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

Unified Diff: webrtc/modules/audio_processing/aec3/adaptive_fir_filter_unittest.cc

Issue 2856113003: Revert of Added ARM Neon SIMD optimizations for AEC3 (Closed)
Patch Set: Created 3 years, 8 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
Index: webrtc/modules/audio_processing/aec3/adaptive_fir_filter_unittest.cc
diff --git a/webrtc/modules/audio_processing/aec3/adaptive_fir_filter_unittest.cc b/webrtc/modules/audio_processing/aec3/adaptive_fir_filter_unittest.cc
index 4560958bfd0ef350e46d97a5a3ddcb34484627d0..6d1a5820fe7f0e6c752d9e84cc212d3406a87c2a 100644
--- a/webrtc/modules/audio_processing/aec3/adaptive_fir_filter_unittest.cc
+++ b/webrtc/modules/audio_processing/aec3/adaptive_fir_filter_unittest.cc
@@ -10,7 +10,6 @@
#include "webrtc/modules/audio_processing/aec3/adaptive_fir_filter.h"
-#include <math.h>
#include <algorithm>
#include <numeric>
#include <string>
@@ -42,114 +41,10 @@
} // namespace
-#if defined(WEBRTC_HAS_NEON)
-// Verifies that the optimized methods for filter adaptation are similar to
-// their reference counterparts.
-TEST(AdaptiveFirFilter, FilterAdaptationNeonOptimizations) {
- RenderBuffer render_buffer(Aec3Optimization::kNone, 3, 12,
- std::vector<size_t>(1, 12));
- Random random_generator(42U);
- std::vector<std::vector<float>> x(3, std::vector<float>(kBlockSize, 0.f));
- FftData S_C;
- FftData S_NEON;
- FftData G;
- Aec3Fft fft;
- std::vector<FftData> H_C(10);
- std::vector<FftData> H_NEON(10);
- for (auto& H_j : H_C) {
- H_j.Clear();
- }
- for (auto& H_j : H_NEON) {
- H_j.Clear();
- }
-
- for (size_t k = 0; k < 30; ++k) {
- RandomizeSampleVector(&random_generator, x[0]);
- render_buffer.Insert(x);
- }
-
- for (size_t j = 0; j < G.re.size(); ++j) {
- G.re[j] = j / 10001.f;
- }
- for (size_t j = 1; j < G.im.size() - 1; ++j) {
- G.im[j] = j / 20001.f;
- }
- G.im[0] = 0.f;
- G.im[G.im.size() - 1] = 0.f;
-
- AdaptPartitions_NEON(render_buffer, G, H_NEON);
- AdaptPartitions(render_buffer, G, H_C);
- AdaptPartitions_NEON(render_buffer, G, H_NEON);
- AdaptPartitions(render_buffer, G, H_C);
-
- for (size_t l = 0; l < H_C.size(); ++l) {
- for (size_t j = 0; j < H_C[l].im.size(); ++j) {
- EXPECT_NEAR(H_C[l].re[j], H_NEON[l].re[j], fabs(H_C[l].re[j] * 0.00001f));
- EXPECT_NEAR(H_C[l].im[j], H_NEON[l].im[j], fabs(H_C[l].im[j] * 0.00001f));
- }
- }
-
- ApplyFilter_NEON(render_buffer, H_NEON, &S_NEON);
- ApplyFilter(render_buffer, H_C, &S_C);
- for (size_t j = 0; j < S_C.re.size(); ++j) {
- EXPECT_NEAR(S_C.re[j], S_NEON.re[j], fabs(S_C.re[j] * 0.00001f));
- EXPECT_NEAR(S_C.im[j], S_NEON.im[j], fabs(S_C.re[j] * 0.00001f));
- }
-}
-
-// Verifies that the optimized method for frequency response computation is
-// bitexact to the reference counterpart.
-TEST(AdaptiveFirFilter, UpdateFrequencyResponseNeonOptimization) {
- const size_t kNumPartitions = 12;
- std::vector<FftData> H(kNumPartitions);
- std::vector<std::array<float, kFftLengthBy2Plus1>> H2(kNumPartitions);
- std::vector<std::array<float, kFftLengthBy2Plus1>> H2_NEON(kNumPartitions);
-
- for (size_t j = 0; j < H.size(); ++j) {
- for (size_t k = 0; k < H[j].re.size(); ++k) {
- H[j].re[k] = k + j / 3.f;
- H[j].im[k] = j + k / 7.f;
- }
- }
-
- UpdateFrequencyResponse(H, &H2);
- UpdateFrequencyResponse_NEON(H, &H2_NEON);
-
- for (size_t j = 0; j < H2.size(); ++j) {
- for (size_t k = 0; k < H[j].re.size(); ++k) {
- EXPECT_FLOAT_EQ(H2[j][k], H2_NEON[j][k]);
- }
- }
-}
-
-// Verifies that the optimized method for echo return loss computation is
-// bitexact to the reference counterpart.
-TEST(AdaptiveFirFilter, UpdateErlNeonOptimization) {
- const size_t kNumPartitions = 12;
- std::vector<std::array<float, kFftLengthBy2Plus1>> H2(kNumPartitions);
- std::array<float, kFftLengthBy2Plus1> erl;
- std::array<float, kFftLengthBy2Plus1> erl_NEON;
-
- for (size_t j = 0; j < H2.size(); ++j) {
- for (size_t k = 0; k < H2[j].size(); ++k) {
- H2[j][k] = k + j / 3.f;
- }
- }
-
- UpdateErlEstimator(H2, &erl);
- UpdateErlEstimator_NEON(H2, &erl_NEON);
-
- for (size_t j = 0; j < erl.size(); ++j) {
- EXPECT_FLOAT_EQ(erl[j], erl_NEON[j]);
- }
-}
-
-#endif
-
#if defined(WEBRTC_ARCH_X86_FAMILY)
// Verifies that the optimized methods for filter adaptation are bitexact to
// their reference counterparts.
-TEST(AdaptiveFirFilter, FilterAdaptationSse2Optimizations) {
+TEST(AdaptiveFirFilter, FilterAdaptationOptimizations) {
bool use_sse2 = (WebRtc_GetCPUInfo(kSSE2) != 0);
if (use_sse2) {
RenderBuffer render_buffer(Aec3Optimization::kNone, 3, 12,
@@ -200,7 +95,7 @@
// Verifies that the optimized method for frequency response computation is
// bitexact to the reference counterpart.
-TEST(AdaptiveFirFilter, UpdateFrequencyResponseSse2Optimization) {
+TEST(AdaptiveFirFilter, UpdateFrequencyResponseOptimization) {
bool use_sse2 = (WebRtc_GetCPUInfo(kSSE2) != 0);
if (use_sse2) {
const size_t kNumPartitions = 12;
@@ -228,7 +123,7 @@
// Verifies that the optimized method for echo return loss computation is
// bitexact to the reference counterpart.
-TEST(AdaptiveFirFilter, UpdateErlSse2Optimization) {
+TEST(AdaptiveFirFilter, UpdateErlOptimization) {
bool use_sse2 = (WebRtc_GetCPUInfo(kSSE2) != 0);
if (use_sse2) {
const size_t kNumPartitions = 12;
« no previous file with comments | « webrtc/modules/audio_processing/aec3/adaptive_fir_filter.cc ('k') | webrtc/modules/audio_processing/aec3/aec3_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698