History

modify decoder flowchart for non vcl AU check

huili2 committed 11 years ago

Commit b6e28491 parent de68ec64 files · +90 −96Browse files

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

Unified · Split

codec/decoder/core/src/decoder.cpp+25−26
@@ -661,25 +661,24 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 660 unmodified lines
661661 0; // set 4 reserved bytes to zero
662662 pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
663663 if (pNalPayload) { //parse correct
664− if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) {
665− CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
666− }
667664 if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) {
668665 iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3);
669666 }
670− if (pCtx->bAuReadyFlag) {
667+ CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
668+ if (pCtx->bAuReadyFlag && pCtx->pAccessUnitList->uiAvailUnitsNum != 0) {
671669 ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
670+ }
671+ }
672+ DecodeFinishUpdate (pCtx);
672673
673− if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
674+ if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
674675 #ifdef LONG_TERM_REF
675− pCtx->bParamSetsLostFlag = true;
676+ pCtx->bParamSetsLostFlag = true;
676677 #else
677− pCtx->bReferenceLostAtT0Flag = true;
678+ pCtx->bReferenceLostAtT0Flag = true;
678679 #endif
679− if (dsOutOfMemory & pCtx->iErrorCode) {
680− return pCtx->iErrorCode;
681− }
682− }
680+ if (dsOutOfMemory & pCtx->iErrorCode) {
681+ return pCtx->iErrorCode;
683682 }
684683 }
685684 if (iRet) {
@@ -720,24 +719,23 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 34 unmodified lines
720719 pRawData->pCurPos = pDstNal + iDstIdx + 4; //init, increase 4 reserved zero bytes, used to store the next NAL
721720 pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
722721 if (pNalPayload) { //parse correct
723− if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) {
724− CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
725− }
726722 if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) {
727723 iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3);
728724 }
729− if (pCtx->bAuReadyFlag) {
725+ CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
726+ if (pCtx->bAuReadyFlag && pCtx->pAccessUnitList->uiAvailUnitsNum != 0) {
730727 ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
728+ }
729+ }
730+ DecodeFinishUpdate (pCtx);
731731
732− if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
732+ if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
733733 #ifdef LONG_TERM_REF
734− pCtx->bParamSetsLostFlag = true;
734+ pCtx->bParamSetsLostFlag = true;
735735 #else
736− pCtx->bReferenceLostAtT0Flag = true;
736+ pCtx->bReferenceLostAtT0Flag = true;
737737 #endif
738− return pCtx->iErrorCode;
739− }
740− }
738+ return pCtx->iErrorCode;
741739 }
742740 if (iRet) {
743741 iRet = 0;
@@ -760,15 +758,16 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 16 unmodified lines
760758 pCtx->pAccessUnitList->uiEndPos = pCtx->pAccessUnitList->uiAvailUnitsNum - 1;
761759
762760 ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
761+ }
762+ DecodeFinishUpdate (pCtx);
763763
764− if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
764+ if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
765765 #ifdef LONG_TERM_REF
766− pCtx->bParamSetsLostFlag = true;
766+ pCtx->bParamSetsLostFlag = true;
767767 #else
768− pCtx->bReferenceLostAtT0Flag = true;
768+ pCtx->bReferenceLostAtT0Flag = true;
769769 #endif
770− return pCtx->iErrorCode;
771− }
770+ return pCtx->iErrorCode;
772771 }
773772 }
774773

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