Skip to content

Commit ec3a21c

Browse files
committed
Improve the performance
Increase the number of concurrent to improve the performance. Tracked-On: OAM-134135 Signed-off-by: chenyanxzhu <chenyanx.zhu@intel.com> Signed-off-by: Zhang, YichiX <yichix.zhang@intel.com>
1 parent fb1095e commit ec3a21c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

c2_components/src/mfx_c2_decoder_component.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ mfxU16 MfxC2DecoderComponent::GetAsyncDepth(void)
11401140
if (MFX_CODEC_AV1 == m_mfxVideoParams.mfx.CodecId)
11411141
asyncDepth = (MFX_IMPL_BASETYPE(m_mfxImplementation) == MFX_IMPL_SOFTWARE) ? 0 : 10;
11421142
else
1143-
asyncDepth = (MFX_IMPL_BASETYPE(m_mfxImplementation) == MFX_IMPL_SOFTWARE) ? 0 : 1;
1143+
asyncDepth = (MFX_IMPL_BASETYPE(m_mfxImplementation) == MFX_IMPL_SOFTWARE) ? 0 : 2;
11441144
#else
11451145
if ((MFX_IMPL_HARDWARE == MFX_IMPL_BASETYPE(m_mfxImplementation)) &&
11461146
((MFX_CODEC_AVC == m_mfxVideoParams.mfx.CodecId) ||

c2_components/src/mfx_c2_encoder_component.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,8 @@ mfxStatus MfxC2EncoderComponent::ResetSettings()
10661066
m_mfxVideoParamsConfig.mfx.LowPower = MFX_CODINGOPTION_ON;
10671067
}
10681068

1069+
m_mfxVideoParamsConfig.AsyncDepth = 2;
1070+
10691071
MFX_DEBUG_TRACE__mfxStatus(mfx_res);
10701072
return mfx_res;
10711073
}
@@ -1649,7 +1651,13 @@ void MfxC2EncoderComponent::DoWork(std::unique_ptr<C2Work>&& work)
16491651
}
16501652
}
16511653

1652-
if(MFX_ERR_MORE_DATA == mfx_sts) mfx_sts = MFX_ERR_NONE;
1654+
if(MFX_ERR_MORE_DATA == mfx_sts)
1655+
{
1656+
// It may get stuck at the last few frames while processing concurrently.
1657+
if (m_mfxVideoParamsConfig.AsyncDepth > 1)
1658+
m_workingQueue.Push( [this] () { Drain(nullptr); } );
1659+
mfx_sts = MFX_ERR_NONE;
1660+
}
16531661

16541662
} while(false); // fake loop to have a cleanup point there
16551663

0 commit comments

Comments
 (0)