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 |
* |
* |
22 |
* $Id: xvid.h,v 1.27.2.1 2003-02-22 08:49:44 suxen_drol Exp $ |
* $Id: xvid.h,v 1.27.2.7 2003-03-15 16:04:38 suxen_drol Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
26 |
#ifndef _XVID_H_ |
#ifndef _XVID_H_ |
27 |
#define _XVID_H_ |
#define _XVID_H_ |
28 |
|
|
29 |
|
|
30 |
#ifdef __cplusplus |
#ifdef __cplusplus |
31 |
extern "C" { |
extern "C" { |
32 |
#endif |
#endif |
255 |
} xvid_dec_stats_t; |
} xvid_dec_stats_t; |
256 |
|
|
257 |
|
|
258 |
|
/***************************************************************************** |
259 |
|
xvid plugin system -- internals |
260 |
|
|
261 |
|
xvidcore will call XVID_PLG_INFO and XVID_PLG_CREATE during XVID_ENC_CREATE |
262 |
|
before encoding each frame xvidcore will call XVID_PLG_BEFORE |
263 |
|
after encoding each frame xvidcore will call XVID_PLG_AFTER |
264 |
|
xvidcore will call XVID_PLG_DESTROY during XVID_ENC_DESTROY |
265 |
|
****************************************************************************/ |
266 |
|
|
267 |
|
#define XVID_PLG_CREATE 0 |
268 |
|
#define XVID_PLG_DESTROY 1 |
269 |
|
#define XVID_PLG_INFO 2 |
270 |
|
#define XVID_PLG_BEFORE 3 |
271 |
|
#define XVID_PLG_AFTER 4 |
272 |
|
|
273 |
|
/* xvid_plg_info_t.flags */ |
274 |
|
#define XVID_REQORIGINAL 1 /* plugin requires a copy of the original (uncompressed) image */ |
275 |
|
#define XVID_REQPSNR 2 /* plugin requires psnr between the uncompressed and compressed image*/ |
276 |
|
|
277 |
|
|
278 |
|
typedef struct |
279 |
|
{ |
280 |
|
int version; |
281 |
|
int flags; /* plugin flags */ |
282 |
|
} xvid_plg_info_t; |
283 |
|
|
284 |
|
|
285 |
|
typedef struct |
286 |
|
{ |
287 |
|
int version; |
288 |
|
|
289 |
|
int width, height; |
290 |
|
int fincr, fbase; |
291 |
|
|
292 |
|
void * param; |
293 |
|
} xvid_plg_create_t; |
294 |
|
|
295 |
|
|
296 |
|
typedef struct |
297 |
|
{ |
298 |
|
int version; |
299 |
|
|
300 |
|
int width; /* [out] */ |
301 |
|
int height; /* [out] */ |
302 |
|
int fincr; /* [out] */ |
303 |
|
int fbase; /* [out] */ |
304 |
|
|
305 |
|
xvid_image_t reference; /* [out] -> [out] */ |
306 |
|
xvid_image_t current; /* [out] -> [in,out] */ |
307 |
|
xvid_image_t original; /* [out] after: points the original (uncompressed) copy of the current frame */ |
308 |
|
int frame_num; /* [out] frame number */ |
309 |
|
|
310 |
|
int type; /* [in,out] */ |
311 |
|
int quant; /* [in,out] */ |
312 |
|
|
313 |
|
unsigned char * qscale; /* [in,out] pointer to quantizer table */ |
314 |
|
int qscale_stride; /* [in,out] quantizer scale stride */ |
315 |
|
|
316 |
|
int vop_flags; /* [in,out] */ |
317 |
|
int vol_flags; /* [in,out] */ |
318 |
|
int motion_flags; /* [in,out] */ |
319 |
|
|
320 |
|
int length; /* [out] after: length of encoded frame */ |
321 |
|
int kblks, mblks, ublks; /* [out] after: */ |
322 |
|
int sse_y, sse_u, sse_v; /* [out] */ |
323 |
|
} xvid_plg_data_t; |
324 |
|
|
325 |
|
|
326 |
|
/***************************************************************************** |
327 |
|
xvid plugin system -- external |
328 |
|
|
329 |
|
the application passes xvid an array of "xvid_plugin_t" at XVID_ENC_CREATE. the array |
330 |
|
indicates the plugin function pointer and plugin-specific data. |
331 |
|
xvidcore handles the rest. example: |
332 |
|
|
333 |
|
xvid_enc_create_t create; |
334 |
|
xvid_enc_plugin_t plugins[2]; |
335 |
|
|
336 |
|
plugins[0].func = xvid_psnr_func; |
337 |
|
plugins[0].param = NULL; |
338 |
|
plugins[1].func = xvid_cbr_func; |
339 |
|
plugins[1].param = &cbr_data; |
340 |
|
|
341 |
|
create.num_plugins = 2; |
342 |
|
create.plugins = plugins; |
343 |
|
|
344 |
|
****************************************************************************/ |
345 |
|
|
346 |
|
typedef int (xvid_plugin_func)(void * handle, int opt, void * param1, void * param2); |
347 |
|
|
348 |
|
typedef struct |
349 |
|
{ |
350 |
|
xvid_plugin_func * func; |
351 |
|
void * param; |
352 |
|
} xvid_enc_plugin_t; |
353 |
|
|
354 |
|
xvid_plugin_func xvid_plugin_psnr; /* stdout psnr calculator */ |
355 |
|
xvid_plugin_func xvid_plugin_dump; /* dump before and after yuvpgms */ |
356 |
|
|
357 |
|
|
358 |
|
|
359 |
/***************************************************************************** |
/***************************************************************************** |
360 |
* xvid_encore() |
* xvid_encore() |
384 |
/* vol-based flags */ |
/* vol-based flags */ |
385 |
typedef enum { |
typedef enum { |
386 |
XVID_MPEGQUANT = 0x00000001, |
XVID_MPEGQUANT = 0x00000001, |
387 |
|
XVID_EXTRASTATS = 0x00000002, |
388 |
XVID_QUARTERPEL = 0x00000004, /* enable quarterpel: frames will encoded as quarterpel */ |
XVID_QUARTERPEL = 0x00000004, /* enable quarterpel: frames will encoded as quarterpel */ |
389 |
XVID_GMC = 0x00000008, /* enable GMC; frames will be checked for gmc suitability */ |
XVID_GMC = 0x00000008, /* enable GMC; frames will be checked for gmc suitability */ |
390 |
XVID_REDUCED_ENABLE = 0x00000010, /* enable reduced resolution vops: frames will be checked for rrv suitability */ |
XVID_REDUCED_ENABLE = 0x00000010, /* enable reduced resolution vops: frames will be checked for rrv suitability */ |
395 |
/* vop-based flags */ |
/* vop-based flags */ |
396 |
typedef enum { |
typedef enum { |
397 |
XVID_DEBUG = 0x00000001, |
XVID_DEBUG = 0x00000001, |
398 |
XVID_EXTRASTATS = 0x00000002, |
|
399 |
XVID_HALFPEL = 0x00000004, /* use halfpel interpolation */ |
XVID_HALFPEL = 0x00000004, /* use halfpel interpolation */ |
400 |
XVID_INTER4V = 0x00000008, |
XVID_INTER4V = 0x00000008, |
401 |
XVID_LUMIMASKING = 0x00000010, |
XVID_LUMIMASKING = 0x00000010, |
458 |
int width; /* [in] frame dimensions; width, pixel units */ |
int width; /* [in] frame dimensions; width, pixel units */ |
459 |
int height; /* [in] frame dimensions; height, pixel units */ |
int height; /* [in] frame dimensions; height, pixel units */ |
460 |
|
|
461 |
|
int num_plugins; /* [in:opt] number of plugins */ |
462 |
|
xvid_enc_plugin_t * plugins; /* ^^ plugin array */ |
463 |
|
|
464 |
int num_threads; /* [in:opt] number of threads */ |
int num_threads; /* [in:opt] number of threads */ |
465 |
int max_bframes; /* [in:opt] max sequential bframes (0=disable bframes) */ |
int max_bframes; /* [in:opt] max sequential bframes (0=disable bframes) */ |
466 |
|
|
554 |
/* XVID_ENC_ENCODE param2 (optional) |
/* XVID_ENC_ENCODE param2 (optional) |
555 |
xvid_enc_stats_t describes individual frame details |
xvid_enc_stats_t describes individual frame details |
556 |
|
|
|
when bframes>0, you must pass _two_ of these to xvid_encore() |
|
|
ie. xstats[2]; xvid_encore(..., xstats) |
|
557 |
coding_type==XVID_TYPE_NOTHING if the stats are not given |
coding_type==XVID_TYPE_NOTHING if the stats are not given |
558 |
*/ |
*/ |
559 |
typedef struct { |
typedef struct { |
578 |
} |
} |
579 |
#endif |
#endif |
580 |
|
|
581 |
|
|
582 |
#endif |
#endif |