shithub: openh264

Download patch

ref: e1c51e8019062500237409b5c7a85c821ac6108b
parent: 2006efc1e0d0f0cf9a837b33ffb908e59c9a0421
parent: 2508cf925f28e8222b51d58caef6148f7b6766da
author: huili2 <[email protected]>
date: Tue Apr 29 13:39:19 EDT 2014

Merge pull request #769 from ruil2/enc_screen_1

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

--- a/codec/encoder/core/inc/param_svc.h
+++ b/codec/encoder/core/inc/param_svc.h
@@ -369,8 +369,9 @@
         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;
--- a/codec/encoder/core/src/encoder.cpp
+++ b/codec/encoder/core/src/encoder.cpp
@@ -292,7 +292,6 @@
     } else {
       bSceneChangeFlag = pEncCtx->pVaa->bSceneChangeFlag;
     }
-    pEncCtx->bCurFrameMarkedAsSceneLtr   = false;
     if (pEncCtx->pVaa->bIdrPeriodFlag || pEncCtx->bEncCurFrmAsIdrFlag || (!pSvcParam->bEnableLongTermReference
         && bSceneChangeFlag)) {
       iFrameType = videoFrameTypeIDR;
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -2867,6 +2867,7 @@
 #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
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -350,7 +350,7 @@
       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;