Showing the changes to codec/encoder/core/src/ratectl.cpp (1 of 3 files). Show all
Unified · Split
| @@ -626,10 +626,9 @@ void RcInitGomParameters (sWelsEncCtx* pEncCtx) { · 625 unmodified lines | ||
| 626 | 626 | memset (pWelsSvcRc->pGomCost, 0, pWelsSvcRc->iGomSize * sizeof (int32_t)); |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | −void RcCalculateMbQp (sWelsEncCtx* pEncCtx, SMB* pCurMb, const int32_t kiSliceId) { | |
| 630 | − SSlice** ppSliceInLayer = pEncCtx->pCurDqLayer->ppSliceInLayer; | |
| 629 | +void RcCalculateMbQp (sWelsEncCtx* pEncCtx, SSlice* pSlice, SMB* pCurMb) { | |
| 631 | 630 | SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId]; |
| 632 | − SRCSlicing* pSOverRc = &ppSliceInLayer[kiSliceId]->sSlicingOverRc; | |
| 631 | + SRCSlicing* pSOverRc = &pSlice->sSlicingOverRc; | |
| 633 | 632 | |
| 634 | 633 | int32_t iLumaQp = pSOverRc->iCalculatedQpSlice; |
| 635 | 634 | SDqLayer* pCurLayer = pEncCtx->pCurDqLayer; |
| @@ -666,11 +665,10 @@ SWelsSvcRc* RcJudgeBaseUsability (sWelsEncCtx* pEncCtx) { · 30 unmodified lines | ||
| 666 | 665 | return NULL; |
| 667 | 666 | } |
| 668 | 667 | |
| 669 | −void RcGomTargetBits (sWelsEncCtx* pEncCtx, const int32_t kiSliceId) { | |
| 670 | − SSlice** ppSliceInLayer = pEncCtx->pCurDqLayer->ppSliceInLayer; | |
| 668 | +void RcGomTargetBits (sWelsEncCtx* pEncCtx, SSlice* pSlice) { | |
| 671 | 669 | SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId]; |
| 672 | 670 | SWelsSvcRc* pWelsSvcRc_Base = NULL; |
| 673 | − SRCSlicing* pSOverRc = &ppSliceInLayer[kiSliceId]->sSlicingOverRc; | |
| 671 | + SRCSlicing* pSOverRc = &pSlice->sSlicingOverRc; | |
| 674 | 672 | |
| 675 | 673 | int32_t iAllocateBits = 0; |
| 676 | 674 | int32_t iSumSad = 0; |
| @@ -702,12 +700,9 @@ void RcGomTargetBits (sWelsEncCtx* pEncCtx, const int32_t kiSliceId) { · 25 unmodified lines | ||
| 702 | 700 | pSOverRc->iGomTargetBits = iAllocateBits; |
| 703 | 701 | } |
| 704 | 702 | |
| 705 | − | |
| 706 | − | |
| 707 | −void RcCalculateGomQp (sWelsEncCtx* pEncCtx, SMB* pCurMb, int32_t iSliceId) { | |
| 708 | − SSlice** ppSliceInLayer = pEncCtx->pCurDqLayer->ppSliceInLayer; | |
| 703 | +void RcCalculateGomQp (sWelsEncCtx* pEncCtx, SSlice* pSlice, SMB* pCurMb) { | |
| 709 | 704 | SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId]; |
| 710 | − SRCSlicing* pSOverRc = &ppSliceInLayer[iSliceId]->sSlicingOverRc; | |
| 705 | + SRCSlicing* pSOverRc = &pSlice->sSlicingOverRc; | |
| 711 | 706 | int64_t iBitsRatio = 1; |
| 712 | 707 | |
| 713 | 708 | int64_t iLeftBits = pSOverRc->iTargetBitsSlice - pSOverRc->iFrameBitsSlice; |
| @@ -1204,12 +1199,12 @@ void WelsRcMbInitGom (sWelsEncCtx* pEncCtx, SMB* pCurMb, SSlice* pSlice) { · 490 unmodified lines | ||
| 1204 | 1199 | if (0 == (pCurMb->iMbXY % pWelsSvcRc->iNumberMbGom)) { |
| 1205 | 1200 | if (pCurMb->iMbXY != pSOverRc->iStartMbSlice) { |
| 1206 | 1201 | pSOverRc->iComplexityIndexSlice++; |
| 1207 | − RcCalculateGomQp (pEncCtx, pCurMb, kiSliceId); | |
| 1202 | + RcCalculateGomQp (pEncCtx, pSlice, pCurMb); | |
| 1208 | 1203 | } |
| 1209 | − RcGomTargetBits (pEncCtx, kiSliceId); | |
| 1204 | + RcGomTargetBits (pEncCtx, pSlice); | |
| 1210 | 1205 | } |
| 1211 | 1206 | |
| 1212 | − RcCalculateMbQp (pEncCtx, pCurMb, kiSliceId); | |
| 1207 | + RcCalculateMbQp (pEncCtx, pSlice, pCurMb); | |
| 1213 | 1208 | } else { |
| 1214 | 1209 | pCurMb->uiLumaQp = pEncCtx->iGlobalQp; |
| 1215 | 1210 | pCurMb->uiChromaQp = g_kuiChromaQpTable[CLIP3_QP_0_51 (pCurMb->uiLumaQp + kuiChromaQpIndexOffset)]; |