Merge pull request #1643 from mstorsjo/check-num-refs

If lowering the maximum number of ref frames, check iNumRefFrames as well
This commit is contained in:
ruil2 2014-12-17 15:51:52 +08:00
commit 58e868c074

View File

@ -98,8 +98,11 @@ int32_t WelsCheckRefFrameLimitation (SLogContext* pLogCtx, SWelsSvcCodingParam*
WelsLog (pLogCtx, WELS_LOG_WARNING, "change level to level5.0"); WelsLog (pLogCtx, WELS_LOG_WARNING, "change level to level5.0");
} }
iRefFrame = g_ksLevelLimits[pSpatialLayer->uiLevelIdc - 1].uiMaxDPBMbs / uiPicInMBs; iRefFrame = g_ksLevelLimits[pSpatialLayer->uiLevelIdc - 1].uiMaxDPBMbs / uiPicInMBs;
if (iRefFrame < pParam->iMaxNumRefFrame) if (iRefFrame < pParam->iMaxNumRefFrame) {
pParam->iMaxNumRefFrame = iRefFrame; pParam->iMaxNumRefFrame = iRefFrame;
if (pParam->iMaxNumRefFrame < pParam->iNumRefFrame)
pParam->iNumRefFrame = pParam->iMaxNumRefFrame;
}
if (pParam->iMaxNumRefFrame < 1) { if (pParam->iMaxNumRefFrame < 1) {
pParam->iMaxNumRefFrame = 1; pParam->iMaxNumRefFrame = 1;
WelsLog (pLogCtx, WELS_LOG_ERROR, "error Level setting (%d)", pSpatialLayer->uiLevelIdc); WelsLog (pLogCtx, WELS_LOG_ERROR, "error Level setting (%d)", pSpatialLayer->uiLevelIdc);