38 int sample_rate_index, bitrate_index;
39 if (header & (1<<20)) {
40 s->lsf = (header & (1<<19)) ? 0 : 1;
47 s->layer = 4 - ((header >> 17) & 3);
49 sample_rate_index = (header >> 10) & 3;
51 sample_rate_index = 0;
53 sample_rate_index += 3 * (s->lsf + mpeg25);
54 s->sample_rate_index = sample_rate_index;
55 s->error_protection = ((header >> 16) & 1) ^ 1;
58 bitrate_index = (header >> 12) & 0xf;
59 padding = (header >> 9) & 1;
61 s->mode = (header >> 6) & 3;
62 s->mode_ext = (header >> 4) & 3;
72 if (bitrate_index != 0) {
74 s->bit_rate = frame_size * 1000;
77 frame_size = (frame_size * 12000) / sample_rate;
78 frame_size = (frame_size + padding) * 4;
81 frame_size = (frame_size * 144000) / sample_rate;
82 frame_size += padding;
86 frame_size = (frame_size * 144000) / (sample_rate << s->lsf);
87 frame_size += padding;
97 av_dlog(NULL,
"layer%d, %d Hz, %d kbits/s, ",
98 s->layer, s->sample_rate, s->bit_rate);
99 if (s->nb_channels == 2) {
145 *sample_rate = s->sample_rate;
146 *channels = s->nb_channels;
147 *bit_rate = s->bit_rate;
148 return s->frame_size;