From 167bcee3b74e8daef694f0ebc329f4700a805267 Mon Sep 17 00:00:00 2001 From: Hyunjun Ko Date: Thu, 20 Mar 2025 16:33:27 +0900 Subject: [PATCH] vulkan/video: Do byte-alignment when building a h264 slice header Fixes: ff8de6190 ("vulkan/video: adds a bitstream writer of h264 slice header") Closes: mesa/mesa#12835 Signed-off-by: Hyunjun Ko Acked-by: Lionel Landwerlin Part-of: (cherry picked from commit c22a635938c4df93bde6d0b6d4726f4a99c7dbd8) --- .pick_status.json | 2 +- src/vulkan/runtime/vk_video.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index eae31bf0dd1..fef3b668112 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3454,7 +3454,7 @@ "description": "vulkan/video: Do byte-alignment when building a h264 slice header", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "ff8de61907083855a5c3bf307e133628cd919b4c", "notes": null diff --git a/src/vulkan/runtime/vk_video.c b/src/vulkan/runtime/vk_video.c index 1791a676278..aa3ee5da951 100644 --- a/src/vulkan/runtime/vk_video.c +++ b/src/vulkan/runtime/vk_video.c @@ -2258,6 +2258,7 @@ vk_video_encode_h264_slice_header(const StdVideoEncodeH264PictureInfo *pic_info, assert(is_aligned); } + vl_bitstream_rbsp_trailing(&enc); vl_bitstream_flush(&enc); *data_size_ptr += vl_bitstream_get_byte_count(&enc); vl_bitstream_encoder_free(&enc);