summaryrefslogtreecommitdiff
path: root/celt/mathops.h
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2013-10-17 15:56:52 -0700
committerGregory Maxwell <greg@xiph.org>2013-10-28 10:18:54 -0700
commit7830cf1bd2c71bad9aa296254cf5c5f9842e8b8e (patch)
tree53f28e34554bee867a239849b96283bec549a607 /celt/mathops.h
parent2891d852a38b3acb1810fad9f26ba7e0b181cfb2 (diff)
downloadopus-7830cf1bd2c71bad9aa296254cf5c5f9842e8b8e.tar.gz
Replace "inline" with OPUS_INLINE.
Newer versions of MSVC are unhappy with the strategy of the build environment redefining "inline" (even though they don't support the actual keyword). Instead we define OPUS_INLINE to the right thing in opus_defines.h. This is the same approach we use for restrict.
Diffstat (limited to 'celt/mathops.h')
-rw-r--r--celt/mathops.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/celt/mathops.h b/celt/mathops.h
index 7e7d906c..a0525a96 100644
--- a/celt/mathops.h
+++ b/celt/mathops.h
@@ -44,7 +44,7 @@
unsigned isqrt32(opus_uint32 _val);
#ifndef OVERRIDE_CELT_MAXABS16
-static inline opus_val32 celt_maxabs16(const opus_val16 *x, int len)
+static OPUS_INLINE opus_val32 celt_maxabs16(const opus_val16 *x, int len)
{
int i;
opus_val16 maxval = 0;
@@ -60,7 +60,7 @@ static inline opus_val32 celt_maxabs16(const opus_val16 *x, int len)
#ifndef OVERRIDE_CELT_MAXABS32
#ifdef FIXED_POINT
-static inline opus_val32 celt_maxabs32(const opus_val32 *x, int len)
+static OPUS_INLINE opus_val32 celt_maxabs32(const opus_val32 *x, int len)
{
int i;
opus_val32 maxval = 0;
@@ -95,7 +95,7 @@ static inline opus_val32 celt_maxabs32(const opus_val32 *x, int len)
denorm, +/- inf and NaN are *not* handled */
/** Base-2 log approximation (log2(x)). */
-static inline float celt_log2(float x)
+static OPUS_INLINE float celt_log2(float x)
{
int integer;
float frac;
@@ -113,7 +113,7 @@ static inline float celt_log2(float x)
}
/** Base-2 exponential approximation (2^x). */
-static inline float celt_exp2(float x)
+static OPUS_INLINE float celt_exp2(float x)
{
int integer;
float frac;
@@ -145,7 +145,7 @@ static inline float celt_exp2(float x)
#ifndef OVERRIDE_CELT_ILOG2
/** Integer log in base2. Undefined for zero and negative numbers */
-static inline opus_int16 celt_ilog2(opus_int32 x)
+static OPUS_INLINE opus_int16 celt_ilog2(opus_int32 x)
{
celt_assert2(x>0, "celt_ilog2() only defined for strictly positive numbers");
return EC_ILOG(x)-1;
@@ -154,7 +154,7 @@ static inline opus_int16 celt_ilog2(opus_int32 x)
/** Integer log in base2. Defined for zero, but not for negative numbers */
-static inline opus_int16 celt_zlog2(opus_val32 x)
+static OPUS_INLINE opus_int16 celt_zlog2(opus_val32 x)
{
return x <= 0 ? 0 : celt_ilog2(x);
}
@@ -166,7 +166,7 @@ opus_val32 celt_sqrt(opus_val32 x);
opus_val16 celt_cos_norm(opus_val32 x);
/** Base-2 logarithm approximation (log2(x)). (Q14 input, Q10 output) */
-static inline opus_val16 celt_log2(opus_val32 x)
+static OPUS_INLINE opus_val16 celt_log2(opus_val32 x)
{
int i;
opus_val16 n, frac;
@@ -192,14 +192,14 @@ static inline opus_val16 celt_log2(opus_val32 x)
#define D2 14819
#define D3 10204
-static inline opus_val32 celt_exp2_frac(opus_val16 x)
+static OPUS_INLINE opus_val32 celt_exp2_frac(opus_val16 x)
{
opus_val16 frac;
frac = SHL16(x, 4);
return ADD16(D0, MULT16_16_Q15(frac, ADD16(D1, MULT16_16_Q15(frac, ADD16(D2 , MULT16_16_Q15(D3,frac))))));
}
/** Base-2 exponential approximation (2^x). (Q10 input, Q16 output) */
-static inline opus_val32 celt_exp2(opus_val16 x)
+static OPUS_INLINE opus_val32 celt_exp2(opus_val16 x)
{
int integer;
opus_val16 frac;
@@ -225,7 +225,7 @@ opus_val32 frac_div32(opus_val32 a, opus_val32 b);
/* Atan approximation using a 4th order polynomial. Input is in Q15 format
and normalized by pi/4. Output is in Q15 format */
-static inline opus_val16 celt_atan01(opus_val16 x)
+static OPUS_INLINE opus_val16 celt_atan01(opus_val16 x)
{
return MULT16_16_P15(x, ADD32(M1, MULT16_16_P15(x, ADD32(M2, MULT16_16_P15(x, ADD32(M3, MULT16_16_P15(M4, x)))))));
}
@@ -236,7 +236,7 @@ static inline opus_val16 celt_atan01(opus_val16 x)
#undef M4
/* atan2() approximation valid for positive input values */
-static inline opus_val16 celt_atan2p(opus_val16 y, opus_val16 x)
+static OPUS_INLINE opus_val16 celt_atan2p(opus_val16 y, opus_val16 x)
{
if (y < x)
{