37 int sample_rate_index, bitrate_index;
38 if (header & (1<<20)) {
39 s->lsf = (header & (1<<19)) ? 0 : 1;
46 s->layer = 4 - ((header >> 17) & 3);
48 sample_rate_index = (header >> 10) & 3;
50 sample_rate_index += 3 * (s->lsf + mpeg25);
51 s->sample_rate_index = sample_rate_index;
52 s->error_protection = ((header >> 16) & 1) ^ 1;
55 bitrate_index = (header >> 12) & 0xf;
56 padding = (header >> 9) & 1;
58 s->mode = (header >> 6) & 3;
59 s->mode_ext = (header >> 4) & 3;
69 if (bitrate_index != 0) {
71 s->bit_rate = frame_size * 1000;
74 frame_size = (frame_size * 12000) / sample_rate;
75 frame_size = (frame_size + padding) * 4;
78 frame_size = (frame_size * 144000) / sample_rate;
79 frame_size += padding;
83 frame_size = (frame_size * 144000) / (sample_rate << s->lsf);
84 frame_size += padding;
95 s->layer, s->sample_rate, s->bit_rate);
96 if (s->nb_channels == 2) {
142 *sample_rate = s->sample_rate;
143 *channels = s->nb_channels;
144 *bit_rate = s->bit_rate;
145 return s->frame_size;