MCPcopy Create free account
hub / github.com/cisco/openh264 / WelsDecodeInitAccessUnitStart

Function WelsDecodeInitAccessUnitStart

codec/decoder/core/src/decoder_core.cpp:2258–2291  ·  view source on GitHub ↗

* WelsDecodeInitAccessUnitStart * check and (re)allocate picture buffers on new sequence begin * bit_len: size in bit length of data * buf_len: size in byte length of data * coded_au: mark an Access Unit decoding finished * return: * 0 - success; otherwise returned error_no defined in error_no.h */

Source from the content-addressed store, hash-verified

2256* 0 - success; otherwise returned error_no defined in error_no.h
2257*/
2258int32_t WelsDecodeInitAccessUnitStart (PWelsDecoderContext pCtx, SBufferInfo* pDstInfo) {
2259 int32_t iErr = ERR_NONE;
2260 PAccessUnit pCurAu = pCtx->pAccessUnitList;
2261 pCtx->bAuReadyFlag = false;
2262 pCtx->pLastDecPicInfo->bLastHasMmco5 = false;
2263 bool bTmpNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps (pCtx);
2264 if (bTmpNewSeqBegin) {
2265 if (pCtx->pStreamSeqNum)
2266 (*pCtx->pStreamSeqNum)++;
2267 else
2268 pCtx->iSeqNum++;
2269 }
2270 pCtx->bNewSeqBegin = pCtx->bNewSeqBegin || bTmpNewSeqBegin;
2271 if (pCtx->pStreamSeqNum)
2272 pCtx->iSeqNum = *pCtx->pStreamSeqNum;
2273 iErr = WelsDecodeAccessUnitStart (pCtx);
2274 GetVclNalTemporalId (pCtx);
2275
2276 if (ERR_NONE != iErr) {
2277 ForceResetCurrentAccessUnit (pCtx->pAccessUnitList);
2278 if (!pCtx->pParam->bParseOnly)
2279 pDstInfo->iBufferStatus = 0;
2280 pCtx->bNewSeqBegin = pCtx->bNewSeqBegin || pCtx->bNextNewSeqBegin;
2281 pCtx->bNextNewSeqBegin = false; // reset it
2282 if (pCtx->bNewSeqBegin)
2283 ResetActiveSPSForEachLayer (pCtx);
2284 return iErr;
2285 }
2286
2287 pCtx->pSps = pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps;
2288 pCtx->pPps = pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pPps;
2289
2290 return iErr;
2291}
2292
2293/*
2294* AllocPicBuffOnNewSeqBegin

Callers 1

InitConstructAccessUnitFunction · 0.85

Tested by

no test coverage detected