diff options
Diffstat (limited to 'apps/codecs/libspc/spc_codec.h')
-rw-r--r-- | apps/codecs/libspc/spc_codec.h | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/apps/codecs/libspc/spc_codec.h b/apps/codecs/libspc/spc_codec.h index cf72f90af4..95d09fa091 100644 --- a/apps/codecs/libspc/spc_codec.h +++ b/apps/codecs/libspc/spc_codec.h | |||
@@ -37,6 +37,10 @@ | |||
37 | 37 | ||
38 | /** Basic configuration options **/ | 38 | /** Basic configuration options **/ |
39 | 39 | ||
40 | #ifndef ARM_ARCH | ||
41 | #define ARM_ARCH 0 | ||
42 | #endif | ||
43 | |||
40 | #define SPC_DUAL_CORE 1 | 44 | #define SPC_DUAL_CORE 1 |
41 | 45 | ||
42 | #if !defined(SPC_DUAL_CORE) || NUM_CORES == 1 | 46 | #if !defined(SPC_DUAL_CORE) || NUM_CORES == 1 |
@@ -293,6 +297,15 @@ enum | |||
293 | FIR_BUF_MASK = ~((FIR_BUF_ALIGN / 2) | (sizeof ( int32_t ) - 1)) | 297 | FIR_BUF_MASK = ~((FIR_BUF_ALIGN / 2) | (sizeof ( int32_t ) - 1)) |
294 | }; | 298 | }; |
295 | #elif defined (CPU_ARM) | 299 | #elif defined (CPU_ARM) |
300 | #if ARM_ARCH >= 6 | ||
301 | enum | ||
302 | { | ||
303 | FIR_BUF_CNT = FIR_BUF_HALF * 2, | ||
304 | FIR_BUF_SIZE = FIR_BUF_CNT * sizeof ( int32_t ), | ||
305 | FIR_BUF_ALIGN = FIR_BUF_SIZE, | ||
306 | FIR_BUF_MASK = ~((FIR_BUF_ALIGN / 2) | (sizeof ( int32_t ) - 1)) | ||
307 | }; | ||
308 | #else | ||
296 | enum | 309 | enum |
297 | { | 310 | { |
298 | FIR_BUF_CNT = FIR_BUF_HALF * 2 * 2, | 311 | FIR_BUF_CNT = FIR_BUF_HALF * 2 * 2, |
@@ -300,6 +313,7 @@ enum | |||
300 | FIR_BUF_ALIGN = FIR_BUF_SIZE, | 313 | FIR_BUF_ALIGN = FIR_BUF_SIZE, |
301 | FIR_BUF_MASK = ~((FIR_BUF_ALIGN / 2) | (sizeof ( int32_t ) * 2 - 1)) | 314 | FIR_BUF_MASK = ~((FIR_BUF_ALIGN / 2) | (sizeof ( int32_t ) * 2 - 1)) |
302 | }; | 315 | }; |
316 | #endif /* ARM_ARCH */ | ||
303 | #endif /* CPU_* */ | 317 | #endif /* CPU_* */ |
304 | 318 | ||
305 | struct Spc_Dsp | 319 | struct Spc_Dsp |
@@ -318,7 +332,8 @@ struct Spc_Dsp | |||
318 | uint16_t noise; /* also read as int16_t */ | 332 | uint16_t noise; /* also read as int16_t */ |
319 | 333 | ||
320 | #if defined(CPU_COLDFIRE) | 334 | #if defined(CPU_COLDFIRE) |
321 | /* circularly hardware masked address */ | 335 | /* FIR history is interleaved. Hardware handles wrapping by mask. |
336 | * |LR|LR|LR|LR|LR|LR|LR|LR| */ | ||
322 | int32_t *fir_ptr; | 337 | int32_t *fir_ptr; |
323 | /* wrapped address just behind current position - | 338 | /* wrapped address just behind current position - |
324 | allows mac.w to increment and mask fir_ptr */ | 339 | allows mac.w to increment and mask fir_ptr */ |
@@ -328,9 +343,22 @@ struct Spc_Dsp | |||
328 | #elif defined (CPU_ARM) | 343 | #elif defined (CPU_ARM) |
329 | /* fir_buf [i + 8] == fir_buf [i], to avoid wrap checking in FIR code */ | 344 | /* fir_buf [i + 8] == fir_buf [i], to avoid wrap checking in FIR code */ |
330 | int32_t *fir_ptr; | 345 | int32_t *fir_ptr; |
346 | #if ARM_ARCH >= 6 | ||
347 | /* FIR history is interleaved with guard to eliminate wrap checking | ||
348 | * when convolving. | ||
349 | * |LR|LR|LR|LR|LR|LR|LR|LR|--|--|--|--|--|--|--|--| */ | ||
350 | /* copy of echo FIR constants as int16_t, loaded as int32 for | ||
351 | * halfword, packed multiples */ | ||
352 | int16_t fir_coeff [VOICE_COUNT]; | ||
353 | #else | ||
354 | /* FIR history is interleaved with guard to eliminate wrap checking | ||
355 | * when convolving. | ||
356 | * |LL|RR|LL|RR|LL|RR|LL|RR|LL|RR|LL|RR|LL|RR|LL|RR|... | ||
357 | * |--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|--| */ | ||
331 | /* copy of echo FIR constants as int32_t, for faster access */ | 358 | /* copy of echo FIR constants as int32_t, for faster access */ |
332 | int32_t fir_coeff [VOICE_COUNT]; | 359 | int32_t fir_coeff [VOICE_COUNT]; |
333 | #else | 360 | #endif /* ARM_ARCH */ |
361 | #else /* Unoptimized CPU */ | ||
334 | /* fir_buf [i + 8] == fir_buf [i], to avoid wrap checking in FIR code */ | 362 | /* fir_buf [i + 8] == fir_buf [i], to avoid wrap checking in FIR code */ |
335 | int fir_pos; /* (0 to 7) */ | 363 | int fir_pos; /* (0 to 7) */ |
336 | int fir_buf [FIR_BUF_HALF * 2] [2]; | 364 | int fir_buf [FIR_BUF_HALF * 2] [2]; |