History

fix frequent IDR issue when smaller level is set

Karina committed 9 years ago

Commit fdcecde1 parent 297e0431 file · +16 −13Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+16−13
@@ -4238,19 +4238,6 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 4237 unmodified lines
42384238
42394239 break;
42404240 }
4241− if (pOldParam->sSpatialLayers[iIndexD].uiProfileIdc !=
4242− pNewParam->sSpatialLayers[iIndexD].uiProfileIdc
4243− ||
4244− pOldParam->sSpatialLayers[iIndexD].uiLevelIdc !=
4245− pNewParam->sSpatialLayers[iIndexD].uiLevelIdc) {
4246− bNeedReset = true;
4247− WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO,
4248− "WelsEncoderParamAdjust(),iIndexD = %d,uiProfileIdc(%d,%d),uiLevelIdc(%d,%d)", iIndexD,
4249− pOldParam->sSpatialLayers[iIndexD].uiProfileIdc, pNewParam->sSpatialLayers[iIndexD].uiProfileIdc,
4250− pOldParam->sSpatialLayers[iIndexD].uiLevelIdc, pNewParam->sSpatialLayers[iIndexD].uiLevelIdc);
4251−
4252− break;
4253− }
42544241
42554242 // check frame rate
42564243 // we can not check whether corresponding fFrameRate is equal or not,
@@ -4267,6 +4254,22 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 10 unmodified lines
42674254 pOldParam->fMaxFrameRate, pNewParam->fMaxFrameRate);
42684255 break;
42694256 }
4257+ if (pOldParam->sSpatialLayers[iIndexD].uiProfileIdc != pNewParam->sSpatialLayers[iIndexD].uiProfileIdc) {
4258+ bNeedReset = true;
4259+ WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO,
4260+ "WelsEncoderParamAdjust(),iIndexD = %d,uiProfileIdc(%d,%d)", iIndexD,
4261+ pOldParam->sSpatialLayers[iIndexD].uiProfileIdc, pNewParam->sSpatialLayers[iIndexD].uiProfileIdc);
4262+ break;
4263+ }
4264+ //check level change,if new level is smaller than old level,don't reset encoder. still use old level.
4265+
4266+ if (pNewParam->sSpatialLayers[iIndexD].uiLevelIdc > pOldParam->sSpatialLayers[iIndexD].uiLevelIdc) {
4267+ bNeedReset = true;
4268+ WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO,
4269+ "WelsEncoderParamAdjust(),iIndexD = %d,uiLevelIdc(%d,%d)", iIndexD,
4270+ pOldParam->sSpatialLayers[iIndexD].uiLevelIdc, pNewParam->sSpatialLayers[iIndexD].uiLevelIdc);
4271+ break;
4272+ }
42704273 ++ iIndexD;
42714274 } while (iIndexD < pOldParam->iSpatialLayerNum);
42724275 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t