Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002 
0003 .. _codec-stateless-controls:
0004 
0005 *********************************
0006 Stateless Codec Control Reference
0007 *********************************
0008 
0009 The Stateless Codec control class is intended to support
0010 stateless decoder and encoders (i.e. hardware accelerators).
0011 
0012 These drivers are typically supported by the :ref:`stateless_decoder`,
0013 and deal with parsed pixel formats such as V4L2_PIX_FMT_H264_SLICE.
0014 
0015 Stateless Codec Control ID
0016 ==========================
0017 
0018 .. _codec-stateless-control-id:
0019 
0020 ``V4L2_CID_CODEC_STATELESS_CLASS (class)``
0021     The Stateless Codec class descriptor.
0022 
0023 .. _v4l2-codec-stateless-h264:
0024 
0025 ``V4L2_CID_STATELESS_H264_SPS (struct)``
0026     Specifies the sequence parameter set (as extracted from the
0027     bitstream) for the associated H264 slice data. This includes the
0028     necessary parameters for configuring a stateless hardware decoding
0029     pipeline for H264. The bitstream parameters are defined according
0030     to :ref:`h264`, section 7.4.2.1.1 "Sequence Parameter Set Data
0031     Semantics". For further documentation, refer to the above
0032     specification, unless there is an explicit comment stating
0033     otherwise.
0034 
0035 .. c:type:: v4l2_ctrl_h264_sps
0036 
0037 .. raw:: latex
0038 
0039     \small
0040 
0041 .. tabularcolumns:: |p{1.2cm}|p{8.6cm}|p{7.5cm}|
0042 
0043 .. flat-table:: struct v4l2_ctrl_h264_sps
0044     :header-rows:  0
0045     :stub-columns: 0
0046     :widths:       1 1 2
0047 
0048     * - __u8
0049       - ``profile_idc``
0050       -
0051     * - __u8
0052       - ``constraint_set_flags``
0053       - See :ref:`Sequence Parameter Set Constraints Set Flags <h264_sps_constraints_set_flags>`
0054     * - __u8
0055       - ``level_idc``
0056       -
0057     * - __u8
0058       - ``seq_parameter_set_id``
0059       -
0060     * - __u8
0061       - ``chroma_format_idc``
0062       -
0063     * - __u8
0064       - ``bit_depth_luma_minus8``
0065       -
0066     * - __u8
0067       - ``bit_depth_chroma_minus8``
0068       -
0069     * - __u8
0070       - ``log2_max_frame_num_minus4``
0071       -
0072     * - __u8
0073       - ``pic_order_cnt_type``
0074       -
0075     * - __u8
0076       - ``log2_max_pic_order_cnt_lsb_minus4``
0077       -
0078     * - __u8
0079       - ``max_num_ref_frames``
0080       -
0081     * - __u8
0082       - ``num_ref_frames_in_pic_order_cnt_cycle``
0083       -
0084     * - __s32
0085       - ``offset_for_ref_frame[255]``
0086       -
0087     * - __s32
0088       - ``offset_for_non_ref_pic``
0089       -
0090     * - __s32
0091       - ``offset_for_top_to_bottom_field``
0092       -
0093     * - __u16
0094       - ``pic_width_in_mbs_minus1``
0095       -
0096     * - __u16
0097       - ``pic_height_in_map_units_minus1``
0098       -
0099     * - __u32
0100       - ``flags``
0101       - See :ref:`Sequence Parameter Set Flags <h264_sps_flags>`
0102 
0103 .. raw:: latex
0104 
0105     \normalsize
0106 
0107 .. _h264_sps_constraints_set_flags:
0108 
0109 ``Sequence Parameter Set Constraints Set Flags``
0110 
0111 .. cssclass:: longtable
0112 
0113 .. flat-table::
0114     :header-rows:  0
0115     :stub-columns: 0
0116     :widths:       1 1 2
0117 
0118     * - ``V4L2_H264_SPS_CONSTRAINT_SET0_FLAG``
0119       - 0x00000001
0120       -
0121     * - ``V4L2_H264_SPS_CONSTRAINT_SET1_FLAG``
0122       - 0x00000002
0123       -
0124     * - ``V4L2_H264_SPS_CONSTRAINT_SET2_FLAG``
0125       - 0x00000004
0126       -
0127     * - ``V4L2_H264_SPS_CONSTRAINT_SET3_FLAG``
0128       - 0x00000008
0129       -
0130     * - ``V4L2_H264_SPS_CONSTRAINT_SET4_FLAG``
0131       - 0x00000010
0132       -
0133     * - ``V4L2_H264_SPS_CONSTRAINT_SET5_FLAG``
0134       - 0x00000020
0135       -
0136 
0137 .. _h264_sps_flags:
0138 
0139 ``Sequence Parameter Set Flags``
0140 
0141 .. cssclass:: longtable
0142 
0143 .. flat-table::
0144     :header-rows:  0
0145     :stub-columns: 0
0146     :widths:       1 1 2
0147 
0148     * - ``V4L2_H264_SPS_FLAG_SEPARATE_COLOUR_PLANE``
0149       - 0x00000001
0150       -
0151     * - ``V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS``
0152       - 0x00000002
0153       -
0154     * - ``V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO``
0155       - 0x00000004
0156       -
0157     * - ``V4L2_H264_SPS_FLAG_GAPS_IN_FRAME_NUM_VALUE_ALLOWED``
0158       - 0x00000008
0159       -
0160     * - ``V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY``
0161       - 0x00000010
0162       -
0163     * - ``V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD``
0164       - 0x00000020
0165       -
0166     * - ``V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE``
0167       - 0x00000040
0168       -
0169 
0170 ``V4L2_CID_STATELESS_H264_PPS (struct)``
0171     Specifies the picture parameter set (as extracted from the
0172     bitstream) for the associated H264 slice data. This includes the
0173     necessary parameters for configuring a stateless hardware decoding
0174     pipeline for H264.  The bitstream parameters are defined according
0175     to :ref:`h264`, section 7.4.2.2 "Picture Parameter Set RBSP
0176     Semantics". For further documentation, refer to the above
0177     specification, unless there is an explicit comment stating
0178     otherwise.
0179 
0180 .. c:type:: v4l2_ctrl_h264_pps
0181 
0182 .. raw:: latex
0183 
0184     \small
0185 
0186 .. flat-table:: struct v4l2_ctrl_h264_pps
0187     :header-rows:  0
0188     :stub-columns: 0
0189     :widths:       1 1 2
0190 
0191     * - __u8
0192       - ``pic_parameter_set_id``
0193       -
0194     * - __u8
0195       - ``seq_parameter_set_id``
0196       -
0197     * - __u8
0198       - ``num_slice_groups_minus1``
0199       -
0200     * - __u8
0201       - ``num_ref_idx_l0_default_active_minus1``
0202       -
0203     * - __u8
0204       - ``num_ref_idx_l1_default_active_minus1``
0205       -
0206     * - __u8
0207       - ``weighted_bipred_idc``
0208       -
0209     * - __s8
0210       - ``pic_init_qp_minus26``
0211       -
0212     * - __s8
0213       - ``pic_init_qs_minus26``
0214       -
0215     * - __s8
0216       - ``chroma_qp_index_offset``
0217       -
0218     * - __s8
0219       - ``second_chroma_qp_index_offset``
0220       -
0221     * - __u16
0222       - ``flags``
0223       - See :ref:`Picture Parameter Set Flags <h264_pps_flags>`
0224 
0225 .. raw:: latex
0226 
0227     \normalsize
0228 
0229 .. _h264_pps_flags:
0230 
0231 ``Picture Parameter Set Flags``
0232 
0233 .. raw:: latex
0234 
0235     \begingroup
0236     \scriptsize
0237     \setlength{\tabcolsep}{2pt}
0238 
0239 .. tabularcolumns:: |p{9.8cm}|p{1.0cm}|p{6.5cm}|
0240 
0241 .. flat-table::
0242     :header-rows:  0
0243     :stub-columns: 0
0244     :widths:       10 1 4
0245 
0246     * - ``V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE``
0247       - 0x0001
0248       -
0249     * - ``V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT``
0250       - 0x0002
0251       -
0252     * - ``V4L2_H264_PPS_FLAG_WEIGHTED_PRED``
0253       - 0x0004
0254       -
0255     * - ``V4L2_H264_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT``
0256       - 0x0008
0257       -
0258     * - ``V4L2_H264_PPS_FLAG_CONSTRAINED_INTRA_PRED``
0259       - 0x0010
0260       -
0261     * - ``V4L2_H264_PPS_FLAG_REDUNDANT_PIC_CNT_PRESENT``
0262       - 0x0020
0263       -
0264     * - ``V4L2_H264_PPS_FLAG_TRANSFORM_8X8_MODE``
0265       - 0x0040
0266       -
0267     * - ``V4L2_H264_PPS_FLAG_SCALING_MATRIX_PRESENT``
0268       - 0x0080
0269       - ``V4L2_CID_STATELESS_H264_SCALING_MATRIX``
0270         must be used for this picture.
0271 
0272 .. raw:: latex
0273 
0274     \endgroup
0275 
0276 ``V4L2_CID_STATELESS_H264_SCALING_MATRIX (struct)``
0277     Specifies the scaling matrix (as extracted from the bitstream) for
0278     the associated H264 slice data. The bitstream parameters are
0279     defined according to :ref:`h264`, section 7.4.2.1.1.1 "Scaling
0280     List Semantics". For further documentation, refer to the above
0281     specification, unless there is an explicit comment stating
0282     otherwise.
0283 
0284 .. c:type:: v4l2_ctrl_h264_scaling_matrix
0285 
0286 .. raw:: latex
0287 
0288     \small
0289 
0290 .. tabularcolumns:: |p{0.6cm}|p{4.8cm}|p{11.9cm}|
0291 
0292 .. flat-table:: struct v4l2_ctrl_h264_scaling_matrix
0293     :header-rows:  0
0294     :stub-columns: 0
0295     :widths:       1 1 2
0296 
0297     * - __u8
0298       - ``scaling_list_4x4[6][16]``
0299       - Scaling matrix after applying the inverse scanning process.
0300         Expected list order is Intra Y, Intra Cb, Intra Cr, Inter Y,
0301         Inter Cb, Inter Cr. The values on each scaling list are
0302         expected in raster scan order.
0303     * - __u8
0304       - ``scaling_list_8x8[6][64]``
0305       - Scaling matrix after applying the inverse scanning process.
0306         Expected list order is Intra Y, Inter Y, Intra Cb, Inter Cb,
0307         Intra Cr, Inter Cr. The values on each scaling list are
0308         expected in raster scan order.
0309 
0310 ``V4L2_CID_STATELESS_H264_SLICE_PARAMS (struct)``
0311     Specifies the slice parameters (as extracted from the bitstream)
0312     for the associated H264 slice data. This includes the necessary
0313     parameters for configuring a stateless hardware decoding pipeline
0314     for H264.  The bitstream parameters are defined according to
0315     :ref:`h264`, section 7.4.3 "Slice Header Semantics". For further
0316     documentation, refer to the above specification, unless there is
0317     an explicit comment stating otherwise.
0318 
0319 .. c:type:: v4l2_ctrl_h264_slice_params
0320 
0321 .. raw:: latex
0322 
0323     \small
0324 
0325 .. tabularcolumns:: |p{4.0cm}|p{5.9cm}|p{7.4cm}|
0326 
0327 .. flat-table:: struct v4l2_ctrl_h264_slice_params
0328     :header-rows:  0
0329     :stub-columns: 0
0330     :widths:       1 1 2
0331 
0332     * - __u32
0333       - ``header_bit_size``
0334       - Offset in bits to slice_data() from the beginning of this slice.
0335     * - __u32
0336       - ``first_mb_in_slice``
0337       -
0338     * - __u8
0339       - ``slice_type``
0340       -
0341     * - __u8
0342       - ``colour_plane_id``
0343       -
0344     * - __u8
0345       - ``redundant_pic_cnt``
0346       -
0347     * - __u8
0348       - ``cabac_init_idc``
0349       -
0350     * - __s8
0351       - ``slice_qp_delta``
0352       -
0353     * - __s8
0354       - ``slice_qs_delta``
0355       -
0356     * - __u8
0357       - ``disable_deblocking_filter_idc``
0358       -
0359     * - __s8
0360       - ``slice_alpha_c0_offset_div2``
0361       -
0362     * - __s8
0363       - ``slice_beta_offset_div2``
0364       -
0365     * - __u8
0366       - ``num_ref_idx_l0_active_minus1``
0367       - If num_ref_idx_active_override_flag is not set, this field must be
0368         set to the value of num_ref_idx_l0_default_active_minus1
0369     * - __u8
0370       - ``num_ref_idx_l1_active_minus1``
0371       - If num_ref_idx_active_override_flag is not set, this field must be
0372         set to the value of num_ref_idx_l1_default_active_minus1
0373     * - __u8
0374       - ``reserved``
0375       - Applications and drivers must set this to zero.
0376     * - struct :c:type:`v4l2_h264_reference`
0377       - ``ref_pic_list0[32]``
0378       - Reference picture list after applying the per-slice modifications
0379     * - struct :c:type:`v4l2_h264_reference`
0380       - ``ref_pic_list1[32]``
0381       - Reference picture list after applying the per-slice modifications
0382     * - __u32
0383       - ``flags``
0384       - See :ref:`Slice Parameter Flags <h264_slice_flags>`
0385 
0386 .. raw:: latex
0387 
0388     \normalsize
0389 
0390 .. _h264_slice_flags:
0391 
0392 ``Slice Parameter Set Flags``
0393 
0394 .. cssclass:: longtable
0395 
0396 .. flat-table::
0397     :header-rows:  0
0398     :stub-columns: 0
0399     :widths:       1 1 2
0400 
0401     * - ``V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED``
0402       - 0x00000001
0403       -
0404     * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH``
0405       - 0x00000002
0406       -
0407 
0408 ``V4L2_CID_STATELESS_H264_PRED_WEIGHTS (struct)``
0409     Prediction weight table defined according to :ref:`h264`,
0410     section 7.4.3.2 "Prediction Weight Table Semantics".
0411     The prediction weight table must be passed by applications
0412     under the conditions explained in section 7.3.3 "Slice header
0413     syntax".
0414 
0415 .. c:type:: v4l2_ctrl_h264_pred_weights
0416 
0417 .. raw:: latex
0418 
0419     \small
0420 
0421 .. tabularcolumns:: |p{4.9cm}|p{4.9cm}|p{7.5cm}|
0422 
0423 .. flat-table:: struct v4l2_ctrl_h264_pred_weights
0424     :header-rows:  0
0425     :stub-columns: 0
0426     :widths:       1 1 2
0427 
0428     * - __u16
0429       - ``luma_log2_weight_denom``
0430       -
0431     * - __u16
0432       - ``chroma_log2_weight_denom``
0433       -
0434     * - struct :c:type:`v4l2_h264_weight_factors`
0435       - ``weight_factors[2]``
0436       - The weight factors at index 0 are the weight factors for the reference
0437         list 0, the one at index 1 for the reference list 1.
0438 
0439 .. raw:: latex
0440 
0441     \normalsize
0442 
0443 .. c:type:: v4l2_h264_weight_factors
0444 
0445 .. raw:: latex
0446 
0447     \small
0448 
0449 .. tabularcolumns:: |p{1.0cm}|p{4.5cm}|p{11.8cm}|
0450 
0451 .. flat-table:: struct v4l2_h264_weight_factors
0452     :header-rows:  0
0453     :stub-columns: 0
0454     :widths:       1 1 2
0455 
0456     * - __s16
0457       - ``luma_weight[32]``
0458       -
0459     * - __s16
0460       - ``luma_offset[32]``
0461       -
0462     * - __s16
0463       - ``chroma_weight[32][2]``
0464       -
0465     * - __s16
0466       - ``chroma_offset[32][2]``
0467       -
0468 
0469 .. raw:: latex
0470 
0471     \normalsize
0472 
0473 ``Picture Reference``
0474 
0475 .. c:type:: v4l2_h264_reference
0476 
0477 .. cssclass:: longtable
0478 
0479 .. flat-table:: struct v4l2_h264_reference
0480     :header-rows:  0
0481     :stub-columns: 0
0482     :widths:       1 1 2
0483 
0484     * - __u8
0485       - ``fields``
0486       - Specifies how the picture is referenced. See :ref:`Reference Fields <h264_ref_fields>`
0487     * - __u8
0488       - ``index``
0489       - Index into the :c:type:`v4l2_ctrl_h264_decode_params`.dpb array.
0490 
0491 .. _h264_ref_fields:
0492 
0493 ``Reference Fields``
0494 
0495 .. raw:: latex
0496 
0497     \small
0498 
0499 .. tabularcolumns:: |p{5.4cm}|p{0.8cm}|p{11.1cm}|
0500 
0501 .. flat-table::
0502     :header-rows:  0
0503     :stub-columns: 0
0504     :widths:       1 1 2
0505 
0506     * - ``V4L2_H264_TOP_FIELD_REF``
0507       - 0x1
0508       - The top field in field pair is used for short-term reference.
0509     * - ``V4L2_H264_BOTTOM_FIELD_REF``
0510       - 0x2
0511       - The bottom field in field pair is used for short-term reference.
0512     * - ``V4L2_H264_FRAME_REF``
0513       - 0x3
0514       - The frame (or the top/bottom fields, if it's a field pair)
0515         is used for short-term reference.
0516 
0517 .. raw:: latex
0518 
0519     \normalsize
0520 
0521 ``V4L2_CID_STATELESS_H264_DECODE_PARAMS (struct)``
0522     Specifies the decode parameters (as extracted from the bitstream)
0523     for the associated H264 slice data. This includes the necessary
0524     parameters for configuring a stateless hardware decoding pipeline
0525     for H264. The bitstream parameters are defined according to
0526     :ref:`h264`. For further documentation, refer to the above
0527     specification, unless there is an explicit comment stating
0528     otherwise.
0529 
0530 .. c:type:: v4l2_ctrl_h264_decode_params
0531 
0532 .. raw:: latex
0533 
0534     \small
0535 
0536 .. tabularcolumns:: |p{4.0cm}|p{5.9cm}|p{7.4cm}|
0537 
0538 .. flat-table:: struct v4l2_ctrl_h264_decode_params
0539     :header-rows:  0
0540     :stub-columns: 0
0541     :widths:       1 1 2
0542 
0543     * - struct :c:type:`v4l2_h264_dpb_entry`
0544       - ``dpb[16]``
0545       -
0546     * - __u16
0547       - ``nal_ref_idc``
0548       - NAL reference ID value coming from the NAL Unit header
0549     * - __u16
0550       - ``frame_num``
0551       -
0552     * - __s32
0553       - ``top_field_order_cnt``
0554       - Picture Order Count for the coded top field
0555     * - __s32
0556       - ``bottom_field_order_cnt``
0557       - Picture Order Count for the coded bottom field
0558     * - __u16
0559       - ``idr_pic_id``
0560       -
0561     * - __u16
0562       - ``pic_order_cnt_lsb``
0563       -
0564     * - __s32
0565       - ``delta_pic_order_cnt_bottom``
0566       -
0567     * - __s32
0568       - ``delta_pic_order_cnt0``
0569       -
0570     * - __s32
0571       - ``delta_pic_order_cnt1``
0572       -
0573     * - __u32
0574       - ``dec_ref_pic_marking_bit_size``
0575       - Size in bits of the dec_ref_pic_marking() syntax element.
0576     * - __u32
0577       - ``pic_order_cnt_bit_size``
0578       - Combined size in bits of the picture order count related syntax
0579         elements: pic_order_cnt_lsb, delta_pic_order_cnt_bottom,
0580         delta_pic_order_cnt0, and delta_pic_order_cnt1.
0581     * - __u32
0582       - ``slice_group_change_cycle``
0583       -
0584     * - __u32
0585       - ``reserved``
0586       - Applications and drivers must set this to zero.
0587     * - __u32
0588       - ``flags``
0589       - See :ref:`Decode Parameters Flags <h264_decode_params_flags>`
0590 
0591 .. raw:: latex
0592 
0593     \normalsize
0594 
0595 .. _h264_decode_params_flags:
0596 
0597 ``Decode Parameters Flags``
0598 
0599 .. raw:: latex
0600 
0601     \small
0602 
0603 .. tabularcolumns:: |p{8.3cm}|p{2.1cm}|p{6.9cm}|
0604 
0605 .. flat-table::
0606     :header-rows:  0
0607     :stub-columns: 0
0608     :widths:       1 1 2
0609 
0610     * - ``V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC``
0611       - 0x00000001
0612       - That picture is an IDR picture
0613     * - ``V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC``
0614       - 0x00000002
0615       -
0616     * - ``V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD``
0617       - 0x00000004
0618       -
0619     * - ``V4L2_H264_DECODE_PARAM_FLAG_PFRAME``
0620       - 0x00000008
0621       -
0622     * - ``V4L2_H264_DECODE_PARAM_FLAG_BFRAME``
0623       - 0x00000010
0624       -
0625 
0626 .. raw:: latex
0627 
0628     \normalsize
0629 
0630 .. c:type:: v4l2_h264_dpb_entry
0631 
0632 .. raw:: latex
0633 
0634     \small
0635 
0636 .. tabularcolumns:: |p{1.0cm}|p{4.9cm}|p{11.4cm}|
0637 
0638 .. flat-table:: struct v4l2_h264_dpb_entry
0639     :header-rows:  0
0640     :stub-columns: 0
0641     :widths:       1 1 2
0642 
0643     * - __u64
0644       - ``reference_ts``
0645       - Timestamp of the V4L2 capture buffer to use as reference, used
0646         with B-coded and P-coded frames. The timestamp refers to the
0647         ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
0648         :c:func:`v4l2_timeval_to_ns()` function to convert the struct
0649         :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
0650     * - __u32
0651       - ``pic_num``
0652       - For short term references, this must match the derived value PicNum
0653         (8-28) and for long term references it must match the derived value
0654         LongTermPicNum (8-29). When decoding frames (as opposed to fields)
0655         pic_num is the same as FrameNumWrap.
0656     * - __u16
0657       - ``frame_num``
0658       - For short term references, this must match the frame_num value from
0659         the slice header syntax (the driver will wrap the value if needed). For
0660         long term references, this must be set to the value of
0661         long_term_frame_idx described in the dec_ref_pic_marking() syntax.
0662     * - __u8
0663       - ``fields``
0664       - Specifies how the DPB entry is referenced. See :ref:`Reference Fields <h264_ref_fields>`
0665     * - __u8
0666       - ``reserved[5]``
0667       - Applications and drivers must set this to zero.
0668     * - __s32
0669       - ``top_field_order_cnt``
0670       -
0671     * - __s32
0672       - ``bottom_field_order_cnt``
0673       -
0674     * - __u32
0675       - ``flags``
0676       - See :ref:`DPB Entry Flags <h264_dpb_flags>`
0677 
0678 .. raw:: latex
0679 
0680     \normalsize
0681 
0682 .. _h264_dpb_flags:
0683 
0684 ``DPB Entries Flags``
0685 
0686 .. raw:: latex
0687 
0688     \small
0689 
0690 .. tabularcolumns:: |p{7.7cm}|p{2.1cm}|p{7.5cm}|
0691 
0692 .. flat-table::
0693     :header-rows:  0
0694     :stub-columns: 0
0695     :widths:       1 1 2
0696 
0697     * - ``V4L2_H264_DPB_ENTRY_FLAG_VALID``
0698       - 0x00000001
0699       - The DPB entry is valid (non-empty) and should be considered.
0700     * - ``V4L2_H264_DPB_ENTRY_FLAG_ACTIVE``
0701       - 0x00000002
0702       - The DPB entry is used for reference.
0703     * - ``V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM``
0704       - 0x00000004
0705       - The DPB entry is used for long-term reference.
0706     * - ``V4L2_H264_DPB_ENTRY_FLAG_FIELD``
0707       - 0x00000008
0708       - The DPB entry is a single field or a complementary field pair.
0709 
0710 .. raw:: latex
0711 
0712     \normalsize
0713 
0714 ``V4L2_CID_STATELESS_H264_DECODE_MODE (enum)``
0715     Specifies the decoding mode to use. Currently exposes slice-based and
0716     frame-based decoding but new modes might be added later on.
0717     This control is used as a modifier for V4L2_PIX_FMT_H264_SLICE
0718     pixel format. Applications that support V4L2_PIX_FMT_H264_SLICE
0719     are required to set this control in order to specify the decoding mode
0720     that is expected for the buffer.
0721     Drivers may expose a single or multiple decoding modes, depending
0722     on what they can support.
0723 
0724 .. c:type:: v4l2_stateless_h264_decode_mode
0725 
0726 .. raw:: latex
0727 
0728     \scriptsize
0729 
0730 .. tabularcolumns:: |p{7.4cm}|p{0.3cm}|p{9.6cm}|
0731 
0732 .. flat-table::
0733     :header-rows:  0
0734     :stub-columns: 0
0735     :widths:       1 1 2
0736 
0737     * - ``V4L2_STATELESS_H264_DECODE_MODE_SLICE_BASED``
0738       - 0
0739       - Decoding is done at the slice granularity.
0740         The OUTPUT buffer must contain a single slice.
0741         When this mode is selected, the ``V4L2_CID_STATELESS_H264_SLICE_PARAMS``
0742         control shall be set. When multiple slices compose a frame,
0743         use of ``V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF`` flag
0744         is required.
0745     * - ``V4L2_STATELESS_H264_DECODE_MODE_FRAME_BASED``
0746       - 1
0747       - Decoding is done at the frame granularity,
0748         The OUTPUT buffer must contain all slices needed to decode the
0749         frame. The OUTPUT buffer must also contain both fields.
0750         This mode will be supported by devices that
0751         parse the slice(s) header(s) in hardware. When this mode is
0752         selected, the ``V4L2_CID_STATELESS_H264_SLICE_PARAMS``
0753         control shall not be set.
0754 
0755 .. raw:: latex
0756 
0757     \normalsize
0758 
0759 ``V4L2_CID_STATELESS_H264_START_CODE (enum)``
0760     Specifies the H264 slice start code expected for each slice.
0761     This control is used as a modifier for V4L2_PIX_FMT_H264_SLICE
0762     pixel format. Applications that support V4L2_PIX_FMT_H264_SLICE
0763     are required to set this control in order to specify the start code
0764     that is expected for the buffer.
0765     Drivers may expose a single or multiple start codes, depending
0766     on what they can support.
0767 
0768 .. c:type:: v4l2_stateless_h264_start_code
0769 
0770 .. raw:: latex
0771 
0772     \small
0773 
0774 .. tabularcolumns:: |p{7.9cm}|p{0.4cm}|p{9.0cm}|
0775 
0776 .. flat-table::
0777     :header-rows:  0
0778     :stub-columns: 0
0779     :widths:       4 1 4
0780 
0781     * - ``V4L2_STATELESS_H264_START_CODE_NONE``
0782       - 0
0783       - Selecting this value specifies that H264 slices are passed
0784         to the driver without any start code. The bitstream data should be
0785         according to :ref:`h264` 7.3.1 NAL unit syntax, hence contains
0786         emulation prevention bytes when required.
0787     * - ``V4L2_STATELESS_H264_START_CODE_ANNEX_B``
0788       - 1
0789       - Selecting this value specifies that H264 slices are expected
0790         to be prefixed by Annex B start codes. According to :ref:`h264`
0791         valid start codes can be 3-bytes 0x000001 or 4-bytes 0x00000001.
0792 
0793 .. raw:: latex
0794 
0795     \normalsize
0796 
0797 .. _codec-stateless-fwht:
0798 
0799 ``V4L2_CID_STATELESS_FWHT_PARAMS (struct)``
0800     Specifies the FWHT (Fast Walsh Hadamard Transform) parameters (as extracted
0801     from the bitstream) for the associated FWHT data. This includes the necessary
0802     parameters for configuring a stateless hardware decoding pipeline for FWHT.
0803     This codec is specific to the vicodec test driver.
0804 
0805 .. c:type:: v4l2_ctrl_fwht_params
0806 
0807 .. raw:: latex
0808 
0809     \small
0810 
0811 .. tabularcolumns:: |p{1.4cm}|p{3.9cm}|p{12.0cm}|
0812 
0813 .. flat-table:: struct v4l2_ctrl_fwht_params
0814     :header-rows:  0
0815     :stub-columns: 0
0816     :widths:       1 1 2
0817 
0818     * - __u64
0819       - ``backward_ref_ts``
0820       - Timestamp of the V4L2 capture buffer to use as backward reference, used
0821         with P-coded frames. The timestamp refers to the
0822         ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
0823         :c:func:`v4l2_timeval_to_ns()` function to convert the struct
0824         :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
0825     * - __u32
0826       - ``version``
0827       - The version of the codec. Set to ``V4L2_FWHT_VERSION``.
0828     * - __u32
0829       - ``width``
0830       - The width of the frame.
0831     * - __u32
0832       - ``height``
0833       - The height of the frame.
0834     * - __u32
0835       - ``flags``
0836       - The flags of the frame, see :ref:`fwht-flags`.
0837     * - __u32
0838       - ``colorspace``
0839       - The colorspace of the frame, from enum :c:type:`v4l2_colorspace`.
0840     * - __u32
0841       - ``xfer_func``
0842       - The transfer function, from enum :c:type:`v4l2_xfer_func`.
0843     * - __u32
0844       - ``ycbcr_enc``
0845       - The Y'CbCr encoding, from enum :c:type:`v4l2_ycbcr_encoding`.
0846     * - __u32
0847       - ``quantization``
0848       - The quantization range, from enum :c:type:`v4l2_quantization`.
0849 
0850 .. raw:: latex
0851 
0852     \normalsize
0853 
0854 .. _fwht-flags:
0855 
0856 FWHT Flags
0857 ==========
0858 
0859 .. raw:: latex
0860 
0861     \small
0862 
0863 .. tabularcolumns:: |p{7.0cm}|p{2.3cm}|p{8.0cm}|
0864 
0865 .. flat-table::
0866     :header-rows:  0
0867     :stub-columns: 0
0868     :widths:       3 1 4
0869 
0870     * - ``V4L2_FWHT_FL_IS_INTERLACED``
0871       - 0x00000001
0872       - Set if this is an interlaced format.
0873     * - ``V4L2_FWHT_FL_IS_BOTTOM_FIRST``
0874       - 0x00000002
0875       - Set if this is a bottom-first (NTSC) interlaced format.
0876     * - ``V4L2_FWHT_FL_IS_ALTERNATE``
0877       - 0x00000004
0878       - Set if each 'frame' contains just one field.
0879     * - ``V4L2_FWHT_FL_IS_BOTTOM_FIELD``
0880       - 0x00000008
0881       - If V4L2_FWHT_FL_IS_ALTERNATE was set, then this is set if this 'frame' is the
0882         bottom field, else it is the top field.
0883     * - ``V4L2_FWHT_FL_LUMA_IS_UNCOMPRESSED``
0884       - 0x00000010
0885       - Set if the Y' (luma) plane is uncompressed.
0886     * - ``V4L2_FWHT_FL_CB_IS_UNCOMPRESSED``
0887       - 0x00000020
0888       - Set if the Cb plane is uncompressed.
0889     * - ``V4L2_FWHT_FL_CR_IS_UNCOMPRESSED``
0890       - 0x00000040
0891       - Set if the Cr plane is uncompressed.
0892     * - ``V4L2_FWHT_FL_CHROMA_FULL_HEIGHT``
0893       - 0x00000080
0894       - Set if the chroma plane has the same height as the luma plane,
0895         else the chroma plane is half the height of the luma plane.
0896     * - ``V4L2_FWHT_FL_CHROMA_FULL_WIDTH``
0897       - 0x00000100
0898       - Set if the chroma plane has the same width as the luma plane,
0899         else the chroma plane is half the width of the luma plane.
0900     * - ``V4L2_FWHT_FL_ALPHA_IS_UNCOMPRESSED``
0901       - 0x00000200
0902       - Set if the alpha plane is uncompressed.
0903     * - ``V4L2_FWHT_FL_I_FRAME``
0904       - 0x00000400
0905       - Set if this is an I-frame.
0906     * - ``V4L2_FWHT_FL_COMPONENTS_NUM_MSK``
0907       - 0x00070000
0908       - The number of color components minus one.
0909     * - ``V4L2_FWHT_FL_PIXENC_MSK``
0910       - 0x00180000
0911       - The mask for the pixel encoding.
0912     * - ``V4L2_FWHT_FL_PIXENC_YUV``
0913       - 0x00080000
0914       - Set if the pixel encoding is YUV.
0915     * - ``V4L2_FWHT_FL_PIXENC_RGB``
0916       - 0x00100000
0917       - Set if the pixel encoding is RGB.
0918     * - ``V4L2_FWHT_FL_PIXENC_HSV``
0919       - 0x00180000
0920       - Set if the pixel encoding is HSV.
0921 
0922 .. raw:: latex
0923 
0924     \normalsize
0925 
0926 .. _v4l2-codec-stateless-vp8:
0927 
0928 ``V4L2_CID_STATELESS_VP8_FRAME (struct)``
0929     Specifies the frame parameters for the associated VP8 parsed frame data.
0930     This includes the necessary parameters for
0931     configuring a stateless hardware decoding pipeline for VP8.
0932     The bitstream parameters are defined according to :ref:`vp8`.
0933 
0934 .. c:type:: v4l2_ctrl_vp8_frame
0935 
0936 .. raw:: latex
0937 
0938     \small
0939 
0940 .. tabularcolumns:: |p{7.0cm}|p{4.6cm}|p{5.7cm}|
0941 
0942 .. cssclass:: longtable
0943 
0944 .. flat-table:: struct v4l2_ctrl_vp8_frame
0945     :header-rows:  0
0946     :stub-columns: 0
0947     :widths:       1 1 2
0948 
0949     * - struct :c:type:`v4l2_vp8_segment`
0950       - ``segment``
0951       - Structure with segment-based adjustments metadata.
0952     * - struct :c:type:`v4l2_vp8_loop_filter`
0953       - ``lf``
0954       - Structure with loop filter level adjustments metadata.
0955     * - struct :c:type:`v4l2_vp8_quantization`
0956       - ``quant``
0957       - Structure with VP8 dequantization indices metadata.
0958     * - struct :c:type:`v4l2_vp8_entropy`
0959       - ``entropy``
0960       - Structure with VP8 entropy coder probabilities metadata.
0961     * - struct :c:type:`v4l2_vp8_entropy_coder_state`
0962       - ``coder_state``
0963       - Structure with VP8 entropy coder state.
0964     * - __u16
0965       - ``width``
0966       - The width of the frame. Must be set for all frames.
0967     * - __u16
0968       - ``height``
0969       - The height of the frame. Must be set for all frames.
0970     * - __u8
0971       - ``horizontal_scale``
0972       - Horizontal scaling factor.
0973     * - __u8
0974       - ``vertical_scaling factor``
0975       - Vertical scale.
0976     * - __u8
0977       - ``version``
0978       - Bitstream version.
0979     * - __u8
0980       - ``prob_skip_false``
0981       - Indicates the probability that the macroblock is not skipped.
0982     * - __u8
0983       - ``prob_intra``
0984       - Indicates the probability that a macroblock is intra-predicted.
0985     * - __u8
0986       - ``prob_last``
0987       - Indicates the probability that the last reference frame is used
0988         for inter-prediction
0989     * - __u8
0990       - ``prob_gf``
0991       - Indicates the probability that the golden reference frame is used
0992         for inter-prediction
0993     * - __u8
0994       - ``num_dct_parts``
0995       - Number of DCT coefficients partitions. Must be one of: 1, 2, 4, or 8.
0996     * - __u32
0997       - ``first_part_size``
0998       - Size of the first partition, i.e. the control partition.
0999     * - __u32
1000       - ``first_part_header_bits``
1001       - Size in bits of the first partition header portion.
1002     * - __u32
1003       - ``dct_part_sizes[8]``
1004       - DCT coefficients sizes.
1005     * - __u64
1006       - ``last_frame_ts``
1007       - Timestamp for the V4L2 capture buffer to use as last reference frame, used
1008         with inter-coded frames. The timestamp refers to the ``timestamp`` field in
1009         struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1010         function to convert the struct :c:type:`timeval` in struct
1011         :c:type:`v4l2_buffer` to a __u64.
1012     * - __u64
1013       - ``golden_frame_ts``
1014       - Timestamp for the V4L2 capture buffer to use as last reference frame, used
1015         with inter-coded frames. The timestamp refers to the ``timestamp`` field in
1016         struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1017         function to convert the struct :c:type:`timeval` in struct
1018         :c:type:`v4l2_buffer` to a __u64.
1019     * - __u64
1020       - ``alt_frame_ts``
1021       - Timestamp for the V4L2 capture buffer to use as alternate reference frame, used
1022         with inter-coded frames. The timestamp refers to the ``timestamp`` field in
1023         struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1024         function to convert the struct :c:type:`timeval` in struct
1025         :c:type:`v4l2_buffer` to a __u64.
1026     * - __u64
1027       - ``flags``
1028       - See :ref:`Frame Flags <vp8_frame_flags>`
1029 
1030 .. raw:: latex
1031 
1032     \normalsize
1033 
1034 .. _vp8_frame_flags:
1035 
1036 ``Frame Flags``
1037 
1038 .. tabularcolumns:: |p{9.8cm}|p{0.8cm}|p{6.7cm}|
1039 
1040 .. cssclass:: longtable
1041 
1042 .. flat-table::
1043     :header-rows:  0
1044     :stub-columns: 0
1045     :widths:       1 1 2
1046 
1047     * - ``V4L2_VP8_FRAME_FLAG_KEY_FRAME``
1048       - 0x01
1049       - Indicates if the frame is a key frame.
1050     * - ``V4L2_VP8_FRAME_FLAG_EXPERIMENTAL``
1051       - 0x02
1052       - Experimental bitstream.
1053     * - ``V4L2_VP8_FRAME_FLAG_SHOW_FRAME``
1054       - 0x04
1055       - Show frame flag, indicates if the frame is for display.
1056     * - ``V4L2_VP8_FRAME_FLAG_MB_NO_SKIP_COEFF``
1057       - 0x08
1058       - Enable/disable skipping of macroblocks with no non-zero coefficients.
1059     * - ``V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN``
1060       - 0x10
1061       - Sign of motion vectors when the golden frame is referenced.
1062     * - ``V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT``
1063       - 0x20
1064       - Sign of motion vectors when the alt frame is referenced.
1065 
1066 .. c:type:: v4l2_vp8_entropy_coder_state
1067 
1068 .. cssclass:: longtable
1069 
1070 .. tabularcolumns:: |p{1.0cm}|p{2.0cm}|p{14.3cm}|
1071 
1072 .. flat-table:: struct v4l2_vp8_entropy_coder_state
1073     :header-rows:  0
1074     :stub-columns: 0
1075     :widths:       1 1 2
1076 
1077     * - __u8
1078       - ``range``
1079       - coder state value for "Range"
1080     * - __u8
1081       - ``value``
1082       - coder state value for "Value"-
1083     * - __u8
1084       - ``bit_count``
1085       - number of bits left.
1086     * - __u8
1087       - ``padding``
1088       - Applications and drivers must set this to zero.
1089 
1090 .. c:type:: v4l2_vp8_segment
1091 
1092 .. cssclass:: longtable
1093 
1094 .. tabularcolumns:: |p{1.2cm}|p{4.0cm}|p{12.1cm}|
1095 
1096 .. flat-table:: struct v4l2_vp8_segment
1097     :header-rows:  0
1098     :stub-columns: 0
1099     :widths:       1 1 2
1100 
1101     * - __s8
1102       - ``quant_update[4]``
1103       - Signed quantizer value update.
1104     * - __s8
1105       - ``lf_update[4]``
1106       - Signed loop filter level value update.
1107     * - __u8
1108       - ``segment_probs[3]``
1109       - Segment probabilities.
1110     * - __u8
1111       - ``padding``
1112       - Applications and drivers must set this to zero.
1113     * - __u32
1114       - ``flags``
1115       - See :ref:`Segment Flags <vp8_segment_flags>`
1116 
1117 .. _vp8_segment_flags:
1118 
1119 ``Segment Flags``
1120 
1121 .. raw:: latex
1122 
1123     \small
1124 
1125 .. tabularcolumns:: |p{10cm}|p{1.0cm}|p{6.3cm}|
1126 
1127 .. flat-table::
1128     :header-rows:  0
1129     :stub-columns: 0
1130     :widths:       1 1 2
1131 
1132     * - ``V4L2_VP8_SEGMENT_FLAG_ENABLED``
1133       - 0x01
1134       - Enable/disable segment-based adjustments.
1135     * - ``V4L2_VP8_SEGMENT_FLAG_UPDATE_MAP``
1136       - 0x02
1137       - Indicates if the macroblock segmentation map is updated in this frame.
1138     * - ``V4L2_VP8_SEGMENT_FLAG_UPDATE_FEATURE_DATA``
1139       - 0x04
1140       - Indicates if the segment feature data is updated in this frame.
1141     * - ``V4L2_VP8_SEGMENT_FLAG_DELTA_VALUE_MODE``
1142       - 0x08
1143       - If is set, the segment feature data mode is delta-value.
1144         If cleared, it's absolute-value.
1145 
1146 .. raw:: latex
1147 
1148     \normalsize
1149 
1150 .. c:type:: v4l2_vp8_loop_filter
1151 
1152 .. cssclass:: longtable
1153 
1154 .. tabularcolumns:: |p{1.5cm}|p{3.9cm}|p{11.9cm}|
1155 
1156 .. flat-table:: struct v4l2_vp8_loop_filter
1157     :header-rows:  0
1158     :stub-columns: 0
1159     :widths:       1 1 2
1160 
1161     * - __s8
1162       - ``ref_frm_delta[4]``
1163       - Reference adjustment (signed) delta value.
1164     * - __s8
1165       - ``mb_mode_delta[4]``
1166       - Macroblock prediction mode adjustment (signed) delta value.
1167     * - __u8
1168       - ``sharpness_level``
1169       - Sharpness level
1170     * - __u8
1171       - ``level``
1172       - Filter level
1173     * - __u16
1174       - ``padding``
1175       - Applications and drivers must set this to zero.
1176     * - __u32
1177       - ``flags``
1178       - See :ref:`Loop Filter Flags <vp8_loop_filter_flags>`
1179 
1180 .. _vp8_loop_filter_flags:
1181 
1182 ``Loop Filter Flags``
1183 
1184 .. tabularcolumns:: |p{7.0cm}|p{1.2cm}|p{9.1cm}|
1185 
1186 .. flat-table::
1187     :header-rows:  0
1188     :stub-columns: 0
1189     :widths:       1 1 2
1190 
1191     * - ``V4L2_VP8_LF_ADJ_ENABLE``
1192       - 0x01
1193       - Enable/disable macroblock-level loop filter adjustment.
1194     * - ``V4L2_VP8_LF_DELTA_UPDATE``
1195       - 0x02
1196       - Indicates if the delta values used in an adjustment are updated.
1197     * - ``V4L2_VP8_LF_FILTER_TYPE_SIMPLE``
1198       - 0x04
1199       - If set, indicates the filter type is simple.
1200         If cleared, the filter type is normal.
1201 
1202 .. c:type:: v4l2_vp8_quantization
1203 
1204 .. tabularcolumns:: |p{1.5cm}|p{3.5cm}|p{12.3cm}|
1205 
1206 .. flat-table:: struct v4l2_vp8_quantization
1207     :header-rows:  0
1208     :stub-columns: 0
1209     :widths:       1 1 2
1210 
1211     * - __u8
1212       - ``y_ac_qi``
1213       - Luma AC coefficient table index.
1214     * - __s8
1215       - ``y_dc_delta``
1216       - Luma DC delta vaue.
1217     * - __s8
1218       - ``y2_dc_delta``
1219       - Y2 block DC delta value.
1220     * - __s8
1221       - ``y2_ac_delta``
1222       - Y2 block AC delta value.
1223     * - __s8
1224       - ``uv_dc_delta``
1225       - Chroma DC delta value.
1226     * - __s8
1227       - ``uv_ac_delta``
1228       - Chroma AC delta value.
1229     * - __u16
1230       - ``padding``
1231       - Applications and drivers must set this to zero.
1232 
1233 .. c:type:: v4l2_vp8_entropy
1234 
1235 .. cssclass:: longtable
1236 
1237 .. tabularcolumns:: |p{1.5cm}|p{5.8cm}|p{10.0cm}|
1238 
1239 .. flat-table:: struct v4l2_vp8_entropy
1240     :header-rows:  0
1241     :stub-columns: 0
1242     :widths:       1 1 2
1243 
1244     * - __u8
1245       - ``coeff_probs[4][8][3][11]``
1246       - Coefficient update probabilities.
1247     * - __u8
1248       - ``y_mode_probs[4]``
1249       - Luma mode update probabilities.
1250     * - __u8
1251       - ``uv_mode_probs[3]``
1252       - Chroma mode update probabilities.
1253     * - __u8
1254       - ``mv_probs[2][19]``
1255       - MV decoding update probabilities.
1256     * - __u8
1257       - ``padding[3]``
1258       - Applications and drivers must set this to zero.
1259 
1260 .. _v4l2-codec-stateless-mpeg2:
1261 
1262 ``V4L2_CID_STATELESS_MPEG2_SEQUENCE (struct)``
1263     Specifies the sequence parameters (as extracted from the bitstream) for the
1264     associated MPEG-2 slice data. This includes fields matching the syntax
1265     elements from the sequence header and sequence extension parts of the
1266     bitstream as specified by :ref:`mpeg2part2`.
1267 
1268 .. c:type:: v4l2_ctrl_mpeg2_sequence
1269 
1270 .. raw:: latex
1271 
1272     \small
1273 
1274 .. cssclass:: longtable
1275 
1276 .. tabularcolumns:: |p{1.4cm}|p{6.5cm}|p{9.4cm}|
1277 
1278 .. flat-table:: struct v4l2_ctrl_mpeg2_sequence
1279     :header-rows:  0
1280     :stub-columns: 0
1281     :widths:       1 1 2
1282 
1283     * - __u16
1284       - ``horizontal_size``
1285       - The width of the displayable part of the frame's luminance component.
1286     * - __u16
1287       - ``vertical_size``
1288       - The height of the displayable part of the frame's luminance component.
1289     * - __u32
1290       - ``vbv_buffer_size``
1291       - Used to calculate the required size of the video buffering verifier,
1292         defined (in bits) as: 16 * 1024 * vbv_buffer_size.
1293     * - __u16
1294       - ``profile_and_level_indication``
1295       - The current profile and level indication as extracted from the
1296         bitstream.
1297     * - __u8
1298       - ``chroma_format``
1299       - The chrominance sub-sampling format (1: 4:2:0, 2: 4:2:2, 3: 4:4:4).
1300     * - __u8
1301       - ``flags``
1302       - See :ref:`MPEG-2 Sequence Flags <mpeg2_sequence_flags>`.
1303 
1304 .. _mpeg2_sequence_flags:
1305 
1306 ``MPEG-2 Sequence Flags``
1307 
1308 .. cssclass:: longtable
1309 
1310 .. flat-table::
1311     :header-rows:  0
1312     :stub-columns: 0
1313     :widths:       1 1 2
1314 
1315     * - ``V4L2_MPEG2_SEQ_FLAG_PROGRESSIVE``
1316       - 0x01
1317       - Indication that all the frames for the sequence are progressive instead
1318         of interlaced.
1319 
1320 .. raw:: latex
1321 
1322     \normalsize
1323 
1324 ``V4L2_CID_STATELESS_MPEG2_PICTURE (struct)``
1325     Specifies the picture parameters (as extracted from the bitstream) for the
1326     associated MPEG-2 slice data. This includes fields matching the syntax
1327     elements from the picture header and picture coding extension parts of the
1328     bitstream as specified by :ref:`mpeg2part2`.
1329 
1330 .. c:type:: v4l2_ctrl_mpeg2_picture
1331 
1332 .. raw:: latex
1333 
1334     \small
1335 
1336 .. cssclass:: longtable
1337 
1338 .. tabularcolumns:: |p{1.0cm}|p{5.6cm}|p{10.7cm}|
1339 
1340 .. flat-table:: struct v4l2_ctrl_mpeg2_picture
1341     :header-rows:  0
1342     :stub-columns: 0
1343     :widths:       1 1 2
1344 
1345     * - __u64
1346       - ``backward_ref_ts``
1347       - Timestamp of the V4L2 capture buffer to use as backward reference, used
1348         with B-coded and P-coded frames. The timestamp refers to the
1349         ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
1350         :c:func:`v4l2_timeval_to_ns()` function to convert the struct
1351         :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
1352     * - __u64
1353       - ``forward_ref_ts``
1354       - Timestamp for the V4L2 capture buffer to use as forward reference, used
1355         with B-coded frames. The timestamp refers to the ``timestamp`` field in
1356         struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1357         function to convert the struct :c:type:`timeval` in struct
1358         :c:type:`v4l2_buffer` to a __u64.
1359     * - __u32
1360       - ``flags``
1361       - See :ref:`MPEG-2 Picture Flags <mpeg2_picture_flags>`.
1362     * - __u8
1363       - ``f_code[2][2]``
1364       - Motion vector codes.
1365     * - __u8
1366       - ``picture_coding_type``
1367       - Picture coding type for the frame covered by the current slice
1368         (V4L2_MPEG2_PIC_CODING_TYPE_I, V4L2_MPEG2_PIC_CODING_TYPE_P or
1369         V4L2_MPEG2_PIC_CODING_TYPE_B).
1370     * - __u8
1371       - ``picture_structure``
1372       - Picture structure (1: interlaced top field, 2: interlaced bottom field,
1373         3: progressive frame).
1374     * - __u8
1375       - ``intra_dc_precision``
1376       - Precision of Discrete Cosine transform (0: 8 bits precision,
1377         1: 9 bits precision, 2: 10 bits precision, 3: 11 bits precision).
1378     * - __u8
1379       - ``reserved[5]``
1380       - Applications and drivers must set this to zero.
1381 
1382 .. _mpeg2_picture_flags:
1383 
1384 ``MPEG-2 Picture Flags``
1385 
1386 .. cssclass:: longtable
1387 
1388 .. flat-table::
1389     :header-rows:  0
1390     :stub-columns: 0
1391     :widths:       1 1 2
1392 
1393     * - ``V4L2_MPEG2_PIC_FLAG_TOP_FIELD_FIRST``
1394       - 0x00000001
1395       - If set and it's an interlaced stream, top field is output first.
1396     * - ``V4L2_MPEG2_PIC_FLAG_FRAME_PRED_DCT``
1397       - 0x00000002
1398       - If set only frame-DCT and frame prediction are used.
1399     * - ``V4L2_MPEG2_PIC_FLAG_CONCEALMENT_MV``
1400       - 0x00000004
1401       -  If set motion vectors are coded for intra macroblocks.
1402     * - ``V4L2_MPEG2_PIC_FLAG_Q_SCALE_TYPE``
1403       - 0x00000008
1404       - This flag affects the inverse quantization process.
1405     * - ``V4L2_MPEG2_PIC_FLAG_INTRA_VLC``
1406       - 0x00000010
1407       - This flag affects the decoding of transform coefficient data.
1408     * - ``V4L2_MPEG2_PIC_FLAG_ALT_SCAN``
1409       - 0x00000020
1410       - This flag affects the decoding of transform coefficient data.
1411     * - ``V4L2_MPEG2_PIC_FLAG_REPEAT_FIRST``
1412       - 0x00000040
1413       - This flag affects the decoding process of progressive frames.
1414     * - ``V4L2_MPEG2_PIC_FLAG_PROGRESSIVE``
1415       - 0x00000080
1416       - Indicates whether the current frame is progressive.
1417 
1418 .. raw:: latex
1419 
1420     \normalsize
1421 
1422 ``V4L2_CID_STATELESS_MPEG2_QUANTISATION (struct)``
1423     Specifies quantisation matrices, in zigzag scanning order, for the
1424     associated MPEG-2 slice data. This control is initialized by the kernel
1425     to the matrices default values. If a bitstream transmits a user-defined
1426     quantisation matrices load, applications are expected to use this control.
1427     Applications are also expected to set the control loading the default
1428     values, if the quantisation matrices need to be reset, for instance on a
1429     sequence header. This process is specified by section 6.3.7.
1430     "Quant matrix extension" of the specification.
1431 
1432 .. c:type:: v4l2_ctrl_mpeg2_quantisation
1433 
1434 .. tabularcolumns:: |p{0.8cm}|p{8.0cm}|p{8.5cm}|
1435 
1436 .. cssclass:: longtable
1437 
1438 .. raw:: latex
1439 
1440     \small
1441 
1442 .. flat-table:: struct v4l2_ctrl_mpeg2_quantisation
1443     :header-rows:  0
1444     :stub-columns: 0
1445     :widths:       1 1 2
1446 
1447     * - __u8
1448       - ``intra_quantiser_matrix[64]``
1449       - The quantisation matrix coefficients for intra-coded frames, in zigzag
1450         scanning order. It is relevant for both luma and chroma components,
1451         although it can be superseded by the chroma-specific matrix for
1452         non-4:2:0 YUV formats.
1453     * - __u8
1454       - ``non_intra_quantiser_matrix[64]``
1455       - The quantisation matrix coefficients for non-intra-coded frames, in
1456         zigzag scanning order. It is relevant for both luma and chroma
1457         components, although it can be superseded by the chroma-specific matrix
1458         for non-4:2:0 YUV formats.
1459     * - __u8
1460       - ``chroma_intra_quantiser_matrix[64]``
1461       - The quantisation matrix coefficients for the chominance component of
1462         intra-coded frames, in zigzag scanning order. Only relevant for
1463         non-4:2:0 YUV formats.
1464     * - __u8
1465       - ``chroma_non_intra_quantiser_matrix[64]``
1466       - The quantisation matrix coefficients for the chrominance component of
1467         non-intra-coded frames, in zigzag scanning order. Only relevant for
1468         non-4:2:0 YUV formats.
1469 
1470 .. raw:: latex
1471 
1472     \normalsize
1473 
1474 .. _v4l2-codec-stateless-vp9:
1475 
1476 ``V4L2_CID_STATELESS_VP9_COMPRESSED_HDR (struct)``
1477     Stores VP9 probabilities updates as parsed from the current compressed frame
1478     header. A value of zero in an array element means no update of the relevant
1479     probability. Motion vector-related updates contain a new value or zero. All
1480     other updates contain values translated with inv_map_table[] (see 6.3.5 in
1481     :ref:`vp9`).
1482 
1483 .. c:type:: v4l2_ctrl_vp9_compressed_hdr
1484 
1485 .. tabularcolumns:: |p{1cm}|p{4.8cm}|p{11.4cm}|
1486 
1487 .. cssclass:: longtable
1488 
1489 .. flat-table:: struct v4l2_ctrl_vp9_compressed_hdr
1490     :header-rows:  0
1491     :stub-columns: 0
1492     :widths:       1 1 2
1493 
1494     * - __u8
1495       - ``tx_mode``
1496       - Specifies the TX mode. See :ref:`TX Mode <vp9_tx_mode>` for more details.
1497     * - __u8
1498       - ``tx8[2][1]``
1499       - TX 8x8 probabilities delta.
1500     * - __u8
1501       - ``tx16[2][2]``
1502       - TX 16x16 probabilities delta.
1503     * - __u8
1504       - ``tx32[2][3]``
1505       - TX 32x32 probabilities delta.
1506     * - __u8
1507       - ``coef[4][2][2][6][6][3]``
1508       - Coefficient probabilities delta.
1509     * - __u8
1510       - ``skip[3]``
1511       - Skip probabilities delta.
1512     * - __u8
1513       - ``inter_mode[7][3]``
1514       - Inter prediction mode probabilities delta.
1515     * - __u8
1516       - ``interp_filter[4][2]``
1517       - Interpolation filter probabilities delta.
1518     * - __u8
1519       - ``is_inter[4]``
1520       - Is inter-block probabilities delta.
1521     * - __u8
1522       - ``comp_mode[5]``
1523       - Compound prediction mode probabilities delta.
1524     * - __u8
1525       - ``single_ref[5][2]``
1526       - Single reference probabilities delta.
1527     * - __u8
1528       - ``comp_ref[5]``
1529       - Compound reference probabilities delta.
1530     * - __u8
1531       - ``y_mode[4][9]``
1532       - Y prediction mode probabilities delta.
1533     * - __u8
1534       - ``uv_mode[10][9]``
1535       - UV prediction mode probabilities delta.
1536     * - __u8
1537       - ``partition[16][3]``
1538       - Partition probabilities delta.
1539     * - __u8
1540       - ``mv.joint[3]``
1541       - Motion vector joint probabilities delta.
1542     * - __u8
1543       - ``mv.sign[2]``
1544       - Motion vector sign probabilities delta.
1545     * - __u8
1546       - ``mv.classes[2][10]``
1547       - Motion vector class probabilities delta.
1548     * - __u8
1549       - ``mv.class0_bit[2]``
1550       - Motion vector class0 bit probabilities delta.
1551     * - __u8
1552       - ``mv.bits[2][10]``
1553       - Motion vector bits probabilities delta.
1554     * - __u8
1555       - ``mv.class0_fr[2][2][3]``
1556       - Motion vector class0 fractional bit probabilities delta.
1557     * - __u8
1558       - ``mv.fr[2][3]``
1559       - Motion vector fractional bit probabilities delta.
1560     * - __u8
1561       - ``mv.class0_hp[2]``
1562       - Motion vector class0 high precision fractional bit probabilities delta.
1563     * - __u8
1564       - ``mv.hp[2]``
1565       - Motion vector high precision fractional bit probabilities delta.
1566 
1567 .. _vp9_tx_mode:
1568 
1569 ``TX Mode``
1570 
1571 .. tabularcolumns:: |p{6.5cm}|p{0.5cm}|p{10.3cm}|
1572 
1573 .. flat-table::
1574     :header-rows:  0
1575     :stub-columns: 0
1576     :widths:       1 1 2
1577 
1578     * - ``V4L2_VP9_TX_MODE_ONLY_4X4``
1579       - 0
1580       - Transform size is 4x4.
1581     * - ``V4L2_VP9_TX_MODE_ALLOW_8X8``
1582       - 1
1583       - Transform size can be up to 8x8.
1584     * - ``V4L2_VP9_TX_MODE_ALLOW_16X16``
1585       - 2
1586       - Transform size can be up to 16x16.
1587     * - ``V4L2_VP9_TX_MODE_ALLOW_32X32``
1588       - 3
1589       - transform size can be up to 32x32.
1590     * - ``V4L2_VP9_TX_MODE_SELECT``
1591       - 4
1592       - Bitstream contains the transform size for each block.
1593 
1594 See section '7.3.1 Tx mode semantics' of the :ref:`vp9` specification for more details.
1595 
1596 ``V4L2_CID_STATELESS_VP9_FRAME (struct)``
1597     Specifies the frame parameters for the associated VP9 frame decode request.
1598     This includes the necessary parameters for configuring a stateless hardware
1599     decoding pipeline for VP9. The bitstream parameters are defined according
1600     to :ref:`vp9`.
1601 
1602 .. c:type:: v4l2_ctrl_vp9_frame
1603 
1604 .. raw:: latex
1605 
1606     \small
1607 
1608 .. tabularcolumns:: |p{4.7cm}|p{5.5cm}|p{7.1cm}|
1609 
1610 .. cssclass:: longtable
1611 
1612 .. flat-table:: struct v4l2_ctrl_vp9_frame
1613     :header-rows:  0
1614     :stub-columns: 0
1615     :widths:       1 1 2
1616 
1617     * - struct :c:type:`v4l2_vp9_loop_filter`
1618       - ``lf``
1619       - Loop filter parameters. See struct :c:type:`v4l2_vp9_loop_filter` for more details.
1620     * - struct :c:type:`v4l2_vp9_quantization`
1621       - ``quant``
1622       - Quantization parameters. See :c:type:`v4l2_vp9_quantization` for more details.
1623     * - struct :c:type:`v4l2_vp9_segmentation`
1624       - ``seg``
1625       - Segmentation parameters. See :c:type:`v4l2_vp9_segmentation` for more details.
1626     * - __u32
1627       - ``flags``
1628       - Combination of V4L2_VP9_FRAME_FLAG_* flags. See :ref:`Frame Flags<vp9_frame_flags>`.
1629     * - __u16
1630       - ``compressed_header_size``
1631       - Compressed header size in bytes.
1632     * - __u16
1633       - ``uncompressed_header_size``
1634       - Uncompressed header size in bytes.
1635     * - __u16
1636       - ``frame_width_minus_1``
1637       - Add 1 to get the frame width expressed in pixels. See section 7.2.3 in :ref:`vp9`.
1638     * - __u16
1639       - ``frame_height_minus_1``
1640       - Add 1 to get the frame height expressed in pixels. See section 7.2.3 in :ref:`vp9`.
1641     * - __u16
1642       - ``render_width_minus_1``
1643       - Add 1 to get the expected render width expressed in pixels. This is
1644         not used during the decoding process but might be used by HW scalers to
1645         prepare a frame that's ready for scanout. See section 7.2.4 in :ref:`vp9`.
1646     * - __u16
1647       - render_height_minus_1
1648       - Add 1 to get the expected render height expressed in pixels. This is
1649         not used during the decoding process but might be used by HW scalers to
1650         prepare a frame that's ready for scanout. See section 7.2.4 in :ref:`vp9`.
1651     * - __u64
1652       - ``last_frame_ts``
1653       - "last" reference buffer timestamp.
1654         The timestamp refers to the ``timestamp`` field in
1655         struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1656         function to convert the struct :c:type:`timeval` in struct
1657         :c:type:`v4l2_buffer` to a __u64.
1658     * - __u64
1659       - ``golden_frame_ts``
1660       - "golden" reference buffer timestamp.
1661         The timestamp refers to the ``timestamp`` field in
1662         struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1663         function to convert the struct :c:type:`timeval` in struct
1664         :c:type:`v4l2_buffer` to a __u64.
1665     * - __u64
1666       - ``alt_frame_ts``
1667       - "alt" reference buffer timestamp.
1668         The timestamp refers to the ``timestamp`` field in
1669         struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1670         function to convert the struct :c:type:`timeval` in struct
1671         :c:type:`v4l2_buffer` to a __u64.
1672     * - __u8
1673       - ``ref_frame_sign_bias``
1674       - a bitfield specifying whether the sign bias is set for a given
1675         reference frame. See :ref:`Reference Frame Sign Bias<vp9_ref_frame_sign_bias>`
1676         for more details.
1677     * - __u8
1678       - ``reset_frame_context``
1679       - specifies whether the frame context should be reset to default values. See
1680         :ref:`Reset Frame Context<vp9_reset_frame_context>` for more details.
1681     * - __u8
1682       - ``frame_context_idx``
1683       - Frame context that should be used/updated.
1684     * - __u8
1685       - ``profile``
1686       - VP9 profile. Can be 0, 1, 2 or 3.
1687     * - __u8
1688       - ``bit_depth``
1689       - Component depth in bits. Can be 8, 10 or 12. Note that not all profiles
1690         support 10 and/or 12 bits depths.
1691     * - __u8
1692       - ``interpolation_filter``
1693       - Specifies the filter selection used for performing inter prediction. See
1694         :ref:`Interpolation Filter<vp9_interpolation_filter>` for more details.
1695     * - __u8
1696       - ``tile_cols_log2``
1697       - Specifies the base 2 logarithm of the width of each tile (where the
1698         width is measured in units of 8x8 blocks). Shall be less than or equal
1699         to 6.
1700     * - __u8
1701       - ``tile_rows_log2``
1702       - Specifies the base 2 logarithm of the height of each tile (where the
1703         height is measured in units of 8x8 blocks).
1704     * - __u8
1705       - ``reference_mode``
1706       - Specifies the type of inter prediction to be used. See
1707         :ref:`Reference Mode<vp9_reference_mode>` for more details. Note that
1708         this is derived as part of the compressed header parsing process and
1709         for this reason should have been part of
1710         :c:type: `v4l2_ctrl_vp9_compressed_hdr` optional control. It is safe to
1711         set this value to zero if the driver does not require compressed
1712         headers.
1713     * - __u8
1714       - ``reserved[7]``
1715       - Applications and drivers must set this to zero.
1716 
1717 .. raw:: latex
1718 
1719     \normalsize
1720 
1721 .. _vp9_frame_flags:
1722 
1723 ``Frame Flags``
1724 
1725 .. tabularcolumns:: |p{10.0cm}|p{1.2cm}|p{6.1cm}|
1726 
1727 .. flat-table::
1728     :header-rows:  0
1729     :stub-columns: 0
1730     :widths:       1 1 2
1731 
1732     * - ``V4L2_VP9_FRAME_FLAG_KEY_FRAME``
1733       - 0x001
1734       - The frame is a key frame.
1735     * - ``V4L2_VP9_FRAME_FLAG_SHOW_FRAME``
1736       - 0x002
1737       - The frame should be displayed.
1738     * - ``V4L2_VP9_FRAME_FLAG_ERROR_RESILIENT``
1739       - 0x004
1740       - The decoding should be error resilient.
1741     * - ``V4L2_VP9_FRAME_FLAG_INTRA_ONLY``
1742       - 0x008
1743       - The frame does not reference other frames.
1744     * - ``V4L2_VP9_FRAME_FLAG_ALLOW_HIGH_PREC_MV``
1745       - 0x010
1746       - The frame can use high precision motion vectors.
1747     * - ``V4L2_VP9_FRAME_FLAG_REFRESH_FRAME_CTX``
1748       - 0x020
1749       - Frame context should be updated after decoding.
1750     * - ``V4L2_VP9_FRAME_FLAG_PARALLEL_DEC_MODE``
1751       - 0x040
1752       - Parallel decoding is used.
1753     * - ``V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING``
1754       - 0x080
1755       - Vertical subsampling is enabled.
1756     * - ``V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING``
1757       - 0x100
1758       - Horizontal subsampling is enabled.
1759     * - ``V4L2_VP9_FRAME_FLAG_COLOR_RANGE_FULL_SWING``
1760       - 0x200
1761       - The full UV range is used.
1762 
1763 .. _vp9_ref_frame_sign_bias:
1764 
1765 ``Reference Frame Sign Bias``
1766 
1767 .. tabularcolumns:: |p{7.0cm}|p{1.2cm}|p{9.1cm}|
1768 
1769 .. flat-table::
1770     :header-rows:  0
1771     :stub-columns: 0
1772     :widths:       1 1 2
1773 
1774     * - ``V4L2_VP9_SIGN_BIAS_LAST``
1775       - 0x1
1776       - Sign bias is set for the last reference frame.
1777     * - ``V4L2_VP9_SIGN_BIAS_GOLDEN``
1778       - 0x2
1779       - Sign bias is set for the golden reference frame.
1780     * - ``V4L2_VP9_SIGN_BIAS_ALT``
1781       - 0x2
1782       - Sign bias is set for the alt reference frame.
1783 
1784 .. _vp9_reset_frame_context:
1785 
1786 ``Reset Frame Context``
1787 
1788 .. tabularcolumns:: |p{7.0cm}|p{1.2cm}|p{9.1cm}|
1789 
1790 .. flat-table::
1791     :header-rows:  0
1792     :stub-columns: 0
1793     :widths:       1 1 2
1794 
1795     * - ``V4L2_VP9_RESET_FRAME_CTX_NONE``
1796       - 0
1797       - Do not reset any frame context.
1798     * - ``V4L2_VP9_RESET_FRAME_CTX_SPEC``
1799       - 1
1800       - Reset the frame context pointed to by
1801         :c:type:`v4l2_ctrl_vp9_frame`.frame_context_idx.
1802     * - ``V4L2_VP9_RESET_FRAME_CTX_ALL``
1803       - 2
1804       - Reset all frame contexts.
1805 
1806 See section '7.2 Uncompressed header semantics' of the :ref:`vp9` specification
1807 for more details.
1808 
1809 .. _vp9_interpolation_filter:
1810 
1811 ``Interpolation Filter``
1812 
1813 .. tabularcolumns:: |p{9.0cm}|p{1.2cm}|p{7.1cm}|
1814 
1815 .. flat-table::
1816     :header-rows:  0
1817     :stub-columns: 0
1818     :widths:       1 1 2
1819 
1820     * - ``V4L2_VP9_INTERP_FILTER_EIGHTTAP``
1821       - 0
1822       - Eight tap filter.
1823     * - ``V4L2_VP9_INTERP_FILTER_EIGHTTAP_SMOOTH``
1824       - 1
1825       - Eight tap smooth filter.
1826     * - ``V4L2_VP9_INTERP_FILTER_EIGHTTAP_SHARP``
1827       - 2
1828       - Eeight tap sharp filter.
1829     * - ``V4L2_VP9_INTERP_FILTER_BILINEAR``
1830       - 3
1831       - Bilinear filter.
1832     * - ``V4L2_VP9_INTERP_FILTER_SWITCHABLE``
1833       - 4
1834       - Filter selection is signaled at the block level.
1835 
1836 See section '7.2.7 Interpolation filter semantics' of the :ref:`vp9` specification
1837 for more details.
1838 
1839 .. _vp9_reference_mode:
1840 
1841 ``Reference Mode``
1842 
1843 .. tabularcolumns:: |p{9.6cm}|p{0.5cm}|p{7.2cm}|
1844 
1845 .. flat-table::
1846     :header-rows:  0
1847     :stub-columns: 0
1848     :widths:       1 1 2
1849 
1850     * - ``V4L2_VP9_REFERENCE_MODE_SINGLE_REFERENCE``
1851       - 0
1852       - Indicates that all the inter blocks use only a single reference frame
1853         to generate motion compensated prediction.
1854     * - ``V4L2_VP9_REFERENCE_MODE_COMPOUND_REFERENCE``
1855       - 1
1856       - Requires all the inter blocks to use compound mode. Single reference
1857         frame prediction is not allowed.
1858     * - ``V4L2_VP9_REFERENCE_MODE_SELECT``
1859       - 2
1860       - Allows each individual inter block to select between single and
1861         compound prediction modes.
1862 
1863 See section '7.3.6 Frame reference mode semantics' of the :ref:`vp9` specification for more details.
1864 
1865 .. c:type:: v4l2_vp9_segmentation
1866 
1867 Encodes the quantization parameters. See section '7.2.10 Segmentation
1868 params syntax' of the :ref:`vp9` specification for more details.
1869 
1870 .. tabularcolumns:: |p{0.8cm}|p{5cm}|p{11.4cm}|
1871 
1872 .. cssclass:: longtable
1873 
1874 .. flat-table:: struct v4l2_vp9_segmentation
1875     :header-rows:  0
1876     :stub-columns: 0
1877     :widths:       1 1 2
1878 
1879     * - __u8
1880       - ``feature_data[8][4]``
1881       - Data attached to each feature. Data entry is only valid if the feature
1882         is enabled. The array shall be indexed with segment number as the first dimension
1883         (0..7) and one of V4L2_VP9_SEG_* as the second dimension.
1884         See :ref:`Segment Feature IDs<vp9_segment_feature>`.
1885     * - __u8
1886       - ``feature_enabled[8]``
1887       - Bitmask defining which features are enabled in each segment. The value for each
1888         segment is a combination of V4L2_VP9_SEGMENT_FEATURE_ENABLED(id) values where id is
1889         one of V4L2_VP9_SEG_*. See :ref:`Segment Feature IDs<vp9_segment_feature>`.
1890     * - __u8
1891       - ``tree_probs[7]``
1892       - Specifies the probability values to be used when decoding a Segment-ID.
1893         See '5.15. Segmentation map' section of :ref:`vp9` for more details.
1894     * - __u8
1895       - ``pred_probs[3]``
1896       - Specifies the probability values to be used when decoding a
1897         Predicted-Segment-ID. See '6.4.14. Get segment id syntax'
1898         section of :ref:`vp9` for more details.
1899     * - __u8
1900       - ``flags``
1901       - Combination of V4L2_VP9_SEGMENTATION_FLAG_* flags. See
1902         :ref:`Segmentation Flags<vp9_segmentation_flags>`.
1903     * - __u8
1904       - ``reserved[5]``
1905       - Applications and drivers must set this to zero.
1906 
1907 .. _vp9_segment_feature:
1908 
1909 ``Segment feature IDs``
1910 
1911 .. tabularcolumns:: |p{6.0cm}|p{1cm}|p{10.3cm}|
1912 
1913 .. flat-table::
1914     :header-rows:  0
1915     :stub-columns: 0
1916     :widths:       1 1 2
1917 
1918     * - ``V4L2_VP9_SEG_LVL_ALT_Q``
1919       - 0
1920       - Quantizer segment feature.
1921     * - ``V4L2_VP9_SEG_LVL_ALT_L``
1922       - 1
1923       - Loop filter segment feature.
1924     * - ``V4L2_VP9_SEG_LVL_REF_FRAME``
1925       - 2
1926       - Reference frame segment feature.
1927     * - ``V4L2_VP9_SEG_LVL_SKIP``
1928       - 3
1929       - Skip segment feature.
1930     * - ``V4L2_VP9_SEG_LVL_MAX``
1931       - 4
1932       - Number of segment features.
1933 
1934 .. _vp9_segmentation_flags:
1935 
1936 ``Segmentation Flags``
1937 
1938 .. tabularcolumns:: |p{10.6cm}|p{0.8cm}|p{5.9cm}|
1939 
1940 .. flat-table::
1941     :header-rows:  0
1942     :stub-columns: 0
1943     :widths:       1 1 2
1944 
1945     * - ``V4L2_VP9_SEGMENTATION_FLAG_ENABLED``
1946       - 0x01
1947       - Indicates that this frame makes use of the segmentation tool.
1948     * - ``V4L2_VP9_SEGMENTATION_FLAG_UPDATE_MAP``
1949       - 0x02
1950       - Indicates that the segmentation map should be updated during the
1951         decoding of this frame.
1952     * - ``V4L2_VP9_SEGMENTATION_FLAG_TEMPORAL_UPDATE``
1953       - 0x04
1954       - Indicates that the updates to the segmentation map are coded
1955         relative to the existing segmentation map.
1956     * - ``V4L2_VP9_SEGMENTATION_FLAG_UPDATE_DATA``
1957       - 0x08
1958       - Indicates that new parameters are about to be specified for each
1959         segment.
1960     * - ``V4L2_VP9_SEGMENTATION_FLAG_ABS_OR_DELTA_UPDATE``
1961       - 0x10
1962       - Indicates that the segmentation parameters represent the actual values
1963         to be used.
1964 
1965 .. c:type:: v4l2_vp9_quantization
1966 
1967 Encodes the quantization parameters. See section '7.2.9 Quantization params
1968 syntax' of the VP9 specification for more details.
1969 
1970 .. tabularcolumns:: |p{0.8cm}|p{4cm}|p{12.4cm}|
1971 
1972 .. cssclass:: longtable
1973 
1974 .. flat-table:: struct v4l2_vp9_quantization
1975     :header-rows:  0
1976     :stub-columns: 0
1977     :widths:       1 1 2
1978 
1979     * - __u8
1980       - ``base_q_idx``
1981       - Indicates the base frame qindex.
1982     * - __s8
1983       - ``delta_q_y_dc``
1984       - Indicates the Y DC quantizer relative to base_q_idx.
1985     * - __s8
1986       - ``delta_q_uv_dc``
1987       - Indicates the UV DC quantizer relative to base_q_idx.
1988     * - __s8
1989       - ``delta_q_uv_ac``
1990       - Indicates the UV AC quantizer relative to base_q_idx.
1991     * - __u8
1992       - ``reserved[4]``
1993       - Applications and drivers must set this to zero.
1994 
1995 .. c:type:: v4l2_vp9_loop_filter
1996 
1997 This structure contains all loop filter related parameters. See sections
1998 '7.2.8 Loop filter semantics' of the :ref:`vp9` specification for more details.
1999 
2000 .. tabularcolumns:: |p{0.8cm}|p{4cm}|p{12.4cm}|
2001 
2002 .. cssclass:: longtable
2003 
2004 .. flat-table:: struct v4l2_vp9_loop_filter
2005     :header-rows:  0
2006     :stub-columns: 0
2007     :widths:       1 1 2
2008 
2009     * - __s8
2010       - ``ref_deltas[4]``
2011       - Contains the adjustment needed for the filter level based on the chosen
2012         reference frame.
2013     * - __s8
2014       - ``mode_deltas[2]``
2015       - Contains the adjustment needed for the filter level based on the chosen
2016         mode.
2017     * - __u8
2018       - ``level``
2019       - Indicates the loop filter strength.
2020     * - __u8
2021       - ``sharpness``
2022       - Indicates the sharpness level.
2023     * - __u8
2024       - ``flags``
2025       - Combination of V4L2_VP9_LOOP_FILTER_FLAG_* flags.
2026         See :ref:`Loop Filter Flags <vp9_loop_filter_flags>`.
2027     * - __u8
2028       - ``reserved[7]``
2029       - Applications and drivers must set this to zero.
2030 
2031 
2032 .. _vp9_loop_filter_flags:
2033 
2034 ``Loop Filter Flags``
2035 
2036 .. tabularcolumns:: |p{9.6cm}|p{0.5cm}|p{7.2cm}|
2037 
2038 .. flat-table::
2039     :header-rows:  0
2040     :stub-columns: 0
2041     :widths:       1 1 2
2042 
2043     * - ``V4L2_VP9_LOOP_FILTER_FLAG_DELTA_ENABLED``
2044       - 0x1
2045       - When set, the filter level depends on the mode and reference frame used
2046         to predict a block.
2047     * - ``V4L2_VP9_LOOP_FILTER_FLAG_DELTA_UPDATE``
2048       - 0x2
2049       - When set, the bitstream contains additional syntax elements that
2050         specify which mode and reference frame deltas are to be updated.
2051 
2052 .. _v4l2-codec-stateless-hevc:
2053 
2054 ``V4L2_CID_STATELESS_HEVC_SPS (struct)``
2055     Specifies the Sequence Parameter Set fields (as extracted from the
2056     bitstream) for the associated HEVC slice data.
2057     These bitstream parameters are defined according to :ref:`hevc`.
2058     They are described in section 7.4.3.2 "Sequence parameter set RBSP
2059     semantics" of the specification.
2060 
2061 .. c:type:: v4l2_ctrl_hevc_sps
2062 
2063 .. raw:: latex
2064 
2065     \small
2066 
2067 .. tabularcolumns:: |p{1.2cm}|p{9.2cm}|p{6.9cm}|
2068 
2069 .. cssclass:: longtable
2070 
2071 .. flat-table:: struct v4l2_ctrl_hevc_sps
2072     :header-rows:  0
2073     :stub-columns: 0
2074     :widths:       1 1 2
2075 
2076     * - __u8
2077       - ``video_parameter_set_id``
2078       - Specifies the value of the vps_video_parameter_set_id of the active VPS
2079         as described in section "7.4.3.2.1 General sequence parameter set RBSP semantics"
2080         of H.265 specifications.
2081     * - __u8
2082       - ``seq_parameter_set_id``
2083       - Provides an identifier for the SPS for reference by other syntax elements
2084         as described in section "7.4.3.2.1 General sequence parameter set RBSP semantics"
2085         of H.265 specifications.
2086     * - __u16
2087       - ``pic_width_in_luma_samples``
2088       - Specifies the width of each decoded picture in units of luma samples.
2089     * - __u16
2090       - ``pic_height_in_luma_samples``
2091       - Specifies the height of each decoded picture in units of luma samples.
2092     * - __u8
2093       - ``bit_depth_luma_minus8``
2094       - This value plus 8 specifies the bit depth of the samples of the luma array.
2095     * - __u8
2096       - ``bit_depth_chroma_minus8``
2097       - This value plus 8 specifies the bit depth of the samples of the chroma arrays.
2098     * - __u8
2099       - ``log2_max_pic_order_cnt_lsb_minus4``
2100       - Specifies the value of the variable MaxPicOrderCntLsb.
2101     * - __u8
2102       - ``sps_max_dec_pic_buffering_minus1``
2103       - This value plus 1 specifies the maximum required size of the decoded picture buffer for
2104         the coded video sequence (CVS).
2105     * - __u8
2106       - ``sps_max_num_reorder_pics``
2107       - Indicates the maximum allowed number of pictures.
2108     * - __u8
2109       - ``sps_max_latency_increase_plus1``
2110       - Used to signal MaxLatencyPictures, which indicates the maximum number of
2111         pictures that can precede any picture in output order and follow that
2112         picture in decoding order.
2113     * - __u8
2114       - ``log2_min_luma_coding_block_size_minus3``
2115       - This value plus 3 specifies the minimum luma coding block size.
2116     * - __u8
2117       - ``log2_diff_max_min_luma_coding_block_size``
2118       - Specifies the difference between the maximum and minimum luma coding block size.
2119     * - __u8
2120       - ``log2_min_luma_transform_block_size_minus2``
2121       - This value plus 2 specifies the minimum luma transform block size.
2122     * - __u8
2123       - ``log2_diff_max_min_luma_transform_block_size``
2124       - Specifies the difference between the maximum and minimum luma transform block size.
2125     * - __u8
2126       - ``max_transform_hierarchy_depth_inter``
2127       - Specifies the maximum hierarchy depth for transform units of coding units coded
2128         in inter prediction mode.
2129     * - __u8
2130       - ``max_transform_hierarchy_depth_intra``
2131       - Specifies the maximum hierarchy depth for transform units of coding units coded in
2132         intra prediction mode.
2133     * - __u8
2134       - ``pcm_sample_bit_depth_luma_minus1``
2135       - This value plus 1 specifies the number of bits used to represent each of PCM sample values of the
2136         luma component.
2137     * - __u8
2138       - ``pcm_sample_bit_depth_chroma_minus1``
2139       - Specifies the number of bits used to represent each of PCM sample values of
2140         the chroma components.
2141     * - __u8
2142       - ``log2_min_pcm_luma_coding_block_size_minus3``
2143       - Plus 3 specifies the minimum size of coding blocks.
2144     * - __u8
2145       - ``log2_diff_max_min_pcm_luma_coding_block_size``
2146       - Specifies the difference between the maximum and minimum size of coding blocks.
2147     * - __u8
2148       - ``num_short_term_ref_pic_sets``
2149       - Specifies the number of st_ref_pic_set() syntax structures included in the SPS.
2150     * - __u8
2151       - ``num_long_term_ref_pics_sps``
2152       - Specifies the number of candidate long-term reference pictures that are
2153         specified in the SPS.
2154     * - __u8
2155       - ``chroma_format_idc``
2156       - Specifies the chroma sampling.
2157     * - __u8
2158       - ``sps_max_sub_layers_minus1``
2159       - This value plus 1 specifies the maximum number of temporal sub-layers.
2160     * - __u64
2161       - ``flags``
2162       - See :ref:`Sequence Parameter Set Flags <hevc_sps_flags>`
2163 
2164 .. raw:: latex
2165 
2166     \normalsize
2167 
2168 .. _hevc_sps_flags:
2169 
2170 ``Sequence Parameter Set Flags``
2171 
2172 .. raw:: latex
2173 
2174     \small
2175 
2176 .. cssclass:: longtable
2177 
2178 .. flat-table::
2179     :header-rows:  0
2180     :stub-columns: 0
2181     :widths:       1 1 2
2182 
2183     * - ``V4L2_HEVC_SPS_FLAG_SEPARATE_COLOUR_PLANE``
2184       - 0x00000001
2185       -
2186     * - ``V4L2_HEVC_SPS_FLAG_SCALING_LIST_ENABLED``
2187       - 0x00000002
2188       -
2189     * - ``V4L2_HEVC_SPS_FLAG_AMP_ENABLED``
2190       - 0x00000004
2191       -
2192     * - ``V4L2_HEVC_SPS_FLAG_SAMPLE_ADAPTIVE_OFFSET``
2193       - 0x00000008
2194       -
2195     * - ``V4L2_HEVC_SPS_FLAG_PCM_ENABLED``
2196       - 0x00000010
2197       -
2198     * - ``V4L2_HEVC_SPS_FLAG_PCM_LOOP_FILTER_DISABLED``
2199       - 0x00000020
2200       -
2201     * - ``V4L2_HEVC_SPS_FLAG_LONG_TERM_REF_PICS_PRESENT``
2202       - 0x00000040
2203       -
2204     * - ``V4L2_HEVC_SPS_FLAG_SPS_TEMPORAL_MVP_ENABLED``
2205       - 0x00000080
2206       -
2207     * - ``V4L2_HEVC_SPS_FLAG_STRONG_INTRA_SMOOTHING_ENABLED``
2208       - 0x00000100
2209       -
2210 
2211 .. raw:: latex
2212 
2213     \normalsize
2214 
2215 ``V4L2_CID_STATELESS_HEVC_PPS (struct)``
2216     Specifies the Picture Parameter Set fields (as extracted from the
2217     bitstream) for the associated HEVC slice data.
2218     These bitstream parameters are defined according to :ref:`hevc`.
2219     They are described in section 7.4.3.3 "Picture parameter set RBSP
2220     semantics" of the specification.
2221 
2222 .. c:type:: v4l2_ctrl_hevc_pps
2223 
2224 .. tabularcolumns:: |p{1.2cm}|p{8.6cm}|p{7.5cm}|
2225 
2226 .. cssclass:: longtable
2227 
2228 .. flat-table:: struct v4l2_ctrl_hevc_pps
2229     :header-rows:  0
2230     :stub-columns: 0
2231     :widths:       1 1 2
2232 
2233     * - __u8
2234       - ``pic_parameter_set_id``
2235       - Identifies the PPS for reference by other syntax elements.
2236     * - __u8
2237       - ``num_extra_slice_header_bits``
2238       - Specifies the number of extra slice header bits that are present
2239         in the slice header RBSP for coded pictures referring to the PPS.
2240     * - __u8
2241       - ``num_ref_idx_l0_default_active_minus1``
2242       - This value plus 1 specifies the inferred value of num_ref_idx_l0_active_minus1.
2243     * - __u8
2244       - ``num_ref_idx_l1_default_active_minus1``
2245       - This value plus 1 specifies the inferred value of num_ref_idx_l1_active_minus1.
2246     * - __s8
2247       - ``init_qp_minus26``
2248       - This value plus 26 specifies the initial value of SliceQp Y for each slice
2249         referring to the PPS.
2250     * - __u8
2251       - ``diff_cu_qp_delta_depth``
2252       - Specifies the difference between the luma coding tree block size
2253         and the minimum luma coding block size of coding units that
2254         convey cu_qp_delta_abs and cu_qp_delta_sign_flag.
2255     * - __s8
2256       - ``pps_cb_qp_offset``
2257       - Specifies the offsets to the luma quantization parameter Cb.
2258     * - __s8
2259       - ``pps_cr_qp_offset``
2260       - Specifies the offsets to the luma quantization parameter Cr.
2261     * - __u8
2262       - ``num_tile_columns_minus1``
2263       - This value plus 1 specifies the number of tile columns partitioning the picture.
2264     * - __u8
2265       - ``num_tile_rows_minus1``
2266       - This value plus 1 specifies the number of tile rows partitioning the picture.
2267     * - __u8
2268       - ``column_width_minus1[20]``
2269       - This value plus 1 specifies the width of the i-th tile column in units of
2270         coding tree blocks.
2271     * - __u8
2272       - ``row_height_minus1[22]``
2273       - This value plus 1 specifies the height of the i-th tile row in units of coding
2274         tree blocks.
2275     * - __s8
2276       - ``pps_beta_offset_div2``
2277       - Specifies the default deblocking parameter offsets for beta divided by 2.
2278     * - __s8
2279       - ``pps_tc_offset_div2``
2280       - Specifies the default deblocking parameter offsets for tC divided by 2.
2281     * - __u8
2282       - ``log2_parallel_merge_level_minus2``
2283       - This value plus 2 specifies the value of the variable Log2ParMrgLevel.
2284     * - __u8
2285       - ``padding[4]``
2286       - Applications and drivers must set this to zero.
2287     * - __u64
2288       - ``flags``
2289       - See :ref:`Picture Parameter Set Flags <hevc_pps_flags>`
2290 
2291 .. _hevc_pps_flags:
2292 
2293 ``Picture Parameter Set Flags``
2294 
2295 .. raw:: latex
2296 
2297     \small
2298 
2299 .. flat-table::
2300     :header-rows:  0
2301     :stub-columns: 0
2302     :widths:       1 1 2
2303 
2304     * - ``V4L2_HEVC_PPS_FLAG_DEPENDENT_SLICE_SEGMENT_ENABLED``
2305       - 0x00000001
2306       -
2307     * - ``V4L2_HEVC_PPS_FLAG_OUTPUT_FLAG_PRESENT``
2308       - 0x00000002
2309       -
2310     * - ``V4L2_HEVC_PPS_FLAG_SIGN_DATA_HIDING_ENABLED``
2311       - 0x00000004
2312       -
2313     * - ``V4L2_HEVC_PPS_FLAG_CABAC_INIT_PRESENT``
2314       - 0x00000008
2315       -
2316     * - ``V4L2_HEVC_PPS_FLAG_CONSTRAINED_INTRA_PRED``
2317       - 0x00000010
2318       -
2319     * - ``V4L2_HEVC_PPS_FLAG_TRANSFORM_SKIP_ENABLED``
2320       - 0x00000020
2321       -
2322     * - ``V4L2_HEVC_PPS_FLAG_CU_QP_DELTA_ENABLED``
2323       - 0x00000040
2324       -
2325     * - ``V4L2_HEVC_PPS_FLAG_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT``
2326       - 0x00000080
2327       -
2328     * - ``V4L2_HEVC_PPS_FLAG_WEIGHTED_PRED``
2329       - 0x00000100
2330       -
2331     * - ``V4L2_HEVC_PPS_FLAG_WEIGHTED_BIPRED``
2332       - 0x00000200
2333       -
2334     * - ``V4L2_HEVC_PPS_FLAG_TRANSQUANT_BYPASS_ENABLED``
2335       - 0x00000400
2336       -
2337     * - ``V4L2_HEVC_PPS_FLAG_TILES_ENABLED``
2338       - 0x00000800
2339       -
2340     * - ``V4L2_HEVC_PPS_FLAG_ENTROPY_CODING_SYNC_ENABLED``
2341       - 0x00001000
2342       -
2343     * - ``V4L2_HEVC_PPS_FLAG_LOOP_FILTER_ACROSS_TILES_ENABLED``
2344       - 0x00002000
2345       -
2346     * - ``V4L2_HEVC_PPS_FLAG_PPS_LOOP_FILTER_ACROSS_SLICES_ENABLED``
2347       - 0x00004000
2348       -
2349     * - ``V4L2_HEVC_PPS_FLAG_DEBLOCKING_FILTER_OVERRIDE_ENABLED``
2350       - 0x00008000
2351       -
2352     * - ``V4L2_HEVC_PPS_FLAG_PPS_DISABLE_DEBLOCKING_FILTER``
2353       - 0x00010000
2354       -
2355     * - ``V4L2_HEVC_PPS_FLAG_LISTS_MODIFICATION_PRESENT``
2356       - 0x00020000
2357       -
2358     * - ``V4L2_HEVC_PPS_FLAG_SLICE_SEGMENT_HEADER_EXTENSION_PRESENT``
2359       - 0x00040000
2360       -
2361     * - ``V4L2_HEVC_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT``
2362       - 0x00080000
2363       - Specifies the presence of deblocking filter control syntax elements in
2364         the PPS
2365     * - ``V4L2_HEVC_PPS_FLAG_UNIFORM_SPACING``
2366       - 0x00100000
2367       - Specifies that tile column boundaries and likewise tile row boundaries
2368         are distributed uniformly across the picture
2369 
2370 .. raw:: latex
2371 
2372     \normalsize
2373 
2374 ``V4L2_CID_STATELESS_HEVC_SLICE_PARAMS (struct)``
2375     Specifies various slice-specific parameters, especially from the NAL unit
2376     header, general slice segment header and weighted prediction parameter
2377     parts of the bitstream.
2378     These bitstream parameters are defined according to :ref:`hevc`.
2379     They are described in section 7.4.7 "General slice segment header
2380     semantics" of the specification.
2381     This control is a dynamically sized 1-dimensional array,
2382     V4L2_CTRL_FLAG_DYNAMIC_ARRAY flag must be set when using it.
2383 
2384 .. c:type:: v4l2_ctrl_hevc_slice_params
2385 
2386 .. raw:: latex
2387 
2388     \scriptsize
2389 
2390 .. tabularcolumns:: |p{5.4cm}|p{6.8cm}|p{5.1cm}|
2391 
2392 .. cssclass:: longtable
2393 
2394 .. flat-table:: struct v4l2_ctrl_hevc_slice_params
2395     :header-rows:  0
2396     :stub-columns: 0
2397     :widths:       1 1 2
2398 
2399     * - __u32
2400       - ``bit_size``
2401       - Size (in bits) of the current slice data.
2402     * - __u32
2403       - ``data_byte_offset``
2404       - Offset (in byte) to the video data in the current slice data.
2405     * - __u32
2406       - ``num_entry_point_offsets``
2407       - Specifies the number of entry point offset syntax elements in the slice header.
2408         When the driver supports it, the ``V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS``
2409         must be set.
2410     * - __u8
2411       - ``nal_unit_type``
2412       - Specifies the coding type of the slice (B, P or I).
2413     * - __u8
2414       - ``nuh_temporal_id_plus1``
2415       - Minus 1 specifies a temporal identifier for the NAL unit.
2416     * - __u8
2417       - ``slice_type``
2418       -
2419         (V4L2_HEVC_SLICE_TYPE_I, V4L2_HEVC_SLICE_TYPE_P or
2420         V4L2_HEVC_SLICE_TYPE_B).
2421     * - __u8
2422       - ``colour_plane_id``
2423       - Specifies the colour plane associated with the current slice.
2424     * - __s32
2425       - ``slice_pic_order_cnt``
2426       - Specifies the picture order count.
2427     * - __u8
2428       - ``num_ref_idx_l0_active_minus1``
2429       - This value plus 1 specifies the maximum reference index for reference picture list 0
2430         that may be used to decode the slice.
2431     * - __u8
2432       - ``num_ref_idx_l1_active_minus1``
2433       - This value plus 1 specifies the maximum reference index for reference picture list 1
2434         that may be used to decode the slice.
2435     * - __u8
2436       - ``collocated_ref_idx``
2437       - Specifies the reference index of the collocated picture used for
2438         temporal motion vector prediction.
2439     * - __u8
2440       - ``five_minus_max_num_merge_cand``
2441       - Specifies the maximum number of merging motion vector prediction
2442         candidates supported in the slice subtracted from 5.
2443     * - __s8
2444       - ``slice_qp_delta``
2445       - Specifies the initial value of QpY to be used for the coding blocks in the slice.
2446     * - __s8
2447       - ``slice_cb_qp_offset``
2448       - Specifies a difference to be added to the value of pps_cb_qp_offset.
2449     * - __s8
2450       - ``slice_cr_qp_offset``
2451       - Specifies a difference to be added to the value of pps_cr_qp_offset.
2452     * - __s8
2453       - ``slice_act_y_qp_offset``
2454       - Specifies the offset to the luma of quantization parameter qP derived in section 8.6.2
2455     * - __s8
2456       - ``slice_act_cb_qp_offset``
2457       - Specifies the offset to the cb of quantization parameter qP derived in section 8.6.2
2458     * - __s8
2459       - ``slice_act_cr_qp_offset``
2460       - Specifies the offset to the cr of quantization parameter qP derived in section 8.6.2
2461     * - __s8
2462       - ``slice_beta_offset_div2``
2463       - Specifies the deblocking parameter offsets for beta divided by 2.
2464     * - __s8
2465       - ``slice_tc_offset_div2``
2466       - Specifies the deblocking parameter offsets for tC divided by 2.
2467     * - __u8
2468       - ``pic_struct``
2469       - Indicates whether a picture should be displayed as a frame or as one or more fields.
2470     * - __u32
2471       - ``slice_segment_addr``
2472       - Specifies the address of the first coding tree block in the slice segment.
2473     * - __u8
2474       - ``ref_idx_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
2475       - The list of L0 reference elements as indices in the DPB.
2476     * - __u8
2477       - ``ref_idx_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
2478       - The list of L1 reference elements as indices in the DPB.
2479     * - __u16
2480       - ``short_term_ref_pic_set_size``
2481       - Specifies the size, in bits, of the short-term reference picture set, described as st_ref_pic_set()
2482         in the specification, included in the slice header or SPS (section 7.3.6.1).
2483     * - __u16
2484       - ``long_term_ref_pic_set_size``
2485       - Specifies the size, in bits, of the long-term reference picture set include in the slice header
2486         or SPS. It is the number of bits in the conditional block if(long_term_ref_pics_present_flag)
2487         in section 7.3.6.1 of the specification.
2488     * - __u8
2489       - ``padding``
2490       - Applications and drivers must set this to zero.
2491     * - struct :c:type:`v4l2_hevc_pred_weight_table`
2492       - ``pred_weight_table``
2493       - The prediction weight coefficients for inter-picture prediction.
2494     * - __u64
2495       - ``flags``
2496       - See :ref:`Slice Parameters Flags <hevc_slice_params_flags>`
2497 
2498 .. raw:: latex
2499 
2500     \normalsize
2501 
2502 .. _hevc_slice_params_flags:
2503 
2504 ``Slice Parameters Flags``
2505 
2506 .. raw:: latex
2507 
2508     \scriptsize
2509 
2510 .. flat-table::
2511     :header-rows:  0
2512     :stub-columns: 0
2513     :widths:       1 1 2
2514 
2515     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_SAO_LUMA``
2516       - 0x00000001
2517       -
2518     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_SAO_CHROMA``
2519       - 0x00000002
2520       -
2521     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_TEMPORAL_MVP_ENABLED``
2522       - 0x00000004
2523       -
2524     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_MVD_L1_ZERO``
2525       - 0x00000008
2526       -
2527     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_CABAC_INIT``
2528       - 0x00000010
2529       -
2530     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_COLLOCATED_FROM_L0``
2531       - 0x00000020
2532       -
2533     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_USE_INTEGER_MV``
2534       - 0x00000040
2535       -
2536     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_DEBLOCKING_FILTER_DISABLED``
2537       - 0x00000080
2538       -
2539     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_SLICE_LOOP_FILTER_ACROSS_SLICES_ENABLED``
2540       - 0x00000100
2541       -
2542     * - ``V4L2_HEVC_SLICE_PARAMS_FLAG_DEPENDENT_SLICE_SEGMENT``
2543       - 0x00000200
2544       -
2545 
2546 .. raw:: latex
2547 
2548     \normalsize
2549 
2550 ``V4L2_CID_STATELESS_HEVC_ENTRY_POINT_OFFSETS (integer)``
2551     Specifies entry point offsets in bytes.
2552     This control is a dynamically sized array. The number of entry point
2553     offsets is reported by the ``elems`` field.
2554     This bitstream parameter is defined according to :ref:`hevc`.
2555     They are described in section 7.4.7.1 "General slice segment header
2556     semantics" of the specification.
2557     When multiple slices are submitted in a request, the length of
2558     this array must be the sum of num_entry_point_offsets of all the
2559     slices in the request.
2560 
2561 ``V4L2_CID_STATELESS_HEVC_SCALING_MATRIX (struct)``
2562     Specifies the HEVC scaling matrix parameters used for the scaling process
2563     for transform coefficients.
2564     These matrix and parameters are defined according to :ref:`hevc`.
2565     They are described in section 7.4.5 "Scaling list data semantics" of
2566     the specification.
2567 
2568 .. c:type:: v4l2_ctrl_hevc_scaling_matrix
2569 
2570 .. raw:: latex
2571 
2572     \scriptsize
2573 
2574 .. tabularcolumns:: |p{5.4cm}|p{6.8cm}|p{5.1cm}|
2575 
2576 .. cssclass:: longtable
2577 
2578 .. flat-table:: struct v4l2_ctrl_hevc_scaling_matrix
2579     :header-rows:  0
2580     :stub-columns: 0
2581     :widths:       1 1 2
2582 
2583     * - __u8
2584       - ``scaling_list_4x4[6][16]``
2585       - Scaling list is used for the scaling process for transform
2586         coefficients. The values on each scaling list are expected
2587         in raster scan order.
2588     * - __u8
2589       - ``scaling_list_8x8[6][64]``
2590       - Scaling list is used for the scaling process for transform
2591         coefficients. The values on each scaling list are expected
2592         in raster scan order.
2593     * - __u8
2594       - ``scaling_list_16x16[6][64]``
2595       - Scaling list is used for the scaling process for transform
2596         coefficients. The values on each scaling list are expected
2597         in raster scan order.
2598     * - __u8
2599       - ``scaling_list_32x32[2][64]``
2600       - Scaling list is used for the scaling process for transform
2601         coefficients. The values on each scaling list are expected
2602         in raster scan order.
2603     * - __u8
2604       - ``scaling_list_dc_coef_16x16[6]``
2605       - Scaling list is used for the scaling process for transform
2606         coefficients. The values on each scaling list are expected
2607         in raster scan order.
2608     * - __u8
2609       - ``scaling_list_dc_coef_32x32[2]``
2610       - Scaling list is used for the scaling process for transform
2611         coefficients. The values on each scaling list are expected
2612         in raster scan order.
2613 
2614 .. raw:: latex
2615 
2616     \normalsize
2617 
2618 .. c:type:: v4l2_hevc_dpb_entry
2619 
2620 .. raw:: latex
2621 
2622     \small
2623 
2624 .. tabularcolumns:: |p{1.0cm}|p{4.2cm}|p{12.1cm}|
2625 
2626 .. flat-table:: struct v4l2_hevc_dpb_entry
2627     :header-rows:  0
2628     :stub-columns: 0
2629     :widths:       1 1 2
2630 
2631     * - __u64
2632       - ``timestamp``
2633       - Timestamp of the V4L2 capture buffer to use as reference, used
2634         with B-coded and P-coded frames. The timestamp refers to the
2635         ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
2636         :c:func:`v4l2_timeval_to_ns()` function to convert the struct
2637         :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
2638     * - __u8
2639       - ``flags``
2640       - Long term flag for the reference frame
2641         (V4L2_HEVC_DPB_ENTRY_LONG_TERM_REFERENCE). The flag is set as
2642         described in the ITU HEVC specification chapter "8.3.2 Decoding
2643         process for reference picture set".
2644     * - __u8
2645       - ``field_pic``
2646       - Whether the reference is a field picture or a frame.
2647         See :ref:`HEVC dpb field pic Flags <hevc_dpb_field_pic_flags>`
2648     * - __s32
2649       - ``pic_order_cnt_val``
2650       - The picture order count of the current picture.
2651     * - __u8
2652       - ``padding[2]``
2653       - Applications and drivers must set this to zero.
2654 
2655 .. raw:: latex
2656 
2657     \normalsize
2658 
2659 .. _hevc_dpb_field_pic_flags:
2660 
2661 ``HEVC dpb field pic Flags``
2662 
2663 .. raw:: latex
2664 
2665     \scriptsize
2666 
2667 .. flat-table::
2668     :header-rows:  0
2669     :stub-columns: 0
2670     :widths:       1 1 2
2671 
2672     * - ``V4L2_HEVC_SEI_PIC_STRUCT_FRAME``
2673       - 0
2674       - (progressive) Frame
2675     * - ``V4L2_HEVC_SEI_PIC_STRUCT_TOP_FIELD``
2676       - 1
2677       - Top field
2678     * - ``V4L2_HEVC_SEI_PIC_STRUCT_BOTTOM_FIELD``
2679       - 2
2680       - Bottom field
2681     * - ``V4L2_HEVC_SEI_PIC_STRUCT_TOP_BOTTOM``
2682       - 3
2683       - Top field, bottom field, in that order
2684     * - ``V4L2_HEVC_SEI_PIC_STRUCT_BOTTOM_TOP``
2685       - 4
2686       - Bottom field, top field, in that order
2687     * - ``V4L2_HEVC_SEI_PIC_STRUCT_TOP_BOTTOM_TOP``
2688       - 5
2689       - Top field, bottom field, top field repeated, in that order
2690     * - ``V4L2_HEVC_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM``
2691       - 6
2692       - Bottom field, top field, bottom field repeated, in that order
2693     * - ``V4L2_HEVC_SEI_PIC_STRUCT_FRAME_DOUBLING``
2694       - 7
2695       - Frame doubling
2696     * - ``V4L2_HEVC_SEI_PIC_STRUCT_FRAME_TRIPLING``
2697       - 8
2698       - Frame tripling
2699     * - ``V4L2_HEVC_SEI_PIC_STRUCT_TOP_PAIRED_PREVIOUS_BOTTOM``
2700       - 9
2701       - Top field paired with previous bottom field in output order
2702     * - ``V4L2_HEVC_SEI_PIC_STRUCT_BOTTOM_PAIRED_PREVIOUS_TOP``
2703       - 10
2704       - Bottom field paired with previous top field in output order
2705     * - ``V4L2_HEVC_SEI_PIC_STRUCT_TOP_PAIRED_NEXT_BOTTOM``
2706       - 11
2707       - Top field paired with next bottom field in output order
2708     * - ``V4L2_HEVC_SEI_PIC_STRUCT_BOTTOM_PAIRED_NEXT_TOP``
2709       - 12
2710       - Bottom field paired with next top field in output order
2711 
2712 .. c:type:: v4l2_hevc_pred_weight_table
2713 
2714 .. raw:: latex
2715 
2716     \footnotesize
2717 
2718 .. tabularcolumns:: |p{0.8cm}|p{10.6cm}|p{5.9cm}|
2719 
2720 .. flat-table:: struct v4l2_hevc_pred_weight_table
2721     :header-rows:  0
2722     :stub-columns: 0
2723     :widths:       1 1 2
2724 
2725     * - __s8
2726       - ``delta_luma_weight_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
2727       - The difference of the weighting factor applied to the luma
2728         prediction value for list 0.
2729     * - __s8
2730       - ``luma_offset_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
2731       - The additive offset applied to the luma prediction value for list 0.
2732     * - __s8
2733       - ``delta_chroma_weight_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]``
2734       - The difference of the weighting factor applied to the chroma
2735         prediction value for list 0.
2736     * - __s8
2737       - ``chroma_offset_l0[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]``
2738       - The difference of the additive offset applied to the chroma
2739         prediction values for list 0.
2740     * - __s8
2741       - ``delta_luma_weight_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
2742       - The difference of the weighting factor applied to the luma
2743         prediction value for list 1.
2744     * - __s8
2745       - ``luma_offset_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
2746       - The additive offset applied to the luma prediction value for list 1.
2747     * - __s8
2748       - ``delta_chroma_weight_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]``
2749       - The difference of the weighting factor applied to the chroma
2750         prediction value for list 1.
2751     * - __s8
2752       - ``chroma_offset_l1[V4L2_HEVC_DPB_ENTRIES_NUM_MAX][2]``
2753       - The difference of the additive offset applied to the chroma
2754         prediction values for list 1.
2755     * - __u8
2756       - ``luma_log2_weight_denom``
2757       - The base 2 logarithm of the denominator for all luma weighting
2758         factors.
2759     * - __s8
2760       - ``delta_chroma_log2_weight_denom``
2761       - The difference of the base 2 logarithm of the denominator for
2762         all chroma weighting factors.
2763     * - __u8
2764       - ``padding[6]``
2765       - Applications and drivers must set this to zero.
2766 
2767 .. raw:: latex
2768 
2769     \normalsize
2770 
2771 ``V4L2_CID_STATELESS_HEVC_DECODE_MODE (enum)``
2772     Specifies the decoding mode to use. Currently exposes slice-based and
2773     frame-based decoding but new modes might be added later on.
2774     This control is used as a modifier for V4L2_PIX_FMT_HEVC_SLICE
2775     pixel format. Applications that support V4L2_PIX_FMT_HEVC_SLICE
2776     are required to set this control in order to specify the decoding mode
2777     that is expected for the buffer.
2778     Drivers may expose a single or multiple decoding modes, depending
2779     on what they can support.
2780 
2781 .. c:type:: v4l2_stateless_hevc_decode_mode
2782 
2783 .. raw:: latex
2784 
2785     \small
2786 
2787 .. tabularcolumns:: |p{9.4cm}|p{0.6cm}|p{7.3cm}|
2788 
2789 .. flat-table::
2790     :header-rows:  0
2791     :stub-columns: 0
2792     :widths:       1 1 2
2793 
2794     * - ``V4L2_STATELESS_HEVC_DECODE_MODE_SLICE_BASED``
2795       - 0
2796       - Decoding is done at the slice granularity.
2797         The OUTPUT buffer must contain a single slice.
2798     * - ``V4L2_STATELESS_HEVC_DECODE_MODE_FRAME_BASED``
2799       - 1
2800       - Decoding is done at the frame granularity.
2801         The OUTPUT buffer must contain all slices needed to decode the
2802         frame.
2803 
2804 .. raw:: latex
2805 
2806     \normalsize
2807 
2808 ``V4L2_CID_STATELESS_HEVC_START_CODE (enum)``
2809     Specifies the HEVC slice start code expected for each slice.
2810     This control is used as a modifier for V4L2_PIX_FMT_HEVC_SLICE
2811     pixel format. Applications that support V4L2_PIX_FMT_HEVC_SLICE
2812     are required to set this control in order to specify the start code
2813     that is expected for the buffer.
2814     Drivers may expose a single or multiple start codes, depending
2815     on what they can support.
2816 
2817 .. c:type:: v4l2_stateless_hevc_start_code
2818 
2819 .. tabularcolumns:: |p{9.2cm}|p{0.6cm}|p{7.5cm}|
2820 
2821 .. flat-table::
2822     :header-rows:  0
2823     :stub-columns: 0
2824     :widths:       1 1 2
2825 
2826     * - ``V4L2_STATELESS_HEVC_START_CODE_NONE``
2827       - 0
2828       - Selecting this value specifies that HEVC slices are passed
2829         to the driver without any start code. The bitstream data should be
2830         according to :ref:`hevc` 7.3.1.1 General NAL unit syntax, hence
2831         contains emulation prevention bytes when required.
2832     * - ``V4L2_STATELESS_HEVC_START_CODE_ANNEX_B``
2833       - 1
2834       - Selecting this value specifies that HEVC slices are expected
2835         to be prefixed by Annex B start codes. According to :ref:`hevc`
2836         valid start codes can be 3-bytes 0x000001 or 4-bytes 0x00000001.
2837 
2838 .. raw:: latex
2839 
2840     \normalsize
2841 
2842 ``V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID (integer)``
2843     Specifies a priority identifier for the NAL unit, which will be applied to
2844     the base layer. By default this value is set to 0 for the base layer,
2845     and the next layer will have the priority ID assigned as 1, 2, 3 and so on.
2846     The video encoder can't decide the priority id to be applied to a layer,
2847     so this has to come from client.
2848     This is applicable to H264 and valid Range is from 0 to 63.
2849     Source Rec. ITU-T H.264 (06/2019); G.7.4.1.1, G.8.8.1.
2850 
2851 ``V4L2_CID_MPEG_VIDEO_LTR_COUNT (integer)``
2852     Specifies the maximum number of Long Term Reference (LTR) frames at any
2853     given time that the encoder can keep.
2854     This is applicable to the H264 and HEVC encoders.
2855 
2856 ``V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX (integer)``
2857     After setting this control the frame that will be queued next
2858     will be marked as a Long Term Reference (LTR) frame
2859     and given this LTR index which ranges from 0 to LTR_COUNT-1.
2860     This is applicable to the H264 and HEVC encoders.
2861     Source Rec. ITU-T H.264 (06/2019); Table 7.9
2862 
2863 ``V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES (bitmask)``
2864     Specifies the Long Term Reference (LTR) frame(s) to be used for
2865     encoding the next frame queued after setting this control.
2866     This provides a bitmask which consists of bits [0, LTR_COUNT-1].
2867     This is applicable to the H264 and HEVC encoders.
2868 
2869 ``V4L2_CID_STATELESS_HEVC_DECODE_PARAMS (struct)``
2870     Specifies various decode parameters, especially the references picture order
2871     count (POC) for all the lists (short, long, before, current, after) and the
2872     number of entries for each of them.
2873     These parameters are defined according to :ref:`hevc`.
2874     They are described in section 8.3 "Slice decoding process" of the
2875     specification.
2876 
2877 .. c:type:: v4l2_ctrl_hevc_decode_params
2878 
2879 .. cssclass:: longtable
2880 
2881 .. flat-table:: struct v4l2_ctrl_hevc_decode_params
2882     :header-rows:  0
2883     :stub-columns: 0
2884     :widths:       1 1 2
2885 
2886     * - __s32
2887       - ``pic_order_cnt_val``
2888       - PicOrderCntVal as described in section 8.3.1 "Decoding process
2889         for picture order count" of the specification.
2890     * - __u16
2891       - ``short_term_ref_pic_set_size``
2892       - Specifies the size, in bits, of the short-term reference picture set, of the first slice
2893         described as st_ref_pic_set() in the specification, included in the slice header
2894         or SPS (section 7.3.6.1).
2895     * - __u16
2896       - ``long_term_ref_pic_set_size``
2897       - Specifies the size, in bits, of the long-term reference picture set, of the first slice
2898         included in the slice header or SPS. It is the number of bits in the conditional block
2899         if(long_term_ref_pics_present_flag) in section 7.3.6.1 of the specification.
2900     * - __u8
2901       - ``num_active_dpb_entries``
2902       - The number of entries in ``dpb``.
2903     * - __u8
2904       - ``num_poc_st_curr_before``
2905       - The number of reference pictures in the short-term set that come before
2906         the current frame.
2907     * - __u8
2908       - ``num_poc_st_curr_after``
2909       - The number of reference pictures in the short-term set that come after
2910         the current frame.
2911     * - __u8
2912       - ``num_poc_lt_curr``
2913       - The number of reference pictures in the long-term set.
2914     * - __u8
2915       - ``poc_st_curr_before[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
2916       - PocStCurrBefore as described in section 8.3.2 "Decoding process for reference
2917         picture set": provides the index of the short term before references in DPB array.
2918     * - __u8
2919       - ``poc_st_curr_after[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
2920       - PocStCurrAfter as described in section 8.3.2 "Decoding process for reference
2921         picture set": provides the index of the short term after references in DPB array.
2922     * - __u8
2923       - ``poc_lt_curr[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
2924       - PocLtCurr as described in section 8.3.2 "Decoding process for reference
2925         picture set": provides the index of the long term references in DPB array.
2926     * - struct :c:type:`v4l2_hevc_dpb_entry`
2927       - ``dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]``
2928       - The decoded picture buffer, for meta-data about reference frames.
2929     * - __u64
2930       - ``flags``
2931       - See :ref:`Decode Parameters Flags <hevc_decode_params_flags>`
2932 
2933 .. _hevc_decode_params_flags:
2934 
2935 ``Decode Parameters Flags``
2936 
2937 .. cssclass:: longtable
2938 
2939 .. flat-table::
2940     :header-rows:  0
2941     :stub-columns: 0
2942     :widths:       1 1 2
2943 
2944     * - ``V4L2_HEVC_DECODE_PARAM_FLAG_IRAP_PIC``
2945       - 0x00000001
2946       -
2947     * - ``V4L2_HEVC_DECODE_PARAM_FLAG_IDR_PIC``
2948       - 0x00000002
2949       -
2950     * - ``V4L2_HEVC_DECODE_PARAM_FLAG_NO_OUTPUT_OF_PRIOR``
2951       - 0x00000004
2952       -