STRUCT V4L2_CTRL_H264_SLICE_PARAMS(9)
π NAME π
struct v4l2_ctrl_h264_slice_params β the H264 slice parameters, bestie π
okay so real quick before we dive in: this page lives in the Kernel API Manual, section 9, and it's literally all about one struct. buckle up π¦
β¨ SYNOPSIS β¨
struct v4l2_ctrl_h264_slice_params {
__u32 header_bit_size;
__u32 first_mb_in_slice;
__u8 slice_type;
__u8 colour_plane_id;
__u8 redundant_pic_cnt;
__u8 cabac_init_idc;
__s8 slice_qp_delta;
__s8 slice_qs_delta;
__u8 disable_deblocking_filter_idc;
__s8 slice_alpha_c0_offset_div2;
__s8 slice_beta_offset_div2;
__u8 num_ref_idx_l0_active_minus1;
__u8 num_ref_idx_l1_active_minus1;
__u8 reserved;
struct v4l2_h264_reference ref_pic_list0[V4L2_H264_REF_LIST_LEN];
struct v4l2_h264_reference ref_pic_list1[V4L2_H264_REF_LIST_LEN];
__u32 flags;
};
that's the whole squad right there, no cap π
π MEMBERS π
okay so here's the member-by-member breakdown, and yes i'm gonna hype each one up because they all matter:
header_bit_sizeβ this is the offset in bits toslice_datafrom the beginning of this slice. like, where the actual data starts, in bits. slay β¨first_mb_in_sliceβ see H264 specification. (iykyk, the spec is the main character here fr)slice_typeβ see H264 specification.colour_plane_idβ see H264 specification.redundant_pic_cntβ see H264 specification.cabac_init_idcβ see H264 specification.slice_qp_deltaβ see H264 specification.slice_qs_deltaβ see H264 specification.disable_deblocking_filter_idcβ see H264 specification.slice_alpha_c0_offset_div2β see H264 specification.slice_beta_offset_div2β see H264 specification.num_ref_idx_l0_active_minus1β see H264 specification.num_ref_idx_l1_active_minus1β see H264 specification.reservedβ padding field. Should be zeroed by applications. like, please zero it, don't be that person πref_pic_list0β reference picture list 0 after applying the per-slice modifications. yes, after the modifications, that's the whole point πref_pic_list1β reference picture list 1 after applying the per-slice modifications.flagsβ seeV4L2_H264_SLICE_FLAG_{}. the curly braces are literally part of the vibe, don't come for me π«Ά
πΈ DESCRIPTION πΈ
okay so here's the tea: this structure holds the H264 syntax elements that are specified as non-invariant for the slices in a given frame. non-invariant = these babies change slice to slice, so they need their own home π
meanwhile, the slice invariant syntax elements live over in struct v4l2_ctrl_h264_decode_params. and why, you ask? because it reduces the API surface on frame-based decoders, where the slice header parsing is done by the hardware. hardware does the parsing, struct stays smaller, everybody eats π₯
the slice invariant syntax elements are specified in specification section "7.4.3 Slice header semantics" β go read it, it's giving required reading π
and except where noted, the members on this struct match the slice header syntax. literally matching, character for character energy.
π¦ SEE ALSO π¦
Kernel file ./include/uapi/linux/v4l2-controls.h β and then the entire extended friend group:
enum v4l2_mpeg_video_av1_profile(9)enum v4l2_mpeg_video_av1_level(9)enum v4l2_stateless_h264_decode_mode(9)enum v4l2_stateless_h264_start_code(9)struct v4l2_ctrl_h264_sps(9)struct v4l2_ctrl_h264_pps(9)struct v4l2_ctrl_h264_scaling_matrix(9)struct v4l2_ctrl_h264_pred_weights(9)struct v4l2_h264_reference(9)struct v4l2_h264_dpb_entry(9)struct v4l2_ctrl_h264_decode_params(9)struct v4l2_ctrl_fwht_params(9)struct v4l2_vp8_segment(9)struct v4l2_vp8_loop_filter(9)struct v4l2_vp8_quantization(9)struct v4l2_vp8_entropy(9)struct v4l2_vp8_entropy_coder_state(9)struct v4l2_ctrl_vp8_frame(9)struct v4l2_ctrl_mpeg2_sequence(9)struct v4l2_ctrl_mpeg2_picture(9)struct v4l2_ctrl_mpeg2_quantisation(9)struct v4l2_ctrl_hevc_sps(9)struct v4l2_ctrl_hevc_pps(9)struct v4l2_hevc_dpb_entry(9)struct v4l2_hevc_pred_weight_table(9)struct v4l2_ctrl_hevc_slice_params(9)struct v4l2_ctrl_hevc_decode_params(9)struct v4l2_ctrl_hevc_scaling_matrix(9)struct v4l2_vp9_loop_filter(9)struct v4l2_vp9_quantization(9)struct v4l2_vp9_segmentation(9)struct v4l2_ctrl_vp9_frame(9)struct v4l2_vp9_mv_probs(9)struct v4l2_ctrl_vp9_compressed_hdr(9)struct v4l2_ctrl_av1_sequence(9)struct v4l2_ctrl_av1_tile_group_entry(9)enum v4l2_av1_warp_model(9)enum v4l2_av1_reference_frame(9)struct v4l2_av1_global_motion(9)enum v4l2_av1_frame_restoration_type(9)struct v4l2_av1_loop_restoration(9)struct v4l2_av1_cdef(9)enum v4l2_av1_segment_feature(9)struct v4l2_av1_segmentation(9)struct v4l2_av1_loop_filter(9)struct v4l2_av1_quantization(9)struct v4l2_av1_tile_info(9)enum v4l2_av1_frame_type(9)enum v4l2_av1_interpolation_filter(9)enum v4l2_av1_tx_mode(9)struct v4l2_ctrl_av1_frame(9)struct v4l2_ctrl_av1_film_grain(9)
like, that's the whole codec cinematic universe, and they all live in the same header. iconic π
π and that's the page!! π sourced from ./include/uapi/linux, dated October 2026 β go off, kernel docs, periodt πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms