Showing the changes to codec/encoder/core/src/ratectl.cpp (1 of 3 files). Show all
Unified · Split
| @@ -707,9 +707,9 @@ void RcVBufferCalculationSkip (sWelsEncCtx* pEncCtx) { · 706 unmodified lines | ||
| 707 | 707 | pDLayerParamInternal->iSkipFrameFlag = 1; |
| 708 | 708 | } |
| 709 | 709 | } |
| 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]; | |
| 713 | 713 | //SSpatialLayerInternal* pDLayerParamInternal = &pEncCtx->pSvcParam->sDependencyLayers[pEncCtx->uiDependencyId]; |
| 714 | 714 | if (!pEncCtx->pSvcParam->bEnableFrameSkip) |
| 715 | 715 | return; |
| @@ -773,14 +773,15 @@ void WelsRcFrameDelayJudge (sWelsEncCtx* pEncCtx, EVideoFrameType eFrameType, lo · 57 unmodified lines | ||
| 773 | 773 | bool CheckFrameSkipBasedMaxbr (sWelsEncCtx* pEncCtx, int32_t iSpatialNum, EVideoFrameType eFrameType, |
| 774 | 774 | const uint32_t uiTimeStamp) { |
| 775 | 775 | bool bSkipMustFlag = false; |
| 776 | + int32_t iDidIdx = pEncCtx->uiDependencyId; | |
| 777 | + SSpatialPicIndex* pSpatialIndexMap = &pEncCtx->sSpatialIndexMap[0]; | |
| 776 | 778 | if (!pEncCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge) |
| 777 | 779 | return false; |
| 778 | 780 | if( pEncCtx->pSvcParam->bSimulcastAVC){ |
| 779 | − int32_t iDidIdx = pEncCtx->uiDependencyId; | |
| 780 | 781 | if (UNSPECIFIED_BIT_RATE == pEncCtx->pSvcParam->sSpatialLayers[iDidIdx].iMaxSpatialBitrate) |
| 781 | 782 | return false; |
| 782 | 783 | |
| 783 | − pEncCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge (pEncCtx, eFrameType, uiTimeStamp); | |
| 784 | + pEncCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge (pEncCtx, eFrameType, uiTimeStamp,iDidIdx); | |
| 784 | 785 | if (true == pEncCtx->pWelsSvcRc[iDidIdx].bSkipFlag) { |
| 785 | 786 | bSkipMustFlag = true; |
| 786 | 787 | pEncCtx->pWelsSvcRc[iDidIdx].uiLastTimeStamp = uiTimeStamp; |
| @@ -790,8 +791,8 @@ bool CheckFrameSkipBasedMaxbr (sWelsEncCtx* pEncCtx, int32_t iSpatialNum, EVideo · 3 unmodified lines | ||
| 790 | 791 | for(int32_t i = 0;i<iSpatialNum;i++){ |
| 791 | 792 | if (UNSPECIFIED_BIT_RATE == pEncCtx->pSvcParam->sSpatialLayers[i].iMaxSpatialBitrate) |
| 792 | 793 | break; |
| 793 | − | |
| 794 | − pEncCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge (pEncCtx, eFrameType, uiTimeStamp); | |
| 794 | + iDidIdx = (pSpatialIndexMap + i)->iDid; | |
| 795 | + pEncCtx->pFuncList->pfRc.pfWelsRcPicDelayJudge (pEncCtx, eFrameType, uiTimeStamp,iDidIdx); | |
| 795 | 796 | if (true == pEncCtx->pWelsSvcRc[i].bSkipFlag) { |
| 796 | 797 | bSkipMustFlag = true; |
| 797 | 798 | pEncCtx->pWelsSvcRc[i].uiLastTimeStamp = uiTimeStamp; |
| @@ -1285,9 +1286,9 @@ void InitRcModuleTimeStamp (sWelsEncCtx* pEncCtx) { · 487 unmodified lines | ||
| 1285 | 1286 | pWelsSvcRc->iAvgCost2Bits = 1; |
| 1286 | 1287 | pWelsSvcRc->iSkipBufferRatio = SKIP_RATIO; |
| 1287 | 1288 | } |
| 1288 | −void WelsRcFrameDelayJudgeTimeStamp (sWelsEncCtx* pEncCtx, EVideoFrameType eFrameType, long long uiTimeStamp) { | |
| 1289 | +void WelsRcFrameDelayJudgeTimeStamp (sWelsEncCtx* pEncCtx, EVideoFrameType eFrameType, long long uiTimeStamp,int32_t iDidIdx) { | |
| 1289 | 1290 | SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId]; |
| 1290 | − SSpatialLayerConfig* pDLayerConfig = &pEncCtx->pSvcParam->sSpatialLayers[pEncCtx->uiDependencyId]; | |
| 1291 | + SSpatialLayerConfig* pDLayerConfig = &pEncCtx->pSvcParam->sSpatialLayers[iDidIdx]; | |
| 1291 | 1292 | |
| 1292 | 1293 | if (pDLayerConfig->iSpatialBitrate > pDLayerConfig->iMaxSpatialBitrate) |
| 1293 | 1294 | pDLayerConfig->iSpatialBitrate = pDLayerConfig->iMaxSpatialBitrate; |