Merge pull request #1789 from huili2/bugfix_checkspsactive

bug fix for multi-layer active sps check
This commit is contained in:
HaiboZhu 2015-02-04 09:13:18 +08:00
commit 442230a91d

View File

@ -832,18 +832,30 @@ bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps, bool bUseSubsetFlag) {
if (bUseSubsetFlag) {
if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->bSubspsAvailFlags[pSps->iSpsId]
&& pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
PSps pNextUsedSps =
pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
if (pNextUsedSps->iSpsId == pSps->iSpsId)
return true;
int i = 0, iNum = (int32_t) pCtx->pAccessUnitList->uiAvailUnitsNum;
while (i < iNum) {
PNalUnit pNalUnit = pCtx->pAccessUnitList->pNalUnitsList[i];
if (pNalUnit->sNalData.sVclNal.bSliceHeaderExtFlag) { //ext data
PSps pNextUsedSps = pNalUnit->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
if (pNextUsedSps->iSpsId == pSps->iSpsId)
return true;
}
++i;
}
}
} else {
if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->bSpsAvailFlags[pSps->iSpsId]
&& pCtx->pAccessUnitList->uiAvailUnitsNum > 0) {
PSps pNextUsedSps =
pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
if (pNextUsedSps->iSpsId == pSps->iSpsId)
return true;
int i = 0, iNum = (int32_t) pCtx->pAccessUnitList->uiAvailUnitsNum;
while (i < iNum) {
PNalUnit pNalUnit = pCtx->pAccessUnitList->pNalUnitsList[i];
if (!pNalUnit->sNalData.sVclNal.bSliceHeaderExtFlag) { //non-ext data
PSps pNextUsedSps = pNalUnit->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
if (pNextUsedSps->iSpsId == pSps->iSpsId)
return true;
}
++i;
}
}
}
return false;