[svn] / trunk / vfw / src / xvid.h Repository:
ViewVC logotype

Annotation of /trunk/vfw/src/xvid.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 121 - (view) (download)

1 : Isibaar 3 #ifndef _XVID_H_
2 :     #define _XVID_H_
3 :    
4 :     #ifdef __cplusplus
5 :     extern "C" {
6 :     #endif
7 :    
8 :     // ==========================================
9 :     // global
10 :     // ==========================================
11 :    
12 :     // API Version: 2.0
13 :     #define API_VERSION ((2 << 16) | (0))
14 :    
15 :     // cpu features
16 :     #define XVID_CPU_MMX 0x00000001
17 :     #define XVID_CPU_MMXEXT 0x00000002
18 :     #define XVID_CPU_SSE 0x00000004
19 :     #define XVID_CPU_SSE2 0x00000008
20 :     #define XVID_CPU_3DNOW 0x00000010
21 :     #define XVID_CPU_3DNOWEXT 0x00000020
22 :     #define XVID_CPU_TSC 0x00000040
23 :     #define XVID_CPU_FORCE 0x80000000
24 :    
25 :     // colorspaces
26 :     #define XVID_CSP_RGB24 0
27 :     #define XVID_CSP_YV12 1
28 :     #define XVID_CSP_YUY2 2
29 :     #define XVID_CSP_UYVY 3
30 :     #define XVID_CSP_I420 4
31 :     #define XVID_CSP_RGB555 10
32 :     #define XVID_CSP_RGB565 11
33 :     #define XVID_CSP_USER 12
34 :     #define XVID_CSP_YVYU 1002
35 :     #define XVID_CSP_RGB32 1000
36 :     #define XVID_CSP_NULL 9999
37 :    
38 :     #define XVID_CSP_VFLIP 0x80000000 // flip mask
39 :    
40 :     // error
41 :     #define XVID_ERR_FAIL -1
42 :     #define XVID_ERR_OK 0
43 :     #define XVID_ERR_MEMORY 1
44 :     #define XVID_ERR_FORMAT 2
45 :    
46 :     typedef struct
47 :     {
48 :     int cpu_flags;
49 :     int api_version;
50 :     int core_build;
51 :     } XVID_INIT_PARAM;
52 :    
53 :     int xvid_init(void *handle, int opt,
54 :     void *param1, void *param2);
55 :    
56 :    
57 :     // ==========================================
58 :     // decoder
59 :     // ==========================================
60 :    
61 :     #define XVID_QUICK_DECODE 0x00000010 /* increases decoding speed but reduces quality */
62 :    
63 :     typedef struct
64 :     {
65 :     int width;
66 :     int height;
67 :     void *handle;
68 :     } XVID_DEC_PARAM;
69 :    
70 :    
71 :     typedef struct
72 :     {
73 :     int general;
74 :     void * bitstream;
75 :     int length;
76 :    
77 :     void * image;
78 :     int stride;
79 :     int colorspace;
80 :     } XVID_DEC_FRAME;
81 :    
82 :    
83 :     // decoder options
84 :     #define XVID_DEC_DECODE 0
85 :     #define XVID_DEC_CREATE 1
86 :     #define XVID_DEC_DESTROY 2
87 :    
88 :     int xvid_decore(void * handle,
89 :     int opt,
90 :     void * param1,
91 :     void * param2);
92 :    
93 :    
94 :     // ==========================================
95 :     // encoder
96 :     // ==========================================
97 :    
98 :     /* Do not rely on the VALUES of these constants, they may be changed at any time */
99 :     #define XVID_VALID_FLAGS 0x80000000
100 :    
101 :     #define XVID_CUSTOM_QMATRIX 0x00000004 /* use custom quant matrix */
102 :     #define XVID_H263QUANT 0x00000010
103 :     #define XVID_MPEGQUANT 0x00000020
104 :     #define XVID_HALFPEL 0x00000040 /* use halfpel interpolation */
105 :     #define XVID_ADAPTIVEQUANT 0x00000080
106 :     #define XVID_LUMIMASKING 0x00000100
107 : h 102 #define XVID_LATEINTRA 0x00000200
108 : Isibaar 3
109 : h 102 #define XVID_INTERLACING 0x00000400 /* enable interlaced encoding */
110 :     #define XVID_TOPFIELDFIRST 0x00000800 /* set top-field-first flag (cosmetic only) */
111 :     #define XVID_ALTERNATESCAN 0x00001000 /* ?? sets alternate vertical scan flag */
112 : Isibaar 3
113 : h 102 #define XVID_HINTEDME_GET 0x00002000 /* receive mv hint data from core (1st pass) */
114 :     #define XVID_HINTEDME_SET 0x00004000 /* send mv hint data to core (2nd pass) */
115 : Isibaar 3
116 : h 102 #define XVID_INTER4V 0x00008000
117 :    
118 :     #define XVID_ME_ZERO 0x00010000
119 :     #define XVID_ME_LOGARITHMIC 0x00020000
120 :     #define XVID_ME_FULLSEARCH 0x00040000
121 :     #define XVID_ME_PMVFAST 0x00080000
122 :     #define XVID_ME_EPZS 0x00100000
123 :    
124 : Isibaar 3 #define PMV_HALFPELDIAMOND16 0x00010000
125 :     #define PMV_HALFPELREFINE16 0x00020000
126 :     #define PMV_EXTSEARCH16 0x00040000 /* extend PMV by more searches */
127 :     #define PMV_EARLYSTOP16 0x00080000
128 :     #define PMV_QUICKSTOP16 0x00100000 /* like early, but without any more refinement */
129 :     #define PMV_UNRESTRICTED16 0x00200000 /* unrestricted ME, not implemented */
130 :     #define PMV_OVERLAPPING16 0x00400000 /* overlapping ME, not implemented */
131 : h 102 #define PMV_USESQUARES16 0x00800000
132 : Isibaar 3
133 :     #define PMV_HALFPELDIAMOND8 0x01000000
134 :     #define PMV_HALFPELREFINE8 0x02000000
135 :     #define PMV_EXTSEARCH8 0x04000000 /* extend PMV by more searches */
136 :     #define PMV_EARLYSTOP8 0x08000000
137 :     #define PMV_QUICKSTOP8 0x10000000 /* like early, but without any more refinement */
138 :     #define PMV_UNRESTRICTED8 0x20000000 /* unrestricted ME, not implemented */
139 :     #define PMV_OVERLAPPING8 0x40000000 /* overlapping ME, not implemented */
140 : h 102 #define PMV_USESQUARES8 0x80000000
141 : Isibaar 3
142 : h 102
143 : Isibaar 3 typedef struct
144 :     {
145 :     int width, height;
146 :     int fincr, fbase; // frame increment, fbase. each frame = "fincr/fbase" seconds
147 : h 121 int rc_bitrate; // the bitrate of the target encoded stream, in bits/second
148 :     int rc_reaction_delay_factor; // how fast the rate control reacts - lower values are faster
149 :     int rc_averaging_period; // as above
150 :     int rc_buffer; // as above
151 : Isibaar 3 int max_quantizer; // the upper limit of the quantizer
152 :     int min_quantizer; // the lower limit of the quantizer
153 :     int max_key_interval; // the maximum interval between key frames
154 :    
155 :     void * handle; // [out] encoder instance handle
156 :    
157 :     } XVID_ENC_PARAM;
158 :    
159 :    
160 :     typedef struct
161 :     {
162 : h 102 int x;
163 :     int y;
164 :     } VECTOR;
165 :    
166 :     typedef struct
167 :     {
168 :     int mode; // macroblock mode
169 :     VECTOR mvs[4];
170 :     } MVBLOCKHINT;
171 :    
172 :     typedef struct
173 :     {
174 :     int intra; // frame intra choice
175 :     int fcode; // frame fcode
176 :     MVBLOCKHINT * block; // caller-allocated array of block hints (mb_width * mb_height)
177 :     } MVFRAMEHINT;
178 :    
179 :     typedef struct
180 :     {
181 :     int rawhints; // if set, use MVFRAMEHINT, else use compressed buffer
182 :    
183 :     MVFRAMEHINT mvhint;
184 :     void * hintstream; // compressed hint buffer
185 :     int hintlength; // length of buffer (bytes)
186 :     } HINTINFO;
187 :    
188 :     typedef struct
189 :     {
190 : Isibaar 3 int general; // [in] general options
191 :     int motion; // [in] ME options
192 :     void * bitstream; // [in] bitstream ptr
193 :     int length; // [out] bitstream length (bytes)
194 :    
195 :     void * image; // [in] image ptr
196 :     int colorspace; // [in] source colorspace
197 :    
198 :     unsigned char *quant_intra_matrix; // [in] custom intra qmatrix
199 :     unsigned char *quant_inter_matrix; // [in] custom inter qmatrix
200 :     int quant; // [in] frame quantizer (vbr)
201 :     int intra; // [in] force intra frame (vbr only)
202 :     // [out] intra state
203 : h 102 HINTINFO hint; // [in/out] mv hint information
204 : Isibaar 3 } XVID_ENC_FRAME;
205 :    
206 :    
207 :     typedef struct
208 :     {
209 :     int quant; // [out] frame quantizer
210 :     int hlength; // [out] header length (bytes)
211 :     int kblks, mblks, ublks; // [out]
212 :    
213 :     } XVID_ENC_STATS;
214 :    
215 :    
216 :     #define XVID_ENC_ENCODE 0
217 :     #define XVID_ENC_CREATE 1
218 :     #define XVID_ENC_DESTROY 2
219 :    
220 :     int xvid_encore(void * handle,
221 :     int opt,
222 :     void * param1,
223 :     void * param2);
224 :    
225 :    
226 :     #ifdef __cplusplus
227 :     }
228 :     #endif
229 :    
230 :     #endif /* _XVID_H_ */

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4