Lines Matching defs:fr
79 get_II_stuff(struct frame *fr)
95 if (fr->lsf)
98 table = translate[fr->sampling_frequency][2 - fr->stereo][fr->bitrate_index];
101 fr->alloc = tables[table];
102 fr->II_sblimit = sblim;
150 print_header(PMPSTR mp, struct frame *fr)
156 fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"),
157 layers[fr->lay], freqs[fr->sampling_frequency],
158 modes[fr->mode], fr->mode_ext, fr->framesize + 4);
160 fr->stereo, fr->copyright ? "Yes" : "No",
161 fr->original ? "Yes" : "No", fr->error_protection ? "Yes" : "No", fr->emphasis);
163 tabsel_123[fr->lsf][fr->lay - 1][fr->bitrate_index], fr->extension);
167 print_header_compact(PMPSTR mp, struct frame *fr)
173 fr->mpeg25 ? "2.5" : (fr->lsf ? "2.0" : "1.0"),
174 layers[fr->lay],
175 tabsel_123[fr->lsf][fr->lay - 1][fr->bitrate_index],
176 freqs[fr->sampling_frequency], modes[fr->mode]);
186 decode_header(PMPSTR mp, struct frame *fr, unsigned long newhead)
191 fr->lsf = (newhead & (1 << 19)) ? 0x0 : 0x1;
192 fr->mpeg25 = 0;
195 fr->lsf = 1;
196 fr->mpeg25 = 1;
200 fr->lay = 4 - ((newhead >> 17) & 3);
202 if (fr->lay != 3 && fr->mpeg25) {
210 if (fr->mpeg25) {
211 fr->sampling_frequency = 6 + ((newhead >> 10) & 0x3);
214 fr->sampling_frequency = ((newhead >> 10) & 0x3) + (fr->lsf * 3);
216 fr->error_protection = ((newhead >> 16) & 0x1) ^ 0x1;
218 if (fr->mpeg25) /* allow Bitrate change for 2.5 ... */
219 fr->bitrate_index = ((newhead >> 12) & 0xf);
221 fr->bitrate_index = ((newhead >> 12) & 0xf);
222 fr->padding = ((newhead >> 9) & 0x1);
223 fr->extension = ((newhead >> 8) & 0x1);
224 fr->mode = ((newhead >> 6) & 0x3);
225 fr->mode_ext = ((newhead >> 4) & 0x3);
226 fr->copyright = ((newhead >> 3) & 0x1);
227 fr->original = ((newhead >> 2) & 0x1);
228 fr->emphasis = newhead & 0x3;
230 fr->stereo = (fr->mode == MPG_MD_MONO) ? 1 : 2;
232 switch (fr->lay) {
234 fr->framesize = (long) tabsel_123[fr->lsf][0][fr->bitrate_index] * 12000;
235 fr->framesize /= freqs[fr->sampling_frequency];
236 fr->framesize = ((fr->framesize + fr->padding) << 2) - 4;
237 fr->down_sample = 0;
238 fr->down_sample_sblimit = SBLIMIT >> (fr->down_sample);
242 fr->framesize = (long) tabsel_123[fr->lsf][1][fr->bitrate_index] * 144000;
243 fr->framesize /= freqs[fr->sampling_frequency];
244 fr->framesize += fr->padding - 4;
245 fr->down_sample = 0;
246 fr->down_sample_sblimit = SBLIMIT >> (fr->down_sample);
251 fr->do_layer = do_layer3;
252 if (fr->lsf)
253 ssize = (fr->stereo == 1) ? 9 : 17;
255 ssize = (fr->stereo == 1) ? 17 : 32;
259 if (fr->error_protection)
262 if (fr->framesize > MAX_INPUT_FRAMESIZE) {
264 fr->framesize = MAX_INPUT_FRAMESIZE;
269 if (fr->bitrate_index == 0)
270 fr->framesize = 0;
272 fr->framesize = (long) tabsel_123[fr->lsf][2][fr->bitrate_index] * 144000;
273 fr->framesize /= freqs[fr->sampling_frequency] << (fr->lsf);
274 fr->framesize = fr->framesize + fr->padding - 4;
278 lame_report_fnc(mp->report_err, "Sorry, layer %d not supported\n", fr->lay);
281 /* print_header(mp, fr); */