From 4e0d4aab48509af32d06ac97b8c10cd304c236fb Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 9 Mar 2023 15:23:04 +1000 Subject: [PATCH] anv: fix image height for field pictures. Fixes: 98c58a16ef1ab2 ("anv: add initial video decode support for h264.) Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/genX_video.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/genX_video.c b/src/intel/vulkan/genX_video.c index 3d85653..253fcfe 100644 --- a/src/intel/vulkan/genX_video.c +++ b/src/intel/vulkan/genX_video.c @@ -231,10 +231,13 @@ anv_h264_decode_video(struct anv_cmd_buffer *cmd_buffer, picid.PictureIDRemappingDisable = true; } + uint32_t pic_height = sps->pic_height_in_map_units_minus1 + 1; + if (!sps->flags.frame_mbs_only_flag) + pic_height *= 2; anv_batch_emit(&cmd_buffer->batch, GENX(MFX_AVC_IMG_STATE), avc_img) { avc_img.FrameWidth = sps->pic_width_in_mbs_minus1; - avc_img.FrameHeight = sps->pic_height_in_map_units_minus1; - avc_img.FrameSize = (sps->pic_width_in_mbs_minus1 + 1) * (sps->pic_height_in_map_units_minus1 + 1); + avc_img.FrameHeight = pic_height - 1; + avc_img.FrameSize = (sps->pic_width_in_mbs_minus1 + 1) * pic_height; if (!h264_pic_info->pStdPictureInfo->flags.field_pic_flag) avc_img.ImageStructure = FramePicture; -- 2.7.4