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_surface
43 struct pipe_reference reference
;
44 struct pipe_screen
*screen
;
45 enum pipe_video_chroma_format chroma_format
;
46 /*enum pipe_video_surface_format surface_format;*/
52 pipe_video_surface_reference(struct pipe_video_surface
**ptr
, struct pipe_video_surface
*surf
)
54 struct pipe_video_surface
*old_surf
= *ptr
;
56 if (pipe_reference(&(*ptr
)->reference
, &surf
->reference
))
57 old_surf
->screen
->video_surface_destroy(old_surf
);
61 struct pipe_video_rect
66 enum pipe_mpeg12_picture_type
68 PIPE_MPEG12_PICTURE_TYPE_FIELD_TOP
,
69 PIPE_MPEG12_PICTURE_TYPE_FIELD_BOTTOM
,
70 PIPE_MPEG12_PICTURE_TYPE_FRAME
73 enum pipe_mpeg12_macroblock_type
75 PIPE_MPEG12_MACROBLOCK_TYPE_INTRA
,
76 PIPE_MPEG12_MACROBLOCK_TYPE_FWD
,
77 PIPE_MPEG12_MACROBLOCK_TYPE_BKWD
,
78 PIPE_MPEG12_MACROBLOCK_TYPE_BI
,
80 PIPE_MPEG12_MACROBLOCK_NUM_TYPES
83 enum pipe_mpeg12_motion_type
85 PIPE_MPEG12_MOTION_TYPE_FIELD
,
86 PIPE_MPEG12_MOTION_TYPE_FRAME
,
87 PIPE_MPEG12_MOTION_TYPE_DUALPRIME
,
88 PIPE_MPEG12_MOTION_TYPE_16x8
91 enum pipe_mpeg12_dct_type
93 PIPE_MPEG12_DCT_TYPE_FIELD
,
94 PIPE_MPEG12_DCT_TYPE_FRAME
97 struct pipe_macroblock
99 enum pipe_video_codec codec
;
102 struct pipe_mpeg12_macroblock
104 struct pipe_macroblock base
;
108 enum pipe_mpeg12_macroblock_type mb_type
;
109 enum pipe_mpeg12_motion_type mo_type
;
110 enum pipe_mpeg12_dct_type dct_type
;
113 struct pipe_buffer
*blocks
;
117 struct pipe_picture_desc
119 enum pipe_video_format format
;
122 struct pipe_mpeg12_picture_desc
124 struct pipe_picture_desc base
;
126 /* TODO: Use bitfields where possible? */
127 struct pipe_surface
*forward_reference
;
128 struct pipe_surface
*backward_reference
;
129 unsigned picture_coding_type
;
131 unsigned intra_dc_precision
;
132 unsigned picture_structure
;
133 unsigned top_field_first
;
134 unsigned frame_pred_frame_dct
;
135 unsigned concealment_motion_vectors
;
136 unsigned q_scale_type
;
137 unsigned intra_vlc_format
;
138 unsigned alternate_scan
;
139 unsigned full_pel_forward_vector
;
140 unsigned full_pel_backward_vector
;
141 struct pipe_buffer
*intra_quantizer_matrix
;
142 struct pipe_buffer
*non_intra_quantizer_matrix
;
143 struct pipe_buffer
*chroma_intra_quantizer_matrix
;
144 struct pipe_buffer
*chroma_non_intra_quantizer_matrix
;
152 #endif /* PIPE_VIDEO_STATE_H */