Showing the changes to codec/encoder/core/src/svc_encode_slice.cpp (1 of 1 file). Show all
Unified · Split
| @@ -541,7 +541,8 @@ int32_t WelsISliceMdEnc (sWelsEncCtx* pEncCtx, SSlice* pSlice) { //pMd + encodin · 540 unmodified lines | |||
| 541 | sDss.iStartPos = sDss.iCurrentPos = 0; | 541 | sDss.iStartPos = sDss.iCurrentPos = 0; |
| 542 | } | 542 | } |
| 543 | for (; ;) { | 543 | for (; ;) { |
| 544 | pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, 0); | 544 | if (!pEncCtx->pSvcParam->iEntropyCodingModeFlag) |
| 545 | pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, 0); | ||
| 545 | iCurMbIdx = iNextMbIdx; | 546 | iCurMbIdx = iNextMbIdx; |
| 546 | pCurMb = &pMbList[ iCurMbIdx ]; | 547 | pCurMb = &pMbList[ iCurMbIdx ]; |
| 547 | 548 | ||
| @@ -555,10 +556,12 @@ TRY_REENCODING: · 7 unmodified lines | |||
| 555 | 556 | ||
| 556 | 557 | ||
| 557 | iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb); | 558 | iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb); |
| 558 | if ((iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) && (pCurMb->uiLumaQp < 50)) { | 559 | if (!pEncCtx->pSvcParam->iEntropyCodingModeFlag) { |
| 559 | pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice); | 560 | if ((iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND) && (pCurMb->uiLumaQp < 50)) { |
| 560 | UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset); | 561 | pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice); |
| 561 | goto TRY_REENCODING; | 562 | UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset); |
| 563 | goto TRY_REENCODING; | ||
| 564 | } | ||
| 562 | } | 565 | } |
| 563 | if (ENC_RETURN_SUCCESS != iEncReturn) | 566 | if (ENC_RETURN_SUCCESS != iEncReturn) |
| 564 | return iEncReturn; | 567 | return iEncReturn; |
| @@ -1115,7 +1118,8 @@ int32_t WelsMdInterMbLoop (sWelsEncCtx* pEncCtx, SSlice* pSlice, void* pWelsMd, · 550 unmodified lines | |||
| 1115 | } | 1118 | } |
| 1116 | pSlice->iMbSkipRun = 0; | 1119 | pSlice->iMbSkipRun = 0; |
| 1117 | for (;;) { | 1120 | for (;;) { |
| 1118 | pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, pSlice->iMbSkipRun); | 1121 | if (!pEncCtx->pSvcParam->iEntropyCodingModeFlag) |
| 1122 | pEncCtx->pFuncList->pfStashMBStatus (&sDss, pSlice, pSlice->iMbSkipRun); | ||
| 1119 | //point to current pMb | 1123 | //point to current pMb |
| 1120 | iCurMbIdx = iNextMbIdx; | 1124 | iCurMbIdx = iNextMbIdx; |
| 1121 | pCurMb = &pMbList[ iCurMbIdx ]; | 1125 | pCurMb = &pMbList[ iCurMbIdx ]; |
| @@ -1145,10 +1149,12 @@ TRY_REENCODING: · 23 unmodified lines | |||
| 1145 | //step (6): begin to write bit stream; if the pSlice size is controlled, the writing may be skipped | 1149 | //step (6): begin to write bit stream; if the pSlice size is controlled, the writing may be skipped |
| 1146 | 1150 | ||
| 1147 | iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb); | 1151 | iEncReturn = pEncCtx->pFuncList->pfWelsSpatialWriteMbSyn (pEncCtx, pSlice, pCurMb); |
| 1148 | if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND && (pCurMb->uiLumaQp < 50)) { | 1152 | if (!pEncCtx->pSvcParam->iEntropyCodingModeFlag) { |
| 1149 | pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice); | 1153 | if (iEncReturn == ENC_RETURN_VLCOVERFLOWFOUND && (pCurMb->uiLumaQp < 50)) { |
| 1150 | UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset); | 1154 | pSlice->iMbSkipRun = pEncCtx->pFuncList->pfStashPopMBStatus (&sDss, pSlice); |
| 1151 | goto TRY_REENCODING; | 1155 | UpdateQpForOverflow (pCurMb, kuiChromaQpIndexOffset); |
| 1156 | goto TRY_REENCODING; | ||
| 1157 | } | ||
| 1152 | } | 1158 | } |
| 1153 | if (ENC_RETURN_SUCCESS != iEncReturn) | 1159 | if (ENC_RETURN_SUCCESS != iEncReturn) |
| 1154 | return iEncReturn; | 1160 | return iEncReturn; |