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/encoder_ext.cpp (1 of 5 files). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+15−6
@@ -3670,7 +3670,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 3669 unmodified lines
36703670 if (SM_SINGLE_SLICE == pParam->sSliceArgument.uiSliceMode) { // only one slice within a sQualityStat layer
36713671 int32_t iSliceSize = 0;
36723672 int32_t iPayloadSize = 0;
3673− SSlice* pCurSlice = pCtx->pCurDqLayer->ppSliceInLayer[0];
3673+ uint32_t uiTheadIdx = 0;
3674+ SSlice* pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo.pSliceInThread[uiTheadIdx][0];
36743675
36753676 if (pCtx->bNeedPrefixNalFlag) {
36763677 pCtx->iEncoderError = AddPrefixNal (pCtx, pLayerBsInfo, &pLayerBsInfo->pNalLengthInByte[0], &iNalIdxInLayer, eNalType,
@@ -3808,13 +3809,16 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 131 unmodified lines
38083809 iLayerSize = AppendSliceToFrameBs (pCtx, pLayerBsInfo, kiPartitionCnt);
38093810 } else { // for non-dynamic-slicing mode single threading branch..
38103811 const bool bNeedPrefix = pCtx->bNeedPrefixNalFlag;
3811− int32_t iSliceIdx = 0;
3812− SSlice* pCurSlice = NULL;
3812+
3813+ int32_t iSliceIdx = 0;
3814+ uint32_t uiTheadIdx = 0;
3815+ SSlice* pCurSlice = NULL;
38133816
38143817 iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer);
38153818 while (iSliceIdx < iSliceCount) {
38163819 int32_t iSliceSize = 0;
38173820 int32_t iPayloadSize = 0;
3821+
38183822 if (bNeedPrefix) {
38193823 pCtx->iEncoderError = AddPrefixNal (pCtx, pLayerBsInfo, &pLayerBsInfo->pNalLengthInByte[0], &iNalIdxInLayer, eNalType,
38203824 eNalRefIdc,
@@ -3824,7 +3828,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 3 unmodified lines
38243828 }
38253829
38263830 WelsLoadNal (pCtx->pOut, eNalType, eNalRefIdc);
3827− pCurSlice = pCtx->pCurDqLayer->ppSliceInLayer[iSliceIdx];
3831+
3832+ pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo.pSliceInThread[uiTheadIdx][iSliceIdx];
38283833 assert (iSliceIdx == (int) pCurSlice->uiSliceIdx);
38293834 pCtx->iEncoderError = SetSliceBoundaryInfo(pCtx->pCurDqLayer, pCurSlice, iSliceIdx);
38303835 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
@@ -4516,7 +4521,8 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 685 unmodified lines
45164521 ) {
45174522
45184523 SDqLayer* pCurLayer = pCtx->pCurDqLayer;
4519− SSlice* pStartSlice = pCurLayer->ppSliceInLayer[iStartSliceIdx];
4524+ uint32_t uiTheadIdx = 0;
4525+ SSlice* pStartSlice = &pCurLayer->sSliceThreadInfo.pSliceInThread[uiTheadIdx][iStartSliceIdx];
45204526 int32_t iNalIdxInLayer = *pNalIdxInLayer;
45214527 int32_t iSliceIdx = iStartSliceIdx;
45224528 const int32_t kiSliceStep = pCtx->iActiveThreadsNum;
@@ -4529,6 +4535,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 6 unmodified lines
45294535 const int32_t kiSliceIdxStep = pCtx->iActiveThreadsNum;
45304536 int32_t iReturn = ENC_RETURN_SUCCESS;
45314537
4538+
45324539 //init
45334540 {
45344541 pStartSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = iFirstMbIdxInPartition;
@@ -4565,8 +4572,10 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 30 unmodified lines
45654572 }
45664573
45674574 WelsLoadNal (pCtx->pOut, keNalType, keNalRefIdc);
4568− pCurSlice = pCtx->pCurDqLayer->ppSliceInLayer[iSliceIdx];
4575+
4576+ pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo.pSliceInThread[uiTheadIdx][iSliceIdx];
45694577 assert (iSliceIdx == (int) pCurSlice->uiSliceIdx);
4578+
45704579 iReturn = WelsCodeOneSlice (pCtx, pCurSlice, keNalType);
45714580 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
45724581 WelsUnloadNal (pCtx->pOut);

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