| @@ -82,6 +82,8 @@ void DoErrorConFrameCopy (PWelsDecoderContext pCtx) { · 81 unmodified lines |
| 82 | 82 | uint32_t uiHeightInPixelY = (pCtx->pSps->iMbHeight) << 4; |
| 83 | 83 | int32_t iStrideY = pDstPic->iLinesize[0]; |
| 84 | 84 | int32_t iStrideUV = pDstPic->iLinesize[1]; |
| 85 | + pCtx->iMbNum = pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight; |
| 86 | + pCtx->iMbEcedNum = pCtx->iMbNum; |
| 85 | 87 | if ((pCtx->eErrorConMethod == ERROR_CON_FRAME_COPY) && (pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag)) |
| 86 | 88 | pSrcPic = NULL; //no cross IDR method, should fill in data instead of copy |
| 87 | 89 | if (pSrcPic == NULL) { //no ref pic, assign specific data to picture |
| @@ -105,10 +107,10 @@ void DoErrorConSliceCopy (PWelsDecoderContext pCtx) { · 17 unmodified lines |
| 105 | 107 | if ((pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY) && (pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag)) |
| 106 | 108 | pSrcPic = NULL; //no cross IDR method, should fill in data instead of copy |
| 107 | 109 | |
| 108 | | − int32_t iMbNum = pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight; |
| 110 | + pCtx->iMbNum = pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight; |
| 109 | 111 | //uint8_t *pDstData[3], *pSrcData[3]; |
| 110 | 112 | bool* pMbCorrectlyDecodedFlag = pCtx->pCurDqLayer->pMbCorrectlyDecodedFlag; |
| 111 | | − int32_t iMbEcedNum = 0; |
| 113 | + pCtx->iMbEcedNum = 0; |
| 112 | 114 | //Do slice copy late |
| 113 | 115 | int32_t iMbXyIndex; |
| 114 | 116 | uint8_t* pSrcData, *pDstData; |
| @@ -118,7 +120,7 @@ void DoErrorConSliceCopy (PWelsDecoderContext pCtx) { · 3 unmodified lines |
| 118 | 120 | for (int32_t iMbX = 0; iMbX < iMbWidth; ++iMbX) { |
| 119 | 121 | iMbXyIndex = iMbY * iMbWidth + iMbX; |
| 120 | 122 | if (!pMbCorrectlyDecodedFlag[iMbXyIndex]) { |
| 121 | | − iMbEcedNum++; |
| 123 | + pCtx->iMbEcedNum++; |
| 122 | 124 | if (pSrcPic != NULL) { |
| 123 | 125 | iSrcStride = pSrcPic->iLinesize[0]; |
| 124 | 126 | //Y component |
| @@ -156,10 +158,6 @@ void DoErrorConSliceCopy (PWelsDecoderContext pCtx) { · 31 unmodified lines |
| 156 | 158 | } //!pMbCorrectlyDecodedFlag[iMbXyIndex] |
| 157 | 159 | } //iMbX |
| 158 | 160 | } //iMbY |
| 159 | | − |
| 160 | | − if (!pCtx->bFreezeOutput) |
| 161 | | − pCtx->sDecoderStatistics.uiAvgEcRatio = (pCtx->sDecoderStatistics.uiAvgEcRatio * pCtx->sDecoderStatistics.uiEcFrameNum) |
| 162 | | − + ((iMbEcedNum * 100) / iMbNum) ; |
| 163 | 161 | } |
| 164 | 162 | |
| 165 | 163 | //Do error concealment using slice MV copy method |
| @@ -368,9 +366,9 @@ void DoErrorConSliceMVCopy (PWelsDecoderContext pCtx) { · 202 unmodified lines |
| 368 | 366 | PPicture pDstPic = pCtx->pDec; |
| 369 | 367 | PPicture pSrcPic = pCtx->pPreviousDecodedPictureInDpb; |
| 370 | 368 | |
| 371 | | − int32_t iMbNum = pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight; |
| 369 | + pCtx->iMbNum = pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight; |
| 372 | 370 | bool* pMbCorrectlyDecodedFlag = pCtx->pCurDqLayer->pMbCorrectlyDecodedFlag; |
| 373 | | − int32_t iMbEcedNum = 0; |
| 371 | + pCtx->iMbEcedNum = 0; |
| 374 | 372 | int32_t iMbXyIndex; |
| 375 | 373 | uint8_t* pDstData; |
| 376 | 374 | uint32_t iDstStride = pDstPic->iLinesize[0]; |
| @@ -395,7 +393,7 @@ void DoErrorConSliceMVCopy (PWelsDecoderContext pCtx) { · 18 unmodified lines |
| 395 | 393 | for (int32_t iMbX = 0; iMbX < iMbWidth; ++iMbX) { |
| 396 | 394 | iMbXyIndex = iMbY * iMbWidth + iMbX; |
| 397 | 395 | if (!pMbCorrectlyDecodedFlag[iMbXyIndex]) { |
| 398 | | − iMbEcedNum++; |
| 396 | + pCtx->iMbEcedNum++; |
| 399 | 397 | if (pSrcPic != NULL) { |
| 400 | 398 | DoMbECMvCopy (pCtx, pDstPic, pSrcPic, iMbXyIndex, iMbX, iMbY, &sMCRefMem); |
| 401 | 399 | } else { //pSrcPic == NULL |
| @@ -422,10 +420,6 @@ void DoErrorConSliceMVCopy (PWelsDecoderContext pCtx) { · 20 unmodified lines |
| 422 | 420 | } //!pMbCorrectlyDecodedFlag[iMbXyIndex] |
| 423 | 421 | } //iMbX |
| 424 | 422 | } //iMbY |
| 425 | | − |
| 426 | | − if (!pCtx->bFreezeOutput) |
| 427 | | − pCtx->sDecoderStatistics.uiAvgEcRatio = (pCtx->sDecoderStatistics.uiAvgEcRatio * pCtx->sDecoderStatistics.uiEcFrameNum) |
| 428 | | − + ((iMbEcedNum * 100) / iMbNum) ; |
| 429 | 423 | } |
| 430 | 424 | |
| 431 | 425 | //Mark erroneous frame as Ref Pic into DPB |