Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 1 file). Show all
Unified · Split
| @@ -786,18 +786,28 @@ const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) { · 785 unmodified lines | ||
| 786 | 786 | return NULL; |
| 787 | 787 | } |
| 788 | 788 | |
| 789 | −bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps) { | |
| 789 | +bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps, bool bUseSubsetFlag) { | |
| 790 | 790 | for (int i = 0; i < MAX_LAYER_NUM; i++) { |
| 791 | 791 | if (pCtx->pActiveLayerSps[i] == pSps) |
| 792 | 792 | return true; |
| 793 | 793 | } |
| 794 | 794 | // 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 | + } | |
| 801 | 811 | } |
| 802 | 812 | return false; |
| 803 | 813 | } |
| @@ -1127,7 +1137,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 323 unmodified lines | ||
| 1127 | 1137 | } else { |
| 1128 | 1138 | pTmpSps = &pCtx->sSpsBuffer[iSpsId]; |
| 1129 | 1139 | } |
| 1130 | − if (CheckSpsActive (pCtx, pTmpSps)) { | |
| 1140 | + if (CheckSpsActive (pCtx, pTmpSps, kbUseSubsetFlag)) { | |
| 1131 | 1141 | // we are overwriting the active sps, copy a temp buffer |
| 1132 | 1142 | if (kbUseSubsetFlag) { |
| 1133 | 1143 | if (memcmp (&pCtx->sSubsetSpsBuffer[iSpsId], pSubsetSps, sizeof (SSubsetSps)) != 0) { |