Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 1 file). Show all
Unified · Split
| @@ -562,10 +562,17 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 561 unmodified lines | ||
| 562 | 562 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_PPS_ID); |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | − if (pCtx->iOverwriteFlags & OVERWRITE_PPS) | |
| 566 | − pPps = &pCtx->sPpsBuffer[MAX_PPS_COUNT]; | |
| 567 | − else | |
| 565 | + if (pCtx->iOverwriteFlags & OVERWRITE_PPS) { | |
| 566 | + if (pCtx->pAccessUnitList->uiAvailUnitsNum > 1 || pCtx->iTotalNumMbRec > 0) { | |
| 567 | + pPps = &pCtx->sPpsBuffer[MAX_PPS_COUNT]; | |
| 568 | + } else { | |
| 569 | + memcpy (&pCtx->sPpsBuffer[pCtx->sPpsBuffer[MAX_PPS_COUNT].iPpsId], &pCtx->sPpsBuffer[MAX_PPS_COUNT], sizeof (SPps)); | |
| 570 | + pCtx->iOverwriteFlags ^= OVERWRITE_PPS; | |
| 571 | + pPps = &pCtx->sPpsBuffer[iPpsId]; | |
| 572 | + } | |
| 573 | + } else { | |
| 568 | 574 | pPps = &pCtx->sPpsBuffer[iPpsId]; |
| 575 | + } | |
| 569 | 576 | |
| 570 | 577 | if (pPps->uiNumSliceGroups == 0) { |
| 571 | 578 | WelsLog (pLogCtx, WELS_LOG_WARNING, "Invalid PPS referenced"); |
| @@ -574,10 +581,19 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 2 unmodified lines | ||
| 574 | 581 | } |
| 575 | 582 | |
| 576 | 583 | if (kbExtensionFlag) { |
| 577 | − if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS) | |
| 578 | − pSubsetSps = &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT]; | |
| 579 | − else | |
| 580 | − pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId]; | |
| 584 | + if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS) { | |
| 585 | + if (pCtx->pAccessUnitList->uiAvailUnitsNum > 1 || pCtx->iTotalNumMbRec > 0) { | |
| 586 | + pSubsetSps = &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT]; | |
| 587 | + } else { | |
| 588 | + memcpy (&pCtx->sSubsetSpsBuffer[pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT].sSps.iSpsId], | |
| 589 | + &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT], sizeof (SSubsetSps)); | |
| 590 | + pCtx->iOverwriteFlags ^= OVERWRITE_SUBSETSPS; | |
| 591 | + pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId]; | |
| 592 | + ResetActiveSPSForEachLayer (pCtx); | |
| 593 | + } | |
| 594 | + } else { | |
| 595 | + pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId]; | |
| 596 | + } | |
| 581 | 597 | pSps = &pSubsetSps->sSps; |
| 582 | 598 | if (pCtx->bSubspsAvailFlags[pPps->iSpsId] == false) { |
| 583 | 599 | WelsLog (pLogCtx, WELS_LOG_ERROR, "SPS id is invalid!"); |
| @@ -590,10 +606,18 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 6 unmodified lines | ||
| 590 | 606 | pCtx->iErrorCode |= dsNoParamSets; |
| 591 | 607 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID); |
| 592 | 608 | } |
| 593 | − if (pCtx->iOverwriteFlags & OVERWRITE_SPS) | |
| 594 | − pSps = &pCtx->sSpsBuffer[MAX_SPS_COUNT]; | |
| 595 | − else | |
| 609 | + if (pCtx->iOverwriteFlags & OVERWRITE_SPS) { | |
| 610 | + if (pCtx->pAccessUnitList->uiAvailUnitsNum > 1 || pCtx->iTotalNumMbRec > 0) { | |
| 611 | + pSps = &pCtx->sSpsBuffer[MAX_SPS_COUNT]; | |
| 612 | + } else { | |
| 613 | + memcpy (&pCtx->sSpsBuffer[pCtx->sSpsBuffer[MAX_SPS_COUNT].iSpsId], &pCtx->sSpsBuffer[MAX_SPS_COUNT], sizeof (SSps)); | |
| 614 | + pCtx->iOverwriteFlags ^= OVERWRITE_SPS; | |
| 615 | + pSps = &pCtx->sSpsBuffer[pPps->iSpsId]; | |
| 616 | + ResetActiveSPSForEachLayer (pCtx); | |
| 617 | + } | |
| 618 | + } else { | |
| 596 | 619 | pSps = &pCtx->sSpsBuffer[pPps->iSpsId]; |
| 620 | + } | |
| 597 | 621 | } |
| 598 | 622 | pSliceHead->iPpsId = iPpsId; |
| 599 | 623 | pSliceHead->iSpsId = pPps->iSpsId; |