History

enable cross IDR EC method

huili2 committed 12 years ago

Commit 103fa5b1 parent c5029ef6 files · +77 −50Browse files

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

Unified · Split

codec/decoder/core/src/error_concealment.cpp+9−3
@@ -41,7 +41,7 @@ · 40 unmodified lines
41namespace WelsDec {41namespace WelsDec {
42//Init42//Init
43void InitErrorCon (PWelsDecoderContext pCtx) {43void InitErrorCon (PWelsDecoderContext pCtx) {
44 if (pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY) {44 if ((pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY) || (pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY_CROSS_IDR)) {
45 pCtx->sCopyFunc.pCopyLumaFunc = WelsCopy16x16_c;45 pCtx->sCopyFunc.pCopyLumaFunc = WelsCopy16x16_c;
46 pCtx->sCopyFunc.pCopyChromaFunc = WelsCopy8x8_c;46 pCtx->sCopyFunc.pCopyChromaFunc = WelsCopy8x8_c;
47 47
@@ -79,6 +79,8 @@ void DoErrorConFrameCopy (PWelsDecoderContext pCtx) { · 31 unmodified lines
79 uint32_t uiHeightInPixelY = (pCtx->pSps->iMbHeight) << 4;79 uint32_t uiHeightInPixelY = (pCtx->pSps->iMbHeight) << 4;
80 int32_t iStrideY = pDstPic->iLinesize[0];80 int32_t iStrideY = pDstPic->iLinesize[0];
81 int32_t iStrideUV = pDstPic->iLinesize[1];81 int32_t iStrideUV = pDstPic->iLinesize[1];
82 if ((pCtx->eErrorConMethod == ERROR_CON_FRAME_COPY) && (pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag))
83 pSrcPic = NULL; //no cross IDR method, should fill in data instead of copy
82 if (pSrcPic == NULL) { //no ref pic, assign specific data to picture84 if (pSrcPic == NULL) { //no ref pic, assign specific data to picture
83 memset (pDstPic->pData[0], 128, uiHeightInPixelY * iStrideY);85 memset (pDstPic->pData[0], 128, uiHeightInPixelY * iStrideY);
84 memset (pDstPic->pData[1], 128, (uiHeightInPixelY >> 1) * iStrideUV);86 memset (pDstPic->pData[1], 128, (uiHeightInPixelY >> 1) * iStrideUV);
@@ -97,6 +99,8 @@ void DoErrorConSliceCopy (PWelsDecoderContext pCtx) { · 12 unmodified lines
97 int32_t iMbHeight = (int32_t) pCtx->pSps->iMbHeight;99 int32_t iMbHeight = (int32_t) pCtx->pSps->iMbHeight;
98 PPicture pDstPic = pCtx->pDec;100 PPicture pDstPic = pCtx->pDec;
99 PPicture pSrcPic = pCtx->pPreviousDecodedPictureInDpb;101 PPicture pSrcPic = pCtx->pPreviousDecodedPictureInDpb;
102 if ((pCtx->eErrorConMethod == ERROR_CON_SLICE_COPY) && (pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.bIdrFlag))
103 pSrcPic = NULL; //no cross IDR method, should fill in data instead of copy
100 104
101 //uint8_t *pDstData[3], *pSrcData[3];105 //uint8_t *pDstData[3], *pSrcData[3];
102 bool* pMbCorrectlyDecodedFlag = pCtx->pCurDqLayer->pMbCorrectlyDecodedFlag;106 bool* pMbCorrectlyDecodedFlag = pCtx->pCurDqLayer->pMbCorrectlyDecodedFlag;
@@ -183,9 +187,11 @@ void ImplementErrorCon (PWelsDecoderContext pCtx) { · 80 unmodified lines
183 if (ERROR_CON_DISABLE == pCtx->eErrorConMethod) {187 if (ERROR_CON_DISABLE == pCtx->eErrorConMethod) {
184 pCtx->iErrorCode |= dsBitstreamError;188 pCtx->iErrorCode |= dsBitstreamError;
185 return;189 return;
186 } else if (ERROR_CON_FRAME_COPY == pCtx->eErrorConMethod) {190 } else if ((ERROR_CON_FRAME_COPY == pCtx->eErrorConMethod)
191 || (ERROR_CON_FRAME_COPY_CROSS_IDR == pCtx->eErrorConMethod)) {
187 DoErrorConFrameCopy (pCtx);192 DoErrorConFrameCopy (pCtx);
188 } else if (ERROR_CON_SLICE_COPY == pCtx->eErrorConMethod) {193 } else if ((ERROR_CON_SLICE_COPY == pCtx->eErrorConMethod)
194 || (ERROR_CON_SLICE_COPY_CROSS_IDR == pCtx->eErrorConMethod)) {
189 DoErrorConSliceCopy (pCtx);195 DoErrorConSliceCopy (pCtx);
190 } //TODO add other EC methods here in the future196 } //TODO add other EC methods here in the future
191 pCtx->iErrorCode |= dsDataErrorConcealed;197 pCtx->iErrorCode |= dsDataErrorConcealed;

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