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
6161 extern void FreePicture (PPicture pPic);
6262
6363 inline void GetValueOf4Bytes (uint8_t* pDstNal, int32_t iDdstIdx) {
64− ST32(pDstNal, iDdstIdx);
64+ ST32 (pDstNal, iDdstIdx);
6565 }
6666
6767 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
421421 int32_t iSrcConsumed = 0; // consumed bit count of source bs
422422 int32_t iDstIdx = 0; //the size of current NAL after 0x03 removal and 00 00 01 removal
423423 int32_t iSrcLength = 0; //the total size of current AU or NAL
424−
424+ int32_t iRet = 0;
425425 int32_t iConsumedBytes = 0;
426426 int32_t iOffset = 0;
427427
@@ -461,7 +461,9 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 33 unmodified lines
461461
462462 iConsumedBytes = 0;
463463 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+ }
465467 if (pCtx->bAuReadyFlag) {
466468 ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
467469
@@ -480,20 +482,17 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 12 unmodified lines
480482 //Do error concealment here
481483 ImplementErrorCon (pCtx);
482484 }
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) {
488488 #ifdef LONG_TERM_REF
489− pCtx->bParamSetsLostFlag = true;
489+ pCtx->bParamSetsLostFlag = true;
490490 #else
491− pCtx->bReferenceLostAtT0Flag = true;
491+ pCtx->bReferenceLostAtT0Flag = true;
492492 #endif
493− ResetParameterSetsState (pCtx);
494− }
495− return pCtx->iErrorCode;
493+ ResetParameterSetsState (pCtx);
496494 }
495+ return pCtx->iErrorCode;
497496 }
498497
499498 pDstNal += iDstIdx; //update current position
@@ -520,7 +519,9 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 20 unmodified lines
520519
521520 iConsumedBytes = 0;
522521 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+ }
524525 if (pCtx->bAuReadyFlag) {
525526 ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
526527
@@ -536,22 +537,18 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 9 unmodified lines
536537 //Do error concealment here
537538 ImplementErrorCon (pCtx);
538539 }
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) {
544543 #ifdef LONG_TERM_REF
545− pCtx->bParamSetsLostFlag = true;
544+ pCtx->bParamSetsLostFlag = true;
546545 #else
547− pCtx->bReferenceLostAtT0Flag = true;
546+ pCtx->bReferenceLostAtT0Flag = true;
548547 #endif
549− ResetParameterSetsState (pCtx);
550− }
551− return pCtx->iErrorCode;
548+ ResetParameterSetsState (pCtx);
552549 }
550+ return pCtx->iErrorCode;
553551 }
554−
555552 pDstNal += iDstIdx;
556553 pRawData->pCurPos = pDstNal; //init the pCurPos for next NAL(s) storage
557554 } 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
574571 ResetParameterSetsState (pCtx);
575572 return pCtx->iErrorCode;
576573 }
577− //Do error concealment here
578574 ImplementErrorCon (pCtx);
579575 }
580576 }
@@ -662,7 +658,7 @@ void AssignFuncPointerForRec (PWelsDecoderContext pCtx) { · 81 unmodified lines
662658 pCtx->pIdctResAddPredFunc = IdctResAddPred_c;
663659
664660 #if defined(HAVE_NEON)
665− if ( pCtx->uiCpuFlag & WELS_CPU_NEON ) {
661+ if (pCtx->uiCpuFlag & WELS_CPU_NEON) {
666662 pCtx->pIdctResAddPredFunc = IdctResAddPred_neon;
667663
668664 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