Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 6 files). Show all
Unified · Split
| @@ -925,8 +925,8 @@ int32_t InitMbListD (sWelsEncCtx** ppCtx) { · 924 unmodified lines | |||
| 925 | void FreeSliceInLayer (SDqLayer* pDq, CMemoryAlign* pMa) { | 925 | void FreeSliceInLayer (SDqLayer* pDq, CMemoryAlign* pMa) { |
| 926 | int32_t iIdx = 0; | 926 | int32_t iIdx = 0; |
| 927 | for (; iIdx < MAX_THREADS_NUM; iIdx ++) { | 927 | for (; iIdx < MAX_THREADS_NUM; iIdx ++) { |
| 928 | FreeSliceBuffer (pDq->sSliceThreadInfo.pSliceInThread[iIdx], | 928 | FreeSliceBuffer (pDq->sSliceThreadInfo[iIdx].pSliceInThread, |
| 929 | pDq->sSliceThreadInfo.iMaxSliceNumInThread[iIdx], | 929 | pDq->sSliceThreadInfo[iIdx].iMaxSliceNum, |
| 930 | pMa, "pSliceInThread"); | 930 | pMa, "pSliceInThread"); |
| 931 | } | 931 | } |
| 932 | } | 932 | } |
| @@ -3646,8 +3646,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 2713 unmodified lines | |||
| 3646 | if (SM_SINGLE_SLICE == pParam->sSliceArgument.uiSliceMode) { // only one slice within a sQualityStat layer | 3646 | if (SM_SINGLE_SLICE == pParam->sSliceArgument.uiSliceMode) { // only one slice within a sQualityStat layer |
| 3647 | int32_t iSliceSize = 0; | 3647 | int32_t iSliceSize = 0; |
| 3648 | int32_t iPayloadSize = 0; | 3648 | int32_t iPayloadSize = 0; |
| 3649 | uint32_t uiTheadIdx = 0; | 3649 | SSlice* pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo[0].pSliceInThread[0]; |
| 3650 | SSlice* pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo.pSliceInThread[uiTheadIdx][0]; | ||
| 3651 | 3650 | ||
| 3652 | if (pCtx->bNeedPrefixNalFlag) { | 3651 | if (pCtx->bNeedPrefixNalFlag) { |
| 3653 | pCtx->iEncoderError = AddPrefixNal (pCtx, pLayerBsInfo, &pLayerBsInfo->pNalLengthInByte[0], &iNalIdxInLayer, eNalType, | 3652 | pCtx->iEncoderError = AddPrefixNal (pCtx, pLayerBsInfo, &pLayerBsInfo->pNalLengthInByte[0], &iNalIdxInLayer, eNalType, |
| @@ -3833,7 +3832,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 179 unmodified lines | |||
| 3833 | 3832 | ||
| 3834 | WelsLoadNal (pCtx->pOut, eNalType, eNalRefIdc); | 3833 | WelsLoadNal (pCtx->pOut, eNalType, eNalRefIdc); |
| 3835 | 3834 | ||
| 3836 | pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo.pSliceInThread[uiTheadIdx][iSliceIdx]; | 3835 | pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo[uiTheadIdx].pSliceInThread[iSliceIdx]; |
| 3837 | assert (iSliceIdx == pCurSlice->iSliceIdx); | 3836 | assert (iSliceIdx == pCurSlice->iSliceIdx); |
| 3838 | pCtx->iEncoderError = SetSliceBoundaryInfo(pCtx->pCurDqLayer, pCurSlice, iSliceIdx); | 3837 | pCtx->iEncoderError = SetSliceBoundaryInfo(pCtx->pCurDqLayer, pCurSlice, iSliceIdx); |
| 3839 | 3838 | ||
| @@ -4481,7 +4480,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 641 unmodified lines | |||
| 4481 | 4480 | ||
| 4482 | SDqLayer* pCurLayer = pCtx->pCurDqLayer; | 4481 | SDqLayer* pCurLayer = pCtx->pCurDqLayer; |
| 4483 | uint32_t uiTheadIdx = 0; | 4482 | uint32_t uiTheadIdx = 0; |
| 4484 | SSlice* pStartSlice = &pCurLayer->sSliceThreadInfo.pSliceInThread[uiTheadIdx][iStartSliceIdx]; | 4483 | SSlice* pStartSlice = &pCurLayer->sSliceThreadInfo[uiTheadIdx].pSliceInThread[iStartSliceIdx]; |
| 4485 | int32_t iNalIdxInLayer = *pNalIdxInLayer; | 4484 | int32_t iNalIdxInLayer = *pNalIdxInLayer; |
| 4486 | int32_t iSliceIdx = iStartSliceIdx; | 4485 | int32_t iSliceIdx = iStartSliceIdx; |
| 4487 | const int32_t kiSliceStep = pCtx->iActiveThreadsNum; | 4486 | const int32_t kiSliceStep = pCtx->iActiveThreadsNum; |
| @@ -4501,7 +4500,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 13 unmodified lines | |||
| 4501 | int32_t iPayloadSize = 0; | 4500 | int32_t iPayloadSize = 0; |
| 4502 | SSlice* pCurSlice = NULL; | 4501 | SSlice* pCurSlice = NULL; |
| 4503 | 4502 | ||
| 4504 | if (iSliceIdx >= (pCurLayer->sSliceThreadInfo.iMaxSliceNumInThread[uiTheadIdx] - kiSliceIdxStep)) { // insufficient memory in pSliceInLayer[] | 4503 | if (iSliceIdx >= (pCurLayer->sSliceThreadInfo[uiTheadIdx].iMaxSliceNum - kiSliceIdxStep)) { // insufficient memory in pSliceInLayer[] |
| 4505 | if (pCtx->iActiveThreadsNum == 1) { | 4504 | if (pCtx->iActiveThreadsNum == 1) { |
| 4506 | //only single thread support re-alloc now | 4505 | //only single thread support re-alloc now |
| 4507 | if (DynSliceRealloc (pCtx, pFrameBSInfo, pLayerBsInfo)) { | 4506 | if (DynSliceRealloc (pCtx, pFrameBSInfo, pLayerBsInfo)) { |
| @@ -4525,7 +4524,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 17 unmodified lines | |||
| 4525 | } | 4524 | } |
| 4526 | 4525 | ||
| 4527 | WelsLoadNal (pCtx->pOut, keNalType, keNalRefIdc); | 4526 | WelsLoadNal (pCtx->pOut, keNalType, keNalRefIdc); |
| 4528 | pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo.pSliceInThread[uiTheadIdx][iSliceIdx]; | 4527 | pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo[uiTheadIdx].pSliceInThread[iSliceIdx]; |
| 4529 | pCurSlice->iSliceIdx = iSliceIdx; | 4528 | pCurSlice->iSliceIdx = iSliceIdx; |
| 4530 | 4529 | ||
| 4531 | iReturn = WelsCodeOneSlice (pCtx, pCurSlice, keNalType); | 4530 | iReturn = WelsCodeOneSlice (pCtx, pCurSlice, keNalType); |