1 /**************************************************************************
3 * Copyright 2009 Younes Manton.
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
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>
41 struct pipe_video_rect
46 enum pipe_mpeg12_picture_type
48 PIPE_MPEG12_PICTURE_TYPE_FIELD_TOP
,
49 PIPE_MPEG12_PICTURE_TYPE_FIELD_BOTTOM
,
50 PIPE_MPEG12_PICTURE_TYPE_FRAME
54 * flags for macroblock_type, see section 6.3.17.1 in the spec
56 enum pipe_mpeg12_macroblock_type
58 PIPE_MPEG12_MB_TYPE_QUANT
= 0x01,
59 PIPE_MPEG12_MB_TYPE_MOTION_FORWARD
= 0x02,
60 PIPE_MPEG12_MB_TYPE_MOTION_BACKWARD
= 0x04,
61 PIPE_MPEG12_MB_TYPE_PATTERN
= 0x08,
62 PIPE_MPEG12_MB_TYPE_INTRA
= 0x10
66 * flags for motion_type, see table 6-17 and 6-18 in the spec
68 enum pipe_mpeg12_motion_type
70 PIPE_MPEG12_MO_TYPE_RESERVED
= 0x00,
71 PIPE_MPEG12_MO_TYPE_FIELD
= 0x01,
72 PIPE_MPEG12_MO_TYPE_FRAME
= 0x02,
73 PIPE_MPEG12_MO_TYPE_16x8
= 0x02,
74 PIPE_MPEG12_MO_TYPE_DUAL_PRIME
= 0x03
78 * see section 6.3.17.1 and table 6-19 in the spec
80 enum pipe_mpeg12_dct_type
82 PIPE_MPEG12_DCT_TYPE_FRAME
= 0,
83 PIPE_MPEG12_DCT_TYPE_FIELD
= 1
86 enum pipe_mpeg12_field_select
88 PIPE_MPEG12_FS_FIRST_FORWARD
= 0x01,
89 PIPE_MPEG12_FS_FIRST_BACKWARD
= 0x02,
90 PIPE_MPEG12_FS_SECOND_FORWARD
= 0x04,
91 PIPE_MPEG12_FS_SECOND_BACKWARD
= 0x08
94 struct pipe_picture_desc
96 enum pipe_video_profile profile
;
99 struct pipe_macroblock
101 enum pipe_video_codec codec
;
104 struct pipe_mpeg12_picture_desc
106 struct pipe_picture_desc base
;
108 unsigned picture_coding_type
;
109 unsigned picture_structure
;
110 unsigned frame_pred_frame_dct
;
111 unsigned q_scale_type
;
112 unsigned alternate_scan
;
113 unsigned intra_vlc_format
;
114 unsigned concealment_motion_vectors
;
115 unsigned f_code
[2][2];
118 struct pipe_mpeg12_macroblock
120 struct pipe_macroblock base
;
122 /* see section 6.3.17 in the spec */
125 /* see section 6.3.17.1 in the spec */
126 unsigned char macroblock_type
;
130 /* see table 6-17 in the spec */
131 unsigned int frame_motion_type
:2;
133 /* see table 6-18 in the spec */
134 unsigned int field_motion_type
:2;
136 /* see table 6-19 in the spec */
137 unsigned int dct_type
:1;
142 /* see section 6.3.17.2 in the spec */
143 unsigned char motion_vertical_field_select
;
145 /* see Table 7-7 in the spec */
148 /* see figure 6.10-12 in the spec */
149 unsigned short coded_block_pattern
;
151 /* see figure 6.10-12 in the spec */
154 /* Number of skipped macroblocks after this macroblock */
155 unsigned short num_skipped_macroblocks
;
162 #endif /* PIPE_VIDEO_STATE_H */