diff libgsmefr/memops.h @ 58:d285877fc4cc

libgsmefr: cod_12k2.c compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 25 Nov 2022 18:50:50 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgsmefr/memops.h	Fri Nov 25 18:50:50 2022 +0000
@@ -0,0 +1,24 @@
+/*
+ * The original code from ETSI uses its own Copy() and Set_zero()
+ * functions, operating on Word16 elements.  Here we implement them
+ * as static inline functions wrapping around memcpy and memset.
+ */
+
+#include <string.h>
+
+static inline void Copy (
+    const Word16 x[],  /* (i)  : input vector                               */
+    Word16 y[],        /* (o)  : output vector                              */
+    Word16 L           /* (i)  : vector length                              */
+)
+{
+	memcpy(y, x, L * 2);
+}
+
+static inline void Set_zero (
+    Word16 x[],        /* (o)  : vector to clear                            */
+    Word16 L           /* (i)  : length of vector                           */
+)
+{
+	memset(x, 0, L * 2);
+}