diff --git a/codec/decoder/core/src/decode_slice.cpp b/codec/decoder/core/src/decode_slice.cpp index dca0d5e0..c78cab28 100644 --- a/codec/decoder/core/src/decode_slice.cpp +++ b/codec/decoder/core/src/decode_slice.cpp @@ -93,7 +93,11 @@ int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx) { } ++iCountNumMb; - ++pCtx->iTotalNumMbRec; + if (!pCurLayer->pMbCorrectlyDecodedFlag[iNextMbXyIndex]) { //already con-ed, overwrite + pCurLayer->pMbCorrectlyDecodedFlag[iNextMbXyIndex] = true; + ++pCtx->iTotalNumMbRec; + } + if (iCountNumMb >= iTotalNumMb) { break; } @@ -394,7 +398,6 @@ int32_t WelsDecodeSlice (PWelsDecoderContext pCtx, bool bFirstSliceInLayer, PNal } ++pSlice->iTotalMbInCurSlice; - pCurLayer->pMbCorrectlyDecodedFlag[iNextMbXyIndex] = true; if (pSliceHeader->pPps->uiNumSliceGroups > 1) { iNextMbXyIndex = FmoNextMb (pFmo, iNextMbXyIndex);