Commit e41cd3cd authored by Claudio Freire's avatar Claudio Freire Committed by Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 91f4a44f
...@@ -593,7 +593,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, ...@@ -593,7 +593,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
coeffs[ch] = cpe->ch[ch].coeffs; coeffs[ch] = cpe->ch[ch].coeffs;
s->psy.model->analyze(&s->psy, start_ch, coeffs, wi); s->psy.model->analyze(&s->psy, start_ch, coeffs, wi);
for (ch = 0; ch < chans; ch++) { 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); s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
} }
cpe->common_window = 0; cpe->common_window = 0;
...@@ -609,7 +609,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, ...@@ -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 && cpe->common_window) {
if (s->options.stereo_mode > 0) { if (s->options.stereo_mode > 0) {
IndividualChannelStream *ics = &cpe->ch[0].ics; IndividualChannelStream *ics = &cpe->ch[0].ics;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment