fix the issue that long term reference frame is disable for screen

This commit is contained in:
ruil2 2014-04-29 17:24:22 +08:00
parent 2006efc1e0
commit 2508cf925f
4 changed files with 4 additions and 3 deletions

View File

@ -369,8 +369,9 @@ int32_t ParamTranscode (const SEncParamExt& pCodingParam) {
iNumRefFrame = WELS_MAX(1, WELS_LOG2 (uiGopSize)) + iLTRRefNum;
} else {
iLTRRefNum = 0;
if( iNumRefFrame == AUTO_REF_PIC_COUNT)
iNumRefFrame = 1;
iNumRefFrame = WELS_MAX(1, uiGopSize>>1);
}
} else {
iLTRRefNum = bEnableLongTermReference ? WELS_CLIP3(pCodingParam.iLTRRefNum,1,LONG_TERM_REF_NUM) : 0;

View File

@ -292,7 +292,6 @@ EVideoFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum
} else {
bSceneChangeFlag = pEncCtx->pVaa->bSceneChangeFlag;
}
pEncCtx->bCurFrameMarkedAsSceneLtr = false;
if (pEncCtx->pVaa->bIdrPeriodFlag || pEncCtx->bEncCurFrmAsIdrFlag || (!pSvcParam->bEnableLongTermReference
&& bSceneChangeFlag)) {
iFrameType = videoFrameTypeIDR;

View File

@ -2867,6 +2867,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
#endif//_DEBUG
pCtx->iEncoderError = ENC_RETURN_SUCCESS;
pCtx->bCurFrameMarkedAsSceneLtr = false;
pFbi->iLayerNum = 0; // for initialization
pFbi->uiTimeStamp = pSrcPic->uiTimeStamp;
// perform csc/denoise/downsample/padding, generate spatial layers

View File

@ -350,7 +350,7 @@ int CWelsH264SVCEncoder::InitializeInternal(SWelsSvcCodingParam* pCfg) {
pCfg->iNumRefFrame = WELS_MAX(1,WELS_LOG2 (pCfg->uiGopSize)) + pCfg->iLTRRefNum;
} else {
pCfg->iLTRRefNum = 0;
pCfg->iNumRefFrame = 1;
pCfg->iNumRefFrame = WELS_MAX(1, pCfg->uiGopSize>>1);
}
} else {
pCfg->iLTRRefNum = pCfg->bEnableLongTermReference ? WELS_CLIP3(pCfg->iLTRRefNum,1,LONG_TERM_REF_NUM) : 0;