Revision cf7c961b libavcodec/ac3enc.c

View differences:

libavcodec/ac3enc.c
964 964
    for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
965 965
        AC3Block *block = &s->blocks[blk];
966 966
        for (ch = 0; ch < s->channels; ch++) {
967
            if (block->exp_strategy[ch] == EXP_REUSE) {
968
                AC3Block *block1 = &s->blocks[blk-1];
969
                memcpy(block->psd[ch],  block1->psd[ch],  AC3_MAX_COEFS*sizeof(block->psd[0][0]));
970
                memcpy(block->mask[ch], block1->mask[ch], AC3_CRITICAL_BANDS*sizeof(block->mask[0][0]));
971
            } else {
967
            /* We only need psd and mask for calculating bap.
968
               Since we currently do not calculate bap when exponent
969
               strategy is EXP_REUSE we do not need to calculate psd or mask. */
970
            if (block->exp_strategy[ch] != EXP_REUSE) {
972 971
                ff_ac3_bit_alloc_calc_psd(block->exp[ch], 0,
973 972
                                          s->nb_coefs[ch],
974 973
                                          block->psd[ch], block->band_psd[ch]);

Also available in: Unified diff