[xiph-commits] r11749 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Mon Aug 7 23:54:49 PDT 2006


Author: jm
Date: 2006-08-07 23:54:47 -0700 (Mon, 07 Aug 2006)
New Revision: 11749

Modified:
   trunk/speex/libspeex/pseudofloat.h
Log:
added FLOAT_SQRT


Modified: trunk/speex/libspeex/pseudofloat.h
===================================================================
--- trunk/speex/libspeex/pseudofloat.h	2006-08-08 06:08:52 UTC (rev 11748)
+++ trunk/speex/libspeex/pseudofloat.h	2006-08-08 06:54:47 UTC (rev 11749)
@@ -36,6 +36,7 @@
 #define PSEUDOFLOAT_H
 
 #include "misc.h"
+#include "math_approx.h"
 #include <math.h>
 
 #ifdef FIXED_POINT
@@ -334,6 +335,22 @@
    return r;
 }
 
+static inline spx_float_t FLOAT_SQRT(spx_float_t a)
+{
+   spx_float_t r;
+   spx_int32_t m;
+   m = a.m << 14;
+   r.e = a.e - 14;
+   if (r.e & 1)
+   {
+      r.e -= 1;
+      m <<= 1;
+   }
+   r.e >>= 1;
+   r.m = spx_sqrt(m);
+   return r;
+}
+
 #else
 
 #define spx_float_t float
@@ -354,6 +371,7 @@
 #define FLOAT_LT(a,b) ((a)<(b))
 #define FLOAT_GT(a,b) ((a)>(b))
 #define FLOAT_DIVU(a,b) ((a)/(b))
+#define FLOAT_SQRT(a) (spx_sqrt(a))
 
 #endif
 



More information about the commits mailing list