Mercurial > libavcodec.hg
changeset 11728:907ac02ef561 libavcodec
aacenc: Fix psy logic.
Set band info before determining scalefactors. Use the look ahead for
windowing decision.
author | alexc |
---|---|
date | Fri, 14 May 2010 16:49:11 +0000 |
parents | 0c98bdb71f48 |
children | 6598cef880fc |
files | aacenc.c aacpsy.c |
diffstat | 2 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/aacenc.c Thu May 13 20:41:36 2010 +0000 +++ b/aacenc.c Fri May 14 16:49:11 2010 +0000 @@ -562,6 +562,7 @@ cpe = &s->cpe[i]; for (j = 0; j < chans; j++) { s->cur_channel = start_ch + j; + ff_psy_set_band_info(&s->psy, s->cur_channel, cpe->ch[j].coeffs, &wi[j]); s->coder->search_for_quantizers(avctx, s, &cpe->ch[j], s->lambda); } cpe->common_window = 0; @@ -592,7 +593,6 @@ } for (j = 0; j < chans; j++) { s->cur_channel = start_ch + j; - ff_psy_set_band_info(&s->psy, s->cur_channel, cpe->ch[j].coeffs, &wi[j]); encode_individual_channel(avctx, s, &cpe->ch[j], cpe->common_window); } start_ch += chans;
--- a/aacpsy.c Thu May 13 20:41:36 2010 +0000 +++ b/aacpsy.c Fri May 14 16:49:11 2010 +0000 @@ -195,7 +195,7 @@ int attack_n = 0; for (i = 0; i < 8; i++) { for (j = 0; j < 128; j++) { - v = iir_filter(audio[(i*128+j)*ctx->avctx->channels], pch->iir_state); + v = iir_filter(la[(i*128+j)*ctx->avctx->channels], pch->iir_state); sum += v*v; } s[i] = sum;