comparison mpegaudiodec.c @ 6701:ef18192d8474 libavcodec

simplify
author bcoudurier
date Sat, 26 Apr 2008 14:30:06 +0000
parents dd38dc6306a8
children a9a28c8b40fb
comparison
equal deleted inserted replaced
6700:dd38dc6306a8 6701:ef18192d8474
2571 OUT_INT *out_samples = data; 2571 OUT_INT *out_samples = data;
2572 OUT_INT decoded_buf[MPA_FRAME_SIZE * MPA_MAX_CHANNELS]; 2572 OUT_INT decoded_buf[MPA_FRAME_SIZE * MPA_MAX_CHANNELS];
2573 OUT_INT *outptr, *bp; 2573 OUT_INT *outptr, *bp;
2574 int fsize; 2574 int fsize;
2575 int fr, i, j, n; 2575 int fr, i, j, n;
2576 int off = avctx->channels;
2577 2576
2578 len = buf_size; 2577 len = buf_size;
2579 2578
2580 *data_size = 0; 2579 *data_size = 0;
2581 // Discard too short frames 2580 // Discard too short frames
2608 /* interleave output data */ 2607 /* interleave output data */
2609 bp = out_samples + s->coff[fr]; 2608 bp = out_samples + s->coff[fr];
2610 if(m->nb_channels == 1) { 2609 if(m->nb_channels == 1) {
2611 for(j = 0; j < n; j++) { 2610 for(j = 0; j < n; j++) {
2612 *bp = decoded_buf[j]; 2611 *bp = decoded_buf[j];
2613 bp += off; 2612 bp += avctx->channels;
2614 } 2613 }
2615 } else { 2614 } else {
2616 for(j = 0; j < n; j++) { 2615 for(j = 0; j < n; j++) {
2617 bp[0] = decoded_buf[j++]; 2616 bp[0] = decoded_buf[j++];
2618 bp[1] = decoded_buf[j]; 2617 bp[1] = decoded_buf[j];
2619 bp += off; 2618 bp += avctx->channels;
2620 } 2619 }
2621 } 2620 }
2622 } 2621 }
2623 } 2622 }
2624 2623