aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Freire <klaussfreire@gmail.com>2013-05-12 09:38:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-12 19:14:17 +0200
commite41cd3cdeb495d295d252682091022a3445806c5 (patch)
tree349ebdcb5220853c480065b27b38c5569e2fc005
parent91f4a44ff4fa55e0a48f71c432a1dc3158d662b9 (diff)
downloadffmpeg-e41cd3cdeb495d295d252682091022a3445806c5.tar.gz
aacenc: Fix ticket #1784: erasure of surround channels
This was due to a miscomputation of s->cur_channel, which led to psy-based encoders using the psy coefficients for the wrong channel. Test sample attached on the bug tracker had the peculiar case of all other channels being silent, so the error was far more noticeable. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/aacenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 80dd3d80e6..362f02b115 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -593,7 +593,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
coeffs[ch] = cpe->ch[ch].coeffs;
s->psy.model->analyze(&s->psy, start_ch, coeffs, wi);
for (ch = 0; ch < chans; ch++) {
- s->cur_channel = start_ch * 2 + ch;
+ s->cur_channel = start_ch + ch;
s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
}
cpe->common_window = 0;
@@ -609,7 +609,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
}
}
- s->cur_channel = start_ch * 2;
+ s->cur_channel = start_ch;
if (s->options.stereo_mode && cpe->common_window) {
if (s->options.stereo_mode > 0) {
IndividualChannelStream *ics = &cpe->ch[0].ics;