History

remove pCountMbNumInSlice from SSliceCtx

huade committed 10 years ago

Commit d02addd1 parent 60f36eb8 files · +40 −72Browse files

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

Unified · Split

codec/encoder/core/src/slice_multi_threading.cpp+10−10
@@ -85,7 +85,7 @@ void UpdateMbListNeighborParallel (SDqLayer* pCurDq, · 84 unmodified lines
8585 const uint16_t* kpMbMap = pSliceCtx->pOverallMbMap;
8686 const int32_t kiMbWidth = pSliceCtx->iMbWidth;
8787 int32_t iIdx = pUpdateSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice;
88− const int32_t kiEndMbInSlice = iIdx + pSliceCtx->pCountMbNumInSlice[uiSliceIdc] - 1;
88+ const int32_t kiEndMbInSlice = iIdx + pUpdateSlice->iCountMbNumInSlice - 1;
8989
9090 do {
9191 SMB* pMb = &pMbList[iIdx];
@@ -132,7 +132,6 @@ void CalcSliceComplexRatio (SDqLayer* pCurDq) { · 40 unmodified lines
132132 SSliceCtx* pSliceCtx = &pCurDq->sSliceEncCtx;
133133 SSlice* pSliceInLayer = pCurDq->sLayerInfo.pSliceInLayer;
134134 int32_t iSumAv = 0;
135− int32_t* pCountMbInSlice = (int32_t*)pSliceCtx->pCountMbNumInSlice;
136135 const int32_t kiSliceCount = pSliceCtx->iSliceNumInFrame;
137136 int32_t iSliceIdx = 0;
138137 int32_t iAvI[MAX_SLICES_NUM];
@@ -140,10 +139,11 @@ void CalcSliceComplexRatio (SDqLayer* pCurDq) { · 1 unmodified line
140139 WelsEmms();
141140
142141 while (iSliceIdx < kiSliceCount) {
143− iAvI[iSliceIdx] = WELS_DIV_ROUND (INT_MULTIPLY * pCountMbInSlice[iSliceIdx], pSliceInLayer[iSliceIdx].uiSliceConsumeTime);
142+ iAvI[iSliceIdx] = WELS_DIV_ROUND (INT_MULTIPLY * pSliceInLayer[iSliceIdx].iCountMbNumInSlice,
143+ pSliceInLayer[iSliceIdx].uiSliceConsumeTime);
144144 MT_TRACE_LOG (NULL, WELS_LOG_DEBUG, "[MT] CalcSliceComplexRatio(), uiSliceConsumeTime[%d]= %d us, slice_run= %d",
145145 iSliceIdx,
146− pSliceInLayer[iSliceIdx].uiSliceConsumeTime, pCountMbInSlice[iSliceIdx]);
146+ pSliceInLayer[iSliceIdx].uiSliceConsumeTime, pSliceInLayer[iSliceIdx].iCountMbNumInSlice);
147147 iSumAv += iAvI[iSliceIdx];
148148
149149 ++ iSliceIdx;
@@ -271,7 +271,7 @@ void DynamicAdjustSlicing (sWelsEncCtx* pCtx, · 121 unmodified lines
271271 MT_TRACE_LOG (pCtx, WELS_LOG_DEBUG,
272272 "[MT] DynamicAdjustSlicing(), uiSliceIdx= %d, iSliceComplexRatio= %.2f, slice_run_org= %d, slice_run_adj= %d",
273273 iSliceIdx, pSliceInLayer[iSliceIdx].iSliceComplexRatio * 1.0f / INT_MULTIPLY,
274− pSliceCtx->pCountMbNumInSlice[iSliceIdx],
274+ pSliceInLayer[iSliceIdx].iCountMbNumInSlice,
275275 iNumMbAssigning);
276276 ++ iSliceIdx;
277277 iMaximalMbNum = iMbNumLeft - (kiCountSliceNum - iSliceIdx - 1) * iMinimalMbNum; // get maximal num_mb in left parts
@@ -280,8 +280,7 @@ void DynamicAdjustSlicing (sWelsEncCtx* pCtx, · 2 unmodified lines
280280 MT_TRACE_LOG (pCtx, WELS_LOG_DEBUG,
281281 "[MT] DynamicAdjustSlicing(), iSliceIdx= %d, iSliceComplexRatio= %.2f, slice_run_org= %d, slice_run_adj= %d",
282282 iSliceIdx, pSliceInLayer[iSliceIdx].iSliceComplexRatio * 1.0f / INT_MULTIPLY,
283− pSliceCtx->pCountMbNumInSlice[iSliceIdx], iMbNumLeft);
284−
283+ pSliceInLayer[iSliceIdx].iCountMbNumInSlice, iMbNumLeft);
285284
286285 if (DynamicAdjustSlicePEncCtxAll (pCurDqLayer, iRunLen) == 0) {
287286 const int32_t kiThreadNum = pCtx->pSvcParam->iCountThreadsNum;
@@ -367,7 +366,7 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 79 unmodified lines
367366 iIdx = 0;
368367 while (iIdx < iNumSpatialLayers) {
369368 SSliceArgument* pSliceArgument = &pPara->sSpatialLayers[iIdx].sSliceArgument;
370− if (pSliceArgument->uiSliceMode == SM_FIXEDSLCNUM_SLICE || pSliceArgument->uiSliceMode == SM_RASTER_SLICE) {
369+ if (pSliceArgument->uiSliceMode == SM_FIXEDSLCNUM_SLICE || pSliceArgument->uiSliceMode == SM_RASTER_SLICE) {
371370 bWillUseTaskManage = true;
372371 }
373372 ++ iIdx;
@@ -789,7 +788,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 415 unmodified lines
789788 pEncPEncCtx->iCodingIndex, iSliceIdx,
790789 pEncPEncCtx->pCurDqLayer->sLayerInfo.pSliceInLayer[iSliceIdx].uiSliceConsumeTime, iSliceSize,
791790 pCurDq->sLayerInfo.pSliceInLayer[iSliceIdx].sSliceHeaderExt.sSliceHeader.iFirstMbInSlice,
792− pCurDq->sSliceEncCtx.pCountMbNumInSlice[iSliceIdx]);
791+ pCurDq->sLayerInfo.pSliceInLayer[iSliceIdx].iCountMbNumInSlice);
793792 }
794793
795794 #if defined(SLICE_INFO_OUTPUT)
@@ -898,7 +897,8 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 102 unmodified lines
898897
899898 MT_TRACE_LOG (pEncPEncCtx, WELS_LOG_INFO,
900899 "[MT] CodingSliceThreadProc(), coding_idx %d, iPartitionId %d, uiSliceIdx %d, iSliceSize %d, count_mb_slice %d, iEndMbInPartition %d, pCurDq->pLastCodedMbIdxOfPartition[%d] %d\n",
901− pEncPEncCtx->iCodingIndex, kiPartitionId, iSliceIdx, iSliceSize, pCurDq->sSliceEncCtx.pCountMbNumInSlice[iSliceIdx],
900+ pEncPEncCtx->iCodingIndex, kiPartitionId, iSliceIdx, iSliceSize,
901+ pCurDq->sLayerInfo.pSliceInLayer[iSliceIdx].iCountMbNumInSlice,
902902 kiEndMbInPartition, kiPartitionId, pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId]);
903903
904904 iAnyMbLeftInPartition = kiEndMbInPartition - (1 + pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId]);

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