History

add EC method to freeze sequence when resolution changed and decoding IDR error

huili2 committed 12 years ago

Commit 0d16fd61 parent aed7b237 files · +33 −6Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+12−0
@@ -83,6 +83,7 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 82 unmodified lines
8383 } else if (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag
8484 && (pCtx->iErrorCode == dsErrorFree)) { //complete non-ECed IDR frame done
8585 pCtx->pDec->bIsComplete = true;
86+ pCtx->bFreezeOutput = false;
8687 }
8788
8889 pCtx->iTotalNumMbRec = 0;
@@ -103,9 +104,15 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 14 unmodified lines
103104 ppDst[2] = ppDst[2] + pCtx->sFrameCrop.iTopOffset * pPic->iLinesize[1] + pCtx->sFrameCrop.iLeftOffset;
104105 pDstInfo->iBufferStatus = 1;
105106
107+ bool bOutResChange = (pCtx->iLastImgWidthInPixel != pDstInfo->UsrData.sSystemBuffer.iWidth)
108+ || (pCtx->iLastImgHeightInPixel != pDstInfo->UsrData.sSystemBuffer.iHeight);
109+ pCtx->iLastImgWidthInPixel = pDstInfo->UsrData.sSystemBuffer.iWidth;
110+ pCtx->iLastImgHeightInPixel = pDstInfo->UsrData.sSystemBuffer.iHeight;
106111 if (pCtx->eErrorConMethod == ERROR_CON_DISABLE) //no buffer output if EC is disabled and frame incomplete
107112 pDstInfo->iBufferStatus = (int32_t) (bFrameCompleteFlag
108113 && pPic->bIsComplete); // When EC disable, ECed picture not output
114+ else if (pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY_CROSS_IDR_FREEZE_RES_CHANGE && pCtx->iErrorCode && bOutResChange)
115+ pCtx->bFreezeOutput = true;
109116
110117
111118 if ((pDstInfo->iBufferStatus == 1) && (pCurDq->sLayerInfo.sNalHeaderExt.bIdrFlag)) {
@@ -120,6 +127,8 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 8 unmodified lines
120127 pCtx->iErrorCode |= dsBitstreamError;
121128 return -1;
122129 }
130+ if (pCtx->bFreezeOutput)
131+ pDstInfo->iBufferStatus = 0;
123132
124133 return 0;
125134 }
@@ -394,6 +403,9 @@ int32_t WelsInitMemory (PWelsDecoderContext pCtx) { · 268 unmodified lines
394403 pCtx->bEndOfStreamFlag = false;
395404 pCtx->iImgWidthInPixel = 0;
396405 pCtx->iImgHeightInPixel = 0;
406+ pCtx->iLastImgWidthInPixel = 0;
407+ pCtx->iLastImgHeightInPixel = 0;
408+ pCtx->bFreezeOutput = false;
397409
398410 return ERR_NONE;
399411 }

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