1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
This commit is contained in:
Claudio Freire 2013-05-12 09:38:40 +02:00 committed by Martin Storsjö
parent f4d0a63b5b
commit 8bbdd20a29

View File

@ -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;