static void set_downmix_coeffs(AC3DecodeContext *s)

{

    int i;

    float cmix = gain_levels[s->center_mix_level];

    float smix = gain_levels[s->surround_mix_level];



    for(i=0; i<s->fbw_channels; i++) {

        s->downmix_coeffs[i][0] = gain_levels[ac3_default_coeffs[s->channel_mode][i][0]];

        s->downmix_coeffs[i][1] = gain_levels[ac3_default_coeffs[s->channel_mode][i][1]];

    }

    if(s->channel_mode > 1 && s->channel_mode & 1) {

        s->downmix_coeffs[1][0] = s->downmix_coeffs[1][1] = cmix;

    }

    if(s->channel_mode == AC3_CHMODE_2F1R || s->channel_mode == AC3_CHMODE_3F1R) {

        int nf = s->channel_mode - 2;

        s->downmix_coeffs[nf][0] = s->downmix_coeffs[nf][1] = smix * LEVEL_MINUS_3DB;

    }

    if(s->channel_mode == AC3_CHMODE_2F2R || s->channel_mode == AC3_CHMODE_3F2R) {

        int nf = s->channel_mode - 4;

        s->downmix_coeffs[nf][0] = s->downmix_coeffs[nf+1][1] = smix;

    }



    s->downmix_coeff_sum[0] = s->downmix_coeff_sum[1] = 0.0f;

    for(i=0; i<s->fbw_channels; i++) {

        s->downmix_coeff_sum[0] += s->downmix_coeffs[i][0];

        s->downmix_coeff_sum[1] += s->downmix_coeffs[i][1];

    }

}

static void set_downmix_coeffs(AC3DecodeContext *s)

{

    int i;

    float cmix = gain_levels[s->center_mix_level];

    float smix = gain_levels[s->surround_mix_level];



    for(i=0; i<s->fbw_channels; i++) {

        s->downmix_coeffs[i][0] = gain_levels[ac3_default_coeffs[s->channel_mode][i][0]];

        s->downmix_coeffs[i][1] = gain_levels[ac3_default_coeffs[s->channel_mode][i][1]];

    }

    if(s->channel_mode > 1 && s->channel_mode & 1) {

        s->downmix_coeffs[1][0] = s->downmix_coeffs[1][1] = cmix;

    }

    if(s->channel_mode == AC3_CHMODE_2F1R || s->channel_mode == AC3_CHMODE_3F1R) {

        int nf = s->channel_mode - 2;

        s->downmix_coeffs[nf][0] = s->downmix_coeffs[nf][1] = smix * LEVEL_MINUS_3DB;

    }

    if(s->channel_mode == AC3_CHMODE_2F2R || s->channel_mode == AC3_CHMODE_3F2R) {

        int nf = s->channel_mode - 4;

        s->downmix_coeffs[nf][0] = s->downmix_coeffs[nf+1][1] = smix;

    }



    s->downmix_coeff_sum[0] = s->downmix_coeff_sum[1] = 0.0f;

    for(i=0; i<s->fbw_channels; i++) {

        s->downmix_coeff_sum[0] += s->downmix_coeffs[i][0];

        s->downmix_coeff_sum[1] += s->downmix_coeffs[i][1];

    }

}

static void FUNC_0(AC3DecodeContext *VAR_0)

{

    int VAR_1;

    float VAR_2 = gain_levels[VAR_0->center_mix_level];

    float VAR_3 = gain_levels[VAR_0->surround_mix_level];



    for(VAR_1=0; VAR_1<VAR_0->fbw_channels; VAR_1++) {

        VAR_0->downmix_coeffs[VAR_1][0] = gain_levels[ac3_default_coeffs[VAR_0->channel_mode][VAR_1][0]];

        VAR_0->downmix_coeffs[VAR_1][1] = gain_levels[ac3_default_coeffs[VAR_0->channel_mode][VAR_1][1]];

    }

    if(VAR_0->channel_mode > 1 && VAR_0->channel_mode & 1) {

        VAR_0->downmix_coeffs[1][0] = VAR_0->downmix_coeffs[1][1] = VAR_2;

    }

    if(VAR_0->channel_mode == AC3_CHMODE_2F1R || VAR_0->channel_mode == AC3_CHMODE_3F1R) {

        int VAR_5 = VAR_0->channel_mode - 2;

        VAR_0->downmix_coeffs[VAR_5][0] = VAR_0->downmix_coeffs[VAR_5][1] = VAR_3 * LEVEL_MINUS_3DB;

    }

    if(VAR_0->channel_mode == AC3_CHMODE_2F2R || VAR_0->channel_mode == AC3_CHMODE_3F2R) {

        int VAR_5 = VAR_0->channel_mode - 4;

        VAR_0->downmix_coeffs[VAR_5][0] = VAR_0->downmix_coeffs[VAR_5+1][1] = VAR_3;

    }



    VAR_0->downmix_coeff_sum[0] = VAR_0->downmix_coeff_sum[1] = 0.0f;

    for(VAR_1=0; VAR_1<VAR_0->fbw_channels; VAR_1++) {

        VAR_0->downmix_coeff_sum[0] += VAR_0->downmix_coeffs[VAR_1][0];

        VAR_0->downmix_coeff_sum[1] += VAR_0->downmix_coeffs[VAR_1][1];

    }

}

static void FUNC_0(AC3DecodeContext *VAR_0)
{ int VAR_1; float VAR_2 = gain_levels[VAR_0->center_mix_level]; float VAR_3 = gain_levels[VAR_0->surround_mix_level]; for(VAR_1=0; VAR_1<VAR_0->fbw_channels; VAR_1++) { VAR_0->downmix_coeffs[VAR_1][0] = gain_levels[ac3_default_coeffs[VAR_0->channel_mode][VAR_1][0]]; VAR_0->downmix_coeffs[VAR_1][1] = gain_levels[ac3_default_coeffs[VAR_0->channel_mode][VAR_1][1]]; } if(VAR_0->channel_mode > 1 && VAR_0->channel_mode & 1) { VAR_0->downmix_coeffs[1][0] = VAR_0->downmix_coeffs[1][1] = VAR_2; } if(VAR_0->channel_mode == AC3_CHMODE_2F1R || VAR_0->channel_mode == AC3_CHMODE_3F1R) { int VAR_5 = VAR_0->channel_mode - 2; VAR_0->downmix_coeffs[VAR_5][0] = VAR_0->downmix_coeffs[VAR_5][1] = VAR_3 * LEVEL_MINUS_3DB; } if(VAR_0->channel_mode == AC3_CHMODE_2F2R || VAR_0->channel_mode == AC3_CHMODE_3F2R) { int VAR_5 = VAR_0->channel_mode - 4; VAR_0->downmix_coeffs[VAR_5][0] = VAR_0->downmix_coeffs[VAR_5+1][1] = VAR_3; } VAR_0->downmix_coeff_sum[0] = VAR_0->downmix_coeff_sum[1] = 0.0f; for(VAR_1=0; VAR_1<VAR_0->fbw_channels; VAR_1++) { VAR_0->downmix_coeff_sum[0] += VAR_0->downmix_coeffs[VAR_1][0]; VAR_0->downmix_coeff_sum[1] += VAR_0->downmix_coeffs[VAR_1][1]; } }