1106
|
1 /**
|
|
2 * @file mpegaudio.h
|
|
3 * mpeg audio declarations for both encoder and decoder.
|
|
4 */
|
84
|
5
|
|
6 /* max frame size, in samples */
|
|
7 #define MPA_FRAME_SIZE 1152
|
0
|
8
|
|
9 /* max compressed frame size */
|
84
|
10 #define MPA_MAX_CODED_FRAME_SIZE 1792
|
0
|
11
|
|
12 #define MPA_MAX_CHANNELS 2
|
|
13
|
|
14 #define SBLIMIT 32 /* number of subbands */
|
84
|
15
|
|
16 #define MPA_STEREO 0
|
|
17 #define MPA_JSTEREO 1
|
|
18 #define MPA_DUAL 2
|
|
19 #define MPA_MONO 3
|
|
20
|
2472
|
21 /* header + layer + bitrate + freq + lsf/mpeg25 */
|
|
22 #define SAME_HEADER_MASK \
|
|
23 (0xffe00000 | (3 << 17) | (0xf << 12) | (3 << 10) | (3 << 19))
|
|
24
|
84
|
25 int l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
|
1612
|
26 int mpa_decode_header(AVCodecContext *avctx, uint32_t head);
|
0
|
27
|
1064
|
28 extern const uint16_t mpa_bitrate_tab[2][3][15];
|
|
29 extern const uint16_t mpa_freq_tab[3];
|
84
|
30 extern const unsigned char *alloc_tables[5];
|
|
31 extern const double enwindow[512];
|
|
32 extern const int sblimit_table[5];
|
|
33 extern const int quant_steps[17];
|
|
34 extern const int quant_bits[17];
|
1064
|
35 extern const int32_t mpa_enwindow[257];
|
2472
|
36
|
|
37 /* fast header check for resync */
|
|
38 static inline int ff_mpa_check_header(uint32_t header){
|
|
39 /* header */
|
|
40 if ((header & 0xffe00000) != 0xffe00000)
|
|
41 return -1;
|
|
42 /* layer check */
|
|
43 if ((header & (3<<17)) == 0)
|
|
44 return -1;
|
|
45 /* bit rate */
|
|
46 if ((header & (0xf<<12)) == 0xf<<12)
|
|
47 return -1;
|
|
48 /* frequency */
|
|
49 if ((header & (3<<10)) == 3<<10)
|
|
50 return -1;
|
|
51 return 0;
|
|
52 }
|