History

Merge pull request #2481 from ruil2/maxbitrate1

fix iContinualSkipFrames calculation

HaiboZhu committed 10 years ago

Commit 515eeb42 parents 7ccc377 87e81a74 files · +21 −22Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+11−10
@@ -3455,14 +3455,13 @@ EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsIn · 3454 unmodified lines
34553455
34563456 bool bSkipFrameFlag = WelsRcCheckFrameStatus (pCtx,uiTimeStamp,iSpatialNum,iCurDid);
34573457 EVideoFrameType eFrameType = DecideFrameType (pCtx, iSpatialNum, iCurDid, bSkipFrameFlag);
3458−
34593458 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);
34633459 if (pSvcParam->bSimulcastAVC) {
34643460 if (pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip)
34653461 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);
34663465 }
34673466
34683467 else {
@@ -3471,11 +3470,14 @@ EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsIn · 2 unmodified lines
34713470 pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip (pCtx, (pSpatialIndexMap + i)->iDid);
34723471 }
34733472 }
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, iCurDid, pCtx->pWelsSvcRc[iCurDid].iContinualSkipFrames);
34743476 }
34753477
34763478 } else {
34773479 SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[iCurDid];
3478− pCtx->iContinualSkipFrames = 0;
3480+
34793481 iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[iCurDid], pParamInternal->iCodingIndex,
34803482 pSvcParam->uiGopSize);
34813483 pCtx->uiTemporalId = iCurTid;
@@ -3500,10 +3502,12 @@ EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsIn · 18 unmodified lines
35003502 for (int32_t i = 0; i < pSvcParam->iSpatialLayerNum; i++) {
35013503 SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[i];
35023504 pParamInternal->iCodingIndex ++;
3505+ pCtx->pWelsSvcRc[i].iContinualSkipFrames = 0;
35033506 }
35043507 } else {
35053508 SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[iCurDid];
35063509 pParamInternal->iCodingIndex++;
3510+ pCtx->pWelsSvcRc[iCurDid].iContinualSkipFrames = 0;
35073511 }
35083512 }
35093513 return eFrameType;
@@ -3575,8 +3579,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 65 unmodified lines
35753579 pFbi->eFrameType = videoFrameTypeSkip;
35763580 pLayerBsInfo->eFrameType = videoFrameTypeSkip;
35773581 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",
3579− pSrcPic->uiTimeStamp, pCtx->iContinualSkipFrames);
3582+ "[Rc] Frame timestamp = %lld, skip one frame due to preprocessing return (temporal layer settings or else)",
3583+ pSrcPic->uiTimeStamp);
35803584 return ENC_RETURN_SUCCESS;
35813585 }
35823586
@@ -3935,9 +3939,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 352 unmodified lines
39353939 }
39363940
39373941 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);
39413942 pCtx->iEncoderError = ENC_RETURN_SUCCESS;
39423943 return ENC_RETURN_SUCCESS;
39433944 }

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