xvid.h   xvid.h 
/************************************************************************** *** /************************************************************************** ***
* *
* XVID MPEG-4 VIDEO CODEC * XVID MPEG-4 VIDEO CODEC
* - XviD Main header file - * - Xvid Main header file -
* *
* Copyright(C) 2001-2004 Peter Ross <pross@xvid.org> * Copyright(C) 2001-2010 Peter Ross <pross@xvid.org>
* *
* This program is free software ; you can redistribute it and/or modify * This program is free software ; you can redistribute it and/or modify
* 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
* the Free Software Foundation ; either version 2 of the License, or * the Free Software Foundation ; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of * but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program ; if not, write to the Free Software * along with this program ; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
* *
* $Id: xvid.h,v 1.63.2.3 2009/05/25 08:09:23 Isibaar Exp $ * $Id: xvid.h,v 1.74.2.2 2011/02/14 17:21:00 Isibaar Exp $
* *
************************************************************************** **/ ************************************************************************** **/
#ifndef _XVID_H_ #ifndef _XVID_H_
#define _XVID_H_ #define _XVID_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
skipping to change at line 59 skipping to change at line 59
#define XVID_MAKE_VERSION(a,b,c) ((((a)&0xff)<<16) | (((b)&0xff)<<8) | ((c) &0xff)) #define XVID_MAKE_VERSION(a,b,c) ((((a)&0xff)<<16) | (((b)&0xff)<<8) | ((c) &0xff))
#define XVID_VERSION_MAJOR(a) ((char)(((a)>>16) & 0xff)) #define XVID_VERSION_MAJOR(a) ((char)(((a)>>16) & 0xff))
#define XVID_VERSION_MINOR(a) ((char)(((a)>> 8) & 0xff)) #define XVID_VERSION_MINOR(a) ((char)(((a)>> 8) & 0xff))
#define XVID_VERSION_PATCH(a) ((char)(((a)>> 0) & 0xff)) #define XVID_VERSION_PATCH(a) ((char)(((a)>> 0) & 0xff))
#define XVID_MAKE_API(a,b) ((((a)&0xff)<<16) | (((b)&0xff)<<0)) #define XVID_MAKE_API(a,b) ((((a)&0xff)<<16) | (((b)&0xff)<<0))
#define XVID_API_MAJOR(a) (((a)>>16) & 0xff) #define XVID_API_MAJOR(a) (((a)>>16) & 0xff)
#define XVID_API_MINOR(a) (((a)>> 0) & 0xff) #define XVID_API_MINOR(a) (((a)>> 0) & 0xff)
#define XVID_VERSION XVID_MAKE_VERSION(1,2,2) #define XVID_VERSION XVID_MAKE_VERSION(1,3,0)
#define XVID_API XVID_MAKE_API(4, 2) #define XVID_API XVID_MAKE_API(4, 3)
/* Bitstream Version /* Bitstream Version
* this will be writen into the bitstream to allow easy detection of xvid * this will be writen into the bitstream to allow easy detection of xvid
* encoder bugs in the decoder, without this it might not possible to * encoder bugs in the decoder, without this it might not possible to
* automatically distinquish between a file which has been encoded with an * automatically distinquish between a file which has been encoded with an
* old & buggy XVID from a file which has been encoded with a bugfree versi on * old & buggy XVID from a file which has been encoded with a bugfree versi on
* see the infamous interlacing bug ... * see the infamous interlacing bug ...
* *
* this MUST be increased if an encoder bug is fixed, increasing it too oft en * this MUST be increased if an encoder bug is fixed, increasing it too oft en
* doesnt hurt but not increasing it could cause difficulty for decoders in the * doesnt hurt but not increasing it could cause difficulty for decoders in the
* future * future
*/ */
#define XVID_BS_VERSION 50 #define XVID_BS_VERSION 62
/************************************************************************** *** /************************************************************************** ***
* error codes * error codes
************************************************************************** **/ ************************************************************************** **/
/* all functions return values <0 indicate error */ /* all functions return values <0 indicate error */
#define XVID_ERR_FAIL -1 /* general fault */ #define XVID_ERR_FAIL -1 /* general fault */
#define XVID_ERR_MEMORY -2 /* memory allocation error */ #define XVID_ERR_MEMORY -2 /* memory allocation error */
#define XVID_ERR_FORMAT -3 /* file format error */ #define XVID_ERR_FORMAT -3 /* file format error */
skipping to change at line 127 skipping to change at line 127
int csp; /* [in] colorspace; or with XVID_CSP_VFLIP to perform vertical flip */ int csp; /* [in] colorspace; or with XVID_CSP_VFLIP to perform vertical flip */
void * plane[4]; /* [in] image plane ptrs */ void * plane[4]; /* [in] image plane ptrs */
int stride[4]; /* [in] image stride; "bytes per row "*/ int stride[4]; /* [in] image stride; "bytes per row "*/
} xvid_image_t; } xvid_image_t;
/* video-object-sequence profiles */ /* video-object-sequence profiles */
#define XVID_PROFILE_S_L0 0x08 /* simple */ #define XVID_PROFILE_S_L0 0x08 /* simple */
#define XVID_PROFILE_S_L1 0x01 #define XVID_PROFILE_S_L1 0x01
#define XVID_PROFILE_S_L2 0x02 #define XVID_PROFILE_S_L2 0x02
#define XVID_PROFILE_S_L3 0x03 #define XVID_PROFILE_S_L3 0x03
#define XVID_PROFILE_S_L4a 0x04
#define XVID_PROFILE_S_L5 0x05
#define XVID_PROFILE_S_L6 0x06
#define XVID_PROFILE_ARTS_L1 0x91 /* advanced realtime simple */ #define XVID_PROFILE_ARTS_L1 0x91 /* advanced realtime simple */
#define XVID_PROFILE_ARTS_L2 0x92 #define XVID_PROFILE_ARTS_L2 0x92
#define XVID_PROFILE_ARTS_L3 0x93 #define XVID_PROFILE_ARTS_L3 0x93
#define XVID_PROFILE_ARTS_L4 0x94 #define XVID_PROFILE_ARTS_L4 0x94
#define XVID_PROFILE_AS_L0 0xf0 /* advanced simple */ #define XVID_PROFILE_AS_L0 0xf0 /* advanced simple */
#define XVID_PROFILE_AS_L1 0xf1 #define XVID_PROFILE_AS_L1 0xf1
#define XVID_PROFILE_AS_L2 0xf2 #define XVID_PROFILE_AS_L2 0xf2
#define XVID_PROFILE_AS_L3 0xf3 #define XVID_PROFILE_AS_L3 0xf3
#define XVID_PROFILE_AS_L4 0xf4 #define XVID_PROFILE_AS_L4 0xf4
skipping to change at line 228 skipping to change at line 231
* xvid_decore() * xvid_decore()
************************************************************************** **/ ************************************************************************** **/
#define XVID_DEC_CREATE 0 /* create decore instance; return 0 on success * / #define XVID_DEC_CREATE 0 /* create decore instance; return 0 on success * /
#define XVID_DEC_DESTROY 1 /* destroy decore instance: return 0 on success */ #define XVID_DEC_DESTROY 1 /* destroy decore instance: return 0 on success */
#define XVID_DEC_DECODE 2 /* decode a frame: returns number of bytes consu med >= 0 */ #define XVID_DEC_DECODE 2 /* decode a frame: returns number of bytes consu med >= 0 */
extern int xvid_decore(void *handle, int opt, void *param1, void *param2); extern int xvid_decore(void *handle, int opt, void *param1, void *param2);
/* XVID_DEC_CREATE param 1 /* XVID_DEC_CREATE param 1
image width & height may be specified here when the dimensions are image width & height as well as FourCC code may be specified
known in advance. */ here when known in advance (e.g. being read from container) */
typedef struct { typedef struct {
int version; int version;
int width; /* [in:opt] image width */ int width; /* [in:opt] image width */
int height; /* [in:opt] image width */ int height; /* [in:opt] image width */
void * handle; /* [out] decore context handle */ void * handle; /* [out] decore context handle */
/* ------- v1.3.x ------- */
int fourcc; /* [in:opt] fourcc of the input video */
int num_threads;/* [in:opt] number of threads to use in decoder */
} xvid_dec_create_t; } xvid_dec_create_t;
/* XVID_DEC_DECODE param1 */ /* XVID_DEC_DECODE param1 */
/* general flags */ /* general flags */
#define XVID_LOWDELAY (1<<0) /* lowdelay mode */ #define XVID_LOWDELAY (1<<0) /* lowdelay mode */
#define XVID_DISCONTINUITY (1<<1) /* indicates break in stream */ #define XVID_DISCONTINUITY (1<<1) /* indicates break in stream */
#define XVID_DEBLOCKY (1<<2) /* perform luma deblocking */ #define XVID_DEBLOCKY (1<<2) /* perform luma deblocking */
#define XVID_DEBLOCKUV (1<<3) /* perform chroma deblocking */ #define XVID_DEBLOCKUV (1<<3) /* perform chroma deblocking */
#define XVID_FILMEFFECT (1<<4) /* adds film grain */ #define XVID_FILMEFFECT (1<<4) /* adds film grain */
#define XVID_DERINGUV (1<<5) /* perform chroma deringing, requires deb locking to work */ #define XVID_DERINGUV (1<<5) /* perform chroma deringing, requires deb locking to work */
skipping to change at line 472 skipping to change at line 478
extern xvid_plugin_func xvid_plugin_single; /* single-pass rate control * / extern xvid_plugin_func xvid_plugin_single; /* single-pass rate control * /
extern xvid_plugin_func xvid_plugin_2pass1; /* two-pass rate control: fir st pass */ extern xvid_plugin_func xvid_plugin_2pass1; /* two-pass rate control: fir st pass */
extern xvid_plugin_func xvid_plugin_2pass2; /* two-pass rate control: sec ond pass */ extern xvid_plugin_func xvid_plugin_2pass2; /* two-pass rate control: sec ond pass */
extern xvid_plugin_func xvid_plugin_lumimasking; /* lumimasking */ extern xvid_plugin_func xvid_plugin_lumimasking; /* lumimasking */
extern xvid_plugin_func xvid_plugin_psnr; /* write psnr values to stdo ut */ extern xvid_plugin_func xvid_plugin_psnr; /* write psnr values to stdo ut */
extern xvid_plugin_func xvid_plugin_dump; /* dump before and after yuv pgms */ extern xvid_plugin_func xvid_plugin_dump; /* dump before and after yuv pgms */
extern xvid_plugin_func xvid_plugin_ssim; /*write ssim values to stdou extern xvid_plugin_func xvid_plugin_ssim; /*write ssim values to s
t*/ tdout*/
extern xvid_plugin_func xvid_plugin_psnrhvsm; /*write psnrhvsm values to s
tdout*/
/* single pass rate control /* single pass rate control
* CBR and Constant quantizer modes */ * CBR and Constant quantizer modes */
typedef struct typedef struct
{ {
int version; int version;
int bitrate; /* [in] bits per second */ int bitrate; /* [in] bits per second */
int reaction_delay_factor; /* [in] */ int reaction_delay_factor; /* [in] */
int averaging_period; /* [in] */ int averaging_period; /* [in] */
skipping to change at line 517 skipping to change at line 524
int kfreduction; /* [in] maximum bitrate reduction appl ied to an iframe under the kfthreshold distance limit */ int kfreduction; /* [in] maximum bitrate reduction appl ied to an iframe under the kfthreshold distance limit */
int kfthreshold; /* [in] if an iframe is closer to the next iframe than this distance, a quantity of bits int kfthreshold; /* [in] if an iframe is closer to the next iframe than this distance, a quantity of bits
* is substracted from its bit allocation. The reduction is computed as multiple s of * is substracted from its bit allocation. The reduction is computed as multiple s of
* kf reduction/kthreshold. It reaches kfreduction when the distance == kfthresho ld, * kf reduction/kthreshold. It reaches kfreduction when the distance == kfthresho ld,
* 0 for 1<distance<kfthreshold */ * 0 for 1<distance<kfthreshold */
int container_frame_overhead; /* [in] How many bytes the controller has to compensate per frame due to container format overhead */ int container_frame_overhead; /* [in] How many bytes the controller has to compensate per frame due to container format overhead */
/* ------- v1.1.x ------- */ /* ------- v1.1.x ------- */
int vbv_size; /* [in] buffer size (bits) */ int vbv_size; /* [in] buffer size (bits) If this is zero, VBV check is disabled.*/
int vbv_initial; /* [in] initial buffer occupancy (bits ) */ int vbv_initial; /* [in] initial buffer occupancy (bits ) */
int vbv_maxrate; /* [in] max processing bitrate (bits p er second) */ int vbv_maxrate; /* [in] max processing bitrate (bits p er second) */
int vbv_peakrate; /* [in:opt] max average bitrate over 3 int vbv_peakrate; /* [in:opt] max average bitrate over 1
seconds (bits per second) */ second (bits per second).
*
This is used for diagnostics only and won't affect the actual peak bitrat
e.
*
This is not a problem as long as vbv_peakrate > vbv_size + vbv_maxrate wh
ich
*
guarantees that vbv_peakrate won't be exceeded. */
}xvid_plugin_2pass2_t; }xvid_plugin_2pass2_t;
typedef struct{ typedef struct{
/*stat output*/ /*stat output*/
int b_printstat; int b_printstat;
char* stat_path; char* stat_path;
/*visualize*/ /*visualize*/
int b_visualize; int b_visualize;
/*accuracy 0 very accurate 4 very fast*/ /*accuracy 0 very accurate 4 very fast*/
int acc; int acc;
int cpu_flags; /* XVID_CPU_XXX flags */ int cpu_flags; /* XVID_CPU_XXX flags */
} xvid_plugin_ssim_t; } xvid_plugin_ssim_t;
typedef struct {
int version;
int method; /* [in] masking method to apply. 0 for luminance m
asking, 1 for variance masking */
} xvid_plugin_lumimasking_t;
/************************************************************************** *** /************************************************************************** ***
* ENCODER API * ENCODER API
************************************************************************** **/ ************************************************************************** **/
/*------------------------------------------------------------------------- --- /*------------------------------------------------------------------------- ---
* Encoder operations * Encoder operations
*------------------------------------------------------------------------- -*/ *------------------------------------------------------------------------- -*/
#define XVID_ENC_CREATE 0 /* create encoder instance; returns 0 on success */ #define XVID_ENC_CREATE 0 /* create encoder instance; returns 0 on success */
#define XVID_ENC_DESTROY 1 /* destroy encoder instance; returns 0 on succes s */ #define XVID_ENC_DESTROY 1 /* destroy encoder instance; returns 0 on succes s */
skipping to change at line 633 skipping to change at line 648
#define XVID_VOP_HALFPEL (1<< 1) /* use halfpel interpolation */ #define XVID_VOP_HALFPEL (1<< 1) /* use halfpel interpolation */
#define XVID_VOP_INTER4V (1<< 2) /* use 4 motion vectors per M B */ #define XVID_VOP_INTER4V (1<< 2) /* use 4 motion vectors per M B */
#define XVID_VOP_TRELLISQUANT (1<< 3) /* use trellis based R-D "opt imal" quantization */ #define XVID_VOP_TRELLISQUANT (1<< 3) /* use trellis based R-D "opt imal" quantization */
#define XVID_VOP_CHROMAOPT (1<< 4) /* enable chroma optimization pre-filter */ #define XVID_VOP_CHROMAOPT (1<< 4) /* enable chroma optimization pre-filter */
#define XVID_VOP_CARTOON (1<< 5) /* use 'cartoon mode' */ #define XVID_VOP_CARTOON (1<< 5) /* use 'cartoon mode' */
#define XVID_VOP_GREYSCALE (1<< 6) /* enable greyscale only mode (even for color input material chroma is ignored) */ #define XVID_VOP_GREYSCALE (1<< 6) /* enable greyscale only mode (even for color input material chroma is ignored) */
#define XVID_VOP_HQACPRED (1<< 7) /* high quality ac prediction */ #define XVID_VOP_HQACPRED (1<< 7) /* high quality ac prediction */
#define XVID_VOP_MODEDECISION_RD (1<< 8) /* enable DCT-ME and use it f or mode decision */ #define XVID_VOP_MODEDECISION_RD (1<< 8) /* enable DCT-ME and use it f or mode decision */
#define XVID_VOP_FAST_MODEDECISION_RD (1<<12) /* use simplified R-D mode de cision */ #define XVID_VOP_FAST_MODEDECISION_RD (1<<12) /* use simplified R-D mode de cision */
#define XVID_VOP_RD_BVOP (1<<13) /* enable rate-distortion mod e decision in b-frames */ #define XVID_VOP_RD_BVOP (1<<13) /* enable rate-distortion mod e decision in b-frames */
#define XVID_VOP_RD_PSNRHVSM (1<<14) /* use PSNR-HVS-M as metric f or rate-distortion optimizations */
/* Only valid for vol_flags|=XVID_VOL_INTERLACING */ /* Only valid for vol_flags|=XVID_VOL_INTERLACING */
#define XVID_VOP_TOPFIELDFIRST (1<< 9) /* set top-field-first flag */ #define XVID_VOP_TOPFIELDFIRST (1<< 9) /* set top-field-first flag */
#define XVID_VOP_ALTERNATESCAN (1<<10) /* set alternate vertical sca n flag */ #define XVID_VOP_ALTERNATESCAN (1<<10) /* set alternate vertical sca n flag */
/* only valid for vol_flags|=XVID_VOL_REDUCED_ENABLED */ /* only valid for vol_flags|=XVID_VOL_REDUCED_ENABLED */
#define XVID_VOP_REDUCED (1<<11) /* reduced resolution vop */ #define XVID_VOP_REDUCED (1<<11) /* reduced resolution vop */
/* NOTE: reduced resolution feature is not supported anymore. This flag will have no effect! */ /* NOTE: reduced resolution feature is not supported anymore. This flag will have no effect! */
/*------------------------------------------------------------------------- --- /*------------------------------------------------------------------------- ---
skipping to change at line 709 skipping to change at line 725
int profile; /* [in] profile@level; refer to XVID_PR OFILE_xxx */ int profile; /* [in] profile@level; refer to XVID_PR OFILE_xxx */
int width; /* [in] frame dimensions; width, pixel units */ int width; /* [in] frame dimensions; width, pixel units */
int height; /* [in] frame dimensions; height, pixel units */ int height; /* [in] frame dimensions; height, pixel units */
int num_zones; /* [in:opt] number of bitrate zones */ int num_zones; /* [in:opt] number of bitrate zones */
xvid_enc_zone_t * zones; /* ^^ zone array */ xvid_enc_zone_t * zones; /* ^^ zone array */
int num_plugins; /* [in:opt] number of plugins */ int num_plugins; /* [in:opt] number of plugins */
xvid_enc_plugin_t * plugins; /* ^^ plugin array */ xvid_enc_plugin_t * plugins; /* ^^ plugin array */
int num_threads; /* [in:opt] number of threads */ int num_threads; /* [in:opt] number of threads to use in encoder */
int max_bframes; /* [in:opt] max sequential bframes (0=d isable bframes) */ int max_bframes; /* [in:opt] max sequential bframes (0=d isable bframes) */
int global; /* [in:opt] global flags; controls enco ding behavior */ int global; /* [in:opt] global flags; controls enco ding behavior */
/* --- vol-based stuff; included here for convenience */ /* --- vol-based stuff; included here for convenience */
int fincr; /* [in:opt] framerate increment; set to zero for variable framerate */ int fincr; /* [in:opt] framerate increment; set to zero for variable framerate */
int fbase; /* [in] framerate base frame_duration = fincr/fbase seconds*/ int fbase; /* [in] framerate base frame_duration = fincr/fbase seconds*/
/* ---------------------------------------------- */ /* ---------------------------------------------- */
/* --- vop-based; included here for convenience */ /* --- vop-based; included here for convenience */
skipping to change at line 732 skipping to change at line 748
int frame_drop_ratio; /* [in:opt] frame dropping: 0=drop none ... 100=drop all */ int frame_drop_ratio; /* [in:opt] frame dropping: 0=drop none ... 100=drop all */
int bquant_ratio; /* [in:opt] bframe quantizer multipier/ offeset; used to decide bframes quant when bquant==-1 */ int bquant_ratio; /* [in:opt] bframe quantizer multipier/ offeset; used to decide bframes quant when bquant==-1 */
int bquant_offset; /* bquant = (avg(past_ref_quant,future_ ref_quant)*bquant_ratio + bquant_offset) / 100 */ int bquant_offset; /* bquant = (avg(past_ref_quant,future_ ref_quant)*bquant_ratio + bquant_offset) / 100 */
int min_quant[3]; /* [in:opt] */ int min_quant[3]; /* [in:opt] */
int max_quant[3]; /* [in:opt] */ int max_quant[3]; /* [in:opt] */
/* ---------------------------------------------- */ /* ---------------------------------------------- */
void *handle; /* [out] encoder instance handle */ void *handle; /* [out] encoder instance handle */
/* ------- v1.3.x ------- */
int start_frame_num; /* [in:opt] frame number of start frame
relative to zones definitions. allows to encode sub-sequences */
int num_slices; /* [in:opt] number of slices to code fo
r each frame */
} xvid_enc_create_t; } xvid_enc_create_t;
/*------------------------------------------------------------------------- --- /*------------------------------------------------------------------------- ---
* xvid_enc_frame_t structure definition * xvid_enc_frame_t structure definition
* *
* This structure is passed as param1 during a frame encoding (operation * This structure is passed as param1 during a frame encoding (operation
* XVID_ENC_ENCODE) * XVID_ENC_ENCODE)
*------------------------------------------------------------------------- -*/ *------------------------------------------------------------------------- -*/
/* out value for the frame structure->type field /* out value for the frame structure->type field
 End of changes. 15 change blocks. 
18 lines changed or deleted 47 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/