summaryrefslogtreecommitdiff
path: root/libavcodec/aacenc.c
diff options
context:
space:
mode:
authorClaudio Freire <klaussfreire@gmail.com>2013-05-12 09:38:40 +0200
committerMartin Storsjö <martin@martin.st>2013-05-14 12:42:05 +0300
commit8bbdd20a293eab2cfac9f332613ead02a4e3c0c2 (patch)
treef7d0abdeb41ac03362058a30d2aca6bc2ec4bd82 /libavcodec/aacenc.c
parentf4d0a63b5b5c682c18df3bba730f97a9067408ba (diff)
aacenc: Fix 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. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/aacenc.c')
-rw-r--r--libavcodec/aacenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 60eca59ae0..b2ad47bd75 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -597,7 +597,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;
@@ -613,7 +613,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;