STRUCT V4L2_CTRL_H264_SLICE_PARAMS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 to slice_data from 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 β€” see V4L2_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