shithub: openh264

Download patch

ref: c29da290b9ef745749e692b7aba4025cd7c33115
parent: df77a5d587eca1d8667b9513531c70cb5aafaa3a
parent: 64ad70b0eaa1b52b8266969b227acc2f80f1694e
author: sijchen <[email protected]>
date: Tue May 31 06:58:38 EDT 2016

Merge pull request #2479 from ruil2/refine_rc1

get the correct did for savc case

--- a/codec/encoder/core/inc/rc.h
+++ b/codec/encoder/core/inc/rc.h
@@ -269,7 +269,7 @@
 void WelsRcInitModule (sWelsEncCtx* pCtx, RC_MODES iRcMode);
 void WelsRcInitFuncPointers (sWelsEncCtx* pEncCtx, RC_MODES iRcMode);
 void WelsRcFreeMemory (sWelsEncCtx* pCtx);
-bool WelsRcCheckFrameStatus (sWelsEncCtx* pEncCtx,long long uiTimeStamp,int32_t iSpatialNum);
+bool WelsRcCheckFrameStatus (sWelsEncCtx* pEncCtx,long long uiTimeStamp,int32_t iSpatialNum,int32_t iCurDid);
 bool WelsUpdateSkipFrameStatus();
 long long GetTimestampForRc(const long long uiTimeStamp, const long long uiLastTimeStamp, const float fFrameRate);
 
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -3453,7 +3453,7 @@
   SWelsSvcCodingParam* pSvcParam        = pCtx->pSvcParam;
   SSpatialPicIndex* pSpatialIndexMap = &pCtx->sSpatialIndexMap[0];
 
-  bool bSkipFrameFlag =  WelsRcCheckFrameStatus (pCtx,uiTimeStamp,iSpatialNum);
+  bool bSkipFrameFlag =  WelsRcCheckFrameStatus (pCtx,uiTimeStamp,iSpatialNum,iCurDid);
   EVideoFrameType eFrameType = DecideFrameType (pCtx, iSpatialNum, iCurDid, bSkipFrameFlag);
 
   if (eFrameType == videoFrameTypeSkip) {
--- a/codec/encoder/core/src/ratectl.cpp
+++ b/codec/encoder/core/src/ratectl.cpp
@@ -768,7 +768,7 @@
   }
 }
 
-bool WelsRcCheckFrameStatus (sWelsEncCtx* pEncCtx, long long uiTimeStamp, int32_t iSpatialNum) {
+bool WelsRcCheckFrameStatus (sWelsEncCtx* pEncCtx, long long uiTimeStamp, int32_t iSpatialNum,int32_t iCurDid) {
 
   bool bSkipMustFlag = false;
 
@@ -777,7 +777,7 @@
   //simul_cast AVC control
   if (pEncCtx->pSvcParam->bSimulcastAVC) {
     //check target_br skip and update info
-    int32_t iDidIdx = pSpatialIndexMap->iDid;
+    int32_t iDidIdx = iCurDid;
     if (pEncCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge) {
       pEncCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge (pEncCtx, uiTimeStamp, iDidIdx);
     }