Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 4 files). Show all
Unified · Split
| @@ -61,7 +61,7 @@ extern PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth · 60 unmodified lines | ||
| 61 | 61 | extern void FreePicture (PPicture pPic); |
| 62 | 62 | |
| 63 | 63 | inline void GetValueOf4Bytes (uint8_t* pDstNal, int32_t iDdstIdx) { |
| 64 | − ST32(pDstNal, iDdstIdx); | |
| 64 | + ST32 (pDstNal, iDdstIdx); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiSize, |
| @@ -421,7 +421,7 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 353 unmodified lines | ||
| 421 | 421 | int32_t iSrcConsumed = 0; // consumed bit count of source bs |
| 422 | 422 | int32_t iDstIdx = 0; //the size of current NAL after 0x03 removal and 00 00 01 removal |
| 423 | 423 | int32_t iSrcLength = 0; //the total size of current AU or NAL |
| 424 | − | |
| 424 | + int32_t iRet = 0; | |
| 425 | 425 | int32_t iConsumedBytes = 0; |
| 426 | 426 | int32_t iOffset = 0; |
| 427 | 427 | |
| @@ -461,7 +461,9 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 33 unmodified lines | ||
| 461 | 461 | |
| 462 | 462 | iConsumedBytes = 0; |
| 463 | 463 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); |
| 464 | − | |
| 464 | + if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) { | |
| 465 | + iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes); | |
| 466 | + } | |
| 465 | 467 | if (pCtx->bAuReadyFlag) { |
| 466 | 468 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); |
| 467 | 469 | |
| @@ -480,20 +482,17 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 12 unmodified lines | ||
| 480 | 482 | //Do error concealment here |
| 481 | 483 | ImplementErrorCon (pCtx); |
| 482 | 484 | } |
| 483 | − | |
| 484 | − if ((IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) || IS_SEI_NAL (pCtx->sCurNalHead.eNalUnitType)) && | |
| 485 | − pNalPayload) { | |
| 486 | − if (ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes)) { | |
| 487 | − if (dsNoParamSets & pCtx->iErrorCode) { | |
| 485 | + if (iRet) { | |
| 486 | + iRet = 0; | |
| 487 | + if (dsNoParamSets & pCtx->iErrorCode) { | |
| 488 | 488 | #ifdef LONG_TERM_REF |
| 489 | − pCtx->bParamSetsLostFlag = true; | |
| 489 | + pCtx->bParamSetsLostFlag = true; | |
| 490 | 490 | #else |
| 491 | − pCtx->bReferenceLostAtT0Flag = true; | |
| 491 | + pCtx->bReferenceLostAtT0Flag = true; | |
| 492 | 492 | #endif |
| 493 | − ResetParameterSetsState (pCtx); | |
| 494 | − } | |
| 495 | − return pCtx->iErrorCode; | |
| 493 | + ResetParameterSetsState (pCtx); | |
| 496 | 494 | } |
| 495 | + return pCtx->iErrorCode; | |
| 497 | 496 | } |
| 498 | 497 | |
| 499 | 498 | pDstNal += iDstIdx; //update current position |
| @@ -520,7 +519,9 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 20 unmodified lines | ||
| 520 | 519 | |
| 521 | 520 | iConsumedBytes = 0; |
| 522 | 521 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); |
| 523 | − | |
| 522 | + if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) { | |
| 523 | + iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes); | |
| 524 | + } | |
| 524 | 525 | if (pCtx->bAuReadyFlag) { |
| 525 | 526 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); |
| 526 | 527 | |
| @@ -536,22 +537,18 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 9 unmodified lines | ||
| 536 | 537 | //Do error concealment here |
| 537 | 538 | ImplementErrorCon (pCtx); |
| 538 | 539 | } |
| 539 | − | |
| 540 | − if ((IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) || IS_SEI_NAL (pCtx->sCurNalHead.eNalUnitType)) | |
| 541 | − && pNalPayload) { | |
| 542 | − if (ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes)) { | |
| 543 | − if (dsNoParamSets & pCtx->iErrorCode) { | |
| 540 | + if (iRet) { | |
| 541 | + iRet = 0; | |
| 542 | + if (dsNoParamSets & pCtx->iErrorCode) { | |
| 544 | 543 | #ifdef LONG_TERM_REF |
| 545 | − pCtx->bParamSetsLostFlag = true; | |
| 544 | + pCtx->bParamSetsLostFlag = true; | |
| 546 | 545 | #else |
| 547 | − pCtx->bReferenceLostAtT0Flag = true; | |
| 546 | + pCtx->bReferenceLostAtT0Flag = true; | |
| 548 | 547 | #endif |
| 549 | − ResetParameterSetsState (pCtx); | |
| 550 | − } | |
| 551 | − return pCtx->iErrorCode; | |
| 548 | + ResetParameterSetsState (pCtx); | |
| 552 | 549 | } |
| 550 | + return pCtx->iErrorCode; | |
| 553 | 551 | } |
| 554 | − | |
| 555 | 552 | pDstNal += iDstIdx; |
| 556 | 553 | pRawData->pCurPos = pDstNal; //init the pCurPos for next NAL(s) storage |
| 557 | 554 | } else { /* no supplementary picture payload input, but stored a picture */ |
| @@ -574,7 +571,6 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 16 unmodified lines | ||
| 574 | 571 | ResetParameterSetsState (pCtx); |
| 575 | 572 | return pCtx->iErrorCode; |
| 576 | 573 | } |
| 577 | − //Do error concealment here | |
| 578 | 574 | ImplementErrorCon (pCtx); |
| 579 | 575 | } |
| 580 | 576 | } |
| @@ -662,7 +658,7 @@ void AssignFuncPointerForRec (PWelsDecoderContext pCtx) { · 81 unmodified lines | ||
| 662 | 658 | pCtx->pIdctResAddPredFunc = IdctResAddPred_c; |
| 663 | 659 | |
| 664 | 660 | #if defined(HAVE_NEON) |
| 665 | − if ( pCtx->uiCpuFlag & WELS_CPU_NEON ) { | |
| 661 | + if (pCtx->uiCpuFlag & WELS_CPU_NEON) { | |
| 666 | 662 | pCtx->pIdctResAddPredFunc = IdctResAddPred_neon; |
| 667 | 663 | |
| 668 | 664 | pCtx->pGetI16x16LumaPredFunc[I16_PRED_DC] = WelsDecoderI16x16LumaPredDc_neon; |