From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Paul Kocialkowski <paulk@sys-base.io>,
devicetree@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil@kernel.org>,
Marco Felsch <m.felsch@pengutronix.de>,
Michael Tretter <m.tretter@pengutronix.de>
Subject: Re: [PATCH 03/14] media: h264: Add SPS video definitions
Date: Tue, 17 Nov 2026 16:31:55 -0500 [thread overview]
Message-ID: <db1d7bd622df8b0edc0c329c37a350cee745b123.camel@collabora.com> (raw)
In-Reply-To: <20260522101653.2565125-4-paulk@sys-base.io>
[-- Attachment #1: Type: text/plain, Size: 5208 bytes --]
Hi,
Le vendredi 22 mai 2026 à 12:16 +0200, Paul Kocialkowski a écrit :
> These definitions are used to build the video part of the SPS,
> including important fields such as frame cropping, timing info
> (frame rate) and pixel coding.
Since the kernel take control of bitstream generation, maybe it should offer to
insert SEIs ?
Nicolas
>
> Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
> ---
> include/media/v4l2-h264.h | 115 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 115 insertions(+)
>
> diff --git a/include/media/v4l2-h264.h b/include/media/v4l2-h264.h
> index 1833c0556963..3b00a1b67fe5 100644
> --- a/include/media/v4l2-h264.h
> +++ b/include/media/v4l2-h264.h
> @@ -12,6 +12,121 @@
>
> #include <media/v4l2-ctrls.h>
>
> +#define V4L2_H264_START_CODE_ANNEX_B 0x00000001
> +
> +#define V4L2_H264_NALU_TYPE_SLICE_NON_IDR 1
> +#define V4L2_H264_NALU_TYPE_SLICE_IDR 5
> +#define V4L2_H264_NALU_TYPE_SPS 7
> +#define V4L2_H264_NALU_TYPE_PPS 8
> +#define V4L2_H264_NALU_TYPE_AUD 9
> +
> +#define V4L2_H264_PRIMARY_PIC_TYPE_I 0
> +#define V4L2_H264_PRIMARY_PIC_TYPE_IP 1
> +#define V4L2_H264_PRIMARY_PIC_TYPE_IPB 2
> +
> +#define V4L2_H264_VUI_ASPECT_RATIO_IDC_EXTENDED 255
> +
> +#define V4L2_H264_VUI_VIDEO_COMPONENT 0
> +#define V4L2_H264_VUI_VIDEO_PAL 1
> +#define V4L2_H264_VUI_VIDEO_NTSC 2
> +#define V4L2_H264_VUI_VIDEO_SECAM 3
> +#define V4L2_H264_VUI_VIDEO_MAC 4
> +#define V4L2_H264_VUI_VIDEO_UNSPECIFIED 5
> +
> +#define V4L2_H264_VUI_COLOUR_BT709 1
> +#define V4L2_H264_VUI_COLOUR_UNSPECIFIED 2
> +#define V4L2_H264_VUI_COLOUR_BT470_SYSTEM_M 4
> +#define V4L2_H264_VUI_COLOUR_BT470_SYSTEM_BG 5
> +#define V4L2_H264_VUI_COLOUR_SMPTE170M 6
> +#define V4L2_H264_VUI_COLOUR_SMPTE240M 7
> +#define V4L2_H264_VUI_COLOUR_BT2020 9
> +
> +#define V4L2_H264_VUI_TRANSFER_BT709 1
> +#define V4L2_H264_VUI_TRANSFER_UNSPECIFIED 2
> +#define V4L2_H264_VUI_TRANSFER_BT470_SYSTEM_M 4
> +#define V4L2_H264_VUI_TRANSFER_BT470_SYSTEM_BG 5
> +#define V4L2_H264_VUI_TRANSFER_SMPTE170M 6
> +#define V4L2_H264_VUI_TRANSFER_SMPTE240M 7
> +#define V4L2_H264_VUI_TRANSFER_LINEAR 8
> +#define V4L2_H264_VUI_TRANSFER_SRGB 13
> +
> +#define V4L2_H264_VUI_MATRIX_IDENTITY 0
> +#define V4L2_H264_VUI_MATRIX_BT709 1
> +#define V4L2_H264_VUI_MATRIX_UNSPECIFIED 2
> +#define V4L2_H264_VUI_MATRIX_BT470_SYSTEM_M 4
> +#define V4L2_H264_VUI_MATRIX_BT470_SYSTEM_BG 5
> +#define V4L2_H264_VUI_MATRIX_SMPTE170M 6
> +#define V4L2_H264_VUI_MATRIX_SMPTE240M 7
> +#define V4L2_H264_VUI_MATRIX_BT2020 9
> +#define V4L2_H264_VUI_MATRIX_BT2020_CONST_LUM 10
> +
> +#define V4L2_H264_SPS_VIDEO_FLAG_FRAME_CROPPING BIT(0)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_PARAMETERS_PRESENT BIT(1)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_ASPECT_RATIO_INFO_PRESENT BIT(2)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_OVERSCAN_INFO_PRESENT BIT(3)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_OVERSCAN_APPROPRIATE BIT(4)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_VIDEO_SIGNAL_TYPE_PRESENT BIT(5)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_VIDEO_FULL_RANGE BIT(6)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_COLOUR_DESCRIPTION_PRESENT BIT(7)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_CHROMA_LOC_INFO_PRESENT BIT(8)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_TIMING_INFO_PRESENT BIT(9)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_FIXED_FRAME_RATE BIT(10)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_NAL_HRD_PARAMETERS_PRESENT BIT(11)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_VCL_HRD_PARAMETERS_PRESENT BIT(12)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_LOW_DELAY_HRD BIT(13)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_PIC_STRUCT_PRESENT BIT(14)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_BITSTREAM_RESTRICTION BIT(15)
> +#define V4L2_H264_SPS_VIDEO_FLAG_VUI_MOTION_VECTORS_OVER_PIC_BOUNDARIES BIT(16)
> +
> +struct v4l2_h264_sps_video_hrd {
> + u8 cpb_cnt_minus1;
> + u8 bit_rate_scale;
> + u8 cpb_size_scale;
> +
> + u32 bit_rate_value_minus1[32];
> + u32 cpb_size_value_minus1[32];
> + u8 cbr_flag[32];
> +
> + u8 initial_cpb_removal_delay_length_minus1;
> + u8 cpb_removal_delay_length_minus1;
> + u8 dpb_output_delay_length_minus1;
> + u8 time_offset_length;
> +};
> +
> +struct v4l2_h264_sps_video {
> + u32 frame_crop_left_offset;
> + u32 frame_crop_right_offset;
> + u32 frame_crop_top_offset;
> + u32 frame_crop_bottom_offset;
> +
> + u8 aspect_ratio_idc;
> + u16 sar_width;
> + u16 sar_height;
> +
> + u8 video_format;
> + u8 colour_primaries;
> + u8 transfer_characteristics;
> + u8 matrix_coefficients;
> +
> + u8 chroma_sample_loc_type_top_field;
> + u8 chroma_sample_loc_type_bottom_field;
> +
> + u32 num_units_in_tick;
> + u32 time_scale;
> +
> + struct v4l2_h264_sps_video_hrd nal_hrd;
> + struct v4l2_h264_sps_video_hrd vcl_hrd;
> +
> + u32 max_bytes_per_pic_denom;
> + u32 max_bits_per_mb_denom;
> + u32 log2_max_mv_length_horizontal;
> + u32 log2_max_mv_length_vertical;
> + u32 max_num_reorder_frames;
> + u32 max_dec_frame_buffering;
> +
> + u32 flags;
> +};
> +
> /**
> * struct v4l2_h264_reflist_builder - Reference list builder object
> *
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-11-17 21:32 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 10:16 [PATCH 00/14] media: Add V4L2 H.264 stateless encode and VC8000E support Paul Kocialkowski
2026-05-22 10:16 ` [PATCH 01/14] media: h264: Add a more generic reflist builder init Paul Kocialkowski
2026-11-17 21:06 ` Nicolas Dufresne
2026-05-22 10:16 ` [PATCH 02/14] media: uapi: Add H.264 stateless encode support Paul Kocialkowski
2026-11-17 21:30 ` Nicolas Dufresne
2026-05-22 10:16 ` [PATCH 03/14] media: h264: Add SPS video definitions Paul Kocialkowski
2026-11-17 21:31 ` Nicolas Dufresne [this message]
2026-11-17 21:34 ` Nicolas Dufresne
2026-05-22 10:16 ` [PATCH 04/14] media: h264: Add stateless encode core Paul Kocialkowski
2026-11-17 21:37 ` Nicolas Dufresne
2026-05-22 10:16 ` [PATCH 05/14] media: h264: Add stateless encode rbsp Paul Kocialkowski
2026-05-22 10:16 ` [PATCH 06/14] media: h264: Add stateless encode reference management Paul Kocialkowski
2026-05-22 10:16 ` [PATCH 07/14] media: h264: Add stateless encode rate control Paul Kocialkowski
2026-05-22 10:16 ` [PATCH 08/14] media: verisilicon: Report default pixel coding for non-JPEG and fix JPEG case Paul Kocialkowski
2026-05-22 10:16 ` [PATCH 09/14] media: verisilicon: Cancel job with runtime pm put/clk disable on failure Paul Kocialkowski
2026-11-17 21:42 ` Nicolas Dufresne
2026-05-22 10:16 ` [PATCH 10/14] media: hantro: use hantro_decoded_buffer only for dst_vq Paul Kocialkowski
2026-11-17 21:48 ` Nicolas Dufresne
2026-05-22 10:16 ` [PATCH 11/14] media: verisilicon: Add common encoder parm and frameintervals ioctls Paul Kocialkowski
2026-11-17 21:50 ` Nicolas Dufresne
2026-05-22 10:16 ` [PATCH 12/14] media: verisilicon: Add support for the VC8000E H.264 encoder Paul Kocialkowski
2026-11-17 22:00 ` Nicolas Dufresne
2026-05-22 10:16 ` [PATCH 13/14] media: verilisicon: imx8m: Add support for the VC8000E on i.MX8MP Paul Kocialkowski
2026-05-22 10:16 ` [PATCH 14/14] arm64: dts: imx8mp: add VC8000E encoder node Paul Kocialkowski
2026-05-22 11:28 ` Fabio Estevam
2026-11-17 22:02 ` Nicolas Dufresne
2026-05-22 14:47 ` [PATCH 00/14] media: Add V4L2 H.264 stateless encode and VC8000E support Nicolas Dufresne
2026-09-23 12:10 ` Michael Nazzareno Trimarchi
2026-09-23 20:05 ` Paul Kocialkowski
2026-09-24 5:30 ` Michael Nazzareno Trimarchi
2026-09-24 18:09 ` Paul Kocialkowski
2026-09-24 19:38 ` Michael Nazzareno Trimarchi
2026-09-24 19:44 ` Nicolas Dufresne
2026-09-24 20:30 ` Paul Kocialkowski
2026-09-24 20:46 ` Nicolas Dufresne
2026-09-30 4:14 ` Chen-Yu Tsai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=db1d7bd622df8b0edc0c329c37a350cee745b123.camel@collabora.com \
--to=nicolas.dufresne@collabora.com \
--cc=benjamin.gaignard@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hverkuil@kernel.org \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.felsch@pengutronix.de \
--cc=m.tretter@pengutronix.de \
--cc=mchehab@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=paulk@sys-base.io \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®