annotate libtwamr/lsp_az.c @ 403:7e0aeab69b10

libtwamr: integrate spreproc.c
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 06 May 2024 23:11:34 +0000
parents 2ed325c9a507
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
380
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 ********************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * R99 Version 3.3.0
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 * REL-4 Version 4.1.0
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 ********************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 * File : lsp_az.c
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 * Purpose : Converts from the line spectral pairs (LSP) to
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 * : LP coefficients, for a 10th order filter.
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 * Description :
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 * - Find the coefficients of F1(z) and F2(z) (see Get_lsp_pol)
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 * - Multiply F1(z) by 1+z^{-1} and F2(z) by 1-z^{-1}
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 * - A(z) = ( F1(z) + F2(z) ) / 2
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 ********************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 /*
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 ********************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 * MODULE INCLUDE FILE AND VERSION ID
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 ********************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 #include "namespace.h"
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 #include "lsp_az.h"
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 /*
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 ********************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 * INCLUDE FILES
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 ********************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 #include "typedef.h"
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 #include "basic_op.h"
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 #include "oper_32b.h"
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 #include "no_count.h"
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 /*
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 ********************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 * LOCAL VARIABLES AND TABLES
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 ********************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 /*
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 ********************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 * LOCAL PROGRAM CODE
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 ********************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 /*************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 * FUNCTION: Get_lsp_pol
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 * PURPOSE: Find the polynomial F1(z) or F2(z) from the LSPs.
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 * If the LSP vector is passed at address 0 F1(z) is computed
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 * and if it is passed at address 1 F2(z) is computed.
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 * DESCRIPTION:
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 * This is performed by expanding the product polynomials:
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 * F1(z) = product ( 1 - 2 lsp[i] z^-1 + z^-2 )
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 * i=0,2,4,6,8
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 * F2(z) = product ( 1 - 2 lsp[i] z^-1 + z^-2 )
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 * i=1,3,5,7,9
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 * where lsp[] is the LSP vector in the cosine domain.
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 * The expansion is performed using the following recursion:
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 * f[0] = 1
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 * b = -2.0 * lsp[0]
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 * f[1] = b
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 * for i=2 to 5 do
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 * b = -2.0 * lsp[2*i-2];
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 * f[i] = b*f[i-1] + 2.0*f[i-2];
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 * for j=i-1 down to 2 do
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 * f[j] = f[j] + b*f[j-1] + f[j-2];
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 * f[1] = f[1] + b;
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 *************************************************************************/
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 static void Get_lsp_pol (Word16 *lsp, Word32 *f)
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 {
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 Word16 i, j, hi, lo;
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 Word32 t0;
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 /* f[0] = 1.0; */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 *f = L_mult (4096, 2048); move32 ();
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 f++; move32 ();
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 *f = L_msu ((Word32) 0, *lsp, 512); /* f[1] = -2.0 * lsp[0]; */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 f++; move32 ();
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 lsp += 2; /* Advance lsp pointer */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 for (i = 2; i <= 5; i++)
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 {
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 *f = f[-2]; move32 ();
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 for (j = 1; j < i; j++, f--)
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 {
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 L_Extract (f[-1], &hi, &lo);
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 t0 = Mpy_32_16 (hi, lo, *lsp); /* t0 = f[-1] * lsp */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 t0 = L_shl (t0, 1);
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 *f = L_add (*f, f[-2]); move32 (); /* *f += f[-2] */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 *f = L_sub (*f, t0);move32 (); /* *f -= t0 */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 }
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 *f = L_msu (*f, *lsp, 512); move32 (); /* *f -= lsp<<9 */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 f += i; /* Advance f pointer */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 lsp += 2; /* Advance lsp pointer */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 }
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 return;
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 }
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 /*
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 ********************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 * PUBLIC PROGRAM CODE
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 ********************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 /*************************************************************************
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 * FUNCTION: Lsp_Az
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 * PURPOSE: Converts from the line spectral pairs (LSP) to
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 * LP coefficients, for a 10th order filter.
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 * DESCRIPTION:
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 * - Find the coefficients of F1(z) and F2(z) (see Get_lsp_pol)
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 * - Multiply F1(z) by 1+z^{-1} and F2(z) by 1-z^{-1}
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 * - A(z) = ( F1(z) + F2(z) ) / 2
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 *
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 *************************************************************************/
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 void Lsp_Az (
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 Word16 lsp[], /* (i) : line spectral frequencies */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 Word16 a[] /* (o) : predictor coefficients (order = 10) */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 )
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 {
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 Word16 i, j;
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 Word32 f1[6], f2[6];
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 Word32 t0;
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 Get_lsp_pol (&lsp[0], f1);
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 Get_lsp_pol (&lsp[1], f2);
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 for (i = 5; i > 0; i--)
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 {
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 f1[i] = L_add (f1[i], f1[i - 1]); move32 (); /* f1[i] += f1[i-1]; */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 f2[i] = L_sub (f2[i], f2[i - 1]); move32 (); /* f2[i] -= f2[i-1]; */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 }
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 a[0] = 4096; move16 ();
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 for (i = 1, j = 10; i <= 5; i++, j--)
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 {
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 t0 = L_add (f1[i], f2[i]); /* f1[i] + f2[i] */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 a[i] = extract_l (L_shr_r (t0, 13)); move16 ();
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 t0 = L_sub (f1[i], f2[i]); /* f1[i] - f2[i] */
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 a[j] = extract_l (L_shr_r (t0, 13)); move16 ();
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 }
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 return;
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 }
2ed325c9a507 libtwamr: integrate lsp_az.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159