History

fix bNewSeqBegin logic

Licai Guo committed 12 years ago

Commit bada2d31 parent f00d3ac5 files · +11 −4Browse files

Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 5 files). Show all

Unified · Split

codec/decoder/core/src/decoder_core.cpp+6−2
@@ -1534,7 +1534,6 @@ static bool CheckNewSeqBeginAndUpdateActiveLayerSps(PWelsDecoderContext pCtx) { · 1533 unmodified lines
15341534 static void WriteBackActiveParameters(PWelsDecoderContext pCtx) {
15351535 if (pCtx->iOverwriteFlags & OVERWRITE_PPS) {
15361536 memcpy(&pCtx->sPpsBuffer[pCtx->sPpsBuffer[MAX_PPS_COUNT].iPpsId], &pCtx->sPpsBuffer[MAX_PPS_COUNT], sizeof(SPps));
1537− pCtx->bNewSeqBegin = true;
15381537 }
15391538 if (pCtx->iOverwriteFlags & OVERWRITE_SPS) {
15401539 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
15421541 }
15431542 if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS) {
15441543 memcpy(&pCtx->sSubsetSpsBuffer[pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT].sSps.iSpsId], &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT], sizeof(SSubsetSps));
1544+ pCtx->bNewSeqBegin = true;
15451545 }
15461546 pCtx->iOverwriteFlags = OVERWRITE_NONE;
15471547 }
@@ -1567,7 +1567,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 19 unmodified lines
15671567 pCtx->bAuReadyFlag = false;
15681568 pCtx->bLastHasMmco5 = false;
15691569 bool bTmpNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx);
1570− pCtx->bNewSeqBegin = pCtx->bNewSeqBegin && bTmpNewSeqBegin;
1570+ pCtx->bNewSeqBegin = pCtx->bNewSeqBegin || bTmpNewSeqBegin;
15711571 iErr = WelsDecodeAccessUnitStart (pCtx);
15721572 GetVclNalTemporalId (pCtx);
15731573
@@ -1599,6 +1599,10 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 25 unmodified lines
15991599 WelsDecodeAccessUnitEnd (pCtx);
16001600 pCtx->bNewSeqBegin = false;
16011601 WriteBackActiveParameters(pCtx);
1602+ pCtx->bNewSeqBegin = pCtx->bNewSeqBegin || pCtx->bNextNewSeqBegin;
1603+ pCtx->bNextNewSeqBegin = false; // reset it
1604+ if (pCtx->bNewSeqBegin)
1605+ ResetActiveSPSForEachLayer(pCtx);
16021606 if (ERR_NONE != iErr) {
16031607 WelsLog (pCtx, WELS_LOG_INFO, "returned error from decoding:[0x%x]\n", iErr);
16041608 return iErr;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t