util.h File Reference

#include "l3side.h"
#include "id3tag.h"

Include dependency graph for util.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  aligned_pointer_t
struct  bit_stream_struc
struct  nsPsy_t
struct  VBR_seek_info_t
struct  ATH_t
 ATH related stuff, if something new ATH related has to be added, please plugg it here into the ATH_t struct. More...
struct  PSY_t
 PSY Model related stuff. More...
struct  lame_internal_flags

Defines

#define FALSE   0
#define TRUE   (!FALSE)
#define MAX_U_32_NUM   0xFFFFFFFF
#define PI   3.14159265358979323846
#define LOG2   0.69314718055994530942
#define LOG10   2.30258509299404568402
#define SQRT2   1.41421356237309504880
#define HAN_SIZE   512
#define CRC16_POLYNOMIAL   0x8005
#define MAX_BITS_PER_CHANNEL   4095
#define MAX_BITS_PER_GRANULE   7680
#define BUFFER_SIZE   LAME_MAXMP3BUFFER
#define Min(A, B)   ((A) < (B) ? (A) : (B))
#define Max(A, B)   ((A) > (B) ? (A) : (B))
#define FAST_LOG10(x)   log10(x)
#define FAST_LOG(x)   log(x)
#define FAST_LOG10_X(x, y)   (log10(x)*(y))
#define FAST_LOG_X(x, y)   (log(x)*(y))
#define MAX_CHANNELS   2
#define LAME_ID   0xFFF88E3B
#define MFSIZE   ( 3*1152 + ENCDELAY - MDCTDELAY )
#define BPC   320
#define MAX_HEADER_BUF   256
#define MAX_HEADER_LEN   40
#define DEBUGF   lame_debugf
#define ERRORF   lame_errorf
#define MSGF   lame_msgf

Typedefs

typedef replaygain_data replaygain_t
typedef plotting_data plotting_data
typedef void(*) iteration_loop_t (lame_global_flags const *gfp, FLOAT const pe[2][2], FLOAT const ms_ratio[2], III_psy_ratio const ratio[2][2])
typedef bit_stream_struc Bit_stream_struc
typedef lame_internal_flags lame_internal_flags

Functions

void malloc_aligned (aligned_pointer_t *ptr, unsigned int size, unsigned int bytes)
void free_aligned (aligned_pointer_t *ptr)
void freegfc (lame_internal_flags *const gfc)
void free_id3tag (lame_internal_flags *const gfc)
int BitrateIndex (int, int, int)
int FindNearestBitrate (int, int, int)
int map2MP3Frequency (int freq)
int SmpFrqIndex (int, int *const)
int nearestBitrateFullIndex (const int brate)
FLOAT ATHformula (FLOAT freq, lame_global_flags const *gfp)
FLOAT freq2bark (FLOAT freq)
FLOAT freq2cbw (FLOAT freq)
void disable_FPE (void)
void init_log_table (void)
ieee754_float32_t fast_log2 (ieee754_float32_t x)
void fill_buffer (lame_global_flags const *gfp, sample_t *mfbuf[2], sample_t const *in_buffer[2], int nsamples, int *n_in, int *n_out)
int fill_buffer_resample (lame_global_flags const *gfp, sample_t *outbuf, int desired_len, sample_t const *inbuf, int len, int *num_used, int channels)
int lame_decode1_unclipped (unsigned char *mp3buf, int len, sample_t pcm_l[], sample_t pcm_r[])
int has_MMX (void)
int has_3DNow (void)
int has_SSE (void)
int has_SSE2 (void)
void lame_errorf (const lame_internal_flags *gfc, const char *,...)
void lame_debugf (const lame_internal_flags *gfc, const char *,...)
void lame_msgf (const lame_internal_flags *gfc, const char *,...)


Define Documentation

#define BPC   320

Definition at line 339 of file util.h.

Referenced by fill_buffer_resample(), and freegfc().

#define BUFFER_SIZE   LAME_MAXMP3BUFFER

Definition at line 88 of file util.h.

Referenced by init_bit_stream_w(), putbits2(), and putbits_noheaders().

#define CRC16_POLYNOMIAL   0x8005

Definition at line 82 of file util.h.

Referenced by CRC_update().

#define DEBUGF   lame_debugf

Definition at line 546 of file util.h.

Referenced by compute_flushbits(), huffman_coder_count1(), and writeMainData().

#define ERRORF   lame_errorf

Definition at line 547 of file util.h.

Referenced by compute_flushbits(), format_bitstream(), InitVbrTag(), lame_mp3_tags_fid(), lame_set_athaa_loudapprox(), and update_inbuffer_size().

#define FALSE   0

Definition at line 39 of file util.h.

#define FAST_LOG (  )     log(x)

Definition at line 101 of file util.h.

Referenced by L3psycho_anal(), and L3psycho_anal_ns().

#define FAST_LOG10 (  )     log10(x)

Definition at line 100 of file util.h.

Referenced by calc_noise(), pecalc_l(), pecalc_s(), and penalties().

#define FAST_LOG10_X ( x,
 )     (log10(x)*(y))

Definition at line 102 of file util.h.

Referenced by athAdjust(), and mask_add().

#define FAST_LOG_X ( x,
 )     (log(x)*(y))

Definition at line 103 of file util.h.

Referenced by determine_block_type(), and L3psycho_anal().

#define HAN_SIZE   512

Definition at line 81 of file util.h.

#define LAME_ID   0xFFF88E3B

Definition at line 241 of file util.h.

Referenced by lame_close(), lame_encode(), lame_encode_buffer(), lame_encode_buffer_float(), lame_encode_buffer_int(), lame_encode_buffer_long(), lame_encode_buffer_long2(), lame_encode_buffer_sample_t(), and lame_init_params().

#define LOG10   2.30258509299404568402

Definition at line 70 of file util.h.

Referenced by pecalc_l(), and pecalc_s().

#define LOG2   0.69314718055994530942

Definition at line 64 of file util.h.

#define Max ( A,
 )     ((A) > (B) ? (A) : (B))

Definition at line 91 of file util.h.

Referenced by adjust_ATH(), ATHformula_GB(), bitpressure_strategy(), calc_min_bits(), calc_noise(), determine_block_type(), get_klemm_noise(), L3psycho_anal(), lame_init_params(), msfix1(), nearestBitrateFullIndex(), ns_msfix(), parse_args(), set_pinfo(), set_subblock_gain(), and writeMainData().

#define MAX_BITS_PER_CHANNEL   4095

Definition at line 84 of file util.h.

Referenced by calc_target_bits(), CBR_iteration_loop(), on_pe(), reduce_side(), and VBR_encode_granule().

#define MAX_BITS_PER_GRANULE   7680

Definition at line 85 of file util.h.

Referenced by calc_target_bits(), on_pe(), and reduce_side().

#define MAX_CHANNELS   2

Definition at line 217 of file util.h.

#define MAX_HEADER_BUF   256

Definition at line 357 of file util.h.

Referenced by add_dummy_byte(), compute_flushbits(), flush_bitstream(), format_bitstream(), and putheader_bits().

#define MAX_HEADER_LEN   40

Definition at line 358 of file util.h.

#define MAX_U_32_NUM   0xFFFFFFFF

Definition at line 49 of file util.h.

Referenced by get_audio_common(), id3tag_write_v2(), lame_init_old(), and OpenSndFile().

#define MFSIZE   ( 3*1152 + ENCDELAY - MDCTDELAY )

Definition at line 249 of file util.h.

#define Min ( A,
 )     ((A) < (B) ? (A) : (B))

Definition at line 90 of file util.h.

Referenced by calc_min_bits(), compute_ath(), compute_masking_s(), determine_block_type(), fill_buffer(), fill_buffer_resample(), fskip(), get_audio_common(), init_numline(), L3psycho_anal(), L3psycho_anal_ns(), lame_init_params(), lame_init_params_ppflt(), msfix1(), noquant_count_bits(), ns_msfix(), on_pe(), parse_args(), putbits2(), putbits_noheaders(), ResvFrameBegin(), ResvFrameEnd(), short_block_constrain(), and writeheader().

#define MSGF   lame_msgf

Definition at line 548 of file util.h.

Referenced by lame_print_config(), and lame_print_internals().

#define PI   3.14159265358979323846

Definition at line 56 of file util.h.

Referenced by blackman(), filter_coef(), init_fft(), and init_numline().

#define SQRT2   1.41421356237309504880

Definition at line 77 of file util.h.

Referenced by compute_ffts(), fht(), ms_convert(), and window_subband().

#define TRUE   (!FALSE)

Definition at line 43 of file util.h.


Typedef Documentation

typedef struct bit_stream_struc Bit_stream_struc

typedef void(*) iteration_loop_t(lame_global_flags const *gfp, FLOAT const pe[2][2], FLOAT const ms_ratio[2], III_psy_ratio const ratio[2][2])

Definition at line 134 of file util.h.

typedef struct lame_internal_flags lame_internal_flags

Definition at line 487 of file util.h.

typedef struct plotting_data plotting_data

Definition at line 115 of file util.h.

typedef struct replaygain_data replaygain_t

Definition at line 110 of file util.h.


Function Documentation

FLOAT ATHformula ( FLOAT  freq,
lame_global_flags const *  gfp 
)

Definition at line 226 of file util.c.

References lame_global_struct::ATHcurve, ATHformula_GB(), lame_global_struct::ATHtype, and gfp.

Referenced by ATHmdct().

Here is the call graph for this function:

int BitrateIndex ( int  ,
int  ,
int   
)

Definition at line 392 of file util.c.

References bitrate_table, and i.

Referenced by lame_init_params(), and PutVbrTag().

void disable_FPE ( void   ) 

Definition at line 793 of file util.c.

Referenced by lame_init_old().

ieee754_float32_t fast_log2 ( ieee754_float32_t  x  ) 

void fill_buffer ( lame_global_flags const *  gfp,
sample_t mfbuf[2],
sample_t const *  in_buffer[2],
int  nsamples,
int *  n_in,
int *  n_out 
)

Definition at line 508 of file util.c.

References lame_internal_flags::channels_out, fill_buffer_resample(), lame_global_struct::framesize, gfc, gfp, i, lame_global_struct::internal_flags, lame_internal_flags::mf_size, Min, and lame_internal_flags::resample_ratio.

Here is the call graph for this function:

int fill_buffer_resample ( lame_global_flags const *  gfp,
sample_t outbuf,
int  desired_len,
sample_t const *  inbuf,
int  len,
int *  num_used,
int  channels 
)

Definition at line 537 of file util.c.

References lame_internal_flags::blackfilt, blackman(), BPC, lame_internal_flags::fill_buffer_resample_init, gcd(), gfc, gfp, i, lame_global_struct::in_samplerate, lame_internal_flags::inbuf_old, lame_global_struct::internal_flags, lame_internal_flags::itime, Min, lame_global_struct::out_samplerate, lame_global_struct::quality, and lame_internal_flags::resample_ratio.

Referenced by fill_buffer().

Here is the call graph for this function:

int FindNearestBitrate ( int  ,
int  ,
int   
)

Definition at line 274 of file util.c.

References ABS, bitrate_table, and i.

Referenced by lame_init_params().

void free_aligned ( aligned_pointer_t ptr  ) 

Definition at line 168 of file util.c.

References aligned_pointer_t::aligned, and aligned_pointer_t::pointer.

void free_id3tag ( lame_internal_flags *const  gfc  ) 

Definition at line 49 of file util.c.

References id3tag_spec::album, id3tag_spec::albumart, id3tag_spec::albumart_mimetype, id3tag_spec::albumart_size, id3tag_spec::artist, id3tag_spec::comment, id3tag_spec::genre_id3v2, gfc, i, MIMETYPE_NONE, id3tag_spec::num_values, lame_internal_flags::tag_spec, id3tag_spec::title, id3tag_spec::track_id3v2, and id3tag_spec::values.

Referenced by id3tag_init().

void freegfc ( lame_internal_flags *const  gfc  ) 

Definition at line 95 of file util.c.

References lame_internal_flags::blackfilt, BPC, gfc, and i.

Referenced by lame_close(), and lame_init_params().

FLOAT freq2bark ( FLOAT  freq  ) 

Definition at line 248 of file util.c.

Referenced by init_numline().

FLOAT freq2cbw ( FLOAT  freq  ) 

Definition at line 259 of file util.c.

int has_3DNow ( void   ) 

Definition at line 752 of file util.c.

Referenced by lame_init_params().

int has_MMX ( void   ) 

Definition at line 741 of file util.c.

Referenced by lame_init_params().

int has_SSE ( void   ) 

Definition at line 763 of file util.c.

Referenced by lame_init_params().

int has_SSE2 ( void   ) 

Definition at line 778 of file util.c.

Referenced by lame_init_params().

void init_log_table ( void   ) 

Definition at line 970 of file util.c.

Referenced by lame_init().

void lame_debugf ( const lame_internal_flags gfc,
const char *  ,
  ... 
)

Definition at line 673 of file util.c.

References lame_internal_flags::debugf, gfc, and lame_internal_flags::report.

int lame_decode1_unclipped ( unsigned char *  mp3buf,
int  len,
sample_t  pcm_l[],
sample_t  pcm_r[] 
)

Referenced by copy_buffer().

void lame_errorf ( const lame_internal_flags gfc,
const char *  ,
  ... 
)

Definition at line 711 of file util.c.

References lame_internal_flags::errorf, gfc, and lame_internal_flags::report.

void lame_msgf ( const lame_internal_flags gfc,
const char *  ,
  ... 
)

Definition at line 692 of file util.c.

References gfc, lame_internal_flags::msgf, and lame_internal_flags::report.

void malloc_aligned ( aligned_pointer_t ptr,
unsigned int  size,
unsigned int  bytes 
)

Definition at line 152 of file util.c.

References aligned_pointer_t::aligned, and aligned_pointer_t::pointer.

int map2MP3Frequency ( int  freq  ) 

Definition at line 369 of file util.c.

Referenced by lame_init_params().

int nearestBitrateFullIndex ( const int  brate  ) 

Definition at line 316 of file util.c.

References bitrate_table, and Max.

Referenced by apply_abr_preset(), and optimum_bandwidth().

int SmpFrqIndex ( int  ,
int *  const 
)

Definition at line 412 of file util.c.

Referenced by lame_init_params().


Generated on Sun Dec 2 11:37:07 2007 for LAME by  doxygen 1.5.2