History

Multi-thread-fixed:RBC#1716:refactoring for InitSliceRC

huade committed 9 years ago

Commit 462af171 parent e448da84 files · +6 −11Browse files

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

Unified · Split

codec/encoder/core/src/svc_encode_slice.cpp+5−9
@@ -1127,18 +1127,16 @@ void InitSliceRefInfoWithBase (SSlice* pSlice, SSlice* pBaseSlice, const uint8_t · 1126 unmodified lines
11271127
11281128 }
11291129
1130−static inline int32_t InitSliceRC (SSlice* pSlice, const int32_t kiGlobalQp, const int32_t kiBitsPerMb) {
1130+static inline int32_t InitSliceRC (SSlice* pSlice, const int32_t kiGlobalQp) {
11311131
1132− if (NULL == pSlice || kiGlobalQp < 0 || kiBitsPerMb < 0)
1132+ if (NULL == pSlice || kiGlobalQp < 0)
11331133 return ENC_RETURN_INVALIDINPUT;
11341134
11351135 pSlice->sSlicingOverRc.iComplexityIndexSlice = 0;
11361136 pSlice->sSlicingOverRc.iCalculatedQpSlice = kiGlobalQp;
11371137 pSlice->sSlicingOverRc.iTotalQpSlice = 0;
11381138 pSlice->sSlicingOverRc.iTotalMbSlice = 0;
1139− pSlice->sSlicingOverRc.iTargetBitsSlice = WELS_DIV_ROUND (kiBitsPerMb *
1140− pSlice->iCountMbNumInSlice,
1141− INT_MULTIPLY);
1139+ pSlice->sSlicingOverRc.iTargetBitsSlice = 0;
11421140 pSlice->sSlicingOverRc.iFrameBitsSlice = 0;
11431141 pSlice->sSlicingOverRc.iGomBitsSlice = 0;
11441142
@@ -1158,8 +1156,6 @@ int32_t ReallocateSliceList (sWelsEncCtx* pCtx, · 13 unmodified lines
11581156 int32_t iRet = 0;
11591157 const int32_t kiCurDid = pCtx->uiDependencyId;
11601158 int32_t iMaxSliceBufferSize = (pCtx)->iSliceBufferSize[kiCurDid];
1161− int32_t iBitsPerMb = WELS_DIV_ROUND (pCtx->pWelsSvcRc[kiCurDid].iTargetBits * INT_MULTIPLY,
1162− pCtx->pWelsSvcRc[kiCurDid].iNumberMbFrame);
11631159 bool bIndependenceBsBuffer = (pCtx->pSvcParam->iMultipleThreadIdc > 1 &&
11641160 SM_SINGLE_SLICE != pSliceArgument->uiSliceMode) ? true : false;
11651161
@@ -1211,7 +1207,7 @@ int32_t ReallocateSliceList (sWelsEncCtx* pCtx, · 45 unmodified lines
12111207 InitSliceHeadWithBase (pSlice, pBaseSlice);
12121208 InitSliceRefInfoWithBase (pSlice, pBaseSlice, pCtx->iNumRef0);
12131209
1214− iRet = InitSliceRC (pSlice, pCtx->iGlobalQp, iBitsPerMb);
1210+ iRet = InitSliceRC (pSlice, pCtx->iGlobalQp);
12151211 if (ENC_RETURN_SUCCESS != iRet) {
12161212 FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "ReallocateSliceList()::InitSliceBsBuffer()");
12171213 return iRet;
@@ -1345,6 +1341,7 @@ int32_t ReallocSliceBuffer (sWelsEncCtx* pCtx) { · 127 unmodified lines
13451341 pMA->WelsFree (pCurLayer->pCountMbNumInSlice, "pCountMbNumInSlice");
13461342 pCurLayer->pCountMbNumInSlice = pCountMbNumInSlice;
13471343
1344+
13481345 for (iSliceIdx = 0; iSliceIdx < iMaxSliceNumNew; iSliceIdx++) {
13491346 pCurLayer->ppSliceInLayer[iSliceIdx] = pCurLayer->sSliceThreadInfo.pSliceInThread[0] + iSliceIdx;
13501347 }
@@ -1358,7 +1355,6 @@ int32_t ReallocSliceBuffer (sWelsEncCtx* pCtx) { · 7 unmodified lines
13581355 return ENC_RETURN_SUCCESS;
13591356 }
13601357
1361−
13621358 /*
13631359 int32_t ReOrderSliceInLayer (SDqLayer* pCurLayer,
13641360 const int32_t kiThreadNum,

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