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 | pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] = | 626 | pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] = |
| 627 | 0; // set 4 reserved bytes to zero | 627 | 0; // set 4 reserved bytes to zero |
| 628 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); | 628 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); |
| 629 | if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { | 629 | if (pNalPayload) { //parse correct |
| 630 | CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); | 630 | if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { |
| 631 | } | 631 | CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); |
| 632 | if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) { | 632 | } |
| 633 | iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); | 633 | if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) { |
| 634 | } | 634 | iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); |
| 635 | if (pCtx->bAuReadyFlag) { | 635 | } |
| 636 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | 636 | if (pCtx->bAuReadyFlag) { |
| 637 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | ||
| 637 | 638 | ||
| 638 | if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | 639 | if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { |
| 639 | #ifdef LONG_TERM_REF | 640 | #ifdef LONG_TERM_REF |
| 640 | pCtx->bParamSetsLostFlag = true; | 641 | pCtx->bParamSetsLostFlag = true; |
| 641 | #else | 642 | #else |
| 642 | pCtx->bReferenceLostAtT0Flag = true; | 643 | pCtx->bReferenceLostAtT0Flag = true; |
| 643 | #endif | 644 | #endif |
| 644 | if (dsOutOfMemory & pCtx->iErrorCode) { | 645 | if (dsOutOfMemory & pCtx->iErrorCode) { |
| 645 | return 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 | pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] = | 684 | pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] = |
| 683 | 0; // set 4 reserved bytes to zero | 685 | 0; // set 4 reserved bytes to zero |
| 684 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); | 686 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); |
| 685 | if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { | 687 | if (pNalPayload) { //parse correct |
| 686 | CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); | 688 | if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { |
| 687 | } | 689 | CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); |
| 688 | if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) { | 690 | } |
| 689 | iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); | 691 | if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) { |
| 690 | } | 692 | iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); |
| 691 | if (pCtx->bAuReadyFlag) { | 693 | } |
| 692 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | 694 | if (pCtx->bAuReadyFlag) { |
| 695 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | ||
| 693 | 696 | ||
| 694 | if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | 697 | if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { |
| 695 | #ifdef LONG_TERM_REF | 698 | #ifdef LONG_TERM_REF |
| 696 | pCtx->bParamSetsLostFlag = true; | 699 | pCtx->bParamSetsLostFlag = true; |
| 697 | #else | 700 | #else |
| 698 | pCtx->bReferenceLostAtT0Flag = true; | 701 | pCtx->bReferenceLostAtT0Flag = true; |
| 699 | #endif | 702 | #endif |
| 700 | return pCtx->iErrorCode; | 703 | return pCtx->iErrorCode; |
| 704 | } | ||
| 701 | } | 705 | } |
| 702 | } | 706 | } |
| 703 | if (iRet) { | 707 | if (iRet) { |