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
36603660 iLayerSize = 0;
36613661
36623662 if (SM_SINGLE_SLICE == pParam->sSliceArgument.uiSliceMode) { // only one slice within a sQualityStat layer
3663− int32_t iSliceSize = 0;
3663+ int32_t iSliceSize = 0;
36643664 int32_t iPayloadSize = 0;
3665+ SSlice* pCurSlice = pCtx->pCurDqLayer->ppSliceInLayer[0];
36653666
36663667 if (pCtx->bNeedPrefixNalFlag) {
36673668 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
36723673 }
36733674
36743675 WelsLoadNal (pCtx->pOut, eNalType, eNalRefIdc);
3675−
3676− pCtx->iEncoderError = WelsCodeOneSlice (pCtx, 0, eNalType);
3676+ assert (0 == (int) pCurSlice->uiSliceIdx);
3677+ pCtx->iEncoderError = WelsCodeOneSlice (pCtx, pCurSlice, eNalType);
36773678 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
36783679
36793680 WelsUnloadNal (pCtx->pOut);
@@ -3793,11 +3794,11 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 113 unmodified lines
37933794 #endif
37943795 //TO DO: add update ppSliceInLayer module based on pSliceInThread[ThreadNum]
37953796 // UpdateSliceInLayerInfo(); // reordering
3796−
37973797 iLayerSize = AppendSliceToFrameBs (pCtx, pLayerBsInfo, kiPartitionCnt);
37983798 } else { // for non-dynamic-slicing mode single threading branch..
37993799 const bool bNeedPrefix = pCtx->bNeedPrefixNalFlag;
38003800 int32_t iSliceIdx = 0;
3801+ SSlice* pCurSlice = NULL;
38013802
38023803 iSliceCount = GetCurrentSliceNum (pCtx->pCurDqLayer);
38033804 while (iSliceIdx < iSliceCount) {
@@ -3812,7 +3813,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 8 unmodified lines
38123813 }
38133814
38143815 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);
38163819 WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
38173820
38183821 WelsUnloadNal (pCtx->pOut);
@@ -4523,6 +4526,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 704 unmodified lines
45234526 while (iAnyMbLeftInPartition > 0) {
45244527 int32_t iSliceSize = 0;
45254528 int32_t iPayloadSize = 0;
4529+ SSlice* pCurSlice = NULL;
45264530
45274531 if (iSliceIdx >= (pSliceCtx->iMaxSliceNumConstraint - kiSliceIdxStep)) { // insufficient memory in pSliceInLayer[]
45284532 if (pCtx->iActiveThreadsNum == 1) {
@@ -4548,7 +4552,9 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 19 unmodified lines
45484552 }
45494553
45504554 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);
45524558 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
45534559 WelsUnloadNal (pCtx->pOut);
45544560

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