Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 4 files). Show all
Unified · Split
| @@ -3455,14 +3455,13 @@ EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsIn · 3454 unmodified lines | |||
| 3455 | 3455 | ||
| 3456 | bool bSkipFrameFlag = WelsRcCheckFrameStatus (pCtx,uiTimeStamp,iSpatialNum); | 3456 | bool bSkipFrameFlag = WelsRcCheckFrameStatus (pCtx,uiTimeStamp,iSpatialNum); |
| 3457 | EVideoFrameType eFrameType = DecideFrameType (pCtx, iSpatialNum, iCurDid, bSkipFrameFlag); | 3457 | EVideoFrameType eFrameType = DecideFrameType (pCtx, iSpatialNum, iCurDid, bSkipFrameFlag); |
| 3458 | |||
| 3459 | if (eFrameType == videoFrameTypeSkip) { | 3458 | if (eFrameType == videoFrameTypeSkip) { |
| 3460 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, | ||
| 3461 | "[Rc] Frame timestamp = %lld, skip one frame due to target_br, continual skipped %d frames", | ||
| 3462 | uiTimeStamp, pCtx->iContinualSkipFrames); | ||
| 3463 | if (pSvcParam->bSimulcastAVC) { | 3459 | if (pSvcParam->bSimulcastAVC) { |
| 3464 | if (pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip) | 3460 | if (pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip) |
| 3465 | pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip (pCtx, iCurDid); | 3461 | pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip (pCtx, iCurDid); |
| 3462 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, | ||
| 3463 | "[Rc] Frame timestamp = %lld, iDid = %d,skip one frame due to target_br, continual skipped %d frames", | ||
| 3464 | uiTimeStamp, iCurDid, pCtx->pWelsSvcRc[iCurDid].iContinualSkipFrames); | ||
| 3466 | } | 3465 | } |
| 3467 | 3466 | ||
| 3468 | else { | 3467 | else { |
| @@ -3471,11 +3470,14 @@ EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsIn · 2 unmodified lines | |||
| 3471 | pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip (pCtx, (pSpatialIndexMap + i)->iDid); | 3470 | pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip (pCtx, (pSpatialIndexMap + i)->iDid); |
| 3472 | } | 3471 | } |
| 3473 | } | 3472 | } |
| 3473 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, | ||
| 3474 | "[Rc] Frame timestamp = %lld, iDid = %d,skip one frame due to target_br, continual skipped %d frames", | ||
| 3475 | uiTimeStamp, pSpatialIndexMap->iDid, pCtx->pWelsSvcRc[pSpatialIndexMap->iDid].iContinualSkipFrames); | ||
| 3474 | } | 3476 | } |
| 3475 | 3477 | ||
| 3476 | } else { | 3478 | } else { |
| 3477 | SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[iCurDid]; | 3479 | SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[iCurDid]; |
| 3478 | pCtx->iContinualSkipFrames = 0; | 3480 | |
| 3479 | iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[iCurDid], pParamInternal->iCodingIndex, | 3481 | iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[iCurDid], pParamInternal->iCodingIndex, |
| 3480 | pSvcParam->uiGopSize); | 3482 | pSvcParam->uiGopSize); |
| 3481 | pCtx->uiTemporalId = iCurTid; | 3483 | pCtx->uiTemporalId = iCurTid; |
| @@ -3500,10 +3502,12 @@ EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsIn · 18 unmodified lines | |||
| 3500 | for (int32_t i = 0; i < pSvcParam->iSpatialLayerNum; i++) { | 3502 | for (int32_t i = 0; i < pSvcParam->iSpatialLayerNum; i++) { |
| 3501 | SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[i]; | 3503 | SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[i]; |
| 3502 | pParamInternal->iCodingIndex ++; | 3504 | pParamInternal->iCodingIndex ++; |
| 3505 | pCtx->pWelsSvcRc[i].iContinualSkipFrames = 0; | ||
| 3503 | } | 3506 | } |
| 3504 | } else { | 3507 | } else { |
| 3505 | SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[iCurDid]; | 3508 | SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[iCurDid]; |
| 3506 | pParamInternal->iCodingIndex++; | 3509 | pParamInternal->iCodingIndex++; |
| 3510 | pCtx->pWelsSvcRc[iCurDid].iContinualSkipFrames = 0; | ||
| 3507 | } | 3511 | } |
| 3508 | } | 3512 | } |
| 3509 | return eFrameType; | 3513 | return eFrameType; |
| @@ -3575,8 +3579,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 65 unmodified lines | |||
| 3575 | pFbi->eFrameType = videoFrameTypeSkip; | 3579 | pFbi->eFrameType = videoFrameTypeSkip; |
| 3576 | pLayerBsInfo->eFrameType = videoFrameTypeSkip; | 3580 | pLayerBsInfo->eFrameType = videoFrameTypeSkip; |
| 3577 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, | 3581 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, |
| 3578 | "[Rc] Frame timestamp = %lld, skip one frame due to preprocessing return (temporal layer settings or else), continual skipped %d frames", | 3582 | "[Rc] Frame timestamp = %lld, skip one frame due to preprocessing return (temporal layer settings or else)", |
| 3579 | pSrcPic->uiTimeStamp, pCtx->iContinualSkipFrames); | 3583 | pSrcPic->uiTimeStamp); |
| 3580 | return ENC_RETURN_SUCCESS; | 3584 | return ENC_RETURN_SUCCESS; |
| 3581 | } | 3585 | } |
| 3582 | 3586 | ||
| @@ -3935,9 +3939,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 352 unmodified lines | |||
| 3935 | } | 3939 | } |
| 3936 | 3940 | ||
| 3937 | WelsRcPostFrameSkippedUpdate (pCtx, iCurDid); | 3941 | WelsRcPostFrameSkippedUpdate (pCtx, iCurDid); |
| 3938 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_INFO, | ||
| 3939 | "[Rc] Frame timestamp = %lld, skip one frame due to post skip, continual skipped %d frames", | ||
| 3940 | pFbi->uiTimeStamp, pCtx->iContinualSkipFrames); | ||
| 3941 | pCtx->iEncoderError = ENC_RETURN_SUCCESS; | 3942 | pCtx->iEncoderError = ENC_RETURN_SUCCESS; |
| 3942 | return ENC_RETURN_SUCCESS; | 3943 | return ENC_RETURN_SUCCESS; |
| 3943 | } | 3944 | } |