Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 6 files). Show all
Unified · Split
| @@ -3101,8 +3101,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 3100 unmodified lines | ||
| 3101 | 3101 | // perform csc/denoise/downsample/padding, generate spatial layers |
| 3102 | 3102 | iSpatialNum = pCtx->pVpp->BuildSpatialPicList (pCtx, pSrcPic); |
| 3103 | 3103 | |
| 3104 | − if (pCtx->pSvcParam->bEnableFrameSkip) { | |
| 3105 | − UpdateMaxBrCheckWindowStatus (pCtx, iSpatialNum, pSrcPic->uiTimeStamp); | |
| 3104 | + if (pCtx->pFuncList->pfRc.pfWelsUpdateMaxBrWindowStatus) { | |
| 3105 | + pCtx->pFuncList->pfRc.pfWelsUpdateMaxBrWindowStatus (pCtx, iSpatialNum, pSrcPic->uiTimeStamp); | |
| 3106 | 3106 | } |
| 3107 | 3107 | |
| 3108 | 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 | 3116 | eFrameType = DecideFrameType (pCtx, iSpatialNum); |
| 3117 | 3117 | if (eFrameType == videoFrameTypeSkip) { |
| 3118 | − UpdateBufferWhenFrameSkipped (pCtx, iSpatialNum); | |
| 3118 | + if (pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip) | |
| 3119 | + pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip (pCtx, iSpatialNum); | |
| 3119 | 3120 | pFbi->eFrameType = eFrameType; |
| 3120 | 3121 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld, skip one frame, continual skipped %d frames", |
| 3121 | 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 | 3126 | //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 | − pFbi->eFrameType = videoFrameTypeSkip; | |
| 3128 | − WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld, skip one frame, continual skipped %d frames", | |
| 3129 | − pSrcPic->uiTimeStamp, pCtx->iContinualSkipFrames); | |
| 3130 | − return ENC_RETURN_SUCCESS; | |
| 3127 | + if (pCtx->pFuncList->pfRc.pfWelsCheckSkipBasedMaxbr) { | |
| 3128 | + bool bSkip = pCtx->pFuncList->pfRc.pfWelsCheckSkipBasedMaxbr (pCtx, iSpatialNum, eFrameType, | |
| 3129 | + (uint32_t)pSrcPic->uiTimeStamp); | |
| 3130 | + if (bSkip) { | |
| 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 | 3138 | pCtx->iContinualSkipFrames = 0; |