From 2456e28d9139fc6b2fee59dd058ad83a7e2f3416 Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Sat, 15 Sep 2001 22:42:25 +0000 Subject: merged code and tables between encoder and decoder Originally committed as revision 119 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/mpegaudio.h | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) (limited to 'libavcodec/mpegaudio.h') diff --git a/libavcodec/mpegaudio.h b/libavcodec/mpegaudio.h index 9d5fdfb011..7dc206a1e6 100644 --- a/libavcodec/mpegaudio.h +++ b/libavcodec/mpegaudio.h @@ -1,34 +1,27 @@ +/* mpeg audio declarations for both encoder and decoder */ + +/* max frame size, in samples */ +#define MPA_FRAME_SIZE 1152 /* max compressed frame size */ -#define MPA_MAX_CODED_FRAME_SIZE 1200 +#define MPA_MAX_CODED_FRAME_SIZE 1792 -#define MPA_FRAME_SIZE 1152 #define MPA_MAX_CHANNELS 2 -#define SAMPLES_BUF_SIZE 4096 #define SBLIMIT 32 /* number of subbands */ -#define DCT_BITS 14 /* number of bits for the DCT */ -#define MUL(a,b) (((a) * (b)) >> DCT_BITS) -#define FIX(a) ((int)((a) * (1 << DCT_BITS))) -typedef struct MpegAudioContext { - PutBitContext pb; - int nb_channels; - int freq, bit_rate; - int lsf; /* 1 if mpeg2 low bitrate selected */ - int bitrate_index; /* bit rate */ - int freq_index; - int frame_size; /* frame size, in bits, without padding */ - INT64 nb_samples; /* total number of samples encoded */ - /* padding computation */ - int frame_frac, frame_frac_incr, do_padding; - short samples_buf[MPA_MAX_CHANNELS][SAMPLES_BUF_SIZE]; /* buffer for filter */ - int samples_offset[MPA_MAX_CHANNELS]; /* offset in samples_buf */ - int sb_samples[MPA_MAX_CHANNELS][3][12][SBLIMIT]; - unsigned char scale_factors[MPA_MAX_CHANNELS][SBLIMIT][3]; /* scale factors */ - /* code to group 3 scale factors */ - unsigned char scale_code[MPA_MAX_CHANNELS][SBLIMIT]; - int sblimit; /* number of used subbands */ - const unsigned char *alloc_table; -} MpegAudioContext; +#define MPA_STEREO 0 +#define MPA_JSTEREO 1 +#define MPA_DUAL 2 +#define MPA_MONO 3 + +int l2_select_table(int bitrate, int nb_channels, int freq, int lsf); +const UINT16 mpa_bitrate_tab[2][3][15]; +const UINT16 mpa_freq_tab[3]; +extern const unsigned char *alloc_tables[5]; +extern const double enwindow[512]; +extern const int sblimit_table[5]; +extern const int quant_steps[17]; +extern const int quant_bits[17]; +extern const INT32 mpa_enwindow[257]; -- cgit v1.2.3