STRUCT V4L2_CTRL_HEVC_SLICE_PARAMS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

struct v4l2_ctrl_hevc_slice_params β€” HEVC slice parameters πŸ’…

Bestie, this is the little struct that holds everything the kernel needs to know about one HEVC slice. It's giving "backstage pass to the decoder" energy, and tbh it ate. πŸŽ€


🌸 SYNOPSIS 🌸

struct v4l2_ctrl_hevc_slice_params {
    __u32 bit_size;
    __u32 data_byte_offset;
    __u32 num_entry_point_offsets;
    __u8 nal_unit_type;
    __u8 nuh_temporal_id_plus1;
    __u8 slice_type;
    __u8 colour_plane_id;
    __s32 slice_pic_order_cnt;
    __u8 num_ref_idx_l0_active_minus1;
    __u8 num_ref_idx_l1_active_minus1;
    __u8 collocated_ref_idx;
    __u8 five_minus_max_num_merge_cand;
    __s8 slice_qp_delta;
    __s8 slice_cb_qp_offset;
    __s8 slice_cr_qp_offset;
    __s8 slice_act_y_qp_offset;
    __s8 slice_act_cb_qp_offset;
    __s8 slice_act_cr_qp_offset;
    __s8 slice_beta_offset_div2;
    __s8 slice_tc_offset_div2;
    __u8 pic_struct;
    __u8 reserved0[3];
    __u32 slice_segment_addr;
    __u8 ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
    __u8 ref_idx_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX];
    __u16 short_term_ref_pic_set_size;
    __u16 long_term_ref_pic_set_size;
    struct v4l2_hevc_pred_weight_table pred_weight_table;
    __u8 reserved1[2];
    __u64 flags;
 };

Like, look at her. Gorgeous. Every field accounted for, no notes. πŸ‘‘


πŸ¦‹ Members πŸ¦‹

Ok so let's go field by field, because bestie you will be asked about these:

  • bit_size β€” the size, in bits, of the current slice data. That's it. That's the field. ✨
  • data_byte_offset β€” how far, in bytes, you gotta hop to find the video data for the current slice.
  • num_entry_point_offsets β€” says how many entry point offset syntax elements are chilling in the slice header.
  • nal_unit_type β€” the coding type of the slice, i.e. is she a B, a P, or an I? main character choices only.
  • nuh_temporal_id_plus1 β€” minus 1, this specifies a temporal identifier for the NAL unit. (Yes, "minus 1" is literally in the name, it's not a typo, don't come for me.)
  • slice_type β€” peep V4L2_HEVC_SLICE_TYPE_{} for the deets.
  • colour_plane_id β€” which colour plane is associated with the current slice. (Spelled with a u, she's fancy.)
  • slice_pic_order_cnt β€” the picture order count. Keeping things in order, as one does. πŸ’…
  • num_ref_idx_l0_active_minus1 β€” this value plus 1 gives the maximum reference index for reference picture list 0 that may be used to decode the slice.
  • num_ref_idx_l1_active_minus1 β€” same vibe as above, but for reference picture list 1. This value plus 1 = the max reference index for list 1 that may be used to decode the slice.
  • collocated_ref_idx β€” the reference index of the collocated picture used for temporal motion vector prediction. Say that five times fast, I dare you. 😭
  • five_minus_max_num_merge_cand β€” the maximum number of merging motion vector prediction candidates supported in the slice, subtracted from 5. Math girlie.
  • slice_qp_delta β€” the initial value of QpY that gets used for the coding blocks in the slice.
  • slice_cb_qp_offset β€” a difference to be added to the value of pps_cb_qp_offset.
  • slice_cr_qp_offset β€” a difference to be added to the value of pps_cr_qp_offset.
  • slice_act_y_qp_offset β€” screen content extension parameters. Very niche, very demure.
  • slice_act_cb_qp_offset β€” screen content extension parameters. Same energy.
  • slice_act_cr_qp_offset β€” screen content extension parameters. Third time's the charm. πŸ“
  • slice_beta_offset_div2 β€” specifies the deblocking parameter offsets for beta, divided by 2.
  • slice_tc_offset_div2 β€” specifies the deblocking parameter offsets for tC, divided by 2.
  • pic_struct β€” tells you whether a picture should be displayed as a frame, or as one or more fields.
  • reserved0 β€” padding field. Should be zeroed by applications. Don't be chaotic, zero it. πŸ™ˆ
  • slice_segment_addr β€” the address of the first coding tree block in the slice segment.
  • ref_idx_l0 β€” the list of L0 reference elements, as indices in the DPB.
  • ref_idx_l1 β€” the list of L1 reference elements, as indices in the DPB.
  • short_term_ref_pic_set_size β€” the size of the short-term reference pictures set included in the SPS.
  • long_term_ref_pic_set_size β€” the size of the long-term reference pictures set include in the SPS. (That's the original wording's grammar, not mine β€” leaving it exactly as it lives. 🫢)
  • pred_weight_table β€” the prediction weight coefficients for inter-picture prediction.
  • reserved1 β€” padding field. Should be zeroed by applications. Same rules, bestie. ⭐
  • flags β€” check V4L2_HEVC_SLICE_PARAMS_FLAG_{} for what's up in there.

πŸ’– Description πŸ’–

So this control is a dynamically sized 1-dimensional array, and β€” important β€” the V4L2_CTRL_FLAG_DYNAMIC_ARRAY flag must be set when you use it. No flag, no slay. Flat out required. πŸ”₯

Not me being dramatic about it, but like β€” the flag isn't optional. It's giving "you WILL set this flag". Periodt. πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./include/uapi/linux/v4l2-controls.h, plus literally the entire extended universe of V4L2 controls down here (yes, all of them, I would never do you dirty by trimming the list):

  • 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_ctrl_h264_slice_params(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_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)

Ok that's the whole page, you're officially educated. πŸ’œ Go forth and decode responsibly.

This little gem lives under ./include/uapi/linux, and this version is dated October 2026 β€” so if you're reading it later than that, no cap, go check for a newer one. Love u, bye! πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from