diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-02-16 00:30:24 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-02-18 19:52:32 +0100 |
commit | 6159bd0d670f88dc87f515f859100c53b7d81a89 (patch) | |
tree | abff104d4fc99fe06f304b910867794c848d2e45 /libavcodec/ac3enc.c | |
parent | ee60e04c2c07b907bf72d1092c43b972c9c5e725 (diff) | |
download | ffmpeg-6159bd0d670f88dc87f515f859100c53b7d81a89.tar.gz |
ac3enc: fix bug in stereo rematrixing decision.
The rematrixing strategy reuse flags are not reset between frames, so they
need to be initialized for all blocks, not just block 0.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 5b54d4b376fbd2c291b8a6dba7d425e28f654bcf)
Diffstat (limited to 'libavcodec/ac3enc.c')
-rw-r--r-- | libavcodec/ac3enc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 72a6c89288..02bc403f82 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -310,9 +310,9 @@ static void compute_rematrixing_strategy(AC3EncodeContext *s) nb_coefs = FFMIN(s->nb_coefs[0], s->nb_coefs[1]); - s->blocks[0].new_rematrixing_strategy = 1; for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) { block = &s->blocks[blk]; + block->new_rematrixing_strategy = !blk; for (bnd = 0; bnd < 4; bnd++) { /* calculate calculate sum of squared coeffs for one band in one block */ int start = ff_ac3_rematrix_band_tab[bnd]; @@ -337,7 +337,6 @@ static void compute_rematrixing_strategy(AC3EncodeContext *s) /* determine if new rematrixing flags will be sent */ if (blk && - !block->new_rematrixing_strategy && block->rematrixing_flags[bnd] != block0->rematrixing_flags[bnd]) { block->new_rematrixing_strategy = 1; } |