The parameter didn't make sense since it only pointed to the pSliceBsa field, which isn't what should be used to stash the cabac context.
Showing the changes to codec/encoder/core/src/svc_encode_slice.cpp (1 of 3 files). Show all
Unified · Split
| @@ -493,13 +493,12 @@ int32_t WelsISliceMdEnc (sWelsEncCtx* pEncCtx, SSlice* pSlice) { //pMd + encodin · 492 unmodified lines | |||
| 493 | 493 | ||
| 494 | SWelsMD sMd; | 494 | SWelsMD sMd; |
| 495 | int32_t iEncReturn = ENC_RETURN_SUCCESS; | 495 | int32_t iEncReturn = ENC_RETURN_SUCCESS; |
| 496 | SBitStringAux* pBs = pSlice->pSliceBsa; | ||
| 497 | SDynamicSlicingStack sDss; | 496 | SDynamicSlicingStack sDss; |
| 498 | if (pEncCtx->pSvcParam->iEntropyCodingModeFlag) { | 497 | if (pEncCtx->pSvcParam->iEntropyCodingModeFlag) { |
| 499 | WelsInitSliceCabac (pEncCtx, pSlice); | 498 | WelsInitSliceCabac (pEncCtx, pSlice); |
| 500 | } | 499 | } |
| 501 | for (; ;) { | 500 | for (; ;) { |
| 502 | pEncCtx->pFuncList->pfStashMBStatus (&sDss, pBs, pSlice, 0); | 501 | pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, 0); |
| 503 | iCurMbIdx = iNextMbIdx; | 502 | iCurMbIdx = iNextMbIdx; |
| 504 | pCurMb = &pMbList[ iCurMbIdx ]; | 503 | pCurMb = &pMbList[ iCurMbIdx ]; |
| 505 | 504 | ||
| @@ -514,7 +513,7 @@ TRY_REENCODING: · 8 unmodified lines | |||
| 514 | 513 | ||
| 515 | iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb); | 514 | iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb); |
| 516 | if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) { | 515 | if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) { |
| 517 | pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pBs, pSlice); | 516 | pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice); |
| 518 | UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset); | 517 | UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset); |
| 519 | goto TRY_REENCODING; | 518 | goto TRY_REENCODING; |
| 520 | } | 519 | } |
| @@ -567,7 +566,7 @@ int32_t WelsISliceMdEncDynamic (sWelsEncCtx* pEncCtx, SSlice* pSlice) { //pMd + · 46 unmodified lines | |||
| 567 | iCurMbIdx = iNextMbIdx; | 566 | iCurMbIdx = iNextMbIdx; |
| 568 | pCurMb = &pMbList[ iCurMbIdx ]; | 567 | pCurMb = &pMbList[ iCurMbIdx ]; |
| 569 | 568 | ||
| 570 | pEncCtx->pFuncList->pfStashMBStatus (&sDss, pBs, pSlice, 0); | 569 | pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, 0); |
| 571 | pEncCtx->pFuncList->pfRc.pfWelsRcMbInit (pEncCtx, pCurMb, pSlice); | 570 | pEncCtx->pFuncList->pfRc.pfWelsRcMbInit (pEncCtx, pCurMb, pSlice); |
| 572 | // if already reaches the largest number of slices, set QPs to the upper bound | 571 | // if already reaches the largest number of slices, set QPs to the upper bound |
| 573 | if (pSlice->bDynamicSlicingSliceSizeCtrlFlag) { | 572 | if (pSlice->bDynamicSlicingSliceSizeCtrlFlag) { |
| @@ -583,7 +582,7 @@ TRY_REENCODING: · 9 unmodified lines | |||
| 583 | 582 | ||
| 584 | iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb); | 583 | iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb); |
| 585 | if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) { | 584 | if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) { |
| 586 | pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pBs, pSlice); | 585 | pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice); |
| 587 | UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset); | 586 | UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset); |
| 588 | goto TRY_REENCODING; | 587 | goto TRY_REENCODING; |
| 589 | } | 588 | } |
| @@ -593,7 +592,7 @@ TRY_REENCODING: · 3 unmodified lines | |||
| 593 | sDss.iCurrentPos = BsGetBitsPos (pBs); | 592 | sDss.iCurrentPos = BsGetBitsPos (pBs); |
| 594 | 593 | ||
| 595 | if (DynSlcJudgeSliceBoundaryStepBack (pEncCtx, pSlice, pSliceCtx, pCurMb, &sDss)) { //islice | 594 | if (DynSlcJudgeSliceBoundaryStepBack (pEncCtx, pSlice, pSliceCtx, pCurMb, &sDss)) { //islice |
| 596 | pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pBs, pSlice); | 595 | pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice); |
| 597 | pCurLayer->pLastCodedMbIdxOfPartition[kiPartitionId] = iCurMbIdx - | 596 | pCurLayer->pLastCodedMbIdxOfPartition[kiPartitionId] = iCurMbIdx - |
| 598 | 1; // update pLastCodedMbIdxOfPartition, need to -1 due to stepping back | 597 | 1; // update pLastCodedMbIdxOfPartition, need to -1 due to stepping back |
| 599 | ++ pCurLayer->pNumSliceCodedOfPartition[kiPartitionId]; | 598 | ++ pCurLayer->pNumSliceCodedOfPartition[kiPartitionId]; |
| @@ -954,7 +953,7 @@ int32_t WelsMdInterMbLoop (sWelsEncCtx* pEncCtx, SSlice* pSlice, void* pWelsMd, · 354 unmodified lines | |||
| 954 | } | 953 | } |
| 955 | pSlice->iMbSkipRun = 0; | 954 | pSlice->iMbSkipRun = 0; |
| 956 | for (;;) { | 955 | for (;;) { |
| 957 | pEncCtx->pFuncList->pfStashMBStatus (&sDss, pBs, pSlice, pSlice->iMbSkipRun); | 956 | pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, pSlice->iMbSkipRun); |
| 958 | //point to current pMb | 957 | //point to current pMb |
| 959 | iCurMbIdx = iNextMbIdx; | 958 | iCurMbIdx = iNextMbIdx; |
| 960 | pCurMb = &pMbList[ iCurMbIdx ]; | 959 | pCurMb = &pMbList[ iCurMbIdx ]; |
| @@ -985,7 +984,7 @@ TRY_REENCODING: · 24 unmodified lines | |||
| 985 | 984 | ||
| 986 | iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb); | 985 | iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb); |
| 987 | if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) { | 986 | if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) { |
| 988 | pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pBs, pSlice); | 987 | pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice); |
| 989 | UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset); | 988 | UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset); |
| 990 | goto TRY_REENCODING; | 989 | goto TRY_REENCODING; |
| 991 | } | 990 | } |
| @@ -1050,7 +1049,7 @@ int32_t WelsMdInterMbLoopOverDynamicSlice (sWelsEncCtx* pEncCtx, SSlice* pSlice, · 58 unmodified lines | |||
| 1050 | for (;;) { | 1049 | for (;;) { |
| 1051 | //DYNAMIC_SLICING_ONE_THREAD - MultiD | 1050 | //DYNAMIC_SLICING_ONE_THREAD - MultiD |
| 1052 | //stack pBs pointer | 1051 | //stack pBs pointer |
| 1053 | pEncCtx->pFuncList->pfStashMBStatus (&sDss, pBs, pSlice, pSlice->iMbSkipRun); | 1052 | pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, pSlice->iMbSkipRun); |
| 1054 | 1053 | ||
| 1055 | //point to current pMb | 1054 | //point to current pMb |
| 1056 | iCurMbIdx = iNextMbIdx; | 1055 | iCurMbIdx = iNextMbIdx; |
| @@ -1091,7 +1090,7 @@ TRY_REENCODING: · 34 unmodified lines | |||
| 1091 | 1090 | ||
| 1092 | iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb); | 1091 | iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb); |
| 1093 | if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) { | 1092 | if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) { |
| 1094 | pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pBs, pSlice); | 1093 | pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice); |
| 1095 | UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset); | 1094 | UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset); |
| 1096 | goto TRY_REENCODING; | 1095 | goto TRY_REENCODING; |
| 1097 | } | 1096 | } |
| @@ -1102,7 +1101,7 @@ TRY_REENCODING: · 4 unmodified lines | |||
| 1102 | //DYNAMIC_SLICING_ONE_THREAD - MultiD | 1101 | //DYNAMIC_SLICING_ONE_THREAD - MultiD |
| 1103 | sDss.iCurrentPos = BsGetBitsPos (pBs); | 1102 | sDss.iCurrentPos = BsGetBitsPos (pBs); |
| 1104 | if (DynSlcJudgeSliceBoundaryStepBack (pEncCtx, pSlice, pSliceCtx, pCurMb, &sDss)) { | 1103 | if (DynSlcJudgeSliceBoundaryStepBack (pEncCtx, pSlice, pSliceCtx, pCurMb, &sDss)) { |
| 1105 | pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pBs, pSlice); | 1104 | pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice); |
| 1106 | pCurLayer->pLastCodedMbIdxOfPartition[kiPartitionId] = iCurMbIdx - | 1105 | pCurLayer->pLastCodedMbIdxOfPartition[kiPartitionId] = iCurMbIdx - |
| 1107 | 1; // update pLastCodedMbIdxOfPartition, need to -1 due to stepping back | 1106 | 1; // update pLastCodedMbIdxOfPartition, need to -1 due to stepping back |
| 1108 | ++ pCurLayer->pNumSliceCodedOfPartition[kiPartitionId]; | 1107 | ++ pCurLayer->pNumSliceCodedOfPartition[kiPartitionId]; |