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

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

Issue 2810133002: Further SSE2 optimizations for the AEC3 adaptive filter. (Closed)
Patch Set: Added comments 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
« no previous file with comments | « webrtc/modules/audio_processing/aec3/adaptive_fir_filter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 85d9769bf33773adfef6286a70991a2f8e2b4f48..6d1a5820fe7f0e6c752d9e84cc212d3406a87c2a 100644
--- a/webrtc/modules/audio_processing/aec3/adaptive_fir_filter_unittest.cc
+++ b/webrtc/modules/audio_processing/aec3/adaptive_fir_filter_unittest.cc
@@ -42,9 +42,9 @@ std::string ProduceDebugText(size_t delay) {
} // namespace
#if defined(WEBRTC_ARCH_X86_FAMILY)
-// Verifies that the optimized methods are bitexact to their reference
-// counterparts.
-TEST(AdaptiveFirFilter, TestOptimizations) {
+// Verifies that the optimized methods for filter adaptation are bitexact to
+// their reference counterparts.
+TEST(AdaptiveFirFilter, FilterAdaptationOptimizations) {
bool use_sse2 = (WebRtc_GetCPUInfo(kSSE2) != 0);
if (use_sse2) {
RenderBuffer render_buffer(Aec3Optimization::kNone, 3, 12,
@@ -93,6 +93,59 @@ TEST(AdaptiveFirFilter, TestOptimizations) {
}
}
+// Verifies that the optimized method for frequency response computation is
+// bitexact to the reference counterpart.
+TEST(AdaptiveFirFilter, UpdateFrequencyResponseOptimization) {
+ bool use_sse2 = (WebRtc_GetCPUInfo(kSSE2) != 0);
+ if (use_sse2) {
+ 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_SSE2(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_SSE2(H, &H2_SSE2);
+
+ 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_SSE2[j][k]);
+ }
+ }
+ }
+}
+
+// Verifies that the optimized method for echo return loss computation is
+// bitexact to the reference counterpart.
+TEST(AdaptiveFirFilter, UpdateErlOptimization) {
+ bool use_sse2 = (WebRtc_GetCPUInfo(kSSE2) != 0);
+ if (use_sse2) {
+ const size_t kNumPartitions = 12;
+ std::vector<std::array<float, kFftLengthBy2Plus1>> H2(kNumPartitions);
+ std::array<float, kFftLengthBy2Plus1> erl;
+ std::array<float, kFftLengthBy2Plus1> erl_SSE2;
+
+ 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_SSE2(H2, &erl_SSE2);
+
+ for (size_t j = 0; j < erl.size(); ++j) {
+ EXPECT_FLOAT_EQ(erl[j], erl_SSE2[j]);
+ }
+ }
+}
+
#endif
#if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
« no previous file with comments | « webrtc/modules/audio_processing/aec3/adaptive_fir_filter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698