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 | return bNewSeq; | 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 | * ConstructAccessUnit | 1549 | * ConstructAccessUnit |
| 1536 | * construct an access unit for given input bitstream, maybe partial NAL Unit, one or more Units are involved to | 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 | int32_t iWidth; | 1562 | int32_t iWidth; |
| 1549 | int32_t iHeight; | 1563 | int32_t iHeight; |
| 1550 | int32_t iStride[2] = { 0 }; | 1564 | int32_t iStride[2] = { 0 }; |
| 1551 | |||
| 1552 | PAccessUnit pCurAu = pCtx->pAccessUnitList; | 1565 | PAccessUnit pCurAu = pCtx->pAccessUnitList; |
| 1553 | 1566 | ||
| 1554 | pCtx->bAuReadyFlag = false; | 1567 | pCtx->bAuReadyFlag = false; |
| 1555 | pCtx->bLastHasMmco5 = false; | 1568 | pCtx->bLastHasMmco5 = false; |
| 1556 | pCtx->bNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx); | 1569 | bool bTmpNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx); |
| 1570 | pCtx->bNewSeqBegin = pCtx->bNewSeqBegin && bTmpNewSeqBegin; | ||
| 1557 | iErr = WelsDecodeAccessUnitStart (pCtx); | 1571 | iErr = WelsDecodeAccessUnitStart (pCtx); |
| 1558 | GetVclNalTemporalId (pCtx); | 1572 | GetVclNalTemporalId (pCtx); |
| 1559 | 1573 | ||
| @@ -1584,6 +1598,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 24 unmodified lines | |||
| 1584 | 1598 | ||
| 1585 | WelsDecodeAccessUnitEnd (pCtx); | 1599 | WelsDecodeAccessUnitEnd (pCtx); |
| 1586 | pCtx->bNewSeqBegin = false; | 1600 | pCtx->bNewSeqBegin = false; |
| 1601 | WriteBackActiveParameters(pCtx); | ||
| 1587 | if (ERR_NONE != iErr) { | 1602 | if (ERR_NONE != iErr) { |
| 1588 | WelsLog (pCtx, WELS_LOG_INFO, "returned error from decoding:[0x%x]\n", iErr); | 1603 | WelsLog (pCtx, WELS_LOG_INFO, "returned error from decoding:[0x%x]\n", iErr); |
| 1589 | return iErr; | 1604 | return iErr; |