changeset 395:8c7d5eec544c

libtwamr: integrate weight_a.c
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 06 May 2024 18:52:57 +0000
parents 2af94ba0c075
children 38ee82480462
files libtwamr/Makefile libtwamr/namespace.list libtwamr/weight_a.c libtwamr/weight_a.h
diffstat 4 files changed, 114 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libtwamr/Makefile	Mon May 06 18:49:17 2024 +0000
+++ b/libtwamr/Makefile	Mon May 06 18:52:57 2024 +0000
@@ -13,7 +13,7 @@
 	post_pro.o pow2.o prmno.o q_gain_c.o q_gain_p.o q_plsf.o q_plsf3_tab.o \
 	q_plsf5_tab.o q_plsf_3.o q_plsf_5.o qgain475.o qgain795.o qua_gain.o \
 	qua_gain_tab.o reorder.o residu.o s10_8pf.o set_sign.o sqrt_l.o \
-	syn_filt.o tls_flags.o window.o
+	syn_filt.o tls_flags.o weight_a.o window.o
 HDRS=	namespace.h
 LIB=	libtwamr.a
 
--- a/libtwamr/namespace.list	Mon May 06 18:49:17 2024 +0000
+++ b/libtwamr/namespace.list	Mon May 06 18:52:57 2024 +0000
@@ -30,7 +30,7 @@
 Pitch_fr Pitch_fr_reset
 Post_Process Post_Process_reset
 Q_plsf_reset Q_plsf_3 Q_plsf_5 Qua_gain
-Residu Syn_filt
+Residu Syn_filt Weight_Ai
 
 agc agc2 agc_reset
 pseudonoise build_CN_code build_CN_param
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libtwamr/weight_a.c	Mon May 06 18:52:57 2024 +0000
@@ -0,0 +1,67 @@
+/*
+********************************************************************************
+*
+*      GSM AMR-NB speech codec   R98   Version 7.6.0   December 12, 2001
+*                                R99   Version 3.3.0                
+*                                REL-4 Version 4.1.0                
+*
+********************************************************************************
+*
+*      File             : weight_a.c
+*      Purpose          : Spectral expansion of LP coefficients.  (order==10)
+*      Description      : a_exp[i] = a[i] * fac[i-1]    ,i=1,10
+*
+********************************************************************************
+*/
+/*
+********************************************************************************
+*                         MODULE INCLUDE FILE AND VERSION ID
+********************************************************************************
+*/
+#include "namespace.h"
+#include "weight_a.h"
+
+/*
+********************************************************************************
+*                         INCLUDE FILES
+********************************************************************************
+*/
+#include "typedef.h"
+#include "basic_op.h"
+#include "no_count.h"
+#include "cnst.h"
+
+/*
+********************************************************************************
+*                         LOCAL VARIABLES AND TABLES
+********************************************************************************
+*/
+/*
+*--------------------------------------*
+* Constants (defined in cnst.h         *
+*--------------------------------------*
+*  M         : LPC order               *
+*--------------------------------------*
+*/
+
+/*
+********************************************************************************
+*                         PUBLIC PROGRAM CODE
+********************************************************************************
+*/
+void Weight_Ai (
+    Word16 a[],         /* (i)     : a[M+1]  LPC coefficients   (M=10)    */
+    const Word16 fac[], /* (i)     : Spectral expansion factors.          */
+    Word16 a_exp[]      /* (o)     : Spectral expanded LPC coefficients   */
+)
+{
+    Word16 i;
+
+    a_exp[0] = a[0];                                    move16 (); 
+    for (i = 1; i <= M; i++)
+    {
+        a_exp[i] = round (L_mult (a[i], fac[i - 1]));   move16 (); 
+    }
+
+    return;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libtwamr/weight_a.h	Mon May 06 18:52:57 2024 +0000
@@ -0,0 +1,45 @@
+/*
+********************************************************************************
+*
+*      GSM AMR-NB speech codec   R98   Version 7.6.0   December 12, 2001
+*                                R99   Version 3.3.0                
+*                                REL-4 Version 4.1.0                
+*
+********************************************************************************
+*
+*      File             : weight_a.h
+*      Purpose          : Spectral expansion of LP coefficients.  (order==10)
+*      Description      : a_exp[i] = a[i] * fac[i-1]    ,i=1,10
+*
+*
+********************************************************************************
+*/
+#ifndef weight_a_h
+#define weight_a_h "$Id $"
+ 
+/*
+********************************************************************************
+*                         INCLUDE FILES
+********************************************************************************
+*/
+#include "typedef.h"
+ 
+/*
+********************************************************************************
+*                         DEFINITION OF DATA TYPES
+********************************************************************************
+*/
+ 
+/*
+********************************************************************************
+*                         DECLARATION OF PROTOTYPES
+********************************************************************************
+*/
+ 
+void Weight_Ai (
+    Word16 a[],        /* (i)  : a[m+1]  LPC coefficients   (m=10)          */
+    const Word16 fac[],/* (i)  : Spectral expansion factors.                */
+    Word16 a_exp[]     /* (o)  : Spectral expanded LPC coefficients         */
+);
+ 
+#endif