Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2412)

Unified Diff: third_party/opus/src/celt/float_cast.h

Issue 2962373002: [Opus] Update to v1.2.1 (Closed)
Patch Set: Pre-increment instead of post-increment Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/opus/src/celt/fixed_generic.h ('k') | third_party/opus/src/celt/kiss_fft.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/opus/src/celt/float_cast.h
diff --git a/third_party/opus/src/celt/float_cast.h b/third_party/opus/src/celt/float_cast.h
index ed5a39b5433b58f2fa08432d2eb6189d6cbe8f6c..98b40abcf65f5df7a51d3d9d67d61869a5535fe9 100644
--- a/third_party/opus/src/celt/float_cast.h
+++ b/third_party/opus/src/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
« no previous file with comments | « third_party/opus/src/celt/fixed_generic.h ('k') | third_party/opus/src/celt/kiss_fft.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698