diff libgsmefr/levinson.c @ 76:0e41ca9ebf45

libgsmefr: levinson.c compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 26 Nov 2022 06:48:14 +0000
parents 49dd1ac8e75b
children 1cdbaeec7bcc
line wrap: on
line diff
--- 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;