diff options
author | Felicia Lim <flim@google.com> | 2017-07-05 17:36:56 -0700 |
---|---|---|
committer | Felicia Lim <flim@google.com> | 2017-07-07 09:42:55 -0700 |
commit | 0c2090c324e4f2ba2a8621c8b083559bab74c7c5 (patch) | |
tree | fea1ab0038bc4102569d1ab4ee57a0f973895570 /celt/float_cast.h | |
parent | a7703b70699299f078a189e19b6915120cded732 (diff) | |
download | libopus-0c2090c324e4f2ba2a8621c8b083559bab74c7c5.tar.gz |
Opus 1.2.1android-o-iot-preview-5o-iot-preview-5
Change-Id: I551f1de5c5e121ac1275334e67c7e0f96ab18114
Test: - verified builds for arm*/mips*/x86*
- checked functionality using an emulator and stagefright
Diffstat (limited to 'celt/float_cast.h')
-rw-r--r-- | celt/float_cast.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/celt/float_cast.h b/celt/float_cast.h index ed5a39b5..98b40abc 100644 --- a/celt/float_cast.h +++ b/celt/float_cast.h @@ -61,7 +61,13 @@ ** the config.h file. */ -#if (HAVE_LRINTF) +/* With GCC, when SSE is available, the fastest conversion is cvtss2si. */ +#if defined(__GNUC__) && defined(__SSE__) + +#include <xmmintrin.h> +static OPUS_INLINE opus_int32 float2int(float x) {return _mm_cvt_ss2si(_mm_set_ss(x));} + +#elif defined(HAVE_LRINTF) /* These defines enable functionality introduced with the 1999 ISO C ** standard. They must be defined before the inclusion of math.h to |