static void apply_mid_side_stereo(ChannelElement *cpe)

{

    int w, w2, g, i;

    IndividualChannelStream *ics = &cpe->ch[0].ics;

    if (!cpe->common_window)

        return;

    for (w = 0; w < ics->num_windows; w += ics->group_len[w]) {

        for (w2 =  0; w2 < ics->group_len[w]; w2++) {

            int start = (w+w2) * 128;

            for (g = 0; g < ics->num_swb; g++) {

                if (!cpe->ms_mask[w*16 + g]) {

                    start += ics->swb_sizes[g];

                    continue;

                }

                for (i = 0; i < ics->swb_sizes[g]; i++) {

                    float L = (cpe->ch[0].coeffs[start+i] + cpe->ch[1].coeffs[start+i]) * 0.5f;

                    float R = L - cpe->ch[1].coeffs[start+i];

                    cpe->ch[0].coeffs[start+i] = L;

                    cpe->ch[1].coeffs[start+i] = R;

                }

                start += ics->swb_sizes[g];

            }

        }

    }

}

static void apply_mid_side_stereo(ChannelElement *cpe)

{

    int w, w2, g, i;

    IndividualChannelStream *ics = &cpe->ch[0].ics;

    if (!cpe->common_window)

        return;

    for (w = 0; w < ics->num_windows; w += ics->group_len[w]) {

        for (w2 =  0; w2 < ics->group_len[w]; w2++) {

            int start = (w+w2) * 128;

            for (g = 0; g < ics->num_swb; g++) {

                if (!cpe->ms_mask[w*16 + g]) {

                    start += ics->swb_sizes[g];

                    continue;

                }

                for (i = 0; i < ics->swb_sizes[g]; i++) {

                    float L = (cpe->ch[0].coeffs[start+i] + cpe->ch[1].coeffs[start+i]) * 0.5f;

                    float R = L - cpe->ch[1].coeffs[start+i];

                    cpe->ch[0].coeffs[start+i] = L;

                    cpe->ch[1].coeffs[start+i] = R;

                }

                start += ics->swb_sizes[g];

            }

        }

    }

}

                if (!cpe->ms_mask[w*16 + g]) {
static void FUNC_0(ChannelElement *VAR_0)

{

    int VAR_1, VAR_2, VAR_3, VAR_4;

    IndividualChannelStream *ics = &VAR_0->ch[0].ics;

    if (!VAR_0->common_window)

        return;

    for (VAR_1 = 0; VAR_1 < ics->num_windows; VAR_1 += ics->group_len[VAR_1]) {

        for (VAR_2 =  0; VAR_2 < ics->group_len[VAR_1]; VAR_2++) {

            int start = (VAR_1+VAR_2) * 128;

            for (VAR_3 = 0; VAR_3 < ics->num_swb; VAR_3++) {

                if (!VAR_0->ms_mask[VAR_1*16 + VAR_3]) {

                    start += ics->swb_sizes[VAR_3];

                    continue;

                }

                for (VAR_4 = 0; VAR_4 < ics->swb_sizes[VAR_3]; VAR_4++) {

                    float L = (VAR_0->ch[0].coeffs[start+VAR_4] + VAR_0->ch[1].coeffs[start+VAR_4]) * 0.5f;

                    float R = L - VAR_0->ch[1].coeffs[start+VAR_4];

                    VAR_0->ch[0].coeffs[start+VAR_4] = L;

                    VAR_0->ch[1].coeffs[start+VAR_4] = R;

                }

                start += ics->swb_sizes[VAR_3];

            }

        }

    }

}

static void FUNC_0(ChannelElement *VAR_0)
{ int VAR_1, VAR_2, VAR_3, VAR_4; IndividualChannelStream *ics = &VAR_0->ch[0].ics; if (!VAR_0->common_window)
return; for (VAR_1 = 0; VAR_1 < ics->num_windows; VAR_1 += ics->group_len[VAR_1]) { for (VAR_2 =  0; VAR_2 < ics->group_len[VAR_1]; VAR_2++) { int start = (VAR_1+VAR_2) * 128; for (VAR_3 = 0; VAR_3 < ics->num_swb; VAR_3++) { if (!VAR_0->ms_mask[VAR_1*16 + VAR_3]) { start += ics->swb_sizes[VAR_3]; continue; } for (VAR_4 = 0; VAR_4 < ics->swb_sizes[VAR_3]; VAR_4++) { float L = (VAR_0->ch[0].coeffs[start+VAR_4] + VAR_0->ch[1].coeffs[start+VAR_4]) * 0.5f; float R = L - VAR_0->ch[1].coeffs[start+VAR_4]; VAR_0->ch[0].coeffs[start+VAR_4] = L; VAR_0->ch[1].coeffs[start+VAR_4] = R; } start += ics->swb_sizes[VAR_3]; } } } }