39 int sample_rate_index, bitrate_index;
40 if (header & (1<<20)) {
41 s->lsf = (header & (1<<19)) ? 0 : 1;
48 s->layer = 4 - ((header >> 17) & 3);
50 sample_rate_index = (header >> 10) & 3;
52 sample_rate_index = 0;
54 sample_rate_index += 3 * (s->lsf + mpeg25);
55 s->sample_rate_index = sample_rate_index;
56 s->error_protection = ((header >> 16) & 1) ^ 1;
59 bitrate_index = (header >> 12) & 0xf;
60 padding = (header >> 9) & 1;
62 s->mode = (header >> 6) & 3;
63 s->mode_ext = (header >> 4) & 3;
73 if (bitrate_index != 0) {
75 s->bit_rate = frame_size * 1000;
78 frame_size = (frame_size * 12000) / sample_rate;
79 frame_size = (frame_size + padding) * 4;
82 frame_size = (frame_size * 144000) / sample_rate;
83 frame_size += padding;
87 frame_size = (frame_size * 144000) / (sample_rate << s->lsf);
88 frame_size += padding;
99 s->layer, s->sample_rate, s->bit_rate);
100 if (s->nb_channels == 2) {
147 *sample_rate = s->sample_rate;
148 *channels = s->nb_channels;
149 *bit_rate = s->bit_rate;
150 return s->frame_size;
#define FF_ARRAY_ELEMS(a)
mpeg audio layer common tables.
const uint16_t avpriv_mpa_freq_tab[3]
static const uint8_t header[24]
AVCodecID
Identify the syntax and semantics of the bitstream.
#define MODE_EXT_MS_STEREO
preferred ID for decoding MPEG audio layer 1, 2 or 3
Libavcodec external API header.
main external API structure.
#define MODE_EXT_I_STEREO
common internal api header.
common internal and external API header
mpeg audio declarations for both encoder and decoder.
const uint16_t avpriv_mpa_bitrate_tab[2][3][15]