History

Multi-thread-fixed:RBC#1721:replace ppSliceInLayer by pSliceInThread

huade committed 9 years ago

Commit 71750df1 parent c62e70d5 files · +58 −41Browse files

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

Unified · Split

codec/encoder/core/src/svc_encode_slice.cpp+5−4
@@ -954,6 +954,7 @@ int32_t InitSliceList (sWelsEncCtx* pCtx, · 953 unmodified lines
954954 }
955955
956956 pSlice->uiSliceIdx = iSliceIdx;
957+ pSlice->uiThreadIdx = 0;
957958 pSlice->iCountMbNumInSlice = 0;
958959 pSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = 0;
959960
@@ -1185,6 +1186,7 @@ int32_t ReallocateSliceList (sWelsEncCtx* pCtx, · 225 unmodified lines
11851186 }
11861187
11871188 pSlice->uiSliceIdx = iSliceIdx;
1189+ pSlice->uiThreadIdx = 0;
11881190 pSlice->iCountMbNumInSlice = 0;
11891191 pSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = 0;
11901192
@@ -1354,7 +1356,6 @@ int32_t ReallocSliceBuffer (sWelsEncCtx* pCtx) { · 163 unmodified lines
13541356 pCurLayer->iMaxSliceNum = iMaxSliceNumNew;
13551357 return ENC_RETURN_SUCCESS;
13561358 }
1357−
13581359 /*
13591360 int32_t ReOrderSliceInLayer (SDqLayer* pCurLayer,
13601361 const int32_t kiThreadNum,
@@ -1518,7 +1519,7 @@ void UpdateMbNeighbourInfoForNextSlice (SDqLayer* pCurDq, · 157 unmodified lines
15181519 void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSliceCtx, SMB* pCurMb,
15191520 int32_t iFirstMbIdxOfNextSlice, const int32_t kiLastMbIdxInPartition) {
15201521 SDqLayer* pCurLayer = pEncCtx->pCurDqLayer;
1521− SSlice** ppSliceInLayer = pCurLayer->ppSliceInLayer;
1522+ SSlice* pSliceInThread = pCurLayer->sSliceThreadInfo.pSliceInThread[0];
15221523 int32_t iCurMbIdx = pCurMb->iMbXY;
15231524 uint16_t iCurSliceIdc = pSliceCtx->pOverallMbMap[ iCurMbIdx ];
15241525 const int32_t kiSliceIdxStep = pEncCtx->iActiveThreadsNum;
@@ -1531,7 +1532,7 @@ void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSlic · 6 unmodified lines
15311532 pCurSlice->sSliceHeaderExt.uiNumMbsInSlice = 1 + iCurMbIdx - pCurSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice;
15321533
15331534 //pNextSlice pointer/initialization
1534− pNextSlice = pCurLayer->ppSliceInLayer[ iNextSliceIdc ];
1535+ pNextSlice = &pSliceInThread[ iNextSliceIdc ];
15351536
15361537 #if _DEBUG
15371538 assert (NULL != pNextSlice);
@@ -1542,7 +1543,7 @@ void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSlic · 4 unmodified lines
15421543 (NAL_UNIT_CODED_SLICE_EXT == pCurLayer->sLayerInfo.sNalHeaderExt.sNalUnitHeader.eNalUnitType);
15431544 memcpy (&pNextSlice->sSliceHeaderExt, &pCurSlice->sSliceHeaderExt,
15441545 sizeof (SSliceHeaderExt)); // confirmed_safe_unsafe_usage
1545− ppSliceInLayer[iNextSliceIdc]->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = iFirstMbIdxOfNextSlice;
1546+ pNextSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = iFirstMbIdxOfNextSlice;
15461547 WelsSetMemMultiplebytes_c (pSliceCtx->pOverallMbMap + iFirstMbIdxOfNextSlice, iNextSliceIdc,
15471548 (kiLastMbIdxInPartition - iFirstMbIdxOfNextSlice + 1), sizeof (uint16_t));
15481549

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