[FFmpeg-cvslog] r23132 - in trunk/libavcodec: aacenc.c aacpsy.c

alexc subversion
Fri May 14 18:49:11 CEST 2010


Author: alexc
Date: Fri May 14 18:49:11 2010
New Revision: 23132

Log:
aacenc: Fix psy logic.

Set band info before determining scalefactors. Use the look ahead for
windowing decision.

Modified:
   trunk/libavcodec/aacenc.c
   trunk/libavcodec/aacpsy.c

Modified: trunk/libavcodec/aacenc.c
==============================================================================
--- trunk/libavcodec/aacenc.c	Thu May 13 22:41:36 2010	(r23131)
+++ trunk/libavcodec/aacenc.c	Fri May 14 18:49:11 2010	(r23132)
@@ -562,6 +562,7 @@ static int aac_encode_frame(AVCodecConte
             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 @@ static int aac_encode_frame(AVCodecConte
             }
             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;

Modified: trunk/libavcodec/aacpsy.c
==============================================================================
--- trunk/libavcodec/aacpsy.c	Thu May 13 22:41:36 2010	(r23131)
+++ trunk/libavcodec/aacpsy.c	Fri May 14 18:49:11 2010	(r23132)
@@ -195,7 +195,7 @@ static FFPsyWindowInfo psy_3gpp_window(F
         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;



More information about the ffmpeg-cvslog mailing list