3 |
* XVID MPEG-4 VIDEO CODEC |
* XVID MPEG-4 VIDEO CODEC |
4 |
* - XviD Main header file - |
* - XviD Main header file - |
5 |
* |
* |
6 |
|
* This file is part of XviD, a free MPEG-4 video encoder/decoder |
7 |
|
* |
8 |
* This program is free software ; you can redistribute it and/or modify |
* This program is free software ; you can redistribute it and/or modify |
9 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
10 |
* the Free Software Foundation ; either version 2 of the License, or |
* the Free Software Foundation ; either version 2 of the License, or |
19 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
|
*****************************************************************************/ |
|
|
/***************************************************************************** |
|
|
* |
|
|
* History |
|
|
* |
|
|
* - 2002/06/13 Added legal header, ANSI C comment style (only for this header |
|
|
* as it can be included in a ANSI C project). |
|
|
* |
|
|
* ToDo ? : when BFRAMES is defined, the API_VERSION should not |
|
|
* be the same (3.0 ?) |
|
|
* |
|
22 |
* $Id$ |
* $Id$ |
23 |
* |
* |
24 |
*****************************************************************************/ |
****************************************************************************/ |
|
|
|
25 |
|
|
26 |
#ifndef _XVID_H_ |
#ifndef _XVID_H_ |
27 |
#define _XVID_H_ |
#define _XVID_H_ |
34 |
* Global constants |
* Global constants |
35 |
****************************************************************************/ |
****************************************************************************/ |
36 |
|
|
37 |
/* API Version : 2.1 */ |
/* API Version : 3.0 */ |
38 |
#define API_VERSION ((2 << 16) | (1)) |
#define API_VERSION ((3 << 16) | (0)) |
39 |
|
#define XVID_API_UNSTABLE |
40 |
|
|
41 |
|
/* Bitstream Version |
42 |
|
* this will be writen into the bitstream to allow easy detection of xvid |
43 |
|
* encoder bugs in the decoder, without this it might not possible to |
44 |
|
* automatically distinquish between a file which has been encoded with an |
45 |
|
* old & buggy XVID from a file which has been encoded with a bugfree version |
46 |
|
* see the infamous interlacing bug ... |
47 |
|
* |
48 |
|
* this MUST be increased if an encoder bug is fixed, increasing it too often |
49 |
|
* doesnt hurt but not increasing it could cause difficulty for decoders in the |
50 |
|
* future |
51 |
|
*/ |
52 |
|
#define XVID_BS_VERSION "0012" |
53 |
|
|
54 |
|
|
55 |
/* Error codes */ |
/* Error codes */ |
60 |
|
|
61 |
|
|
62 |
/* Colorspaces */ |
/* Colorspaces */ |
63 |
#define XVID_CSP_RGB24 0 |
#define XVID_CSP_RGB24 0 /* [b|g|r] */ |
64 |
#define XVID_CSP_YV12 1 |
#define XVID_CSP_YV12 1 |
65 |
#define XVID_CSP_YUY2 2 |
#define XVID_CSP_YUY2 2 |
66 |
#define XVID_CSP_UYVY 3 |
#define XVID_CSP_UYVY 3 |
68 |
#define XVID_CSP_RGB555 10 |
#define XVID_CSP_RGB555 10 |
69 |
#define XVID_CSP_RGB565 11 |
#define XVID_CSP_RGB565 11 |
70 |
#define XVID_CSP_USER 12 |
#define XVID_CSP_USER 12 |
71 |
#define XVID_CSP_EXTERN 1004 // per slice rendering |
#define XVID_CSP_EXTERN 1004 /* per slice rendering */ |
72 |
#define XVID_CSP_YVYU 1002 |
#define XVID_CSP_YVYU 1002 |
73 |
#define XVID_CSP_RGB32 1000 |
#define XVID_CSP_RGB32 1000 /* [b|g|r|a] */ |
74 |
|
#define XVID_CSP_ABGR 1006 /* [a|b|g|r] */ |
75 |
|
#define XVID_CSP_RGBA 1005 /* [r|g|b|a] */ |
76 |
|
|
77 |
|
|
78 |
|
|
79 |
#define XVID_CSP_NULL 9999 |
#define XVID_CSP_NULL 9999 |
80 |
|
|
81 |
#define XVID_CSP_VFLIP 0x80000000 // flip mask |
#define XVID_CSP_VFLIP 0x80000000 /* flip mask */ |
82 |
|
|
83 |
|
|
84 |
/***************************************************************************** |
/***************************************************************************** |
86 |
****************************************************************************/ |
****************************************************************************/ |
87 |
|
|
88 |
/* CPU flags for XVID_INIT_PARAM.cpu_flags */ |
/* CPU flags for XVID_INIT_PARAM.cpu_flags */ |
89 |
|
#define XVID_CPU_FORCE 0x80000000 /* force passed cpu flags */ |
90 |
|
#define XVID_CPU_CHKONLY 0x40000000 /* check cpu only; dont init globals */ |
91 |
|
#define XVID_CPU_ASM 0x00000080 /* native assembly */ |
92 |
|
|
93 |
#define XVID_CPU_MMX 0x00000001 |
/* ARCH_IS_IA32 */ |
94 |
#define XVID_CPU_MMXEXT 0x00000002 |
#define XVID_CPU_MMX 0x00000001 /* mmx : pentiumMMX,k6 */ |
95 |
#define XVID_CPU_SSE 0x00000004 |
#define XVID_CPU_MMXEXT 0x00000002 /* mmx-ext : pentium2, athlon */ |
96 |
#define XVID_CPU_SSE2 0x00000008 |
#define XVID_CPU_SSE 0x00000004 /* sse : pentium3, athlonXP */ |
97 |
#define XVID_CPU_3DNOW 0x00000010 |
#define XVID_CPU_SSE2 0x00000008 /* sse2 : pentium4, athlon64 */ |
98 |
#define XVID_CPU_3DNOWEXT 0x00000020 |
#define XVID_CPU_3DNOW 0x00000010 /* 3dnow : k6-2 */ |
99 |
|
#define XVID_CPU_3DNOWEXT 0x00000020 /* 3dnow-ext: athlon */ |
100 |
|
#define XVID_CPU_TSC 0x00000040 /* timestamp counter */ |
101 |
|
|
102 |
#define XVID_CPU_TSC 0x00000040 |
/* ARCH_IS_IA64 */ |
103 |
|
#define XVID_CPU_IA64 XVID_CPU_ASM /* defined for backward compatibility */ |
104 |
|
|
105 |
#define XVID_CPU_IA64 0x00000080 |
/* ARCH_IS_PPC */ |
106 |
|
#define XVID_CPU_ALTIVEC 0x00000001 /* altivec */ |
107 |
|
|
|
#define XVID_CPU_CHKONLY 0x40000000 /* check cpu only; dont init globals */ |
|
|
#define XVID_CPU_FORCE 0x80000000 |
|
108 |
|
|
109 |
|
typedef struct |
110 |
|
{ |
111 |
|
int colorspace; |
112 |
|
void * y; |
113 |
|
void * u; |
114 |
|
void * v; |
115 |
|
int y_stride; |
116 |
|
int uv_stride; |
117 |
|
} XVID_IMAGE; /* from yv12 */ |
118 |
|
|
119 |
|
#define XVID_INIT_INIT 0 |
120 |
|
#define XVID_INIT_CONVERT 1 |
121 |
|
#define XVID_INIT_TEST 2 |
122 |
|
|
123 |
/***************************************************************************** |
/***************************************************************************** |
124 |
* Initialization structures |
* Initialization structures |
129 |
int cpu_flags; |
int cpu_flags; |
130 |
int api_version; |
int api_version; |
131 |
int core_build; |
int core_build; |
132 |
} |
} XVID_INIT_PARAM; |
133 |
XVID_INIT_PARAM; |
|
134 |
|
typedef struct |
135 |
|
{ |
136 |
|
XVID_IMAGE input; |
137 |
|
XVID_IMAGE output; |
138 |
|
int width; |
139 |
|
int height; |
140 |
|
int interlacing; |
141 |
|
} XVID_INIT_CONVERTINFO; |
142 |
|
|
143 |
/***************************************************************************** |
/***************************************************************************** |
144 |
* Initialization entry point |
* Initialization entry point |
155 |
****************************************************************************/ |
****************************************************************************/ |
156 |
|
|
157 |
/* Flags for XVID_DEC_FRAME.general */ |
/* Flags for XVID_DEC_FRAME.general */ |
158 |
|
#define XVID_DEC_LOWDELAY 0x00000001 /* decode lowdelay mode (ie. VFW) */ |
159 |
|
#define XVID_DEC_DEBLOCKY 0x00000002 /* luma deblocking */ |
160 |
|
#define XVID_DEC_DEBLOCKUV 0x00000008 /* chroma deblocking */ |
161 |
|
#define XVID_DEC_DISCONTINUITY 0x00000004 /* indicates break in stream |
162 |
|
instructs decoder to ignore any |
163 |
|
previous reference frames */ |
164 |
#define XVID_QUICK_DECODE 0x00000010 |
#define XVID_QUICK_DECODE 0x00000010 |
165 |
|
|
166 |
/***************************************************************************** |
/***************************************************************************** |
172 |
int width; |
int width; |
173 |
int height; |
int height; |
174 |
void *handle; |
void *handle; |
175 |
} |
} XVID_DEC_PARAM; |
176 |
XVID_DEC_PARAM; |
|
177 |
|
|
178 |
|
#define XVID_DEC_VOP 0 |
179 |
|
#define XVID_DEC_VOL 1 |
180 |
|
#define XVID_DEC_NOTHING 2 /* nothing was decoded */ |
181 |
|
|
182 |
|
typedef struct |
183 |
|
{ |
184 |
|
int notify; /* [out] output 'mode' */ |
185 |
|
union |
186 |
|
{ |
187 |
|
struct /* XVID_DEC_VOP */ |
188 |
|
{ |
189 |
|
int time_base; /* [out] time base */ |
190 |
|
int time_increment; /* [out] time increment */ |
191 |
|
} vop; |
192 |
|
struct /* XVID_DEC_VOL */ |
193 |
|
{ |
194 |
|
int general; /* [out] flags: eg. frames are interlaced */ |
195 |
|
int width; /* [out] width */ |
196 |
|
int height; /* [out] height */ |
197 |
|
int aspect_ratio; /* [out] aspect ratio */ |
198 |
|
int par_width; /* [out] aspect ratio width */ |
199 |
|
int par_height; /* [out] aspect ratio height */ |
200 |
|
} vol; |
201 |
|
} data; |
202 |
|
} XVID_DEC_STATS; |
203 |
|
|
204 |
|
|
205 |
typedef struct |
typedef struct |
211 |
void *image; |
void *image; |
212 |
int stride; |
int stride; |
213 |
int colorspace; |
int colorspace; |
214 |
} |
} XVID_DEC_FRAME; |
|
XVID_DEC_FRAME; |
|
215 |
|
|
216 |
|
|
217 |
// This struct is used for per slice rendering |
/* This struct is used for per slice rendering */ |
218 |
typedef struct |
typedef struct |
219 |
{ |
{ |
220 |
void *y,*u,*v; |
void *y,*u,*v; |
245 |
#define XVID_GLOBAL_PACKED 0x00000001 /* packed bitstream */ |
#define XVID_GLOBAL_PACKED 0x00000001 /* packed bitstream */ |
246 |
#define XVID_GLOBAL_DX50BVOP 0x00000002 /* dx50 bvop compatibility */ |
#define XVID_GLOBAL_DX50BVOP 0x00000002 /* dx50 bvop compatibility */ |
247 |
#define XVID_GLOBAL_DEBUG 0x00000004 /* print debug info on each frame */ |
#define XVID_GLOBAL_DEBUG 0x00000004 /* print debug info on each frame */ |
248 |
|
#define XVID_GLOBAL_REDUCED 0x04000000 /* reduced resolution vop enable */ |
249 |
|
|
250 |
|
#define XVID_GLOBAL_EXTRASTATS 0x00000200 /* generate extra statistics */ |
251 |
|
|
252 |
|
|
253 |
/* Flags for XVID_ENC_FRAME.general */ |
/* Flags for XVID_ENC_FRAME.general */ |
254 |
#define XVID_VALID_FLAGS 0x80000000 |
#define XVID_VALID_FLAGS 0x80000000 |
257 |
#define XVID_H263QUANT 0x00000010 |
#define XVID_H263QUANT 0x00000010 |
258 |
#define XVID_MPEGQUANT 0x00000020 |
#define XVID_MPEGQUANT 0x00000020 |
259 |
#define XVID_HALFPEL 0x00000040 /* use halfpel interpolation */ |
#define XVID_HALFPEL 0x00000040 /* use halfpel interpolation */ |
260 |
|
#define XVID_QUARTERPEL 0x02000000 |
261 |
#define XVID_ADAPTIVEQUANT 0x00000080 |
#define XVID_ADAPTIVEQUANT 0x00000080 |
262 |
#define XVID_LUMIMASKING 0x00000100 |
#define XVID_LUMIMASKING 0x00000100 |
|
#define XVID_LATEINTRA 0x00000200 |
|
263 |
|
|
264 |
#define XVID_INTERLACING 0x00000400 /* enable interlaced encoding */ |
#define XVID_INTERLACING 0x00000400 /* enable interlaced encoding */ |
265 |
#define XVID_TOPFIELDFIRST 0x00000800 /* set top-field-first flag */ |
#define XVID_TOPFIELDFIRST 0x00000800 /* set top-field-first flag */ |
276 |
#define XVID_ME_PMVFAST 0x00080000 |
#define XVID_ME_PMVFAST 0x00080000 |
277 |
#define XVID_ME_EPZS 0x00100000 |
#define XVID_ME_EPZS 0x00100000 |
278 |
|
|
279 |
|
#define XVID_CHROMAOPT 0x00200000 /* enable chroma optimization pre-filter */ |
280 |
|
|
281 |
|
#define XVID_GREYSCALE 0x01000000 /* enable greyscale only mode (even for |
282 |
|
color input material chroma is ignored) */ |
283 |
|
|
284 |
|
#define XVID_GMC 0x10000000 |
285 |
|
#define XVID_GMC_TRANSLATIONAL 0x20000000 |
286 |
|
|
287 |
#define XVID_GREYSCALE 0x01000000 /* enable greyscale only mode (even for */ |
#define XVID_REDUCED 0x04000000 /* reduced resolution vop */ |
288 |
#define XVID_GRAYSCALE 0x01000000 /* color input material chroma is ignored) */ |
#define XVID_HQACPRED 0x08000000 /* 20030209: high quality ac prediction */ |
289 |
|
|
290 |
|
#define XVID_EXTRASTATS 0x00000200 /* generate extra statistics */ |
291 |
|
|
292 |
|
#define XVID_MODEDECISION_BITS 0x00400000 /* enable DCT-ME and use it for mode decision */ |
293 |
|
|
294 |
|
|
295 |
/* Flags for XVID_ENC_FRAME.motion */ |
/* Flags for XVID_ENC_FRAME.motion */ |
296 |
#define PMV_ADVANCEDDIAMOND8 0x00004000 |
#define PMV_ADVANCEDDIAMOND16 0x00008000 /* use advdiamonds instead of diamonds as search pattern */ |
297 |
#define PMV_ADVANCEDDIAMOND16 0x00008000 |
#define PMV_USESQUARES16 0x00800000 /* use squares instead of diamonds as search pattern */ |
298 |
|
|
|
#define PMV_HALFPELDIAMOND16 0x00010000 |
|
299 |
#define PMV_HALFPELREFINE16 0x00020000 |
#define PMV_HALFPELREFINE16 0x00020000 |
300 |
#define PMV_EXTSEARCH16 0x00040000 /* extend PMV by more searches */ |
#define PMV_HALFPELREFINE8 0x02000000 |
301 |
#define PMV_EARLYSTOP16 0x00080000 |
|
302 |
#define PMV_QUICKSTOP16 0x00100000 /* like early, but without any more refinement */ |
#define PMV_QUARTERPELREFINE16 0x00040000 |
303 |
|
#define PMV_QUARTERPELREFINE8 0x04000000 |
304 |
|
|
305 |
|
#define PMV_EXTSEARCH16 0x00080000 /* extend PMV by more searches */ |
306 |
|
|
307 |
|
#define PMV_EXTSEARCH8 0x08000000 /* use diamond/square for extended 8x8 search */ |
308 |
|
#define PMV_ADVANCEDDIAMOND8 0x00004000 /* use advdiamond for PMV_EXTSEARCH8 */ |
309 |
|
#define PMV_USESQUARES8 0x80000000 /* use square for PMV_EXTSEARCH8 */ |
310 |
|
|
311 |
|
#define PMV_CHROMA16 0x00100000 /* also use chroma for P_VOP/S_VOP ME */ |
312 |
|
#define PMV_CHROMA8 0x10000000 /* also use chroma for B_VOP ME */ |
313 |
|
|
314 |
|
/* Motion search using DCT. use XVID_MODEDECISION_BITS to enable */ |
315 |
|
#define HALFPELREFINE16_BITS 0x00000100 /* perform DCT-based halfpel refinement */ |
316 |
|
#define HALFPELREFINE8_BITS 0x00000200 /* perform DCT-based halfpel refinement for 8x8 mode */ |
317 |
|
#define QUARTERPELREFINE16_BITS 0x00000400 /* perform DCT-based qpel refinement */ |
318 |
|
#define QUARTERPELREFINE8_BITS 0x00000800 /* perform DCT-based qpel refinement for 8x8 mode */ |
319 |
|
|
320 |
|
#define EXTSEARCH_BITS 0x00001000 /* perform DCT-based search using square pattern |
321 |
|
enable PMV_EXTSEARCH8 to do this in 8x8 search as well */ |
322 |
|
#define CHECKPREDICTION_BITS 0x00002000 /* always check vector equal to prediction */ |
323 |
|
|
324 |
|
|
325 |
|
/* note: old and deprecated - or never implemented */ |
326 |
|
|
327 |
|
/* only for compatability with old encoders */ |
328 |
|
|
329 |
|
#define PMV_EARLYSTOP16 0x00 |
330 |
|
#define PMV_EARLYSTOP8 0x00 |
331 |
|
#define PMV_QUICKSTOP16 0x00 |
332 |
|
#define PMV_QUICKSTOP8 0x00 |
333 |
|
|
334 |
|
#define PMV_HALFPELDIAMOND16 0x00 |
335 |
|
#define PMV_HALFPELDIAMOND8 0x00 |
336 |
|
|
337 |
#define PMV_UNRESTRICTED16 0x00200000 /* unrestricted ME, not implemented */ |
#define PMV_UNRESTRICTED16 0x00200000 /* unrestricted ME, not implemented */ |
338 |
#define PMV_OVERLAPPING16 0x00400000 /* overlapping ME, not implemented */ |
#define PMV_OVERLAPPING16 0x00400000 /* overlapping ME, not implemented */ |
|
#define PMV_USESQUARES16 0x00800000 |
|
|
|
|
|
#define PMV_HALFPELDIAMOND8 0x01000000 |
|
|
#define PMV_HALFPELREFINE8 0x02000000 |
|
|
#define PMV_EXTSEARCH8 0x04000000 /* extend PMV by more searches */ |
|
|
#define PMV_EARLYSTOP8 0x08000000 |
|
|
#define PMV_QUICKSTOP8 0x10000000 /* like early, but without any more refinement */ |
|
339 |
#define PMV_UNRESTRICTED8 0x20000000 /* unrestricted ME, not implemented */ |
#define PMV_UNRESTRICTED8 0x20000000 /* unrestricted ME, not implemented */ |
340 |
#define PMV_OVERLAPPING8 0x40000000 /* overlapping ME, not implemented */ |
#define PMV_OVERLAPPING8 0x40000000 /* overlapping ME, not implemented */ |
341 |
#define PMV_USESQUARES8 0x80000000 |
|
342 |
|
#define XVID_ME_COLOUR 0x00 /* this has been converted to PMV_CHROMA[16/8] */ |
343 |
|
|
344 |
|
|
345 |
/***************************************************************************** |
/***************************************************************************** |
349 |
typedef struct |
typedef struct |
350 |
{ |
{ |
351 |
int width, height; |
int width, height; |
352 |
int fincr, fbase; /* frame increment, fbase. each frame = "fincr/fbase" seconds */ |
int fincr, fbase; /* [in] frame increment, fbase. each frame = "fincr/fbase" seconds */ |
353 |
int rc_bitrate; /* the bitrate of the target encoded stream, in bits/second */ |
int rc_bitrate; /* [in] the bitrate of the target encoded stream, in bits/second */ |
354 |
int rc_reaction_delay_factor; /* how fast the rate control reacts - lower values are faster */ |
int rc_reaction_delay_factor; /* [in] how fast the rate control reacts - lower values are faster */ |
355 |
int rc_averaging_period; /* as above */ |
int rc_averaging_period; /* [in] as above */ |
356 |
int rc_buffer; /* as above */ |
int rc_buffer; /* [in] as above */ |
357 |
int max_quantizer; /* the upper limit of the quantizer */ |
int max_quantizer; /* [in] the upper limit of the quantizer */ |
358 |
int min_quantizer; /* the lower limit of the quantizer */ |
int min_quantizer; /* [in] the lower limit of the quantizer */ |
359 |
int max_key_interval; /* the maximum interval between key frames */ |
int max_key_interval; /* [in] the maximum interval between key frames */ |
360 |
#ifdef _SMP |
#ifdef _SMP |
361 |
int num_threads; /* number of threads */ |
int num_threads; /* [in] number of threads */ |
362 |
#endif |
#endif |
363 |
#ifdef BFRAMES |
int global; /* [in] global/debug options */ |
364 |
int global; /* global/debug options */ |
int max_bframes; /* [in] max sequential bframes (0=disable bframes) */ |
365 |
int max_bframes; /* max sequential bframes (0=disable bframes) */ |
int bquant_ratio; /* [in] bframe quantizer multipier (percentage). |
366 |
int bquant_ratio; /* bframe quantizer multipier (percentage). |
used only when bquant < 1 |
367 |
* used only when bquant < 1 |
eg. 200 = x2 multiplier |
368 |
* eg. 200 = x2 multiplier |
quant = ((past_quant + future_quant) * bquant_ratio)/200 |
|
* quant = ((past_quant + future_quant) * bquant_ratio)/200 |
|
369 |
*/ |
*/ |
370 |
int frame_drop_ratio; /* frame dropping: 0=drop none... 100=drop all */ |
int bquant_offset; /* [in] bquant += bquant_offset */ |
371 |
#endif |
int frame_drop_ratio; /* [in] frame dropping: 0=drop none... 100=drop all */ |
372 |
void *handle; /* [out] encoder instance handle */ |
void *handle; /* [out] encoder instance handle */ |
373 |
} |
} XVID_ENC_PARAM; |
|
XVID_ENC_PARAM; |
|
374 |
|
|
375 |
typedef struct |
typedef struct |
376 |
{ |
{ |
377 |
int x; |
int x; |
378 |
int y; |
int y; |
379 |
} |
} VECTOR; |
|
VECTOR; |
|
380 |
|
|
381 |
typedef struct |
typedef struct |
382 |
{ |
{ |
383 |
int mode; /* macroblock mode */ |
int mode; /* macroblock mode */ |
384 |
VECTOR mvs[4]; |
VECTOR mvs[4]; |
385 |
} |
} MVBLOCKHINT; |
|
MVBLOCKHINT; |
|
386 |
|
|
387 |
typedef struct |
typedef struct |
388 |
{ |
{ |
389 |
int intra; /* frame intra choice */ |
int intra; /* frame intra choice */ |
390 |
int fcode; /* frame fcode */ |
int fcode; /* frame fcode */ |
391 |
MVBLOCKHINT *block; /* caller-allocated array of block hints (mb_width * mb_height) */ |
MVBLOCKHINT *block; /* caller-allocated array of block hints (mb_width * mb_height) */ |
392 |
} |
} MVFRAMEHINT; |
|
MVFRAMEHINT; |
|
393 |
|
|
394 |
typedef struct |
typedef struct |
395 |
{ |
{ |
398 |
MVFRAMEHINT mvhint; |
MVFRAMEHINT mvhint; |
399 |
void *hintstream; /* compressed hint buffer */ |
void *hintstream; /* compressed hint buffer */ |
400 |
int hintlength; /* length of buffer (bytes) */ |
int hintlength; /* length of buffer (bytes) */ |
401 |
} |
} HINTINFO; |
|
HINTINFO; |
|
402 |
|
|
403 |
typedef struct |
typedef struct |
404 |
{ |
{ |
408 |
int length; /* [out] bitstream length (bytes) */ |
int length; /* [out] bitstream length (bytes) */ |
409 |
|
|
410 |
void *image; /* [in] image ptr */ |
void *image; /* [in] image ptr */ |
411 |
|
int stride; /* [in] horizontal stride in bytes */ |
412 |
int colorspace; /* [in] source colorspace */ |
int colorspace; /* [in] source colorspace */ |
413 |
|
|
414 |
unsigned char *quant_intra_matrix; // [in] custom intra qmatrix */ |
unsigned char *quant_intra_matrix; /* [in] custom intra qmatrix */ |
415 |
unsigned char *quant_inter_matrix; // [in] custom inter qmatrix */ |
unsigned char *quant_inter_matrix; /* [in] custom inter qmatrix */ |
416 |
int quant; /* [in] frame quantizer (vbr) */ |
int quant; /* [in] frame quantizer (vbr) */ |
417 |
int intra; /* [in] force intra frame (vbr only) |
int intra; /* [in] force intra frame (vbr only) |
418 |
* [out] intra state |
[out] frame type (ugly atm) |
419 |
*/ |
*/ |
420 |
HINTINFO hint; /* [in/out] mv hint information */ |
HINTINFO hint; /* [in/out] mv hint information */ |
421 |
|
|
|
#ifdef BFRAMES |
|
422 |
int bquant; /* [in] bframe quantizer */ |
int bquant; /* [in] bframe quantizer */ |
423 |
#endif |
int bframe_threshold; /* [in] sensitivity of B-frame decision */ |
424 |
|
|
425 |
} |
} XVID_ENC_FRAME; |
|
XVID_ENC_FRAME; |
|
426 |
|
|
427 |
|
|
428 |
typedef struct |
typedef struct |
429 |
{ |
{ |
430 |
int quant; /* [out] frame quantizer */ |
int quant; /* [out] frame quantizer */ |
431 |
int hlength; /* [out] header length (bytes) */ |
int hlength; /* [out] header length (bytes) */ |
432 |
int kblks, mblks, ublks; /* [out] */ |
int kblks; /* [out] number of intra blocks */ |
433 |
|
int mblks; /* [out] number of inter blocks */ |
434 |
} |
int ublks; /* [out] number of "not coded" blocks */ |
435 |
XVID_ENC_STATS; |
long sse_y; /* [out] SSE of Y */ |
436 |
|
long sse_u; /* [out] SSE of Cb */ |
437 |
|
long sse_v; /* [out] SSE of Cr */ |
438 |
|
} XVID_ENC_STATS; |
439 |
|
|
440 |
|
|
441 |
/***************************************************************************** |
/***************************************************************************** |