annotate mpegaudio.h @ 2497:69adfbbdcdeb libavcodec

- samples from mplayer ftp in the "adv" profile seem to have profile=2, which isn't the advanced one; and indeed, using adv. profile parser fails. Using normal parser works, and that's what is done - attempt at taking care of stride for NORM2 bitplane decoding - duplication of much code from msmpeg4.c; this code isn't yet used, but goes down as far as the block layer (mainly Transform Type stuff, the remains are wild editing without checking). Unusable yet, and lacks the AC decoding (but a step further in bitstream parsing) patch by anonymous
author michael
date Fri, 04 Feb 2005 02:20:38 +0000
parents 021dc26e760f
children cc55bc1f8d92
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1106
1e39f273ecd6 per file doxy
michaelni
parents: 1064
diff changeset
1 /**
1e39f273ecd6 per file doxy
michaelni
parents: 1064
diff changeset
2 * @file mpegaudio.h
1e39f273ecd6 per file doxy
michaelni
parents: 1064
diff changeset
3 * mpeg audio declarations for both encoder and decoder.
1e39f273ecd6 per file doxy
michaelni
parents: 1064
diff changeset
4 */
84
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
5
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
6 /* max frame size, in samples */
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
7 #define MPA_FRAME_SIZE 1152
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
8
986e461dc072 Initial revision
glantau
parents:
diff changeset
9 /* max compressed frame size */
84
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
10 #define MPA_MAX_CODED_FRAME_SIZE 1792
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
11
986e461dc072 Initial revision
glantau
parents:
diff changeset
12 #define MPA_MAX_CHANNELS 2
986e461dc072 Initial revision
glantau
parents:
diff changeset
13
986e461dc072 Initial revision
glantau
parents:
diff changeset
14 #define SBLIMIT 32 /* number of subbands */
84
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
15
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
16 #define MPA_STEREO 0
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
17 #define MPA_JSTEREO 1
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
18 #define MPA_DUAL 2
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
19 #define MPA_MONO 3
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
20
2472
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
21 /* header + layer + bitrate + freq + lsf/mpeg25 */
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
22 #define SAME_HEADER_MASK \
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
23 (0xffe00000 | (3 << 17) | (0xf << 12) | (3 << 10) | (3 << 19))
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
24
84
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
25 int l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
1612
0d2b59cf9f45 exported mpa_decode_header for new parser API
bellard
parents: 1106
diff changeset
26 int mpa_decode_header(AVCodecContext *avctx, uint32_t head);
0
986e461dc072 Initial revision
glantau
parents:
diff changeset
27
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 472
diff changeset
28 extern const uint16_t mpa_bitrate_tab[2][3][15];
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 472
diff changeset
29 extern const uint16_t mpa_freq_tab[3];
84
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
30 extern const unsigned char *alloc_tables[5];
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
31 extern const double enwindow[512];
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
32 extern const int sblimit_table[5];
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
33 extern const int quant_steps[17];
608c7f964bca merged code and tables between encoder and decoder
glantau
parents: 64
diff changeset
34 extern const int quant_bits[17];
1064
b32afefe7d33 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 472
diff changeset
35 extern const int32_t mpa_enwindow[257];
2472
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
36
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
37 /* fast header check for resync */
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
38 static inline int ff_mpa_check_header(uint32_t header){
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
39 /* header */
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
40 if ((header & 0xffe00000) != 0xffe00000)
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
41 return -1;
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
42 /* layer check */
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
43 if ((header & (3<<17)) == 0)
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
44 return -1;
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
45 /* bit rate */
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
46 if ((header & (0xf<<12)) == 0xf<<12)
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
47 return -1;
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
48 /* frequency */
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
49 if ((header & (3<<10)) == 3<<10)
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
50 return -1;
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
51 return 0;
021dc26e760f dithering for the mpeg audio decoder
michael
parents: 1612
diff changeset
52 }