fix crashes reported by Debian Cylab Mayhem Team
[swftools.git] / lib / lame / lame_global_flags.h
blob7267c93128333d10e1d817f654e452d7919e2625
2 #ifndef LAME_GLOBAL_FLAGS_H
3 #define LAME_GLOBAL_FLAGS_H
5 struct lame_internal_flags;
6 typedef struct lame_internal_flags lame_internal_flags;
9 typedef enum short_block_e {
10 short_block_not_set = -1, /* allow LAME to decide */
11 short_block_allowed = 0, /* LAME may use them, even different block types for L/R */
12 short_block_coupled, /* LAME may use them, but always same block types in L/R */
13 short_block_dispensed, /* LAME will not use short blocks, long blocks only */
14 short_block_forced /* LAME will not use long blocks, short blocks only */
15 } short_block_t;
17 /***********************************************************************
19 * Control Parameters set by User. These parameters are here for
20 * backwards compatibility with the old, non-shared lib API.
21 * Please use the lame_set_variablename() functions below
24 ***********************************************************************/
25 struct lame_global_struct {
26 /* input description */
27 unsigned long num_samples; /* number of samples. default=2^32-1 */
28 int num_channels; /* input number of channels. default=2 */
29 int in_samplerate; /* input_samp_rate in Hz. default=44.1 kHz */
30 int out_samplerate; /* output_samp_rate.
31 default: LAME picks best value
32 at least not used for MP3 decoding:
33 Remember 44.1 kHz MP3s and AC97 */
34 float scale; /* scale input by this amount before encoding
35 at least not used for MP3 decoding */
36 float scale_left; /* scale input of channel 0 (left) by this
37 amount before encoding */
38 float scale_right; /* scale input of channel 1 (right) by this
39 amount before encoding */
41 /* general control params */
42 int analysis; /* collect data for a MP3 frame analyzer? */
43 int bWriteVbrTag; /* add Xing VBR tag? */
44 int decode_only; /* use lame/mpglib to convert mp3/ogg to wav */
45 int ogg; /* encode to Vorbis .ogg file */
47 int quality; /* quality setting 0=best, 9=worst default=5 */
48 MPEG_mode mode; /* see enum in lame.h
49 default = LAME picks best value */
50 int mode_fixed; /* ignored */
51 int mode_automs; /* use a m/s threshold based on compression
52 ratio */
53 int force_ms; /* force M/S mode. requires mode=1 */
54 int free_format; /* use free format? default=0 */
57 * set either brate>0 or compression_ratio>0, LAME will compute
58 * the value of the variable not set.
59 * Default is compression_ratio = 11.025
61 int brate; /* bitrate */
62 float compression_ratio; /* sizeof(wav file)/sizeof(mp3 file) */
65 /* frame params */
66 int copyright; /* mark as copyright. default=0 */
67 int original; /* mark as original. default=1 */
68 int error_protection; /* use 2 bytes per frame for a CRC
69 checksum. default=0 */
70 Padding_type padding_type; /* PAD_NO = no padding,
71 PAD_ALL = always pad,
72 PAD_ADJUST = adjust padding,
73 default=2 */
74 int extension; /* the MP3 'private extension' bit.
75 Meaningless */
76 int strict_ISO; /* enforce ISO spec as much as possible */
78 /* quantization/noise shaping */
79 int disable_reservoir; /* use bit reservoir? */
80 int experimentalX;
81 int experimentalY;
82 int experimentalZ;
83 int exp_nspsytune;
85 double newmsfix;
86 int preset_expopts;
88 /* VBR control */
89 vbr_mode VBR;
90 int VBR_q;
91 int VBR_mean_bitrate_kbps;
92 int VBR_min_bitrate_kbps;
93 int VBR_max_bitrate_kbps;
94 int VBR_hard_min; /* strictly enforce VBR_min_bitrate
95 normaly, it will be violated for analog
96 silence */
99 /* resampling and filtering */
100 int lowpassfreq; /* freq in Hz. 0=lame choses.
101 -1=no filter */
102 int highpassfreq; /* freq in Hz. 0=lame choses.
103 -1=no filter */
104 int lowpasswidth; /* freq width of filter, in Hz
105 (default=15%) */
106 int highpasswidth; /* freq width of filter, in Hz
107 (default=15%) */
112 * psycho acoustics and other arguments which you should not change
113 * unless you know what you are doing
115 int ATHonly; /* only use ATH */
116 int ATHshort; /* only use ATH for short blocks */
117 int noATH; /* disable ATH */
118 int ATHtype; /* select ATH formula */
119 float ATHlower; /* lower ATH by this many db */
120 int athaa_type; /* select ATH auto-adjust scheme */
121 int athaa_loudapprox; /* select ATH auto-adjust loudness calc */
122 float athaa_sensitivity; /* dB, tune active region of auto-level */
123 int cwlimit; /* predictability limit */
124 short_block_t short_blocks;
125 /* int allow_diff_short; allow blocktypes to differ between
126 channels? */
127 int useTemporal; /* use temporal masking effect */
128 /* int no_short_blocks; disable short blocks */
129 int emphasis; /* Input PCM is emphased PCM (for
130 instance from one of the rarely
131 emphased CDs), it is STRONGLY not
132 recommended to use this, because
133 psycho does not take it into account,
134 and last but not least many decoders
135 don't care about these bits */
136 float msfix; /* Naoki's adjustment of Mid/Side maskings */
138 int tune; /* 0 off, 1 on */
139 float tune_value_a; /* used to pass values for debugging and stuff */
142 struct {
143 void (*msgf) (const char *format, va_list ap);
144 void (*debugf)(const char *format, va_list ap);
145 void (*errorf)(const char *format, va_list ap);
146 } report;
148 /************************************************************************/
149 /* internal variables, do not set... */
150 /* provided because they may be of use to calling application */
151 /************************************************************************/
153 int version; /* 0=MPEG-2/2.5 1=MPEG-1 */
154 int encoder_delay;
155 int encoder_padding; /* number of samples of padding appended to input */
156 int framesize;
157 int frameNum; /* number of frames encoded */
158 int lame_allocated_gfp; /* is this struct owned by calling
159 program or lame? */
163 /****************************************************************************/
164 /* more internal variables, which will not exist after lame_encode_finish() */
165 /****************************************************************************/
166 lame_internal_flags *internal_flags;
168 /* VBR tags. This data is here because VBR header is writen after
169 * input file is closed and *internal_flags struct is free'd */
170 int TotalFrameSize;
171 //int* pVbrFrames;
172 int nVbrNumFrames;
173 int nVbrFrameBufferSize;
178 #endif /* LAME_GLOBAL_FLAGS_H */