static int mp_decode_frame(MPADecodeContext *s, 

                           short *samples)

{

    int i, nb_frames, ch;

    short *samples_ptr;



    init_get_bits(&s->gb, s->inbuf + HEADER_SIZE, 

                  s->inbuf_ptr - s->inbuf - HEADER_SIZE);

    

    /* skip error protection field */

    if (s->error_protection)

        get_bits(&s->gb, 16);



    dprintf("frame %d:\n", s->frame_count);

    switch(s->layer) {

    case 1:

        nb_frames = mp_decode_layer1(s);

        break;

    case 2:

        nb_frames = mp_decode_layer2(s);

        break;

    case 3:

    default:

        nb_frames = mp_decode_layer3(s);

        break;

    }

#if defined(DEBUG)

    for(i=0;i<nb_frames;i++) {

        for(ch=0;ch<s->nb_channels;ch++) {

            int j;

            printf("%d-%d:", i, ch);

            for(j=0;j<SBLIMIT;j++)

                printf(" %0.6f", (double)s->sb_samples[ch][i][j] / FRAC_ONE);

            printf("\n");

        }

    }

#endif

    /* apply the synthesis filter */

    for(ch=0;ch<s->nb_channels;ch++) {

        samples_ptr = samples + ch;

        for(i=0;i<nb_frames;i++) {

            synth_filter(s, ch, samples_ptr, s->nb_channels,

                         s->sb_samples[ch][i]);

            samples_ptr += 32 * s->nb_channels;

        }

    }

#ifdef DEBUG

    s->frame_count++;        

#endif

    return nb_frames * 32 * sizeof(short) * s->nb_channels;

}

static int mp_decode_frame(MPADecodeContext *s, 

                           short *samples)

{

    int i, nb_frames, ch;

    short *samples_ptr;



    init_get_bits(&s->gb, s->inbuf + HEADER_SIZE, 

                  s->inbuf_ptr - s->inbuf - HEADER_SIZE);

    

    

    if (s->error_protection)

        get_bits(&s->gb, 16);



    dprintf("frame %d:\n", s->frame_count);

    switch(s->layer) {

    case 1:

        nb_frames = mp_decode_layer1(s);

        break;

    case 2:

        nb_frames = mp_decode_layer2(s);

        break;

    case 3:

    default:

        nb_frames = mp_decode_layer3(s);

        break;

    }

#if defined(DEBUG)

    for(i=0;i<nb_frames;i++) {

        for(ch=0;ch<s->nb_channels;ch++) {

            int j;

            printf("%d-%d:", i, ch);

            for(j=0;j<SBLIMIT;j++)

                printf(" %0.6f", (double)s->sb_samples[ch][i][j] / FRAC_ONE);

            printf("\n");

        }

    }

#endif

    

    for(ch=0;ch<s->nb_channels;ch++) {

        samples_ptr = samples + ch;

        for(i=0;i<nb_frames;i++) {

            synth_filter(s, ch, samples_ptr, s->nb_channels,

                         s->sb_samples[ch][i]);

            samples_ptr += 32 * s->nb_channels;

        }

    }

#ifdef DEBUG

    s->frame_count++;        

#endif

    return nb_frames * 32 * sizeof(short) * s->nb_channels;

}

static int FUNC_0(MPADecodeContext *VAR_0, 

                           short *VAR_1)

{

    int VAR_2, VAR_3, VAR_4;

    short *VAR_5;



    init_get_bits(&VAR_0->gb, VAR_0->inbuf + HEADER_SIZE, 

                  VAR_0->inbuf_ptr - VAR_0->inbuf - HEADER_SIZE);

    

    

    if (VAR_0->error_protection)

        get_bits(&VAR_0->gb, 16);



    dprintf("frame %d:\n", VAR_0->frame_count);

    switch(VAR_0->layer) {

    case 1:

        VAR_3 = mp_decode_layer1(VAR_0);

        break;

    case 2:

        VAR_3 = mp_decode_layer2(VAR_0);

        break;

    case 3:

    default:

        VAR_3 = mp_decode_layer3(VAR_0);

        break;

    }

#if defined(DEBUG)

    for(VAR_2=0;VAR_2<VAR_3;VAR_2++) {

        for(VAR_4=0;VAR_4<VAR_0->nb_channels;VAR_4++) {

            int j;

            printf("%d-%d:", VAR_2, VAR_4);

            for(j=0;j<SBLIMIT;j++)

                printf(" %0.6f", (double)VAR_0->sb_samples[VAR_4][VAR_2][j] / FRAC_ONE);

            printf("\n");

        }

    }

#endif

    

    for(VAR_4=0;VAR_4<VAR_0->nb_channels;VAR_4++) {

        VAR_5 = VAR_1 + VAR_4;

        for(VAR_2=0;VAR_2<VAR_3;VAR_2++) {

            synth_filter(VAR_0, VAR_4, VAR_5, VAR_0->nb_channels,

                         VAR_0->sb_samples[VAR_4][VAR_2]);

            VAR_5 += 32 * VAR_0->nb_channels;

        }

    }

#ifdef DEBUG

    VAR_0->frame_count++;        

#endif

    return VAR_3 * 32 * sizeof(short) * VAR_0->nb_channels;

}

static int FUNC_0(MPADecodeContext *VAR_0,
short *VAR_1)
{ int VAR_2, VAR_3, VAR_4; short *VAR_5; init_get_bits(&VAR_0->gb, VAR_0->inbuf + HEADER_SIZE,
VAR_0->inbuf_ptr - VAR_0->inbuf - HEADER_SIZE); if (VAR_0->error_protection)
get_bits(&VAR_0->gb, 16); dprintf("frame %d:\n", VAR_0->frame_count); switch(VAR_0->layer) { case 1:
VAR_3 = mp_decode_layer1(VAR_0); break; case 2:
VAR_3 = mp_decode_layer2(VAR_0); break; case 3:
default:
VAR_3 = mp_decode_layer3(VAR_0); break; } #if defined(DEBUG)
for(VAR_2=0;VAR_2<VAR_3;VAR_2++) { for(VAR_4=0;VAR_4<VAR_0->nb_channels;VAR_4++) { int j; printf("%d-%d:", VAR_2, VAR_4); for(j=0;j<SBLIMIT;j++) printf(" %0.6f", (double)VAR_0->sb_samples[VAR_4][VAR_2][j] / FRAC_ONE); printf("\n"); } } #endif
for(VAR_4=0;VAR_4<VAR_0->nb_channels;VAR_4++) { VAR_5 = VAR_1 + VAR_4; for(VAR_2=0;VAR_2<VAR_3;VAR_2++) { synth_filter(VAR_0, VAR_4, VAR_5, VAR_0->nb_channels,
VAR_0->sb_samples[VAR_4][VAR_2]); VAR_5 += 32 * VAR_0->nb_channels; } } #ifdef DEBUG
VAR_0->frame_count++; #endif
return VAR_3 * 32 * sizeof(short) * VAR_0->nb_channels; }