Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1395,18 +1395,13 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, · 1394 unmodified lines | ||
| 1395 | 1395 | ERR_INFO_INVALID_CHROMA_QP_INDEX_OFFSET)); |
| 1396 | 1396 | } |
| 1397 | 1397 | |
| 1398 | − if (pCtx->pAccessUnitList->uiAvailUnitsNum > 0) { | |
| 1399 | − PNalUnit pLastNalUnit = pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiAvailUnitsNum - 1]; | |
| 1400 | − PPps pLastPps = pLastNalUnit->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pPps; | |
| 1401 | − // the active pps is overwrite, write to a temp place | |
| 1402 | − if (pLastPps == &pCtx->sPpsBuffer[uiPpsId] && memcmp (&pCtx->sPpsBuffer[uiPpsId], pPps, sizeof (*pPps)) != 0) { | |
| 1398 | + if (pCtx->pPps != NULL && pCtx->pPps->iPpsId == pPps->iPpsId) { | |
| 1399 | + if (memcmp (pCtx->pPps, pPps, sizeof (*pPps)) != 0) { | |
| 1403 | 1400 | memcpy (&pCtx->sPpsBuffer[MAX_PPS_COUNT], pPps, sizeof (SPps)); |
| 1404 | 1401 | pCtx->iOverwriteFlags |= OVERWRITE_PPS; |
| 1405 | 1402 | pCtx->bAuReadyFlag = true; |
| 1406 | − pCtx->pAccessUnitList->uiEndPos = pCtx->pAccessUnitList->uiAvailUnitsNum - 1; | |
| 1407 | − } else { | |
| 1408 | − memcpy (&pCtx->sPpsBuffer[uiPpsId], pPps, sizeof (SPps)); | |
| 1409 | − pCtx->bPpsAvailFlags[uiPpsId] = true; | |
| 1403 | + pCtx->pAccessUnitList->uiEndPos = (pCtx->pAccessUnitList->uiAvailUnitsNum > 0 ? (pCtx->pAccessUnitList->uiAvailUnitsNum | |
| 1404 | + - 1) : 0); | |
| 1410 | 1405 | } |
| 1411 | 1406 | } else { |
| 1412 | 1407 | memcpy (&pCtx->sPpsBuffer[uiPpsId], pPps, sizeof (SPps)); |