changeset 86:9aef9e54b19d

libgsmefr: preemph.c compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 26 Nov 2022 09:56:19 +0000
parents db8e0b69a6bb
children 41d8e8f4058d
files libgsmefr/Makefile libgsmefr/preemph.c
diffstat 2 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libgsmefr/Makefile	Sat Nov 26 08:59:34 2022 +0000
+++ b/libgsmefr/Makefile	Sat Nov 26 09:56:19 2022 +0000
@@ -5,8 +5,8 @@
 	dec_lag6.o dtx.o e_homing.o enc_create.o enc_lag6.o frame2params.o \
 	g_code.o g_pitch.o int_lpc.o inter_6.o inv_sqrt.o lag_wind.o levinson.o\
 	log2.o lsp_az.o lsp_lsf.o oper_32b.o params2frame.o pitch_f6.o \
-	pitch_ol.o pow2.o pre_proc.o pred_lt6.o sid_class.o sid_insert.o \
-	tls_flags.o
+	pitch_ol.o pow2.o pre_proc.o pred_lt6.o preemph.o sid_class.o \
+	sid_insert.o tls_flags.o
 HDRS=	basic_op.h cnst.h codec.h d_homing.h dec_state.h dtx.h e_homing.h \
 	enc_state.h gains_tb.h gsm_efr.h memops.h namespace.h no_count.h \
 	oper_32b.h sig_proc.h typedef.h vad.h
--- a/libgsmefr/preemph.c	Sat Nov 26 08:59:34 2022 +0000
+++ b/libgsmefr/preemph.c	Sat Nov 26 09:56:19 2022 +0000
@@ -4,13 +4,17 @@
  * Preemphasis: filtering through 1 - g z^-1                           *
  *---------------------------------------------------------------------*/
 
+#include "gsm_efr.h"
 #include "typedef.h"
+#include "namespace.h"
 #include "basic_op.h"
-#include "count.h"
-
-Word16 mem_pre;
+#include "no_count.h"
+#include "sig_proc.h"
+#include "cnst.h"
+#include "dec_state.h"
 
 void preemphasis (
+    struct EFR_decoder_state *st,
     Word16 *signal, /* (i/o)   : input signal overwritten by the output */
     Word16 g,       /* (i)     : preemphasis coefficient                */
     Word16 L        /* (i)     : size of filtering                      */
@@ -18,19 +22,19 @@
 {
     Word16 *p1, *p2, temp, i;
 
-    p1 = signal + L - 1;                    move16 (); 
-    p2 = p1 - 1;                            move16 (); 
-    temp = *p1;                             move16 (); 
+    p1 = signal + L - 1;
+    p2 = p1 - 1;
+    temp = *p1;
 
     for (i = 0; i <= L - 2; i++)
     {
-        *p1 = sub (*p1, mult (g, *p2--));   move16 (); 
+        *p1 = sub (*p1, mult (g, *p2--));
         p1--;
     }
 
-    *p1 = sub (*p1, mult (g, mem_pre));     move16 (); 
+    *p1 = sub (*p1, mult (g, st->mem_pre));
 
-    mem_pre = temp;                         move16 (); 
+    st->mem_pre = temp;
 
     return;
 }