Revision 152cc528

View differences:

libavcodec/ac3enc.c
1114 1114
                AC3_BLOCK_SIZE * sizeof(planar_samples[0][0]));
1115 1115
    }
1116 1116

  
1117
    frame_bits = 0;
1117
    /* apply MDCT */
1118 1118
    for (ch = 0; ch < s->channels; ch++) {
1119
        /* fixed mdct to the six sub blocks & exponent computation */
1120 1119
        for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
1121 1120
            int16_t *input_samples = &planar_samples[ch][blk * AC3_BLOCK_SIZE];
1122 1121

  
......
1137 1136

  
1138 1137
            /* do the MDCT */
1139 1138
            mdct512(mdct_coef[blk][ch], windowed_samples);
1139
        }
1140
    }
1140 1141

  
1142
    /* extract exponents */
1143
    for (ch = 0; ch < s->channels; ch++) {
1144
        for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
1141 1145
            /* compute "exponents". We take into account the normalization there */
1142 1146
            for (i = 0; i < AC3_MAX_COEFS; i++) {
1143 1147
                int e;
......
1154 1158
                exp[blk][ch][i] = e;
1155 1159
            }
1156 1160
        }
1161
    }
1157 1162

  
1163
    /* compute exponent strategies */
1164
    for (ch = 0; ch < s->channels; ch++) {
1158 1165
        compute_exp_strategy_ch(exp_strategy, exp, ch, ch == s->lfe_channel);
1166
    }
1159 1167

  
1168
    /* encode exponents */
1169
    frame_bits = 0;
1170
    for (ch = 0; ch < s->channels; ch++) {
1160 1171
        /* compute the exponents as the decoder will see them. The
1161 1172
           EXP_REUSE case must be handled carefully : we select the
1162 1173
           min of the exponents */

Also available in: Unified diff