From 3b0ed2365c089f9eb9a462805796636edc53ff44 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 12 Jun 2023 14:38:44 +1000 Subject: [PATCH] vulkan/h264: set non-existing flag for invalid gaps This flag is used to indicate to the hw frames in the gaps, vaapi constructs it from a bunch of implicit API information around surface ids. vulkan should just send it explicitly. Reviewed-by: Lynne --- libavcodec/vulkan_h264.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libavcodec/vulkan_h264.c b/libavcodec/vulkan_h264.c index 0548232971..4cfd83fc19 100644 --- a/libavcodec/vulkan_h264.c +++ b/libavcodec/vulkan_h264.c @@ -68,7 +68,14 @@ static int vk_h264_fill_pict(AVCodecContext *avctx, H264Picture **ref_src, .top_field_flag = is_field ? !!(picture_structure & PICT_TOP_FIELD) : 0, .bottom_field_flag = is_field ? !!(picture_structure & PICT_BOTTOM_FIELD) : 0, .used_for_long_term_reference = pic->reference && pic->long_ref, - .is_non_existing = 0, + /* + * flags.is_non_existing is used to indicate whether the picture is marked as + * “non-existing” as defined in section 8.2.5.2 of the ITU-T H.264 Specification; + * 8.2.5.2 Decoding process for gaps in frame_num + * corresponds to the code in h264_slice.c:h264_field_start, + * which sets the invalid_gap flag when decoding. + */ + .is_non_existing = pic->invalid_gap, }, };