summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/libatrac/atrac3.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/apps/codecs/libatrac/atrac3.c b/apps/codecs/libatrac/atrac3.c
index 4c0b7d079f..b93b058bb2 100644
--- a/apps/codecs/libatrac/atrac3.c
+++ b/apps/codecs/libatrac/atrac3.c
@@ -124,6 +124,57 @@ static channel_unit channel_units[2] IBSS_ATTR_LARGE_IRAM;
124 int32_t *in, 124 int32_t *in,
125 int32_t *win, 125 int32_t *win,
126 unsigned int nIn); 126 unsigned int nIn);
127#elif defined (CPU_COLDFIRE)
128 #define MULTIPLY_ADD_BLOCK \
129 "movem.l (%[win]), %%d0-%%d7 \n\t" \
130 "lea.l (8*4, %[win]), %[win] \n\t" \
131 "mac.l %%d0, %%a5, (%[in])+, %%a5, %%acc0\n\t" \
132 "mac.l %%d1, %%a5, (%[in])+, %%a5, %%acc1\n\t" \
133 "mac.l %%d2, %%a5, (%[in])+, %%a5, %%acc0\n\t" \
134 "mac.l %%d3, %%a5, (%[in])+, %%a5, %%acc1\n\t" \
135 "mac.l %%d4, %%a5, (%[in])+, %%a5, %%acc0\n\t" \
136 "mac.l %%d5, %%a5, (%[in])+, %%a5, %%acc1\n\t" \
137 "mac.l %%d6, %%a5, (%[in])+, %%a5, %%acc0\n\t" \
138 "mac.l %%d7, %%a5, (%[in])+, %%a5, %%acc1\n\t" \
139
140
141 static inline void
142 atrac3_iqmf_dewindowing(int32_t *out,
143 int32_t *in,
144 int32_t *win,
145 unsigned int nIn)
146 {
147 int32_t j;
148 int32_t *_in, *_win;
149 for (j = nIn; j != 0; j--, in+=2, out+=2) {
150 _in = in;
151 _win = win;
152
153 asm volatile (
154 "move.l (%[in])+, %%a5 \n\t" /* preload frist in value */
155 MULTIPLY_ADD_BLOCK /* 0.. 7 */
156 MULTIPLY_ADD_BLOCK /* 8..15 */
157 MULTIPLY_ADD_BLOCK /* 16..23 */
158 MULTIPLY_ADD_BLOCK /* 24..31 */
159 MULTIPLY_ADD_BLOCK /* 32..39 */
160 /* 40..47 */
161 "movem.l (%[win]), %%d0-%%d7 \n\t"
162 "mac.l %%d0, %%a5, (%[in])+, %%a5, %%acc0 \n\t"
163 "mac.l %%d1, %%a5, (%[in])+, %%a5, %%acc1 \n\t"
164 "mac.l %%d2, %%a5, (%[in])+, %%a5, %%acc0 \n\t"
165 "mac.l %%d3, %%a5, (%[in])+, %%a5, %%acc1 \n\t"
166 "mac.l %%d4, %%a5, (%[in])+, %%a5, %%acc0 \n\t"
167 "mac.l %%d5, %%a5, (%[in])+, %%a5, %%acc1 \n\t"
168 "mac.l %%d6, %%a5, (%[in])+, %%a5, %%acc0 \n\t"
169 "mac.l %%d7, %%a5, %%acc1 \n\t"
170 "movclr.l %%acc0, %%d1 \n\t" /* s1 */
171 "movclr.l %%acc1, %%d0 \n\t" /* s2 */
172 "movem.l %%d0-%%d1, (%[out]) \n\t"
173 : [in] "+a" (_in), [win] "+a" (_win)
174 : [out] "a" (out)
175 : "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "a5", "memory");
176 }
177 }
127#else 178#else
128 #define MULTIPLY_ADD_BLOCK(y1, y2, x, c, k) \ 179 #define MULTIPLY_ADD_BLOCK(y1, y2, x, c, k) \
129 y1 += fixmul31(c[k], x[k]); k++; \ 180 y1 += fixmul31(c[k], x[k]); k++; \
@@ -134,7 +185,7 @@ static channel_unit channel_units[2] IBSS_ATTR_LARGE_IRAM;
134 y2 += fixmul31(c[k], x[k]); k++; \ 185 y2 += fixmul31(c[k], x[k]); k++; \
135 y1 += fixmul31(c[k], x[k]); k++; \ 186 y1 += fixmul31(c[k], x[k]); k++; \
136 y2 += fixmul31(c[k], x[k]); k++; 187 y2 += fixmul31(c[k], x[k]); k++;
137 188
138 static inline void 189 static inline void
139 atrac3_iqmf_dewindowing(int32_t *out, 190 atrac3_iqmf_dewindowing(int32_t *out,
140 int32_t *in, 191 int32_t *in,