Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 2 files). Show all
Unified · Split
| @@ -3789,9 +3789,15 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 3788 unmodified lines | ||
| 3789 | 3789 | memcpy (pSlcingOverRc, pCtx->pWelsSvcRc->pSlicingOverRc, sizeof (SRCSlicing) * iMaxSliceNumOld); |
| 3790 | 3790 | uiSliceIdx = iMaxSliceNumOld; |
| 3791 | 3791 | SRCSlicing* pSORC = &pSlcingOverRc[uiSliceIdx]; |
| 3792 | + const int32_t kiBitsPerMb = WELS_DIV_ROUND(pCtx->pWelsSvcRc->iTargetBits * INT_MULTIPLY, pCtx->pWelsSvcRc->iNumberMbFrame); | |
| 3792 | 3793 | while (uiSliceIdx < iMaxSliceNum) { |
| 3793 | 3794 | pSORC->iComplexityIndexSlice = 0; |
| 3794 | 3795 | 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; | |
| 3795 | 3801 | pSORC ++; |
| 3796 | 3802 | uiSliceIdx ++; |
| 3797 | 3803 | } |