Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 4 files). Show all
Unified · Split
| @@ -325,7 +325,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 324 unmodified lines | ||
| 325 | 325 | if (pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT) { |
| 326 | 326 | pCfg->iNumRefFrame = ((pCfg->uiGopSize >> 1) > 1) ? ((pCfg->uiGopSize >> 1) + pCfg->iLTRRefNum) : |
| 327 | 327 | (MIN_REF_PIC_COUNT + pCfg->iLTRRefNum); |
| 328 | − pCfg->iNumRefFrame = WELS_CLIP3 (pCfg->iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM); | |
| 328 | + pCfg->iNumRefFrame = WELS_CLIP3 (pCfg->iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA); | |
| 329 | 329 | } |
| 330 | 330 | } |
| 331 | 331 | if (pCfg->iNumRefFrame > pCfg->iMaxNumRefFrame) |
| @@ -519,8 +519,9 @@ void CWelsH264SVCEncoder::CheckLevelSetting (int32_t iLayer, ELevelIdc uiLevelId · 187 unmodified lines | ||
| 519 | 519 | } |
| 520 | 520 | } |
| 521 | 521 | void CWelsH264SVCEncoder::CheckReferenceNumSetting (int32_t iNumRef) { |
| 522 | + int32_t iRefUpperBound = (m_pEncContext->pSvcParam->iUsageType == CAMERA_VIDEO_REAL_TIME)?MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA:MAX_REFERENCE_PICTURE_COUNT_NUM_SCREEN; | |
| 522 | 523 | m_pEncContext->pSvcParam->iNumRefFrame = iNumRef; |
| 523 | − if ((iNumRef < MIN_REF_PIC_COUNT) || (iNumRef > MAX_REFERENCE_PICTURE_COUNT_NUM)) { | |
| 524 | + if ((iNumRef < MIN_REF_PIC_COUNT) || (iNumRef > iRefUpperBound)) { | |
| 524 | 525 | m_pEncContext->pSvcParam->iNumRefFrame = AUTO_REF_PIC_COUNT; |
| 525 | 526 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, |
| 526 | 527 | "doesn't support the number of reference frame(%d) change to auto select mode", iNumRef); |