overwriteactivesps
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, |
| @@ -422,7 +422,7 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 354 unmodified lines | ||
| 422 | 422 | int32_t iSrcConsumed = 0; // consumed bit count of source bs |
| 423 | 423 | int32_t iDstIdx = 0; //the size of current NAL after 0x03 removal and 00 00 01 removal |
| 424 | 424 | int32_t iSrcLength = 0; //the total size of current AU or NAL |
| 425 | − | |
| 425 | + int32_t iRet = 0; | |
| 426 | 426 | int32_t iConsumedBytes = 0; |
| 427 | 427 | int32_t iOffset = 0; |
| 428 | 428 | |
| @@ -462,7 +462,9 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 33 unmodified lines | ||
| 462 | 462 | |
| 463 | 463 | iConsumedBytes = 0; |
| 464 | 464 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); |
| 465 | − | |
| 465 | + if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) { | |
| 466 | + iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes); | |
| 467 | + } | |
| 466 | 468 | if (pCtx->bAuReadyFlag) { |
| 467 | 469 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); |
| 468 | 470 | |
| @@ -481,20 +483,17 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 12 unmodified lines | ||
| 481 | 483 | //Do error concealment here |
| 482 | 484 | ImplementErrorCon (pCtx); |
| 483 | 485 | } |
| 484 | − | |
| 485 | − if ((IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) || IS_SEI_NAL (pCtx->sCurNalHead.eNalUnitType)) && | |
| 486 | − pNalPayload) { | |
| 487 | − if (ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes)) { | |
| 488 | − if (dsNoParamSets & pCtx->iErrorCode) { | |
| 486 | + if (iRet) { | |
| 487 | + iRet = 0; | |
| 488 | + if (dsNoParamSets & pCtx->iErrorCode) { | |
| 489 | 489 | #ifdef LONG_TERM_REF |
| 490 | − pCtx->bParamSetsLostFlag = true; | |
| 490 | + pCtx->bParamSetsLostFlag = true; | |
| 491 | 491 | #else |
| 492 | − pCtx->bReferenceLostAtT0Flag = true; | |
| 492 | + pCtx->bReferenceLostAtT0Flag = true; | |
| 493 | 493 | #endif |
| 494 | − ResetParameterSetsState (pCtx); | |
| 495 | − } | |
| 496 | − return pCtx->iErrorCode; | |
| 494 | + ResetParameterSetsState (pCtx); | |
| 497 | 495 | } |
| 496 | + return pCtx->iErrorCode; | |
| 498 | 497 | } |
| 499 | 498 | |
| 500 | 499 | pDstNal += iDstIdx; //update current position |
| @@ -521,7 +520,9 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 20 unmodified lines | ||
| 521 | 520 | |
| 522 | 521 | iConsumedBytes = 0; |
| 523 | 522 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); |
| 524 | − | |
| 523 | + if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) { | |
| 524 | + iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes); | |
| 525 | + } | |
| 525 | 526 | if (pCtx->bAuReadyFlag) { |
| 526 | 527 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); |
| 527 | 528 | |
| @@ -537,22 +538,18 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 9 unmodified lines | ||
| 537 | 538 | //Do error concealment here |
| 538 | 539 | ImplementErrorCon (pCtx); |
| 539 | 540 | } |
| 540 | − | |
| 541 | − if ((IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) || IS_SEI_NAL (pCtx->sCurNalHead.eNalUnitType)) | |
| 542 | − && pNalPayload) { | |
| 543 | − if (ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes)) { | |
| 544 | − if (dsNoParamSets & pCtx->iErrorCode) { | |
| 541 | + if (iRet) { | |
| 542 | + iRet = 0; | |
| 543 | + if (dsNoParamSets & pCtx->iErrorCode) { | |
| 545 | 544 | #ifdef LONG_TERM_REF |
| 546 | − pCtx->bParamSetsLostFlag = true; | |
| 545 | + pCtx->bParamSetsLostFlag = true; | |
| 547 | 546 | #else |
| 548 | − pCtx->bReferenceLostAtT0Flag = true; | |
| 547 | + pCtx->bReferenceLostAtT0Flag = true; | |
| 549 | 548 | #endif |
| 550 | − ResetParameterSetsState (pCtx); | |
| 551 | − } | |
| 552 | − return pCtx->iErrorCode; | |
| 549 | + ResetParameterSetsState (pCtx); | |
| 553 | 550 | } |
| 551 | + return pCtx->iErrorCode; | |
| 554 | 552 | } |
| 555 | − | |
| 556 | 553 | pDstNal += iDstIdx; |
| 557 | 554 | pRawData->pCurPos = pDstNal; //init the pCurPos for next NAL(s) storage |
| 558 | 555 | } else { /* no supplementary picture payload input, but stored a picture */ |
| @@ -575,7 +572,6 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 16 unmodified lines | ||
| 575 | 572 | ResetParameterSetsState (pCtx); |
| 576 | 573 | return pCtx->iErrorCode; |
| 577 | 574 | } |
| 578 | − //Do error concealment here | |
| 579 | 575 | ImplementErrorCon (pCtx); |
| 580 | 576 | } |
| 581 | 577 | } |
| @@ -663,7 +659,7 @@ void AssignFuncPointerForRec (PWelsDecoderContext pCtx) { · 81 unmodified lines | ||
| 663 | 659 | pCtx->pIdctResAddPredFunc = IdctResAddPred_c; |
| 664 | 660 | |
| 665 | 661 | #if defined(HAVE_NEON) |
| 666 | − if ( pCtx->uiCpuFlag & WELS_CPU_NEON ) { | |
| 662 | + if (pCtx->uiCpuFlag & WELS_CPU_NEON) { | |
| 667 | 663 | pCtx->pIdctResAddPredFunc = IdctResAddPred_neon; |
| 668 | 664 | |
| 669 | 665 | pCtx->pGetI16x16LumaPredFunc[I16_PRED_DC] = WelsDecoderI16x16LumaPredDc_neon; |