Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 5 files). Show all
Unified · Split
| @@ -3670,7 +3670,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 3669 unmodified lines | ||
| 3670 | 3670 | if (SM_SINGLE_SLICE == pParam->sSliceArgument.uiSliceMode) { // only one slice within a sQualityStat layer |
| 3671 | 3671 | int32_t iSliceSize = 0; |
| 3672 | 3672 | 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]; | |
| 3674 | 3675 | |
| 3675 | 3676 | if (pCtx->bNeedPrefixNalFlag) { |
| 3676 | 3677 | 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 | ||
| 3808 | 3809 | iLayerSize = AppendSliceToFrameBs (pCtx, pLayerBsInfo, kiPartitionCnt); |
| 3809 | 3810 | } else { // for non-dynamic-slicing mode single threading branch.. |
| 3810 | 3811 | 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; | |
| 3813 | 3816 | |
| 3814 | 3817 | iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer); |
| 3815 | 3818 | while (iSliceIdx < iSliceCount) { |
| 3816 | 3819 | int32_t iSliceSize = 0; |
| 3817 | 3820 | int32_t iPayloadSize = 0; |
| 3821 | + | |
| 3818 | 3822 | if (bNeedPrefix) { |
| 3819 | 3823 | pCtx->iEncoderError = AddPrefixNal (pCtx, pLayerBsInfo, &pLayerBsInfo->pNalLengthInByte[0], &iNalIdxInLayer, eNalType, |
| 3820 | 3824 | eNalRefIdc, |
| @@ -3824,7 +3828,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 3 unmodified lines | ||
| 3824 | 3828 | } |
| 3825 | 3829 | |
| 3826 | 3830 | WelsLoadNal (pCtx->pOut, eNalType, eNalRefIdc); |
| 3827 | − pCurSlice = pCtx->pCurDqLayer->ppSliceInLayer[iSliceIdx]; | |
| 3831 | + | |
| 3832 | + pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo.pSliceInThread[uiTheadIdx][iSliceIdx]; | |
| 3828 | 3833 | assert (iSliceIdx == (int) pCurSlice->uiSliceIdx); |
| 3829 | 3834 | pCtx->iEncoderError = SetSliceBoundaryInfo(pCtx->pCurDqLayer, pCurSlice, iSliceIdx); |
| 3830 | 3835 | WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS) |
| @@ -4516,7 +4521,8 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 685 unmodified lines | ||
| 4516 | 4521 | ) { |
| 4517 | 4522 | |
| 4518 | 4523 | SDqLayer* pCurLayer = pCtx->pCurDqLayer; |
| 4519 | − SSlice* pStartSlice = pCurLayer->ppSliceInLayer[iStartSliceIdx]; | |
| 4524 | + uint32_t uiTheadIdx = 0; | |
| 4525 | + SSlice* pStartSlice = &pCurLayer->sSliceThreadInfo.pSliceInThread[uiTheadIdx][iStartSliceIdx]; | |
| 4520 | 4526 | int32_t iNalIdxInLayer = *pNalIdxInLayer; |
| 4521 | 4527 | int32_t iSliceIdx = iStartSliceIdx; |
| 4522 | 4528 | const int32_t kiSliceStep = pCtx->iActiveThreadsNum; |
| @@ -4529,6 +4535,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 6 unmodified lines | ||
| 4529 | 4535 | const int32_t kiSliceIdxStep = pCtx->iActiveThreadsNum; |
| 4530 | 4536 | int32_t iReturn = ENC_RETURN_SUCCESS; |
| 4531 | 4537 | |
| 4538 | + | |
| 4532 | 4539 | //init |
| 4533 | 4540 | { |
| 4534 | 4541 | pStartSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = iFirstMbIdxInPartition; |
| @@ -4565,8 +4572,10 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 30 unmodified lines | ||
| 4565 | 4572 | } |
| 4566 | 4573 | |
| 4567 | 4574 | WelsLoadNal (pCtx->pOut, keNalType, keNalRefIdc); |
| 4568 | − pCurSlice = pCtx->pCurDqLayer->ppSliceInLayer[iSliceIdx]; | |
| 4575 | + | |
| 4576 | + pCurSlice = &pCtx->pCurDqLayer->sSliceThreadInfo.pSliceInThread[uiTheadIdx][iSliceIdx]; | |
| 4569 | 4577 | assert (iSliceIdx == (int) pCurSlice->uiSliceIdx); |
| 4578 | + | |
| 4570 | 4579 | iReturn = WelsCodeOneSlice (pCtx, pCurSlice, keNalType); |
| 4571 | 4580 | WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS) |
| 4572 | 4581 | WelsUnloadNal (pCtx->pOut); |