Commit 4245232f authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Mauro Carvalho Chehab

media: uapi: h264: Increase size of 'first_mb_in_slice' field

Slice header syntax element 'first_mb_in_slice' can point
to the last macroblock, currently the field can only reference
65536 macroblocks which is insufficient for 8K videos.

Although unlikely, a 8192x4320 video (where macroblocks are 16x16),
would contain 138240 macroblocks on a frame.

As per the H264 specification, 'first_mb_in_slice' can be up to
PicSizeInMbs - 1, so increase the size of the field to 32-bits.

Note that v4l2_ctrl_h264_slice_params struct will be modified
in a follow-up commit, and so we defer its 64-bit padding.
Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
Tested-by: default avatarJonas Karlman <jonas@kwiboo.se>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent fb92c563
...@@ -1774,7 +1774,7 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - ...@@ -1774,7 +1774,7 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
* - __u32 * - __u32
- ``header_bit_size`` - ``header_bit_size``
- -
* - __u16 * - __u32
- ``first_mb_in_slice`` - ``first_mb_in_slice``
- -
* - __u8 * - __u8
......
...@@ -172,7 +172,8 @@ struct v4l2_ctrl_h264_slice_params { ...@@ -172,7 +172,8 @@ struct v4l2_ctrl_h264_slice_params {
/* Offset in bits to slice_data() from the beginning of this slice. */ /* Offset in bits to slice_data() from the beginning of this slice. */
__u32 header_bit_size; __u32 header_bit_size;
__u16 first_mb_in_slice; __u32 first_mb_in_slice;
__u8 slice_type; __u8 slice_type;
__u8 pic_parameter_set_id; __u8 pic_parameter_set_id;
__u8 colour_plane_id; __u8 colour_plane_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment