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