* Translate an FFmpeg Picture into its VA API form. * * @param[out] va_pic A pointer to VA API's own picture struct * @param[in] pic A pointer to the FFmpeg picture struct to convert * @param[in] pic_structure The picture field type (as defined in mpegvideo.h), * supersedes pic's field type if nonzero. */
| 53 | * supersedes pic's field type if nonzero. |
| 54 | */ |
| 55 | static void fill_vaapi_pic(VAPictureH264 *va_pic, |
| 56 | const H264Picture *pic, |
| 57 | int pic_structure) |
| 58 | { |
| 59 | if (pic_structure == 0) |
| 60 | pic_structure = pic->reference; |
| 61 | pic_structure &= PICT_FRAME; /* PICT_TOP_FIELD|PICT_BOTTOM_FIELD */ |
| 62 | |
| 63 | va_pic->picture_id = ff_vaapi_get_surface_id(pic->f); |
| 64 | va_pic->frame_idx = pic->long_ref ? pic->pic_id : pic->frame_num; |
| 65 | |
| 66 | va_pic->flags = 0; |
| 67 | if (pic_structure != PICT_FRAME) |
| 68 | va_pic->flags |= (pic_structure & PICT_TOP_FIELD) ? VA_PICTURE_H264_TOP_FIELD : VA_PICTURE_H264_BOTTOM_FIELD; |
| 69 | if (pic->reference) |
| 70 | va_pic->flags |= pic->long_ref ? VA_PICTURE_H264_LONG_TERM_REFERENCE : VA_PICTURE_H264_SHORT_TERM_REFERENCE; |
| 71 | |
| 72 | va_pic->TopFieldOrderCnt = 0; |
| 73 | if (pic->field_poc[0] != INT_MAX) |
| 74 | va_pic->TopFieldOrderCnt = pic->field_poc[0]; |
| 75 | |
| 76 | va_pic->BottomFieldOrderCnt = 0; |
| 77 | if (pic->field_poc[1] != INT_MAX) |
| 78 | va_pic->BottomFieldOrderCnt = pic->field_poc[1]; |
| 79 | } |
| 80 | |
| 81 | /** Decoded Picture Buffer (DPB). */ |
| 82 | typedef struct DPB { |
no test coverage detected