History

using function pointer to make different branch for different rc

ruil2 committed 11 years ago

Commit e3bf63d1 parent c1752e26 files · +7719 −7688Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+13−8
@@ -3101,8 +3101,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 3100 unmodified lines
3101 // perform csc/denoise/downsample/padding, generate spatial layers3101 // perform csc/denoise/downsample/padding, generate spatial layers
3102 iSpatialNum = pCtx->pVpp->BuildSpatialPicList (pCtx, pSrcPic);3102 iSpatialNum = pCtx->pVpp->BuildSpatialPicList (pCtx, pSrcPic);
3103 3103
3104 if (pCtx->pSvcParam->bEnableFrameSkip) {3104 if (pCtx->pFuncList->pfRc.pfWelsUpdateMaxBrWindowStatus) {
3105 UpdateMaxBrCheckWindowStatus (pCtx, iSpatialNum, pSrcPic->uiTimeStamp);3105 pCtx->pFuncList->pfRc.pfWelsUpdateMaxBrWindowStatus (pCtx, iSpatialNum, pSrcPic->uiTimeStamp);
3106 }3106 }
3107 3107
3108 if (iSpatialNum < 1) { // skip due to temporal layer settings (different frame rate)3108 if (iSpatialNum < 1) { // skip due to temporal layer settings (different frame rate)
@@ -3115,7 +3115,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 6 unmodified lines
3115 3115
3116 eFrameType = DecideFrameType (pCtx, iSpatialNum);3116 eFrameType = DecideFrameType (pCtx, iSpatialNum);
3117 if (eFrameType == videoFrameTypeSkip) {3117 if (eFrameType == videoFrameTypeSkip) {
3118 UpdateBufferWhenFrameSkipped (pCtx, iSpatialNum);3118 if (pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip)
3119 pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip (pCtx, iSpatialNum);
3119 pFbi->eFrameType = eFrameType;3120 pFbi->eFrameType = eFrameType;
3120 WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld, skip one frame, continual skipped %d frames",3121 WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld, skip one frame, continual skipped %d frames",
3121 pSrcPic->uiTimeStamp, pCtx->iContinualSkipFrames);3122 pSrcPic->uiTimeStamp, pCtx->iContinualSkipFrames);
@@ -3123,11 +3124,15 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 1 unmodified line
3123 }3124 }
3124 3125
3125 //loop each layer to check if have skip frame when RC and frame skip enable3126 //loop each layer to check if have skip frame when RC and frame skip enable
3126 if (CheckFrameSkipBasedMaxbr (pCtx, iSpatialNum, eFrameType, (uint32_t)pSrcPic->uiTimeStamp)) {3127 if (pCtx->pFuncList->pfRc.pfWelsCheckSkipBasedMaxbr) {
3127 pFbi->eFrameType = videoFrameTypeSkip;3128 bool bSkip = pCtx->pFuncList->pfRc.pfWelsCheckSkipBasedMaxbr (pCtx, iSpatialNum, eFrameType,
3128 WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld, skip one frame, continual skipped %d frames",3129 (uint32_t)pSrcPic->uiTimeStamp);
3129 pSrcPic->uiTimeStamp, pCtx->iContinualSkipFrames);3130 if (bSkip) {
3130 return ENC_RETURN_SUCCESS;3131 pFbi->eFrameType = videoFrameTypeSkip;
3132 WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld, skip one frame, continual skipped %d frames",
3133 pSrcPic->uiTimeStamp, pCtx->iContinualSkipFrames);
3134 return ENC_RETURN_SUCCESS;
3135 }
3131 }3136 }
3132 3137
3133 pCtx->iContinualSkipFrames = 0;3138 pCtx->iContinualSkipFrames = 0;

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