History

Squashed commit of the following:

commit 9c95d6a0b10d2e40cb5003934ccc98af6330dfcb Author: JuannyWang <hongjwan@cisco.com> Date: Thu Jun 19 10:43:15 2014 +0800 [delay skip] delay skip to relieve bitrate burst somehow

JuannyWang committed 12 years ago

Commit 45c78f41 parent 37b64fc15 files · +91 −5Browse files

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

Unified · Split

codec/encoder/core/src/ratectl.cpp+20−2
@@ -711,6 +711,22 @@ void RcVBufferCalculationSkip (sWelsEncCtx* pEncCtx) { · 710 unmodified lines
711711 }
712712 }
713713
714+void WelsRcFrameDelayJudge(void* pCtx) {
715+ sWelsEncCtx* pEncCtx = (sWelsEncCtx*)pCtx;
716+ SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
717+ SSpatialLayerConfig* pDLayerParam = &pEncCtx->pSvcParam->sSpatialLayers[pEncCtx->uiDependencyId];
718+ SSpatialLayerInternal* pDLayerParamInternal = &pEncCtx->pSvcParam->sDependencyLayers[pEncCtx->uiDependencyId];
719+
720+ int32_t iSentBits = WELS_ROUND(pDLayerParam->iSpatialBitrate / pDLayerParamInternal->fOutputFrameRate);
721+
722+ pWelsSvcRc->bSkipFlag = false;
723+ if (pWelsSvcRc->iBufferFullnessSkip > pWelsSvcRc->iBufferSizeSkip) {
724+ pWelsSvcRc->bSkipFlag = true;
725+ pWelsSvcRc->iBufferFullnessSkip -= iSentBits;
726+ pWelsSvcRc->iBufferFullnessSkip = WELS_MAX(pWelsSvcRc->iBufferFullnessSkip, 0);
727+ }
728+}
729+
714730 void RcVBufferCalculationPadding (sWelsEncCtx* pEncCtx) {
715731 SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
716732 const int32_t kiOutputBits = WELS_DIV_ROUND(pWelsSvcRc->iBitsPerFrame, INT_MULTIPLY);
@@ -862,8 +878,8 @@ void WelsRcPictureInfoUpdateGom (void* pCtx, int32_t layer_size) { · 145 unmodified lines
862878 #endif
863879
864880
865− if (pEncCtx->pSvcParam->bEnableFrameSkip &&
866− pEncCtx->uiDependencyId == pEncCtx->pSvcParam->iSpatialLayerNum - 1) {
881+ if (pEncCtx->pSvcParam->bEnableFrameSkip /*&&
882+ pEncCtx->uiDependencyId == pEncCtx->pSvcParam->iSpatialLayerNum - 1*/) {
867883 RcVBufferCalculationSkip (pEncCtx);
868884 }
869885
@@ -976,6 +992,7 @@ void WelsRcInitModule (void* pCtx, int32_t iModule) { · 106 unmodified lines
976992 switch (iModule) {
977993 case WELS_RC_DISABLE:
978994 pRcf->pfWelsRcPictureInit = WelsRcPictureInitDisable;
995+ pRcf->pfWelsRcPicDelayJudge = NULL;
979996 pRcf->pfWelsRcPictureInfoUpdate = WelsRcPictureInfoUpdateDisable;
980997 pRcf->pfWelsRcMbInit = WelsRcMbInitDisable;
981998 pRcf->pfWelsRcMbInfoUpdate = WelsRcMbInfoUpdateDisable;
@@ -983,6 +1000,7 @@ void WelsRcInitModule (void* pCtx, int32_t iModule) { · 1 unmodified line
9831000 case WELS_RC_GOM:
9841001 default:
9851002 pRcf->pfWelsRcPictureInit = WelsRcPictureInitGom;
1003+ pRcf->pfWelsRcPicDelayJudge = WelsRcFrameDelayJudge;
9861004 pRcf->pfWelsRcPictureInfoUpdate = WelsRcPictureInfoUpdateGom;
9871005 pRcf->pfWelsRcMbInit = WelsRcMbInitGom;
9881006 pRcf->pfWelsRcMbInfoUpdate = WelsRcMbInfoUpdateGom;

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