1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2
3.. _codec-stateless-controls:
4
5*********************************
6Stateless Codec Control Reference
7*********************************
8
9The Stateless Codec control class is intended to support
10stateless decoder and encoders (i.e. hardware accelerators).
11
12These drivers are typically supported by the :ref:`stateless_decoder`,
13and deal with parsed pixel formats such as V4L2_PIX_FMT_H264_SLICE.
14
15Stateless Codec Control ID
16==========================
17
18.. _codec-stateless-control-id:
19
20``V4L2_CID_CODEC_STATELESS_CLASS (class)``
21    The Stateless Codec class descriptor.
22
23.. _v4l2-codec-stateless-h264:
24
25``V4L2_CID_STATELESS_H264_SPS (struct)``
26    Specifies the sequence parameter set (as extracted from the
27    bitstream) for the associated H264 slice data. This includes the
28    necessary parameters for configuring a stateless hardware decoding
29    pipeline for H264. The bitstream parameters are defined according
30    to :ref:`h264`, section 7.4.2.1.1 "Sequence Parameter Set Data
31    Semantics". For further documentation, refer to the above
32    specification, unless there is an explicit comment stating
33    otherwise.
34
35.. c:type:: v4l2_ctrl_h264_sps
36
37.. raw:: latex
38
39    \small
40
41.. tabularcolumns:: |p{1.2cm}|p{8.6cm}|p{7.5cm}|
42
43.. flat-table:: struct v4l2_ctrl_h264_sps
44    :header-rows:  0
45    :stub-columns: 0
46    :widths:       1 1 2
47
48    * - __u8
49      - ``profile_idc``
50      -
51    * - __u8
52      - ``constraint_set_flags``
53      - See :ref:`Sequence Parameter Set Constraints Set Flags <h264_sps_constraints_set_flags>`
54    * - __u8
55      - ``level_idc``
56      -
57    * - __u8
58      - ``seq_parameter_set_id``
59      -
60    * - __u8
61      - ``chroma_format_idc``
62      -
63    * - __u8
64      - ``bit_depth_luma_minus8``
65      -
66    * - __u8
67      - ``bit_depth_chroma_minus8``
68      -
69    * - __u8
70      - ``log2_max_frame_num_minus4``
71      -
72    * - __u8
73      - ``pic_order_cnt_type``
74      -
75    * - __u8
76      - ``log2_max_pic_order_cnt_lsb_minus4``
77      -
78    * - __u8
79      - ``max_num_ref_frames``
80      -
81    * - __u8
82      - ``num_ref_frames_in_pic_order_cnt_cycle``
83      -
84    * - __s32
85      - ``offset_for_ref_frame[255]``
86      -
87    * - __s32
88      - ``offset_for_non_ref_pic``
89      -
90    * - __s32
91      - ``offset_for_top_to_bottom_field``
92      -
93    * - __u16
94      - ``pic_width_in_mbs_minus1``
95      -
96    * - __u16
97      - ``pic_height_in_map_units_minus1``
98      -
99    * - __u32
100      - ``flags``
101      - See :ref:`Sequence Parameter Set Flags <h264_sps_flags>`
102
103.. raw:: latex
104
105    \normalsize
106
107.. _h264_sps_constraints_set_flags:
108
109``Sequence Parameter Set Constraints Set Flags``
110
111.. cssclass:: longtable
112
113.. flat-table::
114    :header-rows:  0
115    :stub-columns: 0
116    :widths:       1 1 2
117
118    * - ``V4L2_H264_SPS_CONSTRAINT_SET0_FLAG``
119      - 0x00000001
120      -
121    * - ``V4L2_H264_SPS_CONSTRAINT_SET1_FLAG``
122      - 0x00000002
123      -
124    * - ``V4L2_H264_SPS_CONSTRAINT_SET2_FLAG``
125      - 0x00000004
126      -
127    * - ``V4L2_H264_SPS_CONSTRAINT_SET3_FLAG``
128      - 0x00000008
129      -
130    * - ``V4L2_H264_SPS_CONSTRAINT_SET4_FLAG``
131      - 0x00000010
132      -
133    * - ``V4L2_H264_SPS_CONSTRAINT_SET5_FLAG``
134      - 0x00000020
135      -
136
137.. _h264_sps_flags:
138
139``Sequence Parameter Set Flags``
140
141.. cssclass:: longtable
142
143.. flat-table::
144    :header-rows:  0
145    :stub-columns: 0
146    :widths:       1 1 2
147
148    * - ``V4L2_H264_SPS_FLAG_SEPARATE_COLOUR_PLANE``
149      - 0x00000001
150      -
151    * - ``V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS``
152      - 0x00000002
153      -
154    * - ``V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO``
155      - 0x00000004
156      -
157    * - ``V4L2_H264_SPS_FLAG_GAPS_IN_FRAME_NUM_VALUE_ALLOWED``
158      - 0x00000008
159      -
160    * - ``V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY``
161      - 0x00000010
162      -
163    * - ``V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD``
164      - 0x00000020
165      -
166    * - ``V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE``
167      - 0x00000040
168      -
169
170``V4L2_CID_STATELESS_H264_PPS (struct)``
171    Specifies the picture parameter set (as extracted from the
172    bitstream) for the associated H264 slice data. This includes the
173    necessary parameters for configuring a stateless hardware decoding
174    pipeline for H264.  The bitstream parameters are defined according
175    to :ref:`h264`, section 7.4.2.2 "Picture Parameter Set RBSP
176    Semantics". For further documentation, refer to the above
177    specification, unless there is an explicit comment stating
178    otherwise.
179
180.. c:type:: v4l2_ctrl_h264_pps
181
182.. raw:: latex
183
184    \small
185
186.. flat-table:: struct v4l2_ctrl_h264_pps
187    :header-rows:  0
188    :stub-columns: 0
189    :widths:       1 1 2
190
191    * - __u8
192      - ``pic_parameter_set_id``
193      -
194    * - __u8
195      - ``seq_parameter_set_id``
196      -
197    * - __u8
198      - ``num_slice_groups_minus1``
199      -
200    * - __u8
201      - ``num_ref_idx_l0_default_active_minus1``
202      -
203    * - __u8
204      - ``num_ref_idx_l1_default_active_minus1``
205      -
206    * - __u8
207      - ``weighted_bipred_idc``
208      -
209    * - __s8
210      - ``pic_init_qp_minus26``
211      -
212    * - __s8
213      - ``pic_init_qs_minus26``
214      -
215    * - __s8
216      - ``chroma_qp_index_offset``
217      -
218    * - __s8
219      - ``second_chroma_qp_index_offset``
220      -
221    * - __u16
222      - ``flags``
223      - See :ref:`Picture Parameter Set Flags <h264_pps_flags>`
224
225.. raw:: latex
226
227    \normalsize
228
229.. _h264_pps_flags:
230
231``Picture Parameter Set Flags``
232
233.. raw:: latex
234
235    \begingroup
236    \scriptsize
237    \setlength{\tabcolsep}{2pt}
238
239.. tabularcolumns:: |p{9.8cm}|p{1.0cm}|p{6.5cm}|
240
241.. flat-table::
242    :header-rows:  0
243    :stub-columns: 0
244    :widths:       10 1 4
245
246    * - ``V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE``
247      - 0x0001
248      -
249    * - ``V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT``
250      - 0x0002
251      -
252    * - ``V4L2_H264_PPS_FLAG_WEIGHTED_PRED``
253      - 0x0004
254      -
255    * - ``V4L2_H264_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT``
256      - 0x0008
257      -
258    * - ``V4L2_H264_PPS_FLAG_CONSTRAINED_INTRA_PRED``
259      - 0x0010
260      -
261    * - ``V4L2_H264_PPS_FLAG_REDUNDANT_PIC_CNT_PRESENT``
262      - 0x0020
263      -
264    * - ``V4L2_H264_PPS_FLAG_TRANSFORM_8X8_MODE``
265      - 0x0040
266      -
267    * - ``V4L2_H264_PPS_FLAG_SCALING_MATRIX_PRESENT``
268      - 0x0080
269      - ``V4L2_CID_STATELESS_H264_SCALING_MATRIX``
270        must be used for this picture.
271
272.. raw:: latex
273
274    \endgroup
275
276``V4L2_CID_STATELESS_H264_SCALING_MATRIX (struct)``
277    Specifies the scaling matrix (as extracted from the bitstream) for
278    the associated H264 slice data. The bitstream parameters are
279    defined according to :ref:`h264`, section 7.4.2.1.1.1 "Scaling
280    List Semantics". For further documentation, refer to the above
281    specification, unless there is an explicit comment stating
282    otherwise.
283
284.. c:type:: v4l2_ctrl_h264_scaling_matrix
285
286.. raw:: latex
287
288    \small
289
290.. tabularcolumns:: |p{0.6cm}|p{4.8cm}|p{11.9cm}|
291
292.. flat-table:: struct v4l2_ctrl_h264_scaling_matrix
293    :header-rows:  0
294    :stub-columns: 0
295    :widths:       1 1 2
296
297    * - __u8
298      - ``scaling_list_4x4[6][16]``
299      - Scaling matrix after applying the inverse scanning process.
300        Expected list order is Intra Y, Intra Cb, Intra Cr, Inter Y,
301        Inter Cb, Inter Cr. The values on each scaling list are
302        expected in raster scan order.
303    * - __u8
304      - ``scaling_list_8x8[6][64]``
305      - Scaling matrix after applying the inverse scanning process.
306        Expected list order is Intra Y, Inter Y, Intra Cb, Inter Cb,
307        Intra Cr, Inter Cr. The values on each scaling list are
308        expected in raster scan order.
309
310``V4L2_CID_STATELESS_H264_SLICE_PARAMS (struct)``
311    Specifies the slice parameters (as extracted from the bitstream)
312    for the associated H264 slice data. This includes the necessary
313    parameters for configuring a stateless hardware decoding pipeline
314    for H264.  The bitstream parameters are defined according to
315    :ref:`h264`, section 7.4.3 "Slice Header Semantics". For further
316    documentation, refer to the above specification, unless there is
317    an explicit comment stating otherwise.
318
319.. c:type:: v4l2_ctrl_h264_slice_params
320
321.. raw:: latex
322
323    \small
324
325.. tabularcolumns:: |p{4.0cm}|p{5.9cm}|p{7.4cm}|
326
327.. flat-table:: struct v4l2_ctrl_h264_slice_params
328    :header-rows:  0
329    :stub-columns: 0
330    :widths:       1 1 2
331
332    * - __u32
333      - ``header_bit_size``
334      - Offset in bits to slice_data() from the beginning of this slice.
335    * - __u32
336      - ``first_mb_in_slice``
337      -
338    * - __u8
339      - ``slice_type``
340      -
341    * - __u8
342      - ``colour_plane_id``
343      -
344    * - __u8
345      - ``redundant_pic_cnt``
346      -
347    * - __u8
348      - ``cabac_init_idc``
349      -
350    * - __s8
351      - ``slice_qp_delta``
352      -
353    * - __s8
354      - ``slice_qs_delta``
355      -
356    * - __u8
357      - ``disable_deblocking_filter_idc``
358      -
359    * - __s8
360      - ``slice_alpha_c0_offset_div2``
361      -
362    * - __s8
363      - ``slice_beta_offset_div2``
364      -
365    * - __u8
366      - ``num_ref_idx_l0_active_minus1``
367      - If num_ref_idx_active_override_flag is not set, this field must be
368        set to the value of num_ref_idx_l0_default_active_minus1
369    * - __u8
370      - ``num_ref_idx_l1_active_minus1``
371      - If num_ref_idx_active_override_flag is not set, this field must be
372        set to the value of num_ref_idx_l1_default_active_minus1
373    * - __u8
374      - ``reserved``
375      - Applications and drivers must set this to zero.
376    * - struct :c:type:`v4l2_h264_reference`
377      - ``ref_pic_list0[32]``
378      - Reference picture list after applying the per-slice modifications
379    * - struct :c:type:`v4l2_h264_reference`
380      - ``ref_pic_list1[32]``
381      - Reference picture list after applying the per-slice modifications
382    * - __u32
383      - ``flags``
384      - See :ref:`Slice Parameter Flags <h264_slice_flags>`
385
386.. raw:: latex
387
388    \normalsize
389
390.. _h264_slice_flags:
391
392``Slice Parameter Set Flags``
393
394.. cssclass:: longtable
395
396.. flat-table::
397    :header-rows:  0
398    :stub-columns: 0
399    :widths:       1 1 2
400
401    * - ``V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED``
402      - 0x00000001
403      -
404    * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH``
405      - 0x00000002
406      -
407
408``V4L2_CID_STATELESS_H264_PRED_WEIGHTS (struct)``
409    Prediction weight table defined according to :ref:`h264`,
410    section 7.4.3.2 "Prediction Weight Table Semantics".
411    The prediction weight table must be passed by applications
412    under the conditions explained in section 7.3.3 "Slice header
413    syntax".
414
415.. c:type:: v4l2_ctrl_h264_pred_weights
416
417.. raw:: latex
418
419    \small
420
421.. tabularcolumns:: |p{4.9cm}|p{4.9cm}|p{7.5cm}|
422
423.. flat-table:: struct v4l2_ctrl_h264_pred_weights
424    :header-rows:  0
425    :stub-columns: 0
426    :widths:       1 1 2
427
428    * - __u16
429      - ``luma_log2_weight_denom``
430      -
431    * - __u16
432      - ``chroma_log2_weight_denom``
433      -
434    * - struct :c:type:`v4l2_h264_weight_factors`
435      - ``weight_factors[2]``
436      - The weight factors at index 0 are the weight factors for the reference
437        list 0, the one at index 1 for the reference list 1.
438
439.. raw:: latex
440
441    \normalsize
442
443.. c:type:: v4l2_h264_weight_factors
444
445.. raw:: latex
446
447    \small
448
449.. tabularcolumns:: |p{1.0cm}|p{4.5cm}|p{11.8cm}|
450
451.. flat-table:: struct v4l2_h264_weight_factors
452    :header-rows:  0
453    :stub-columns: 0
454    :widths:       1 1 2
455
456    * - __s16
457      - ``luma_weight[32]``
458      -
459    * - __s16
460      - ``luma_offset[32]``
461      -
462    * - __s16
463      - ``chroma_weight[32][2]``
464      -
465    * - __s16
466      - ``chroma_offset[32][2]``
467      -
468
469.. raw:: latex
470
471    \normalsize
472
473``Picture Reference``
474
475.. c:type:: v4l2_h264_reference
476
477.. cssclass:: longtable
478
479.. flat-table:: struct v4l2_h264_reference
480    :header-rows:  0
481    :stub-columns: 0
482    :widths:       1 1 2
483
484    * - __u8
485      - ``fields``
486      - Specifies how the picture is referenced. See :ref:`Reference Fields <h264_ref_fields>`
487    * - __u8
488      - ``index``
489      - Index into the :c:type:`v4l2_ctrl_h264_decode_params`.dpb array.
490
491.. _h264_ref_fields:
492
493``Reference Fields``
494
495.. raw:: latex
496
497    \small
498
499.. tabularcolumns:: |p{5.4cm}|p{0.8cm}|p{11.1cm}|
500
501.. flat-table::
502    :header-rows:  0
503    :stub-columns: 0
504    :widths:       1 1 2
505
506    * - ``V4L2_H264_TOP_FIELD_REF``
507      - 0x1
508      - The top field in field pair is used for short-term reference.
509    * - ``V4L2_H264_BOTTOM_FIELD_REF``
510      - 0x2
511      - The bottom field in field pair is used for short-term reference.
512    * - ``V4L2_H264_FRAME_REF``
513      - 0x3
514      - The frame (or the top/bottom fields, if it's a field pair)
515        is used for short-term reference.
516
517.. raw:: latex
518
519    \normalsize
520
521``V4L2_CID_STATELESS_H264_DECODE_PARAMS (struct)``
522    Specifies the decode parameters (as extracted from the bitstream)
523    for the associated H264 slice data. This includes the necessary
524    parameters for configuring a stateless hardware decoding pipeline
525    for H264. The bitstream parameters are defined according to
526    :ref:`h264`. For further documentation, refer to the above
527    specification, unless there is an explicit comment stating
528    otherwise.
529
530.. c:type:: v4l2_ctrl_h264_decode_params
531
532.. raw:: latex
533
534    \small
535
536.. tabularcolumns:: |p{4.0cm}|p{5.9cm}|p{7.4cm}|
537
538.. flat-table:: struct v4l2_ctrl_h264_decode_params
539    :header-rows:  0
540    :stub-columns: 0
541    :widths:       1 1 2
542
543    * - struct :c:type:`v4l2_h264_dpb_entry`
544      - ``dpb[16]``
545      -
546    * - __u16
547      - ``nal_ref_idc``
548      - NAL reference ID value coming from the NAL Unit header
549    * - __u16
550      - ``frame_num``
551      -
552    * - __s32
553      - ``top_field_order_cnt``
554      - Picture Order Count for the coded top field
555    * - __s32
556      - ``bottom_field_order_cnt``
557      - Picture Order Count for the coded bottom field
558    * - __u16
559      - ``idr_pic_id``
560      -
561    * - __u16
562      - ``pic_order_cnt_lsb``
563      -
564    * - __s32
565      - ``delta_pic_order_cnt_bottom``
566      -
567    * - __s32
568      - ``delta_pic_order_cnt0``
569      -
570    * - __s32
571      - ``delta_pic_order_cnt1``
572      -
573    * - __u32
574      - ``dec_ref_pic_marking_bit_size``
575      - Size in bits of the dec_ref_pic_marking() syntax element.
576    * - __u32
577      - ``pic_order_cnt_bit_size``
578      - Combined size in bits of the picture order count related syntax
579        elements: pic_order_cnt_lsb, delta_pic_order_cnt_bottom,
580        delta_pic_order_cnt0, and delta_pic_order_cnt1.
581    * - __u32
582      - ``slice_group_change_cycle``
583      -
584    * - __u32
585      - ``reserved``
586      - Applications and drivers must set this to zero.
587    * - __u32
588      - ``flags``
589      - See :ref:`Decode Parameters Flags <h264_decode_params_flags>`
590
591.. raw:: latex
592
593    \normalsize
594
595.. _h264_decode_params_flags:
596
597``Decode Parameters Flags``
598
599.. raw:: latex
600
601    \small
602
603.. tabularcolumns:: |p{8.3cm}|p{2.1cm}|p{6.9cm}|
604
605.. flat-table::
606    :header-rows:  0
607    :stub-columns: 0
608    :widths:       1 1 2
609
610    * - ``V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC``
611      - 0x00000001
612      - That picture is an IDR picture
613    * - ``V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC``
614      - 0x00000002
615      -
616    * - ``V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD``
617      - 0x00000004
618      -
619    * - ``V4L2_H264_DECODE_PARAM_FLAG_PFRAME``
620      - 0x00000008
621      -
622    * - ``V4L2_H264_DECODE_PARAM_FLAG_BFRAME``
623      - 0x00000010
624      -
625
626.. raw:: latex
627
628    \normalsize
629
630.. c:type:: v4l2_h264_dpb_entry
631
632.. raw:: latex
633
634    \small
635
636.. tabularcolumns:: |p{1.0cm}|p{4.9cm}|p{11.4cm}|
637
638.. flat-table:: struct v4l2_h264_dpb_entry
639    :header-rows:  0
640    :stub-columns: 0
641    :widths:       1 1 2
642
643    * - __u64
644      - ``reference_ts``
645      - Timestamp of the V4L2 capture buffer to use as reference, used
646        with B-coded and P-coded frames. The timestamp refers to the
647        ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
648        :c:func:`v4l2_timeval_to_ns()` function to convert the struct
649        :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
650    * - __u32
651      - ``pic_num``
652      -
653    * - __u16
654      - ``frame_num``
655      -
656    * - __u8
657      - ``fields``
658      - Specifies how the DPB entry is referenced. See :ref:`Reference Fields <h264_ref_fields>`
659    * - __u8
660      - ``reserved[5]``
661      - Applications and drivers must set this to zero.
662    * - __s32
663      - ``top_field_order_cnt``
664      -
665    * - __s32
666      - ``bottom_field_order_cnt``
667      -
668    * - __u32
669      - ``flags``
670      - See :ref:`DPB Entry Flags <h264_dpb_flags>`
671
672.. raw:: latex
673
674    \normalsize
675
676.. _h264_dpb_flags:
677
678``DPB Entries Flags``
679
680.. raw:: latex
681
682    \small
683
684.. tabularcolumns:: |p{7.7cm}|p{2.1cm}|p{7.5cm}|
685
686.. flat-table::
687    :header-rows:  0
688    :stub-columns: 0
689    :widths:       1 1 2
690
691    * - ``V4L2_H264_DPB_ENTRY_FLAG_VALID``
692      - 0x00000001
693      - The DPB entry is valid (non-empty) and should be considered.
694    * - ``V4L2_H264_DPB_ENTRY_FLAG_ACTIVE``
695      - 0x00000002
696      - The DPB entry is used for reference.
697    * - ``V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM``
698      - 0x00000004
699      - The DPB entry is used for long-term reference.
700    * - ``V4L2_H264_DPB_ENTRY_FLAG_FIELD``
701      - 0x00000008
702      - The DPB entry is a single field or a complementary field pair.
703
704.. raw:: latex
705
706    \normalsize
707
708``V4L2_CID_STATELESS_H264_DECODE_MODE (enum)``
709    Specifies the decoding mode to use. Currently exposes slice-based and
710    frame-based decoding but new modes might be added later on.
711    This control is used as a modifier for V4L2_PIX_FMT_H264_SLICE
712    pixel format. Applications that support V4L2_PIX_FMT_H264_SLICE
713    are required to set this control in order to specify the decoding mode
714    that is expected for the buffer.
715    Drivers may expose a single or multiple decoding modes, depending
716    on what they can support.
717
718.. c:type:: v4l2_stateless_h264_decode_mode
719
720.. raw:: latex
721
722    \scriptsize
723
724.. tabularcolumns:: |p{7.4cm}|p{0.3cm}|p{9.6cm}|
725
726.. flat-table::
727    :header-rows:  0
728    :stub-columns: 0
729    :widths:       1 1 2
730
731    * - ``V4L2_STATELESS_H264_DECODE_MODE_SLICE_BASED``
732      - 0
733      - Decoding is done at the slice granularity.
734        The OUTPUT buffer must contain a single slice.
735        When this mode is selected, the ``V4L2_CID_STATELESS_H264_SLICE_PARAMS``
736        control shall be set. When multiple slices compose a frame,
737        use of ``V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF`` flag
738        is required.
739    * - ``V4L2_STATELESS_H264_DECODE_MODE_FRAME_BASED``
740      - 1
741      - Decoding is done at the frame granularity,
742        The OUTPUT buffer must contain all slices needed to decode the
743        frame. The OUTPUT buffer must also contain both fields.
744        This mode will be supported by devices that
745        parse the slice(s) header(s) in hardware. When this mode is
746        selected, the ``V4L2_CID_STATELESS_H264_SLICE_PARAMS``
747        control shall not be set.
748
749.. raw:: latex
750
751    \normalsize
752
753``V4L2_CID_STATELESS_H264_START_CODE (enum)``
754    Specifies the H264 slice start code expected for each slice.
755    This control is used as a modifier for V4L2_PIX_FMT_H264_SLICE
756    pixel format. Applications that support V4L2_PIX_FMT_H264_SLICE
757    are required to set this control in order to specify the start code
758    that is expected for the buffer.
759    Drivers may expose a single or multiple start codes, depending
760    on what they can support.
761
762.. c:type:: v4l2_stateless_h264_start_code
763
764.. raw:: latex
765
766    \small
767
768.. tabularcolumns:: |p{7.9cm}|p{0.4cm}|p{9.0cm}|
769
770.. flat-table::
771    :header-rows:  0
772    :stub-columns: 0
773    :widths:       4 1 4
774
775    * - ``V4L2_STATELESS_H264_START_CODE_NONE``
776      - 0
777      - Selecting this value specifies that H264 slices are passed
778        to the driver without any start code. The bitstream data should be
779        according to :ref:`h264` 7.3.1 NAL unit syntax, hence contains
780        emulation prevention bytes when required.
781    * - ``V4L2_STATELESS_H264_START_CODE_ANNEX_B``
782      - 1
783      - Selecting this value specifies that H264 slices are expected
784        to be prefixed by Annex B start codes. According to :ref:`h264`
785        valid start codes can be 3-bytes 0x000001 or 4-bytes 0x00000001.
786
787.. raw:: latex
788
789    \normalsize
790
791.. _codec-stateless-fwht:
792
793``V4L2_CID_STATELESS_FWHT_PARAMS (struct)``
794    Specifies the FWHT (Fast Walsh Hadamard Transform) parameters (as extracted
795    from the bitstream) for the associated FWHT data. This includes the necessary
796    parameters for configuring a stateless hardware decoding pipeline for FWHT.
797    This codec is specific to the vicodec test driver.
798
799.. c:type:: v4l2_ctrl_fwht_params
800
801.. raw:: latex
802
803    \small
804
805.. tabularcolumns:: |p{1.4cm}|p{3.9cm}|p{12.0cm}|
806
807.. flat-table:: struct v4l2_ctrl_fwht_params
808    :header-rows:  0
809    :stub-columns: 0
810    :widths:       1 1 2
811
812    * - __u64
813      - ``backward_ref_ts``
814      - Timestamp of the V4L2 capture buffer to use as backward reference, used
815        with P-coded frames. The timestamp refers to the
816	``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
817	:c:func:`v4l2_timeval_to_ns()` function to convert the struct
818	:c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
819    * - __u32
820      - ``version``
821      - The version of the codec. Set to ``V4L2_FWHT_VERSION``.
822    * - __u32
823      - ``width``
824      - The width of the frame.
825    * - __u32
826      - ``height``
827      - The height of the frame.
828    * - __u32
829      - ``flags``
830      - The flags of the frame, see :ref:`fwht-flags`.
831    * - __u32
832      - ``colorspace``
833      - The colorspace of the frame, from enum :c:type:`v4l2_colorspace`.
834    * - __u32
835      - ``xfer_func``
836      - The transfer function, from enum :c:type:`v4l2_xfer_func`.
837    * - __u32
838      - ``ycbcr_enc``
839      - The Y'CbCr encoding, from enum :c:type:`v4l2_ycbcr_encoding`.
840    * - __u32
841      - ``quantization``
842      - The quantization range, from enum :c:type:`v4l2_quantization`.
843
844.. raw:: latex
845
846    \normalsize
847
848.. _fwht-flags:
849
850FWHT Flags
851==========
852
853.. raw:: latex
854
855    \small
856
857.. tabularcolumns:: |p{7.0cm}|p{2.3cm}|p{8.0cm}|
858
859.. flat-table::
860    :header-rows:  0
861    :stub-columns: 0
862    :widths:       3 1 4
863
864    * - ``V4L2_FWHT_FL_IS_INTERLACED``
865      - 0x00000001
866      - Set if this is an interlaced format.
867    * - ``V4L2_FWHT_FL_IS_BOTTOM_FIRST``
868      - 0x00000002
869      - Set if this is a bottom-first (NTSC) interlaced format.
870    * - ``V4L2_FWHT_FL_IS_ALTERNATE``
871      - 0x00000004
872      - Set if each 'frame' contains just one field.
873    * - ``V4L2_FWHT_FL_IS_BOTTOM_FIELD``
874      - 0x00000008
875      - If V4L2_FWHT_FL_IS_ALTERNATE was set, then this is set if this 'frame' is the
876	bottom field, else it is the top field.
877    * - ``V4L2_FWHT_FL_LUMA_IS_UNCOMPRESSED``
878      - 0x00000010
879      - Set if the Y' (luma) plane is uncompressed.
880    * - ``V4L2_FWHT_FL_CB_IS_UNCOMPRESSED``
881      - 0x00000020
882      - Set if the Cb plane is uncompressed.
883    * - ``V4L2_FWHT_FL_CR_IS_UNCOMPRESSED``
884      - 0x00000040
885      - Set if the Cr plane is uncompressed.
886    * - ``V4L2_FWHT_FL_CHROMA_FULL_HEIGHT``
887      - 0x00000080
888      - Set if the chroma plane has the same height as the luma plane,
889	else the chroma plane is half the height of the luma plane.
890    * - ``V4L2_FWHT_FL_CHROMA_FULL_WIDTH``
891      - 0x00000100
892      - Set if the chroma plane has the same width as the luma plane,
893	else the chroma plane is half the width of the luma plane.
894    * - ``V4L2_FWHT_FL_ALPHA_IS_UNCOMPRESSED``
895      - 0x00000200
896      - Set if the alpha plane is uncompressed.
897    * - ``V4L2_FWHT_FL_I_FRAME``
898      - 0x00000400
899      - Set if this is an I-frame.
900    * - ``V4L2_FWHT_FL_COMPONENTS_NUM_MSK``
901      - 0x00070000
902      - The number of color components minus one.
903    * - ``V4L2_FWHT_FL_PIXENC_MSK``
904      - 0x00180000
905      - The mask for the pixel encoding.
906    * - ``V4L2_FWHT_FL_PIXENC_YUV``
907      - 0x00080000
908      - Set if the pixel encoding is YUV.
909    * - ``V4L2_FWHT_FL_PIXENC_RGB``
910      - 0x00100000
911      - Set if the pixel encoding is RGB.
912    * - ``V4L2_FWHT_FL_PIXENC_HSV``
913      - 0x00180000
914      - Set if the pixel encoding is HSV.
915
916.. raw:: latex
917
918    \normalsize
919
920.. _v4l2-codec-stateless-vp8:
921
922``V4L2_CID_STATELESS_VP8_FRAME (struct)``
923    Specifies the frame parameters for the associated VP8 parsed frame data.
924    This includes the necessary parameters for
925    configuring a stateless hardware decoding pipeline for VP8.
926    The bitstream parameters are defined according to :ref:`vp8`.
927
928.. c:type:: v4l2_ctrl_vp8_frame
929
930.. raw:: latex
931
932    \small
933
934.. tabularcolumns:: |p{7.0cm}|p{4.6cm}|p{5.7cm}|
935
936.. cssclass:: longtable
937
938.. flat-table:: struct v4l2_ctrl_vp8_frame
939    :header-rows:  0
940    :stub-columns: 0
941    :widths:       1 1 2
942
943    * - struct :c:type:`v4l2_vp8_segment`
944      - ``segment``
945      - Structure with segment-based adjustments metadata.
946    * - struct :c:type:`v4l2_vp8_loop_filter`
947      - ``lf``
948      - Structure with loop filter level adjustments metadata.
949    * - struct :c:type:`v4l2_vp8_quantization`
950      - ``quant``
951      - Structure with VP8 dequantization indices metadata.
952    * - struct :c:type:`v4l2_vp8_entropy`
953      - ``entropy``
954      - Structure with VP8 entropy coder probabilities metadata.
955    * - struct :c:type:`v4l2_vp8_entropy_coder_state`
956      - ``coder_state``
957      - Structure with VP8 entropy coder state.
958    * - __u16
959      - ``width``
960      - The width of the frame. Must be set for all frames.
961    * - __u16
962      - ``height``
963      - The height of the frame. Must be set for all frames.
964    * - __u8
965      - ``horizontal_scale``
966      - Horizontal scaling factor.
967    * - __u8
968      - ``vertical_scaling factor``
969      - Vertical scale.
970    * - __u8
971      - ``version``
972      - Bitstream version.
973    * - __u8
974      - ``prob_skip_false``
975      - Indicates the probability that the macroblock is not skipped.
976    * - __u8
977      - ``prob_intra``
978      - Indicates the probability that a macroblock is intra-predicted.
979    * - __u8
980      - ``prob_last``
981      - Indicates the probability that the last reference frame is used
982        for inter-prediction
983    * - __u8
984      - ``prob_gf``
985      - Indicates the probability that the golden reference frame is used
986        for inter-prediction
987    * - __u8
988      - ``num_dct_parts``
989      - Number of DCT coefficients partitions. Must be one of: 1, 2, 4, or 8.
990    * - __u32
991      - ``first_part_size``
992      - Size of the first partition, i.e. the control partition.
993    * - __u32
994      - ``first_part_header_bits``
995      - Size in bits of the first partition header portion.
996    * - __u32
997      - ``dct_part_sizes[8]``
998      - DCT coefficients sizes.
999    * - __u64
1000      - ``last_frame_ts``
1001      - Timestamp for the V4L2 capture buffer to use as last reference frame, used
1002        with inter-coded frames. The timestamp refers to the ``timestamp`` field in
1003	struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1004	function to convert the struct :c:type:`timeval` in struct
1005	:c:type:`v4l2_buffer` to a __u64.
1006    * - __u64
1007      - ``golden_frame_ts``
1008      - Timestamp for the V4L2 capture buffer to use as last reference frame, used
1009        with inter-coded frames. The timestamp refers to the ``timestamp`` field in
1010	struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1011	function to convert the struct :c:type:`timeval` in struct
1012	:c:type:`v4l2_buffer` to a __u64.
1013    * - __u64
1014      - ``alt_frame_ts``
1015      - Timestamp for the V4L2 capture buffer to use as alternate reference frame, used
1016        with inter-coded frames. The timestamp refers to the ``timestamp`` field in
1017	struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1018	function to convert the struct :c:type:`timeval` in struct
1019	:c:type:`v4l2_buffer` to a __u64.
1020    * - __u64
1021      - ``flags``
1022      - See :ref:`Frame Flags <vp8_frame_flags>`
1023
1024.. raw:: latex
1025
1026    \normalsize
1027
1028.. _vp8_frame_flags:
1029
1030``Frame Flags``
1031
1032.. tabularcolumns:: |p{9.8cm}|p{0.8cm}|p{6.7cm}|
1033
1034.. cssclass:: longtable
1035
1036.. flat-table::
1037    :header-rows:  0
1038    :stub-columns: 0
1039    :widths:       1 1 2
1040
1041    * - ``V4L2_VP8_FRAME_FLAG_KEY_FRAME``
1042      - 0x01
1043      - Indicates if the frame is a key frame.
1044    * - ``V4L2_VP8_FRAME_FLAG_EXPERIMENTAL``
1045      - 0x02
1046      - Experimental bitstream.
1047    * - ``V4L2_VP8_FRAME_FLAG_SHOW_FRAME``
1048      - 0x04
1049      - Show frame flag, indicates if the frame is for display.
1050    * - ``V4L2_VP8_FRAME_FLAG_MB_NO_SKIP_COEFF``
1051      - 0x08
1052      - Enable/disable skipping of macroblocks with no non-zero coefficients.
1053    * - ``V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN``
1054      - 0x10
1055      - Sign of motion vectors when the golden frame is referenced.
1056    * - ``V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT``
1057      - 0x20
1058      - Sign of motion vectors when the alt frame is referenced.
1059
1060.. c:type:: v4l2_vp8_entropy_coder_state
1061
1062.. cssclass:: longtable
1063
1064.. tabularcolumns:: |p{1.0cm}|p{2.0cm}|p{14.3cm}|
1065
1066.. flat-table:: struct v4l2_vp8_entropy_coder_state
1067    :header-rows:  0
1068    :stub-columns: 0
1069    :widths:       1 1 2
1070
1071    * - __u8
1072      - ``range``
1073      - coder state value for "Range"
1074    * - __u8
1075      - ``value``
1076      - coder state value for "Value"-
1077    * - __u8
1078      - ``bit_count``
1079      - number of bits left.
1080    * - __u8
1081      - ``padding``
1082      - Applications and drivers must set this to zero.
1083
1084.. c:type:: v4l2_vp8_segment
1085
1086.. cssclass:: longtable
1087
1088.. tabularcolumns:: |p{1.2cm}|p{4.0cm}|p{12.1cm}|
1089
1090.. flat-table:: struct v4l2_vp8_segment
1091    :header-rows:  0
1092    :stub-columns: 0
1093    :widths:       1 1 2
1094
1095    * - __s8
1096      - ``quant_update[4]``
1097      - Signed quantizer value update.
1098    * - __s8
1099      - ``lf_update[4]``
1100      - Signed loop filter level value update.
1101    * - __u8
1102      - ``segment_probs[3]``
1103      - Segment probabilities.
1104    * - __u8
1105      - ``padding``
1106      - Applications and drivers must set this to zero.
1107    * - __u32
1108      - ``flags``
1109      - See :ref:`Segment Flags <vp8_segment_flags>`
1110
1111.. _vp8_segment_flags:
1112
1113``Segment Flags``
1114
1115.. raw:: latex
1116
1117    \small
1118
1119.. tabularcolumns:: |p{10cm}|p{1.0cm}|p{6.3cm}|
1120
1121.. flat-table::
1122    :header-rows:  0
1123    :stub-columns: 0
1124    :widths:       1 1 2
1125
1126    * - ``V4L2_VP8_SEGMENT_FLAG_ENABLED``
1127      - 0x01
1128      - Enable/disable segment-based adjustments.
1129    * - ``V4L2_VP8_SEGMENT_FLAG_UPDATE_MAP``
1130      - 0x02
1131      - Indicates if the macroblock segmentation map is updated in this frame.
1132    * - ``V4L2_VP8_SEGMENT_FLAG_UPDATE_FEATURE_DATA``
1133      - 0x04
1134      - Indicates if the segment feature data is updated in this frame.
1135    * - ``V4L2_VP8_SEGMENT_FLAG_DELTA_VALUE_MODE``
1136      - 0x08
1137      - If is set, the segment feature data mode is delta-value.
1138        If cleared, it's absolute-value.
1139
1140.. raw:: latex
1141
1142    \normalsize
1143
1144.. c:type:: v4l2_vp8_loop_filter
1145
1146.. cssclass:: longtable
1147
1148.. tabularcolumns:: |p{1.5cm}|p{3.9cm}|p{11.9cm}|
1149
1150.. flat-table:: struct v4l2_vp8_loop_filter
1151    :header-rows:  0
1152    :stub-columns: 0
1153    :widths:       1 1 2
1154
1155    * - __s8
1156      - ``ref_frm_delta[4]``
1157      - Reference adjustment (signed) delta value.
1158    * - __s8
1159      - ``mb_mode_delta[4]``
1160      - Macroblock prediction mode adjustment (signed) delta value.
1161    * - __u8
1162      - ``sharpness_level``
1163      - Sharpness level
1164    * - __u8
1165      - ``level``
1166      - Filter level
1167    * - __u16
1168      - ``padding``
1169      - Applications and drivers must set this to zero.
1170    * - __u32
1171      - ``flags``
1172      - See :ref:`Loop Filter Flags <vp8_loop_filter_flags>`
1173
1174.. _vp8_loop_filter_flags:
1175
1176``Loop Filter Flags``
1177
1178.. tabularcolumns:: |p{7.0cm}|p{1.2cm}|p{9.1cm}|
1179
1180.. flat-table::
1181    :header-rows:  0
1182    :stub-columns: 0
1183    :widths:       1 1 2
1184
1185    * - ``V4L2_VP8_LF_ADJ_ENABLE``
1186      - 0x01
1187      - Enable/disable macroblock-level loop filter adjustment.
1188    * - ``V4L2_VP8_LF_DELTA_UPDATE``
1189      - 0x02
1190      - Indicates if the delta values used in an adjustment are updated.
1191    * - ``V4L2_VP8_LF_FILTER_TYPE_SIMPLE``
1192      - 0x04
1193      - If set, indicates the filter type is simple.
1194        If cleared, the filter type is normal.
1195
1196.. c:type:: v4l2_vp8_quantization
1197
1198.. tabularcolumns:: |p{1.5cm}|p{3.5cm}|p{12.3cm}|
1199
1200.. flat-table:: struct v4l2_vp8_quantization
1201    :header-rows:  0
1202    :stub-columns: 0
1203    :widths:       1 1 2
1204
1205    * - __u8
1206      - ``y_ac_qi``
1207      - Luma AC coefficient table index.
1208    * - __s8
1209      - ``y_dc_delta``
1210      - Luma DC delta vaue.
1211    * - __s8
1212      - ``y2_dc_delta``
1213      - Y2 block DC delta value.
1214    * - __s8
1215      - ``y2_ac_delta``
1216      - Y2 block AC delta value.
1217    * - __s8
1218      - ``uv_dc_delta``
1219      - Chroma DC delta value.
1220    * - __s8
1221      - ``uv_ac_delta``
1222      - Chroma AC delta value.
1223    * - __u16
1224      - ``padding``
1225      - Applications and drivers must set this to zero.
1226
1227.. c:type:: v4l2_vp8_entropy
1228
1229.. cssclass:: longtable
1230
1231.. tabularcolumns:: |p{1.5cm}|p{5.8cm}|p{10.0cm}|
1232
1233.. flat-table:: struct v4l2_vp8_entropy
1234    :header-rows:  0
1235    :stub-columns: 0
1236    :widths:       1 1 2
1237
1238    * - __u8
1239      - ``coeff_probs[4][8][3][11]``
1240      - Coefficient update probabilities.
1241    * - __u8
1242      - ``y_mode_probs[4]``
1243      - Luma mode update probabilities.
1244    * - __u8
1245      - ``uv_mode_probs[3]``
1246      - Chroma mode update probabilities.
1247    * - __u8
1248      - ``mv_probs[2][19]``
1249      - MV decoding update probabilities.
1250    * - __u8
1251      - ``padding[3]``
1252      - Applications and drivers must set this to zero.
1253
1254.. _v4l2-codec-stateless-mpeg2:
1255
1256``V4L2_CID_STATELESS_MPEG2_SEQUENCE (struct)``
1257    Specifies the sequence parameters (as extracted from the bitstream) for the
1258    associated MPEG-2 slice data. This includes fields matching the syntax
1259    elements from the sequence header and sequence extension parts of the
1260    bitstream as specified by :ref:`mpeg2part2`.
1261
1262.. c:type:: v4l2_ctrl_mpeg2_sequence
1263
1264.. raw:: latex
1265
1266    \small
1267
1268.. cssclass:: longtable
1269
1270.. tabularcolumns:: |p{1.4cm}|p{6.5cm}|p{9.4cm}|
1271
1272.. flat-table:: struct v4l2_ctrl_mpeg2_sequence
1273    :header-rows:  0
1274    :stub-columns: 0
1275    :widths:       1 1 2
1276
1277    * - __u16
1278      - ``horizontal_size``
1279      - The width of the displayable part of the frame's luminance component.
1280    * - __u16
1281      - ``vertical_size``
1282      - The height of the displayable part of the frame's luminance component.
1283    * - __u32
1284      - ``vbv_buffer_size``
1285      - Used to calculate the required size of the video buffering verifier,
1286	defined (in bits) as: 16 * 1024 * vbv_buffer_size.
1287    * - __u16
1288      - ``profile_and_level_indication``
1289      - The current profile and level indication as extracted from the
1290	bitstream.
1291    * - __u8
1292      - ``chroma_format``
1293      - The chrominance sub-sampling format (1: 4:2:0, 2: 4:2:2, 3: 4:4:4).
1294    * - __u8
1295      - ``flags``
1296      - See :ref:`MPEG-2 Sequence Flags <mpeg2_sequence_flags>`.
1297
1298.. _mpeg2_sequence_flags:
1299
1300``MPEG-2 Sequence Flags``
1301
1302.. cssclass:: longtable
1303
1304.. flat-table::
1305    :header-rows:  0
1306    :stub-columns: 0
1307    :widths:       1 1 2
1308
1309    * - ``V4L2_MPEG2_SEQ_FLAG_PROGRESSIVE``
1310      - 0x01
1311      - Indication that all the frames for the sequence are progressive instead
1312	of interlaced.
1313
1314.. raw:: latex
1315
1316    \normalsize
1317
1318``V4L2_CID_STATELESS_MPEG2_PICTURE (struct)``
1319    Specifies the picture parameters (as extracted from the bitstream) for the
1320    associated MPEG-2 slice data. This includes fields matching the syntax
1321    elements from the picture header and picture coding extension parts of the
1322    bitstream as specified by :ref:`mpeg2part2`.
1323
1324.. c:type:: v4l2_ctrl_mpeg2_picture
1325
1326.. raw:: latex
1327
1328    \small
1329
1330.. cssclass:: longtable
1331
1332.. tabularcolumns:: |p{1.0cm}|p{5.6cm}|p{10.7cm}|
1333
1334.. flat-table:: struct v4l2_ctrl_mpeg2_picture
1335    :header-rows:  0
1336    :stub-columns: 0
1337    :widths:       1 1 2
1338
1339    * - __u64
1340      - ``backward_ref_ts``
1341      - Timestamp of the V4L2 capture buffer to use as backward reference, used
1342        with B-coded and P-coded frames. The timestamp refers to the
1343	``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
1344	:c:func:`v4l2_timeval_to_ns()` function to convert the struct
1345	:c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
1346    * - __u64
1347      - ``forward_ref_ts``
1348      - Timestamp for the V4L2 capture buffer to use as forward reference, used
1349        with B-coded frames. The timestamp refers to the ``timestamp`` field in
1350	struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1351	function to convert the struct :c:type:`timeval` in struct
1352	:c:type:`v4l2_buffer` to a __u64.
1353    * - __u32
1354      - ``flags``
1355      - See :ref:`MPEG-2 Picture Flags <mpeg2_picture_flags>`.
1356    * - __u8
1357      - ``f_code[2][2]``
1358      - Motion vector codes.
1359    * - __u8
1360      - ``picture_coding_type``
1361      - Picture coding type for the frame covered by the current slice
1362	(V4L2_MPEG2_PIC_CODING_TYPE_I, V4L2_MPEG2_PIC_CODING_TYPE_P or
1363	V4L2_MPEG2_PIC_CODING_TYPE_B).
1364    * - __u8
1365      - ``picture_structure``
1366      - Picture structure (1: interlaced top field, 2: interlaced bottom field,
1367	3: progressive frame).
1368    * - __u8
1369      - ``intra_dc_precision``
1370      - Precision of Discrete Cosine transform (0: 8 bits precision,
1371	1: 9 bits precision, 2: 10 bits precision, 3: 11 bits precision).
1372    * - __u8
1373      - ``reserved[5]``
1374      - Applications and drivers must set this to zero.
1375
1376.. _mpeg2_picture_flags:
1377
1378``MPEG-2 Picture Flags``
1379
1380.. cssclass:: longtable
1381
1382.. flat-table::
1383    :header-rows:  0
1384    :stub-columns: 0
1385    :widths:       1 1 2
1386
1387    * - ``V4L2_MPEG2_PIC_FLAG_TOP_FIELD_FIRST``
1388      - 0x00000001
1389      - If set and it's an interlaced stream, top field is output first.
1390    * - ``V4L2_MPEG2_PIC_FLAG_FRAME_PRED_DCT``
1391      - 0x00000002
1392      - If set only frame-DCT and frame prediction are used.
1393    * - ``V4L2_MPEG2_PIC_FLAG_CONCEALMENT_MV``
1394      - 0x00000004
1395      -  If set motion vectors are coded for intra macroblocks.
1396    * - ``V4L2_MPEG2_PIC_FLAG_Q_SCALE_TYPE``
1397      - 0x00000008
1398      - This flag affects the inverse quantization process.
1399    * - ``V4L2_MPEG2_PIC_FLAG_INTRA_VLC``
1400      - 0x00000010
1401      - This flag affects the decoding of transform coefficient data.
1402    * - ``V4L2_MPEG2_PIC_FLAG_ALT_SCAN``
1403      - 0x00000020
1404      - This flag affects the decoding of transform coefficient data.
1405    * - ``V4L2_MPEG2_PIC_FLAG_REPEAT_FIRST``
1406      - 0x00000040
1407      - This flag affects the decoding process of progressive frames.
1408    * - ``V4L2_MPEG2_PIC_FLAG_PROGRESSIVE``
1409      - 0x00000080
1410      - Indicates whether the current frame is progressive.
1411
1412.. raw:: latex
1413
1414    \normalsize
1415
1416``V4L2_CID_STATELESS_MPEG2_QUANTISATION (struct)``
1417    Specifies quantisation matrices, in zigzag scanning order, for the
1418    associated MPEG-2 slice data. This control is initialized by the kernel
1419    to the matrices default values. If a bitstream transmits a user-defined
1420    quantisation matrices load, applications are expected to use this control.
1421    Applications are also expected to set the control loading the default
1422    values, if the quantisation matrices need to be reset, for instance on a
1423    sequence header. This process is specified by section 6.3.7.
1424    "Quant matrix extension" of the specification.
1425
1426.. c:type:: v4l2_ctrl_mpeg2_quantisation
1427
1428.. tabularcolumns:: |p{0.8cm}|p{8.0cm}|p{8.5cm}|
1429
1430.. cssclass:: longtable
1431
1432.. raw:: latex
1433
1434    \small
1435
1436.. flat-table:: struct v4l2_ctrl_mpeg2_quantisation
1437    :header-rows:  0
1438    :stub-columns: 0
1439    :widths:       1 1 2
1440
1441    * - __u8
1442      - ``intra_quantiser_matrix[64]``
1443      - The quantisation matrix coefficients for intra-coded frames, in zigzag
1444	scanning order. It is relevant for both luma and chroma components,
1445	although it can be superseded by the chroma-specific matrix for
1446	non-4:2:0 YUV formats.
1447    * - __u8
1448      - ``non_intra_quantiser_matrix[64]``
1449      - The quantisation matrix coefficients for non-intra-coded frames, in
1450	zigzag scanning order. It is relevant for both luma and chroma
1451	components, although it can be superseded by the chroma-specific matrix
1452	for non-4:2:0 YUV formats.
1453    * - __u8
1454      - ``chroma_intra_quantiser_matrix[64]``
1455      - The quantisation matrix coefficients for the chominance component of
1456	intra-coded frames, in zigzag scanning order. Only relevant for
1457	non-4:2:0 YUV formats.
1458    * - __u8
1459      - ``chroma_non_intra_quantiser_matrix[64]``
1460      - The quantisation matrix coefficients for the chrominance component of
1461	non-intra-coded frames, in zigzag scanning order. Only relevant for
1462	non-4:2:0 YUV formats.
1463
1464.. raw:: latex
1465
1466    \normalsize
1467
1468.. _v4l2-codec-stateless-vp9:
1469
1470``V4L2_CID_STATELESS_VP9_COMPRESSED_HDR (struct)``
1471    Stores VP9 probabilities updates as parsed from the current compressed frame
1472    header. A value of zero in an array element means no update of the relevant
1473    probability. Motion vector-related updates contain a new value or zero. All
1474    other updates contain values translated with inv_map_table[] (see 6.3.5 in
1475    :ref:`vp9`).
1476
1477.. c:type:: v4l2_ctrl_vp9_compressed_hdr
1478
1479.. tabularcolumns:: |p{1cm}|p{4.8cm}|p{11.4cm}|
1480
1481.. cssclass:: longtable
1482
1483.. flat-table:: struct v4l2_ctrl_vp9_compressed_hdr
1484    :header-rows:  0
1485    :stub-columns: 0
1486    :widths:       1 1 2
1487
1488    * - __u8
1489      - ``tx_mode``
1490      - Specifies the TX mode. See :ref:`TX Mode <vp9_tx_mode>` for more details.
1491    * - __u8
1492      - ``tx8[2][1]``
1493      - TX 8x8 probabilities delta.
1494    * - __u8
1495      - ``tx16[2][2]``
1496      - TX 16x16 probabilities delta.
1497    * - __u8
1498      - ``tx32[2][3]``
1499      - TX 32x32 probabilities delta.
1500    * - __u8
1501      - ``coef[4][2][2][6][6][3]``
1502      - Coefficient probabilities delta.
1503    * - __u8
1504      - ``skip[3]``
1505      - Skip probabilities delta.
1506    * - __u8
1507      - ``inter_mode[7][3]``
1508      - Inter prediction mode probabilities delta.
1509    * - __u8
1510      - ``interp_filter[4][2]``
1511      - Interpolation filter probabilities delta.
1512    * - __u8
1513      - ``is_inter[4]``
1514      - Is inter-block probabilities delta.
1515    * - __u8
1516      - ``comp_mode[5]``
1517      - Compound prediction mode probabilities delta.
1518    * - __u8
1519      - ``single_ref[5][2]``
1520      - Single reference probabilities delta.
1521    * - __u8
1522      - ``comp_ref[5]``
1523      - Compound reference probabilities delta.
1524    * - __u8
1525      - ``y_mode[4][9]``
1526      - Y prediction mode probabilities delta.
1527    * - __u8
1528      - ``uv_mode[10][9]``
1529      - UV prediction mode probabilities delta.
1530    * - __u8
1531      - ``partition[16][3]``
1532      - Partition probabilities delta.
1533    * - __u8
1534      - ``mv.joint[3]``
1535      - Motion vector joint probabilities delta.
1536    * - __u8
1537      - ``mv.sign[2]``
1538      - Motion vector sign probabilities delta.
1539    * - __u8
1540      - ``mv.classes[2][10]``
1541      - Motion vector class probabilities delta.
1542    * - __u8
1543      - ``mv.class0_bit[2]``
1544      - Motion vector class0 bit probabilities delta.
1545    * - __u8
1546      - ``mv.bits[2][10]``
1547      - Motion vector bits probabilities delta.
1548    * - __u8
1549      - ``mv.class0_fr[2][2][3]``
1550      - Motion vector class0 fractional bit probabilities delta.
1551    * - __u8
1552      - ``mv.fr[2][3]``
1553      - Motion vector fractional bit probabilities delta.
1554    * - __u8
1555      - ``mv.class0_hp[2]``
1556      - Motion vector class0 high precision fractional bit probabilities delta.
1557    * - __u8
1558      - ``mv.hp[2]``
1559      - Motion vector high precision fractional bit probabilities delta.
1560
1561.. _vp9_tx_mode:
1562
1563``TX Mode``
1564
1565.. tabularcolumns:: |p{6.5cm}|p{0.5cm}|p{10.3cm}|
1566
1567.. flat-table::
1568    :header-rows:  0
1569    :stub-columns: 0
1570    :widths:       1 1 2
1571
1572    * - ``V4L2_VP9_TX_MODE_ONLY_4X4``
1573      - 0
1574      - Transform size is 4x4.
1575    * - ``V4L2_VP9_TX_MODE_ALLOW_8X8``
1576      - 1
1577      - Transform size can be up to 8x8.
1578    * - ``V4L2_VP9_TX_MODE_ALLOW_16X16``
1579      - 2
1580      - Transform size can be up to 16x16.
1581    * - ``V4L2_VP9_TX_MODE_ALLOW_32X32``
1582      - 3
1583      - transform size can be up to 32x32.
1584    * - ``V4L2_VP9_TX_MODE_SELECT``
1585      - 4
1586      - Bitstream contains the transform size for each block.
1587
1588See section '7.3.1 Tx mode semantics' of the :ref:`vp9` specification for more details.
1589
1590``V4L2_CID_STATELESS_VP9_FRAME (struct)``
1591    Specifies the frame parameters for the associated VP9 frame decode request.
1592    This includes the necessary parameters for configuring a stateless hardware
1593    decoding pipeline for VP9. The bitstream parameters are defined according
1594    to :ref:`vp9`.
1595
1596.. c:type:: v4l2_ctrl_vp9_frame
1597
1598.. raw:: latex
1599
1600    \small
1601
1602.. tabularcolumns:: |p{4.7cm}|p{5.5cm}|p{7.1cm}|
1603
1604.. cssclass:: longtable
1605
1606.. flat-table:: struct v4l2_ctrl_vp9_frame
1607    :header-rows:  0
1608    :stub-columns: 0
1609    :widths:       1 1 2
1610
1611    * - struct :c:type:`v4l2_vp9_loop_filter`
1612      - ``lf``
1613      - Loop filter parameters. See struct :c:type:`v4l2_vp9_loop_filter` for more details.
1614    * - struct :c:type:`v4l2_vp9_quantization`
1615      - ``quant``
1616      - Quantization parameters. See :c:type:`v4l2_vp9_quantization` for more details.
1617    * - struct :c:type:`v4l2_vp9_segmentation`
1618      - ``seg``
1619      - Segmentation parameters. See :c:type:`v4l2_vp9_segmentation` for more details.
1620    * - __u32
1621      - ``flags``
1622      - Combination of V4L2_VP9_FRAME_FLAG_* flags. See :ref:`Frame Flags<vp9_frame_flags>`.
1623    * - __u16
1624      - ``compressed_header_size``
1625      - Compressed header size in bytes.
1626    * - __u16
1627      - ``uncompressed_header_size``
1628      - Uncompressed header size in bytes.
1629    * - __u16
1630      - ``frame_width_minus_1``
1631      - Add 1 to get the frame width expressed in pixels. See section 7.2.3 in :ref:`vp9`.
1632    * - __u16
1633      - ``frame_height_minus_1``
1634      - Add 1 to get the frame height expressed in pixels. See section 7.2.3 in :ref:`vp9`.
1635    * - __u16
1636      - ``render_width_minus_1``
1637      - Add 1 to get the expected render width expressed in pixels. This is
1638        not used during the decoding process but might be used by HW scalers to
1639        prepare a frame that's ready for scanout. See section 7.2.4 in :ref:`vp9`.
1640    * - __u16
1641      - render_height_minus_1
1642      - Add 1 to get the expected render height expressed in pixels. This is
1643        not used during the decoding process but might be used by HW scalers to
1644        prepare a frame that's ready for scanout. See section 7.2.4 in :ref:`vp9`.
1645    * - __u64
1646      - ``last_frame_ts``
1647      - "last" reference buffer timestamp.
1648	The timestamp refers to the ``timestamp`` field in
1649        struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1650        function to convert the struct :c:type:`timeval` in struct
1651        :c:type:`v4l2_buffer` to a __u64.
1652    * - __u64
1653      - ``golden_frame_ts``
1654      - "golden" reference buffer timestamp.
1655	The timestamp refers to the ``timestamp`` field in
1656        struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1657        function to convert the struct :c:type:`timeval` in struct
1658        :c:type:`v4l2_buffer` to a __u64.
1659    * - __u64
1660      - ``alt_frame_ts``
1661      - "alt" reference buffer timestamp.
1662	The timestamp refers to the ``timestamp`` field in
1663        struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1664        function to convert the struct :c:type:`timeval` in struct
1665        :c:type:`v4l2_buffer` to a __u64.
1666    * - __u8
1667      - ``ref_frame_sign_bias``
1668      - a bitfield specifying whether the sign bias is set for a given
1669        reference frame. See :ref:`Reference Frame Sign Bias<vp9_ref_frame_sign_bias>`
1670        for more details.
1671    * - __u8
1672      - ``reset_frame_context``
1673      - specifies whether the frame context should be reset to default values. See
1674        :ref:`Reset Frame Context<vp9_reset_frame_context>` for more details.
1675    * - __u8
1676      - ``frame_context_idx``
1677      - Frame context that should be used/updated.
1678    * - __u8
1679      - ``profile``
1680      - VP9 profile. Can be 0, 1, 2 or 3.
1681    * - __u8
1682      - ``bit_depth``
1683      - Component depth in bits. Can be 8, 10 or 12. Note that not all profiles
1684        support 10 and/or 12 bits depths.
1685    * - __u8
1686      - ``interpolation_filter``
1687      - Specifies the filter selection used for performing inter prediction. See
1688        :ref:`Interpolation Filter<vp9_interpolation_filter>` for more details.
1689    * - __u8
1690      - ``tile_cols_log2``
1691      - Specifies the base 2 logarithm of the width of each tile (where the
1692        width is measured in units of 8x8 blocks). Shall be less than or equal
1693        to 6.
1694    * - __u8
1695      - ``tile_rows_log2``
1696      - Specifies the base 2 logarithm of the height of each tile (where the
1697        height is measured in units of 8x8 blocks).
1698    * - __u8
1699      - ``reference_mode``
1700      - Specifies the type of inter prediction to be used. See
1701        :ref:`Reference Mode<vp9_reference_mode>` for more details. Note that
1702	this is derived as part of the compressed header parsing process and
1703	for this reason should have been part of
1704	:c:type: `v4l2_ctrl_vp9_compressed_hdr` optional control. It is safe to
1705	set this value to zero if the driver does not require compressed
1706	headers.
1707    * - __u8
1708      - ``reserved[7]``
1709      - Applications and drivers must set this to zero.
1710
1711.. raw:: latex
1712
1713    \normalsize
1714
1715.. _vp9_frame_flags:
1716
1717``Frame Flags``
1718
1719.. tabularcolumns:: |p{10.0cm}|p{1.2cm}|p{6.1cm}|
1720
1721.. flat-table::
1722    :header-rows:  0
1723    :stub-columns: 0
1724    :widths:       1 1 2
1725
1726    * - ``V4L2_VP9_FRAME_FLAG_KEY_FRAME``
1727      - 0x001
1728      - The frame is a key frame.
1729    * - ``V4L2_VP9_FRAME_FLAG_SHOW_FRAME``
1730      - 0x002
1731      - The frame should be displayed.
1732    * - ``V4L2_VP9_FRAME_FLAG_ERROR_RESILIENT``
1733      - 0x004
1734      - The decoding should be error resilient.
1735    * - ``V4L2_VP9_FRAME_FLAG_INTRA_ONLY``
1736      - 0x008
1737      - The frame does not reference other frames.
1738    * - ``V4L2_VP9_FRAME_FLAG_ALLOW_HIGH_PREC_MV``
1739      - 0x010
1740      - The frame can use high precision motion vectors.
1741    * - ``V4L2_VP9_FRAME_FLAG_REFRESH_FRAME_CTX``
1742      - 0x020
1743      - Frame context should be updated after decoding.
1744    * - ``V4L2_VP9_FRAME_FLAG_PARALLEL_DEC_MODE``
1745      - 0x040
1746      - Parallel decoding is used.
1747    * - ``V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING``
1748      - 0x080
1749      - Vertical subsampling is enabled.
1750    * - ``V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING``
1751      - 0x100
1752      - Horizontal subsampling is enabled.
1753    * - ``V4L2_VP9_FRAME_FLAG_COLOR_RANGE_FULL_SWING``
1754      - 0x200
1755      - The full UV range is used.
1756
1757.. _vp9_ref_frame_sign_bias:
1758
1759``Reference Frame Sign Bias``
1760
1761.. tabularcolumns:: |p{7.0cm}|p{1.2cm}|p{9.1cm}|
1762
1763.. flat-table::
1764    :header-rows:  0
1765    :stub-columns: 0
1766    :widths:       1 1 2
1767
1768    * - ``V4L2_VP9_SIGN_BIAS_LAST``
1769      - 0x1
1770      - Sign bias is set for the last reference frame.
1771    * - ``V4L2_VP9_SIGN_BIAS_GOLDEN``
1772      - 0x2
1773      - Sign bias is set for the golden reference frame.
1774    * - ``V4L2_VP9_SIGN_BIAS_ALT``
1775      - 0x2
1776      - Sign bias is set for the alt reference frame.
1777
1778.. _vp9_reset_frame_context:
1779
1780``Reset Frame Context``
1781
1782.. tabularcolumns:: |p{7.0cm}|p{1.2cm}|p{9.1cm}|
1783
1784.. flat-table::
1785    :header-rows:  0
1786    :stub-columns: 0
1787    :widths:       1 1 2
1788
1789    * - ``V4L2_VP9_RESET_FRAME_CTX_NONE``
1790      - 0
1791      - Do not reset any frame context.
1792    * - ``V4L2_VP9_RESET_FRAME_CTX_SPEC``
1793      - 1
1794      - Reset the frame context pointed to by
1795        :c:type:`v4l2_ctrl_vp9_frame`.frame_context_idx.
1796    * - ``V4L2_VP9_RESET_FRAME_CTX_ALL``
1797      - 2
1798      - Reset all frame contexts.
1799
1800See section '7.2 Uncompressed header semantics' of the :ref:`vp9` specification
1801for more details.
1802
1803.. _vp9_interpolation_filter:
1804
1805``Interpolation Filter``
1806
1807.. tabularcolumns:: |p{9.0cm}|p{1.2cm}|p{7.1cm}|
1808
1809.. flat-table::
1810    :header-rows:  0
1811    :stub-columns: 0
1812    :widths:       1 1 2
1813
1814    * - ``V4L2_VP9_INTERP_FILTER_EIGHTTAP``
1815      - 0
1816      - Eight tap filter.
1817    * - ``V4L2_VP9_INTERP_FILTER_EIGHTTAP_SMOOTH``
1818      - 1
1819      - Eight tap smooth filter.
1820    * - ``V4L2_VP9_INTERP_FILTER_EIGHTTAP_SHARP``
1821      - 2
1822      - Eeight tap sharp filter.
1823    * - ``V4L2_VP9_INTERP_FILTER_BILINEAR``
1824      - 3
1825      - Bilinear filter.
1826    * - ``V4L2_VP9_INTERP_FILTER_SWITCHABLE``
1827      - 4
1828      - Filter selection is signaled at the block level.
1829
1830See section '7.2.7 Interpolation filter semantics' of the :ref:`vp9` specification
1831for more details.
1832
1833.. _vp9_reference_mode:
1834
1835``Reference Mode``
1836
1837.. tabularcolumns:: |p{9.6cm}|p{0.5cm}|p{7.2cm}|
1838
1839.. flat-table::
1840    :header-rows:  0
1841    :stub-columns: 0
1842    :widths:       1 1 2
1843
1844    * - ``V4L2_VP9_REFERENCE_MODE_SINGLE_REFERENCE``
1845      - 0
1846      - Indicates that all the inter blocks use only a single reference frame
1847        to generate motion compensated prediction.
1848    * - ``V4L2_VP9_REFERENCE_MODE_COMPOUND_REFERENCE``
1849      - 1
1850      - Requires all the inter blocks to use compound mode. Single reference
1851        frame prediction is not allowed.
1852    * - ``V4L2_VP9_REFERENCE_MODE_SELECT``
1853      - 2
1854      - Allows each individual inter block to select between single and
1855        compound prediction modes.
1856
1857See section '7.3.6 Frame reference mode semantics' of the :ref:`vp9` specification for more details.
1858
1859.. c:type:: v4l2_vp9_segmentation
1860
1861Encodes the quantization parameters. See section '7.2.10 Segmentation
1862params syntax' of the :ref:`vp9` specification for more details.
1863
1864.. tabularcolumns:: |p{0.8cm}|p{5cm}|p{11.4cm}|
1865
1866.. cssclass:: longtable
1867
1868.. flat-table:: struct v4l2_vp9_segmentation
1869    :header-rows:  0
1870    :stub-columns: 0
1871    :widths:       1 1 2
1872
1873    * - __u8
1874      - ``feature_data[8][4]``
1875      - Data attached to each feature. Data entry is only valid if the feature
1876        is enabled. The array shall be indexed with segment number as the first dimension
1877        (0..7) and one of V4L2_VP9_SEG_* as the second dimension.
1878        See :ref:`Segment Feature IDs<vp9_segment_feature>`.
1879    * - __u8
1880      - ``feature_enabled[8]``
1881      - Bitmask defining which features are enabled in each segment. The value for each
1882        segment is a combination of V4L2_VP9_SEGMENT_FEATURE_ENABLED(id) values where id is
1883        one of V4L2_VP9_SEG_*. See :ref:`Segment Feature IDs<vp9_segment_feature>`.
1884    * - __u8
1885      - ``tree_probs[7]``
1886      - Specifies the probability values to be used when decoding a Segment-ID.
1887        See '5.15. Segmentation map' section of :ref:`vp9` for more details.
1888    * - __u8
1889      - ``pred_probs[3]``
1890      - Specifies the probability values to be used when decoding a
1891        Predicted-Segment-ID. See '6.4.14. Get segment id syntax'
1892        section of :ref:`vp9` for more details.
1893    * - __u8
1894      - ``flags``
1895      - Combination of V4L2_VP9_SEGMENTATION_FLAG_* flags. See
1896        :ref:`Segmentation Flags<vp9_segmentation_flags>`.
1897    * - __u8
1898      - ``reserved[5]``
1899      - Applications and drivers must set this to zero.
1900
1901.. _vp9_segment_feature:
1902
1903``Segment feature IDs``
1904
1905.. tabularcolumns:: |p{6.0cm}|p{1cm}|p{10.3cm}|
1906
1907.. flat-table::
1908    :header-rows:  0
1909    :stub-columns: 0
1910    :widths:       1 1 2
1911
1912    * - ``V4L2_VP9_SEG_LVL_ALT_Q``
1913      - 0
1914      - Quantizer segment feature.
1915    * - ``V4L2_VP9_SEG_LVL_ALT_L``
1916      - 1
1917      - Loop filter segment feature.
1918    * - ``V4L2_VP9_SEG_LVL_REF_FRAME``
1919      - 2
1920      - Reference frame segment feature.
1921    * - ``V4L2_VP9_SEG_LVL_SKIP``
1922      - 3
1923      - Skip segment feature.
1924    * - ``V4L2_VP9_SEG_LVL_MAX``
1925      - 4
1926      - Number of segment features.
1927
1928.. _vp9_segmentation_flags:
1929
1930``Segmentation Flags``
1931
1932.. tabularcolumns:: |p{10.6cm}|p{0.8cm}|p{5.9cm}|
1933
1934.. flat-table::
1935    :header-rows:  0
1936    :stub-columns: 0
1937    :widths:       1 1 2
1938
1939    * - ``V4L2_VP9_SEGMENTATION_FLAG_ENABLED``
1940      - 0x01
1941      - Indicates that this frame makes use of the segmentation tool.
1942    * - ``V4L2_VP9_SEGMENTATION_FLAG_UPDATE_MAP``
1943      - 0x02
1944      - Indicates that the segmentation map should be updated during the
1945        decoding of this frame.
1946    * - ``V4L2_VP9_SEGMENTATION_FLAG_TEMPORAL_UPDATE``
1947      - 0x04
1948      - Indicates that the updates to the segmentation map are coded
1949        relative to the existing segmentation map.
1950    * - ``V4L2_VP9_SEGMENTATION_FLAG_UPDATE_DATA``
1951      - 0x08
1952      - Indicates that new parameters are about to be specified for each
1953        segment.
1954    * - ``V4L2_VP9_SEGMENTATION_FLAG_ABS_OR_DELTA_UPDATE``
1955      - 0x10
1956      - Indicates that the segmentation parameters represent the actual values
1957        to be used.
1958
1959.. c:type:: v4l2_vp9_quantization
1960
1961Encodes the quantization parameters. See section '7.2.9 Quantization params
1962syntax' of the VP9 specification for more details.
1963
1964.. tabularcolumns:: |p{0.8cm}|p{4cm}|p{12.4cm}|
1965
1966.. cssclass:: longtable
1967
1968.. flat-table:: struct v4l2_vp9_quantization
1969    :header-rows:  0
1970    :stub-columns: 0
1971    :widths:       1 1 2
1972
1973    * - __u8
1974      - ``base_q_idx``
1975      - Indicates the base frame qindex.
1976    * - __s8
1977      - ``delta_q_y_dc``
1978      - Indicates the Y DC quantizer relative to base_q_idx.
1979    * - __s8
1980      - ``delta_q_uv_dc``
1981      - Indicates the UV DC quantizer relative to base_q_idx.
1982    * - __s8
1983      - ``delta_q_uv_ac``
1984      - Indicates the UV AC quantizer relative to base_q_idx.
1985    * - __u8
1986      - ``reserved[4]``
1987      - Applications and drivers must set this to zero.
1988
1989.. c:type:: v4l2_vp9_loop_filter
1990
1991This structure contains all loop filter related parameters. See sections
1992'7.2.8 Loop filter semantics' of the :ref:`vp9` specification for more details.
1993
1994.. tabularcolumns:: |p{0.8cm}|p{4cm}|p{12.4cm}|
1995
1996.. cssclass:: longtable
1997
1998.. flat-table:: struct v4l2_vp9_loop_filter
1999    :header-rows:  0
2000    :stub-columns: 0
2001    :widths:       1 1 2
2002
2003    * - __s8
2004      - ``ref_deltas[4]``
2005      - Contains the adjustment needed for the filter level based on the chosen
2006        reference frame.
2007    * - __s8
2008      - ``mode_deltas[2]``
2009      - Contains the adjustment needed for the filter level based on the chosen
2010        mode.
2011    * - __u8
2012      - ``level``
2013      - Indicates the loop filter strength.
2014    * - __u8
2015      - ``sharpness``
2016      - Indicates the sharpness level.
2017    * - __u8
2018      - ``flags``
2019      - Combination of V4L2_VP9_LOOP_FILTER_FLAG_* flags.
2020        See :ref:`Loop Filter Flags <vp9_loop_filter_flags>`.
2021    * - __u8
2022      - ``reserved[7]``
2023      - Applications and drivers must set this to zero.
2024
2025
2026.. _vp9_loop_filter_flags:
2027
2028``Loop Filter Flags``
2029
2030.. tabularcolumns:: |p{9.6cm}|p{0.5cm}|p{7.2cm}|
2031
2032.. flat-table::
2033    :header-rows:  0
2034    :stub-columns: 0
2035    :widths:       1 1 2
2036
2037    * - ``V4L2_VP9_LOOP_FILTER_FLAG_DELTA_ENABLED``
2038      - 0x1
2039      - When set, the filter level depends on the mode and reference frame used
2040        to predict a block.
2041    * - ``V4L2_VP9_LOOP_FILTER_FLAG_DELTA_UPDATE``
2042      - 0x2
2043      - When set, the bitstream contains additional syntax elements that
2044        specify which mode and reference frame deltas are to be updated.
2045