lame_global_flags.h

Go to the documentation of this file.
00001 #ifndef LAME_GLOBAL_FLAGS_H
00002 #define LAME_GLOBAL_FLAGS_H
00003 
00004 #ifndef lame_internal_flags_defined
00005 #define lame_internal_flags_defined
00006 struct lame_internal_flags;
00007 typedef struct lame_internal_flags lame_internal_flags;
00008 #endif
00009 
00010 
00011 typedef enum short_block_e {
00012     short_block_not_set = -1, /* allow LAME to decide */
00013     short_block_allowed = 0, /* LAME may use them, even different block types for L/R */
00014     short_block_coupled, /* LAME may use them, but always same block types in L/R */
00015     short_block_dispensed, /* LAME will not use short blocks, long blocks only */
00016     short_block_forced  /* LAME will not use long blocks, short blocks only */
00017 } short_block_t;
00018 
00019 /***********************************************************************
00020 *
00021 *  Control Parameters set by User.  These parameters are here for
00022 *  backwards compatibility with the old, non-shared lib API.
00023 *  Please use the lame_set_variablename() functions below
00024 *
00025 *
00026 ***********************************************************************/
00027 struct lame_global_struct {
00028     /* input description */
00029     unsigned long num_samples; /* number of samples. default=2^32-1           */
00030     int     num_channels;    /* input number of channels. default=2         */
00031     int     in_samplerate;   /* input_samp_rate in Hz. default=44.1 kHz     */
00032     int     out_samplerate;  /* output_samp_rate.
00033                                 default: LAME picks best value
00034                                 at least not used for MP3 decoding:
00035                                 Remember 44.1 kHz MP3s and AC97           */
00036     float   scale;           /* scale input by this amount before encoding
00037                                 at least not used for MP3 decoding          */
00038     float   scale_left;      /* scale input of channel 0 (left) by this
00039                                 amount before encoding                      */
00040     float   scale_right;     /* scale input of channel 1 (right) by this
00041                                 amount before encoding                      */
00042 
00043     /* general control params */
00044     int     analysis;        /* collect data for a MP3 frame analyzer?      */
00045     int     bWriteVbrTag;    /* add Xing VBR tag?                           */
00046     int     decode_only;     /* use lame/mpglib to convert mp3 to wav       */
00047     int     quality;         /* quality setting 0=best,  9=worst  default=5 */
00048     MPEG_mode mode;          /* see enum in lame.h
00049                                 default = LAME picks best value             */
00050     int     force_ms;        /* force M/S mode.  requires mode=1            */
00051     int     free_format;     /* use free format? default=0                  */
00052     int     findReplayGain;  /* find the RG value? default=0       */
00053     int     decode_on_the_fly; /* decode on the fly? default=0                */
00054 
00055     /*
00056      * set either brate>0  or compression_ratio>0, LAME will compute
00057      * the value of the variable not set.
00058      * Default is compression_ratio = 11.025
00059      */
00060     int     brate;           /* bitrate                                    */
00061     float   compression_ratio; /* sizeof(wav file)/sizeof(mp3 file)          */
00062 
00063 
00064     /* frame params */
00065     int     copyright;       /* mark as copyright. default=0           */
00066     int     original;        /* mark as original. default=1            */
00067     int     extension;       /* the MP3 'private extension' bit.
00068                                 Meaningless                            */
00069     int     emphasis;        /* Input PCM is emphased PCM (for
00070                                 instance from one of the rarely
00071                                 emphased CDs), it is STRONGLY not
00072                                 recommended to use this, because
00073                                 psycho does not take it into account,
00074                                 and last but not least many decoders
00075                                 don't care about these bits          */
00076     int     error_protection; /* use 2 bytes per frame for a CRC
00077                                  checksum. default=0                    */
00078     int     strict_ISO;      /* enforce ISO spec as much as possible   */
00079 
00080     int     disable_reservoir; /* use bit reservoir?                     */
00081 
00082     /* quantization/noise shaping */
00083     int     quant_comp;
00084     int     quant_comp_short;
00085     int     experimentalY;
00086     int     exp_nspsytune;
00087 
00088     int     preset;
00089 
00090     /* VBR control */
00091     vbr_mode VBR;
00092     int     VBR_q;
00093     int     VBR_mean_bitrate_kbps;
00094     int     VBR_min_bitrate_kbps;
00095     int     VBR_max_bitrate_kbps;
00096     int     VBR_hard_min;    /* strictly enforce VBR_min_bitrate
00097                                 normaly, it will be violated for analog
00098                                 silence                                 */
00099 
00100 
00101     /* resampling and filtering */
00102     int     lowpassfreq;     /* freq in Hz. 0=lame choses.
00103                                 -1=no filter                          */
00104     int     highpassfreq;    /* freq in Hz. 0=lame choses.
00105                                 -1=no filter                          */
00106     int     lowpasswidth;    /* freq width of filter, in Hz
00107                                 (default=15%)                         */
00108     int     highpasswidth;   /* freq width of filter, in Hz
00109                                 (default=15%)                         */
00110 
00111 
00112 
00113     /*
00114      * psycho acoustics and other arguments which you should not change
00115      * unless you know what you are doing
00116      */
00117     int     psymodel;        /* select psychoacoustic model          */
00118     float   maskingadjust;
00119     float   maskingadjust_short;
00120     int     ATHonly;         /* only use ATH                         */
00121     int     ATHshort;        /* only use ATH for short blocks        */
00122     int     noATH;           /* disable ATH                          */
00123     int     ATHtype;         /* select ATH formula                   */
00124     float   ATHcurve;        /* change ATH formula 4 shape           */
00125     float   ATHlower;        /* lower ATH by this many db            */
00126     int     athaa_type;      /* select ATH auto-adjust scheme        */
00127     int     athaa_loudapprox; /* select ATH auto-adjust loudness calc */
00128     float   athaa_sensitivity; /* dB, tune active region of auto-level */
00129     int     cwlimit;         /* predictability limit                 */
00130     short_block_t short_blocks;
00131     int     useTemporal;     /* use temporal masking effect          */
00132     float   interChRatio;
00133     float   msfix;           /* Naoki's adjustment of Mid/Side maskings */
00134 
00135     int     tune;            /* 0 off, 1 on */
00136     float   tune_value_a;    /* used to pass values for debugging and stuff */
00137 
00138     int     quantization_type; /* 0 depending on quality, 1 ISO, 2 nonlinear */
00139 
00140     struct {
00141         void    (*msgf) (const char *format, va_list ap);
00142         void    (*debugf) (const char *format, va_list ap);
00143         void    (*errorf) (const char *format, va_list ap);
00144     } report;
00145 
00146   /************************************************************************/
00147     /* internal variables, do not set...                                    */
00148     /* provided because they may be of use to calling application           */
00149   /************************************************************************/
00150 
00151     int     version;         /* 0=MPEG-2/2.5  1=MPEG-1               */
00152     int     encoder_delay;
00153     int     encoder_padding; /* number of samples of padding appended to input */
00154     int     framesize;
00155     int     frameNum;        /* number of frames encoded             */
00156     int     lame_allocated_gfp; /* is this struct owned by calling
00157                                    program or lame?                     */
00158 
00159 
00160 
00161   /**************************************************************************/
00162     /* more internal variables are stored in this structure:                  */
00163   /**************************************************************************/
00164     lame_internal_flags *internal_flags;
00165 
00166 
00167     struct {
00168         int     mmx;
00169         int     amd3dnow;
00170         int     sse;
00171 
00172     } asm_optimizations;
00173 };
00174 
00175 #endif /* LAME_GLOBAL_FLAGS_H */

Generated on Sun Dec 2 11:34:19 2007 for LAME by  doxygen 1.5.2