modify decoder flowchart for non vcl AU check
Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 4 files). Show all
Unified · Split
| @@ -661,25 +661,24 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 660 unmodified lines | ||
| 661 | 661 | 0; // set 4 reserved bytes to zero |
| 662 | 662 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); |
| 663 | 663 | if (pNalPayload) { //parse correct |
| 664 | − if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { | |
| 665 | − CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); | |
| 666 | − } | |
| 667 | 664 | if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) { |
| 668 | 665 | iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); |
| 669 | 666 | } |
| 670 | − if (pCtx->bAuReadyFlag) { | |
| 667 | + CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); | |
| 668 | + if (pCtx->bAuReadyFlag && pCtx->pAccessUnitList->uiAvailUnitsNum != 0) { | |
| 671 | 669 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); |
| 670 | + } | |
| 671 | + } | |
| 672 | + DecodeFinishUpdate (pCtx); | |
| 672 | 673 | |
| 673 | − if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | |
| 674 | + if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | |
| 674 | 675 | #ifdef LONG_TERM_REF |
| 675 | − pCtx->bParamSetsLostFlag = true; | |
| 676 | + pCtx->bParamSetsLostFlag = true; | |
| 676 | 677 | #else |
| 677 | − pCtx->bReferenceLostAtT0Flag = true; | |
| 678 | + pCtx->bReferenceLostAtT0Flag = true; | |
| 678 | 679 | #endif |
| 679 | − if (dsOutOfMemory & pCtx->iErrorCode) { | |
| 680 | − return pCtx->iErrorCode; | |
| 681 | − } | |
| 682 | − } | |
| 680 | + if (dsOutOfMemory & pCtx->iErrorCode) { | |
| 681 | + return pCtx->iErrorCode; | |
| 683 | 682 | } |
| 684 | 683 | } |
| 685 | 684 | if (iRet) { |
| @@ -720,24 +719,23 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 34 unmodified lines | ||
| 720 | 719 | pRawData->pCurPos = pDstNal + iDstIdx + 4; //init, increase 4 reserved zero bytes, used to store the next NAL |
| 721 | 720 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); |
| 722 | 721 | if (pNalPayload) { //parse correct |
| 723 | − if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { | |
| 724 | − CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); | |
| 725 | − } | |
| 726 | 722 | if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) { |
| 727 | 723 | iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); |
| 728 | 724 | } |
| 729 | − if (pCtx->bAuReadyFlag) { | |
| 725 | + CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); | |
| 726 | + if (pCtx->bAuReadyFlag && pCtx->pAccessUnitList->uiAvailUnitsNum != 0) { | |
| 730 | 727 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); |
| 728 | + } | |
| 729 | + } | |
| 730 | + DecodeFinishUpdate (pCtx); | |
| 731 | 731 | |
| 732 | − if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | |
| 732 | + if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | |
| 733 | 733 | #ifdef LONG_TERM_REF |
| 734 | − pCtx->bParamSetsLostFlag = true; | |
| 734 | + pCtx->bParamSetsLostFlag = true; | |
| 735 | 735 | #else |
| 736 | − pCtx->bReferenceLostAtT0Flag = true; | |
| 736 | + pCtx->bReferenceLostAtT0Flag = true; | |
| 737 | 737 | #endif |
| 738 | − return pCtx->iErrorCode; | |
| 739 | − } | |
| 740 | − } | |
| 738 | + return pCtx->iErrorCode; | |
| 741 | 739 | } |
| 742 | 740 | if (iRet) { |
| 743 | 741 | iRet = 0; |
| @@ -760,15 +758,16 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 16 unmodified lines | ||
| 760 | 758 | pCtx->pAccessUnitList->uiEndPos = pCtx->pAccessUnitList->uiAvailUnitsNum - 1; |
| 761 | 759 | |
| 762 | 760 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); |
| 761 | + } | |
| 762 | + DecodeFinishUpdate (pCtx); | |
| 763 | 763 | |
| 764 | − if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | |
| 764 | + if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | |
| 765 | 765 | #ifdef LONG_TERM_REF |
| 766 | − pCtx->bParamSetsLostFlag = true; | |
| 766 | + pCtx->bParamSetsLostFlag = true; | |
| 767 | 767 | #else |
| 768 | − pCtx->bReferenceLostAtT0Flag = true; | |
| 768 | + pCtx->bReferenceLostAtT0Flag = true; | |
| 769 | 769 | #endif |
| 770 | − return pCtx->iErrorCode; | |
| 771 | − } | |
| 770 | + return pCtx->iErrorCode; | |
| 772 | 771 | } |
| 773 | 772 | } |
| 774 | 773 | |