ref: 4746ce8fd4929b2f99031d9184a4517676d6eec9
parent: 9692f6cb20d2f29d2cabd4f0c142e26cd041fa6f
author: Martin Storsjö <martin@martin.st>
date: Tue Dec 16 08:56:50 EST 2014
If lowering the maximum number of ref frames, check iNumRefFrames as well Make sure we don't set iMaxNumRefFrames lower than iNumRefFrames. This fixes occasional test failures in EncodeDecodeTestAPI.SetOptionEncParamExt.
--- a/codec/encoder/core/src/au_set.cpp
+++ b/codec/encoder/core/src/au_set.cpp
@@ -98,8 +98,11 @@
WelsLog (pLogCtx, WELS_LOG_WARNING, "change level to level5.0");
}
iRefFrame = g_ksLevelLimits[pSpatialLayer->uiLevelIdc - 1].uiMaxDPBMbs / uiPicInMBs;
- if (iRefFrame < pParam->iMaxNumRefFrame)
+ if (iRefFrame < pParam->iMaxNumRefFrame) {
pParam->iMaxNumRefFrame = iRefFrame;
+ if (pParam->iMaxNumRefFrame < pParam->iNumRefFrame)
+ pParam->iNumRefFrame = pParam->iMaxNumRefFrame;
+ }
if (pParam->iMaxNumRefFrame < 1) {
pParam->iMaxNumRefFrame = 1;
WelsLog (pLogCtx, WELS_LOG_ERROR, "error Level setting (%d)", pSpatialLayer->uiLevelIdc);