state_trackers/vdpau: Add support for VC-1 decoding
[mesa/nouveau-pmpeg.git] / src / gallium / include / pipe / p_video_state.h
blob1940bf12ba1c8a8fdaf6436b5a56f1aaabdcf02c
1 /**************************************************************************
3 * Copyright 2009 Younes Manton.
4 * All Rights Reserved.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
28 #ifndef PIPE_VIDEO_STATE_H
29 #define PIPE_VIDEO_STATE_H
31 #include "pipe/p_defines.h"
32 #include "pipe/p_format.h"
33 #include "pipe/p_state.h"
34 #include "pipe/p_screen.h"
35 #include "util/u_inlines.h"
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
41 struct pipe_video_rect
43 unsigned x, y, w, h;
47 * see table 6-12 in the spec
49 enum pipe_mpeg12_picture_coding_type
51 PIPE_MPEG12_PICTURE_CODING_TYPE_I = 0x01,
52 PIPE_MPEG12_PICTURE_CODING_TYPE_P = 0x02,
53 PIPE_MPEG12_PICTURE_CODING_TYPE_B = 0x03,
54 PIPE_MPEG12_PICTURE_CODING_TYPE_D = 0x04
58 * see table 6-14 in the spec
60 enum pipe_mpeg12_picture_structure
62 PIPE_MPEG12_PICTURE_STRUCTURE_RESERVED = 0x00,
63 PIPE_MPEG12_PICTURE_STRUCTURE_FIELD_TOP = 0x01,
64 PIPE_MPEG12_PICTURE_STRUCTURE_FIELD_BOTTOM = 0x02,
65 PIPE_MPEG12_PICTURE_STRUCTURE_FRAME = 0x03
69 * flags for macroblock_type, see section 6.3.17.1 in the spec
71 enum pipe_mpeg12_macroblock_type
73 PIPE_MPEG12_MB_TYPE_QUANT = 0x01,
74 PIPE_MPEG12_MB_TYPE_MOTION_FORWARD = 0x02,
75 PIPE_MPEG12_MB_TYPE_MOTION_BACKWARD = 0x04,
76 PIPE_MPEG12_MB_TYPE_PATTERN = 0x08,
77 PIPE_MPEG12_MB_TYPE_INTRA = 0x10
81 * flags for motion_type, see table 6-17 and 6-18 in the spec
83 enum pipe_mpeg12_motion_type
85 PIPE_MPEG12_MO_TYPE_RESERVED = 0x00,
86 PIPE_MPEG12_MO_TYPE_FIELD = 0x01,
87 PIPE_MPEG12_MO_TYPE_FRAME = 0x02,
88 PIPE_MPEG12_MO_TYPE_16x8 = 0x02,
89 PIPE_MPEG12_MO_TYPE_DUAL_PRIME = 0x03
93 * see section 6.3.17.1 and table 6-19 in the spec
95 enum pipe_mpeg12_dct_type
97 PIPE_MPEG12_DCT_TYPE_FRAME = 0,
98 PIPE_MPEG12_DCT_TYPE_FIELD = 1
101 enum pipe_mpeg12_field_select
103 PIPE_MPEG12_FS_FIRST_FORWARD = 0x01,
104 PIPE_MPEG12_FS_FIRST_BACKWARD = 0x02,
105 PIPE_MPEG12_FS_SECOND_FORWARD = 0x04,
106 PIPE_MPEG12_FS_SECOND_BACKWARD = 0x08
109 struct pipe_picture_desc
111 enum pipe_video_profile profile;
114 struct pipe_quant_matrix
116 enum pipe_video_codec codec;
119 struct pipe_macroblock
121 enum pipe_video_codec codec;
124 struct pipe_mpeg12_picture_desc
126 struct pipe_picture_desc base;
128 unsigned picture_coding_type;
129 unsigned picture_structure;
130 unsigned frame_pred_frame_dct;
131 unsigned q_scale_type;
132 unsigned alternate_scan;
133 unsigned intra_vlc_format;
134 unsigned concealment_motion_vectors;
135 unsigned intra_dc_precision;
136 unsigned f_code[2][2];
137 unsigned num_slices;
140 struct pipe_mpeg12_quant_matrix
142 struct pipe_quant_matrix base;
144 const uint8_t *intra_matrix;
145 const uint8_t *non_intra_matrix;
148 struct pipe_mpeg12_macroblock
150 struct pipe_macroblock base;
152 /* see section 6.3.17 in the spec */
153 unsigned short x, y;
155 /* see section 6.3.17.1 in the spec */
156 unsigned char macroblock_type;
158 union {
159 struct {
160 /* see table 6-17 in the spec */
161 unsigned int frame_motion_type:2;
163 /* see table 6-18 in the spec */
164 unsigned int field_motion_type:2;
166 /* see table 6-19 in the spec */
167 unsigned int dct_type:1;
168 } bits;
169 unsigned int value;
170 } macroblock_modes;
172 /* see section 6.3.17.2 in the spec */
173 unsigned char motion_vertical_field_select;
175 /* see Table 7-7 in the spec */
176 short PMV[2][2][2];
178 /* see figure 6.10-12 in the spec */
179 unsigned short coded_block_pattern;
181 /* see figure 6.10-12 in the spec */
182 short *blocks;
184 /* Number of skipped macroblocks after this macroblock */
185 unsigned short num_skipped_macroblocks;
188 struct pipe_mpeg4_picture_desc
190 struct pipe_picture_desc base;
191 int32_t trd[2];
192 int32_t trb[2];
193 uint16_t vop_time_increment_resolution;
194 uint8_t vop_coding_type;
195 uint8_t vop_fcode_forward;
196 uint8_t vop_fcode_backward;
197 uint8_t resync_marker_disable;
198 uint8_t interlaced;
199 uint8_t quant_type;
200 uint8_t quarter_sample;
201 uint8_t short_video_header;
202 uint8_t rounding_control;
203 uint8_t alternate_vertical_scan_flag;
204 uint8_t top_field_first;
207 struct pipe_mpeg4_quant_matrix
209 struct pipe_quant_matrix base;
211 const uint8_t *intra_matrix;
212 const uint8_t *non_intra_matrix;
215 struct pipe_vc1_picture_desc
217 struct pipe_picture_desc base;
218 uint32_t slice_count;
219 uint8_t picture_type;
220 uint8_t frame_coding_mode;
221 uint8_t postprocflag;
222 uint8_t pulldown;
223 uint8_t interlace;
224 uint8_t tfcntrflag;
225 uint8_t finterpflag;
226 uint8_t psf;
227 uint8_t dquant;
228 uint8_t panscan_flag;
229 uint8_t refdist_flag;
230 uint8_t quantizer;
231 uint8_t extended_mv;
232 uint8_t extended_dmv;
233 uint8_t overlap;
234 uint8_t vstransform;
235 uint8_t loopfilter;
236 uint8_t fastuvmc;
237 uint8_t range_mapy_flag;
238 uint8_t range_mapy;
239 uint8_t range_mapuv_flag;
240 uint8_t range_mapuv;
241 uint8_t multires;
242 uint8_t syncmarker;
243 uint8_t rangered;
244 uint8_t maxbframes;
245 uint8_t deblockEnable;
246 uint8_t pquant;
249 #ifdef __cplusplus
251 #endif
253 #endif /* PIPE_VIDEO_STATE_H */