changeset 52:988fd7ff514f

libgsmefr: add state pointers to ETSI function prototypes
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 25 Nov 2022 08:22:41 +0000
parents 722959d9410f
children 49dd1ac8e75b
files libgsmefr/codec.h libgsmefr/d_homing.h libgsmefr/dtx.h libgsmefr/e_homing.h libgsmefr/sig_proc.h libgsmefr/vad.h
diffstat 6 files changed, 34 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/libgsmefr/codec.h	Fri Nov 25 06:46:22 2022 +0000
+++ b/libgsmefr/codec.h	Fri Nov 25 08:22:41 2022 +0000
@@ -1,13 +1,15 @@
-void Init_Coder_12k2 (void);
+void Init_Coder_12k2 (struct EFR_encoder_state *st);
 
 void Coder_12k2 (
+    struct EFR_encoder_state *st,
     Word16 ana[],      /* output  : Analysis parameters */
     Word16 synth[]     /* output  : Local synthesis     */
 );
 
-void Init_Decoder_12k2 (void);
+void Init_Decoder_12k2 (struct EFR_decoder_state *st);
 
 void Decoder_12k2 (
+    struct EFR_decoder_state *st,
     Word16 parm[],     /* input : vector of synthesis parameters
                                   parm[0] = bad frame indicator (bfi) */
     Word16 synth[],    /* output: synthesis speech                    */
@@ -16,9 +18,10 @@
     Word16 SID_flag
 );
 
-void Init_Post_Filter (void);
+void Init_Post_Filter (struct EFR_decoder_state *st);
 
 void Post_Filter (
+    struct EFR_decoder_state *st,
     Word16 *syn,       /* in/out: synthesis speech (postfiltered is output) */
     Word16 *Az_4       /* input : interpolated LPC parameters in all subfr. */
 );
@@ -36,7 +39,9 @@
     Word16 index[],    /* (i)   : index of 10 pulses (sign+position)        */
     Word16 cod[]       /* (o)   : algebraic (fixed) codebook excitation     */
 );
+
 Word16 Dec_lag6 (      /* output: return integer pitch lag                  */
+    struct EFR_decoder_state *st,
     Word16 index,      /* input : received pitch index                      */
     Word16 pit_min,    /* input : minimum pitch lag                         */
     Word16 pit_max,    /* input : maximum pitch lag                         */
@@ -46,6 +51,7 @@
     Word16 bfi         /* input : bad frame indicator                       */
 );
 Word16 d_gain_pitch (  /* out      : quantized pitch gain                   */
+    struct EFR_decoder_state *st,
     Word16 index,      /* in       : index of quantization                  */
     Word16 bfi,        /* in       : bad frame indicator (good = 0)         */
     Word16 state,      /* in       : state of the state machine             */
@@ -54,6 +60,7 @@
 
 );
 void d_gain_code (
+    struct EFR_decoder_state *st,
     Word16 index,      /* input : received quantization index               */
     Word16 code[],     /* input : innovation codevector                     */
     Word16 lcode,      /* input : codevector length                         */
@@ -67,6 +74,7 @@
 
 );
 void D_plsf_5 (
+    struct EFR_decoder_state *st,
     Word16 *indice,    /* input : quantization indices of 5 submatrices     */
     Word16 *lsp1_q,    /* output: quantized 1st LSP vector                  */
     Word16 *lsp2_q,    /* output: quantized 2nd LSP vector                  */
@@ -75,6 +83,7 @@
     Word16 rxdtx_ctrl,
     Word16 rx_dtx_state
 );
+
 Word16 Enc_lag6 (      /* output: Return index of encoding                  */
     Word16 T0,         /* input : Pitch delay                               */
     Word16 *T0_frac,   /* in/out: Fractional pitch delay                    */
@@ -90,6 +99,7 @@
 );
 
 Word16 q_gain_code (   /* Return quantization index                         */
+    struct EFR_encoder_state *st,
     Word16 code[],     /* (i)      : fixed codebook excitation              */
     Word16 lcode,      /* (i)      : codevector size                        */
     Word16 *gain,      /* (i/o)    : quantized fixed codebook gain          */
@@ -152,7 +162,9 @@
     Word16 frac,       /* input : fraction of lag                           */
     Word16 L_subfr     /* input : subframe size                             */
 );
+
 void Q_plsf_5 (
+    struct EFR_encoder_state *st,
     Word16 *lsp1,      /* input : 1st LSP vector                            */
     Word16 *lsp2,      /* input : 2nd LSP vector                            */
     Word16 *lsp1_q,    /* output: quantized 1st LSP vector                  */
--- a/libgsmefr/d_homing.h	Fri Nov 25 06:46:22 2022 +0000
+++ b/libgsmefr/d_homing.h	Fri Nov 25 08:22:41 2022 +0000
@@ -15,4 +15,4 @@
 
 Word16 decoder_homing_frame_test (Word16 parm[], Word16 nbr_of_params);
 
-void decoder_reset (void);
+void decoder_reset (struct EFR_decoder_state *st);
--- a/libgsmefr/dtx.h	Fri Nov 25 06:46:22 2022 +0000
+++ b/libgsmefr/dtx.h	Fri Nov 25 08:22:41 2022 +0000
@@ -47,22 +47,23 @@
 #define RX_CNI_BFI               0x0200
 #define RX_FIRST_SP_FLAG         0x0400
 
-void reset_tx_dtx (void);       /* Reset tx dtx variables */
-void reset_rx_dtx (void);       /* Reset rx dtx variables */
+void reset_tx_dtx (struct EFR_encoder_state *st);  /* Reset tx dtx variables */
+void reset_rx_dtx (struct EFR_decoder_state *st);  /* Reset rx dtx variables */
 
 void tx_dtx (
-    Word16 VAD_flag,
-    Word16 *txdtx_ctrl
+    struct EFR_encoder_state *st,
+    Word16 VAD_flag
 );
 
 void rx_dtx (
-    Word16 *rxdtx_ctrl,
+    struct EFR_decoder_state *st,
     Word16 TAF,
     Word16 bfi,
     Word16 SID_flag
 );
 
 void CN_encoding (
+    struct EFR_encoder_state *st,
     Word16 params[],
     Word16 txdtx_ctrl
 );
@@ -86,11 +87,13 @@
 );
 
 void update_gain_code_history_tx (
+    struct EFR_encoder_state *st,
     Word16 new_gain_code,
     Word16 gain_code_old_tx[4 * DTX_HANGOVER]
 );
 
 void update_gain_code_history_rx (
+    struct EFR_decoder_state *st,
     Word16 new_gain_code,
     Word16 gain_code_old_rx[4 * DTX_HANGOVER]
 );
--- a/libgsmefr/e_homing.h	Fri Nov 25 06:46:22 2022 +0000
+++ b/libgsmefr/e_homing.h	Fri Nov 25 08:22:41 2022 +0000
@@ -13,4 +13,4 @@
 
 Word16 encoder_homing_frame_test (Word16 input_frame[]);
 
-void encoder_reset (void);
+void encoder_reset (struct EFR_encoder_state *st);
--- a/libgsmefr/sig_proc.h	Fri Nov 25 06:46:22 2022 +0000
+++ b/libgsmefr/sig_proc.h	Fri Nov 25 08:22:41 2022 +0000
@@ -19,8 +19,9 @@
 
 /* General signal processing */
 
-void Init_Pre_Process (void);
+void Init_Pre_Process (struct EFR_encoder_state *st);
 void Pre_Process (
+    struct EFR_encoder_state *st,
     Word16 signal[],   /* Input/output signal                               */
     Word16 lg          /* Lenght of signal                                  */
 );
@@ -38,6 +39,7 @@
     Word16 r_l[]       /* (i/o)  : Autocorrelations  (lsb)                  */
 );
 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)       */
@@ -97,6 +99,7 @@
     Word16 L           /* (i)  : vector size                                */
 );
 void agc (
+    struct EFR_decoder_state *st,
     Word16 *sig_in,    /* (i)  : postfilter input signal                    */
     Word16 *sig_out,   /* (i/o): postfilter output signal                   */
     Word16 agc_fac,    /* (i)  : AGC factor                                 */
@@ -108,6 +111,7 @@
     Word16 l_trm       /* (i)  : subframe size                              */
 );
 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                          */
--- a/libgsmefr/vad.h	Fri Nov 25 06:46:22 2022 +0000
+++ b/libgsmefr/vad.h	Fri Nov 25 08:22:41 2022 +0000
@@ -8,9 +8,10 @@
  *
  **************************************************************************/
 
-void vad_reset (void);
+void vad_reset (struct EFR_encoder_state *st);
 
 Word16 vad_computation (
+    struct EFR_encoder_state *st,
     Word16 r_h[],
     Word16 r_l[],
     Word16 scal_acf,
@@ -92,6 +93,6 @@
 );
 
 void periodicity_update (
-    Word16 lags[],
-    Word16 *ptch
+    struct EFR_encoder_state *st,
+    Word16 lags[]
 );