1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
3 .. _codec-stateless-controls:
5 *********************************
6 Stateless Codec Control Reference
7 *********************************
9 The Stateless Codec control class is intended to support
10 stateless decoder and encoders (i.e. hardware accelerators).
12 These drivers are typically supported by the :ref:`stateless_decoder`,
13 and deal with parsed pixel formats such as V4L2_PIX_FMT_H264_SLICE.
15 Stateless Codec Control ID
16 ==========================
18 .. _codec-stateless-control-id:
20 ``V4L2_CID_CODEC_STATELESS_CLASS (class)``
21 The Stateless Codec class descriptor.
23 .. _v4l2-codec-stateless-h264:
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
35 .. c:type:: v4l2_ctrl_h264_sps
41 .. tabularcolumns:: |p{1.2cm}|p{8.6cm}|p{7.5cm}|
43 .. flat-table:: struct v4l2_ctrl_h264_sps
52 - ``constraint_set_flags``
53 - See :ref:`Sequence Parameter Set Constraints Set Flags <h264_sps_constraints_set_flags>`
58 - ``seq_parameter_set_id``
61 - ``chroma_format_idc``
64 - ``bit_depth_luma_minus8``
67 - ``bit_depth_chroma_minus8``
70 - ``log2_max_frame_num_minus4``
73 - ``pic_order_cnt_type``
76 - ``log2_max_pic_order_cnt_lsb_minus4``
79 - ``max_num_ref_frames``
82 - ``num_ref_frames_in_pic_order_cnt_cycle``
85 - ``offset_for_ref_frame[255]``
88 - ``offset_for_non_ref_pic``
91 - ``offset_for_top_to_bottom_field``
94 - ``pic_width_in_mbs_minus1``
97 - ``pic_height_in_map_units_minus1``
101 - See :ref:`Sequence Parameter Set Flags <h264_sps_flags>`
107 .. _h264_sps_constraints_set_flags:
109 ``Sequence Parameter Set Constraints Set Flags``
111 .. cssclass:: longtable
118 * - ``V4L2_H264_SPS_CONSTRAINT_SET0_FLAG``
121 * - ``V4L2_H264_SPS_CONSTRAINT_SET1_FLAG``
124 * - ``V4L2_H264_SPS_CONSTRAINT_SET2_FLAG``
127 * - ``V4L2_H264_SPS_CONSTRAINT_SET3_FLAG``
130 * - ``V4L2_H264_SPS_CONSTRAINT_SET4_FLAG``
133 * - ``V4L2_H264_SPS_CONSTRAINT_SET5_FLAG``
139 ``Sequence Parameter Set Flags``
141 .. cssclass:: longtable
148 * - ``V4L2_H264_SPS_FLAG_SEPARATE_COLOUR_PLANE``
151 * - ``V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS``
154 * - ``V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO``
157 * - ``V4L2_H264_SPS_FLAG_GAPS_IN_FRAME_NUM_VALUE_ALLOWED``
160 * - ``V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY``
163 * - ``V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD``
166 * - ``V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE``
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
180 .. c:type:: v4l2_ctrl_h264_pps
186 .. flat-table:: struct v4l2_ctrl_h264_pps
192 - ``pic_parameter_set_id``
195 - ``seq_parameter_set_id``
198 - ``num_slice_groups_minus1``
201 - ``num_ref_idx_l0_default_active_minus1``
204 - ``num_ref_idx_l1_default_active_minus1``
207 - ``weighted_bipred_idc``
210 - ``pic_init_qp_minus26``
213 - ``pic_init_qs_minus26``
216 - ``chroma_qp_index_offset``
219 - ``second_chroma_qp_index_offset``
223 - See :ref:`Picture Parameter Set Flags <h264_pps_flags>`
231 ``Picture Parameter Set Flags``
237 \setlength{\tabcolsep}{2pt}
239 .. tabularcolumns:: |p{9.8cm}|p{1.0cm}|p{6.5cm}|
246 * - ``V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE``
249 * - ``V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT``
252 * - ``V4L2_H264_PPS_FLAG_WEIGHTED_PRED``
255 * - ``V4L2_H264_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT``
258 * - ``V4L2_H264_PPS_FLAG_CONSTRAINED_INTRA_PRED``
261 * - ``V4L2_H264_PPS_FLAG_REDUNDANT_PIC_CNT_PRESENT``
264 * - ``V4L2_H264_PPS_FLAG_TRANSFORM_8X8_MODE``
267 * - ``V4L2_H264_PPS_FLAG_SCALING_MATRIX_PRESENT``
269 - ``V4L2_CID_STATELESS_H264_SCALING_MATRIX``
270 must be used for this picture.
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
284 .. c:type:: v4l2_ctrl_h264_scaling_matrix
290 .. tabularcolumns:: |p{0.6cm}|p{4.8cm}|p{11.9cm}|
292 .. flat-table:: struct v4l2_ctrl_h264_scaling_matrix
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.
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.
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.
319 .. c:type:: v4l2_ctrl_h264_slice_params
325 .. tabularcolumns:: |p{4.0cm}|p{5.9cm}|p{7.4cm}|
327 .. flat-table:: struct v4l2_ctrl_h264_slice_params
333 - ``header_bit_size``
334 - Offset in bits to slice_data() from the beginning of this slice.
336 - ``first_mb_in_slice``
342 - ``colour_plane_id``
345 - ``redundant_pic_cnt``
357 - ``disable_deblocking_filter_idc``
360 - ``slice_alpha_c0_offset_div2``
363 - ``slice_beta_offset_div2``
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
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
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
384 - See :ref:`Slice Parameter Flags <h264_slice_flags>`
390 .. _h264_slice_flags:
392 ``Slice Parameter Set Flags``
394 .. cssclass:: longtable
401 * - ``V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED``
404 * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH``
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
415 .. c:type:: v4l2_ctrl_h264_pred_weights
421 .. tabularcolumns:: |p{4.9cm}|p{4.9cm}|p{7.5cm}|
423 .. flat-table:: struct v4l2_ctrl_h264_pred_weights
429 - ``luma_log2_weight_denom``
432 - ``chroma_log2_weight_denom``
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.
443 .. c:type:: v4l2_h264_weight_factors
449 .. tabularcolumns:: |p{1.0cm}|p{4.5cm}|p{11.8cm}|
451 .. flat-table:: struct v4l2_h264_weight_factors
457 - ``luma_weight[32]``
460 - ``luma_offset[32]``
463 - ``chroma_weight[32][2]``
466 - ``chroma_offset[32][2]``
473 ``Picture Reference``
475 .. c:type:: v4l2_h264_reference
477 .. cssclass:: longtable
479 .. flat-table:: struct v4l2_h264_reference
486 - Specifies how the picture is referenced. See :ref:`Reference Fields <h264_ref_fields>`
489 - Index into the :c:type:`v4l2_ctrl_h264_decode_params`.dpb array.
499 .. tabularcolumns:: |p{5.4cm}|p{0.8cm}|p{11.1cm}|
506 * - ``V4L2_H264_TOP_FIELD_REF``
508 - The top field in field pair is used for short-term reference.
509 * - ``V4L2_H264_BOTTOM_FIELD_REF``
511 - The bottom field in field pair is used for short-term reference.
512 * - ``V4L2_H264_FRAME_REF``
514 - The frame (or the top/bottom fields, if it's a field pair)
515 is used for short-term reference.
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
530 .. c:type:: v4l2_ctrl_h264_decode_params
536 .. tabularcolumns:: |p{4.0cm}|p{5.9cm}|p{7.4cm}|
538 .. flat-table:: struct v4l2_ctrl_h264_decode_params
543 * - struct :c:type:`v4l2_h264_dpb_entry`
548 - NAL reference ID value coming from the NAL Unit header
553 - ``top_field_order_cnt``
554 - Picture Order Count for the coded top field
556 - ``bottom_field_order_cnt``
557 - Picture Order Count for the coded bottom field
562 - ``pic_order_cnt_lsb``
565 - ``delta_pic_order_cnt_bottom``
568 - ``delta_pic_order_cnt0``
571 - ``delta_pic_order_cnt1``
574 - ``dec_ref_pic_marking_bit_size``
575 - Size in bits of the dec_ref_pic_marking() syntax element.
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.
582 - ``slice_group_change_cycle``
586 - Applications and drivers must set this to zero.
589 - See :ref:`Decode Parameters Flags <h264_decode_params_flags>`
595 .. _h264_decode_params_flags:
597 ``Decode Parameters Flags``
603 .. tabularcolumns:: |p{8.3cm}|p{2.1cm}|p{6.9cm}|
610 * - ``V4L2_H264_DECODE_PARAM_FLAG_IDR_PIC``
612 - That picture is an IDR picture
613 * - ``V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC``
616 * - ``V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD``
624 .. c:type:: v4l2_h264_dpb_entry
630 .. tabularcolumns:: |p{1.0cm}|p{4.9cm}|p{11.4cm}|
632 .. flat-table:: struct v4l2_h264_dpb_entry
639 - Timestamp of the V4L2 capture buffer to use as reference, used
640 with B-coded and P-coded frames. The timestamp refers to the
641 ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
642 :c:func:`v4l2_timeval_to_ns()` function to convert the struct
643 :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
652 - Specifies how the DPB entry is referenced. See :ref:`Reference Fields <h264_ref_fields>`
655 - Applications and drivers must set this to zero.
657 - ``top_field_order_cnt``
660 - ``bottom_field_order_cnt``
664 - See :ref:`DPB Entry Flags <h264_dpb_flags>`
672 ``DPB Entries Flags``
678 .. tabularcolumns:: |p{7.7cm}|p{2.1cm}|p{7.5cm}|
685 * - ``V4L2_H264_DPB_ENTRY_FLAG_VALID``
687 - The DPB entry is valid (non-empty) and should be considered.
688 * - ``V4L2_H264_DPB_ENTRY_FLAG_ACTIVE``
690 - The DPB entry is used for reference.
691 * - ``V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM``
693 - The DPB entry is used for long-term reference.
694 * - ``V4L2_H264_DPB_ENTRY_FLAG_FIELD``
696 - The DPB entry is a single field or a complementary field pair.
702 ``V4L2_CID_STATELESS_H264_DECODE_MODE (enum)``
703 Specifies the decoding mode to use. Currently exposes slice-based and
704 frame-based decoding but new modes might be added later on.
705 This control is used as a modifier for V4L2_PIX_FMT_H264_SLICE
706 pixel format. Applications that support V4L2_PIX_FMT_H264_SLICE
707 are required to set this control in order to specify the decoding mode
708 that is expected for the buffer.
709 Drivers may expose a single or multiple decoding modes, depending
710 on what they can support.
712 .. c:type:: v4l2_stateless_h264_decode_mode
718 .. tabularcolumns:: |p{7.4cm}|p{0.3cm}|p{9.6cm}|
725 * - ``V4L2_STATELESS_H264_DECODE_MODE_SLICE_BASED``
727 - Decoding is done at the slice granularity.
728 The OUTPUT buffer must contain a single slice.
729 When this mode is selected, the ``V4L2_CID_STATELESS_H264_SLICE_PARAMS``
730 control shall be set. When multiple slices compose a frame,
731 use of ``V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF`` flag
733 * - ``V4L2_STATELESS_H264_DECODE_MODE_FRAME_BASED``
735 - Decoding is done at the frame granularity,
736 The OUTPUT buffer must contain all slices needed to decode the
737 frame. The OUTPUT buffer must also contain both fields.
738 This mode will be supported by devices that
739 parse the slice(s) header(s) in hardware. When this mode is
740 selected, the ``V4L2_CID_STATELESS_H264_SLICE_PARAMS``
741 control shall not be set.
747 ``V4L2_CID_STATELESS_H264_START_CODE (enum)``
748 Specifies the H264 slice start code expected for each slice.
749 This control is used as a modifier for V4L2_PIX_FMT_H264_SLICE
750 pixel format. Applications that support V4L2_PIX_FMT_H264_SLICE
751 are required to set this control in order to specify the start code
752 that is expected for the buffer.
753 Drivers may expose a single or multiple start codes, depending
754 on what they can support.
756 .. c:type:: v4l2_stateless_h264_start_code
762 .. tabularcolumns:: |p{7.9cm}|p{0.4cm}|p{9.0cm}|
769 * - ``V4L2_STATELESS_H264_START_CODE_NONE``
771 - Selecting this value specifies that H264 slices are passed
772 to the driver without any start code. The bitstream data should be
773 according to :ref:`h264` 7.3.1 NAL unit syntax, hence contains
774 emulation prevention bytes when required.
775 * - ``V4L2_STATELESS_H264_START_CODE_ANNEX_B``
777 - Selecting this value specifies that H264 slices are expected
778 to be prefixed by Annex B start codes. According to :ref:`h264`
779 valid start codes can be 3-bytes 0x000001 or 4-bytes 0x00000001.
785 .. _codec-stateless-fwht:
787 ``V4L2_CID_STATELESS_FWHT_PARAMS (struct)``
788 Specifies the FWHT (Fast Walsh Hadamard Transform) parameters (as extracted
789 from the bitstream) for the associated FWHT data. This includes the necessary
790 parameters for configuring a stateless hardware decoding pipeline for FWHT.
791 This codec is specific to the vicodec test driver.
793 .. c:type:: v4l2_ctrl_fwht_params
799 .. tabularcolumns:: |p{1.4cm}|p{3.9cm}|p{12.0cm}|
801 .. flat-table:: struct v4l2_ctrl_fwht_params
807 - ``backward_ref_ts``
808 - Timestamp of the V4L2 capture buffer to use as backward reference, used
809 with P-coded frames. The timestamp refers to the
810 ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
811 :c:func:`v4l2_timeval_to_ns()` function to convert the struct
812 :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
815 - The version of the codec. Set to ``V4L2_FWHT_VERSION``.
818 - The width of the frame.
821 - The height of the frame.
824 - The flags of the frame, see :ref:`fwht-flags`.
827 - The colorspace of the frame, from enum :c:type:`v4l2_colorspace`.
830 - The transfer function, from enum :c:type:`v4l2_xfer_func`.
833 - The Y'CbCr encoding, from enum :c:type:`v4l2_ycbcr_encoding`.
836 - The quantization range, from enum :c:type:`v4l2_quantization`.
851 .. tabularcolumns:: |p{7.0cm}|p{2.3cm}|p{8.0cm}|
858 * - ``V4L2_FWHT_FL_IS_INTERLACED``
860 - Set if this is an interlaced format.
861 * - ``V4L2_FWHT_FL_IS_BOTTOM_FIRST``
863 - Set if this is a bottom-first (NTSC) interlaced format.
864 * - ``V4L2_FWHT_FL_IS_ALTERNATE``
866 - Set if each 'frame' contains just one field.
867 * - ``V4L2_FWHT_FL_IS_BOTTOM_FIELD``
869 - If V4L2_FWHT_FL_IS_ALTERNATE was set, then this is set if this 'frame' is the
870 bottom field, else it is the top field.
871 * - ``V4L2_FWHT_FL_LUMA_IS_UNCOMPRESSED``
873 - Set if the Y' (luma) plane is uncompressed.
874 * - ``V4L2_FWHT_FL_CB_IS_UNCOMPRESSED``
876 - Set if the Cb plane is uncompressed.
877 * - ``V4L2_FWHT_FL_CR_IS_UNCOMPRESSED``
879 - Set if the Cr plane is uncompressed.
880 * - ``V4L2_FWHT_FL_CHROMA_FULL_HEIGHT``
882 - Set if the chroma plane has the same height as the luma plane,
883 else the chroma plane is half the height of the luma plane.
884 * - ``V4L2_FWHT_FL_CHROMA_FULL_WIDTH``
886 - Set if the chroma plane has the same width as the luma plane,
887 else the chroma plane is half the width of the luma plane.
888 * - ``V4L2_FWHT_FL_ALPHA_IS_UNCOMPRESSED``
890 - Set if the alpha plane is uncompressed.
891 * - ``V4L2_FWHT_FL_I_FRAME``
893 - Set if this is an I-frame.
894 * - ``V4L2_FWHT_FL_COMPONENTS_NUM_MSK``
896 - The number of color components minus one.
897 * - ``V4L2_FWHT_FL_PIXENC_MSK``
899 - The mask for the pixel encoding.
900 * - ``V4L2_FWHT_FL_PIXENC_YUV``
902 - Set if the pixel encoding is YUV.
903 * - ``V4L2_FWHT_FL_PIXENC_RGB``
905 - Set if the pixel encoding is RGB.
906 * - ``V4L2_FWHT_FL_PIXENC_HSV``
908 - Set if the pixel encoding is HSV.
914 .. _v4l2-codec-stateless-vp8:
916 ``V4L2_CID_STATELESS_VP8_FRAME (struct)``
917 Specifies the frame parameters for the associated VP8 parsed frame data.
918 This includes the necessary parameters for
919 configuring a stateless hardware decoding pipeline for VP8.
920 The bitstream parameters are defined according to :ref:`vp8`.
922 .. c:type:: v4l2_ctrl_vp8_frame
928 .. tabularcolumns:: |p{7.0cm}|p{4.6cm}|p{5.7cm}|
930 .. cssclass:: longtable
932 .. flat-table:: struct v4l2_ctrl_vp8_frame
937 * - struct :c:type:`v4l2_vp8_segment`
939 - Structure with segment-based adjustments metadata.
940 * - struct :c:type:`v4l2_vp8_loop_filter`
942 - Structure with loop filter level adjustments metadata.
943 * - struct :c:type:`v4l2_vp8_quantization`
945 - Structure with VP8 dequantization indices metadata.
946 * - struct :c:type:`v4l2_vp8_entropy`
948 - Structure with VP8 entropy coder probabilities metadata.
949 * - struct :c:type:`v4l2_vp8_entropy_coder_state`
951 - Structure with VP8 entropy coder state.
954 - The width of the frame. Must be set for all frames.
957 - The height of the frame. Must be set for all frames.
959 - ``horizontal_scale``
960 - Horizontal scaling factor.
962 - ``vertical_scaling factor``
968 - ``prob_skip_false``
969 - Indicates the probability that the macroblock is not skipped.
972 - Indicates the probability that a macroblock is intra-predicted.
975 - Indicates the probability that the last reference frame is used
979 - Indicates the probability that the golden reference frame is used
983 - Number of DCT coefficients partitions. Must be one of: 1, 2, 4, or 8.
985 - ``first_part_size``
986 - Size of the first partition, i.e. the control partition.
988 - ``first_part_header_bits``
989 - Size in bits of the first partition header portion.
991 - ``dct_part_sizes[8]``
992 - DCT coefficients sizes.
995 - Timestamp for the V4L2 capture buffer to use as last reference frame, used
996 with inter-coded frames. The timestamp refers to the ``timestamp`` field in
997 struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
998 function to convert the struct :c:type:`timeval` in struct
999 :c:type:`v4l2_buffer` to a __u64.
1001 - ``golden_frame_ts``
1002 - Timestamp for the V4L2 capture buffer to use as last reference frame, used
1003 with inter-coded frames. The timestamp refers to the ``timestamp`` field in
1004 struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1005 function to convert the struct :c:type:`timeval` in struct
1006 :c:type:`v4l2_buffer` to a __u64.
1009 - Timestamp for the V4L2 capture buffer to use as alternate reference frame, used
1010 with inter-coded frames. The timestamp refers to the ``timestamp`` field in
1011 struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1012 function to convert the struct :c:type:`timeval` in struct
1013 :c:type:`v4l2_buffer` to a __u64.
1016 - See :ref:`Frame Flags <vp8_frame_flags>`
1022 .. _vp8_frame_flags:
1026 .. tabularcolumns:: |p{9.8cm}|p{0.8cm}|p{6.7cm}|
1028 .. cssclass:: longtable
1035 * - ``V4L2_VP8_FRAME_FLAG_KEY_FRAME``
1037 - Indicates if the frame is a key frame.
1038 * - ``V4L2_VP8_FRAME_FLAG_EXPERIMENTAL``
1040 - Experimental bitstream.
1041 * - ``V4L2_VP8_FRAME_FLAG_SHOW_FRAME``
1043 - Show frame flag, indicates if the frame is for display.
1044 * - ``V4L2_VP8_FRAME_FLAG_MB_NO_SKIP_COEFF``
1046 - Enable/disable skipping of macroblocks with no non-zero coefficients.
1047 * - ``V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN``
1049 - Sign of motion vectors when the golden frame is referenced.
1050 * - ``V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT``
1052 - Sign of motion vectors when the alt frame is referenced.
1054 .. c:type:: v4l2_vp8_entropy_coder_state
1056 .. cssclass:: longtable
1058 .. tabularcolumns:: |p{1.0cm}|p{2.0cm}|p{14.3cm}|
1060 .. flat-table:: struct v4l2_vp8_entropy_coder_state
1067 - coder state value for "Range"
1070 - coder state value for "Value"-
1073 - number of bits left.
1076 - Applications and drivers must set this to zero.
1078 .. c:type:: v4l2_vp8_segment
1080 .. cssclass:: longtable
1082 .. tabularcolumns:: |p{1.2cm}|p{4.0cm}|p{12.1cm}|
1084 .. flat-table:: struct v4l2_vp8_segment
1090 - ``quant_update[4]``
1091 - Signed quantizer value update.
1094 - Signed loop filter level value update.
1096 - ``segment_probs[3]``
1097 - Segment probabilities.
1100 - Applications and drivers must set this to zero.
1103 - See :ref:`Segment Flags <vp8_segment_flags>`
1105 .. _vp8_segment_flags:
1113 .. tabularcolumns:: |p{10cm}|p{1.0cm}|p{6.3cm}|
1120 * - ``V4L2_VP8_SEGMENT_FLAG_ENABLED``
1122 - Enable/disable segment-based adjustments.
1123 * - ``V4L2_VP8_SEGMENT_FLAG_UPDATE_MAP``
1125 - Indicates if the macroblock segmentation map is updated in this frame.
1126 * - ``V4L2_VP8_SEGMENT_FLAG_UPDATE_FEATURE_DATA``
1128 - Indicates if the segment feature data is updated in this frame.
1129 * - ``V4L2_VP8_SEGMENT_FLAG_DELTA_VALUE_MODE``
1131 - If is set, the segment feature data mode is delta-value.
1132 If cleared, it's absolute-value.
1138 .. c:type:: v4l2_vp8_loop_filter
1140 .. cssclass:: longtable
1142 .. tabularcolumns:: |p{1.5cm}|p{3.9cm}|p{11.9cm}|
1144 .. flat-table:: struct v4l2_vp8_loop_filter
1150 - ``ref_frm_delta[4]``
1151 - Reference adjustment (signed) delta value.
1153 - ``mb_mode_delta[4]``
1154 - Macroblock prediction mode adjustment (signed) delta value.
1156 - ``sharpness_level``
1163 - Applications and drivers must set this to zero.
1166 - See :ref:`Loop Filter Flags <vp8_loop_filter_flags>`
1168 .. _vp8_loop_filter_flags:
1170 ``Loop Filter Flags``
1172 .. tabularcolumns:: |p{7.0cm}|p{1.2cm}|p{9.1cm}|
1179 * - ``V4L2_VP8_LF_ADJ_ENABLE``
1181 - Enable/disable macroblock-level loop filter adjustment.
1182 * - ``V4L2_VP8_LF_DELTA_UPDATE``
1184 - Indicates if the delta values used in an adjustment are updated.
1185 * - ``V4L2_VP8_LF_FILTER_TYPE_SIMPLE``
1187 - If set, indicates the filter type is simple.
1188 If cleared, the filter type is normal.
1190 .. c:type:: v4l2_vp8_quantization
1192 .. tabularcolumns:: |p{1.5cm}|p{3.5cm}|p{12.3cm}|
1194 .. flat-table:: struct v4l2_vp8_quantization
1201 - Luma AC coefficient table index.
1204 - Luma DC delta vaue.
1207 - Y2 block DC delta value.
1210 - Y2 block AC delta value.
1213 - Chroma DC delta value.
1216 - Chroma AC delta value.
1219 - Applications and drivers must set this to zero.
1221 .. c:type:: v4l2_vp8_entropy
1223 .. cssclass:: longtable
1225 .. tabularcolumns:: |p{1.5cm}|p{5.8cm}|p{10.0cm}|
1227 .. flat-table:: struct v4l2_vp8_entropy
1233 - ``coeff_probs[4][8][3][11]``
1234 - Coefficient update probabilities.
1236 - ``y_mode_probs[4]``
1237 - Luma mode update probabilities.
1239 - ``uv_mode_probs[3]``
1240 - Chroma mode update probabilities.
1242 - ``mv_probs[2][19]``
1243 - MV decoding update probabilities.
1246 - Applications and drivers must set this to zero.
1248 .. _v4l2-codec-stateless-mpeg2:
1250 ``V4L2_CID_STATELESS_MPEG2_SEQUENCE (struct)``
1251 Specifies the sequence parameters (as extracted from the bitstream) for the
1252 associated MPEG-2 slice data. This includes fields matching the syntax
1253 elements from the sequence header and sequence extension parts of the
1254 bitstream as specified by :ref:`mpeg2part2`.
1256 .. c:type:: v4l2_ctrl_mpeg2_sequence
1262 .. cssclass:: longtable
1264 .. tabularcolumns:: |p{1.4cm}|p{6.5cm}|p{9.4cm}|
1266 .. flat-table:: struct v4l2_ctrl_mpeg2_sequence
1272 - ``horizontal_size``
1273 - The width of the displayable part of the frame's luminance component.
1276 - The height of the displayable part of the frame's luminance component.
1278 - ``vbv_buffer_size``
1279 - Used to calculate the required size of the video buffering verifier,
1280 defined (in bits) as: 16 * 1024 * vbv_buffer_size.
1282 - ``profile_and_level_indication``
1283 - The current profile and level indication as extracted from the
1287 - The chrominance sub-sampling format (1: 4:2:0, 2: 4:2:2, 3: 4:4:4).
1290 - See :ref:`MPEG-2 Sequence Flags <mpeg2_sequence_flags>`.
1292 .. _mpeg2_sequence_flags:
1294 ``MPEG-2 Sequence Flags``
1296 .. cssclass:: longtable
1303 * - ``V4L2_MPEG2_SEQ_FLAG_PROGRESSIVE``
1305 - Indication that all the frames for the sequence are progressive instead
1312 ``V4L2_CID_STATELESS_MPEG2_PICTURE (struct)``
1313 Specifies the picture parameters (as extracted from the bitstream) for the
1314 associated MPEG-2 slice data. This includes fields matching the syntax
1315 elements from the picture header and picture coding extension parts of the
1316 bitstream as specified by :ref:`mpeg2part2`.
1318 .. c:type:: v4l2_ctrl_mpeg2_picture
1324 .. cssclass:: longtable
1326 .. tabularcolumns:: |p{1.0cm}|p{5.6cm}|p{10.7cm}|
1328 .. flat-table:: struct v4l2_ctrl_mpeg2_picture
1334 - ``backward_ref_ts``
1335 - Timestamp of the V4L2 capture buffer to use as backward reference, used
1336 with B-coded and P-coded frames. The timestamp refers to the
1337 ``timestamp`` field in struct :c:type:`v4l2_buffer`. Use the
1338 :c:func:`v4l2_timeval_to_ns()` function to convert the struct
1339 :c:type:`timeval` in struct :c:type:`v4l2_buffer` to a __u64.
1341 - ``forward_ref_ts``
1342 - Timestamp for the V4L2 capture buffer to use as forward reference, used
1343 with B-coded frames. The timestamp refers to the ``timestamp`` field in
1344 struct :c:type:`v4l2_buffer`. Use the :c:func:`v4l2_timeval_to_ns()`
1345 function to convert the struct :c:type:`timeval` in struct
1346 :c:type:`v4l2_buffer` to a __u64.
1349 - See :ref:`MPEG-2 Picture Flags <mpeg2_picture_flags>`.
1352 - Motion vector codes.
1354 - ``picture_coding_type``
1355 - Picture coding type for the frame covered by the current slice
1356 (V4L2_MPEG2_PIC_CODING_TYPE_I, V4L2_MPEG2_PIC_CODING_TYPE_P or
1357 V4L2_MPEG2_PIC_CODING_TYPE_B).
1359 - ``picture_structure``
1360 - Picture structure (1: interlaced top field, 2: interlaced bottom field,
1361 3: progressive frame).
1363 - ``intra_dc_precision``
1364 - Precision of Discrete Cosine transform (0: 8 bits precision,
1365 1: 9 bits precision, 2: 10 bits precision, 3: 11 bits precision).
1368 - Applications and drivers must set this to zero.
1370 .. _mpeg2_picture_flags:
1372 ``MPEG-2 Picture Flags``
1374 .. cssclass:: longtable
1381 * - ``V4L2_MPEG2_PIC_FLAG_TOP_FIELD_FIRST``
1383 - If set and it's an interlaced stream, top field is output first.
1384 * - ``V4L2_MPEG2_PIC_FLAG_FRAME_PRED_DCT``
1386 - If set only frame-DCT and frame prediction are used.
1387 * - ``V4L2_MPEG2_PIC_FLAG_CONCEALMENT_MV``
1389 - If set motion vectors are coded for intra macroblocks.
1390 * - ``V4L2_MPEG2_PIC_FLAG_Q_SCALE_TYPE``
1392 - This flag affects the inverse quantization process.
1393 * - ``V4L2_MPEG2_PIC_FLAG_INTRA_VLC``
1395 - This flag affects the decoding of transform coefficient data.
1396 * - ``V4L2_MPEG2_PIC_FLAG_ALT_SCAN``
1398 - This flag affects the decoding of transform coefficient data.
1399 * - ``V4L2_MPEG2_PIC_FLAG_REPEAT_FIRST``
1401 - This flag affects the decoding process of progressive frames.
1402 * - ``V4L2_MPEG2_PIC_FLAG_PROGRESSIVE``
1404 - Indicates whether the current frame is progressive.
1410 ``V4L2_CID_STATELESS_MPEG2_QUANTISATION (struct)``
1411 Specifies quantisation matrices, in zigzag scanning order, for the
1412 associated MPEG-2 slice data. This control is initialized by the kernel
1413 to the matrices default values. If a bitstream transmits a user-defined
1414 quantisation matrices load, applications are expected to use this control.
1415 Applications are also expected to set the control loading the default
1416 values, if the quantisation matrices need to be reset, for instance on a
1417 sequence header. This process is specified by section 6.3.7.
1418 "Quant matrix extension" of the specification.
1420 .. c:type:: v4l2_ctrl_mpeg2_quantisation
1422 .. tabularcolumns:: |p{0.8cm}|p{8.0cm}|p{8.5cm}|
1424 .. cssclass:: longtable
1430 .. flat-table:: struct v4l2_ctrl_mpeg2_quantisation
1436 - ``intra_quantiser_matrix[64]``
1437 - The quantisation matrix coefficients for intra-coded frames, in zigzag
1438 scanning order. It is relevant for both luma and chroma components,
1439 although it can be superseded by the chroma-specific matrix for
1440 non-4:2:0 YUV formats.
1442 - ``non_intra_quantiser_matrix[64]``
1443 - The quantisation matrix coefficients for non-intra-coded frames, in
1444 zigzag scanning order. It is relevant for both luma and chroma
1445 components, although it can be superseded by the chroma-specific matrix
1446 for non-4:2:0 YUV formats.
1448 - ``chroma_intra_quantiser_matrix[64]``
1449 - The quantisation matrix coefficients for the chominance component of
1450 intra-coded frames, in zigzag scanning order. Only relevant for
1451 non-4:2:0 YUV formats.
1453 - ``chroma_non_intra_quantiser_matrix[64]``
1454 - The quantisation matrix coefficients for the chrominance component of
1455 non-intra-coded frames, in zigzag scanning order. Only relevant for
1456 non-4:2:0 YUV formats.