History

refine RC

Karina committed 10 years ago

Commit 4fc2b1f1 parent 1d2b52e9 files · +4704 −4709Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+3−25
@@ -1163,7 +1163,6 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 1162 unmodified lines
11631163 const int32_t kiMbW = (pDlayer->iVideoWidth + 0x0f) >> 4;
11641164 const int32_t kiMbH = (pDlayer->iVideoHeight + 0x0f) >> 4;
11651165
1166− pParamInternal->iSkipFrameFlag = 0;
11671166 pParamInternal->iCodingIndex = 0;
11681167 pParamInternal->iFrameIndex = 0;
11691168 pParamInternal->iFrameNum = 0;
@@ -3144,7 +3143,6 @@ int32_t ForceCodingIDR (sWelsEncCtx* pCtx) { · 1974 unmodified lines
31443143 for (int32_t iDid = 0; iDid < pCtx->pSvcParam->iSpatialLayerNum; iDid++) {
31453144 SSpatialLayerInternal* pParamInternal = &pCtx->pSvcParam->sDependencyLayers[iDid];
31463145 pParamInternal->iCodingIndex = 0;
3147− pParamInternal->iSkipFrameFlag = 0;
31483146 pParamInternal->iFrameIndex = 0;
31493147 pParamInternal->iFrameNum = 0;
31503148 pParamInternal->iPOC = 0;
@@ -3454,14 +3452,9 @@ EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsIn · 303 unmodified lines
34543452 int32_t& iLayerNum, int32_t& iFrameSize, long long uiTimeStamp) {
34553453 SWelsSvcCodingParam* pSvcParam = pCtx->pSvcParam;
34563454 SSpatialPicIndex* pSpatialIndexMap = &pCtx->sSpatialIndexMap[0];
3457− if (!pSvcParam->bSimulcastAVC) {
3458− pCtx->iSkipFrameFlag = false;
3459− for (int32_t iDid = 0; iDid < iSpatialNum; iDid++) {
3460− if (pCtx->pSvcParam->sDependencyLayers[ (pSpatialIndexMap + iDid)->iDid].iSkipFrameFlag)
3461− pCtx->iSkipFrameFlag = 1;
3462− }
3463− }
3464− EVideoFrameType eFrameType = DecideFrameType (pCtx, iSpatialNum, iCurDid);
3455+
3456+ bool bSkipFrameFlag = WelsRcCheckFrameStatus (pCtx,uiTimeStamp,iSpatialNum);
3457+ EVideoFrameType eFrameType = DecideFrameType (pCtx, iSpatialNum, iCurDid, bSkipFrameFlag);
34653458
34663459 if (eFrameType == videoFrameTypeSkip) {
34673460 WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,
@@ -3475,27 +3468,12 @@ EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsIn · 7 unmodified lines
34753468 else {
34763469 if (pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip) {
34773470 for (int32_t i = 0; i < iSpatialNum; i++) {
3478− pCtx->pSvcParam->sDependencyLayers[i].iSkipFrameFlag = false;
34793471 pCtx->pFuncList->pfRc.pfWelsUpdateBufferWhenSkip (pCtx, (pSpatialIndexMap + i)->iDid);
34803472 }
34813473 }
34823474 }
34833475
34843476 } else {
3485− if (pCtx->pFuncList->pfRc.pfWelsCheckSkipBasedMaxbr) {
3486− bool bSkip = pCtx->pFuncList->pfRc.pfWelsCheckSkipBasedMaxbr (pCtx, iSpatialNum, eFrameType,
3487− (uint32_t)uiTimeStamp);
3488− if (bSkip) {
3489− eFrameType = videoFrameTypeSkip;
3490− pLayerBsInfo->eFrameType = videoFrameTypeSkip;
3491− WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,
3492− "[Rc] Frame timestamp = %lld, skip one frame due to max_br, continual skipped %d frames",
3493− uiTimeStamp, pCtx->iContinualSkipFrames);
3494− }
3495− }
3496− }
3497−
3498− if (eFrameType != videoFrameTypeSkip) {
34993477 SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[iCurDid];
35003478 pCtx->iContinualSkipFrames = 0;
35013479 iCurTid = GetTemporalLevel (&pSvcParam->sDependencyLayers[iCurDid], pParamInternal->iCodingIndex,

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