Commit | Line | Data |
---|---|---|
95140634 HV |
1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | /* | |
3 | * These are the MPEG2 state controls for use with stateless MPEG-2 | |
4 | * codec drivers. | |
5 | * | |
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. | |
9 | */ | |
10 | ||
11 | #ifndef _MPEG2_CTRLS_H_ | |
12 | #define _MPEG2_CTRLS_H_ | |
13 | ||
14 | #define V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS (V4L2_CID_MPEG_BASE+250) | |
15 | #define V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION (V4L2_CID_MPEG_BASE+251) | |
16 | ||
17 | /* enum v4l2_ctrl_type type values */ | |
18 | #define V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS 0x0103 | |
19 | #define V4L2_CTRL_TYPE_MPEG2_QUANTIZATION 0x0104 | |
20 | ||
21 | #define V4L2_MPEG2_PICTURE_CODING_TYPE_I 1 | |
22 | #define V4L2_MPEG2_PICTURE_CODING_TYPE_P 2 | |
23 | #define V4L2_MPEG2_PICTURE_CODING_TYPE_B 3 | |
24 | #define V4L2_MPEG2_PICTURE_CODING_TYPE_D 4 | |
25 | ||
26 | struct v4l2_mpeg2_sequence { | |
27 | /* ISO/IEC 13818-2, ITU-T Rec. H.262: Sequence header */ | |
28 | __u16 horizontal_size; | |
29 | __u16 vertical_size; | |
30 | __u32 vbv_buffer_size; | |
31 | ||
32 | /* ISO/IEC 13818-2, ITU-T Rec. H.262: Sequence extension */ | |
33 | __u8 profile_and_level_indication; | |
34 | __u8 progressive_sequence; | |
35 | __u8 chroma_format; | |
36 | __u8 pad; | |
37 | }; | |
38 | ||
39 | struct v4l2_mpeg2_picture { | |
40 | /* ISO/IEC 13818-2, ITU-T Rec. H.262: Picture header */ | |
41 | __u8 picture_coding_type; | |
42 | ||
43 | /* ISO/IEC 13818-2, ITU-T Rec. H.262: Picture coding extension */ | |
44 | __u8 f_code[2][2]; | |
45 | __u8 intra_dc_precision; | |
46 | __u8 picture_structure; | |
47 | __u8 top_field_first; | |
48 | __u8 frame_pred_frame_dct; | |
49 | __u8 concealment_motion_vectors; | |
50 | __u8 q_scale_type; | |
51 | __u8 intra_vlc_format; | |
52 | __u8 alternate_scan; | |
53 | __u8 repeat_first_field; | |
54 | __u8 progressive_frame; | |
55 | __u8 pad; | |
56 | }; | |
57 | ||
58 | struct v4l2_ctrl_mpeg2_slice_params { | |
59 | __u32 bit_size; | |
60 | __u32 data_bit_offset; | |
61 | ||
62 | struct v4l2_mpeg2_sequence sequence; | |
63 | struct v4l2_mpeg2_picture picture; | |
64 | ||
65 | /* ISO/IEC 13818-2, ITU-T Rec. H.262: Slice */ | |
66 | __u8 quantiser_scale_code; | |
67 | ||
68 | __u8 backward_ref_index; | |
69 | __u8 forward_ref_index; | |
70 | __u8 pad; | |
71 | }; | |
72 | ||
73 | struct v4l2_ctrl_mpeg2_quantization { | |
74 | /* ISO/IEC 13818-2, ITU-T Rec. H.262: Quant matrix extension */ | |
75 | __u8 load_intra_quantiser_matrix; | |
76 | __u8 load_non_intra_quantiser_matrix; | |
77 | __u8 load_chroma_intra_quantiser_matrix; | |
78 | __u8 load_chroma_non_intra_quantiser_matrix; | |
79 | ||
80 | __u8 intra_quantiser_matrix[64]; | |
81 | __u8 non_intra_quantiser_matrix[64]; | |
82 | __u8 chroma_intra_quantiser_matrix[64]; | |
83 | __u8 chroma_non_intra_quantiser_matrix[64]; | |
84 | }; | |
85 | ||
86 | #endif |