static void compute_stereo(MPADecodeContext *s, GranuleDef *g0, GranuleDef *g1)

{

    int i, j, k, l;

    int sf_max, sf, len, non_zero_found;

    INTFLOAT (*is_tab)[16], *tab0, *tab1, tmp0, tmp1, v1, v2;

    int non_zero_found_short[3];



    /* intensity stereo */

    if (s->mode_ext & MODE_EXT_I_STEREO) {

        if (!s->lsf) {

            is_tab = is_table;

            sf_max = 7;

        } else {

            is_tab = is_table_lsf[g1->scalefac_compress & 1];

            sf_max = 16;

        }



        tab0 = g0->sb_hybrid + 576;

        tab1 = g1->sb_hybrid + 576;



        non_zero_found_short[0] = 0;

        non_zero_found_short[1] = 0;

        non_zero_found_short[2] = 0;

        k = (13 - g1->short_start) * 3 + g1->long_end - 3;

        for (i = 12; i >= g1->short_start; i--) {

            /* for last band, use previous scale factor */

            if (i != 11)

                k -= 3;

            len = band_size_short[s->sample_rate_index][i];

            for (l = 2; l >= 0; l--) {

                tab0 -= len;

                tab1 -= len;

                if (!non_zero_found_short[l]) {

                    /* test if non zero band. if so, stop doing i-stereo */

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

                        if (tab1[j] != 0) {

                            non_zero_found_short[l] = 1;

                            goto found1;

                        }

                    }

                    sf = g1->scale_factors[k + l];

                    if (sf >= sf_max)

                        goto found1;



                    v1 = is_tab[0][sf];

                    v2 = is_tab[1][sf];

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

                        tmp0    = tab0[j];

                        tab0[j] = MULLx(tmp0, v1, FRAC_BITS);

                        tab1[j] = MULLx(tmp0, v2, FRAC_BITS);

                    }

                } else {

found1:

                    if (s->mode_ext & MODE_EXT_MS_STEREO) {

                        /* lower part of the spectrum : do ms stereo

                           if enabled */

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

                            tmp0    = tab0[j];

                            tmp1    = tab1[j];

                            tab0[j] = MULLx(tmp0 + tmp1, ISQRT2, FRAC_BITS);

                            tab1[j] = MULLx(tmp0 - tmp1, ISQRT2, FRAC_BITS);

                        }

                    }

                }

            }

        }



        non_zero_found = non_zero_found_short[0] |

                         non_zero_found_short[1] |

                         non_zero_found_short[2];



        for (i = g1->long_end - 1;i >= 0;i--) {

            len   = band_size_long[s->sample_rate_index][i];

            tab0 -= len;

            tab1 -= len;

            /* test if non zero band. if so, stop doing i-stereo */

            if (!non_zero_found) {

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

                    if (tab1[j] != 0) {

                        non_zero_found = 1;

                        goto found2;

                    }

                }

                /* for last band, use previous scale factor */

                k  = (i == 21) ? 20 : i;

                sf = g1->scale_factors[k];

                if (sf >= sf_max)

                    goto found2;

                v1 = is_tab[0][sf];

                v2 = is_tab[1][sf];

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

                    tmp0    = tab0[j];

                    tab0[j] = MULLx(tmp0, v1, FRAC_BITS);

                    tab1[j] = MULLx(tmp0, v2, FRAC_BITS);

                }

            } else {

found2:

                if (s->mode_ext & MODE_EXT_MS_STEREO) {

                    /* lower part of the spectrum : do ms stereo

                       if enabled */

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

                        tmp0    = tab0[j];

                        tmp1    = tab1[j];

                        tab0[j] = MULLx(tmp0 + tmp1, ISQRT2, FRAC_BITS);

                        tab1[j] = MULLx(tmp0 - tmp1, ISQRT2, FRAC_BITS);

                    }

                }

            }

        }

    } else if (s->mode_ext & MODE_EXT_MS_STEREO) {

        /* ms stereo ONLY */

        /* NOTE: the 1/sqrt(2) normalization factor is included in the

           global gain */

#if USE_FLOATS

       s->fdsp->butterflies_float(g0->sb_hybrid, g1->sb_hybrid, 576);

#else

        tab0 = g0->sb_hybrid;

        tab1 = g1->sb_hybrid;

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

            tmp0    = tab0[i];

            tmp1    = tab1[i];

            tab0[i] = tmp0 + tmp1;

            tab1[i] = tmp0 - tmp1;

        }

#endif

    }

}

static void compute_stereo(MPADecodeContext *s, GranuleDef *g0, GranuleDef *g1)

{

    int i, j, k, l;

    int sf_max, sf, len, non_zero_found;

    INTFLOAT (*is_tab)[16], *tab0, *tab1, tmp0, tmp1, v1, v2;

    int non_zero_found_short[3];



    

    if (s->mode_ext & MODE_EXT_I_STEREO) {

        if (!s->lsf) {

            is_tab = is_table;

            sf_max = 7;

        } else {

            is_tab = is_table_lsf[g1->scalefac_compress & 1];

            sf_max = 16;

        }



        tab0 = g0->sb_hybrid + 576;

        tab1 = g1->sb_hybrid + 576;



        non_zero_found_short[0] = 0;

        non_zero_found_short[1] = 0;

        non_zero_found_short[2] = 0;

        k = (13 - g1->short_start) * 3 + g1->long_end - 3;

        for (i = 12; i >= g1->short_start; i--) {

            

            if (i != 11)

                k -= 3;

            len = band_size_short[s->sample_rate_index][i];

            for (l = 2; l >= 0; l--) {

                tab0 -= len;

                tab1 -= len;

                if (!non_zero_found_short[l]) {

                    

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

                        if (tab1[j] != 0) {

                            non_zero_found_short[l] = 1;

                            goto found1;

                        }

                    }

                    sf = g1->scale_factors[k + l];

                    if (sf >= sf_max)

                        goto found1;



                    v1 = is_tab[0][sf];

                    v2 = is_tab[1][sf];

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

                        tmp0    = tab0[j];

                        tab0[j] = MULLx(tmp0, v1, FRAC_BITS);

                        tab1[j] = MULLx(tmp0, v2, FRAC_BITS);

                    }

                } else {

found1:

                    if (s->mode_ext & MODE_EXT_MS_STEREO) {

                        



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

                            tmp0    = tab0[j];

                            tmp1    = tab1[j];

                            tab0[j] = MULLx(tmp0 + tmp1, ISQRT2, FRAC_BITS);

                            tab1[j] = MULLx(tmp0 - tmp1, ISQRT2, FRAC_BITS);

                        }

                    }

                }

            }

        }



        non_zero_found = non_zero_found_short[0] |

                         non_zero_found_short[1] |

                         non_zero_found_short[2];



        for (i = g1->long_end - 1;i >= 0;i--) {

            len   = band_size_long[s->sample_rate_index][i];

            tab0 -= len;

            tab1 -= len;

            

            if (!non_zero_found) {

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

                    if (tab1[j] != 0) {

                        non_zero_found = 1;

                        goto found2;

                    }

                }

                

                k  = (i == 21) ? 20 : i;

                sf = g1->scale_factors[k];

                if (sf >= sf_max)

                    goto found2;

                v1 = is_tab[0][sf];

                v2 = is_tab[1][sf];

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

                    tmp0    = tab0[j];

                    tab0[j] = MULLx(tmp0, v1, FRAC_BITS);

                    tab1[j] = MULLx(tmp0, v2, FRAC_BITS);

                }

            } else {

found2:

                if (s->mode_ext & MODE_EXT_MS_STEREO) {

                    



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

                        tmp0    = tab0[j];

                        tmp1    = tab1[j];

                        tab0[j] = MULLx(tmp0 + tmp1, ISQRT2, FRAC_BITS);

                        tab1[j] = MULLx(tmp0 - tmp1, ISQRT2, FRAC_BITS);

                    }

                }

            }

        }

    } else if (s->mode_ext & MODE_EXT_MS_STEREO) {

        

        



#if USE_FLOATS

       s->fdsp->butterflies_float(g0->sb_hybrid, g1->sb_hybrid, 576);

#else

        tab0 = g0->sb_hybrid;

        tab1 = g1->sb_hybrid;

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

            tmp0    = tab0[i];

            tmp1    = tab1[i];

            tab0[i] = tmp0 + tmp1;

            tab1[i] = tmp0 - tmp1;

        }

#endif

    }

}

    INTFLOAT (*is_tab)[16], *tab0, *tab1, tmp0, tmp1, v1, v2;
static void FUNC_0(MPADecodeContext *VAR_0, GranuleDef *VAR_1, GranuleDef *VAR_2)

{

    int VAR_3, VAR_4, VAR_5, VAR_6;

    int VAR_7, VAR_8, VAR_9, VAR_10;

    INTFLOAT (*is_tab)[16], *tab0, *tab1, tmp0, tmp1, v1, v2;

    int VAR_11[3];



    

    if (VAR_0->mode_ext & MODE_EXT_I_STEREO) {

        if (!VAR_0->lsf) {

            is_tab = is_table;

            VAR_7 = 7;

        } else {

            is_tab = is_table_lsf[VAR_2->scalefac_compress & 1];

            VAR_7 = 16;

        }



        tab0 = VAR_1->sb_hybrid + 576;

        tab1 = VAR_2->sb_hybrid + 576;



        VAR_11[0] = 0;

        VAR_11[1] = 0;

        VAR_11[2] = 0;

        VAR_5 = (13 - VAR_2->short_start) * 3 + VAR_2->long_end - 3;

        for (VAR_3 = 12; VAR_3 >= VAR_2->short_start; VAR_3--) {

            

            if (VAR_3 != 11)

                VAR_5 -= 3;

            VAR_9 = band_size_short[VAR_0->sample_rate_index][VAR_3];

            for (VAR_6 = 2; VAR_6 >= 0; VAR_6--) {

                tab0 -= VAR_9;

                tab1 -= VAR_9;

                if (!VAR_11[VAR_6]) {

                    

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

                        if (tab1[VAR_4] != 0) {

                            VAR_11[VAR_6] = 1;

                            goto found1;

                        }

                    }

                    VAR_8 = VAR_2->scale_factors[VAR_5 + VAR_6];

                    if (VAR_8 >= VAR_7)

                        goto found1;



                    v1 = is_tab[0][VAR_8];

                    v2 = is_tab[1][VAR_8];

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

                        tmp0    = tab0[VAR_4];

                        tab0[VAR_4] = MULLx(tmp0, v1, FRAC_BITS);

                        tab1[VAR_4] = MULLx(tmp0, v2, FRAC_BITS);

                    }

                } else {

found1:

                    if (VAR_0->mode_ext & MODE_EXT_MS_STEREO) {

                        



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

                            tmp0    = tab0[VAR_4];

                            tmp1    = tab1[VAR_4];

                            tab0[VAR_4] = MULLx(tmp0 + tmp1, ISQRT2, FRAC_BITS);

                            tab1[VAR_4] = MULLx(tmp0 - tmp1, ISQRT2, FRAC_BITS);

                        }

                    }

                }

            }

        }



        VAR_10 = VAR_11[0] |

                         VAR_11[1] |

                         VAR_11[2];



        for (VAR_3 = VAR_2->long_end - 1;VAR_3 >= 0;VAR_3--) {

            VAR_9   = band_size_long[VAR_0->sample_rate_index][VAR_3];

            tab0 -= VAR_9;

            tab1 -= VAR_9;

            

            if (!VAR_10) {

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

                    if (tab1[VAR_4] != 0) {

                        VAR_10 = 1;

                        goto found2;

                    }

                }

                

                VAR_5  = (VAR_3 == 21) ? 20 : VAR_3;

                VAR_8 = VAR_2->scale_factors[VAR_5];

                if (VAR_8 >= VAR_7)

                    goto found2;

                v1 = is_tab[0][VAR_8];

                v2 = is_tab[1][VAR_8];

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

                    tmp0    = tab0[VAR_4];

                    tab0[VAR_4] = MULLx(tmp0, v1, FRAC_BITS);

                    tab1[VAR_4] = MULLx(tmp0, v2, FRAC_BITS);

                }

            } else {

found2:

                if (VAR_0->mode_ext & MODE_EXT_MS_STEREO) {

                    



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

                        tmp0    = tab0[VAR_4];

                        tmp1    = tab1[VAR_4];

                        tab0[VAR_4] = MULLx(tmp0 + tmp1, ISQRT2, FRAC_BITS);

                        tab1[VAR_4] = MULLx(tmp0 - tmp1, ISQRT2, FRAC_BITS);

                    }

                }

            }

        }

    } else if (VAR_0->mode_ext & MODE_EXT_MS_STEREO) {

        

        



#if USE_FLOATS

       VAR_0->fdsp->butterflies_float(VAR_1->sb_hybrid, VAR_2->sb_hybrid, 576);

#else

        tab0 = VAR_1->sb_hybrid;

        tab1 = VAR_2->sb_hybrid;

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

            tmp0    = tab0[VAR_3];

            tmp1    = tab1[VAR_3];

            tab0[VAR_3] = tmp0 + tmp1;

            tab1[VAR_3] = tmp0 - tmp1;

        }

#endif

    }

}

static void FUNC_0(MPADecodeContext *VAR_0, GranuleDef *VAR_1, GranuleDef *VAR_2)
{ int VAR_3, VAR_4, VAR_5, VAR_6; int VAR_7, VAR_8, VAR_9, VAR_10; INTFLOAT (*is_tab)[16], *tab0, *tab1, tmp0, tmp1, v1, v2; int VAR_11[3]; if (VAR_0->mode_ext & MODE_EXT_I_STEREO) { if (!VAR_0->lsf) { is_tab = is_table; VAR_7 = 7; } else { is_tab = is_table_lsf[VAR_2->scalefac_compress & 1]; VAR_7 = 16; } tab0 = VAR_1->sb_hybrid + 576; tab1 = VAR_2->sb_hybrid + 576; VAR_11[0] = 0; VAR_11[1] = 0; VAR_11[2] = 0; VAR_5 = (13 - VAR_2->short_start) * 3 + VAR_2->long_end - 3; for (VAR_3 = 12; VAR_3 >= VAR_2->short_start; VAR_3--) { if (VAR_3 != 11)
VAR_5 -= 3; VAR_9 = band_size_short[VAR_0->sample_rate_index][VAR_3]; for (VAR_6 = 2; VAR_6 >= 0; VAR_6--) { tab0 -= VAR_9; tab1 -= VAR_9; if (!VAR_11[VAR_6]) { for (VAR_4 = 0; VAR_4 < VAR_9; VAR_4++) { if (tab1[VAR_4] != 0) { VAR_11[VAR_6] = 1; goto found1; } } VAR_8 = VAR_2->scale_factors[VAR_5 + VAR_6]; if (VAR_8 >= VAR_7)
goto found1; v1 = is_tab[0][VAR_8]; v2 = is_tab[1][VAR_8]; for (VAR_4 = 0; VAR_4 < VAR_9; VAR_4++) { tmp0    = tab0[VAR_4]; tab0[VAR_4] = MULLx(tmp0, v1, FRAC_BITS); tab1[VAR_4] = MULLx(tmp0, v2, FRAC_BITS); } } else { found1:
if (VAR_0->mode_ext & MODE_EXT_MS_STEREO) { for (VAR_4 = 0; VAR_4 < VAR_9; VAR_4++) { tmp0    = tab0[VAR_4]; tmp1    = tab1[VAR_4]; tab0[VAR_4] = MULLx(tmp0 + tmp1, ISQRT2, FRAC_BITS); tab1[VAR_4] = MULLx(tmp0 - tmp1, ISQRT2, FRAC_BITS); } } } } } VAR_10 = VAR_11[0] |
VAR_11[1] |
VAR_11[2]; for (VAR_3 = VAR_2->long_end - 1;VAR_3 >= 0;VAR_3--) { VAR_9   = band_size_long[VAR_0->sample_rate_index][VAR_3]; tab0 -= VAR_9; tab1 -= VAR_9; if (!VAR_10) { for (VAR_4 = 0; VAR_4 < VAR_9; VAR_4++) { if (tab1[VAR_4] != 0) { VAR_10 = 1; goto found2; } } VAR_5  = (VAR_3 == 21) ? 20 : VAR_3; VAR_8 = VAR_2->scale_factors[VAR_5]; if (VAR_8 >= VAR_7)
goto found2; v1 = is_tab[0][VAR_8]; v2 = is_tab[1][VAR_8]; for (VAR_4 = 0; VAR_4 < VAR_9; VAR_4++) { tmp0    = tab0[VAR_4]; tab0[VAR_4] = MULLx(tmp0, v1, FRAC_BITS); tab1[VAR_4] = MULLx(tmp0, v2, FRAC_BITS); } } else { found2:
if (VAR_0->mode_ext & MODE_EXT_MS_STEREO) { for (VAR_4 = 0; VAR_4 < VAR_9; VAR_4++) { tmp0    = tab0[VAR_4]; tmp1    = tab1[VAR_4]; tab0[VAR_4] = MULLx(tmp0 + tmp1, ISQRT2, FRAC_BITS); tab1[VAR_4] = MULLx(tmp0 - tmp1, ISQRT2, FRAC_BITS); } } } } } else if (VAR_0->mode_ext & MODE_EXT_MS_STEREO) { #if USE_FLOATS
VAR_0->fdsp->butterflies_float(VAR_1->sb_hybrid, VAR_2->sb_hybrid, 576); #else
tab0 = VAR_1->sb_hybrid; tab1 = VAR_2->sb_hybrid; for (VAR_3 = 0; VAR_3 < 576; VAR_3++) { tmp0    = tab0[VAR_3]; tmp1    = tab1[VAR_3]; tab0[VAR_3] = tmp0 + tmp1; tab1[VAR_3] = tmp0 - tmp1; } #endif
} }