diff options
Diffstat (limited to 'apps/codecs/liba52/a52_internal.h')
-rw-r--r-- | apps/codecs/liba52/a52_internal.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/codecs/liba52/a52_internal.h b/apps/codecs/liba52/a52_internal.h index 32b1160903..4de21d9dde 100644 --- a/apps/codecs/liba52/a52_internal.h +++ b/apps/codecs/liba52/a52_internal.h | |||
@@ -141,6 +141,31 @@ typedef int16_t quantizer_t; | |||
141 | #if 0 | 141 | #if 0 |
142 | #define MUL(a,b) ((int)(((int64_t)(a) * (b) + (1 << 29)) >> 30)) | 142 | #define MUL(a,b) ((int)(((int64_t)(a) * (b) + (1 << 29)) >> 30)) |
143 | #define MUL_L(a,b) ((int)(((int64_t)(a) * (b) + (1 << 25)) >> 26)) | 143 | #define MUL_L(a,b) ((int)(((int64_t)(a) * (b) + (1 << 25)) >> 26)) |
144 | #elif CONFIG_CPU==MCF5249 && !defined(SIMULATOR) | ||
145 | /* loses 1 bit of accuracy */ | ||
146 | #define MUL(a, b) \ | ||
147 | ({ \ | ||
148 | int32_t t; \ | ||
149 | asm volatile ( \ | ||
150 | "mac.l %[A], %[B], %%acc0\n\t" \ | ||
151 | "movclr.l %%acc0, %[t]\n\t" \ | ||
152 | "asl.l #1, %[t]" \ | ||
153 | : [t] "=d" (t) \ | ||
154 | : [A] "r" ((a)), [B] "r" ((b))); \ | ||
155 | t; \ | ||
156 | }) | ||
157 | /* loses 5 bits of accuracy */ | ||
158 | #define MUL_L(a, b) \ | ||
159 | ({ \ | ||
160 | int32_t t; \ | ||
161 | asm volatile ( \ | ||
162 | "mac.l %[A], %[B], %%acc0\n\t" \ | ||
163 | "movclr.l %%acc0, %[t]\n\t" \ | ||
164 | "asl.l #5, %[t]" \ | ||
165 | : [t] "=d" (t) \ | ||
166 | : [A] "r" ((a)), [B] "r" ((b))); \ | ||
167 | t; \ | ||
168 | }) | ||
144 | #elif 1 | 169 | #elif 1 |
145 | #define MUL(a,b) \ | 170 | #define MUL(a,b) \ |
146 | ({ int32_t _ta=(a), _tb=(b), _tc; \ | 171 | ({ int32_t _ta=(a), _tb=(b), _tc; \ |