[FFmpeg-cvslog] Check for cbrtf() and provide fallback

Mans Rullgard git at videolan.org
Sat Oct 22 20:47:46 CEST 2011


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Wed Jul  7 00:27:52 2010 +0100| [ab2539708a241ddb2190d95d68a86b71b0bec601] | committer: Michael Niedermayer

Check for cbrtf() and provide fallback
(cherry picked from commit bfb37d7db1c6394099f6b177e10d6e769e678f6a)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ab2539708a241ddb2190d95d68a86b71b0bec601
---

 configure        |    2 ++
 libavutil/libm.h |    5 +++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 6d2879d..68bc6b7 100755
--- a/configure
+++ b/configure
@@ -1125,6 +1125,7 @@ HAVE_LIST="
     attribute_may_alias
     attribute_packed
     bswap
+    cbrtf
     closesocket
     cmov
     dcbzl
@@ -2999,6 +3000,7 @@ check_lib math.h sin -lm && LIBM="-lm"
 disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
 enabled vaapi && require vaapi va/va.h vaInitialize -lva
 
+check_mathfunc cbrtf
 check_mathfunc exp2
 check_mathfunc exp2f
 check_mathfunc llrint
diff --git a/libavutil/libm.h b/libavutil/libm.h
index 7e5f668..62faea4 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -28,6 +28,11 @@
 #include "config.h"
 #include "attributes.h"
 
+#if !HAVE_CBRTF
+#undef cbrtf
+#define cbrtf(x) powf(x, 1.0/3.0)
+#endif /* HAVE_CBRTF */
+
 #if !HAVE_EXP2
 #undef exp2
 #define exp2(x) exp((x) * 0.693147180559945)



More information about the ffmpeg-cvslog mailing list