[FFmpeg-devel] [RFC] simplify exp_table generation

Reimar Döffinger Reimar.Doeffinger
Fri Nov 6 20:55:20 CET 2009


Hello,
following patch IMO makes it more obvious that exp_table is just a
partial copy of expval_table and avoids the duplicate llrintf.
I think I also asked whether it is probably ok to replace the llrintf(f)
with f + 0.5, since llrintf is not available everywhere and the
libavutil/mathematics.h workaround is difficult to use for the case of
hardcoded tables + cross-compiling.
Index: libavcodec/mpegaudio_tablegen.h
===================================================================
--- libavcodec/mpegaudio_tablegen.h     (revision 20469)
+++ libavcodec/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