Showing the changes to codec/decoder/core/src/manage_dec_ref.cpp (1 of 29 files). Show all
Unified · Split
| @@ -140,20 +140,24 @@ static int32_t WelsCheckAndRecoverForFutureDecoding (PWelsDecoderContext pCtx) { · 139 unmodified lines | |||
| 140 | || (ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE == pCtx->pParam->eEcActiveIdc) | 140 | || (ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE == pCtx->pParam->eEcActiveIdc) |
| 141 | || (ERROR_CON_SLICE_MV_COPY_CROSS_IDR == pCtx->pParam->eEcActiveIdc) | 141 | || (ERROR_CON_SLICE_MV_COPY_CROSS_IDR == pCtx->pParam->eEcActiveIdc) |
| 142 | || (ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE == pCtx->pParam->eEcActiveIdc)) | 142 | || (ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE == pCtx->pParam->eEcActiveIdc)) |
| 143 | && (NULL != pCtx->pPreviousDecodedPictureInDpb); | 143 | && (NULL != pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb); |
| 144 | bCopyPrevious = bCopyPrevious && (pRef->iWidthInPixel == pCtx->pPreviousDecodedPictureInDpb->iWidthInPixel) | 144 | bCopyPrevious = bCopyPrevious |
| 145 | && (pRef->iHeightInPixel == pCtx->pPreviousDecodedPictureInDpb->iHeightInPixel); | 145 | && (pRef->iWidthInPixel == pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb->iWidthInPixel) |
| 146 | && (pRef->iHeightInPixel == pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb->iHeightInPixel); | ||
| 146 | 147 | ||
| 147 | if (!bCopyPrevious) { | 148 | if (!bCopyPrevious) { |
| 148 | memset (pRef->pData[0], 128, pRef->iLinesize[0] * pRef->iHeightInPixel); | 149 | memset (pRef->pData[0], 128, pRef->iLinesize[0] * pRef->iHeightInPixel); |
| 149 | memset (pRef->pData[1], 128, pRef->iLinesize[1] * pRef->iHeightInPixel / 2); | 150 | memset (pRef->pData[1], 128, pRef->iLinesize[1] * pRef->iHeightInPixel / 2); |
| 150 | memset (pRef->pData[2], 128, pRef->iLinesize[2] * pRef->iHeightInPixel / 2); | 151 | memset (pRef->pData[2], 128, pRef->iLinesize[2] * pRef->iHeightInPixel / 2); |
| 151 | } else if (pRef == pCtx->pPreviousDecodedPictureInDpb) { | 152 | } else if (pRef == pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb) { |
| 152 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "WelsInitRefList()::EC memcpy overlap."); | 153 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "WelsInitRefList()::EC memcpy overlap."); |
| 153 | } else { | 154 | } else { |
| 154 | memcpy (pRef->pData[0], pCtx->pPreviousDecodedPictureInDpb->pData[0], pRef->iLinesize[0] * pRef->iHeightInPixel); | 155 | memcpy (pRef->pData[0], pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb->pData[0], |
| 155 | memcpy (pRef->pData[1], pCtx->pPreviousDecodedPictureInDpb->pData[1], pRef->iLinesize[1] * pRef->iHeightInPixel / 2); | 156 | pRef->iLinesize[0] * pRef->iHeightInPixel); |
| 156 | memcpy (pRef->pData[2], pCtx->pPreviousDecodedPictureInDpb->pData[2], pRef->iLinesize[2] * pRef->iHeightInPixel / 2); | 157 | memcpy (pRef->pData[1], pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb->pData[1], |
| 158 | pRef->iLinesize[1] * pRef->iHeightInPixel / 2); | ||
| 159 | memcpy (pRef->pData[2], pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb->pData[2], | ||
| 160 | pRef->iLinesize[2] * pRef->iHeightInPixel / 2); | ||
| 157 | } | 161 | } |
| 158 | pRef->iFrameNum = 0; | 162 | pRef->iFrameNum = 0; |
| 159 | pRef->iFramePoc = 0; | 163 | pRef->iFramePoc = 0; |
| @@ -577,7 +581,7 @@ int32_t WelsMarkAsRef (PWelsDecoderContext pCtx) { · 417 unmodified lines | |||
| 577 | } | 581 | } |
| 578 | } | 582 | } |
| 579 | 583 | ||
| 580 | if (pCtx->bLastHasMmco5) { | 584 | if (pCtx->pLastDecPicInfo->bLastHasMmco5) { |
| 581 | pCtx->pDec->iFrameNum = 0; | 585 | pCtx->pDec->iFrameNum = 0; |
| 582 | pCtx->pDec->iFramePoc = 0; | 586 | pCtx->pDec->iFramePoc = 0; |
| 583 | } | 587 | } |
| @@ -684,7 +688,7 @@ static int32_t MMCOProcess (PWelsDecoderContext pCtx, uint32_t uiMmcoType, · 100 unmodified lines | |||
| 684 | break; | 688 | break; |
| 685 | case MMCO_RESET: | 689 | case MMCO_RESET: |
| 686 | WelsResetRefPic (pCtx); | 690 | WelsResetRefPic (pCtx); |
| 687 | pCtx->bLastHasMmco5 = true; | 691 | pCtx->pLastDecPicInfo->bLastHasMmco5 = true; |
| 688 | break; | 692 | break; |
| 689 | case MMCO_LONG: | 693 | case MMCO_LONG: |
| 690 | if (iLongTermFrameIdx > pRefPic->iMaxLongTermFrameIdx) { | 694 | if (iLongTermFrameIdx > pRefPic->iMaxLongTermFrameIdx) { |