comparison libtwamr/lag_wind.c @ 384:a8dab7028e4d

libtwamr: integrate lag_wind.c
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 06 May 2024 05:56:50 +0000
parents
children
comparison
equal deleted inserted replaced
383:838ed426bb76 384:a8dab7028e4d
1 /*
2 ********************************************************************************
3 *
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001
5 * R99 Version 3.3.0
6 * REL-4 Version 4.1.0
7 *
8 ********************************************************************************
9 *
10 * File : lag_wind.c
11 * Purpose : Lag windowing of autocorrelations.
12 *
13 ********************************************************************************
14 */
15 /*
16 ********************************************************************************
17 * MODULE INCLUDE FILE AND VERSION ID
18 ********************************************************************************
19 */
20 #include "namespace.h"
21 #include "lag_wind.h"
22
23 /*
24 ********************************************************************************
25 * INCLUDE FILES
26 ********************************************************************************
27 */
28 #include "typedef.h"
29 #include "basic_op.h"
30 #include "oper_32b.h"
31 #include "no_count.h"
32
33 /*
34 ********************************************************************************
35 * LOCAL VARIABLES AND TABLES
36 ********************************************************************************
37 */
38 #include "lag_wind.tab" /* Table for Lag_Window() */
39
40 /*
41 ********************************************************************************
42 * PUBLIC PROGRAM CODE
43 ********************************************************************************
44 */
45 /*************************************************************************
46 *
47 * FUNCTION: Lag_window()
48 *
49 * PURPOSE: Lag windowing of autocorrelations.
50 *
51 * DESCRIPTION:
52 * r[i] = r[i]*lag_wind[i], i=1,...,10
53 *
54 * r[i] and lag_wind[i] are in special double precision format.
55 * See "oper_32b.c" for the format.
56 *
57 *************************************************************************/
58 void Lag_window (
59 Word16 m, /* (i) : LPC order */
60 Word16 r_h[], /* (i/o) : Autocorrelations (msb) */
61 Word16 r_l[] /* (i/o) : Autocorrelations (lsb) */
62 )
63 {
64 Word16 i;
65 Word32 x;
66
67 for (i = 1; i <= m; i++)
68 {
69 x = Mpy_32 (r_h[i], r_l[i], lag_h[i - 1], lag_l[i - 1]);
70 L_Extract (x, &r_h[i], &r_l[i]);
71 }
72 return;
73 }