History

Merge pull request #713 from licaiguo/overwriteactivesps

overwriteactivesps

huili2 committed 12 years ago

Commit 7d99aa42 parents 9b03223 79ed7444 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
@@ -1531,6 +1531,20 @@ static bool CheckNewSeqBeginAndUpdateActiveLayerSps(PWelsDecoderContext pCtx) { · 1530 unmodified lines
15311531 return bNewSeq;
15321532 }
15331533
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+}
15341548 /*
15351549 * ConstructAccessUnit
15361550 * 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
15481562 int32_t iWidth;
15491563 int32_t iHeight;
15501564 int32_t iStride[2] = { 0 };
1551−
15521565 PAccessUnit pCurAu = pCtx->pAccessUnitList;
15531566
15541567 pCtx->bAuReadyFlag = false;
15551568 pCtx->bLastHasMmco5 = false;
1556− pCtx->bNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx);
1569+ bool bTmpNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps(pCtx);
1570+ pCtx->bNewSeqBegin = pCtx->bNewSeqBegin && bTmpNewSeqBegin;
15571571 iErr = WelsDecodeAccessUnitStart (pCtx);
15581572 GetVclNalTemporalId (pCtx);
15591573
@@ -1584,6 +1598,7 @@ int32_t ConstructAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferI · 24 unmodified lines
15841598
15851599 WelsDecodeAccessUnitEnd (pCtx);
15861600 pCtx->bNewSeqBegin = false;
1601+ WriteBackActiveParameters(pCtx);
15871602 if (ERR_NONE != iErr) {
15881603 WelsLog (pCtx, WELS_LOG_INFO, "returned error from decoding:[0x%x]\n", iErr);
15891604 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