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

Method ParseAccessUnit

codec/decoder/plus/src/welsDecoderExt.cpp:1280–1322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1278}
1279
1280DECODING_STATE CWelsDecoder::ParseAccessUnit (SWelsDecoderThreadCTX& sThreadCtx) {
1281 sThreadCtx.pCtx->bHasNewSps = false;
1282 sThreadCtx.pCtx->bParamSetsLostFlag = m_bParamSetsLostFlag;
1283 sThreadCtx.pCtx->bFreezeOutput = m_bFreezeOutput;
1284 sThreadCtx.pCtx->uiDecodingTimeStamp = ++m_uiDecodeTimeStamp;
1285 bool bPicBuffChanged = false;
1286 if (m_pLastDecThrCtx != NULL && sThreadCtx.pCtx->sSpsPpsCtx.iSeqId < m_pLastDecThrCtx->pCtx->sSpsPpsCtx.iSeqId) {
1287 CopySpsPps (m_pLastDecThrCtx->pCtx, sThreadCtx.pCtx);
1288 sThreadCtx.pCtx->iPicQueueNumber = m_pLastDecThrCtx->pCtx->iPicQueueNumber;
1289 if (sThreadCtx.pCtx->pPicBuff != m_pPicBuff) {
1290 bPicBuffChanged = true;
1291 sThreadCtx.pCtx->pPicBuff = m_pPicBuff;
1292 sThreadCtx.pCtx->bHaveGotMemory = m_pPicBuff != NULL;
1293 sThreadCtx.pCtx->iImgWidthInPixel = m_pLastDecThrCtx->pCtx->iImgWidthInPixel;
1294 sThreadCtx.pCtx->iImgHeightInPixel = m_pLastDecThrCtx->pCtx->iImgHeightInPixel;
1295 }
1296 }
1297
1298 //if threadCount > 1, then each thread must contain exact one complete frame.
1299 if (GetThreadCount (sThreadCtx.pCtx) > 1) {
1300 sThreadCtx.pCtx->pAccessUnitList->uiAvailUnitsNum = 0;
1301 sThreadCtx.pCtx->pAccessUnitList->uiActualUnitsNum = 0;
1302 }
1303
1304 int32_t iRet = DecodeFrame2WithCtx (sThreadCtx.pCtx, sThreadCtx.kpSrc, sThreadCtx.kiSrcLen, sThreadCtx.ppDst,
1305 &sThreadCtx.sDstInfo);
1306
1307 int32_t iErr = InitConstructAccessUnit (sThreadCtx.pCtx, &sThreadCtx.sDstInfo);
1308 if (ERR_NONE != iErr) {
1309 return (DECODING_STATE) (iRet | iErr);
1310 }
1311 if (sThreadCtx.pCtx->bNewSeqBegin) {
1312 m_pPicBuff = sThreadCtx.pCtx->pPicBuff;
1313 } else if (bPicBuffChanged) {
1314 InitialDqLayersContext (sThreadCtx.pCtx, sThreadCtx.pCtx->pSps->iMbWidth << 4, sThreadCtx.pCtx->pSps->iMbHeight << 4);
1315 }
1316 if (!sThreadCtx.pCtx->bNewSeqBegin && m_pLastDecThrCtx != NULL) {
1317 sThreadCtx.pCtx->sFrameCrop = m_pLastDecThrCtx->pCtx->pSps->sFrameCrop;
1318 }
1319 m_bParamSetsLostFlag = sThreadCtx.pCtx->bNewSeqBegin ? false : sThreadCtx.pCtx->bParamSetsLostFlag;
1320 m_bFreezeOutput = sThreadCtx.pCtx->bNewSeqBegin ? false : sThreadCtx.pCtx->bFreezeOutput;
1321 return (DECODING_STATE)iErr;
1322}
1323/*
1324* Run decoding picture in separate thread.
1325*/

Callers

nothing calls this directly

Calls 4

CopySpsPpsFunction · 0.85
GetThreadCountFunction · 0.85
InitConstructAccessUnitFunction · 0.85
InitialDqLayersContextFunction · 0.85

Tested by

no test coverage detected