History

add EC MV copy

dong zhang committed 11 years ago

Commit 9425c2a1 parent 48e79d515 files · +321 −28Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+11−1
@@ -113,7 +113,9 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 112 unmodified lines
113113 if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) //no buffer output if EC is disabled and frame incomplete
114114 pDstInfo->iBufferStatus = (int32_t) (bFrameCompleteFlag
115115 && pPic->bIsComplete); // When EC disable, ECed picture not output
116− else if (pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE && pCtx->iErrorCode && bOutResChange)
116+ else if ((pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE
117+ || pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE)
118+ && pCtx->iErrorCode && bOutResChange)
117119 pCtx->bFreezeOutput = true;
118120
119121 if ((pDstInfo->iBufferStatus == 1) && (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag)) {
@@ -620,6 +622,7 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 500 unmodified lines
620622 pSliceHeadExt->pSubsetSps = pSubsetSps;
621623
622624 bIdrFlag = (!kbExtensionFlag && eNalType == NAL_UNIT_CODED_SLICE_IDR) || (kbExtensionFlag && pNalHeaderExt->bIdrFlag);
625+ pSliceHead->bIdrFlag = bIdrFlag;
623626
624627 if (pSps->uiLog2MaxFrameNum == 0) {
625628 WelsLog (pLogCtx, WELS_LOG_WARNING, "non existing SPS referenced");
@@ -1961,6 +1964,8 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 1335 unmodified lines
19611964 memcpy (&pLayerInfo.sNalHeaderExt, &pNalCur->sNalHeaderExt, sizeof (SNalUnitHeaderExt)); //confirmed_safe_unsafe_usage
19621965
19631966 pCtx->pDec->iFrameNum = pSh->iFrameNum;
1967+ pCtx->pDec->iFramePoc = pSh->iPicOrderCntLsb; // still can not obtain correct, because current do not support POCtype 2
1968+ pCtx->pDec->bIdrFlag = pNalCur->sNalHeaderExt.bIdrFlag;
19641969
19651970 memcpy (&pLayerInfo.sSliceInLayer.sSliceHeaderExt, pShExt, sizeof (SSliceHeaderExt)); //confirmed_safe_unsafe_usage
19661971 pLayerInfo.sSliceInLayer.bSliceHeaderExtFlag = pNalCur->sNalData.sVclNal.bSliceHeaderExtFlag;
@@ -2126,6 +2131,9 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 159 unmodified lines
21262131 pCtx->pDec->iLinesize,
21272132 pCtx->sExpandPicFunc.pfExpandLumaPicture, pCtx->sExpandPicFunc.pfExpandChromaPicture);
21282133 pCtx->pDec = NULL;
2134+ } else if (pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR || pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE) {
2135+ pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //store latest decoded picture for MV Copy EC
2136+ pCtx->pDec = NULL;
21292137 }
21302138 }
21312139
@@ -2156,6 +2164,8 @@ bool CheckAndFinishLastPic (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferIn · 24 unmodified lines
21562164 if (pCtx->sLastNalHdrExt.sNalUnitHeader.uiNalRefIdc > 0) {
21572165 pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //save ECed pic for future use
21582166 MarkECFrameAsRef (pCtx);
2167+ } else if (pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR || pCtx->eErrorConMethod == ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE) {
2168+ pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //save ECed pic for future MV Copy use
21592169 }
21602170 } else {
21612171 if (DecodeFrameConstruction (pCtx, ppDst, pDstInfo))

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