comparison mpegaudiodec.c @ 1025:1f9afd8b9131 libavcodec

GetBitContext.size is allways multiplied by 8 -> use size_in_bits to avoid useless *8 in a few inner loops
author michaelni
date Tue, 21 Jan 2003 17:34:12 +0000
parents 48349e11c9b2
children bb5de8a59da8
comparison
equal deleted inserted replaced
1024:9cc1031e1864 1025:1f9afd8b9131
1458 /* copy old data before current one */ 1458 /* copy old data before current one */
1459 ptr -= backstep; 1459 ptr -= backstep;
1460 memcpy(ptr, s->inbuf1[s->inbuf_index ^ 1] + 1460 memcpy(ptr, s->inbuf1[s->inbuf_index ^ 1] +
1461 BACKSTEP_SIZE + s->old_frame_size - backstep, backstep); 1461 BACKSTEP_SIZE + s->old_frame_size - backstep, backstep);
1462 /* init get bits again */ 1462 /* init get bits again */
1463 init_get_bits(&s->gb, ptr, s->frame_size + backstep); 1463 init_get_bits(&s->gb, ptr, (s->frame_size + backstep)*8);
1464 1464
1465 /* prepare next buffer */ 1465 /* prepare next buffer */
1466 s->inbuf_index ^= 1; 1466 s->inbuf_index ^= 1;
1467 s->inbuf = &s->inbuf1[s->inbuf_index][BACKSTEP_SIZE]; 1467 s->inbuf = &s->inbuf1[s->inbuf_index][BACKSTEP_SIZE];
1468 s->old_frame_size = s->frame_size; 1468 s->old_frame_size = s->frame_size;
2278 { 2278 {
2279 int i, nb_frames, ch; 2279 int i, nb_frames, ch;
2280 short *samples_ptr; 2280 short *samples_ptr;
2281 2281
2282 init_get_bits(&s->gb, s->inbuf + HEADER_SIZE, 2282 init_get_bits(&s->gb, s->inbuf + HEADER_SIZE,
2283 s->inbuf_ptr - s->inbuf - HEADER_SIZE); 2283 (s->inbuf_ptr - s->inbuf - HEADER_SIZE)*8);
2284 2284
2285 /* skip error protection field */ 2285 /* skip error protection field */
2286 if (s->error_protection) 2286 if (s->error_protection)
2287 get_bits(&s->gb, 16); 2287 get_bits(&s->gb, 16);
2288 2288