History

Add subSPS pre-active check in CheckActiveSPS

Haibo Zhu committed 11 years ago

Commit e47a3631 parent e041bc61 file · +18 −8Browse files

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

Unified · Split

codec/decoder/core/src/au_parser.cpp+18−8
@@ -786,18 +786,28 @@ const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) { · 785 unmodified lines
786786 return NULL;
787787 }
788788
789−bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps) {
789+bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps, bool bUseSubsetFlag) {
790790 for (int i = 0; i < MAX_LAYER_NUM; i++) {
791791 if (pCtx->pActiveLayerSps[i] == pSps)
792792 return true;
793793 }
794794 // Pre-active, will be used soon
795− if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->bSpsAvailFlags[pSps->iSpsId]
796− && pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
797− PSps pNextUsedSps =
798− pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
799− if (pNextUsedSps->iSpsId == pSps->iSpsId)
800− return true;
795+ if (bUseSubsetFlag) {
796+ if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->bSubspsAvailFlags[pSps->iSpsId]
797+ && pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
798+ PSps pNextUsedSps =
799+ pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
800+ if (pNextUsedSps->iSpsId == pSps->iSpsId)
801+ return true;
802+ }
803+ } else {
804+ if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->bSpsAvailFlags[pSps->iSpsId]
805+ && pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
806+ PSps pNextUsedSps =
807+ pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
808+ if (pNextUsedSps->iSpsId == pSps->iSpsId)
809+ return true;
810+ }
801811 }
802812 return false;
803813 }
@@ -1127,7 +1137,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 323 unmodified lines
11271137 } else {
11281138 pTmpSps = &pCtx->sSpsBuffer[iSpsId];
11291139 }
1130− if (CheckSpsActive (pCtx, pTmpSps)) {
1140+ if (CheckSpsActive (pCtx, pTmpSps, kbUseSubsetFlag)) {
11311141 // we are overwriting the active sps, copy a temp buffer
11321142 if (kbUseSubsetFlag) {
11331143 if (memcmp (&pCtx->sSubsetSpsBuffer[iSpsId], pSubsetSps, sizeof (SSubsetSps)) != 0) {

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