|
Packit |
47f805 |
#ifndef LAME_GLOBAL_FLAGS_H
|
|
Packit |
47f805 |
#define LAME_GLOBAL_FLAGS_H
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
#ifndef lame_internal_flags_defined
|
|
Packit |
47f805 |
#define lame_internal_flags_defined
|
|
Packit |
47f805 |
struct lame_internal_flags;
|
|
Packit |
47f805 |
typedef struct lame_internal_flags lame_internal_flags;
|
|
Packit |
47f805 |
#endif
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
typedef enum short_block_e {
|
|
Packit |
47f805 |
short_block_not_set = -1, /* allow LAME to decide */
|
|
Packit |
47f805 |
short_block_allowed = 0, /* LAME may use them, even different block types for L/R */
|
|
Packit |
47f805 |
short_block_coupled, /* LAME may use them, but always same block types in L/R */
|
|
Packit |
47f805 |
short_block_dispensed, /* LAME will not use short blocks, long blocks only */
|
|
Packit |
47f805 |
short_block_forced /* LAME will not use long blocks, short blocks only */
|
|
Packit |
47f805 |
} short_block_t;
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
/***********************************************************************
|
|
Packit |
47f805 |
*
|
|
Packit |
47f805 |
* Control Parameters set by User. These parameters are here for
|
|
Packit |
47f805 |
* backwards compatibility with the old, non-shared lib API.
|
|
Packit |
47f805 |
* Please use the lame_set_variablename() functions below
|
|
Packit |
47f805 |
*
|
|
Packit |
47f805 |
*
|
|
Packit |
47f805 |
***********************************************************************/
|
|
Packit |
47f805 |
struct lame_global_struct {
|
|
Packit |
47f805 |
unsigned int class_id;
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
/* input description */
|
|
Packit |
47f805 |
unsigned long num_samples; /* number of samples. default=2^32-1 */
|
|
Packit |
47f805 |
int num_channels; /* input number of channels. default=2 */
|
|
Packit |
47f805 |
int samplerate_in; /* input_samp_rate in Hz. default=44.1 kHz */
|
|
Packit |
47f805 |
int samplerate_out; /* output_samp_rate.
|
|
Packit |
47f805 |
default: LAME picks best value
|
|
Packit |
47f805 |
at least not used for MP3 decoding:
|
|
Packit |
47f805 |
Remember 44.1 kHz MP3s and AC97 */
|
|
Packit |
47f805 |
float scale; /* scale input by this amount before encoding
|
|
Packit |
47f805 |
at least not used for MP3 decoding */
|
|
Packit |
47f805 |
float scale_left; /* scale input of channel 0 (left) by this
|
|
Packit |
47f805 |
amount before encoding */
|
|
Packit |
47f805 |
float scale_right; /* scale input of channel 1 (right) by this
|
|
Packit |
47f805 |
amount before encoding */
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
/* general control params */
|
|
Packit |
47f805 |
int analysis; /* collect data for a MP3 frame analyzer? */
|
|
Packit |
47f805 |
int write_lame_tag; /* add Xing VBR tag? */
|
|
Packit |
47f805 |
int decode_only; /* use lame/mpglib to convert mp3 to wav */
|
|
Packit |
47f805 |
int quality; /* quality setting 0=best, 9=worst default=5 */
|
|
Packit |
47f805 |
MPEG_mode mode; /* see enum in lame.h
|
|
Packit |
47f805 |
default = LAME picks best value */
|
|
Packit |
47f805 |
int force_ms; /* force M/S mode. requires mode=1 */
|
|
Packit |
47f805 |
int free_format; /* use free format? default=0 */
|
|
Packit |
47f805 |
int findReplayGain; /* find the RG value? default=0 */
|
|
Packit |
47f805 |
int decode_on_the_fly; /* decode on the fly? default=0 */
|
|
Packit |
47f805 |
int write_id3tag_automatic; /* 1 (default) writes ID3 tags, 0 not */
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
int nogap_total;
|
|
Packit |
47f805 |
int nogap_current;
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
int substep_shaping;
|
|
Packit |
47f805 |
int noise_shaping;
|
|
Packit |
47f805 |
int subblock_gain; /* 0 = no, 1 = yes */
|
|
Packit |
47f805 |
int use_best_huffman; /* 0 = no. 1=outside loop 2=inside loop(slow) */
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
/*
|
|
Packit |
47f805 |
* set either brate>0 or compression_ratio>0, LAME will compute
|
|
Packit |
47f805 |
* the value of the variable not set.
|
|
Packit |
47f805 |
* Default is compression_ratio = 11.025
|
|
Packit |
47f805 |
*/
|
|
Packit |
47f805 |
int brate; /* bitrate */
|
|
Packit |
47f805 |
float compression_ratio; /* sizeof(wav file)/sizeof(mp3 file) */
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
/* frame params */
|
|
Packit |
47f805 |
int copyright; /* mark as copyright. default=0 */
|
|
Packit |
47f805 |
int original; /* mark as original. default=1 */
|
|
Packit |
47f805 |
int extension; /* the MP3 'private extension' bit.
|
|
Packit |
47f805 |
Meaningless */
|
|
Packit |
47f805 |
int emphasis; /* Input PCM is emphased PCM (for
|
|
Packit |
47f805 |
instance from one of the rarely
|
|
Packit |
47f805 |
emphased CDs), it is STRONGLY not
|
|
Packit |
47f805 |
recommended to use this, because
|
|
Packit |
47f805 |
psycho does not take it into account,
|
|
Packit |
47f805 |
and last but not least many decoders
|
|
Packit |
47f805 |
don't care about these bits */
|
|
Packit |
47f805 |
int error_protection; /* use 2 bytes per frame for a CRC
|
|
Packit |
47f805 |
checksum. default=0 */
|
|
Packit |
47f805 |
int strict_ISO; /* enforce ISO spec as much as possible */
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
int disable_reservoir; /* use bit reservoir? */
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
/* quantization/noise shaping */
|
|
Packit |
47f805 |
int quant_comp;
|
|
Packit |
47f805 |
int quant_comp_short;
|
|
Packit |
47f805 |
int experimentalY;
|
|
Packit |
47f805 |
int experimentalZ;
|
|
Packit |
47f805 |
int exp_nspsytune;
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
int preset;
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
/* VBR control */
|
|
Packit |
47f805 |
vbr_mode VBR;
|
|
Packit |
47f805 |
float VBR_q_frac; /* Range [0,...,1[ */
|
|
Packit |
47f805 |
int VBR_q; /* Range [0,...,9] */
|
|
Packit |
47f805 |
int VBR_mean_bitrate_kbps;
|
|
Packit |
47f805 |
int VBR_min_bitrate_kbps;
|
|
Packit |
47f805 |
int VBR_max_bitrate_kbps;
|
|
Packit |
47f805 |
int VBR_hard_min; /* strictly enforce VBR_min_bitrate
|
|
Packit |
47f805 |
normaly, it will be violated for analog
|
|
Packit |
47f805 |
silence */
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
/* resampling and filtering */
|
|
Packit |
47f805 |
int lowpassfreq; /* freq in Hz. 0=lame choses.
|
|
Packit |
47f805 |
-1=no filter */
|
|
Packit |
47f805 |
int highpassfreq; /* freq in Hz. 0=lame choses.
|
|
Packit |
47f805 |
-1=no filter */
|
|
Packit |
47f805 |
int lowpasswidth; /* freq width of filter, in Hz
|
|
Packit |
47f805 |
(default=15%) */
|
|
Packit |
47f805 |
int highpasswidth; /* freq width of filter, in Hz
|
|
Packit |
47f805 |
(default=15%) */
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
/*
|
|
Packit |
47f805 |
* psycho acoustics and other arguments which you should not change
|
|
Packit |
47f805 |
* unless you know what you are doing
|
|
Packit |
47f805 |
*/
|
|
Packit |
47f805 |
float maskingadjust;
|
|
Packit |
47f805 |
float maskingadjust_short;
|
|
Packit |
47f805 |
int ATHonly; /* only use ATH */
|
|
Packit |
47f805 |
int ATHshort; /* only use ATH for short blocks */
|
|
Packit |
47f805 |
int noATH; /* disable ATH */
|
|
Packit |
47f805 |
int ATHtype; /* select ATH formula */
|
|
Packit |
47f805 |
float ATHcurve; /* change ATH formula 4 shape */
|
|
Packit |
47f805 |
float ATH_lower_db; /* lower ATH by this many db */
|
|
Packit |
47f805 |
int athaa_type; /* select ATH auto-adjust scheme */
|
|
Packit |
47f805 |
float athaa_sensitivity; /* dB, tune active region of auto-level */
|
|
Packit |
47f805 |
short_block_t short_blocks;
|
|
Packit |
47f805 |
int useTemporal; /* use temporal masking effect */
|
|
Packit |
47f805 |
float interChRatio;
|
|
Packit |
47f805 |
float msfix; /* Naoki's adjustment of Mid/Side maskings */
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
int tune; /* 0 off, 1 on */
|
|
Packit |
47f805 |
float tune_value_a; /* used to pass values for debugging and stuff */
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
float attackthre; /* attack threshold for L/R/M channel */
|
|
Packit |
47f805 |
float attackthre_s; /* attack threshold for S channel */
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
struct {
|
|
Packit |
47f805 |
void (*msgf) (const char *format, va_list ap);
|
|
Packit |
47f805 |
void (*debugf) (const char *format, va_list ap);
|
|
Packit |
47f805 |
void (*errorf) (const char *format, va_list ap);
|
|
Packit |
47f805 |
} report;
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
/************************************************************************/
|
|
Packit |
47f805 |
/* internal variables, do not set... */
|
|
Packit |
47f805 |
/* provided because they may be of use to calling application */
|
|
Packit |
47f805 |
/************************************************************************/
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
int lame_allocated_gfp; /* is this struct owned by calling
|
|
Packit |
47f805 |
program or lame? */
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
/**************************************************************************/
|
|
Packit |
47f805 |
/* more internal variables are stored in this structure: */
|
|
Packit |
47f805 |
/**************************************************************************/
|
|
Packit |
47f805 |
lame_internal_flags *internal_flags;
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
struct {
|
|
Packit |
47f805 |
int mmx;
|
|
Packit |
47f805 |
int amd3dnow;
|
|
Packit |
47f805 |
int sse;
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
} asm_optimizations;
|
|
Packit |
47f805 |
};
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
int is_lame_global_flags_valid(const lame_global_flags * gfp);
|
|
Packit |
47f805 |
|
|
Packit |
47f805 |
#endif /* LAME_GLOBAL_FLAGS_H */
|