1.16. Stateless Codec Control Reference¶
The Stateless Codec control class is intended to support stateless decoder and encoders (i.e. hardware accelerators).
These drivers are typically supported by the Memory-to-memory Stateless Video Decoder Interface, and deal with parsed pixel formats such as V4L2_PIX_FMT_H264_SLICE.
1.16.1. Stateless Codec Control ID¶
V4L2_CID_CODEC_STATELESS_CLASS (class)
The Stateless Codec class descriptor.
V4L2_CID_STATELESS_H264_SPS (struct)
Specifies the sequence parameter set (as extracted from the bitstream) for the associated H264 slice data. This includes the necessary parameters for configuring a stateless hardware decoding pipeline for H264. The bitstream parameters are defined according to ITU-T Rec. H.264 Specification (04/2017 Edition), section 7.4.2.1.1 “Sequence Parameter Set Data Semantics”. For further documentation, refer to the above specification, unless there is an explicit comment stating otherwise.
-
v4l2_ctrl_h264_sps
¶
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__s32 |
|
|
__s32 |
|
|
__s32 |
|
|
__u16 |
|
|
__u16 |
|
|
__u32 |
|
Sequence Parameter Set Constraints Set Flags
|
0x00000001 |
|
|
0x00000002 |
|
|
0x00000004 |
|
|
0x00000008 |
|
|
0x00000010 |
|
|
0x00000020 |
Sequence Parameter Set Flags
|
0x00000001 |
|
|
0x00000002 |
|
|
0x00000004 |
|
|
0x00000008 |
|
|
0x00000010 |
|
|
0x00000020 |
|
|
0x00000040 |
V4L2_CID_STATELESS_H264_PPS (struct)
Specifies the picture parameter set (as extracted from the bitstream) for the associated H264 slice data. This includes the necessary parameters for configuring a stateless hardware decoding pipeline for H264. The bitstream parameters are defined according to ITU-T Rec. H.264 Specification (04/2017 Edition), section 7.4.2.2 “Picture Parameter Set RBSP Semantics”. For further documentation, refer to the above specification, unless there is an explicit comment stating otherwise.
-
v4l2_ctrl_h264_pps
¶
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__s8 |
|
|
__s8 |
|
|
__s8 |
|
|
__s8 |
|
|
__u16 |
|
Picture Parameter Set Flags
|
0x00000001 |
|
|
0x00000002 |
|
|
0x00000004 |
|
|
0x00000008 |
|
|
0x00000010 |
|
|
0x00000020 |
|
|
0x00000040 |
|
|
0x00000080 |
Indicates that |
V4L2_CID_STATELESS_H264_SCALING_MATRIX (struct)
Specifies the scaling matrix (as extracted from the bitstream) for the associated H264 slice data. The bitstream parameters are defined according to ITU-T Rec. H.264 Specification (04/2017 Edition), section 7.4.2.1.1.1 “Scaling List Semantics”. For further documentation, refer to the above specification, unless there is an explicit comment stating otherwise.
-
v4l2_ctrl_h264_scaling_matrix
¶
__u8 |
|
Scaling matrix after applying the inverse scanning process. Expected list order is Intra Y, Intra Cb, Intra Cr, Inter Y, Inter Cb, Inter Cr. The values on each scaling list are expected in raster scan order. |
__u8 |
|
Scaling matrix after applying the inverse scanning process. Expected list order is Intra Y, Inter Y, Intra Cb, Inter Cb, Intra Cr, Inter Cr. The values on each scaling list are expected in raster scan order. |
V4L2_CID_STATELESS_H264_SLICE_PARAMS (struct)
Specifies the slice parameters (as extracted from the bitstream) for the associated H264 slice data. This includes the necessary parameters for configuring a stateless hardware decoding pipeline for H264. The bitstream parameters are defined according to ITU-T Rec. H.264 Specification (04/2017 Edition), section 7.4.3 “Slice Header Semantics”. For further documentation, refer to the above specification, unless there is an explicit comment stating otherwise.
-
v4l2_ctrl_h264_slice_params
¶
__u32 |
|
Offset in bits to slice_data() from the beginning of this slice. |
__u32 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__u8 |
|
|
__s8 |
|
|
__s8 |
|
|
__u8 |
|
|
__s8 |
|
|
__s8 |
|
|
__u8 |
|
If num_ref_idx_active_override_flag is not set, this field must be set to the value of num_ref_idx_l0_default_active_minus1. |
__u8 |
|
If num_ref_idx_active_override_flag is not set, this field must be set to the value of num_ref_idx_l1_default_active_minus1. |
__u8 |
|
Applications and drivers must set this to zero. |
struct |
|
Reference picture list after applying the per-slice modifications |
struct |
|
Reference picture list after applying the per-slice modifications |
__u32 |
|
Slice Parameter Set Flags
|
0x00000001 |
|
|
0x00000002 |
V4L2_CID_STATELESS_H264_PRED_WEIGHTS (struct)
Prediction weight table defined according to ITU-T Rec. H.264 Specification (04/2017 Edition), section 7.4.3.2 “Prediction Weight Table Semantics”. The prediction weight table must be passed by applications under the conditions explained in section 7.3.3 “Slice header syntax”.
-
v4l2_ctrl_h264_pred_weights
¶
__u16 |
|
|
__u16 |
|
|
struct |
|
The weight factors at index 0 are the weight factors for the reference list 0, the one at index 1 for the reference list 1. |
-
v4l2_h264_weight_factors
¶
__s16 |
|
|
__s16 |
|
|
__s16 |
|
|
__s16 |
|
Picture Reference
-
v4l2_h264_reference
¶
__u8 |
|
Specifies how the picture is referenced. See Reference Fields |
__u8 |
|
Index into the |
Reference Fields
|
0x1 |
The top field in field pair is used for short-term reference. |
|
0x2 |
The bottom field in field pair is used for short-term reference. |
|
0x3 |
The frame (or the top/bottom fields, if it’s a field pair) is used for short-term reference. |
V4L2_CID_STATELESS_H264_DECODE_PARAMS (struct)
Specifies the decode parameters (as extracted from the bitstream) for the associated H264 slice data. This includes the necessary parameters for configuring a stateless hardware decoding pipeline for H264. The bitstream parameters are defined according to ITU-T Rec. H.264 Specification (04/2017 Edition). For further documentation, refer to the above specification, unless there is an explicit comment stating otherwise.
-
v4l2_ctrl_h264_decode_params
¶
struct |
|
|
__u16 |
|
NAL reference ID value coming from the NAL Unit header |
__u16 |
|
|
__s32 |
|
Picture Order Count for the coded top field |
__s32 |
|
Picture Order Count for the coded bottom field |
__u16 |
|
|
__u16 |
|
|
__s32 |
|
|
__s32 |
|
|
__s32 |
|
|
__u32 |
|
Size in bits of the dec_ref_pic_marking() syntax element. |
__u32 |
|
Combined size in bits of the picture order count related syntax elements: pic_order_cnt_lsb, delta_pic_order_cnt_bottom, delta_pic_order_cnt0, and delta_pic_order_cnt1. |
__u32 |
|
|
__u32 |
|
Applications and drivers must set this to zero. |
__u32 |
|
Decode Parameters Flags
|
0x00000001 |
That picture is an IDR picture |
|
0x00000002 |
|
|
0x00000004 |
-
v4l2_h264_dpb_entry
¶
__u64 |
|
Timestamp of the V4L2 capture buffer to use as reference, used
with B-coded and P-coded frames. The timestamp refers to the
|
__u32 |
|
|
__u16 |
|
|
__u8 |
|
Specifies how the DPB entry is referenced. See Reference Fields |
__u8 |
|
Applications and drivers must set this to zero. |
__s32 |
|
|
__s32 |
|
|
__u32 |
|
See DPB Entry Flags |
DPB Entries Flags
|
0x00000001 |
The DPB entry is valid (non-empty) and should be considered. |
|
0x00000002 |
The DPB entry is used for reference. |
|
0x00000004 |
The DPB entry is used for long-term reference. |
|
0x00000008 |
The DPB entry is a single field or a complementary field pair. |
V4L2_CID_STATELESS_H264_DECODE_MODE (enum)
Specifies the decoding mode to use. Currently exposes slice-based and frame-based decoding but new modes might be added later on. This control is used as a modifier for V4L2_PIX_FMT_H264_SLICE pixel format. Applications that support V4L2_PIX_FMT_H264_SLICE are required to set this control in order to specify the decoding mode that is expected for the buffer. Drivers may expose a single or multiple decoding modes, depending on what they can support.
-
v4l2_stateless_h264_decode_mode
¶
|
0 |
Decoding is done at the slice granularity.
The OUTPUT buffer must contain a single slice.
When this mode is selected, the |
|
1 |
Decoding is done at the frame granularity,
The OUTPUT buffer must contain all slices needed to decode the
frame. The OUTPUT buffer must also contain both fields.
This mode will be supported by devices that
parse the slice(s) header(s) in hardware. When this mode is
selected, the |
V4L2_CID_STATELESS_H264_START_CODE (enum)
Specifies the H264 slice start code expected for each slice. This control is used as a modifier for V4L2_PIX_FMT_H264_SLICE pixel format. Applications that support V4L2_PIX_FMT_H264_SLICE are required to set this control in order to specify the start code that is expected for the buffer. Drivers may expose a single or multiple start codes, depending on what they can support.
-
v4l2_stateless_h264_start_code
¶
|
0 |
Selecting this value specifies that H264 slices are passed to the driver without any start code. |
|
1 |
Selecting this value specifies that H264 slices are expected to be prefixed by Annex B start codes. According to ITU-T Rec. H.264 Specification (04/2017 Edition) valid start codes can be 3-bytes 0x000001 or 4-bytes 0x00000001. |
V4L2_CID_STATELESS_FWHT_PARAMS (struct)
Specifies the FWHT (Fast Walsh Hadamard Transform) parameters (as extracted from the bitstream) for the associated FWHT data. This includes the necessary parameters for configuring a stateless hardware decoding pipeline for FWHT. This codec is specific to the vicodec test driver.
-
v4l2_ctrl_fwht_params
¶
__u64 |
|
Timestamp of the V4L2 capture buffer to use as backward reference, used
with P-coded frames. The timestamp refers to the
|
__u32 |
|
The version of the codec. Set to |
__u32 |
|
The width of the frame. |
__u32 |
|
The height of the frame. |
__u32 |
|
The flags of the frame, see FWHT Flags. |
__u32 |
|
The colorspace of the frame, from enum |
__u32 |
|
The transfer function, from enum |
__u32 |
|
The Y’CbCr encoding, from enum |
__u32 |
|
The quantization range, from enum |
1.16.2. FWHT Flags¶
|
0x00000001 |
Set if this is an interlaced format. |
|
0x00000002 |
Set if this is a bottom-first (NTSC) interlaced format. |
|
0x00000004 |
Set if each ‘frame’ contains just one field. |
|
0x00000008 |
If V4L2_FWHT_FL_IS_ALTERNATE was set, then this is set if this ‘frame’ is the bottom field, else it is the top field. |
|
0x00000010 |
Set if the Y’ (luma) plane is uncompressed. |
|
0x00000020 |
Set if the Cb plane is uncompressed. |
|
0x00000040 |
Set if the Cr plane is uncompressed. |
|
0x00000080 |
Set if the chroma plane has the same height as the luma plane, else the chroma plane is half the height of the luma plane. |
|
0x00000100 |
Set if the chroma plane has the same width as the luma plane, else the chroma plane is half the width of the luma plane. |
|
0x00000200 |
Set if the alpha plane is uncompressed. |
|
0x00000400 |
Set if this is an I-frame. |
|
0x00070000 |
The number of color components - 1. |
|
0x00180000 |
The mask for the pixel encoding. |
|
0x00080000 |
Set if the pixel encoding is YUV. |
|
0x00100000 |
Set if the pixel encoding is RGB. |
|
0x00180000 |
Set if the pixel encoding is HSV. |