[g3dvl] make mv weights a public interface
[mesa.git] / src / gallium / include / pipe / p_video_state.h
1 /**************************************************************************
2 *
3 * Copyright 2009 Younes Manton.
4 * All Rights Reserved.
5 *
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:
13 *
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.
17 *
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.
25 *
26 **************************************************************************/
27
28 #ifndef PIPE_VIDEO_STATE_H
29 #define PIPE_VIDEO_STATE_H
30
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>
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 struct pipe_video_rect
42 {
43 unsigned x, y, w, h;
44 };
45
46 enum pipe_mpeg12_picture_type
47 {
48 PIPE_MPEG12_PICTURE_TYPE_FIELD_TOP,
49 PIPE_MPEG12_PICTURE_TYPE_FIELD_BOTTOM,
50 PIPE_MPEG12_PICTURE_TYPE_FRAME
51 };
52
53 enum pipe_mpeg12_motion_type
54 {
55 PIPE_MPEG12_MOTION_TYPE_FIELD,
56 PIPE_MPEG12_MOTION_TYPE_FRAME,
57 PIPE_MPEG12_MOTION_TYPE_DUALPRIME,
58 PIPE_MPEG12_MOTION_TYPE_16x8
59 };
60
61 enum pipe_mpeg12_dct_type
62 {
63 PIPE_MPEG12_DCT_TYPE_FIELD,
64 PIPE_MPEG12_DCT_TYPE_FRAME
65 };
66
67 struct pipe_macroblock
68 {
69 enum pipe_video_codec codec;
70 };
71
72 struct pipe_mpeg12_motionvector
73 {
74 signed x, y;
75 bool field_select;
76 };
77
78 struct pipe_mpeg12_macroblock
79 {
80 struct pipe_macroblock base;
81
82 unsigned mbx;
83 unsigned mby;
84 enum pipe_mpeg12_motion_type mo_type;
85 bool dct_intra;
86 enum pipe_mpeg12_dct_type dct_type;
87 struct {
88 unsigned wheight:8;
89 struct pipe_mpeg12_motionvector top, bottom;
90 } mv[2];
91 unsigned cbp;
92 short *blocks;
93 };
94
95 #if 0
96 struct pipe_picture_desc
97 {
98 enum pipe_video_format format;
99 };
100
101 struct pipe_mpeg12_picture_desc
102 {
103 struct pipe_picture_desc base;
104
105 /* TODO: Use bitfields where possible? */
106 struct pipe_surface *forward_reference;
107 struct pipe_surface *backward_reference;
108 unsigned picture_coding_type;
109 unsigned fcode;
110 unsigned intra_dc_precision;
111 unsigned picture_structure;
112 unsigned top_field_first;
113 unsigned frame_pred_frame_dct;
114 unsigned concealment_motion_vectors;
115 unsigned q_scale_type;
116 unsigned intra_vlc_format;
117 unsigned alternate_scan;
118 unsigned full_pel_forward_vector;
119 unsigned full_pel_backward_vector;
120 struct pipe_buffer *intra_quantizer_matrix;
121 struct pipe_buffer *non_intra_quantizer_matrix;
122 struct pipe_buffer *chroma_intra_quantizer_matrix;
123 struct pipe_buffer *chroma_non_intra_quantizer_matrix;
124 };
125 #endif
126
127 #ifdef __cplusplus
128 }
129 #endif
130
131 #endif /* PIPE_VIDEO_STATE_H */