summaryrefslogtreecommitdiff
path: root/libavcodec/aacenc.c
diff options
context:
space:
mode:
authorNathan Caldwell <saintdev@gmail.com>2011-06-15 02:50:25 -0600
committerAlex Converse <alex.converse@gmail.com>2011-06-29 14:28:52 -0700
commit0bc01cc9fe83fe676690fd200e7d74cdab595f15 (patch)
tree635bc129c5d29085f9e1692bdf54233e76cbe2a3 /libavcodec/aacenc.c
parenta3e1f80e8ba28151ea5d84c15ecf454b8170aa13 (diff)
psymodel: Add channels and channel groups to the psymodel.
Diffstat (limited to 'libavcodec/aacenc.c')
-rw-r--r--libavcodec/aacenc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 8c7ed87b4a..1df16ade27 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -210,7 +210,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
sizes[1] = swb_size_128[i];
lengths[0] = ff_aac_num_swb_1024[i];
lengths[1] = ff_aac_num_swb_128[i];
- ff_psy_init(&s->psy, avctx, 2, sizes, lengths);
+ ff_psy_init(&s->psy, avctx, 2, sizes, lengths, s->chan_map[0], &s->chan_map[1]);
s->psypp = ff_psy_preprocess_init(avctx);
s->coder = &ff_aac_coders[2];
@@ -570,8 +570,8 @@ static int aac_encode_frame(AVCodecContext *avctx,
put_bits(&s->pb, 3, tag);
put_bits(&s->pb, 4, chan_el_counter[tag]++);
for (ch = 0; ch < chans; ch++) {
- s->cur_channel = start_ch + ch;
- s->psy.model->analyze(&s->psy, s->cur_channel, cpe->ch[ch].coeffs, &wi[ch]);
+ s->cur_channel = start_ch * 2 + ch;
+ s->psy.model->analyze(&s->psy, start_ch + ch, cpe->ch[ch].coeffs, &wi[ch]);
s->coder->search_for_quantizers(avctx, s, &cpe->ch[ch], s->lambda);
}
cpe->common_window = 0;
@@ -587,7 +587,7 @@ static int aac_encode_frame(AVCodecContext *avctx,
}
}
}
- s->cur_channel = start_ch;
+ s->cur_channel = start_ch * 2;
if (s->options.stereo_mode && cpe->common_window) {
if (s->options.stereo_mode > 0) {
IndividualChannelStream *ics = &cpe->ch[0].ics;