Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 29 files). Show all
Unified · Split
| @@ -148,48 +148,50 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 147 unmodified lines | ||
| 148 | 148 | ++ (*pConsumedBytes); |
| 149 | 149 | |
| 150 | 150 | if (! (IS_SEI_NAL (pNalUnitHeader->eNalUnitType) || IS_SPS_NAL (pNalUnitHeader->eNalUnitType) |
| 151 | − || IS_AU_DELIMITER_NAL (pNalUnitHeader->eNalUnitType) || pCtx->bSpsExistAheadFlag)) { | |
| 152 | − if (pCtx->bPrintFrameErrorTraceFlag && pCtx->iSpsErrorIgnored == 0) { | |
| 151 | + || IS_AU_DELIMITER_NAL (pNalUnitHeader->eNalUnitType) || pCtx->sSpsPpsCtx.bSpsExistAheadFlag)) { | |
| 152 | + if (pCtx->bPrintFrameErrorTraceFlag && pCtx->sSpsPpsCtx.iSpsErrorIgnored == 0) { | |
| 153 | 153 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 154 | 154 | "parse_nal(), no exist Sequence Parameter Sets ahead of sequence when try to decode NAL(type:%d).", |
| 155 | 155 | pNalUnitHeader->eNalUnitType); |
| 156 | 156 | } else { |
| 157 | − pCtx->iSpsErrorIgnored++; | |
| 157 | + pCtx->sSpsPpsCtx.iSpsErrorIgnored++; | |
| 158 | 158 | } |
| 159 | − pCtx->sDecoderStatistics.iSpsNoExistNalNum++; | |
| 159 | + pCtx->pDecoderStatistics->iSpsNoExistNalNum++; | |
| 160 | 160 | pCtx->iErrorCode = dsNoParamSets; |
| 161 | 161 | return NULL; |
| 162 | 162 | } |
| 163 | − pCtx->iSpsErrorIgnored = 0; | |
| 163 | + pCtx->sSpsPpsCtx.iSpsErrorIgnored = 0; | |
| 164 | 164 | if (! (IS_SEI_NAL (pNalUnitHeader->eNalUnitType) || IS_PARAM_SETS_NALS (pNalUnitHeader->eNalUnitType) |
| 165 | − || IS_AU_DELIMITER_NAL (pNalUnitHeader->eNalUnitType) || pCtx->bPpsExistAheadFlag)) { | |
| 166 | − if (pCtx->bPrintFrameErrorTraceFlag && pCtx->iPpsErrorIgnored == 0) { | |
| 165 | + || IS_AU_DELIMITER_NAL (pNalUnitHeader->eNalUnitType) || pCtx->sSpsPpsCtx.bPpsExistAheadFlag)) { | |
| 166 | + if (pCtx->bPrintFrameErrorTraceFlag && pCtx->sSpsPpsCtx.iPpsErrorIgnored == 0) { | |
| 167 | 167 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 168 | 168 | "parse_nal(), no exist Picture Parameter Sets ahead of sequence when try to decode NAL(type:%d).", |
| 169 | 169 | pNalUnitHeader->eNalUnitType); |
| 170 | 170 | } else { |
| 171 | − pCtx->iPpsErrorIgnored++; | |
| 171 | + pCtx->sSpsPpsCtx.iPpsErrorIgnored++; | |
| 172 | 172 | } |
| 173 | − pCtx->sDecoderStatistics.iPpsNoExistNalNum++; | |
| 173 | + pCtx->pDecoderStatistics->iPpsNoExistNalNum++; | |
| 174 | 174 | pCtx->iErrorCode = dsNoParamSets; |
| 175 | 175 | return NULL; |
| 176 | 176 | } |
| 177 | − pCtx->iPpsErrorIgnored = 0; | |
| 178 | − if ((IS_VCL_NAL_AVC_BASE (pNalUnitHeader->eNalUnitType) && ! (pCtx->bSpsExistAheadFlag || pCtx->bPpsExistAheadFlag)) || | |
| 179 | − (IS_NEW_INTRODUCED_SVC_NAL (pNalUnitHeader->eNalUnitType) && ! (pCtx->bSpsExistAheadFlag || pCtx->bSubspsExistAheadFlag | |
| 180 | − || pCtx->bPpsExistAheadFlag))) { | |
| 181 | − if (pCtx->bPrintFrameErrorTraceFlag && pCtx->iSubSpsErrorIgnored == 0) { | |
| 177 | + pCtx->sSpsPpsCtx.iPpsErrorIgnored = 0; | |
| 178 | + if ((IS_VCL_NAL_AVC_BASE (pNalUnitHeader->eNalUnitType) && ! (pCtx->sSpsPpsCtx.bSpsExistAheadFlag | |
| 179 | + || pCtx->sSpsPpsCtx.bPpsExistAheadFlag)) || | |
| 180 | + (IS_NEW_INTRODUCED_SVC_NAL (pNalUnitHeader->eNalUnitType) && ! (pCtx->sSpsPpsCtx.bSpsExistAheadFlag | |
| 181 | + || pCtx->sSpsPpsCtx.bSubspsExistAheadFlag | |
| 182 | + || pCtx->sSpsPpsCtx.bPpsExistAheadFlag))) { | |
| 183 | + if (pCtx->bPrintFrameErrorTraceFlag && pCtx->sSpsPpsCtx.iSubSpsErrorIgnored == 0) { | |
| 182 | 184 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 183 | 185 | "ParseNalHeader(), no exist Parameter Sets ahead of sequence when try to decode slice(type:%d).", |
| 184 | 186 | pNalUnitHeader->eNalUnitType); |
| 185 | 187 | } else { |
| 186 | − pCtx->iSubSpsErrorIgnored++; | |
| 188 | + pCtx->sSpsPpsCtx.iSubSpsErrorIgnored++; | |
| 187 | 189 | } |
| 188 | − pCtx->sDecoderStatistics.iSubSpsNoExistNalNum++; | |
| 190 | + pCtx->pDecoderStatistics->iSubSpsNoExistNalNum++; | |
| 189 | 191 | pCtx->iErrorCode |= dsNoParamSets; |
| 190 | 192 | return NULL; |
| 191 | 193 | } |
| 192 | − pCtx->iSubSpsErrorIgnored = 0; | |
| 194 | + pCtx->sSpsPpsCtx.iSubSpsErrorIgnored = 0; | |
| 193 | 195 | |
| 194 | 196 | switch (pNalUnitHeader->eNalUnitType) { |
| 195 | 197 | case NAL_UNIT_AU_DELIMITER: |
| @@ -201,7 +203,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 5 unmodified lines | ||
| 201 | 203 | break; |
| 202 | 204 | |
| 203 | 205 | case NAL_UNIT_PREFIX: |
| 204 | − pCurNal = &pCtx->sPrefixNal; | |
| 206 | + pCurNal = &pCtx->sSpsPpsCtx.sPrefixNal; | |
| 205 | 207 | pCurNal->uiTimeStamp = pCtx->uiTimeStamp; |
| 206 | 208 | |
| 207 | 209 | if (iNalSize < NAL_UNIT_HEADER_EXT_SIZE) { |
| @@ -365,9 +367,9 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 157 unmodified lines | ||
| 365 | 367 | memcpy (pSavedData->pCurPos + iStartDeltaByte, pSrcNal, iActualLen); |
| 366 | 368 | pSavedData->pCurPos += iStartDeltaByte + iActualLen; |
| 367 | 369 | } |
| 368 | − if (NAL_UNIT_PREFIX == pCtx->sPrefixNal.sNalHeaderExt.sNalUnitHeader.eNalUnitType) { | |
| 369 | − if (pCtx->sPrefixNal.sNalData.sPrefixNal.bPrefixNalCorrectFlag) { | |
| 370 | − PrefetchNalHeaderExtSyntax (pCtx, pCurNal, &pCtx->sPrefixNal); | |
| 370 | + if (NAL_UNIT_PREFIX == pCtx->sSpsPpsCtx.sPrefixNal.sNalHeaderExt.sNalUnitHeader.eNalUnitType) { | |
| 371 | + if (pCtx->sSpsPpsCtx.sPrefixNal.sNalData.sPrefixNal.bPrefixNalCorrectFlag) { | |
| 372 | + PrefetchNalHeaderExtSyntax (pCtx, pCurNal, &pCtx->sSpsPpsCtx.sPrefixNal); | |
| 371 | 373 | } |
| 372 | 374 | } |
| 373 | 375 | |
| @@ -496,8 +498,8 @@ bool CheckAccessUnitBoundary (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, · 122 unmodified lines | ||
| 496 | 498 | const PNalUnitHeaderExt kpCurNalHeaderExt = &kpCurNal->sNalHeaderExt; |
| 497 | 499 | const SSliceHeader* kpLastSliceHeader = &kpLastNal->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader; |
| 498 | 500 | const SSliceHeader* kpCurSliceHeader = &kpCurNal->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader; |
| 499 | − if (pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != NULL | |
| 500 | − && pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != kpSps) { | |
| 501 | + if (pCtx->sSpsPpsCtx.pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != NULL | |
| 502 | + && pCtx->sSpsPpsCtx.pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != kpSps) { | |
| 501 | 503 | return true; // the active sps changed, new sequence begins, so the current au is ready |
| 502 | 504 | } |
| 503 | 505 | |
| @@ -548,8 +550,8 @@ bool CheckAccessUnitBoundary (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, · 44 unmodified lines | ||
| 548 | 550 | |
| 549 | 551 | bool CheckNextAuNewSeq (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, const PSps kpSps) { |
| 550 | 552 | const PNalUnitHeaderExt kpCurNalHeaderExt = &kpCurNal->sNalHeaderExt; |
| 551 | − if (pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != NULL | |
| 552 | − && pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != kpSps) | |
| 553 | + if (pCtx->sSpsPpsCtx.pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != NULL | |
| 554 | + && pCtx->sSpsPpsCtx.pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != kpSps) | |
| 553 | 555 | return true; |
| 554 | 556 | if (kpCurNalHeaderExt->bIdrFlag) |
| 555 | 557 | return true; |
| @@ -620,7 +622,7 @@ int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t · 64 unmodified lines | ||
| 620 | 622 | return iErr; |
| 621 | 623 | } |
| 622 | 624 | } |
| 623 | − iErr = ParsePps (pCtx, &pCtx->sPpsBuffer[0], pBs, pSrcNal, kSrcNalLen); | |
| 625 | + iErr = ParsePps (pCtx, &pCtx->sSpsPpsCtx.sPpsBuffer[0], pBs, pSrcNal, kSrcNalLen); | |
| 624 | 626 | if (ERR_NONE != iErr) { // modified for pps invalid, 12/1/2009 |
| 625 | 627 | if (pCtx->pParam->eEcActiveIdc == ERROR_CON_DISABLE) |
| 626 | 628 | pCtx->iErrorCode |= dsNoParamSets; |
| @@ -629,7 +631,7 @@ int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t · 2 unmodified lines | ||
| 629 | 631 | return iErr; |
| 630 | 632 | } |
| 631 | 633 | |
| 632 | − pCtx->bPpsExistAheadFlag = true; | |
| 634 | + pCtx->sSpsPpsCtx.bPpsExistAheadFlag = true; | |
| 633 | 635 | |
| 634 | 636 | break; |
| 635 | 637 | |
| @@ -683,7 +685,7 @@ int32_t ParseRefBasePicMarking (PBitStringAux pBs, PRefBasePicMarking pRefBasePi · 47 unmodified lines | ||
| 683 | 685 | } |
| 684 | 686 | |
| 685 | 687 | int32_t ParsePrefixNalUnit (PWelsDecoderContext pCtx, PBitStringAux pBs) { |
| 686 | − PNalUnit pCurNal = &pCtx->sPrefixNal; | |
| 688 | + PNalUnit pCurNal = &pCtx->sSpsPpsCtx.sPrefixNal; | |
| 687 | 689 | uint32_t uiCode; |
| 688 | 690 | |
| 689 | 691 | if (pCurNal->sNalHeaderExt.sNalUnitHeader.uiNalRefIdc != 0) { |
| @@ -834,12 +836,12 @@ const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) { · 144 unmodified lines | ||
| 834 | 836 | |
| 835 | 837 | bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps, bool bUseSubsetFlag) { |
| 836 | 838 | for (int i = 0; i < MAX_LAYER_NUM; i++) { |
| 837 | − if (pCtx->pActiveLayerSps[i] == pSps) | |
| 839 | + if (pCtx->sSpsPpsCtx.pActiveLayerSps[i] == pSps) | |
| 838 | 840 | return true; |
| 839 | 841 | } |
| 840 | 842 | // Pre-active, will be used soon |
| 841 | 843 | if (bUseSubsetFlag) { |
| 842 | − if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->bSubspsAvailFlags[pSps->iSpsId]) { | |
| 844 | + if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->sSpsPpsCtx.bSubspsAvailFlags[pSps->iSpsId]) { | |
| 843 | 845 | if (pCtx->iTotalNumMbRec > 0) { |
| 844 | 846 | return true; |
| 845 | 847 | } |
| @@ -857,7 +859,7 @@ bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps, bool bUseSubsetFlag) { · 11 unmodified lines | ||
| 857 | 859 | } |
| 858 | 860 | } |
| 859 | 861 | } else { |
| 860 | − if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->bSpsAvailFlags[pSps->iSpsId]) { | |
| 862 | + if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->sSpsPpsCtx.bSpsAvailFlags[pSps->iSpsId]) { | |
| 861 | 863 | if (pCtx->iTotalNumMbRec > 0) { |
| 862 | 864 | return true; |
| 863 | 865 | } |
| @@ -1251,57 +1253,57 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 387 unmodified lines | ||
| 1251 | 1253 | |
| 1252 | 1254 | |
| 1253 | 1255 | if (PRO_SCALABLE_BASELINE == uiProfileIdc || PRO_SCALABLE_HIGH == uiProfileIdc) |
| 1254 | − pCtx->bAvcBasedFlag = false; | |
| 1256 | + pCtx->sSpsPpsCtx.bAvcBasedFlag = false; | |
| 1255 | 1257 | |
| 1256 | 1258 | *pPicWidth = pSps->iMbWidth << 4; |
| 1257 | 1259 | *pPicHeight = pSps->iMbHeight << 4; |
| 1258 | 1260 | PSps pTmpSps = NULL; |
| 1259 | 1261 | if (kbUseSubsetFlag) { |
| 1260 | − pTmpSps = &pCtx->sSubsetSpsBuffer[iSpsId].sSps; | |
| 1262 | + pTmpSps = &pCtx->sSpsPpsCtx.sSubsetSpsBuffer[iSpsId].sSps; | |
| 1261 | 1263 | } else { |
| 1262 | − pTmpSps = &pCtx->sSpsBuffer[iSpsId]; | |
| 1264 | + pTmpSps = &pCtx->sSpsPpsCtx.sSpsBuffer[iSpsId]; | |
| 1263 | 1265 | } |
| 1264 | 1266 | if (CheckSpsActive (pCtx, pTmpSps, kbUseSubsetFlag)) { |
| 1265 | 1267 | // we are overwriting the active sps, copy a temp buffer |
| 1266 | 1268 | if (kbUseSubsetFlag) { |
| 1267 | − if (memcmp (&pCtx->sSubsetSpsBuffer[iSpsId], pSubsetSps, sizeof (SSubsetSps)) != 0) { | |
| 1269 | + if (memcmp (&pCtx->sSpsPpsCtx.sSubsetSpsBuffer[iSpsId], pSubsetSps, sizeof (SSubsetSps)) != 0) { | |
| 1268 | 1270 | if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) { |
| 1269 | − memcpy (&pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT], pSubsetSps, sizeof (SSubsetSps)); | |
| 1271 | + memcpy (&pCtx->sSpsPpsCtx.sSubsetSpsBuffer[MAX_SPS_COUNT], pSubsetSps, sizeof (SSubsetSps)); | |
| 1270 | 1272 | pCtx->bAuReadyFlag = true; |
| 1271 | 1273 | pCtx->pAccessUnitList->uiEndPos = pCtx->pAccessUnitList->uiAvailUnitsNum - 1; |
| 1272 | − pCtx->iOverwriteFlags |= OVERWRITE_SUBSETSPS; | |
| 1274 | + pCtx->sSpsPpsCtx.iOverwriteFlags |= OVERWRITE_SUBSETSPS; | |
| 1273 | 1275 | } else if ((pCtx->pSps != NULL) && (pCtx->pSps->iSpsId == pSubsetSps->sSps.iSpsId)) { |
| 1274 | − memcpy (&pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT], pSubsetSps, sizeof (SSubsetSps)); | |
| 1275 | − pCtx->iOverwriteFlags |= OVERWRITE_SUBSETSPS; | |
| 1276 | + memcpy (&pCtx->sSpsPpsCtx.sSubsetSpsBuffer[MAX_SPS_COUNT], pSubsetSps, sizeof (SSubsetSps)); | |
| 1277 | + pCtx->sSpsPpsCtx.iOverwriteFlags |= OVERWRITE_SUBSETSPS; | |
| 1276 | 1278 | } else { |
| 1277 | − memcpy (&pCtx->sSubsetSpsBuffer[iSpsId], pSubsetSps, sizeof (SSubsetSps)); | |
| 1279 | + memcpy (&pCtx->sSpsPpsCtx.sSubsetSpsBuffer[iSpsId], pSubsetSps, sizeof (SSubsetSps)); | |
| 1278 | 1280 | } |
| 1279 | 1281 | } |
| 1280 | 1282 | } else { |
| 1281 | − if (memcmp (&pCtx->sSpsBuffer[iSpsId], pSps, sizeof (SSps)) != 0) { | |
| 1283 | + if (memcmp (&pCtx->sSpsPpsCtx.sSpsBuffer[iSpsId], pSps, sizeof (SSps)) != 0) { | |
| 1282 | 1284 | if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) { |
| 1283 | − memcpy (&pCtx->sSpsBuffer[MAX_SPS_COUNT], pSps, sizeof (SSps)); | |
| 1284 | − pCtx->iOverwriteFlags |= OVERWRITE_SPS; | |
| 1285 | + memcpy (&pCtx->sSpsPpsCtx.sSpsBuffer[MAX_SPS_COUNT], pSps, sizeof (SSps)); | |
| 1286 | + pCtx->sSpsPpsCtx.iOverwriteFlags |= OVERWRITE_SPS; | |
| 1285 | 1287 | pCtx->bAuReadyFlag = true; |
| 1286 | 1288 | pCtx->pAccessUnitList->uiEndPos = pCtx->pAccessUnitList->uiAvailUnitsNum - 1; |
| 1287 | 1289 | } else if ((pCtx->pSps != NULL) && (pCtx->pSps->iSpsId == pSps->iSpsId)) { |
| 1288 | − memcpy (&pCtx->sSpsBuffer[MAX_SPS_COUNT], pSps, sizeof (SSps)); | |
| 1289 | − pCtx->iOverwriteFlags |= OVERWRITE_SPS; | |
| 1290 | + memcpy (&pCtx->sSpsPpsCtx.sSpsBuffer[MAX_SPS_COUNT], pSps, sizeof (SSps)); | |
| 1291 | + pCtx->sSpsPpsCtx.iOverwriteFlags |= OVERWRITE_SPS; | |
| 1290 | 1292 | } else { |
| 1291 | − memcpy (&pCtx->sSpsBuffer[iSpsId], pSps, sizeof (SSps)); | |
| 1293 | + memcpy (&pCtx->sSpsPpsCtx.sSpsBuffer[iSpsId], pSps, sizeof (SSps)); | |
| 1292 | 1294 | } |
| 1293 | 1295 | } |
| 1294 | 1296 | } |
| 1295 | 1297 | } |
| 1296 | 1298 | // Not overwrite active sps, just copy to final place |
| 1297 | 1299 | else if (kbUseSubsetFlag) { |
| 1298 | − memcpy (&pCtx->sSubsetSpsBuffer[iSpsId], pSubsetSps, sizeof (SSubsetSps)); | |
| 1299 | − pCtx->bSubspsAvailFlags[iSpsId] = true; | |
| 1300 | − pCtx->bSubspsExistAheadFlag = true; | |
| 1300 | + memcpy (&pCtx->sSpsPpsCtx.sSubsetSpsBuffer[iSpsId], pSubsetSps, sizeof (SSubsetSps)); | |
| 1301 | + pCtx->sSpsPpsCtx.bSubspsAvailFlags[iSpsId] = true; | |
| 1302 | + pCtx->sSpsPpsCtx.bSubspsExistAheadFlag = true; | |
| 1301 | 1303 | } else { |
| 1302 | − memcpy (&pCtx->sSpsBuffer[iSpsId], pSps, sizeof (SSps)); | |
| 1303 | − pCtx->bSpsAvailFlags[iSpsId] = true; | |
| 1304 | − pCtx->bSpsExistAheadFlag = true; | |
| 1304 | + memcpy (&pCtx->sSpsPpsCtx.sSpsBuffer[iSpsId], pSps, sizeof (SSps)); | |
| 1305 | + pCtx->sSpsPpsCtx.bSpsAvailFlags[iSpsId] = true; | |
| 1306 | + pCtx->sSpsPpsCtx.bSpsExistAheadFlag = true; | |
| 1305 | 1307 | } |
| 1306 | 1308 | return ERR_NONE; |
| 1307 | 1309 | } |
| @@ -1421,8 +1423,8 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, · 113 unmodified lines | ||
| 1421 | 1423 | WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //pic_scaling_matrix_present_flag |
| 1422 | 1424 | pPps->bPicScalingMatrixPresentFlag = !!uiCode; |
| 1423 | 1425 | if (pPps->bPicScalingMatrixPresentFlag) { |
| 1424 | − if (pCtx->bSpsAvailFlags[pPps->iSpsId]) { | |
| 1425 | − WELS_READ_VERIFY (ParseScalingList (&pCtx->sSpsBuffer[pPps->iSpsId], pBsAux, 1, pPps->bTransform8x8ModeFlag, | |
| 1426 | + if (pCtx->sSpsPpsCtx.bSpsAvailFlags[pPps->iSpsId]) { | |
| 1427 | + WELS_READ_VERIFY (ParseScalingList (&pCtx->sSpsPpsCtx.sSpsBuffer[pPps->iSpsId], pBsAux, 1, pPps->bTransform8x8ModeFlag, | |
| 1426 | 1428 | pPps->bPicScalingListPresentFlag, pPps->iScalingList4x4, pPps->iScalingList8x8)); |
| 1427 | 1429 | } else { |
| 1428 | 1430 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, |
| @@ -1440,16 +1442,16 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, · 11 unmodified lines | ||
| 1440 | 1442 | |
| 1441 | 1443 | if (pCtx->pPps != NULL && pCtx->pPps->iPpsId == pPps->iPpsId) { |
| 1442 | 1444 | if (memcmp (pCtx->pPps, pPps, sizeof (*pPps)) != 0) { |
| 1443 | − memcpy (&pCtx->sPpsBuffer[MAX_PPS_COUNT], pPps, sizeof (SPps)); | |
| 1444 | − pCtx->iOverwriteFlags |= OVERWRITE_PPS; | |
| 1445 | + memcpy (&pCtx->sSpsPpsCtx.sPpsBuffer[MAX_PPS_COUNT], pPps, sizeof (SPps)); | |
| 1446 | + pCtx->sSpsPpsCtx.iOverwriteFlags |= OVERWRITE_PPS; | |
| 1445 | 1447 | if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) { |
| 1446 | 1448 | pCtx->bAuReadyFlag = true; |
| 1447 | 1449 | pCtx->pAccessUnitList->uiEndPos = pCtx->pAccessUnitList->uiAvailUnitsNum - 1; |
| 1448 | 1450 | } |
| 1449 | 1451 | } |
| 1450 | 1452 | } else { |
| 1451 | − memcpy (&pCtx->sPpsBuffer[uiPpsId], pPps, sizeof (SPps)); | |
| 1452 | − pCtx->bPpsAvailFlags[uiPpsId] = true; | |
| 1453 | + memcpy (&pCtx->sSpsPpsCtx.sPpsBuffer[uiPpsId], pPps, sizeof (SPps)); | |
| 1454 | + pCtx->sSpsPpsCtx.bPpsAvailFlags[uiPpsId] = true; | |
| 1453 | 1455 | } |
| 1454 | 1456 | if (pCtx->pParam->bParseOnly) { |
| 1455 | 1457 | if (kSrcNalLen >= SPS_PPS_BS_SIZE - 4) { //pps bs exceeds |