Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 4 files). Show all
Unified · Split
| @@ -1505,6 +1505,20 @@ static bool CheckNewSeqBeginAndUpdateActiveLayerSps(PWelsDecoderContext pCtx) { · 1504 unmodified lines | |||
| 1505 | return bNewSeq; | 1505 | return bNewSeq; |
| 1506 | } | 1506 | } |
| 1507 | 1507 | ||
| 1508 | static void WriteBackActiveParameters(PWelsDecoderContext pCtx) { | ||
| 1509 | if (pCtx->iOverwriteFlags & OVERWRITE_PPS) { | ||
| 1510 | memcpy(&pCtx->sPpsBuffer[pCtx->sPpsBuffer[MAX_PPS_COUNT].iPpsId], &pCtx->sPpsBuffer[MAX_PPS_COUNT], sizeof(SPps)); | ||
| 1511 | pCtx->bNewSeqBegin = true; | ||
| 1512 | } | ||
| 1513 | if (pCtx->iOverwriteFlags & OVERWRITE_SPS) { | ||
| 1514 | memcpy(&pCtx->sSpsBuffer[pCtx->sSpsBuffer[MAX_SPS_COUNT].iSpsId], &pCtx->sSpsBuffer[MAX_SPS_COUNT], sizeof(SSps)); | ||
| 1515 | pCtx->bNewSeqBegin = true; | ||
| 1516 | } | ||
| 1517 | if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS) { | ||
| 1518 | memcpy(&pCtx->sSubsetSpsBuffer[pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT].sSps.iSpsId], &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT], sizeof(SSubsetSps)); | ||
| 1519 | } | ||
| 1520 | pCtx->iOverwriteFlags = OVERWRITE_NONE; | ||
| 1521 | } | ||
| 1508 | /* | 1522 | /* |
| 1509 | * ConstructAccessUnit | 1523 | * ConstructAccessUnit |
| 1510 | * construct an access unit for given input bitstream, maybe partial NAL Unit, one or more Units are involved to | 1524 | * construct an access unit for given input bitstream, maybe partial NAL Unit, one or more Units are involved to |
| @@ -1522,12 +1536,12 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 11 unmodified lines | |||
| 1522 | int32_t iWidth; | 1536 | int32_t iWidth; |
| 1523 | int32_t iHeight; | 1537 | int32_t iHeight; |
| 1524 | int32_t iStride[2] = { 0 }; | 1538 | int32_t iStride[2] = { 0 }; |
| 1525 | |||
| 1526 | PAccessUnit pCurAu = pCtx->pAccessUnitList; | 1539 | PAccessUnit pCurAu = pCtx->pAccessUnitList; |
| 1527 | 1540 | ||
| 1528 | pCtx->bAuReadyFlag = false; | 1541 | pCtx->bAuReadyFlag = false; |
| 1529 | pCtx->bLastHasMmco5 = false; | 1542 | pCtx->bLastHasMmco5 = false; |
| 1530 | pCtx->bNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx); | 1543 | bool bTmpNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx); |
| 1544 | pCtx->bNewSeqBegin = pCtx->bNewSeqBegin && bTmpNewSeqBegin; | ||
| 1531 | iErr = WelsDecodeAccessUnitStart (pCtx); | 1545 | iErr = WelsDecodeAccessUnitStart (pCtx); |
| 1532 | GetVclNalTemporalId (pCtx); | 1546 | GetVclNalTemporalId (pCtx); |
| 1533 | 1547 | ||
| @@ -1558,6 +1572,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 24 unmodified lines | |||
| 1558 | 1572 | ||
| 1559 | WelsDecodeAccessUnitEnd (pCtx); | 1573 | WelsDecodeAccessUnitEnd (pCtx); |
| 1560 | pCtx->bNewSeqBegin = false; | 1574 | pCtx->bNewSeqBegin = false; |
| 1575 | WriteBackActiveParameters(pCtx); | ||
| 1561 | if (ERR_NONE != iErr) { | 1576 | if (ERR_NONE != iErr) { |
| 1562 | WelsLog (pCtx, WELS_LOG_INFO, "returned error from decoding:[0x%x]\n", iErr); | 1577 | WelsLog (pCtx, WELS_LOG_INFO, "returned error from decoding:[0x%x]\n", iErr); |
| 1563 | 1578 | ||