diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-10-10 18:24:19 +1100 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-10-10 18:24:19 +1100 |
commit | cf28c0144bdedf4fdcbfc901f684ef62a1b38d14 (patch) | |
tree | 6f071313e8bbb2470a623bdbb5c6a0aa2c75e260 /include/share/compat.h | |
parent | a1abfa3df29fc7fcb8cee35365c51db8fbc99dbc (diff) | |
download | flac-cf28c0144bdedf4fdcbfc901f684ef62a1b38d14.tar.gz |
Adds use of restrict keyword to improve encoding speed.
Restrict works very poorly in Visual Studio (much slower than without)
so defined flac_restrict in share/compat.h and use that in:
lpc_compute_residual...()
lpc_restore_signal...()
As a result, FLAC__lpc_compute_residual_from_qlp_coefficients_wide_intrin_sse41()
offers no advantage for 64-bit compiles and was removed from x86-64 part
of stream_encoder.c
Patch-from: lvqcl <lvqcl.mail@gmail.com>
Diffstat (limited to 'include/share/compat.h')
-rw-r--r-- | include/share/compat.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/share/compat.h b/include/share/compat.h index a4b48ac9..a7447aa5 100644 --- a/include/share/compat.h +++ b/include/share/compat.h @@ -76,6 +76,15 @@ #define inline __inline #endif +#if defined __INTEL_COMPILER || (defined _MSC_VER && defined _WIN64) +/* MSVS generates VERY slow 32-bit code with __restrict */ +#define flac_restrict __restrict +#elif defined __GNUC__ +#define flac_restrict __restrict__ +#else +#define flac_restrict +#endif + /* adjust for compilers that can't understand using LLU suffix for uint64_t literals */ #ifdef _MSC_VER #define FLAC__U64L(x) x |