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

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

Issue 2862573002: Reland 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/matched_filter_unittest.cc
diff --git a/webrtc/modules/audio_processing/aec3/matched_filter_unittest.cc b/webrtc/modules/audio_processing/aec3/matched_filter_unittest.cc
index 45965c7bbb775177b3b5bd33a5b9e4c1d7bf12fe..02d91bb834b55c55d2b46211f1ce919a5cc84c90 100644
--- a/webrtc/modules/audio_processing/aec3/matched_filter_unittest.cc
+++ b/webrtc/modules/audio_processing/aec3/matched_filter_unittest.cc
@@ -43,10 +43,47 @@
} // namespace
+#if defined(WEBRTC_HAS_NEON)
+// Verifies that the optimized methods for NEON are similar to their reference
+// counterparts.
+TEST(MatchedFilter, TestNeonOptimizations) {
+ Random random_generator(42U);
+ std::vector<float> x(2000);
+ RandomizeSampleVector(&random_generator, x);
+ std::vector<float> y(kSubBlockSize);
+ std::vector<float> h_NEON(512);
+ std::vector<float> h(512);
+ int x_index = 0;
+ for (int k = 0; k < 1000; ++k) {
+ RandomizeSampleVector(&random_generator, y);
+
+ bool filters_updated = false;
+ float error_sum = 0.f;
+ bool filters_updated_NEON = false;
+ float error_sum_NEON = 0.f;
+
+ MatchedFilterCore_NEON(x_index, h.size() * 150.f * 150.f, x, y, h_NEON,
+ &filters_updated_NEON, &error_sum_NEON);
+
+ MatchedFilterCore(x_index, h.size() * 150.f * 150.f, x, y, h,
+ &filters_updated, &error_sum);
+
+ EXPECT_EQ(filters_updated, filters_updated_NEON);
+ EXPECT_NEAR(error_sum, error_sum_NEON, error_sum / 100000.f);
+
+ for (size_t j = 0; j < h.size(); ++j) {
+ EXPECT_NEAR(h[j], h_NEON[j], 0.00001f);
+ }
+
+ x_index = (x_index + kSubBlockSize) % x.size();
+ }
+}
+#endif
+
#if defined(WEBRTC_ARCH_X86_FAMILY)
-// Verifies that the optimized methods are bitexact to their reference
+// Verifies that the optimized methods for SSE2 are bitexact to their reference
// counterparts.
-TEST(MatchedFilter, TestOptimizations) {
+TEST(MatchedFilter, TestSse2Optimizations) {
bool use_sse2 = (WebRtc_GetCPUInfo(kSSE2) != 0);
if (use_sse2) {
Random random_generator(42U);
« no previous file with comments | « webrtc/modules/audio_processing/aec3/matched_filter.cc ('k') | webrtc/modules/audio_processing/aec3/vector_math.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698