FreeCalypso > hg > gsm-codec-lib
annotate libtwamr/spstproc.c @ 453:19f1aa01ea10
new approach to config & build for ThemWi software
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 10 May 2024 05:45:46 +0000 |
parents | a37687c6ff22 |
children |
rev | line source |
---|---|
404
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 ******************************************************************************** |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * GSM AMR-NB speech codec R98 Version 7.6.0 December 12, 2001 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * R99 Version 3.3.0 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * REL-4 Version 4.1.0 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 ******************************************************************************** |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 * |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 * File : subframePostProc.c |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 * Purpose : Subframe post processing |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 * |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 ******************************************************************************** |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 /* |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 ******************************************************************************** |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 * MODULE INCLUDE FILE AND VERSION ID |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 ******************************************************************************** |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 #include "namespace.h" |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 #include "spstproc.h" |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 /* |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 ******************************************************************************** |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 * INCLUDE FILES |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 ******************************************************************************** |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 #include "typedef.h" |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 #include "basic_op.h" |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #include "oper_32b.h" |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 #include "no_count.h" |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 #include "syn_filt.h" |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 #include "cnst.h" |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 /* |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 ******************************************************************************** |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 * LOCAL VARIABLES AND TABLES |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 ******************************************************************************** |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 /* |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 ******************************************************************************** |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 * PUBLIC PROGRAM CODE |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 ******************************************************************************** |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 int subframePostProc( |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 Word16 *speech, /* i : speech segment */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 enum Mode mode, /* i : coder mode */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 Word16 i_subfr, /* i : Subframe nr */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 Word16 gain_pit, /* i : Pitch gain Q14 */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 Word16 gain_code, /* i : Decoded innovation gain */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 Word16 *Aq, /* i : A(z) quantized for the 4 subframes */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 Word16 synth[], /* i : Local snthesis */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 Word16 xn[], /* i : Target vector for pitch search */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 Word16 code[], /* i : Fixed codebook exitation */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 Word16 y1[], /* i : Filtered adaptive exitation */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 Word16 y2[], /* i : Filtered fixed codebook excitation */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 Word16 *mem_syn, /* i/o : memory of synthesis filter */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 Word16 *mem_err, /* o : pointer to error signal */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 Word16 *mem_w0, /* o : memory of weighting filter */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 Word16 *exc, /* o : long term prediction residual */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 Word16 *sharp /* o : pitch sharpening value */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 ) |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 { |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 Word16 i, j, k; |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 Word16 temp; |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 Word32 L_temp; |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 Word16 tempShift; |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 Word16 kShift; |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 Word16 pitch_fac; |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 test (); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 if (sub(mode, MR122) != 0) |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 { |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 tempShift = 1; move16 (); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 kShift = 2; move16 (); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 pitch_fac = gain_pit; move16 (); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 } |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 else |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 { |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 tempShift = 2; move16 (); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 kShift = 4; move16 (); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 pitch_fac = shr (gain_pit, 1); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 } |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 /*------------------------------------------------------------* |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 * - Update pitch sharpening "sharp" with quantized gain_pit * |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 *------------------------------------------------------------*/ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 *sharp = gain_pit; move16 (); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 test (); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 if (sub(*sharp, SHARPMAX) > 0) |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 { |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 *sharp = SHARPMAX; move16 (); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 } |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 /*------------------------------------------------------* |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 * - Find the total excitation * |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 * - find synthesis speech corresponding to exc[] * |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 * - update filters memories for finding the target * |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 * vector in the next subframe * |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 * (update error[-m..-1] and mem_w_err[]) * |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 *------------------------------------------------------*/ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 for (i = 0; i < L_SUBFR; i++) { |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 /* exc[i] = gain_pit*exc[i] + gain_code*code[i]; */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 /* |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 * 12k2 others |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 * --------------------------------- |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 * exc Q0 Q0 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 * gain_pit Q14 Q14 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 * pitch_fac Q13 Q14 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 * product: Q14 Q15 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 * |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 * code Q12 Q13 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 * gain_code Q1 Q1 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 * product Q14 Q15 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 * sum Q14 Q15 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 * |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 * tempShift 2 1 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 * sum<<tempShift Q16 Q16 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 * result -> exc Q0 Q0 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 L_temp = L_mult (exc[i + i_subfr], pitch_fac); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 L_temp = L_mac (L_temp, code[i], gain_code); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 L_temp = L_shl (L_temp, tempShift); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 exc[i + i_subfr] = round (L_temp); move16 (); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 } |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 Syn_filt(Aq, &exc[i_subfr], &synth[i_subfr], L_SUBFR, |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 mem_syn, 1); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 for (i = L_SUBFR - M, j = 0; i < L_SUBFR; i++, j++) { |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 mem_err[j] = sub(speech[i_subfr + i], |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 synth[i_subfr + i]); move16 (); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 /* |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 * 12k2 others |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 * --------------------------------- |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 * y1 Q0 Q0 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 * gain_pit Q14 Q14 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 * product Q15 Q15 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 * shifted prod. Q16 Q16 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 * temp Q0 Q0 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 * |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 * y2 Q10 Q12 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 * gain_code Q1 Q1 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 * product Q12 Q14 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 * kshift 4 2 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 * shifted prod. Q16 Q16 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 * k Q0 Q0 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 * mem_w0,xn,sum Q0 Q0 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 */ |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 temp = extract_h(L_shl(L_mult(y1[i], gain_pit), 1)); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 k = extract_h(L_shl(L_mult(y2[i], gain_code), kShift)); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 mem_w0[j] = sub(xn[i], add(temp, k)); move16 (); |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 } |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 return 0; |
a37687c6ff22
libtwamr: integrate spstproc.c
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 } |