From 3df8e38af6da6c0699da8ef040ffc80cf7dab810 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 1 Sep 2006 02:49:49 -0700 Subject: Add ARM assembly optimizations This was my first time writing ARM assembly, so it may not be the best; but they're still significantly faster than the optimized C versions[1] of the functions replace. An knowledgable ARM coder should be able to make better optimizations, but nobody has done so for FLAC yet (at least not publicly, to my knowledge), so I decided to take a stab at it. Also tweaked configure.in a bit to better support cross-compilation. no longer enable 3dnow, sse, or altivec optimizations unless our CPU supports them. (note: sse and 3dnow are supported by 64-bit chips, but the code is currently only optimized for 32-bit sse and 3dnow). FLAC__fixed_restore_signal_asm_arm and FLAC__lpc_restore_signal_asm_arm are pretty well-tested from tracks in my music collection. I do not think I have any music that can exersises FLAC__lpc_restore_signal_asm_arm_wide (especially the 64-bit ASR macro). These optimizations changes result in an approximately 20% reduction in decoding time on my 3rd generation ipod (running ipodlinux). [1] - I still have them at hand, but they're not probably not worth it for the non-ASM optimized architectures. --- src/libFLAC/include/private/fixed.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libFLAC/include/private/fixed.h') diff --git a/src/libFLAC/include/private/fixed.h b/src/libFLAC/include/private/fixed.h index bb71b202..7dd40c9b 100644 --- a/src/libFLAC/include/private/fixed.h +++ b/src/libFLAC/include/private/fixed.h @@ -92,6 +92,10 @@ void FLAC__fixed_compute_residual(const FLAC__int32 data[], unsigned data_len, u * IN data[-order,-1] previously-reconstructed historical samples * OUT data[0,data_len-1] original signal */ +#if (!defined(FLAC__NO_ASM) && defined(FLAC__CPU_ARM)) +void FLAC__fixed_restore_signal_asm_arm(const FLAC__int32 residual[], unsigned data_len, unsigned order, FLAC__int32 data[]); +#else void FLAC__fixed_restore_signal(const FLAC__int32 residual[], unsigned data_len, unsigned order, FLAC__int32 data[]); +#endif #endif -- cgit v1.2.3-24-ge0c7