Revision a7a85899 libavcodec/mpegaudio.h

View differences:

libavcodec/mpegaudio.h
18 18
#define MPA_DUAL    2
19 19
#define MPA_MONO    3
20 20

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

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

  
......
29 33
extern const int quant_steps[17];
30 34
extern const int quant_bits[17];
31 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
}

Also available in: Unified diff