[FFmpeg-devel] [PATCH] slightly simplify mpegaudio_tablegen.h

Reimar Döffinger Reimar.Doeffinger
Wed Oct 28 21:12:19 CET 2009


Hello,
seems simpler (and faster, but not that this matters) to initialize
exp_table from expval_table or is there a reason for this?
E.g. maybe it might make sense to in the future change expval_table
to have less precision than exp_table?
In addition I wanted to ask if it is okay to replace llrint by + 0.5 (or
is rint() preferred?), speed should not be that critical here and llrint
is not available on Cygwin and the internal.h emulation can't be used
due to potential cross-compilation issues.
Index: mpegaudio_tablegen.h
===================================================================
--- mpegaudio_tablegen.h        (revision 20404)
+++ mpegaudio_tablegen.h        (working copy)
@@ -59,9 +59,9 @@
         int exponent= (i>>4);
         double f= value * cbrtf(value) * pow(2, (exponent-400)*0.25 + FRAC_BITS + 5);
         expval_table[exponent][i&15]= llrint(f);
-        if((i&15)==1)
-            exp_table[exponent]= llrint(f);
     }
+    for(i=0; i<512; i++)
+        exp_table[i]= expval_table[i][1];
 }
 #endif /* CONFIG_HARDCODED_TABLES */
 



More information about the ffmpeg-devel mailing list