From 3e3c4d8451a680e23d9fe96886917fc783e94bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=85hgren?= Date: Tue, 2 Jun 2020 12:22:57 +0200 Subject: [PATCH] Updating the Ooura FFT to take SSE2 usage specification in the ctor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: b/155316201 Change-Id: I79a5857da1eed49150509684c0f8b3d94e4e40c2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176373 Reviewed-by: Mirko Bonadei Reviewed-by: Henrik Lundin Commit-Queue: Per Ã…hgren Cr-Commit-Position: refs/heads/master@{#31406} --- common_audio/third_party/ooura/fft_size_128/ooura_fft.cc | 8 ++++++++ common_audio/third_party/ooura/fft_size_128/ooura_fft.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/common_audio/third_party/ooura/fft_size_128/ooura_fft.cc b/common_audio/third_party/ooura/fft_size_128/ooura_fft.cc index 2918374bba..6b6d6f1fd7 100644 --- a/common_audio/third_party/ooura/fft_size_128/ooura_fft.cc +++ b/common_audio/third_party/ooura/fft_size_128/ooura_fft.cc @@ -313,6 +313,14 @@ static void rftbsub_128_C(float* a) { } // namespace +OouraFft::OouraFft(bool sse2_available) { +#if defined(WEBRTC_ARCH_X86_FAMILY) + use_sse2_ = sse2_available; +#else + use_sse2_ = false; +#endif +} + OouraFft::OouraFft() { #if defined(WEBRTC_ARCH_X86_FAMILY) use_sse2_ = (WebRtc_GetCPUInfo(kSSE2) != 0); diff --git a/common_audio/third_party/ooura/fft_size_128/ooura_fft.h b/common_audio/third_party/ooura/fft_size_128/ooura_fft.h index 0cdd6aa66f..8273dfe58e 100644 --- a/common_audio/third_party/ooura/fft_size_128/ooura_fft.h +++ b/common_audio/third_party/ooura/fft_size_128/ooura_fft.h @@ -38,6 +38,10 @@ void rftbsub_128_neon(float* a); class OouraFft { public: + // Ctor allowing the availability of SSE2 support to be specified. + explicit OouraFft(bool sse2_available); + + // Deprecated: This Ctor will soon be removed. OouraFft(); ~OouraFft(); void Fft(float* a) const;