History

refine the workflow for encode one frame

Karina committed 10 years ago

Commit 7e144001 parent c423a803 files · +119 −95Browse files

Showing the changes to codec/encoder/core/src/ratectl.cpp (1 of 3 files). Show all

Unified · Split

codec/encoder/core/src/ratectl.cpp+10−9
@@ -707,9 +707,9 @@ void RcVBufferCalculationSkip (sWelsEncCtx* pEncCtx) { · 706 unmodified lines
707707 pDLayerParamInternal->iSkipFrameFlag = 1;
708708 }
709709 }
710−void WelsRcFrameDelayJudge (sWelsEncCtx* pEncCtx, EVideoFrameType eFrameType, long long uiTimeStamp) {
711− SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
712− SSpatialLayerConfig* pDLayerParam = &pEncCtx->pSvcParam->sSpatialLayers[pEncCtx->uiDependencyId];
710+void WelsRcFrameDelayJudge (sWelsEncCtx* pEncCtx, EVideoFrameType eFrameType, long long uiTimeStamp,int32_t iDidIdx) {
711+ SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[iDidIdx];
712+ SSpatialLayerConfig* pDLayerParam = &pEncCtx->pSvcParam->sSpatialLayers[iDidIdx];
713713 //SSpatialLayerInternal* pDLayerParamInternal = &pEncCtx->pSvcParam->sDependencyLayers[pEncCtx->uiDependencyId];
714714 if (!pEncCtx->pSvcParam->bEnableFrameSkip)
715715 return;
@@ -773,14 +773,15 @@ void WelsRcFrameDelayJudge (sWelsEncCtx* pEncCtx, EVideoFrameType eFrameType, lo · 57 unmodified lines
773773 bool CheckFrameSkipBasedMaxbr (sWelsEncCtx* pEncCtx, int32_t iSpatialNum, EVideoFrameType eFrameType,
774774 const uint32_t uiTimeStamp) {
775775 bool bSkipMustFlag = false;
776+ int32_t iDidIdx = pEncCtx->uiDependencyId;
777+ SSpatialPicIndex* pSpatialIndexMap = &pEncCtx->sSpatialIndexMap[0];
776778 if (!pEncCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge)
777779 return false;
778780 if( pEncCtx->pSvcParam->bSimulcastAVC){
779− int32_t iDidIdx = pEncCtx->uiDependencyId;
780781 if (UNSPECIFIED_BIT_RATE == pEncCtx->pSvcParam->sSpatialLayers[iDidIdx].iMaxSpatialBitrate)
781782 return false;
782783
783− pEncCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge (pEncCtx, eFrameType, uiTimeStamp);
784+ pEncCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge (pEncCtx, eFrameType, uiTimeStamp,iDidIdx);
784785 if (true == pEncCtx->pWelsSvcRc[iDidIdx].bSkipFlag) {
785786 bSkipMustFlag = true;
786787 pEncCtx->pWelsSvcRc[iDidIdx].uiLastTimeStamp = uiTimeStamp;
@@ -790,8 +791,8 @@ bool CheckFrameSkipBasedMaxbr (sWelsEncCtx* pEncCtx, int32_t iSpatialNum, EVideo · 3 unmodified lines
790791 for(int32_t i = 0;i<iSpatialNum;i++){
791792 if (UNSPECIFIED_BIT_RATE == pEncCtx->pSvcParam->sSpatialLayers[i].iMaxSpatialBitrate)
792793 break;
793−
794− pEncCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge (pEncCtx, eFrameType, uiTimeStamp);
794+ iDidIdx = (pSpatialIndexMap + i)->iDid;
795+ pEncCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge (pEncCtx, eFrameType, uiTimeStamp,iDidIdx);
795796 if (true == pEncCtx->pWelsSvcRc[i].bSkipFlag) {
796797 bSkipMustFlag = true;
797798 pEncCtx->pWelsSvcRc[i].uiLastTimeStamp = uiTimeStamp;
@@ -1285,9 +1286,9 @@ void InitRcModuleTimeStamp (sWelsEncCtx* pEncCtx) { · 487 unmodified lines
12851286 pWelsSvcRc->iAvgCost2Bits = 1;
12861287 pWelsSvcRc->iSkipBufferRatio = SKIP_RATIO;
12871288 }
1288−void WelsRcFrameDelayJudgeTimeStamp (sWelsEncCtx* pEncCtx, EVideoFrameType eFrameType, long long uiTimeStamp) {
1289+void WelsRcFrameDelayJudgeTimeStamp (sWelsEncCtx* pEncCtx, EVideoFrameType eFrameType, long long uiTimeStamp,int32_t iDidIdx) {
12891290 SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
1290− SSpatialLayerConfig* pDLayerConfig = &pEncCtx->pSvcParam->sSpatialLayers[pEncCtx->uiDependencyId];
1291+ SSpatialLayerConfig* pDLayerConfig = &pEncCtx->pSvcParam->sSpatialLayers[iDidIdx];
12911292
12921293 if (pDLayerConfig->iSpatialBitrate > pDLayerConfig->iMaxSpatialBitrate)
12931294 pDLayerConfig->iSpatialBitrate = pDLayerConfig->iMaxSpatialBitrate;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t