static void joint_decode(COOKContext *q, float* mlt_buffer1,

                         float* mlt_buffer2) {

    int i,j;

    int decouple_tab[SUBBAND_SIZE];

    float decode_buffer[2048];  //Only 1060 might be needed.

    int idx, cpl_tmp,tmp_idx;

    float f1,f2;

    float* cplscale;



    memset(decouple_tab, 0, sizeof(decouple_tab));

    memset(decode_buffer, 0, sizeof(decode_buffer));



    /* Make sure the buffers are zeroed out. */

    memset(mlt_buffer1,0, 1024*sizeof(float));

    memset(mlt_buffer2,0, 1024*sizeof(float));

    decouple_info(q, decouple_tab);

    mono_decode(q, decode_buffer);



    /* The two channels are stored interleaved in decode_buffer. */

    for (i=0 ; i<q->js_subband_start ; i++) {

        for (j=0 ; j<SUBBAND_SIZE ; j++) {

            mlt_buffer1[i*20+j] = decode_buffer[i*40+j];

            mlt_buffer2[i*20+j] = decode_buffer[i*40+20+j];

        }

    }



    /* When we reach js_subband_start (the higher frequencies)

       the coefficients are stored in a coupling scheme. */

    idx = (1 << q->js_vlc_bits) - 1;

    if (q->js_subband_start < q->subbands) {

        for (i=0 ; i<q->subbands ; i++) {

            cpl_tmp = cplband[i + q->js_subband_start];

            idx -=decouple_tab[cpl_tmp];

            cplscale = (float*)cplscales[q->js_vlc_bits-2];  //choose decoupler table

            f1 = cplscale[decouple_tab[cpl_tmp]];

            f2 = cplscale[idx-1];

            for (j=0 ; j<SUBBAND_SIZE ; j++) {

                tmp_idx = ((2*q->js_subband_start + i)*20)+j;

                mlt_buffer1[20*(i+q->js_subband_start) + j] = f1 * decode_buffer[tmp_idx];

                mlt_buffer2[20*(i+q->js_subband_start) + j] = f2 * decode_buffer[tmp_idx];

            }

            idx = (1 << q->js_vlc_bits) - 1;

        }

    }

}

static void joint_decode(COOKContext *q, float* mlt_buffer1,

                         float* mlt_buffer2) {

    int i,j;

    int decouple_tab[SUBBAND_SIZE];

    float decode_buffer[2048];  

    int idx, cpl_tmp,tmp_idx;

    float f1,f2;

    float* cplscale;



    memset(decouple_tab, 0, sizeof(decouple_tab));

    memset(decode_buffer, 0, sizeof(decode_buffer));



    

    memset(mlt_buffer1,0, 1024*sizeof(float));

    memset(mlt_buffer2,0, 1024*sizeof(float));

    decouple_info(q, decouple_tab);

    mono_decode(q, decode_buffer);



    

    for (i=0 ; i<q->js_subband_start ; i++) {

        for (j=0 ; j<SUBBAND_SIZE ; j++) {

            mlt_buffer1[i*20+j] = decode_buffer[i*40+j];

            mlt_buffer2[i*20+j] = decode_buffer[i*40+20+j];

        }

    }



    



    idx = (1 << q->js_vlc_bits) - 1;

    if (q->js_subband_start < q->subbands) {

        for (i=0 ; i<q->subbands ; i++) {

            cpl_tmp = cplband[i + q->js_subband_start];

            idx -=decouple_tab[cpl_tmp];

            cplscale = (float*)cplscales[q->js_vlc_bits-2];  

            f1 = cplscale[decouple_tab[cpl_tmp]];

            f2 = cplscale[idx-1];

            for (j=0 ; j<SUBBAND_SIZE ; j++) {

                tmp_idx = ((2*q->js_subband_start + i)*20)+j;

                mlt_buffer1[20*(i+q->js_subband_start) + j] = f1 * decode_buffer[tmp_idx];

                mlt_buffer2[20*(i+q->js_subband_start) + j] = f2 * decode_buffer[tmp_idx];

            }

            idx = (1 << q->js_vlc_bits) - 1;

        }

    }

}

static void FUNC_0(COOKContext *VAR_0, float* VAR_1,

                         float* VAR_2) {

    int VAR_3,VAR_4;

    int VAR_5[SUBBAND_SIZE];

    float VAR_6[2048];  

    int VAR_7, VAR_8,VAR_9;

    float VAR_10,VAR_11;

    float* VAR_12;



    memset(VAR_5, 0, sizeof(VAR_5));

    memset(VAR_6, 0, sizeof(VAR_6));



    

    memset(VAR_1,0, 1024*sizeof(float));

    memset(VAR_2,0, 1024*sizeof(float));

    decouple_info(VAR_0, VAR_5);

    mono_decode(VAR_0, VAR_6);



    

    for (VAR_3=0 ; VAR_3<VAR_0->js_subband_start ; VAR_3++) {

        for (VAR_4=0 ; VAR_4<SUBBAND_SIZE ; VAR_4++) {

            VAR_1[VAR_3*20+VAR_4] = VAR_6[VAR_3*40+VAR_4];

            VAR_2[VAR_3*20+VAR_4] = VAR_6[VAR_3*40+20+VAR_4];

        }

    }



    



    VAR_7 = (1 << VAR_0->js_vlc_bits) - 1;

    if (VAR_0->js_subband_start < VAR_0->subbands) {

        for (VAR_3=0 ; VAR_3<VAR_0->subbands ; VAR_3++) {

            VAR_8 = cplband[VAR_3 + VAR_0->js_subband_start];

            VAR_7 -=VAR_5[VAR_8];

            VAR_12 = (float*)cplscales[VAR_0->js_vlc_bits-2];  

            VAR_10 = VAR_12[VAR_5[VAR_8]];

            VAR_11 = VAR_12[VAR_7-1];

            for (VAR_4=0 ; VAR_4<SUBBAND_SIZE ; VAR_4++) {

                VAR_9 = ((2*VAR_0->js_subband_start + VAR_3)*20)+VAR_4;

                VAR_1[20*(VAR_3+VAR_0->js_subband_start) + VAR_4] = VAR_10 * VAR_6[VAR_9];

                VAR_2[20*(VAR_3+VAR_0->js_subband_start) + VAR_4] = VAR_11 * VAR_6[VAR_9];

            }

            VAR_7 = (1 << VAR_0->js_vlc_bits) - 1;

        }

    }

}

static void FUNC_0(COOKContext *VAR_0, float* VAR_1,
float* VAR_2) { int VAR_3,VAR_4; int VAR_5[SUBBAND_SIZE]; float VAR_6[2048]; int VAR_7, VAR_8,VAR_9; float VAR_10,VAR_11; float* VAR_12; memset(VAR_5, 0, sizeof(VAR_5)); memset(VAR_6, 0, sizeof(VAR_6)); memset(VAR_1,0, 1024*sizeof(float)); memset(VAR_2,0, 1024*sizeof(float)); decouple_info(VAR_0, VAR_5); mono_decode(VAR_0, VAR_6); for (VAR_3=0 ; VAR_3<VAR_0->js_subband_start ; VAR_3++) { for (VAR_4=0 ; VAR_4<SUBBAND_SIZE ; VAR_4++) { VAR_1[VAR_3*20+VAR_4] = VAR_6[VAR_3*40+VAR_4]; VAR_2[VAR_3*20+VAR_4] = VAR_6[VAR_3*40+20+VAR_4]; } } VAR_7 = (1 << VAR_0->js_vlc_bits) - 1; if (VAR_0->js_subband_start < VAR_0->subbands) { for (VAR_3=0 ; VAR_3<VAR_0->subbands ; VAR_3++) { VAR_8 = cplband[VAR_3 + VAR_0->js_subband_start]; VAR_7 -=VAR_5[VAR_8]; VAR_12 = (float*)cplscales[VAR_0->js_vlc_bits-2]; VAR_10 = VAR_12[VAR_5[VAR_8]]; VAR_11 = VAR_12[VAR_7-1]; for (VAR_4=0 ; VAR_4<SUBBAND_SIZE ; VAR_4++) { VAR_9 = ((2*VAR_0->js_subband_start + VAR_3)*20)+VAR_4; VAR_1[20*(VAR_3+VAR_0->js_subband_start) + VAR_4] = VAR_10 * VAR_6[VAR_9]; VAR_2[20*(VAR_3+VAR_0->js_subband_start) + VAR_4] = VAR_11 * VAR_6[VAR_9]; } VAR_7 = (1 << VAR_0->js_vlc_bits) - 1; } } }