History

re-structure SWelsDecoderContext and others and prepare for the support of multi-threading support.

xiaotiansf committed 7 years ago

Commit 2f5ecec1 parent 9ed97c729 files · +2285 −1568Browse files

Showing the changes to codec/decoder/core/src/manage_dec_ref.cpp (1 of 29 files). Show all

Unified · Split

codec/decoder/core/src/manage_dec_ref.cpp+13−9
@@ -140,20 +140,24 @@ static int32_t WelsCheckAndRecoverForFutureDecoding (PWelsDecoderContext pCtx) { · 139 unmodified lines
140140 || (ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE == pCtx->pParam->eEcActiveIdc)
141141 || (ERROR_CON_SLICE_MV_COPY_CROSS_IDR == pCtx->pParam->eEcActiveIdc)
142142 || (ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE == pCtx->pParam->eEcActiveIdc))
143− && (NULL != pCtx->pPreviousDecodedPictureInDpb);
144− bCopyPrevious = bCopyPrevious && (pRef->iWidthInPixel == pCtx->pPreviousDecodedPictureInDpb->iWidthInPixel)
145− && (pRef->iHeightInPixel == pCtx->pPreviousDecodedPictureInDpb->iHeightInPixel);
143+ && (NULL != pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb);
144+ bCopyPrevious = bCopyPrevious
145+ && (pRef->iWidthInPixel == pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb->iWidthInPixel)
146+ && (pRef->iHeightInPixel == pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb->iHeightInPixel);
146147
147148 if (!bCopyPrevious) {
148149 memset (pRef->pData[0], 128, pRef->iLinesize[0] * pRef->iHeightInPixel);
149150 memset (pRef->pData[1], 128, pRef->iLinesize[1] * pRef->iHeightInPixel / 2);
150151 memset (pRef->pData[2], 128, pRef->iLinesize[2] * pRef->iHeightInPixel / 2);
151− } else if (pRef == pCtx->pPreviousDecodedPictureInDpb) {
152+ } else if (pRef == pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb) {
152153 WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "WelsInitRefList()::EC memcpy overlap.");
153154 } else {
154− memcpy (pRef->pData[0], pCtx->pPreviousDecodedPictureInDpb->pData[0], pRef->iLinesize[0] * pRef->iHeightInPixel);
155− memcpy (pRef->pData[1], pCtx->pPreviousDecodedPictureInDpb->pData[1], pRef->iLinesize[1] * pRef->iHeightInPixel / 2);
156− memcpy (pRef->pData[2], pCtx->pPreviousDecodedPictureInDpb->pData[2], pRef->iLinesize[2] * pRef->iHeightInPixel / 2);
155+ memcpy (pRef->pData[0], pCtx->pLastDecPicInfo->pPreviousDecodedPictureInDpb->pData[0],
156+ pRef->iLinesize[0] * pRef->iHeightInPixel);
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);
157161 }
158162 pRef->iFrameNum = 0;
159163 pRef->iFramePoc = 0;
@@ -577,7 +581,7 @@ int32_t WelsMarkAsRef (PWelsDecoderContext pCtx) { · 417 unmodified lines
577581 }
578582 }
579583
580− if (pCtx->bLastHasMmco5) {
584+ if (pCtx->pLastDecPicInfo->bLastHasMmco5) {
581585 pCtx->pDec->iFrameNum = 0;
582586 pCtx->pDec->iFramePoc = 0;
583587 }
@@ -684,7 +688,7 @@ static int32_t MMCOProcess (PWelsDecoderContext pCtx, uint32_t uiMmcoType, · 100 unmodified lines
684688 break;
685689 case MMCO_RESET:
686690 WelsResetRefPic (pCtx);
687− pCtx->bLastHasMmco5 = true;
691+ pCtx->pLastDecPicInfo->bLastHasMmco5 = true;
688692 break;
689693 case MMCO_LONG:
690694 if (iLongTermFrameIdx > pRefPic->iMaxLongTermFrameIdx) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t