aboutsummaryrefslogtreecommitdiff
path: root/modules/audio_processing/aec3/aec3_fft.cc
diff options
context:
space:
mode:
Diffstat (limited to 'modules/audio_processing/aec3/aec3_fft.cc')
-rw-r--r--modules/audio_processing/aec3/aec3_fft.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/audio_processing/aec3/aec3_fft.cc b/modules/audio_processing/aec3/aec3_fft.cc
index 1832101855..d1d4f7da06 100644
--- a/modules/audio_processing/aec3/aec3_fft.cc
+++ b/modules/audio_processing/aec3/aec3_fft.cc
@@ -15,6 +15,7 @@
#include <iterator>
#include "rtc_base/checks.h"
+#include "system_wrappers/include/cpu_features_wrapper.h"
namespace webrtc {
@@ -70,8 +71,18 @@ const float kSqrtHanning128[kFftLength] = {
0.19509032201613f, 0.17096188876030f, 0.14673047445536f, 0.12241067519922f,
0.09801714032956f, 0.07356456359967f, 0.04906767432742f, 0.02454122852291f};
+bool IsSse2Available() {
+#if defined(WEBRTC_ARCH_X86_FAMILY)
+ return WebRtc_GetCPUInfo(kSSE2) != 0;
+#else
+ return false;
+#endif
+}
+
} // namespace
+Aec3Fft::Aec3Fft() : ooura_fft_(IsSse2Available()) {}
+
// TODO(peah): Change x to be std::array once the rest of the code allows this.
void Aec3Fft::ZeroPaddedFft(rtc::ArrayView<const float> x,
Window window,