overwriteactivesps
Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 4 files). Show all
Unified · Split
| @@ -1531,6 +1531,20 @@ static bool CheckNewSeqBeginAndUpdateActiveLayerSps(PWelsDecoderContext pCtx) { · 1530 unmodified lines | ||
| 1531 | 1531 | return bNewSeq; |
| 1532 | 1532 | } |
| 1533 | 1533 | |
| 1534 | +static void WriteBackActiveParameters(PWelsDecoderContext pCtx) { | |
| 1535 | + if (pCtx->iOverwriteFlags & OVERWRITE_PPS) { | |
| 1536 | + memcpy(&pCtx->sPpsBuffer[pCtx->sPpsBuffer[MAX_PPS_COUNT].iPpsId], &pCtx->sPpsBuffer[MAX_PPS_COUNT], sizeof(SPps)); | |
| 1537 | + pCtx->bNewSeqBegin = true; | |
| 1538 | + } | |
| 1539 | + if (pCtx->iOverwriteFlags & OVERWRITE_SPS) { | |
| 1540 | + memcpy(&pCtx->sSpsBuffer[pCtx->sSpsBuffer[MAX_SPS_COUNT].iSpsId], &pCtx->sSpsBuffer[MAX_SPS_COUNT], sizeof(SSps)); | |
| 1541 | + pCtx->bNewSeqBegin = true; | |
| 1542 | + } | |
| 1543 | + if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS) { | |
| 1544 | + memcpy(&pCtx->sSubsetSpsBuffer[pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT].sSps.iSpsId], &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT], sizeof(SSubsetSps)); | |
| 1545 | + } | |
| 1546 | + pCtx->iOverwriteFlags = OVERWRITE_NONE; | |
| 1547 | +} | |
| 1534 | 1548 | /* |
| 1535 | 1549 | * ConstructAccessUnit |
| 1536 | 1550 | * construct an access unit for given input bitstream, maybe partial NAL Unit, one or more Units are involved to |
| @@ -1548,12 +1562,12 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 11 unmodified lines | ||
| 1548 | 1562 | int32_t iWidth; |
| 1549 | 1563 | int32_t iHeight; |
| 1550 | 1564 | int32_t iStride[2] = { 0 }; |
| 1551 | − | |
| 1552 | 1565 | PAccessUnit pCurAu = pCtx->pAccessUnitList; |
| 1553 | 1566 | |
| 1554 | 1567 | pCtx->bAuReadyFlag = false; |
| 1555 | 1568 | pCtx->bLastHasMmco5 = false; |
| 1556 | − pCtx->bNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx); | |
| 1569 | + bool bTmpNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx); | |
| 1570 | + pCtx->bNewSeqBegin = pCtx->bNewSeqBegin && bTmpNewSeqBegin; | |
| 1557 | 1571 | iErr = WelsDecodeAccessUnitStart (pCtx); |
| 1558 | 1572 | GetVclNalTemporalId (pCtx); |
| 1559 | 1573 | |
| @@ -1584,6 +1598,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 24 unmodified lines | ||
| 1584 | 1598 | |
| 1585 | 1599 | WelsDecodeAccessUnitEnd (pCtx); |
| 1586 | 1600 | pCtx->bNewSeqBegin = false; |
| 1601 | + WriteBackActiveParameters(pCtx); | |
| 1587 | 1602 | if (ERR_NONE != iErr) { |
| 1588 | 1603 | WelsLog (pCtx, WELS_LOG_INFO, "returned error from decoding:[0x%x]\n", iErr); |
| 1589 | 1604 | return iErr; |