2 /* max compressed frame size */
3 #define MPA_MAX_CODED_FRAME_SIZE 1200
5 #define MPA_FRAME_SIZE 1152
6 #define MPA_MAX_CHANNELS 2
8 #define SAMPLES_BUF_SIZE 4096
9 #define SBLIMIT 32 /* number of subbands */
10 #define DCT_BITS 14 /* number of bits for the DCT */
11 #define MUL(a,b) (((a) * (b)) >> DCT_BITS)
12 #define FIX(a) ((int)((a) * (1 << DCT_BITS)))
14 typedef struct MpegAudioContext {
18 int lsf; /* 1 if mpeg2 low bitrate selected */
19 int bitrate_index; /* bit rate */
21 int frame_size; /* frame size, in bits, without padding */
22 INT64 nb_samples; /* total number of samples encoded */
23 /* padding computation */
24 int frame_frac, frame_frac_incr, do_padding;
25 short samples_buf[MPA_MAX_CHANNELS][SAMPLES_BUF_SIZE]; /* buffer for filter */
26 int samples_offset[MPA_MAX_CHANNELS]; /* offset in samples_buf */
27 int sb_samples[MPA_MAX_CHANNELS][3][12][SBLIMIT];
28 unsigned char scale_factors[MPA_MAX_CHANNELS][SBLIMIT][3]; /* scale factors */
29 /* code to group 3 scale factors */
30 unsigned char scale_code[MPA_MAX_CHANNELS][SBLIMIT];
31 int sblimit; /* number of used subbands */
32 const unsigned char *alloc_table;