Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 3 files). Show all
Unified · Split
| @@ -626,23 +626,25 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 625 unmodified lines | ||
| 626 | 626 | pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] = |
| 627 | 627 | 0; // set 4 reserved bytes to zero |
| 628 | 628 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); |
| 629 | − if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { | |
| 630 | − CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); | |
| 631 | − } | |
| 632 | − if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) { | |
| 633 | − iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); | |
| 634 | − } | |
| 635 | − if (pCtx->bAuReadyFlag) { | |
| 636 | − ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | |
| 629 | + if (pNalPayload) { //parse correct | |
| 630 | + if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { | |
| 631 | + CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); | |
| 632 | + } | |
| 633 | + if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) { | |
| 634 | + iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); | |
| 635 | + } | |
| 636 | + if (pCtx->bAuReadyFlag) { | |
| 637 | + ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | |
| 637 | 638 | |
| 638 | − if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | |
| 639 | + if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | |
| 639 | 640 | #ifdef LONG_TERM_REF |
| 640 | − pCtx->bParamSetsLostFlag = true; | |
| 641 | + pCtx->bParamSetsLostFlag = true; | |
| 641 | 642 | #else |
| 642 | − pCtx->bReferenceLostAtT0Flag = true; | |
| 643 | + pCtx->bReferenceLostAtT0Flag = true; | |
| 643 | 644 | #endif |
| 644 | − if (dsOutOfMemory & pCtx->iErrorCode) { | |
| 645 | − return pCtx->iErrorCode; | |
| 645 | + if (dsOutOfMemory & pCtx->iErrorCode) { | |
| 646 | + return pCtx->iErrorCode; | |
| 647 | + } | |
| 646 | 648 | } |
| 647 | 649 | } |
| 648 | 650 | } |
| @@ -682,22 +684,24 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 33 unmodified lines | ||
| 682 | 684 | pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] = |
| 683 | 685 | 0; // set 4 reserved bytes to zero |
| 684 | 686 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); |
| 685 | − if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { | |
| 686 | − CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); | |
| 687 | − } | |
| 688 | − if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) { | |
| 689 | − iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); | |
| 690 | − } | |
| 691 | − if (pCtx->bAuReadyFlag) { | |
| 692 | − ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | |
| 687 | + if (pNalPayload) { //parse correct | |
| 688 | + if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { | |
| 689 | + CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); | |
| 690 | + } | |
| 691 | + if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) { | |
| 692 | + iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); | |
| 693 | + } | |
| 694 | + if (pCtx->bAuReadyFlag) { | |
| 695 | + ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | |
| 693 | 696 | |
| 694 | − if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | |
| 697 | + if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | |
| 695 | 698 | #ifdef LONG_TERM_REF |
| 696 | − pCtx->bParamSetsLostFlag = true; | |
| 699 | + pCtx->bParamSetsLostFlag = true; | |
| 697 | 700 | #else |
| 698 | − pCtx->bReferenceLostAtT0Flag = true; | |
| 701 | + pCtx->bReferenceLostAtT0Flag = true; | |
| 699 | 702 | #endif |
| 700 | − return pCtx->iErrorCode; | |
| 703 | + return pCtx->iErrorCode; | |
| 704 | + } | |
| 701 | 705 | } |
| 702 | 706 | } |
| 703 | 707 | if (iRet) { |