summaryrefslogtreecommitdiff
path: root/webrtc/common_audio/resampler/sinc_resampler_sse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webrtc/common_audio/resampler/sinc_resampler_sse.cc')
-rw-r--r--webrtc/common_audio/resampler/sinc_resampler_sse.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/webrtc/common_audio/resampler/sinc_resampler_sse.cc b/webrtc/common_audio/resampler/sinc_resampler_sse.cc
index 9e3953f..f6a24d0 100644
--- a/webrtc/common_audio/resampler/sinc_resampler_sse.cc
+++ b/webrtc/common_audio/resampler/sinc_resampler_sse.cc
@@ -11,13 +11,16 @@
// Modified from the Chromium original:
// src/media/base/simd/sinc_resampler_sse.cc
-#include "webrtc/common_audio/resampler/sinc_resampler.h"
-
+#include <stddef.h>
+#include <stdint.h>
#include <xmmintrin.h>
+#include "common_audio/resampler/sinc_resampler.h"
+
namespace webrtc {
-float SincResampler::Convolve_SSE(const float* input_ptr, const float* k1,
+float SincResampler::Convolve_SSE(const float* input_ptr,
+ const float* k1,
const float* k2,
double kernel_interpolation_factor) {
__m128 m_input;
@@ -41,17 +44,18 @@ float SincResampler::Convolve_SSE(const float* input_ptr, const float* k1,
}
// Linearly interpolate the two "convolutions".
- m_sums1 = _mm_mul_ps(m_sums1, _mm_set_ps1(
- static_cast<float>(1.0 - kernel_interpolation_factor)));
- m_sums2 = _mm_mul_ps(m_sums2, _mm_set_ps1(
- static_cast<float>(kernel_interpolation_factor)));
+ m_sums1 = _mm_mul_ps(
+ m_sums1,
+ _mm_set_ps1(static_cast<float>(1.0 - kernel_interpolation_factor)));
+ m_sums2 = _mm_mul_ps(
+ m_sums2, _mm_set_ps1(static_cast<float>(kernel_interpolation_factor)));
m_sums1 = _mm_add_ps(m_sums1, m_sums2);
// Sum components together.
float result;
m_sums2 = _mm_add_ps(_mm_movehl_ps(m_sums1, m_sums1), m_sums1);
- _mm_store_ss(&result, _mm_add_ss(m_sums2, _mm_shuffle_ps(
- m_sums2, m_sums2, 1)));
+ _mm_store_ss(&result,
+ _mm_add_ss(m_sums2, _mm_shuffle_ps(m_sums2, m_sums2, 1)));
return result;
}