Statistics
| Branch: | Revision:

ffmpeg / libavcodec / mpegaudio.h @ a7a85899

History | View | Annotate | Download (1.36 KB)

1
/**
2
 * @file mpegaudio.h
3
 * mpeg audio declarations for both encoder and decoder.
4
 */
5

    
6
/* max frame size, in samples */
7
#define MPA_FRAME_SIZE 1152 
8

    
9
/* max compressed frame size */
10
#define MPA_MAX_CODED_FRAME_SIZE 1792
11

    
12
#define MPA_MAX_CHANNELS 2
13

    
14
#define SBLIMIT 32 /* number of subbands */
15

    
16
#define MPA_STEREO  0
17
#define MPA_JSTEREO 1
18
#define MPA_DUAL    2
19
#define MPA_MONO    3
20

    
21
/* header + layer + bitrate + freq + lsf/mpeg25 */
22
#define SAME_HEADER_MASK \
23
   (0xffe00000 | (3 << 17) | (0xf << 12) | (3 << 10) | (3 << 19))
24

    
25
int l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
26
int mpa_decode_header(AVCodecContext *avctx, uint32_t head);
27

    
28
extern const uint16_t mpa_bitrate_tab[2][3][15];
29
extern const uint16_t mpa_freq_tab[3];
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];
35
extern const int32_t mpa_enwindow[257];
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
}