* fills the pRefPic.pRefList. */
| 357 | * fills the pRefPic.pRefList. |
| 358 | */ |
| 359 | int32_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 | |
| 385 | int32_t WelsReorderRefList (PWelsDecoderContext pCtx) { |
| 386 |
no test coverage detected