History

remove (ppCtx)->pSliceCtxList and only keep DqLayer->sSliceCtx to simply the structure manage

huade committed 10 years ago

Commit 35ab32b1 parent f9d8e9a10 files · +67 −84Browse files

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

Unified · Split

codec/encoder/core/src/slice_multi_threading.cpp+14−14
@@ -80,7 +80,7 @@ namespace WelsEnc { · 79 unmodified lines
8080 void UpdateMbListNeighborParallel (SDqLayer* pCurDq,
8181 SMB* pMbList,
8282 const int32_t uiSliceIdc) {
83− SSliceCtx* pSliceCtx = pCurDq->pSliceEncCtx;
83+ SSliceCtx* pSliceCtx = &pCurDq->sSliceEncCtx;
8484 const uint16_t* kpMbMap = pSliceCtx->pOverallMbMap;
8585 const int32_t kiMbWidth = pSliceCtx->iMbWidth;
8686 int32_t iIdx = pSliceCtx->pFirstMbInSlice[uiSliceIdc];
@@ -203,7 +203,7 @@ void DynamicAdjustSlicing (sWelsEncCtx* pCtx, · 116 unmodified lines
203203 SDqLayer* pCurDqLayer,
204204 void* pComplexRatio,
205205 int32_t iCurDid) {
206− SSliceCtx* pSliceCtx = pCurDqLayer->pSliceEncCtx;
206+ SSliceCtx* pSliceCtx = &pCurDqLayer->sSliceEncCtx;
207207 const int32_t kiCountSliceNum = pSliceCtx->iSliceNumInFrame;
208208 const int32_t kiCountNumMb = pSliceCtx->iMbNumInFrame;
209209 int32_t iMinimalMbNum =
@@ -818,7 +818,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 608 unmodified lines
818818 "[MT] CodingSliceThreadProc(), coding_idx %d, uiSliceIdx %d, pSliceConsumeTime %d, iSliceSize %d, pFirstMbInSlice %d, count_num_mb_in_slice %d",
819819 pEncPEncCtx->iCodingIndex, iSliceIdx,
820820 pEncPEncCtx->pSliceThreading->pSliceConsumeTime[pEncPEncCtx->uiDependencyId][iSliceIdx], iSliceSize,
821− pCurDq->pSliceEncCtx->pFirstMbInSlice[iSliceIdx], pCurDq->pSliceEncCtx->pCountMbNumInSlice[iSliceIdx]);
821+ pCurDq->sSliceEncCtx.pFirstMbInSlice[iSliceIdx], pCurDq->sSliceEncCtx.pCountMbNumInSlice[iSliceIdx]);
822822 }
823823
824824 #if defined(SLICE_INFO_OUTPUT)
@@ -840,7 +840,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 15 unmodified lines
840840 WelsEventSignal (
841841 &pEncPEncCtx->pSliceThreading->pSliceCodedMasterEvent);
842842 } else { // for SM_SIZELIMITED_SLICE parallelization
843− SSliceCtx* pSliceCtx = pCurDq->pSliceEncCtx;
843+ SSliceCtx* pSliceCtx = &pCurDq->sSliceEncCtx;
844844 const int32_t kiPartitionId = iThreadIdx;
845845 const int32_t kiSliceIdxStep = pEncPEncCtx->iActiveThreadsNum;
846846 const int32_t kiFirstMbInPartition = pPrivateData->iStartMbIndex; // inclusive
@@ -938,7 +938,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 91 unmodified lines
938938
939939 MT_TRACE_LOG (pEncPEncCtx, WELS_LOG_INFO,
940940 "[MT] CodingSliceThreadProc(), coding_idx %d, iPartitionId %d, uiSliceIdx %d, iSliceSize %d, count_mb_slice %d, iEndMbInPartition %d, pCurDq->pLastCodedMbIdxOfPartition[%d] %d\n",
941− pEncPEncCtx->iCodingIndex, kiPartitionId, iSliceIdx, iSliceSize, pCurDq->pSliceEncCtx->pCountMbNumInSlice[iSliceIdx],
941+ pEncPEncCtx->iCodingIndex, kiPartitionId, iSliceIdx, iSliceSize, pCurDq->sSliceEncCtx.pCountMbNumInSlice[iSliceIdx],
942942 kiEndMbInPartition, kiPartitionId, pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId]);
943943
944944 iAnyMbLeftInPartition = kiEndMbInPartition - (1 + pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId]);
@@ -1062,10 +1062,10 @@ int32_t AdjustBaseLayer (sWelsEncCtx* pCtx) { · 117 unmodified lines
10621062 #endif//MT_DEBUG
10631063
10641064 pCtx->pCurDqLayer = pCurDq;
1065− memcpy ((pCtx->pSliceThreading->pSliceConsumeTime[0]), (pCurDq->pSliceEncCtx->pSliceConsumeTime),
1066− pCurDq->pSliceEncCtx->iSliceNumInFrame * sizeof (uint32_t));
1065+ memcpy ((pCtx->pSliceThreading->pSliceConsumeTime[0]), (pCurDq->sSliceEncCtx.pSliceConsumeTime),
1066+ pCurDq->sSliceEncCtx.iSliceNumInFrame * sizeof (uint32_t));
10671067 // do not need adjust due to not different at both slices of consumed time
1068− iNeedAdj = NeedDynamicAdjust (pCtx->pSliceThreading->pSliceConsumeTime[0], pCurDq->pSliceEncCtx->iSliceNumInFrame);
1068+ iNeedAdj = NeedDynamicAdjust (pCtx->pSliceThreading->pSliceConsumeTime[0], pCurDq->sSliceEncCtx.iSliceNumInFrame);
10691069 if (iNeedAdj)
10701070 DynamicAdjustSlicing (pCtx,
10711071 pCurDq,
@@ -1095,13 +1095,13 @@ int32_t AdjustEnhanceLayer (sWelsEncCtx* pCtx, int32_t iCurDid) { · 23 unmodified lines
10951095 && (pCtx->pSvcParam->sSpatialLayers[iCurDid - 1].sSliceArgument.uiSliceMode == SM_FIXEDSLCNUM_SLICE
10961096 && pCtx->pSvcParam->iMultipleThreadIdc >= pCtx->pSvcParam->sSpatialLayers[iCurDid -
10971097 1].sSliceArgument.uiSliceNum);
1098− memcpy ((pCtx->pSliceThreading->pSliceConsumeTime[iCurDid]), (pCtx->pCurDqLayer->pSliceEncCtx->pSliceConsumeTime),
1099− pCtx->pCurDqLayer->pSliceEncCtx->iSliceNumInFrame * sizeof (uint32_t));
1098+ memcpy ((pCtx->pSliceThreading->pSliceConsumeTime[iCurDid]), (pCtx->pCurDqLayer->sSliceEncCtx.pSliceConsumeTime),
1099+ pCtx->pCurDqLayer->sSliceEncCtx.iSliceNumInFrame * sizeof (uint32_t));
11001100
11011101 if (kbModelingFromSpatial) { // using spatial base layer for complexity estimation
11021102 // do not need adjust due to not different at both slices of consumed time
11031103 iNeedAdj = NeedDynamicAdjust (pCtx->pSliceThreading->pSliceConsumeTime[iCurDid - 1],
1104− pCtx->pCurDqLayer->pSliceEncCtx->iSliceNumInFrame);
1104+ pCtx->pCurDqLayer->sSliceEncCtx.iSliceNumInFrame);
11051105 if (iNeedAdj)
11061106 DynamicAdjustSlicing (pCtx,
11071107 pCtx->pCurDqLayer,
@@ -1111,7 +1111,7 @@ int32_t AdjustEnhanceLayer (sWelsEncCtx* pCtx, int32_t iCurDid) { · 3 unmodified lines
11111111 } else { // use temporal layer for complexity estimation
11121112 // do not need adjust due to not different at both slices of consumed time
11131113 iNeedAdj = NeedDynamicAdjust (pCtx->pSliceThreading->pSliceConsumeTime[iCurDid],
1114− pCtx->pCurDqLayer->pSliceEncCtx->iSliceNumInFrame);
1114+ pCtx->pCurDqLayer->sSliceEncCtx.iSliceNumInFrame);
11151115 if (iNeedAdj)
11161116 DynamicAdjustSlicing (pCtx,
11171117 pCtx->pCurDqLayer,
@@ -1136,7 +1136,7 @@ int32_t AdjustEnhanceLayer (sWelsEncCtx* pCtx, int32_t iCurDid) { · 18 unmodified lines
11361136
11371137 #if defined(MT_DEBUG)
11381138 void TrackSliceComplexities (sWelsEncCtx* pCtx, const int32_t iCurDid) {
1139− const int32_t kiCountSliceNum = pCtx->pCurDqLayer->pSliceEncCtx->iSliceNumInFrame;
1139+ const int32_t kiCountSliceNum = pCtx->pCurDqLayer->sSliceEncCtx.iSliceNumInFrame;
11401140 if (kiCountSliceNum > 0) {
11411141 int32_t iSliceIdx = 0;
11421142 do {
@@ -1162,7 +1162,7 @@ void TrackSliceConsumeTime (sWelsEncCtx* pCtx, int32_t* pDidList, const int32_t · 19 unmodified lines
11621162 SSpatialLayerInternal* pDlp = &pPara->sDependencyLayers[kiDid];
11631163 SSliceConfig* pSliceArgument = &pDlp->sSliceArgument;
11641164 SDqLayer* pCurDq = pCtx->ppDqLayerList[kiDid];
1165− SSliceCtx* pSliceCtx = pCurDq->pSliceEncCtx;
1165+ SSliceCtx* pSliceCtx = &pCurDq->sSliceEncCtx;
11661166 const uint32_t kuiCountSliceNum = pSliceCtx->iSliceNumInFrame;
11671167 if (pCtx->pSliceThreading) {
11681168 if (pCtx->pSliceThreading->pFSliceDiff

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