Index: webrtc/modules/audio_processing/aec/aec_core_sse2.cc |
diff --git a/webrtc/modules/audio_processing/aec/aec_core_sse2.cc b/webrtc/modules/audio_processing/aec/aec_core_sse2.cc |
index 91d98b9773a1ad8f33d8cd1efde4f9a54252d6b4..ec466f6c2a64b2d90c7b0ef7b29486e57c718b20 100644 |
--- a/webrtc/modules/audio_processing/aec/aec_core_sse2.cc |
+++ b/webrtc/modules/audio_processing/aec/aec_core_sse2.cc |
@@ -449,7 +449,9 @@ __inline static void _mm_add_ps_4x1(__m128 sum, float* dst) { |
_mm_store_ss(dst, sum); |
} |
-static int PartitionDelaySSE2(const AecCore* aec) { |
+static int PartitionDelaySSE2( |
+ int num_partitions, |
+ float h_fft_buf[2][kExtendedNumPartitions * PART_LEN1]) { |
// Measures the energy in each filter partition and returns the partition with |
// highest energy. |
// TODO(bjornv): Spread computational cost by computing one partition per |
@@ -458,15 +460,15 @@ static int PartitionDelaySSE2(const AecCore* aec) { |
int i; |
int delay = 0; |
- for (i = 0; i < aec->num_partitions; i++) { |
+ for (i = 0; i < num_partitions; i++) { |
int j; |
int pos = i * PART_LEN1; |
float wfEn = 0; |
__m128 vec_wfEn = _mm_set1_ps(0.0f); |
// vectorized code (four at once) |
for (j = 0; j + 3 < PART_LEN1; j += 4) { |
- const __m128 vec_wfBuf0 = _mm_loadu_ps(&aec->wfBuf[0][pos + j]); |
- const __m128 vec_wfBuf1 = _mm_loadu_ps(&aec->wfBuf[1][pos + j]); |
+ const __m128 vec_wfBuf0 = _mm_loadu_ps(&h_fft_buf[0][pos + j]); |
+ const __m128 vec_wfBuf1 = _mm_loadu_ps(&h_fft_buf[1][pos + j]); |
vec_wfEn = _mm_add_ps(vec_wfEn, _mm_mul_ps(vec_wfBuf0, vec_wfBuf0)); |
vec_wfEn = _mm_add_ps(vec_wfEn, _mm_mul_ps(vec_wfBuf1, vec_wfBuf1)); |
} |
@@ -474,8 +476,8 @@ static int PartitionDelaySSE2(const AecCore* aec) { |
// scalar code for the remaining items. |
for (; j < PART_LEN1; j++) { |
- wfEn += aec->wfBuf[0][pos + j] * aec->wfBuf[0][pos + j] + |
- aec->wfBuf[1][pos + j] * aec->wfBuf[1][pos + j]; |
+ wfEn += h_fft_buf[0][pos + j] * h_fft_buf[0][pos + j] + |
+ h_fft_buf[1][pos + j] * h_fft_buf[1][pos + j]; |
} |
if (wfEn > wfEnMax) { |