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 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_PPS_ID); | 562 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_PPS_ID); |
| 563 | } | 563 | } |
| 564 | 564 | ||
| 565 | if (pCtx->iOverwriteFlags & OVERWRITE_PPS) | 565 | if (pCtx->iOverwriteFlags & OVERWRITE_PPS) { |
| 566 | pPps = &pCtx->sPpsBuffer[MAX_PPS_COUNT]; | 566 | if (pCtx->pAccessUnitList->uiAvailUnitsNum > 1 || pCtx->iTotalNumMbRec > 0) { |
| 567 | else | 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 | pPps = &pCtx->sPpsBuffer[iPpsId]; | 574 | pPps = &pCtx->sPpsBuffer[iPpsId]; |
| 575 | } | ||
| 569 | 576 | ||
| 570 | if (pPps->uiNumSliceGroups == 0) { | 577 | if (pPps->uiNumSliceGroups == 0) { |
| 571 | WelsLog (pLogCtx, WELS_LOG_WARNING, "Invalid PPS referenced"); | 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 | if (kbExtensionFlag) { | 583 | if (kbExtensionFlag) { |
| 577 | if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS) | 584 | if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS) { |
| 578 | pSubsetSps = &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT]; | 585 | if (pCtx->pAccessUnitList->uiAvailUnitsNum > 1 || pCtx->iTotalNumMbRec > 0) { |
| 579 | else | 586 | pSubsetSps = &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT]; |
| 580 | pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId]; | 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 | pSps = &pSubsetSps->sSps; | 597 | pSps = &pSubsetSps->sSps; |
| 582 | if (pCtx->bSubspsAvailFlags[pPps->iSpsId] == false) { | 598 | if (pCtx->bSubspsAvailFlags[pPps->iSpsId] == false) { |
| 583 | WelsLog (pLogCtx, WELS_LOG_ERROR, "SPS id is invalid!"); | 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 | pCtx->iErrorCode |= dsNoParamSets; | 606 | pCtx->iErrorCode |= dsNoParamSets; |
| 591 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID); | 607 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID); |
| 592 | } | 608 | } |
| 593 | if (pCtx->iOverwriteFlags & OVERWRITE_SPS) | 609 | if (pCtx->iOverwriteFlags & OVERWRITE_SPS) { |
| 594 | pSps = &pCtx->sSpsBuffer[MAX_SPS_COUNT]; | 610 | if (pCtx->pAccessUnitList->uiAvailUnitsNum > 1 || pCtx->iTotalNumMbRec > 0) { |
| 595 | else | 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 | pSps = &pCtx->sSpsBuffer[pPps->iSpsId]; | 619 | pSps = &pCtx->sSpsBuffer[pPps->iSpsId]; |
| 620 | } | ||
| 597 | } | 621 | } |
| 598 | pSliceHead->iPpsId = iPpsId; | 622 | pSliceHead->iPpsId = iPpsId; |
| 599 | pSliceHead->iSpsId = pPps->iSpsId; | 623 | pSliceHead->iSpsId = pPps->iSpsId; |