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 | extern void FreePicture (PPicture pPic); | 61 | extern void FreePicture (PPicture pPic); |
| 62 | 62 | ||
| 63 | inline void GetValueOf4Bytes (uint8_t* pDstNal, int32_t iDdstIdx) { | 63 | inline void GetValueOf4Bytes (uint8_t* pDstNal, int32_t iDdstIdx) { |
| 64 | ST32(pDstNal, iDdstIdx); | 64 | ST32 (pDstNal, iDdstIdx); |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiSize, | 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 | int32_t iSrcConsumed = 0; // consumed bit count of source bs | 422 | int32_t iSrcConsumed = 0; // consumed bit count of source bs |
| 423 | int32_t iDstIdx = 0; //the size of current NAL after 0x03 removal and 00 00 01 removal | 423 | int32_t iDstIdx = 0; //the size of current NAL after 0x03 removal and 00 00 01 removal |
| 424 | int32_t iSrcLength = 0; //the total size of current AU or NAL | 424 | int32_t iSrcLength = 0; //the total size of current AU or NAL |
| 425 | 425 | int32_t iRet = 0; | |
| 426 | int32_t iConsumedBytes = 0; | 426 | int32_t iConsumedBytes = 0; |
| 427 | int32_t iOffset = 0; | 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 | iConsumedBytes = 0; | 463 | iConsumedBytes = 0; |
| 464 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); | 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 | if (pCtx->bAuReadyFlag) { | 468 | if (pCtx->bAuReadyFlag) { |
| 467 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | 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 | //Do error concealment here | 483 | //Do error concealment here |
| 482 | ImplementErrorCon (pCtx); | 484 | ImplementErrorCon (pCtx); |
| 483 | } | 485 | } |
| 484 | 486 | if (iRet) { | |
| 485 | if ((IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) || IS_SEI_NAL (pCtx->sCurNalHead.eNalUnitType)) && | 487 | iRet = 0; |
| 486 | pNalPayload) { | 488 | if (dsNoParamSets & pCtx->iErrorCode) { |
| 487 | if (ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes)) { | ||
| 488 | if (dsNoParamSets & pCtx->iErrorCode) { | ||
| 489 | #ifdef LONG_TERM_REF | 489 | #ifdef LONG_TERM_REF |
| 490 | pCtx->bParamSetsLostFlag = true; | 490 | pCtx->bParamSetsLostFlag = true; |
| 491 | #else | 491 | #else |
| 492 | pCtx->bReferenceLostAtT0Flag = true; | 492 | pCtx->bReferenceLostAtT0Flag = true; |
| 493 | #endif | 493 | #endif |
| 494 | ResetParameterSetsState (pCtx); | 494 | ResetParameterSetsState (pCtx); |
| 495 | } | ||
| 496 | return pCtx->iErrorCode; | ||
| 497 | } | 495 | } |
| 496 | return pCtx->iErrorCode; | ||
| 498 | } | 497 | } |
| 499 | 498 | ||
| 500 | pDstNal += iDstIdx; //update current position | 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 | iConsumedBytes = 0; | 521 | iConsumedBytes = 0; |
| 523 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); | 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 | if (pCtx->bAuReadyFlag) { | 526 | if (pCtx->bAuReadyFlag) { |
| 526 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | 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 | //Do error concealment here | 538 | //Do error concealment here |
| 538 | ImplementErrorCon (pCtx); | 539 | ImplementErrorCon (pCtx); |
| 539 | } | 540 | } |
| 540 | 541 | if (iRet) { | |
| 541 | if ((IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) || IS_SEI_NAL (pCtx->sCurNalHead.eNalUnitType)) | 542 | iRet = 0; |
| 542 | && pNalPayload) { | 543 | if (dsNoParamSets & pCtx->iErrorCode) { |
| 543 | if (ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes)) { | ||
| 544 | if (dsNoParamSets & pCtx->iErrorCode) { | ||
| 545 | #ifdef LONG_TERM_REF | 544 | #ifdef LONG_TERM_REF |
| 546 | pCtx->bParamSetsLostFlag = true; | 545 | pCtx->bParamSetsLostFlag = true; |
| 547 | #else | 546 | #else |
| 548 | pCtx->bReferenceLostAtT0Flag = true; | 547 | pCtx->bReferenceLostAtT0Flag = true; |
| 549 | #endif | 548 | #endif |
| 550 | ResetParameterSetsState (pCtx); | 549 | ResetParameterSetsState (pCtx); |
| 551 | } | ||
| 552 | return pCtx->iErrorCode; | ||
| 553 | } | 550 | } |
| 551 | return pCtx->iErrorCode; | ||
| 554 | } | 552 | } |
| 555 | |||
| 556 | pDstNal += iDstIdx; | 553 | pDstNal += iDstIdx; |
| 557 | pRawData->pCurPos = pDstNal; //init the pCurPos for next NAL(s) storage | 554 | pRawData->pCurPos = pDstNal; //init the pCurPos for next NAL(s) storage |
| 558 | } else { /* no supplementary picture payload input, but stored a picture */ | 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 | ResetParameterSetsState (pCtx); | 572 | ResetParameterSetsState (pCtx); |
| 576 | return pCtx->iErrorCode; | 573 | return pCtx->iErrorCode; |
| 577 | } | 574 | } |
| 578 | //Do error concealment here | ||
| 579 | ImplementErrorCon (pCtx); | 575 | ImplementErrorCon (pCtx); |
| 580 | } | 576 | } |
| 581 | } | 577 | } |
| @@ -663,7 +659,7 @@ void AssignFuncPointerForRec (PWelsDecoderContext pCtx) { · 81 unmodified lines | |||
| 663 | pCtx->pIdctResAddPredFunc = IdctResAddPred_c; | 659 | pCtx->pIdctResAddPredFunc = IdctResAddPred_c; |
| 664 | 660 | ||
| 665 | #if defined(HAVE_NEON) | 661 | #if defined(HAVE_NEON) |
| 666 | if ( pCtx->uiCpuFlag & WELS_CPU_NEON ) { | 662 | if (pCtx->uiCpuFlag & WELS_CPU_NEON) { |
| 667 | pCtx->pIdctResAddPredFunc = IdctResAddPred_neon; | 663 | pCtx->pIdctResAddPredFunc = IdctResAddPred_neon; |
| 668 | 664 | ||
| 669 | pCtx->pGetI16x16LumaPredFunc[I16_PRED_DC] = WelsDecoderI16x16LumaPredDc_neon; | 665 | pCtx->pGetI16x16LumaPredFunc[I16_PRED_DC] = WelsDecoderI16x16LumaPredDc_neon; |