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

Function WelsInitRefList

codec/decoder/core/src/manage_dec_ref.cpp:359–383  ·  view source on GitHub ↗

* fills the pRefPic.pRefList. */

Source from the content-addressed store, hash-verified

357 * fills the pRefPic.pRefList.
358 */
359int32_t WelsInitRefList (PWelsDecoderContext pCtx, int32_t iPoc) {
360
361 int32_t err = WelsCheckAndRecoverForFutureDecoding (pCtx);
362 if (err != ERR_NONE) return err;
363
364 WrapShortRefPicNum (pCtx);
365
366 PPicture* ppShoreRefList = pCtx->sRefPic.pShortRefList[LIST_0];
367 PPicture* ppLongRefList = pCtx->sRefPic.pLongRefList[LIST_0];
368 memset (pCtx->sRefPic.pRefList[LIST_0], 0, MAX_DPB_COUNT * sizeof (PPicture));
369
370 int32_t i, iCount = 0;
371 //short
372 for (i = 0; i < pCtx->sRefPic.uiShortRefCount[LIST_0] && iCount < MAX_REF_PIC_COUNT; ++i) {
373 pCtx->sRefPic.pRefList[LIST_0][iCount++ ] = ppShoreRefList[i];
374 }
375
376 //long
377 for (i = 0; i < pCtx->sRefPic.uiLongRefCount[LIST_0] && iCount < MAX_REF_PIC_COUNT; ++i) {
378 pCtx->sRefPic.pRefList[LIST_0][iCount++ ] = ppLongRefList[i];
379 }
380 pCtx->sRefPic.uiRefCount[LIST_0] = iCount;
381
382 return ERR_NONE;
383}
384
385int32_t WelsReorderRefList (PWelsDecoderContext pCtx) {
386

Callers 1

InitRefPicListFunction · 0.85

Calls 2

WrapShortRefPicNumFunction · 0.85

Tested by

no test coverage detected