History

overwriteactivesps

Licai Guo committed 12 years ago

Commit 79ed7441 parent f141bd64 files · +114 −51Browse files

Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 4 files). Show all

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t