Showing the changes to codec/decoder/core/src/error_concealment.cpp (1 of 29 files). Show all
Unified · Split
| @@ -83,7 +83,7 @@ void InitErrorCon (PWelsDecoderContext pCtx) { · 82 unmodified lines | ||
| 83 | 83 | //Do error concealment using frame copy method |
| 84 | 84 | void DoErrorConFrameCopy (PWelsDecoderContext pCtx) { |
| 85 | 85 | PPicture pDstPic = pCtx->pDec; |
| 86 | − PPicture pSrcPic = pCtx->pPreviousDecodedPictureInDpb; | |
| 86 | + PPicture pSrcPic = pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb; | |
| 87 | 87 | uint32_t uiHeightInPixelY = (pCtx->pSps->iMbHeight) << 4; |
| 88 | 88 | int32_t iStrideY = pDstPic->iLinesize[0]; |
| 89 | 89 | int32_t iStrideUV = pDstPic->iLinesize[1]; |
| @@ -109,7 +109,7 @@ void DoErrorConSliceCopy (PWelsDecoderContext pCtx) { · 19 unmodified lines | ||
| 109 | 109 | int32_t iMbWidth = (int32_t) pCtx->pSps->iMbWidth; |
| 110 | 110 | int32_t iMbHeight = (int32_t) pCtx->pSps->iMbHeight; |
| 111 | 111 | PPicture pDstPic = pCtx->pDec; |
| 112 | − PPicture pSrcPic = pCtx->pPreviousDecodedPictureInDpb; | |
| 112 | + PPicture pSrcPic = pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb; | |
| 113 | 113 | if ((pCtx->pParam->eEcActiveIdc == ERROR_CON_SLICE_COPY) && (pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag)) |
| 114 | 114 | pSrcPic = NULL; //no cross IDR method, should fill in data instead of copy |
| 115 | 115 | |
| @@ -266,40 +266,40 @@ void GetAvilInfoFromCorrectMb (PWelsDecoderContext pCtx) { · 150 unmodified lines | ||
| 266 | 266 | for (int32_t iMbY = 0; iMbY < iMbHeight; ++iMbY) { |
| 267 | 267 | for (int32_t iMbX = 0; iMbX < iMbWidth; ++iMbX) { |
| 268 | 268 | iMbXyIndex = iMbY * iMbWidth + iMbX; |
| 269 | − if (pMbCorrectlyDecodedFlag[iMbXyIndex] && IS_INTER (pCurDqLayer->pMbType[iMbXyIndex])) { | |
| 270 | − uint32_t iMBType = pCurDqLayer->pMbType[iMbXyIndex]; | |
| 269 | + if (pMbCorrectlyDecodedFlag[iMbXyIndex] && IS_INTER (pCurDqLayer->pDec->pMbType[iMbXyIndex])) { | |
| 270 | + uint32_t iMBType = pCurDqLayer->pDec->pMbType[iMbXyIndex]; | |
| 271 | 271 | switch (iMBType) { |
| 272 | 272 | case MB_TYPE_SKIP: |
| 273 | 273 | case MB_TYPE_16x16: |
| 274 | − iRefIdx = pCurDqLayer->pRefIndex[0][iMbXyIndex][0]; | |
| 275 | − pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pMv[0][iMbXyIndex][0][0]; | |
| 276 | − pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pMv[0][iMbXyIndex][0][1]; | |
| 274 | + iRefIdx = pCurDqLayer->pDec->pRefIndex[0][iMbXyIndex][0]; | |
| 275 | + pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][0][0]; | |
| 276 | + pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][0][1]; | |
| 277 | 277 | pCtx->pECRefPic[iRefIdx] = pCtx->sRefPic.pRefList[LIST_0][iRefIdx]; |
| 278 | 278 | iInterMbCorrectNum[iRefIdx]++; |
| 279 | 279 | break; |
| 280 | 280 | case MB_TYPE_16x8: |
| 281 | − iRefIdx = pCurDqLayer->pRefIndex[0][iMbXyIndex][0]; | |
| 282 | − pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pMv[0][iMbXyIndex][0][0]; | |
| 283 | − pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pMv[0][iMbXyIndex][0][1]; | |
| 281 | + iRefIdx = pCurDqLayer->pDec->pRefIndex[0][iMbXyIndex][0]; | |
| 282 | + pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][0][0]; | |
| 283 | + pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][0][1]; | |
| 284 | 284 | pCtx->pECRefPic[iRefIdx] = pCtx->sRefPic.pRefList[LIST_0][iRefIdx]; |
| 285 | 285 | iInterMbCorrectNum[iRefIdx]++; |
| 286 | 286 | |
| 287 | − iRefIdx = pCurDqLayer->pRefIndex[0][iMbXyIndex][8]; | |
| 288 | − pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pMv[0][iMbXyIndex][8][0]; | |
| 289 | − pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pMv[0][iMbXyIndex][8][1]; | |
| 287 | + iRefIdx = pCurDqLayer->pDec->pRefIndex[0][iMbXyIndex][8]; | |
| 288 | + pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][8][0]; | |
| 289 | + pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][8][1]; | |
| 290 | 290 | pCtx->pECRefPic[iRefIdx] = pCtx->sRefPic.pRefList[LIST_0][iRefIdx]; |
| 291 | 291 | iInterMbCorrectNum[iRefIdx]++; |
| 292 | 292 | break; |
| 293 | 293 | case MB_TYPE_8x16: |
| 294 | − iRefIdx = pCurDqLayer->pRefIndex[0][iMbXyIndex][0]; | |
| 295 | − pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pMv[0][iMbXyIndex][0][0]; | |
| 296 | − pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pMv[0][iMbXyIndex][0][1]; | |
| 294 | + iRefIdx = pCurDqLayer->pDec->pRefIndex[0][iMbXyIndex][0]; | |
| 295 | + pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][0][0]; | |
| 296 | + pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][0][1]; | |
| 297 | 297 | pCtx->pECRefPic[iRefIdx] = pCtx->sRefPic.pRefList[LIST_0][iRefIdx]; |
| 298 | 298 | iInterMbCorrectNum[iRefIdx]++; |
| 299 | 299 | |
| 300 | − iRefIdx = pCurDqLayer->pRefIndex[0][iMbXyIndex][2]; | |
| 301 | − pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pMv[0][iMbXyIndex][2][0]; | |
| 302 | − pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pMv[0][iMbXyIndex][2][1]; | |
| 300 | + iRefIdx = pCurDqLayer->pDec->pRefIndex[0][iMbXyIndex][2]; | |
| 301 | + pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][2][0]; | |
| 302 | + pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][2][1]; | |
| 303 | 303 | pCtx->pECRefPic[iRefIdx] = pCtx->sRefPic.pRefList[LIST_0][iRefIdx]; |
| 304 | 304 | iInterMbCorrectNum[iRefIdx]++; |
| 305 | 305 | break; |
| @@ -311,39 +311,39 @@ void GetAvilInfoFromCorrectMb (PWelsDecoderContext pCtx) { · 5 unmodified lines | ||
| 311 | 311 | for (i = 0; i < 4; i++) { |
| 312 | 312 | iSubMBType = pCurDqLayer->pSubMbType[iMbXyIndex][i]; |
| 313 | 313 | iIIdx = ((i >> 1) << 3) + ((i & 1) << 1); |
| 314 | − iRefIdx = pCurDqLayer->pRefIndex[0][iMbXyIndex][iIIdx]; | |
| 314 | + iRefIdx = pCurDqLayer->pDec->pRefIndex[0][iMbXyIndex][iIIdx]; | |
| 315 | 315 | pCtx->pECRefPic[iRefIdx] = pCtx->sRefPic.pRefList[LIST_0][iRefIdx]; |
| 316 | 316 | switch (iSubMBType) { |
| 317 | 317 | case SUB_MB_TYPE_8x8: |
| 318 | − pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pMv[0][iMbXyIndex][iIIdx][0]; | |
| 319 | − pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pMv[0][iMbXyIndex][iIIdx][1]; | |
| 318 | + pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][iIIdx][0]; | |
| 319 | + pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][iIIdx][1]; | |
| 320 | 320 | iInterMbCorrectNum[iRefIdx]++; |
| 321 | 321 | |
| 322 | 322 | break; |
| 323 | 323 | case SUB_MB_TYPE_8x4: |
| 324 | − pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pMv[0][iMbXyIndex][iIIdx][0]; | |
| 325 | − pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pMv[0][iMbXyIndex][iIIdx][1]; | |
| 324 | + pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][iIIdx][0]; | |
| 325 | + pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][iIIdx][1]; | |
| 326 | 326 | |
| 327 | 327 | |
| 328 | − pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pMv[0][iMbXyIndex][iIIdx + 4][0]; | |
| 329 | − pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pMv[0][iMbXyIndex][iIIdx + 4][1]; | |
| 328 | + pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][iIIdx + 4][0]; | |
| 329 | + pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][iIIdx + 4][1]; | |
| 330 | 330 | iInterMbCorrectNum[iRefIdx] += 2; |
| 331 | 331 | |
| 332 | 332 | break; |
| 333 | 333 | case SUB_MB_TYPE_4x8: |
| 334 | − pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pMv[0][iMbXyIndex][iIIdx][0]; | |
| 335 | − pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pMv[0][iMbXyIndex][iIIdx][1]; | |
| 334 | + pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][iIIdx][0]; | |
| 335 | + pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][iIIdx][1]; | |
| 336 | 336 | |
| 337 | 337 | |
| 338 | − pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pMv[0][iMbXyIndex][iIIdx + 1][0]; | |
| 339 | − pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pMv[0][iMbXyIndex][iIIdx + 1][1]; | |
| 338 | + pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][iIIdx + 1][0]; | |
| 339 | + pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][iIIdx + 1][1]; | |
| 340 | 340 | iInterMbCorrectNum[iRefIdx] += 2; |
| 341 | 341 | break; |
| 342 | 342 | case SUB_MB_TYPE_4x4: { |
| 343 | 343 | for (j = 0; j < 4; j++) { |
| 344 | 344 | iJIdx = ((j >> 1) << 2) + (j & 1); |
| 345 | − pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pMv[0][iMbXyIndex][iIIdx + iJIdx][0]; | |
| 346 | − pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pMv[0][iMbXyIndex][iIIdx + iJIdx][1]; | |
| 345 | + pCtx->iECMVs[iRefIdx][0] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][iIIdx + iJIdx][0]; | |
| 346 | + pCtx->iECMVs[iRefIdx][1] += pCurDqLayer->pDec->pMv[0][iMbXyIndex][iIIdx + iJIdx][1]; | |
| 347 | 347 | } |
| 348 | 348 | iInterMbCorrectNum[iRefIdx] += 4; |
| 349 | 349 | } |
| @@ -372,7 +372,7 @@ void DoErrorConSliceMVCopy (PWelsDecoderContext pCtx) { · 22 unmodified lines | ||
| 372 | 372 | int32_t iMbWidth = (int32_t) pCtx->pSps->iMbWidth; |
| 373 | 373 | int32_t iMbHeight = (int32_t) pCtx->pSps->iMbHeight; |
| 374 | 374 | PPicture pDstPic = pCtx->pDec; |
| 375 | − PPicture pSrcPic = pCtx->pPreviousDecodedPictureInDpb; | |
| 375 | + PPicture pSrcPic = pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb; | |
| 376 | 376 | |
| 377 | 377 | bool* pMbCorrectlyDecodedFlag = pCtx->pCurDqLayer->pMbCorrectlyDecodedFlag; |
| 378 | 378 | int32_t iMbXyIndex; |