History

Multi-thread-fixed:RBC#1713:pSlice instead of kiSliceIdx as input parameter in WelsCodeOneSlice

huade committed 9 years ago

Commit 40566f21 parent 6f347d16 files · +28 −19Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+12−6
@@ -3660,8 +3660,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 3659 unmodified lines
3660 iLayerSize = 0;3660 iLayerSize = 0;
3661 3661
3662 if (SM_SINGLE_SLICE == pParam->sSliceArgument.uiSliceMode) { // only one slice within a sQualityStat layer3662 if (SM_SINGLE_SLICE == pParam->sSliceArgument.uiSliceMode) { // only one slice within a sQualityStat layer
3663 int32_t iSliceSize = 0;3663 int32_t iSliceSize = 0;
3664 int32_t iPayloadSize = 0;3664 int32_t iPayloadSize = 0;
3665 SSlice* pCurSlice = pCtx->pCurDqLayer->ppSliceInLayer[0];
3665 3666
3666 if (pCtx->bNeedPrefixNalFlag) {3667 if (pCtx->bNeedPrefixNalFlag) {
3667 pCtx->iEncoderError = AddPrefixNal (pCtx, pLayerBsInfo, &pLayerBsInfo->pNalLengthInByte[0], &iNalIdxInLayer, eNalType,3668 pCtx->iEncoderError = AddPrefixNal (pCtx, pLayerBsInfo, &pLayerBsInfo->pNalLengthInByte[0], &iNalIdxInLayer, eNalType,
@@ -3672,8 +3673,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 4 unmodified lines
3672 }3673 }
3673 3674
3674 WelsLoadNal (pCtx->pOut, eNalType, eNalRefIdc);3675 WelsLoadNal (pCtx->pOut, eNalType, eNalRefIdc);
3675 3676 assert (0 == (int) pCurSlice->uiSliceIdx);
3676 pCtx->iEncoderError = WelsCodeOneSlice (pCtx, 0, eNalType);3677 pCtx->iEncoderError = WelsCodeOneSlice (pCtx, pCurSlice, eNalType);
3677 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)3678 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
3678 3679
3679 WelsUnloadNal (pCtx->pOut);3680 WelsUnloadNal (pCtx->pOut);
@@ -3793,11 +3794,11 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 113 unmodified lines
3793#endif 3794#endif
3794 //TO DO: add update ppSliceInLayer module based on pSliceInThread[ThreadNum]3795 //TO DO: add update ppSliceInLayer module based on pSliceInThread[ThreadNum]
3795 // UpdateSliceInLayerInfo(); // reordering3796 // UpdateSliceInLayerInfo(); // reordering
3796
3797 iLayerSize = AppendSliceToFrameBs (pCtx, pLayerBsInfo, kiPartitionCnt);3797 iLayerSize = AppendSliceToFrameBs (pCtx, pLayerBsInfo, kiPartitionCnt);
3798 } else { // for non-dynamic-slicing mode single threading branch..3798 } else { // for non-dynamic-slicing mode single threading branch..
3799 const bool bNeedPrefix = pCtx->bNeedPrefixNalFlag;3799 const bool bNeedPrefix = pCtx->bNeedPrefixNalFlag;
3800 int32_t iSliceIdx = 0;3800 int32_t iSliceIdx = 0;
3801 SSlice* pCurSlice = NULL;
3801 3802
3802 iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer);3803 iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer);
3803 while (iSliceIdx < iSliceCount) {3804 while (iSliceIdx < iSliceCount) {
@@ -3812,7 +3813,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 8 unmodified lines
3812 }3813 }
3813 3814
3814 WelsLoadNal (pCtx->pOut, eNalType, eNalRefIdc);3815 WelsLoadNal (pCtx->pOut, eNalType, eNalRefIdc);
3815 pCtx->iEncoderError = WelsCodeOneSlice (pCtx, iSliceIdx, eNalType);3816 pCurSlice = pCtx->pCurDqLayer->ppSliceInLayer[iSliceIdx];
3817 assert (iSliceIdx == (int) pCurSlice->uiSliceIdx);
3818 pCtx->iEncoderError = WelsCodeOneSlice (pCtx, pCurSlice, eNalType);
3816 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)3819 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
3817 3820
3818 WelsUnloadNal (pCtx->pOut);3821 WelsUnloadNal (pCtx->pOut);
@@ -4523,6 +4526,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 704 unmodified lines
4523 while (iAnyMbLeftInPartition > 0) {4526 while (iAnyMbLeftInPartition > 0) {
4524 int32_t iSliceSize = 0;4527 int32_t iSliceSize = 0;
4525 int32_t iPayloadSize = 0;4528 int32_t iPayloadSize = 0;
4529 SSlice* pCurSlice = NULL;
4526 4530
4527 if (iSliceIdx >= (pSliceCtx->iMaxSliceNumConstraint - kiSliceIdxStep)) { // insufficient memory in pSliceInLayer[]4531 if (iSliceIdx >= (pSliceCtx->iMaxSliceNumConstraint - kiSliceIdxStep)) { // insufficient memory in pSliceInLayer[]
4528 if (pCtx->iActiveThreadsNum == 1) {4532 if (pCtx->iActiveThreadsNum == 1) {
@@ -4548,7 +4552,9 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 19 unmodified lines
4548 }4552 }
4549 4553
4550 WelsLoadNal (pCtx->pOut, keNalType, keNalRefIdc);4554 WelsLoadNal (pCtx->pOut, keNalType, keNalRefIdc);
4551 iReturn = WelsCodeOneSlice (pCtx, iSliceIdx, keNalType);4555 pCurSlice = pCtx->pCurDqLayer->ppSliceInLayer[iSliceIdx];
4556 assert (iSliceIdx == (int) pCurSlice->uiSliceIdx);
4557 iReturn = WelsCodeOneSlice (pCtx, pCurSlice, keNalType);
4552 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)4558 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
4553 WelsUnloadNal (pCtx->pOut);4559 WelsUnloadNal (pCtx->pOut);
4554 4560

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