ex
Fork of mbed-os-example-mbed5-blinky by
DuerOS-Light-SDK-v1.1.0/duer-os-light/external/speex/libspeex/filters_bfin.h@47:9e361da97763, 2017-07-18 (annotated)
- Committer:
- TMBOY
- Date:
- Tue Jul 18 16:54:45 2017 +0800
- Revision:
- 47:9e361da97763
?
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| TMBOY | 47:9e361da97763 | 1 | /* Copyright (C) 2005 Analog Devices */ |
| TMBOY | 47:9e361da97763 | 2 | /** |
| TMBOY | 47:9e361da97763 | 3 | @file filters_bfin.h |
| TMBOY | 47:9e361da97763 | 4 | @brief Various analysis/synthesis filters (Blackfin version) |
| TMBOY | 47:9e361da97763 | 5 | */ |
| TMBOY | 47:9e361da97763 | 6 | /* |
| TMBOY | 47:9e361da97763 | 7 | Redistribution and use in source and binary forms, with or without |
| TMBOY | 47:9e361da97763 | 8 | modification, are permitted provided that the following conditions |
| TMBOY | 47:9e361da97763 | 9 | are met: |
| TMBOY | 47:9e361da97763 | 10 | |
| TMBOY | 47:9e361da97763 | 11 | - Redistributions of source code must retain the above copyright |
| TMBOY | 47:9e361da97763 | 12 | notice, this list of conditions and the following disclaimer. |
| TMBOY | 47:9e361da97763 | 13 | |
| TMBOY | 47:9e361da97763 | 14 | - Redistributions in binary form must reproduce the above copyright |
| TMBOY | 47:9e361da97763 | 15 | notice, this list of conditions and the following disclaimer in the |
| TMBOY | 47:9e361da97763 | 16 | documentation and/or other materials provided with the distribution. |
| TMBOY | 47:9e361da97763 | 17 | |
| TMBOY | 47:9e361da97763 | 18 | - Neither the name of the Xiph.org Foundation nor the names of its |
| TMBOY | 47:9e361da97763 | 19 | contributors may be used to endorse or promote products derived from |
| TMBOY | 47:9e361da97763 | 20 | this software without specific prior written permission. |
| TMBOY | 47:9e361da97763 | 21 | |
| TMBOY | 47:9e361da97763 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| TMBOY | 47:9e361da97763 | 23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| TMBOY | 47:9e361da97763 | 24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| TMBOY | 47:9e361da97763 | 25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR |
| TMBOY | 47:9e361da97763 | 26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| TMBOY | 47:9e361da97763 | 27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| TMBOY | 47:9e361da97763 | 28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| TMBOY | 47:9e361da97763 | 29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| TMBOY | 47:9e361da97763 | 30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| TMBOY | 47:9e361da97763 | 31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| TMBOY | 47:9e361da97763 | 32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| TMBOY | 47:9e361da97763 | 33 | */ |
| TMBOY | 47:9e361da97763 | 34 | |
| TMBOY | 47:9e361da97763 | 35 | #define OVERRIDE_NORMALIZE16 |
| TMBOY | 47:9e361da97763 | 36 | int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int len) |
| TMBOY | 47:9e361da97763 | 37 | { |
| TMBOY | 47:9e361da97763 | 38 | spx_sig_t max_val=1; |
| TMBOY | 47:9e361da97763 | 39 | int sig_shift; |
| TMBOY | 47:9e361da97763 | 40 | __asm__ |
| TMBOY | 47:9e361da97763 | 41 | ( |
| TMBOY | 47:9e361da97763 | 42 | "%0 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 43 | "I0 = %1;\n\t" |
| TMBOY | 47:9e361da97763 | 44 | "L0 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 45 | "R1 = [I0++];\n\t" |
| TMBOY | 47:9e361da97763 | 46 | "LOOP norm_max%= LC0 = %2;\n\t" |
| TMBOY | 47:9e361da97763 | 47 | "LOOP_BEGIN norm_max%=;\n\t" |
| TMBOY | 47:9e361da97763 | 48 | "R2 = ABS R1 || R1 = [I0++];\n\t" |
| TMBOY | 47:9e361da97763 | 49 | "%0 = MAX(%0, R2);\n\t" |
| TMBOY | 47:9e361da97763 | 50 | "LOOP_END norm_max%=;\n\t" |
| TMBOY | 47:9e361da97763 | 51 | : "=&d" (max_val) |
| TMBOY | 47:9e361da97763 | 52 | : "a" (x), "a" (len) |
| TMBOY | 47:9e361da97763 | 53 | : "R1", "R2" |
| TMBOY | 47:9e361da97763 | 54 | ); |
| TMBOY | 47:9e361da97763 | 55 | |
| TMBOY | 47:9e361da97763 | 56 | sig_shift=0; |
| TMBOY | 47:9e361da97763 | 57 | while (max_val>max_scale) |
| TMBOY | 47:9e361da97763 | 58 | { |
| TMBOY | 47:9e361da97763 | 59 | sig_shift++; |
| TMBOY | 47:9e361da97763 | 60 | max_val >>= 1; |
| TMBOY | 47:9e361da97763 | 61 | } |
| TMBOY | 47:9e361da97763 | 62 | |
| TMBOY | 47:9e361da97763 | 63 | __asm__ __volatile__ |
| TMBOY | 47:9e361da97763 | 64 | ( |
| TMBOY | 47:9e361da97763 | 65 | "I0 = %0;\n\t" |
| TMBOY | 47:9e361da97763 | 66 | "L0 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 67 | "P1 = %1;\n\t" |
| TMBOY | 47:9e361da97763 | 68 | "R0 = [I0++];\n\t" |
| TMBOY | 47:9e361da97763 | 69 | "LOOP norm_shift%= LC0 = %3;\n\t" |
| TMBOY | 47:9e361da97763 | 70 | "LOOP_BEGIN norm_shift%=;\n\t" |
| TMBOY | 47:9e361da97763 | 71 | "R1 = ASHIFT R0 by %2.L || R0 = [I0++];\n\t" |
| TMBOY | 47:9e361da97763 | 72 | "W[P1++] = R1;\n\t" |
| TMBOY | 47:9e361da97763 | 73 | "LOOP_END norm_shift%=;\n\t" |
| TMBOY | 47:9e361da97763 | 74 | "R1 = ASHIFT R0 by %2.L;\n\t" |
| TMBOY | 47:9e361da97763 | 75 | "W[P1++] = R1;\n\t" |
| TMBOY | 47:9e361da97763 | 76 | : : "a" (x), "a" (y), "d" (-sig_shift), "a" (len-1) |
| TMBOY | 47:9e361da97763 | 77 | : "I0", "L0", "P1", "R0", "R1", "memory" |
| TMBOY | 47:9e361da97763 | 78 | ); |
| TMBOY | 47:9e361da97763 | 79 | return sig_shift; |
| TMBOY | 47:9e361da97763 | 80 | } |
| TMBOY | 47:9e361da97763 | 81 | |
| TMBOY | 47:9e361da97763 | 82 | |
| TMBOY | 47:9e361da97763 | 83 | |
| TMBOY | 47:9e361da97763 | 84 | #define OVERRIDE_FILTER_MEM16 |
| TMBOY | 47:9e361da97763 | 85 | void filter_mem16(const spx_word16_t *_x, const spx_coef_t *num, const spx_coef_t *den, spx_word16_t *_y, int N, int ord, spx_mem_t *mem, char *stack) |
| TMBOY | 47:9e361da97763 | 86 | { |
| TMBOY | 47:9e361da97763 | 87 | VARDECL(spx_word32_t *xy2); |
| TMBOY | 47:9e361da97763 | 88 | VARDECL(spx_word32_t *numden_a); |
| TMBOY | 47:9e361da97763 | 89 | spx_word32_t *xy; |
| TMBOY | 47:9e361da97763 | 90 | spx_word16_t *numden; |
| TMBOY | 47:9e361da97763 | 91 | int i; |
| TMBOY | 47:9e361da97763 | 92 | |
| TMBOY | 47:9e361da97763 | 93 | ALLOC(xy2, (N+1), spx_word32_t); |
| TMBOY | 47:9e361da97763 | 94 | ALLOC(numden_a, (2*ord+2), spx_word32_t); |
| TMBOY | 47:9e361da97763 | 95 | xy = xy2+1; |
| TMBOY | 47:9e361da97763 | 96 | numden = (spx_word16_t*) numden_a; |
| TMBOY | 47:9e361da97763 | 97 | |
| TMBOY | 47:9e361da97763 | 98 | for (i=0;i<ord;i++) |
| TMBOY | 47:9e361da97763 | 99 | { |
| TMBOY | 47:9e361da97763 | 100 | numden[2*i] = num[i]; |
| TMBOY | 47:9e361da97763 | 101 | numden[2*i+1] = den[i]; |
| TMBOY | 47:9e361da97763 | 102 | } |
| TMBOY | 47:9e361da97763 | 103 | __asm__ __volatile__ |
| TMBOY | 47:9e361da97763 | 104 | ( |
| TMBOY | 47:9e361da97763 | 105 | /* Register setup */ |
| TMBOY | 47:9e361da97763 | 106 | "R0 = %5;\n\t" /*ord */ |
| TMBOY | 47:9e361da97763 | 107 | |
| TMBOY | 47:9e361da97763 | 108 | "P0 = %3;\n\t" |
| TMBOY | 47:9e361da97763 | 109 | "I0 = P0;\n\t" |
| TMBOY | 47:9e361da97763 | 110 | "B0 = P0;\n\t" /* numden */ |
| TMBOY | 47:9e361da97763 | 111 | "L0 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 112 | |
| TMBOY | 47:9e361da97763 | 113 | "P2 = %0;\n\t" /* Fused xy */ |
| TMBOY | 47:9e361da97763 | 114 | "I2 = P2;\n\t" |
| TMBOY | 47:9e361da97763 | 115 | "L2 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 116 | |
| TMBOY | 47:9e361da97763 | 117 | "P4 = %6;\n\t" /* mem */ |
| TMBOY | 47:9e361da97763 | 118 | "P0 = %1;\n\t" /* _x */ |
| TMBOY | 47:9e361da97763 | 119 | "P1 = %2;\n\t" /* _y */ |
| TMBOY | 47:9e361da97763 | 120 | |
| TMBOY | 47:9e361da97763 | 121 | /* First sample */ |
| TMBOY | 47:9e361da97763 | 122 | "R1 = [P4++];\n\t" |
| TMBOY | 47:9e361da97763 | 123 | "R1 <<= 3;\n\t" /* shift mem */ |
| TMBOY | 47:9e361da97763 | 124 | "R1.L = R1 (RND);\n\t" |
| TMBOY | 47:9e361da97763 | 125 | "R2 = W[P0++];\n\t" /* load x[0] */ |
| TMBOY | 47:9e361da97763 | 126 | "R1.L = R1.L + R2.L;\n\t" |
| TMBOY | 47:9e361da97763 | 127 | "W[P1++] = R1;\n\t" /* store y[0] */ |
| TMBOY | 47:9e361da97763 | 128 | "R2 = PACK(R1.L, R2.L);\n\t" /* pack x16 and y16 */ |
| TMBOY | 47:9e361da97763 | 129 | "[P2] = R2;\n\t" |
| TMBOY | 47:9e361da97763 | 130 | |
| TMBOY | 47:9e361da97763 | 131 | /* Samples 1 to ord-1 (using memory) */ |
| TMBOY | 47:9e361da97763 | 132 | "R0 += -1;\n\t" |
| TMBOY | 47:9e361da97763 | 133 | "R3 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 134 | "LC0 = R0;\n\t" |
| TMBOY | 47:9e361da97763 | 135 | "LOOP filter_start%= LC0;\n\t" |
| TMBOY | 47:9e361da97763 | 136 | "LOOP_BEGIN filter_start%=;\n\t" |
| TMBOY | 47:9e361da97763 | 137 | "R3 += 1;\n\t" |
| TMBOY | 47:9e361da97763 | 138 | "LC1 = R3;\n\t" |
| TMBOY | 47:9e361da97763 | 139 | |
| TMBOY | 47:9e361da97763 | 140 | "R1 = [P4++];\n\t" |
| TMBOY | 47:9e361da97763 | 141 | "A1 = R1;\n\t" |
| TMBOY | 47:9e361da97763 | 142 | "A0 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 143 | "I0 = B0;\n\t" |
| TMBOY | 47:9e361da97763 | 144 | "I2 = P2;\n\t" |
| TMBOY | 47:9e361da97763 | 145 | "P2 += 4;\n\t" |
| TMBOY | 47:9e361da97763 | 146 | "R4 = [I0++] || R5 = [I2--];\n\t" |
| TMBOY | 47:9e361da97763 | 147 | "LOOP filter_start_inner%= LC1;\n\t" |
| TMBOY | 47:9e361da97763 | 148 | "LOOP_BEGIN filter_start_inner%=;\n\t" |
| TMBOY | 47:9e361da97763 | 149 | "A1 -= R4.H*R5.H, A0 += R4.L*R5.L (IS) || R4 = [I0++] || R5 = [I2--];\n\t" |
| TMBOY | 47:9e361da97763 | 150 | "LOOP_END filter_start_inner%=;\n\t" |
| TMBOY | 47:9e361da97763 | 151 | "A0 += A1;\n\t" |
| TMBOY | 47:9e361da97763 | 152 | "R4 = A0;\n\t" |
| TMBOY | 47:9e361da97763 | 153 | "R4 <<= 3;\n\t" /* shift mem */ |
| TMBOY | 47:9e361da97763 | 154 | "R4.L = R4 (RND);\n\t" |
| TMBOY | 47:9e361da97763 | 155 | "R2 = W[P0++];\n\t" /* load x */ |
| TMBOY | 47:9e361da97763 | 156 | "R4.L = R4.L + R2.L;\n\t" |
| TMBOY | 47:9e361da97763 | 157 | "W[P1++] = R4;\n\t" /* store y */ |
| TMBOY | 47:9e361da97763 | 158 | //"R4 <<= 2;\n\t" |
| TMBOY | 47:9e361da97763 | 159 | //"R2 <<= 2;\n\t" |
| TMBOY | 47:9e361da97763 | 160 | "R2 = PACK(R4.L, R2.L);\n\t" /* pack x16 and y16 */ |
| TMBOY | 47:9e361da97763 | 161 | "[P2] = R2;\n\t" |
| TMBOY | 47:9e361da97763 | 162 | |
| TMBOY | 47:9e361da97763 | 163 | "LOOP_END filter_start%=;\n\t" |
| TMBOY | 47:9e361da97763 | 164 | |
| TMBOY | 47:9e361da97763 | 165 | /* Samples ord to N*/ |
| TMBOY | 47:9e361da97763 | 166 | "R0 = %5;\n\t" |
| TMBOY | 47:9e361da97763 | 167 | "R0 <<= 1;\n\t" |
| TMBOY | 47:9e361da97763 | 168 | "I0 = B0;\n\t" /* numden */ |
| TMBOY | 47:9e361da97763 | 169 | "R0 <<= 1;\n\t" |
| TMBOY | 47:9e361da97763 | 170 | "L0 = R0;\n\t" |
| TMBOY | 47:9e361da97763 | 171 | |
| TMBOY | 47:9e361da97763 | 172 | "R0 = %5;\n\t" /* org */ |
| TMBOY | 47:9e361da97763 | 173 | "R2 = %4;\n\t" /* N */ |
| TMBOY | 47:9e361da97763 | 174 | "R2 = R2 - R0;\n\t" |
| TMBOY | 47:9e361da97763 | 175 | "R4 = [I0++];\n\t" /* numden */ |
| TMBOY | 47:9e361da97763 | 176 | "LC0 = R2;\n\t" |
| TMBOY | 47:9e361da97763 | 177 | "P3 = R0;\n\t" |
| TMBOY | 47:9e361da97763 | 178 | "R0 <<= 2;\n\t" |
| TMBOY | 47:9e361da97763 | 179 | "R0 += 8;\n\t" |
| TMBOY | 47:9e361da97763 | 180 | "I2 = P2;\n\t" |
| TMBOY | 47:9e361da97763 | 181 | "M0 = R0;\n\t" |
| TMBOY | 47:9e361da97763 | 182 | "A1 = A0 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 183 | "R5 = [I2--];\n\t" /* load xy */ |
| TMBOY | 47:9e361da97763 | 184 | "LOOP filter_mid%= LC0;\n\t" |
| TMBOY | 47:9e361da97763 | 185 | "LOOP_BEGIN filter_mid%=;\n\t" |
| TMBOY | 47:9e361da97763 | 186 | "LOOP filter_mid_inner%= LC1=P3;\n\t" |
| TMBOY | 47:9e361da97763 | 187 | "LOOP_BEGIN filter_mid_inner%=;\n\t" |
| TMBOY | 47:9e361da97763 | 188 | "A1 -= R4.H*R5.H, A0 += R4.L*R5.L (IS) || R4 = [I0++] || R5 = [I2--];\n\t" |
| TMBOY | 47:9e361da97763 | 189 | "LOOP_END filter_mid_inner%=;\n\t" |
| TMBOY | 47:9e361da97763 | 190 | "R0 = (A0 += A1) || I2 += M0;\n\t" |
| TMBOY | 47:9e361da97763 | 191 | "R0 = R0 << 3 || R5 = W[P0++];\n\t" /* load x */ |
| TMBOY | 47:9e361da97763 | 192 | "R0.L = R0 (RND);\n\t" |
| TMBOY | 47:9e361da97763 | 193 | "R0.L = R0.L + R5.L;\n\t" |
| TMBOY | 47:9e361da97763 | 194 | "R5 = PACK(R0.L, R5.L) || W[P1++] = R0;\n\t" /* shift y | store y */ |
| TMBOY | 47:9e361da97763 | 195 | "A1 = A0 = 0 || [I2--] = R5\n\t" |
| TMBOY | 47:9e361da97763 | 196 | "LOOP_END filter_mid%=;\n\t" |
| TMBOY | 47:9e361da97763 | 197 | "I2 += 4;\n\t" |
| TMBOY | 47:9e361da97763 | 198 | "P2 = I2;\n\t" |
| TMBOY | 47:9e361da97763 | 199 | /* Update memory */ |
| TMBOY | 47:9e361da97763 | 200 | "P4 = %6;\n\t" |
| TMBOY | 47:9e361da97763 | 201 | "R0 = %5;\n\t" |
| TMBOY | 47:9e361da97763 | 202 | "LC0 = R0;\n\t" |
| TMBOY | 47:9e361da97763 | 203 | "P0 = B0;\n\t" |
| TMBOY | 47:9e361da97763 | 204 | "A1 = A0 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 205 | "LOOP mem_update%= LC0;\n\t" |
| TMBOY | 47:9e361da97763 | 206 | "LOOP_BEGIN mem_update%=;\n\t" |
| TMBOY | 47:9e361da97763 | 207 | "I2 = P2;\n\t" |
| TMBOY | 47:9e361da97763 | 208 | "I0 = P0;\n\t" |
| TMBOY | 47:9e361da97763 | 209 | "P0 += 4;\n\t" |
| TMBOY | 47:9e361da97763 | 210 | "R0 = LC0;\n\t" |
| TMBOY | 47:9e361da97763 | 211 | "LC1 = R0;\n\t" |
| TMBOY | 47:9e361da97763 | 212 | "R5 = [I2--] || R4 = [I0++];\n\t" |
| TMBOY | 47:9e361da97763 | 213 | "LOOP mem_accum%= LC1;\n\t" |
| TMBOY | 47:9e361da97763 | 214 | "LOOP_BEGIN mem_accum%=;\n\t" |
| TMBOY | 47:9e361da97763 | 215 | "A1 -= R4.H*R5.H, A0 += R4.L*R5.L (IS) || R4 = [I0++] || R5 = [I2--];\n\t" |
| TMBOY | 47:9e361da97763 | 216 | "LOOP_END mem_accum%=;\n\t" |
| TMBOY | 47:9e361da97763 | 217 | "R0 = (A0 += A1);\n\t" |
| TMBOY | 47:9e361da97763 | 218 | "A1 = A0 = 0 || [P4++] = R0;\n\t" |
| TMBOY | 47:9e361da97763 | 219 | "LOOP_END mem_update%=;\n\t" |
| TMBOY | 47:9e361da97763 | 220 | "L0 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 221 | : : "m" (xy), "m" (_x), "m" (_y), "m" (numden), "m" (N), "m" (ord), "m" (mem) |
| TMBOY | 47:9e361da97763 | 222 | : "A0", "A1", "R0", "R1", "R2", "R3", "R4", "R5", "P0", "P1", "P2", "P3", "P4", "B0", "I0", "I2", "L0", "L2", "M0", "memory" |
| TMBOY | 47:9e361da97763 | 223 | ); |
| TMBOY | 47:9e361da97763 | 224 | |
| TMBOY | 47:9e361da97763 | 225 | } |
| TMBOY | 47:9e361da97763 | 226 | |
| TMBOY | 47:9e361da97763 | 227 | |
| TMBOY | 47:9e361da97763 | 228 | |
| TMBOY | 47:9e361da97763 | 229 | #define OVERRIDE_IIR_MEM16 |
| TMBOY | 47:9e361da97763 | 230 | void iir_mem16(const spx_word16_t *_x, const spx_coef_t *den, spx_word16_t *_y, int N, int ord, spx_mem_t *mem, char *stack) |
| TMBOY | 47:9e361da97763 | 231 | { |
| TMBOY | 47:9e361da97763 | 232 | VARDECL(spx_word16_t *y); |
| TMBOY | 47:9e361da97763 | 233 | spx_word16_t *yy; |
| TMBOY | 47:9e361da97763 | 234 | |
| TMBOY | 47:9e361da97763 | 235 | ALLOC(y, (N+2), spx_word16_t); |
| TMBOY | 47:9e361da97763 | 236 | yy = y+2; |
| TMBOY | 47:9e361da97763 | 237 | |
| TMBOY | 47:9e361da97763 | 238 | __asm__ __volatile__ |
| TMBOY | 47:9e361da97763 | 239 | ( |
| TMBOY | 47:9e361da97763 | 240 | /* Register setup */ |
| TMBOY | 47:9e361da97763 | 241 | "R0 = %5;\n\t" /*ord */ |
| TMBOY | 47:9e361da97763 | 242 | |
| TMBOY | 47:9e361da97763 | 243 | "P1 = %3;\n\t" |
| TMBOY | 47:9e361da97763 | 244 | "I1 = P1;\n\t" |
| TMBOY | 47:9e361da97763 | 245 | "B1 = P1;\n\t" |
| TMBOY | 47:9e361da97763 | 246 | "L1 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 247 | |
| TMBOY | 47:9e361da97763 | 248 | "P3 = %0;\n\t" |
| TMBOY | 47:9e361da97763 | 249 | "I3 = P3;\n\t" |
| TMBOY | 47:9e361da97763 | 250 | "L3 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 251 | |
| TMBOY | 47:9e361da97763 | 252 | "P4 = %6;\n\t" |
| TMBOY | 47:9e361da97763 | 253 | "P0 = %1;\n\t" |
| TMBOY | 47:9e361da97763 | 254 | "P1 = %2;\n\t" |
| TMBOY | 47:9e361da97763 | 255 | |
| TMBOY | 47:9e361da97763 | 256 | /* First sample */ |
| TMBOY | 47:9e361da97763 | 257 | "R1 = [P4++];\n\t" |
| TMBOY | 47:9e361da97763 | 258 | "R1 = R1 << 3 (S);\n\t" |
| TMBOY | 47:9e361da97763 | 259 | "R1.L = R1 (RND);\n\t" |
| TMBOY | 47:9e361da97763 | 260 | "R2 = W[P0++];\n\t" |
| TMBOY | 47:9e361da97763 | 261 | "R1 = R1 + R2;\n\t" |
| TMBOY | 47:9e361da97763 | 262 | "W[P1++] = R1;\n\t" |
| TMBOY | 47:9e361da97763 | 263 | "W[P3] = R1;\n\t" |
| TMBOY | 47:9e361da97763 | 264 | |
| TMBOY | 47:9e361da97763 | 265 | /* Samples 1 to ord-1 (using memory) */ |
| TMBOY | 47:9e361da97763 | 266 | "R0 += -1;\n\t" |
| TMBOY | 47:9e361da97763 | 267 | "R3 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 268 | "LC0 = R0;\n\t" |
| TMBOY | 47:9e361da97763 | 269 | "LOOP filter_start%= LC0;\n\t" |
| TMBOY | 47:9e361da97763 | 270 | "LOOP_BEGIN filter_start%=;\n\t" |
| TMBOY | 47:9e361da97763 | 271 | "R3 += 1;\n\t" |
| TMBOY | 47:9e361da97763 | 272 | "LC1 = R3;\n\t" |
| TMBOY | 47:9e361da97763 | 273 | |
| TMBOY | 47:9e361da97763 | 274 | "R1 = [P4++];\n\t" |
| TMBOY | 47:9e361da97763 | 275 | "A1 = R1;\n\t" |
| TMBOY | 47:9e361da97763 | 276 | "I1 = B1;\n\t" |
| TMBOY | 47:9e361da97763 | 277 | "I3 = P3;\n\t" |
| TMBOY | 47:9e361da97763 | 278 | "P3 += 2;\n\t" |
| TMBOY | 47:9e361da97763 | 279 | "LOOP filter_start_inner%= LC1;\n\t" |
| TMBOY | 47:9e361da97763 | 280 | "LOOP_BEGIN filter_start_inner%=;\n\t" |
| TMBOY | 47:9e361da97763 | 281 | "R4.L = W[I1++];\n\t" |
| TMBOY | 47:9e361da97763 | 282 | "R5.L = W[I3--];\n\t" |
| TMBOY | 47:9e361da97763 | 283 | "A1 -= R4.L*R5.L (IS);\n\t" |
| TMBOY | 47:9e361da97763 | 284 | "LOOP_END filter_start_inner%=;\n\t" |
| TMBOY | 47:9e361da97763 | 285 | |
| TMBOY | 47:9e361da97763 | 286 | "R1 = A1;\n\t" |
| TMBOY | 47:9e361da97763 | 287 | "R1 <<= 3;\n\t" |
| TMBOY | 47:9e361da97763 | 288 | "R1.L = R1 (RND);\n\t" |
| TMBOY | 47:9e361da97763 | 289 | "R2 = W[P0++];\n\t" |
| TMBOY | 47:9e361da97763 | 290 | "R1 = R1 + R2;\n\t" |
| TMBOY | 47:9e361da97763 | 291 | "W[P1++] = R1;\n\t" |
| TMBOY | 47:9e361da97763 | 292 | "W[P3] = R1;\n\t" |
| TMBOY | 47:9e361da97763 | 293 | "LOOP_END filter_start%=;\n\t" |
| TMBOY | 47:9e361da97763 | 294 | |
| TMBOY | 47:9e361da97763 | 295 | /* Samples ord to N*/ |
| TMBOY | 47:9e361da97763 | 296 | "R0 = %5;\n\t" |
| TMBOY | 47:9e361da97763 | 297 | "R0 <<= 1;\n\t" |
| TMBOY | 47:9e361da97763 | 298 | "I1 = B1;\n\t" |
| TMBOY | 47:9e361da97763 | 299 | "L1 = R0;\n\t" |
| TMBOY | 47:9e361da97763 | 300 | |
| TMBOY | 47:9e361da97763 | 301 | "R0 = %5;\n\t" |
| TMBOY | 47:9e361da97763 | 302 | "R2 = %4;\n\t" |
| TMBOY | 47:9e361da97763 | 303 | "R2 = R2 - R0;\n\t" |
| TMBOY | 47:9e361da97763 | 304 | "R4.L = W[I1++];\n\t" |
| TMBOY | 47:9e361da97763 | 305 | "LC0 = R2;\n\t" |
| TMBOY | 47:9e361da97763 | 306 | "LOOP filter_mid%= LC0;\n\t" |
| TMBOY | 47:9e361da97763 | 307 | "LOOP_BEGIN filter_mid%=;\n\t" |
| TMBOY | 47:9e361da97763 | 308 | "LC1 = R0;\n\t" |
| TMBOY | 47:9e361da97763 | 309 | "A1 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 310 | "I3 = P3;\n\t" |
| TMBOY | 47:9e361da97763 | 311 | "P3 += 2;\n\t" |
| TMBOY | 47:9e361da97763 | 312 | "R5.L = W[I3--];\n\t" |
| TMBOY | 47:9e361da97763 | 313 | "LOOP filter_mid_inner%= LC1;\n\t" |
| TMBOY | 47:9e361da97763 | 314 | "LOOP_BEGIN filter_mid_inner%=;\n\t" |
| TMBOY | 47:9e361da97763 | 315 | "A1 -= R4.L*R5.L (IS) || R4.L = W[I1++] || R5.L = W[I3--];\n\t" |
| TMBOY | 47:9e361da97763 | 316 | "LOOP_END filter_mid_inner%=;\n\t" |
| TMBOY | 47:9e361da97763 | 317 | "R1 = A1;\n\t" |
| TMBOY | 47:9e361da97763 | 318 | "R1 = R1 << 3 || R2 = W[P0++];\n\t" |
| TMBOY | 47:9e361da97763 | 319 | "R1.L = R1 (RND);\n\t" |
| TMBOY | 47:9e361da97763 | 320 | "R1 = R1 + R2;\n\t" |
| TMBOY | 47:9e361da97763 | 321 | "W[P1++] = R1;\n\t" |
| TMBOY | 47:9e361da97763 | 322 | "W[P3] = R1;\n\t" |
| TMBOY | 47:9e361da97763 | 323 | "LOOP_END filter_mid%=;\n\t" |
| TMBOY | 47:9e361da97763 | 324 | |
| TMBOY | 47:9e361da97763 | 325 | /* Update memory */ |
| TMBOY | 47:9e361da97763 | 326 | "P4 = %6;\n\t" |
| TMBOY | 47:9e361da97763 | 327 | "R0 = %5;\n\t" |
| TMBOY | 47:9e361da97763 | 328 | "LC0 = R0;\n\t" |
| TMBOY | 47:9e361da97763 | 329 | "P1 = B1;\n\t" |
| TMBOY | 47:9e361da97763 | 330 | "LOOP mem_update%= LC0;\n\t" |
| TMBOY | 47:9e361da97763 | 331 | "LOOP_BEGIN mem_update%=;\n\t" |
| TMBOY | 47:9e361da97763 | 332 | "A0 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 333 | "I3 = P3;\n\t" |
| TMBOY | 47:9e361da97763 | 334 | "I1 = P1;\n\t" |
| TMBOY | 47:9e361da97763 | 335 | "P1 += 2;\n\t" |
| TMBOY | 47:9e361da97763 | 336 | "R0 = LC0;\n\t" |
| TMBOY | 47:9e361da97763 | 337 | "LC1=R0;\n\t" |
| TMBOY | 47:9e361da97763 | 338 | "R5.L = W[I3--] || R4.L = W[I1++];\n\t" |
| TMBOY | 47:9e361da97763 | 339 | "LOOP mem_accum%= LC1;\n\t" |
| TMBOY | 47:9e361da97763 | 340 | "LOOP_BEGIN mem_accum%=;\n\t" |
| TMBOY | 47:9e361da97763 | 341 | "A0 -= R4.L*R5.L (IS) || R4.L = W[I1++] || R5.L = W[I3--];\n\t" |
| TMBOY | 47:9e361da97763 | 342 | "LOOP_END mem_accum%=;\n\t" |
| TMBOY | 47:9e361da97763 | 343 | "R0 = A0;\n\t" |
| TMBOY | 47:9e361da97763 | 344 | "[P4++] = R0;\n\t" |
| TMBOY | 47:9e361da97763 | 345 | "LOOP_END mem_update%=;\n\t" |
| TMBOY | 47:9e361da97763 | 346 | "L1 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 347 | : : "m" (yy), "m" (_x), "m" (_y), "m" (den), "m" (N), "m" (ord), "m" (mem) |
| TMBOY | 47:9e361da97763 | 348 | : "A0", "A1", "R0", "R1", "R2", "R3", "R4", "R5", "P0", "P1", "P2", "P3", "P4", "B1", "I1", "I3", "L1", "L3", "memory" |
| TMBOY | 47:9e361da97763 | 349 | ); |
| TMBOY | 47:9e361da97763 | 350 | |
| TMBOY | 47:9e361da97763 | 351 | } |
| TMBOY | 47:9e361da97763 | 352 | |
| TMBOY | 47:9e361da97763 | 353 | |
| TMBOY | 47:9e361da97763 | 354 | #define OVERRIDE_FIR_MEM16 |
| TMBOY | 47:9e361da97763 | 355 | void fir_mem16(const spx_word16_t *x, const spx_coef_t *num, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack) |
| TMBOY | 47:9e361da97763 | 356 | { |
| TMBOY | 47:9e361da97763 | 357 | int i; |
| TMBOY | 47:9e361da97763 | 358 | spx_coef_t den2[12]; |
| TMBOY | 47:9e361da97763 | 359 | spx_coef_t *den; |
| TMBOY | 47:9e361da97763 | 360 | den = (spx_coef_t*)((((int)den2)+4)&0xfffffffc); |
| TMBOY | 47:9e361da97763 | 361 | for (i=0;i<10;i++) |
| TMBOY | 47:9e361da97763 | 362 | den[i] = 0; |
| TMBOY | 47:9e361da97763 | 363 | filter_mem16(x, num, den, y, N, ord, mem, stack); |
| TMBOY | 47:9e361da97763 | 364 | } |
| TMBOY | 47:9e361da97763 | 365 | |
| TMBOY | 47:9e361da97763 | 366 | |
| TMBOY | 47:9e361da97763 | 367 | #define OVERRIDE_COMPUTE_IMPULSE_RESPONSE |
| TMBOY | 47:9e361da97763 | 368 | void compute_impulse_response(const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack) |
| TMBOY | 47:9e361da97763 | 369 | { |
| TMBOY | 47:9e361da97763 | 370 | int i; |
| TMBOY | 47:9e361da97763 | 371 | VARDECL(spx_word16_t *ytmp); |
| TMBOY | 47:9e361da97763 | 372 | ALLOC(ytmp, N, spx_word16_t); |
| TMBOY | 47:9e361da97763 | 373 | spx_word16_t *ytmp2 = ytmp; |
| TMBOY | 47:9e361da97763 | 374 | y[0] = LPC_SCALING; |
| TMBOY | 47:9e361da97763 | 375 | for (i=0;i<ord;i++) |
| TMBOY | 47:9e361da97763 | 376 | y[i+1] = awk1[i]; |
| TMBOY | 47:9e361da97763 | 377 | i++; |
| TMBOY | 47:9e361da97763 | 378 | for (;i<N;i++) |
| TMBOY | 47:9e361da97763 | 379 | y[i] = 0; |
| TMBOY | 47:9e361da97763 | 380 | |
| TMBOY | 47:9e361da97763 | 381 | N-=1; |
| TMBOY | 47:9e361da97763 | 382 | __asm__ __volatile__ |
| TMBOY | 47:9e361da97763 | 383 | ( |
| TMBOY | 47:9e361da97763 | 384 | "I0 = %0;\n\t" |
| TMBOY | 47:9e361da97763 | 385 | "I1 = %1;\n\t" |
| TMBOY | 47:9e361da97763 | 386 | "L0 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 387 | "L1 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 388 | "L2 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 389 | "L3 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 390 | "R0 = 1;\n\t" |
| TMBOY | 47:9e361da97763 | 391 | "R0 <<= 13;\n\t" |
| TMBOY | 47:9e361da97763 | 392 | "W[I0] = R0.L;\n\t" |
| TMBOY | 47:9e361da97763 | 393 | "R0 <<= 1;\n\t" |
| TMBOY | 47:9e361da97763 | 394 | "W[I1] = R0.L;\n\t" |
| TMBOY | 47:9e361da97763 | 395 | "R0 = %5;\n\t" |
| TMBOY | 47:9e361da97763 | 396 | "LC0 = R0;\n\t" |
| TMBOY | 47:9e361da97763 | 397 | "R2 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 398 | "LOOP samples%= LC0;\n\t" |
| TMBOY | 47:9e361da97763 | 399 | "LOOP_BEGIN samples%=;\n\t" |
| TMBOY | 47:9e361da97763 | 400 | "R2 += 1;\n\t" |
| TMBOY | 47:9e361da97763 | 401 | "R2 = MIN(R2, %4);\n\t" |
| TMBOY | 47:9e361da97763 | 402 | "I0 = %0;\n\t" |
| TMBOY | 47:9e361da97763 | 403 | "I1 = %1;\n\t" |
| TMBOY | 47:9e361da97763 | 404 | "I2 = %2;\n\t" |
| TMBOY | 47:9e361da97763 | 405 | "I3 = %3;\n\t" |
| TMBOY | 47:9e361da97763 | 406 | "%0 += 2;\n\t" |
| TMBOY | 47:9e361da97763 | 407 | "%1 += 2;\n\t" |
| TMBOY | 47:9e361da97763 | 408 | "A1 = A0 = 0;\n\t" |
| TMBOY | 47:9e361da97763 | 409 | "R0.L = W[I0--] || R1.L = W[I2++];\n\t" |
| TMBOY | 47:9e361da97763 | 410 | "LC1 = R2;\n\t" |
| TMBOY | 47:9e361da97763 | 411 | "LOOP filter%= LC1;\n\t" |
| TMBOY | 47:9e361da97763 | 412 | "LOOP_BEGIN filter%=;\n\t" |
| TMBOY | 47:9e361da97763 | 413 | "A0 -= R0.L*R1.L (IS) || R0.L = W[I1--] || R1.L = W[I3++];\n\t" |
| TMBOY | 47:9e361da97763 | 414 | "A1 -= R0.L*R1.L (IS) || R0.L = W[I0--] || R1.L = W[I2++];\n\t" |
| TMBOY | 47:9e361da97763 | 415 | "LOOP_END filter%=;\n\t" |
| TMBOY | 47:9e361da97763 | 416 | "R0 = A0, R1 = A1;\n\t" |
| TMBOY | 47:9e361da97763 | 417 | "R3 = W[%1] (X);\n\t" |
| TMBOY | 47:9e361da97763 | 418 | "R3 <<= 13;\n\t" |
| TMBOY | 47:9e361da97763 | 419 | "R0 = R0 + R3;\n\t" |
| TMBOY | 47:9e361da97763 | 420 | "R3 = R0 >>> 13;\n\t" |
| TMBOY | 47:9e361da97763 | 421 | "W[%0] = R3.L;\n\t" |
| TMBOY | 47:9e361da97763 | 422 | "R0 <<= 1;\n\t" |
| TMBOY | 47:9e361da97763 | 423 | "R1 = R1 + R0;\n\t" |
| TMBOY | 47:9e361da97763 | 424 | "R1 >>>= 13;\n\t" |
| TMBOY | 47:9e361da97763 | 425 | "W[%1] = R1.L;\n\t" |
| TMBOY | 47:9e361da97763 | 426 | "LOOP_END samples%=;\n\t" |
| TMBOY | 47:9e361da97763 | 427 | : "=a" (ytmp2), "=a" (y) |
| TMBOY | 47:9e361da97763 | 428 | : "a" (awk2), "a" (ak), "d" (ord), "m" (N), "0" (ytmp2), "1" (y) |
| TMBOY | 47:9e361da97763 | 429 | : "A0", "A1", "R0", "R1", "R2", "R3", "I0", "I1", "I2", "I3", "L0", "L1", "L2", "L3", "A0", "A1" |
| TMBOY | 47:9e361da97763 | 430 | ); |
| TMBOY | 47:9e361da97763 | 431 | } |
| TMBOY | 47:9e361da97763 | 432 | |
| TMBOY | 47:9e361da97763 | 433 | |
| TMBOY | 47:9e361da97763 | 434 | |
| TMBOY | 47:9e361da97763 | 435 | #if 0 /* Equivalent C function for filter_mem2 and compute_impulse_response */ |
| TMBOY | 47:9e361da97763 | 436 | #define min(a,b) ((a)<(b) ? (a):(b)) |
| TMBOY | 47:9e361da97763 | 437 | |
| TMBOY | 47:9e361da97763 | 438 | void compute_impulse_response(const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack) |
| TMBOY | 47:9e361da97763 | 439 | { |
| TMBOY | 47:9e361da97763 | 440 | int i,j; |
| TMBOY | 47:9e361da97763 | 441 | VARDECL(spx_word16_t *ytmp); |
| TMBOY | 47:9e361da97763 | 442 | ALLOC(ytmp, N, spx_word16_t); |
| TMBOY | 47:9e361da97763 | 443 | |
| TMBOY | 47:9e361da97763 | 444 | y[0] = LPC_SCALING; |
| TMBOY | 47:9e361da97763 | 445 | for (i=0;i<ord;i++) |
| TMBOY | 47:9e361da97763 | 446 | y[i+1] = awk1[i]; |
| TMBOY | 47:9e361da97763 | 447 | i++; |
| TMBOY | 47:9e361da97763 | 448 | for (;i<N;i++) |
| TMBOY | 47:9e361da97763 | 449 | y[i] = 0; |
| TMBOY | 47:9e361da97763 | 450 | |
| TMBOY | 47:9e361da97763 | 451 | for (i=0;i<N;i++) |
| TMBOY | 47:9e361da97763 | 452 | { |
| TMBOY | 47:9e361da97763 | 453 | spx_word32_t yi = SHL32(EXTEND32(y[i]),LPC_SHIFT); |
| TMBOY | 47:9e361da97763 | 454 | spx_word32_t yi2 = 0; |
| TMBOY | 47:9e361da97763 | 455 | for (j=0;j<min(i,ord);j++) |
| TMBOY | 47:9e361da97763 | 456 | { |
| TMBOY | 47:9e361da97763 | 457 | yi = MAC16_16(yi, awk2[j], -ytmp[i-j-1]); |
| TMBOY | 47:9e361da97763 | 458 | yi2 = MAC16_16(yi2, ak[j], -y[i-j-1]); |
| TMBOY | 47:9e361da97763 | 459 | } |
| TMBOY | 47:9e361da97763 | 460 | ytmp[i] = EXTRACT16(SHR32(yi,LPC_SHIFT)); |
| TMBOY | 47:9e361da97763 | 461 | yi2 = ADD32(yi2,SHL32(yi,1)); |
| TMBOY | 47:9e361da97763 | 462 | y[i] = EXTRACT16(SHR32(yi2,LPC_SHIFT)); |
| TMBOY | 47:9e361da97763 | 463 | } |
| TMBOY | 47:9e361da97763 | 464 | |
| TMBOY | 47:9e361da97763 | 465 | } |
| TMBOY | 47:9e361da97763 | 466 | |
| TMBOY | 47:9e361da97763 | 467 | |
| TMBOY | 47:9e361da97763 | 468 | void filter_mem2(const spx_sig_t *_x, const spx_coef_t *num, const spx_coef_t *den, spx_sig_t *_y, int N, int ord, spx_mem_t *mem) |
| TMBOY | 47:9e361da97763 | 469 | { |
| TMBOY | 47:9e361da97763 | 470 | int i,j; |
| TMBOY | 47:9e361da97763 | 471 | spx_word16_t xi,yi,nyi; |
| TMBOY | 47:9e361da97763 | 472 | spx_word16_t x[N],y[N]; |
| TMBOY | 47:9e361da97763 | 473 | spx_word16_t *xx, *yy; |
| TMBOY | 47:9e361da97763 | 474 | xx = x; |
| TMBOY | 47:9e361da97763 | 475 | yy = y; |
| TMBOY | 47:9e361da97763 | 476 | for (i=0;i<N;i++) |
| TMBOY | 47:9e361da97763 | 477 | { |
| TMBOY | 47:9e361da97763 | 478 | x[i] = EXTRACT16(SHR32(_x[i],SIG_SHIFT)); |
| TMBOY | 47:9e361da97763 | 479 | } |
| TMBOY | 47:9e361da97763 | 480 | |
| TMBOY | 47:9e361da97763 | 481 | for (i=0;i<ord;i++) |
| TMBOY | 47:9e361da97763 | 482 | { |
| TMBOY | 47:9e361da97763 | 483 | spx_word32_t yi = mem[i]; |
| TMBOY | 47:9e361da97763 | 484 | for (j=0;j<i;j++) |
| TMBOY | 47:9e361da97763 | 485 | { |
| TMBOY | 47:9e361da97763 | 486 | yi = MAC16_16(yi, num[j], x[i-j-1]); |
| TMBOY | 47:9e361da97763 | 487 | yi = MAC16_16(yi, den[j], -y[i-j-1]); |
| TMBOY | 47:9e361da97763 | 488 | } |
| TMBOY | 47:9e361da97763 | 489 | _y[i] = ADD32(_x[i],SHL32(yi,1)); |
| TMBOY | 47:9e361da97763 | 490 | y[i] = EXTRACT16(SHR32(_y[i],SIG_SHIFT)); |
| TMBOY | 47:9e361da97763 | 491 | } |
| TMBOY | 47:9e361da97763 | 492 | for (i=ord;i<N;i++) |
| TMBOY | 47:9e361da97763 | 493 | { |
| TMBOY | 47:9e361da97763 | 494 | spx_word32_t yi = 0; |
| TMBOY | 47:9e361da97763 | 495 | for (j=0;j<ord;j++) |
| TMBOY | 47:9e361da97763 | 496 | { |
| TMBOY | 47:9e361da97763 | 497 | yi = MAC16_16(yi, num[j], x[i-j-1]); |
| TMBOY | 47:9e361da97763 | 498 | yi = MAC16_16(yi, den[j], -y[i-j-1]); |
| TMBOY | 47:9e361da97763 | 499 | } |
| TMBOY | 47:9e361da97763 | 500 | _y[i] = ADD32(_x[i],SHL32(yi,1)); |
| TMBOY | 47:9e361da97763 | 501 | y[i] = EXTRACT16(SHR32(_y[i],SIG_SHIFT)); |
| TMBOY | 47:9e361da97763 | 502 | } |
| TMBOY | 47:9e361da97763 | 503 | |
| TMBOY | 47:9e361da97763 | 504 | for (i=0;i<ord;i++) |
| TMBOY | 47:9e361da97763 | 505 | { |
| TMBOY | 47:9e361da97763 | 506 | spx_mem_t m = 0; |
| TMBOY | 47:9e361da97763 | 507 | for (j=0;j<ord-i;j++) |
| TMBOY | 47:9e361da97763 | 508 | { |
| TMBOY | 47:9e361da97763 | 509 | m = MAC16_16(m, x[N-1-j], num[j+i]); |
| TMBOY | 47:9e361da97763 | 510 | m = MAC16_16(m, -y[N-1-j], den[j+i]); |
| TMBOY | 47:9e361da97763 | 511 | } |
| TMBOY | 47:9e361da97763 | 512 | mem[i] = m; |
| TMBOY | 47:9e361da97763 | 513 | } |
| TMBOY | 47:9e361da97763 | 514 | } |
| TMBOY | 47:9e361da97763 | 515 | #endif |
