diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2012-12-22 01:17:38 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2012-12-22 01:17:38 +0400 |
commit | d683c76b882224cb331268438c001ac46fe8e3ab (patch) | |
tree | 9a7643c6c8cd24f2afc3dfc6939e2026ee5c0ccf /src/mlp.c | |
parent | b5f739455d5a5fa343723477297e60bd918ac3d8 (diff) |
Fixes MSVC warnings for double->float and float->int conversionv1.1-alpha
Diffstat (limited to 'src/mlp.c')
-rw-r--r-- | src/mlp.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -36,7 +36,6 @@ #define MAX_NEURONS 100 #ifdef FIXED_POINT -extern const opus_val16 tansig_table[501]; static inline opus_val16 tansig_approx(opus_val32 _x) /* Q19 */ { int i; @@ -63,11 +62,11 @@ static inline opus_val16 tansig_approx(opus_val32 _x) /* Q19 */ } #else /*extern const float tansig_table[501];*/ -static inline double tansig_approx(double x) +static inline opus_val16 tansig_approx(opus_val16 x) { int i; - double y, dy; - double sign=1; + opus_val16 y, dy; + opus_val16 sign=1; if (x>=8) return 1; if (x<=-8) @@ -77,8 +76,8 @@ static inline double tansig_approx(double x) x=-x; sign=-1; } - i = floor(.5+25*x); - x -= .04*i; + i = (int)floor(.5f+25*x); + x -= .04f*i; y = tansig_table[i]; dy = 1-y*y; y = y + x*dy*(1 - y*x); |