History

Multi-thread-fixed:RBC#1689:refactoring for RcCalculateGomQp etc. functions

huade committed 9 years ago

Commit da4dd401 parent f8b60003 files · +13 −14Browse files

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

Unified · Split

codec/encoder/core/src/ratectl.cpp+9−14
@@ -626,10 +626,9 @@ void RcInitGomParameters (sWelsEncCtx* pEncCtx) { · 625 unmodified lines
626626 memset (pWelsSvcRc->pGomCost, 0, pWelsSvcRc->iGomSize * sizeof (int32_t));
627627 }
628628
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) {
631630 SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
632− SRCSlicing* pSOverRc = &ppSliceInLayer[kiSliceId]->sSlicingOverRc;
631+ SRCSlicing* pSOverRc = &pSlice->sSlicingOverRc;
633632
634633 int32_t iLumaQp = pSOverRc->iCalculatedQpSlice;
635634 SDqLayer* pCurLayer = pEncCtx->pCurDqLayer;
@@ -666,11 +665,10 @@ SWelsSvcRc* RcJudgeBaseUsability (sWelsEncCtx* pEncCtx) { · 30 unmodified lines
666665 return NULL;
667666 }
668667
669−void RcGomTargetBits (sWelsEncCtx* pEncCtx, const int32_t kiSliceId) {
670− SSlice** ppSliceInLayer = pEncCtx->pCurDqLayer->ppSliceInLayer;
668+void RcGomTargetBits (sWelsEncCtx* pEncCtx, SSlice* pSlice) {
671669 SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
672670 SWelsSvcRc* pWelsSvcRc_Base = NULL;
673− SRCSlicing* pSOverRc = &ppSliceInLayer[kiSliceId]->sSlicingOverRc;
671+ SRCSlicing* pSOverRc = &pSlice->sSlicingOverRc;
674672
675673 int32_t iAllocateBits = 0;
676674 int32_t iSumSad = 0;
@@ -702,12 +700,9 @@ void RcGomTargetBits (sWelsEncCtx* pEncCtx, const int32_t kiSliceId) { · 25 unmodified lines
702700 pSOverRc->iGomTargetBits = iAllocateBits;
703701 }
704702
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) {
709704 SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
710− SRCSlicing* pSOverRc = &ppSliceInLayer[iSliceId]->sSlicingOverRc;
705+ SRCSlicing* pSOverRc = &pSlice->sSlicingOverRc;
711706 int64_t iBitsRatio = 1;
712707
713708 int64_t iLeftBits = pSOverRc->iTargetBitsSlice - pSOverRc->iFrameBitsSlice;
@@ -1204,12 +1199,12 @@ void WelsRcMbInitGom (sWelsEncCtx* pEncCtx, SMB* pCurMb, SSlice* pSlice) { · 490 unmodified lines
12041199 if (0 == (pCurMb->iMbXY % pWelsSvcRc->iNumberMbGom)) {
12051200 if (pCurMb->iMbXY != pSOverRc->iStartMbSlice) {
12061201 pSOverRc->iComplexityIndexSlice++;
1207− RcCalculateGomQp (pEncCtx, pCurMb, kiSliceId);
1202+ RcCalculateGomQp (pEncCtx, pSlice, pCurMb);
12081203 }
1209− RcGomTargetBits (pEncCtx, kiSliceId);
1204+ RcGomTargetBits (pEncCtx, pSlice);
12101205 }
12111206
1212− RcCalculateMbQp (pEncCtx, pCurMb, kiSliceId);
1207+ RcCalculateMbQp (pEncCtx, pSlice, pCurMb);
12131208 } else {
12141209 pCurMb->uiLumaQp = pEncCtx->iGlobalQp;
12151210 pCurMb->uiChromaQp = g_kuiChromaQpTable[CLIP3_QP_0_51 (pCurMb->uiLumaQp + kuiChromaQpIndexOffset)];

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