rename variables, change thread idx to bufferIdx,which lead to misunderstanding
Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 7 files). Show all
Unified · Split
| @@ -923,9 +923,9 @@ int32_t InitMbListD (sWelsEncCtx** ppCtx) { · 922 unmodified lines | ||
| 923 | 923 | void FreeSliceInLayer (SDqLayer* pDq, CMemoryAlign* pMa) { |
| 924 | 924 | int32_t iIdx = 0; |
| 925 | 925 | for (; iIdx < MAX_THREADS_NUM; iIdx ++) { |
| 926 | − FreeSliceBuffer (pDq->sSliceThreadInfo[iIdx].pSliceInThread, | |
| 927 | − pDq->sSliceThreadInfo[iIdx].iMaxSliceNum, | |
| 928 | − pMa, "pSliceInThread"); | |
| 926 | + FreeSliceBuffer (pDq->sSliceBufferInfo[iIdx].pSliceBuffer, | |
| 927 | + pDq->sSliceBufferInfo[iIdx].iMaxSliceNum, | |
| 928 | + pMa, "pSliceBuffer"); | |
| 929 | 929 | } |
| 930 | 930 | } |
| 931 | 931 | |
| @@ -3643,7 +3643,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 2711 unmodified lines | ||
| 3643 | 3643 | if (SM_SINGLE_SLICE == pParam->sSliceArgument.uiSliceMode) { // only one slice within a sQualityStat layer |
| 3644 | 3644 | int32_t iSliceSize = 0; |
| 3645 | 3645 | int32_t iPayloadSize = 0; |
| 3646 | − SSlice* pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo[0].pSliceInThread[0]; | |
| 3646 | + SSlice* pCurSlice = &pCtx->pCurDqLayer->sSliceBufferInfo[0].pSliceBuffer[0]; | |
| 3647 | 3647 | |
| 3648 | 3648 | if (pCtx->bNeedPrefixNalFlag) { |
| 3649 | 3649 | pCtx->iEncoderError = AddPrefixNal (pCtx, pLayerBsInfo, &pLayerBsInfo->pNalLengthInByte[0], &iNalIdxInLayer, eNalType, |
| @@ -3777,7 +3777,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 127 unmodified lines | ||
| 3777 | 3777 | } else { // for non-dynamic-slicing mode single threading branch.. |
| 3778 | 3778 | const bool bNeedPrefix = pCtx->bNeedPrefixNalFlag; |
| 3779 | 3779 | int32_t iSliceIdx = 0; |
| 3780 | − uint32_t uiTheadIdx = 0; | |
| 3781 | 3780 | SSlice* pCurSlice = NULL; |
| 3782 | 3781 | |
| 3783 | 3782 | iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer); |
| @@ -3795,7 +3794,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 11 unmodified lines | ||
| 3795 | 3794 | |
| 3796 | 3795 | WelsLoadNal (pCtx->pOut, eNalType, eNalRefIdc); |
| 3797 | 3796 | |
| 3798 | − pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo[uiTheadIdx].pSliceInThread[iSliceIdx]; | |
| 3797 | + pCurSlice = &pCtx->pCurDqLayer->sSliceBufferInfo[0].pSliceBuffer[iSliceIdx]; | |
| 3799 | 3798 | assert (iSliceIdx == pCurSlice->iSliceIdx); |
| 3800 | 3799 | pCtx->iEncoderError = SetSliceBoundaryInfo(pCtx->pCurDqLayer, pCurSlice, iSliceIdx); |
| 3801 | 3800 | |
| @@ -4450,8 +4449,8 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 648 unmodified lines | ||
| 4450 | 4449 | ) { |
| 4451 | 4450 | |
| 4452 | 4451 | SDqLayer* pCurLayer = pCtx->pCurDqLayer; |
| 4453 | − uint32_t uiTheadIdx = 0; | |
| 4454 | − SSlice* pStartSlice = &pCurLayer->sSliceThreadInfo[uiTheadIdx].pSliceInThread[iStartSliceIdx]; | |
| 4452 | + uint32_t uSlcBuffIdx = 0; | |
| 4453 | + SSlice* pStartSlice = &pCurLayer->sSliceBufferInfo[uSlcBuffIdx].pSliceBuffer[iStartSliceIdx]; | |
| 4455 | 4454 | int32_t iNalIdxInLayer = *pNalIdxInLayer; |
| 4456 | 4455 | int32_t iSliceIdx = iStartSliceIdx; |
| 4457 | 4456 | const int32_t kiSliceStep = pCtx->iActiveThreadsNum; |
| @@ -4471,7 +4470,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 13 unmodified lines | ||
| 4471 | 4470 | int32_t iPayloadSize = 0; |
| 4472 | 4471 | SSlice* pCurSlice = NULL; |
| 4473 | 4472 | |
| 4474 | − if (iSliceIdx >= (pCurLayer->sSliceThreadInfo[uiTheadIdx].iMaxSliceNum - kiSliceIdxStep)) { // insufficient memory in pSliceInLayer[] | |
| 4473 | + if (iSliceIdx >= (pCurLayer->sSliceBufferInfo[uSlcBuffIdx].iMaxSliceNum - kiSliceIdxStep)) { // insufficient memory in pSliceInLayer[] | |
| 4475 | 4474 | if (pCtx->iActiveThreadsNum == 1) { |
| 4476 | 4475 | //only single thread support re-alloc now |
| 4477 | 4476 | if (DynSliceRealloc (pCtx, pFrameBSInfo, pLayerBsInfo)) { |
| @@ -4495,7 +4494,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 17 unmodified lines | ||
| 4495 | 4494 | } |
| 4496 | 4495 | |
| 4497 | 4496 | WelsLoadNal (pCtx->pOut, keNalType, keNalRefIdc); |
| 4498 | − pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo[uiTheadIdx].pSliceInThread[iSliceIdx]; | |
| 4497 | + pCurSlice = &pCtx->pCurDqLayer->sSliceBufferInfo[uSlcBuffIdx].pSliceBuffer[iSliceIdx]; | |
| 4499 | 4498 | pCurSlice->iSliceIdx = iSliceIdx; |
| 4500 | 4499 | |
| 4501 | 4500 | iReturn = WelsCodeOneSlice (pCtx, pCurSlice, keNalType); |