[FFmpeg-cvslog] r19395 - in trunk: configure libavutil/internal.h

alexc subversion
Fri Jul 10 21:20:07 CEST 2009


Author: alexc
Date: Fri Jul 10 21:20:06 2009
New Revision: 19395

Log:
Add a log2 replacement for systems that haven't quite caught up with the C99
standard library.

Modified:
   trunk/configure
   trunk/libavutil/internal.h

Modified: trunk/configure
==============================================================================
--- trunk/configure	Fri Jul 10 17:50:49 2009	(r19394)
+++ trunk/configure	Fri Jul 10 21:20:06 2009	(r19395)
@@ -911,6 +911,7 @@ HAVE_LIST="
     libdc1394_1
     libdc1394_2
     llrint
+    log2
     loongson
     lrint
     lrintf
@@ -2078,7 +2079,7 @@ check_lib math.h sin -lm
 check_lib va/va.h vaInitialize -lva
 
 # test for C99 functions in math.h
-for func in llrint lrint lrintf round roundf truncf; do
+for func in llrint log2 lrint lrintf round roundf truncf; do
     check_exec <<EOF && enable $func || disable $func
 #include <math.h>
 int main(void) { return ($func(3.999f) > 0)?0:1; }

Modified: trunk/libavutil/internal.h
==============================================================================
--- trunk/libavutil/internal.h	Fri Jul 10 17:50:49 2009	(r19394)
+++ trunk/libavutil/internal.h	Fri Jul 10 21:20:06 2009	(r19395)
@@ -265,6 +265,13 @@ static av_always_inline av_const long lo
 }
 #endif /* HAVE_LLRINT */
 
+#if !HAVE_LOG2
+static av_always_inline av_const double log2(double x)
+{
+    return log(x) * 1.44269504088896340736;
+}
+#endif /* HAVE_LOG2 */
+
 #if !HAVE_LRINT
 static av_always_inline av_const long int lrint(double x)
 {



More information about the ffmpeg-cvslog mailing list