1 /* SPDX-License-Identifier: GPL-2.0 */
3 * These are the VP8 state controls for use with stateless VP8
6 * It turns out that these structs are not stable yet and will undergo
7 * more changes. So keep them private until they are stable and ready to
8 * become part of the official public API.
14 #include <linux/types.h>
16 #define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F')
18 #define V4L2_CID_MPEG_VIDEO_VP8_FRAME_HEADER (V4L2_CID_CODEC_BASE + 2000)
19 #define V4L2_CTRL_TYPE_VP8_FRAME_HEADER 0x301
21 #define V4L2_VP8_SEGMENT_HEADER_FLAG_ENABLED 0x01
22 #define V4L2_VP8_SEGMENT_HEADER_FLAG_UPDATE_MAP 0x02
23 #define V4L2_VP8_SEGMENT_HEADER_FLAG_UPDATE_FEATURE_DATA 0x04
24 #define V4L2_VP8_SEGMENT_HEADER_FLAG_DELTA_VALUE_MODE 0x08
26 struct v4l2_vp8_segment_header {
29 __u8 segment_probs[3];
34 #define V4L2_VP8_LF_HEADER_ADJ_ENABLE 0x01
35 #define V4L2_VP8_LF_HEADER_DELTA_UPDATE 0x02
36 #define V4L2_VP8_LF_FILTER_TYPE_SIMPLE 0x04
37 struct v4l2_vp8_loopfilter_header {
38 __s8 ref_frm_delta[4];
39 __s8 mb_mode_delta[4];
46 struct v4l2_vp8_quantization_header {
56 #define V4L2_VP8_COEFF_PROB_CNT 11
57 #define V4L2_VP8_MV_PROB_CNT 19
58 struct v4l2_vp8_entropy_header {
59 __u8 coeff_probs[4][8][3][V4L2_VP8_COEFF_PROB_CNT];
61 __u8 uv_mode_probs[3];
62 __u8 mv_probs[2][V4L2_VP8_MV_PROB_CNT];
66 struct v4l2_vp8_entropy_coder_state {
73 #define V4L2_VP8_FRAME_HEADER_FLAG_KEY_FRAME 0x01
74 #define V4L2_VP8_FRAME_HEADER_FLAG_EXPERIMENTAL 0x02
75 #define V4L2_VP8_FRAME_HEADER_FLAG_SHOW_FRAME 0x04
76 #define V4L2_VP8_FRAME_HEADER_FLAG_MB_NO_SKIP_COEFF 0x08
77 #define V4L2_VP8_FRAME_HEADER_FLAG_SIGN_BIAS_GOLDEN 0x10
78 #define V4L2_VP8_FRAME_HEADER_FLAG_SIGN_BIAS_ALT 0x20
80 #define VP8_FRAME_IS_KEY_FRAME(hdr) \
81 (!!((hdr)->flags & V4L2_VP8_FRAME_HEADER_FLAG_KEY_FRAME))
83 struct v4l2_ctrl_vp8_frame_header {
84 struct v4l2_vp8_segment_header segment_header;
85 struct v4l2_vp8_loopfilter_header lf_header;
86 struct v4l2_vp8_quantization_header quant_header;
87 struct v4l2_vp8_entropy_header entropy_header;
88 struct v4l2_vp8_entropy_coder_state coder_state;
93 __u8 horizontal_scale;
103 __u32 first_part_size;
104 __u32 first_part_header_bits;
105 __u32 dct_part_sizes[8];
108 __u64 golden_frame_ts;