changeset 76:0e41ca9ebf45

libgsmefr: levinson.c compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 26 Nov 2022 06:48:14 +0000
parents 8d63b167a5d3
children 68f772469ba7
files libgsmefr/Makefile libgsmefr/levinson.c
diffstat 2 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libgsmefr/Makefile	Sat Nov 26 06:39:36 2022 +0000
+++ b/libgsmefr/Makefile	Sat Nov 26 06:48:14 2022 +0000
@@ -3,7 +3,7 @@
 OBJS=	agc.o autocorr.o az_lsp.o basicop2.o c1035pf.o cod_12k2.o convolve.o \
 	d1035pf.o d_gains.o d_homing.o d_plsf_5.o dec_12k2.o dec_create.o \
 	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 \
+	g_code.o g_pitch.o int_lpc.o inter_6.o inv_sqrt.o lag_wind.o levinson.o\
 	params2frame.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 \
--- a/libgsmefr/levinson.c	Sat Nov 26 06:39:36 2022 +0000
+++ b/libgsmefr/levinson.c	Sat Nov 26 06:48:14 2022 +0000
@@ -33,20 +33,22 @@
  *
  *************************************************************************/
 
+#include "gsm_efr.h"
 #include "typedef.h"
+#include "namespace.h"
 #include "basic_op.h"
 #include "oper_32b.h"
-#include "count.h"
+#include "no_count.h"
+#include "sig_proc.h"
+#include "cnst.h"
+#include "enc_state.h"
 
 /* Lpc order == 10 */
 
 #define M 10
 
-/* Last A(z) for case of unstable filter */
-
-Word16 old_A[M + 1];
-
 void Levinson (
+    struct EFR_encoder_state *st,
     Word16 Rh[],    /* (i)     : Rh[m+1] Vector of autocorrelations (msb) */
     Word16 Rl[],    /* (i)     : Rl[m+1] Vector of autocorrelations (lsb) */
     Word16 A[],     /* (o)     : A[m]    LPC coefficients  (m = 10)       */
@@ -127,17 +129,16 @@
         }
         /* Test for unstable filter. If unstable keep old A(z) */
 
-        test (); 
         if (sub (abs_s (Kh), 32750) > 0)
         {
             for (j = 0; j <= M; j++)
             {
-                A[j] = old_A[j];        move16 (); 
+                A[j] = st->old_A[j];
             }
 
             for (j = 0; j < 4; j++)
             {
-                rc[j] = 0;              move16 (); 
+                rc[j] = 0;
             }
 
             return;
@@ -187,7 +188,7 @@
     for (i = 1; i <= M; i++)
     {
         t0 = L_Comp (Ah[i], Al[i]);
-        old_A[i] = A[i] = round (L_shl (t0, 1));move16 (); move16 (); 
+        st->old_A[i] = A[i] = round (L_shl (t0, 1));
     }
 
     return;