Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 5 files). Show all
Unified · Split
| @@ -1534,7 +1534,6 @@ static bool CheckNewSeqBeginAndUpdateActiveLayerSps(PWelsDecoderContext pCtx) { · 1533 unmodified lines | |||
| 1534 | static void WriteBackActiveParameters(PWelsDecoderContext pCtx) { | 1534 | static void WriteBackActiveParameters(PWelsDecoderContext pCtx) { |
| 1535 | if (pCtx->iOverwriteFlags & OVERWRITE_PPS) { | 1535 | if (pCtx->iOverwriteFlags & OVERWRITE_PPS) { |
| 1536 | memcpy(&pCtx->sPpsBuffer[pCtx->sPpsBuffer[MAX_PPS_COUNT].iPpsId], &pCtx->sPpsBuffer[MAX_PPS_COUNT], sizeof(SPps)); | 1536 | memcpy(&pCtx->sPpsBuffer[pCtx->sPpsBuffer[MAX_PPS_COUNT].iPpsId], &pCtx->sPpsBuffer[MAX_PPS_COUNT], sizeof(SPps)); |
| 1537 | pCtx->bNewSeqBegin = true; | ||
| 1538 | } | 1537 | } |
| 1539 | if (pCtx->iOverwriteFlags & OVERWRITE_SPS) { | 1538 | if (pCtx->iOverwriteFlags & OVERWRITE_SPS) { |
| 1540 | memcpy(&pCtx->sSpsBuffer[pCtx->sSpsBuffer[MAX_SPS_COUNT].iSpsId], &pCtx->sSpsBuffer[MAX_SPS_COUNT], sizeof(SSps)); | 1539 | memcpy(&pCtx->sSpsBuffer[pCtx->sSpsBuffer[MAX_SPS_COUNT].iSpsId], &pCtx->sSpsBuffer[MAX_SPS_COUNT], sizeof(SSps)); |
| @@ -1542,6 +1541,7 @@ static void WriteBackActiveParameters(PWelsDecoderContext pCtx) { · 1 unmodified line | |||
| 1542 | } | 1541 | } |
| 1543 | if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS) { | 1542 | if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS) { |
| 1544 | memcpy(&pCtx->sSubsetSpsBuffer[pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT].sSps.iSpsId], &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT], sizeof(SSubsetSps)); | 1543 | memcpy(&pCtx->sSubsetSpsBuffer[pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT].sSps.iSpsId], &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT], sizeof(SSubsetSps)); |
| 1544 | pCtx->bNewSeqBegin = true; | ||
| 1545 | } | 1545 | } |
| 1546 | pCtx->iOverwriteFlags = OVERWRITE_NONE; | 1546 | pCtx->iOverwriteFlags = OVERWRITE_NONE; |
| 1547 | } | 1547 | } |
| @@ -1567,7 +1567,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 19 unmodified lines | |||
| 1567 | pCtx->bAuReadyFlag = false; | 1567 | pCtx->bAuReadyFlag = false; |
| 1568 | pCtx->bLastHasMmco5 = false; | 1568 | pCtx->bLastHasMmco5 = false; |
| 1569 | bool bTmpNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx); | 1569 | bool bTmpNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx); |
| 1570 | pCtx->bNewSeqBegin = pCtx->bNewSeqBegin && bTmpNewSeqBegin; | 1570 | pCtx->bNewSeqBegin = pCtx->bNewSeqBegin || bTmpNewSeqBegin; |
| 1571 | iErr = WelsDecodeAccessUnitStart (pCtx); | 1571 | iErr = WelsDecodeAccessUnitStart (pCtx); |
| 1572 | GetVclNalTemporalId (pCtx); | 1572 | GetVclNalTemporalId (pCtx); |
| 1573 | 1573 | ||
| @@ -1599,6 +1599,10 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 25 unmodified lines | |||
| 1599 | WelsDecodeAccessUnitEnd (pCtx); | 1599 | WelsDecodeAccessUnitEnd (pCtx); |
| 1600 | pCtx->bNewSeqBegin = false; | 1600 | pCtx->bNewSeqBegin = false; |
| 1601 | WriteBackActiveParameters(pCtx); | 1601 | WriteBackActiveParameters(pCtx); |
| 1602 | pCtx->bNewSeqBegin = pCtx->bNewSeqBegin || pCtx->bNextNewSeqBegin; | ||
| 1603 | pCtx->bNextNewSeqBegin = false; // reset it | ||
| 1604 | if (pCtx->bNewSeqBegin) | ||
| 1605 | ResetActiveSPSForEachLayer(pCtx); | ||
| 1602 | if (ERR_NONE != iErr) { | 1606 | if (ERR_NONE != iErr) { |
| 1603 | WelsLog (pCtx, WELS_LOG_INFO, "returned error from decoding:[0x%x]\n", iErr); | 1607 | WelsLog (pCtx, WELS_LOG_INFO, "returned error from decoding:[0x%x]\n", iErr); |
| 1604 | return iErr; | 1608 | return iErr; |