shithub: openh264

Download patch

ref: 64ad70b0eaa1b52b8266969b227acc2f80f1694e
parent: 4fc2b1f636f8df64317df874a0e9b3acbd4e4538
author: Karina <ruil2@cisco.com>
date: Tue May 31 13:35:20 EDT 2016

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);
     }