History

put EC before output

root committed 12 years ago

Commit 67afd911 parent 91cd93e2 files · +18 −24Browse files

Showing the changes to codec/decoder/core/src (2 of 2 files). Show all

Unified · Split

2 files
  1. codec/decoder/core/src/decoder_core.cpp +18 −13
  2. codec/decoder/core/src/error_concealment.cpp +0 −11
codec/decoder/core/src/decoder_core.cpp+18−13
@@ -1641,11 +1641,6 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 1640 unmodified lines
16411641
16421642 WelsDecodeAccessUnitEnd (pCtx);
16431643
1644− if (!pCtx->bInstantDecFlag) {
1645− //Do error concealment here
1646− ImplementErrorCon (pCtx);
1647− }
1648−
16491644 pCtx->bNewSeqBegin = false;
16501645 WriteBackActiveParameters (pCtx);
16511646 pCtx->bNewSeqBegin = pCtx->bNewSeqBegin || pCtx->bNextNewSeqBegin;
@@ -1943,6 +1938,14 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 291 unmodified lines
19431938 #endif//#if !CODEC_FOR_TESTBED
19441939
19451940 if (dq_cur->uiLayerDqId == kuiTargetLayerDqId) {
1941+ if (!pCtx->bInstantDecFlag) {
1942+ //Do error concealment here
1943+ if (NeedErrorCon (pCtx)) {
1944+ ImplementErrorCon (pCtx);
1945+ pCtx->iTotalNumMbRec = pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight;
1946+ }
1947+ }
1948+
19461949 if (DecodeFrameConstruction (pCtx, ppDst, pDstInfo)) {
19471950 return ERR_NONE;
19481951 }
@@ -1979,15 +1982,17 @@ bool CheckAndDoEC (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstI · 30 unmodified lines
19791982 if ((pCtx->iTotalNumMbRec != 0)
19801983 && (CheckAccessUnitBoundaryExt (&pCtx->sLastNalHdrExt, &pCurNal->sNalHeaderExt, &pCtx->sLastSliceHeader,
19811984 &pCurNal->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader))) {
1982− pCtx->iTotalNumMbRec = pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight;
1983− DecodeFrameConstruction (pCtx, ppDst, pDstInfo);
1984− PPicture pCurPic = pCtx->pDec; //temporally store current picture
19851985 //Do Error Concealment here
1986− ImplementErrorCon (pCtx);
1987− pCtx->pPreviousDecodedPictureInDpb = pCurPic; //save ECed pic for future use
1988− pCtx->iPrevFrameNum = pCtx->sLastSliceHeader.iFrameNum; //save frame_num
1989− if (pCtx->bLastHasMmco5)
1990− pCtx->iPrevFrameNum = 0;
1986+ if (NeedErrorCon (pCtx)) { //should always be true!
1987+ ImplementErrorCon (pCtx);
1988+ pCtx->iTotalNumMbRec = pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight;
1989+ DecodeFrameConstruction (pCtx, ppDst, pDstInfo);
1990+ pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //save ECed pic for future use
1991+ MarkECFrameAsRef (pCtx);
1992+ pCtx->iPrevFrameNum = pCtx->sLastSliceHeader.iFrameNum; //save frame_num
1993+ if (pCtx->bLastHasMmco5)
1994+ pCtx->iPrevFrameNum = 0;
1995+ }
19911996 }
19921997 return ERR_NONE;
19931998 }
codec/decoder/core/src/error_concealment.cpp+0−11
@@ -172,9 +172,6 @@ bool NeedErrorCon (PWelsDecoderContext pCtx) { · 171 unmodified lines
172172 // ImplementErrorConceal
173173 // Do actual error concealment
174174 void ImplementErrorCon (PWelsDecoderContext pCtx) {
175− if (!NeedErrorCon (pCtx))
176− return;
177−
178175 if (ERROR_CON_DISABLE == pCtx->iErrorConMethod) {
179176 pCtx->iErrorCode |= dsBitstreamError;
180177 return;
@@ -183,14 +180,6 @@ void ImplementErrorCon (PWelsDecoderContext pCtx) { · 2 unmodified lines
183180 } else if (ERROR_CON_SLICE_COPY == pCtx->iErrorConMethod) {
184181 DoErrorConSliceCopy (pCtx);
185182 } //TODO add other EC methods here in the future
186−
187− //mark the erroneous frame as Ref pic in DPB
188− MarkECFrameAsRef (pCtx);
189− //need update frame_num due current frame is well decoded
190− pCtx->iPrevFrameNum = pCtx->pSliceHeader->iFrameNum;
191− if (pCtx->bLastHasMmco5)
192− pCtx->iPrevFrameNum = 0;
193−
194183 }
195184
196185 } // namespace WelsDec

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