diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-04-30 23:55:18 +0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-05-12 20:41:08 +0400 |
commit | 4d7a4215748e8dc3740dfe6be4070ce055df6023 (patch) | |
tree | e4c57f615ee4b2032b3aa46393aad36519f97501 /libavcodec/ac3enc.c | |
parent | 257de756fb3da2576c8641e0a31f1785e2439f9d (diff) |
ac3enc: put the counting of stereo rematrixing bits in the same place to
make the code easier to understand.
Diffstat (limited to 'libavcodec/ac3enc.c')
-rw-r--r-- | libavcodec/ac3enc.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 753559fbb3..95bdc58f16 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -838,10 +838,6 @@ static void count_frame_bits_fixed(AC3EncodeContext *s) if (!blk) frame_bits++; - /* stereo rematrixing */ - if (s->channel_mode == AC3_CHMODE_STEREO) - frame_bits++; - /* exponent strategy */ frame_bits += 2 * s->fbw_channels; if (s->lfe_on) @@ -931,9 +927,10 @@ static void count_frame_bits(AC3EncodeContext *s) /* audio blocks */ for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) { /* stereo rematrixing */ - if (s->channel_mode == AC3_CHMODE_STEREO && - s->blocks[blk].new_rematrixing_strategy) { - frame_bits += s->num_rematrixing_bands; + if (s->channel_mode == AC3_CHMODE_STEREO) { + frame_bits++; + if (s->blocks[blk].new_rematrixing_strategy) + frame_bits += s->num_rematrixing_bands; } /* bandwidth codes & gain range */ |