History

Merge pull request #713 from licaiguo/overwriteactivesps

overwriteactivesps

huili2 committed 12 years ago

Commit 7d99aa42 parents 9b03223 79ed7444 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,
@@ -422,7 +422,7 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 354 unmodified lines
422422 int32_t iSrcConsumed = 0; // consumed bit count of source bs
423423 int32_t iDstIdx = 0; //the size of current NAL after 0x03 removal and 00 00 01 removal
424424 int32_t iSrcLength = 0; //the total size of current AU or NAL
425−
425+ int32_t iRet = 0;
426426 int32_t iConsumedBytes = 0;
427427 int32_t iOffset = 0;
428428
@@ -462,7 +462,9 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 33 unmodified lines
462462
463463 iConsumedBytes = 0;
464464 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+ }
466468 if (pCtx->bAuReadyFlag) {
467469 ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
468470
@@ -481,20 +483,17 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 12 unmodified lines
481483 //Do error concealment here
482484 ImplementErrorCon (pCtx);
483485 }
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) {
489489 #ifdef LONG_TERM_REF
490− pCtx->bParamSetsLostFlag = true;
490+ pCtx->bParamSetsLostFlag = true;
491491 #else
492− pCtx->bReferenceLostAtT0Flag = true;
492+ pCtx->bReferenceLostAtT0Flag = true;
493493 #endif
494− ResetParameterSetsState (pCtx);
495− }
496− return pCtx->iErrorCode;
494+ ResetParameterSetsState (pCtx);
497495 }
496+ return pCtx->iErrorCode;
498497 }
499498
500499 pDstNal += iDstIdx; //update current position
@@ -521,7 +520,9 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 20 unmodified lines
521520
522521 iConsumedBytes = 0;
523522 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+ }
525526 if (pCtx->bAuReadyFlag) {
526527 ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
527528
@@ -537,22 +538,18 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 9 unmodified lines
537538 //Do error concealment here
538539 ImplementErrorCon (pCtx);
539540 }
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) {
545544 #ifdef LONG_TERM_REF
546− pCtx->bParamSetsLostFlag = true;
545+ pCtx->bParamSetsLostFlag = true;
547546 #else
548− pCtx->bReferenceLostAtT0Flag = true;
547+ pCtx->bReferenceLostAtT0Flag = true;
549548 #endif
550− ResetParameterSetsState (pCtx);
551− }
552− return pCtx->iErrorCode;
549+ ResetParameterSetsState (pCtx);
553550 }
551+ return pCtx->iErrorCode;
554552 }
555−
556553 pDstNal += iDstIdx;
557554 pRawData->pCurPos = pDstNal; //init the pCurPos for next NAL(s) storage
558555 } 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
575572 ResetParameterSetsState (pCtx);
576573 return pCtx->iErrorCode;
577574 }
578− //Do error concealment here
579575 ImplementErrorCon (pCtx);
580576 }
581577 }
@@ -663,7 +659,7 @@ void AssignFuncPointerForRec (PWelsDecoderContext pCtx) { · 81 unmodified lines
663659 pCtx->pIdctResAddPredFunc = IdctResAddPred_c;
664660
665661 #if defined(HAVE_NEON)
666− if ( pCtx->uiCpuFlag & WELS_CPU_NEON ) {
662+ if (pCtx->uiCpuFlag & WELS_CPU_NEON) {
667663 pCtx->pIdctResAddPredFunc = IdctResAddPred_neon;
668664
669665 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