Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: src/mlp.c

Issue 107243004: Updating Opus to release 1.1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/opus
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/analysis.c ('k') | src/opus.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mlp.c
diff --git a/src/mlp.c b/src/mlp.c
index 73b1d315b86b3a9372ec56b1def7a77e52e77e19..463860266747253621f1163d2c73f3b3fd9395d8 100644
--- a/src/mlp.c
+++ b/src/mlp.c
@@ -29,6 +29,9 @@
#include "config.h"
#endif
+#include "opus_types.h"
+#include "opus_defines.h"
+
#include <math.h>
#include "mlp.h"
#include "arch.h"
@@ -36,7 +39,7 @@
#define MAX_NEURONS 100
#if 0
-static inline opus_val16 tansig_approx(opus_val32 _x) /* Q19 */
+static OPUS_INLINE opus_val16 tansig_approx(opus_val32 _x) /* Q19 */
{
int i;
opus_val16 xx; /* Q11 */
@@ -62,14 +65,15 @@ static inline opus_val16 tansig_approx(opus_val32 _x) /* Q19 */
}
#else
/*extern const float tansig_table[501];*/
-static inline float tansig_approx(float x)
+static OPUS_INLINE float tansig_approx(float x)
{
int i;
float y, dy;
float sign=1;
- if (x>=8)
+ /* Tests are reversed to catch NaNs */
+ if (!(x<8))
return 1;
- if (x<=-8)
+ if (!(x>-8))
return -1;
if (x<0)
{
« no previous file with comments | « src/analysis.c ('k') | src/opus.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698