History

fix rc initialize bug

ganyang committed 12 years ago

Commit 22342641 parent 6613de72 files · +9 −3Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+6−0
@@ -3789,9 +3789,15 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 3788 unmodified lines
37893789 memcpy (pSlcingOverRc, pCtx->pWelsSvcRc->pSlicingOverRc, sizeof (SRCSlicing) * iMaxSliceNumOld);
37903790 uiSliceIdx = iMaxSliceNumOld;
37913791 SRCSlicing* pSORC = &pSlcingOverRc[uiSliceIdx];
3792+ const int32_t kiBitsPerMb = WELS_DIV_ROUND(pCtx->pWelsSvcRc->iTargetBits * INT_MULTIPLY, pCtx->pWelsSvcRc->iNumberMbFrame);
37923793 while (uiSliceIdx < iMaxSliceNum) {
37933794 pSORC->iComplexityIndexSlice = 0;
37943795 pSORC->iCalculatedQpSlice = pCtx->iGlobalQp;
3796+ pSORC->iTotalQpSlice = 0;
3797+ pSORC->iTotalMbSlice = 0;
3798+ pSORC->iTargetBitsSlice = WELS_DIV_ROUND(kiBitsPerMb * pCurLayer->pSliceEncCtx->pCountMbNumInSlice[uiSliceIdx], INT_MULTIPLY);
3799+ pSORC->iFrameBitsSlice = 0;
3800+ pSORC->iGomBitsSlice = 0;
37953801 pSORC ++;
37963802 uiSliceIdx ++;
37973803 }

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