shithub: opus

Download patch

ref: 88c58cfaf37d513b6bd1660617e50e610e1ab58d
parent: 1032e47d3f3376947280d2c7769c522b6474c6ad
author: Jean-Marc Valin <jmvalin@amazon.com>
date: Fri Oct 20 13:08:35 EDT 2023

nnet.h no longer needs to #include "vec.h"

--- a/dnn/nnet.c
+++ b/dnn/nnet.c
@@ -40,6 +40,7 @@
 #include "plc_data.h"
 #include "fargan.h"
 #include "os_support.h"
+#include "vec.h"
 
 #ifdef NO_OPTIMIZATIONS
 #if defined(_MSC_VER)
--- a/dnn/nnet.h
+++ b/dnn/nnet.h
@@ -29,7 +29,14 @@
 #define _NNET_H_
 
 #include <stddef.h>
-#include "vec.h"
+#include "opus_types.h"
+
+#ifdef DISABLE_DOT_PROD
+typedef float qweight;
+#else
+typedef signed char qweight;
+#define DOT_PROD
+#endif
 
 #define ACTIVATION_LINEAR  0
 #define ACTIVATION_SIGMOID 1
--- a/dnn/vec.h
+++ b/dnn/vec.h
@@ -47,17 +47,6 @@
 
 #define NO_OPTIMIZATIONS
 
-#ifndef DISABLE_DOT_PROD
-#define DOT_PROD
-/*#define USE_SU_BIAS*/
-#endif
-
-#ifdef DOT_PROD
-typedef signed char qweight;
-#else
-typedef float qweight;
-#endif
-
 static inline void sgemv16x1(float *out, const float *weights, int rows, int cols, int col_stride, const float *x)
 {
    int i, j;
--- a/dnn/vec_avx.h
+++ b/dnn/vec_avx.h
@@ -40,13 +40,6 @@
 
 #define USE_SU_BIAS
 
-
-/* Use 8-bit dot products unless disabled or if stuck with SSE2. */
-#ifndef DISABLE_DOT_PROD
-#define DOT_PROD
-#endif
-
-
 #ifndef __SSE_4_1__
 static inline __m128 mm_floor_ps(__m128 x) {
   __m128 half = _mm_set1_ps(0.5);
@@ -881,12 +874,6 @@
 #define SCALE (128.f*127.f)
 #define SCALE_1 (1.f/128.f/127.f)
 #define USE_SU_BIAS
-
-#ifdef DOT_PROD
-typedef signed char qweight;
-#else
-typedef float qweight;
-#endif
 
 
 #endif /*VEC_AVX_H*/
--- a/dnn/vec_neon.h
+++ b/dnn/vec_neon.h
@@ -34,17 +34,6 @@
 #include <arm_neon.h>
 #include "os_support.h"
 
-#ifndef DISABLE_DOT_PROD
-#define DOT_PROD
-#endif
-
-#ifdef DOT_PROD
-typedef signed char qweight;
-#else
-typedef float qweight;
-#endif
-
-
 #ifndef LPCNET_TEST
 static inline float32x4_t exp4_approx(float32x4_t x) {
   int32x4_t i;
--- a/dnn/write_lpcnet_weights.c
+++ b/dnn/write_lpcnet_weights.c
@@ -33,6 +33,7 @@
 #include <stddef.h>
 #include "nnet.h"
 #include "os_support.h"
+#include "arch.h"
 
 /* This is a bit of a hack because we need to build nnet_data.c and plc_data.c without USE_WEIGHTS_FILE,
    but USE_WEIGHTS_FILE is defined in config.h. */
--