[FFmpeg-cvslog] r15294 - trunk/libavcodec/aac.c

superdump subversion
Thu Sep 11 03:22:34 CEST 2008


Author: superdump
Date: Thu Sep 11 03:22:34 2008
New Revision: 15294

Log:
Correct pulse amplitude application - a negative or 0 coefficient implies the
pulse is subtracted, else it is added. Also avoid a divide by 0.

Based on a patch by Alex Converse (alex converse gmail com)
Fixes part of issue632


Modified:
   trunk/libavcodec/aac.c

Modified: trunk/libavcodec/aac.c
==============================================================================
--- trunk/libavcodec/aac.c	(original)
+++ trunk/libavcodec/aac.c	Thu Sep 11 03:22:34 2008
@@ -753,7 +753,9 @@ static int decode_spectrum_and_dequant(A
     if (pulse_present) {
         for(i = 0; i < pulse->num_pulse; i++){
             float co  = coef_base[ pulse->pos[i] ];
-            float ico = co / sqrtf(sqrtf(fabsf(co))) + pulse->amp[i];
+            float ico = -pulse->amp[i];
+            if (co)
+                ico = co / sqrtf(sqrtf(fabsf(co))) + (co > 0 ? -ico : ico);
             coef_base[ pulse->pos[i] ] = cbrtf(fabsf(ico)) * ico;
         }
     }




More information about the ffmpeg-cvslog mailing list