History

overwriteactivesps

Licai Guo committed 12 years ago

Commit 79ed7441 parent f141bd64 files · +114 −51Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+17−2
@@ -1505,6 +1505,20 @@ static bool CheckNewSeqBeginAndUpdateActiveLayerSps(PWelsDecoderContext pCtx) { · 1504 unmodified lines
15051505 return bNewSeq;
15061506 }
15071507
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+}
15081522 /*
15091523 * ConstructAccessUnit
15101524 * 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
15221536 int32_t iWidth;
15231537 int32_t iHeight;
15241538 int32_t iStride[2] = { 0 };
1525−
15261539 PAccessUnit pCurAu = pCtx->pAccessUnitList;
15271540
15281541 pCtx->bAuReadyFlag = false;
15291542 pCtx->bLastHasMmco5 = false;
1530− pCtx->bNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx);
1543+ bool bTmpNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx);
1544+ pCtx->bNewSeqBegin = pCtx->bNewSeqBegin && bTmpNewSeqBegin;
15311545 iErr = WelsDecodeAccessUnitStart (pCtx);
15321546 GetVclNalTemporalId (pCtx);
15331547
@@ -1558,6 +1572,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 24 unmodified lines
15581572
15591573 WelsDecodeAccessUnitEnd (pCtx);
15601574 pCtx->bNewSeqBegin = false;
1575+ WriteBackActiveParameters(pCtx);
15611576 if (ERR_NONE != iErr) {
15621577 WelsLog (pCtx, WELS_LOG_INFO, "returned error from decoding:[0x%x]\n", iErr);
15631578

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