Esempio n. 1
0
bool VaapiDPBManager::execDummyPictureMarking(const PicturePtr& dummyPic,
                                              const SliceHeaderPtr& sliceHdr,
                                              int32_t frameNum)
{
    initPictureRefLists(dummyPic);
    initPictureRefsPicNum(dummyPic, sliceHdr, frameNum);
    if (!execRefPicMarkingSlidingWindow(dummyPic))
        return false;
    removeShortReference(dummyPic);
    /* add to short reference */
    DPBLayer->shortRef[DPBLayer->shortRefCount++] = dummyPic.get();

    return true;
}
Esempio n. 2
0
/* initialize reference list */
void VaapiDPBManager::initPictureRefs(const PicturePtr& pic,
                                      const SliceHeaderPtr& sliceHdr,
                                      int32_t frameNum)
{
    uint32_t i, numRefs;

    initPictureRefLists(pic);

    initPictureRefsPicNum(pic, sliceHdr, frameNum);

    DPBLayer->refPicList0Count = 0;
    DPBLayer->refPicList1Count = 0;

    switch (pic->m_type) {
    case VAAPI_PICTURE_TYPE_P:
    case VAAPI_PICTURE_TYPE_SP:
        initPictureRefsPSlice(pic, sliceHdr);
        break;
    case VAAPI_PICTURE_TYPE_B:
        initPictureRefsBSlice(pic, sliceHdr);
        break;
    default:
        break;
    }

    execPictureRefsModification(pic, sliceHdr);

    switch (pic->m_type) {
    case VAAPI_PICTURE_TYPE_B:
        numRefs = 1 + sliceHdr->num_ref_idx_l1_active_minus1;
        for (i = DPBLayer->refPicList1Count; i < numRefs; i++)
            DPBLayer->refPicList1[i] = NULL;
        //DPBLayer->refPicList1Count = numRefs;

        // fall-through
    case VAAPI_PICTURE_TYPE_P:
    case VAAPI_PICTURE_TYPE_SP:
        numRefs = 1 + sliceHdr->num_ref_idx_l0_active_minus1;
        for (i = DPBLayer->refPicList0Count; i < numRefs; i++)
            DPBLayer->refPicList0[i] = NULL;
        //DPBLayer->refPicList0Count = numRefs;
        break;
    default:
        break;
    }
}