[FFmpeg-soc] [soc]: r2422 - aacenc/aacenc.c

kostya subversion at mplayerhq.hu
Tue Jun 10 19:46:35 CEST 2008


Author: kostya
Date: Tue Jun 10 19:46:35 2008
New Revision: 2422

Log:
Scale coefficients correctly

Modified:
   aacenc/aacenc.c

Modified: aacenc/aacenc.c
==============================================================================
--- aacenc/aacenc.c	(original)
+++ aacenc/aacenc.c	Tue Jun 10 19:46:35 2008
@@ -204,10 +204,13 @@ static int aac_encode_init(AVCodecContex
 static void apply_psychoacoustics(AVCodecContext *avctx, int channel)
 {
     AACEncContext *s = avctx->priv_data;
-    int i;
+    int i, val;
 
-    for(i = 0; i < 1024; i++)
-        s->icoefs[channel][i] = (int)s->coefs[channel][i];
+    for(i = 0; i < 1024; i++){
+        val = pow(FFABS(s->coefs[channel][i]), 0.75);
+        if(s->coefs[channel][i] > 0.0) val = -val;
+        s->icoefs[channel][i] = val;
+    }
 }
 
 static void analyze(AVCodecContext *avctx, AACEncContext *s, short *audio, int channel)
@@ -372,7 +375,7 @@ static int encode_individual_channel(AVC
     int i, j, g = 0;
 
     s->coded_swb_num = s->swb_num;
-    s->global_gain = 128;
+    s->global_gain = 140;
     i = 0;
     while(i < 1024){
         s->codebooks[g] = determine_section_info(s, channel, i, s->swb_sizes[g]);



More information about the FFmpeg-soc mailing list