History

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

huade committed 9 years ago

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

Unified · Split

4 files
  1. codec/encoder/core/src/encoder_ext.cpp +0 −1
  2. codec/encoder/core/src/ratectl.cpp +1 −0
  3. codec/encoder/core/src/slice_multi_threading.cpp +0 −1
  4. codec/encoder/core/src/svc_encode_slice.cpp +5 −9
codec/encoder/core/src/encoder_ext.cpp+0−1
@@ -3826,7 +3826,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 3825 unmodified lines
38263826 WelsLoadNal (pCtx->pOut, eNalType, eNalRefIdc);
38273827 pCurSlice = pCtx->pCurDqLayer->ppSliceInLayer[iSliceIdx];
38283828 assert (iSliceIdx == (int) pCurSlice->uiSliceIdx);
3829−
38303829 pCtx->iEncoderError = SetSliceBoundaryInfo(pCtx->pCurDqLayer, pCurSlice, iSliceIdx);
38313830 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
38323831
codec/encoder/core/src/ratectl.cpp+1−0
@@ -711,6 +711,7 @@ void RcGomTargetBits (sWelsEncCtx* pEncCtx, SSlice* pSlice) { · 710 unmodified lines
711711 }
712712
713713
714+
714715 void RcCalculateGomQp (sWelsEncCtx* pEncCtx, SSlice* pSlice, SMB* pCurMb) {
715716 SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
716717 SRCSlicing* pSOverRc = &pSlice->sSlicingOverRc;
codec/encoder/core/src/slice_multi_threading.cpp+0−1
@@ -637,7 +637,6 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 636 unmodified lines
637637 WelsLoadNalForSlice (pSliceBs, eNalType, eNalRefIdc);
638638 pCurSlice = pEncPEncCtx->pCurDqLayer->ppSliceInLayer[iSliceIdx];
639639 assert (iSliceIdx == (int) pCurSlice->uiSliceIdx);
640−
641640 iReturn = SetSliceBoundaryInfo(pEncPEncCtx->pCurDqLayer, pCurSlice, iSliceIdx);
642641 if (ENC_RETURN_SUCCESS != iReturn) {
643642 uiThrdRet = iReturn;
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