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

Side by Side Diff: webrtc/modules/audio_processing/aec3/adaptive_fir_filter_unittest.cc

Issue 3005433002: Fix places that trigger no-unused-lambda-capture (Closed)
Patch Set: Rebased Created 3 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 DelayBuffer<float> delay_buffer(delay_samples); 330 DelayBuffer<float> delay_buffer(delay_samples);
331 CascadedBiQuadFilter x_hp_filter(kHighPassFilterCoefficients, 1); 331 CascadedBiQuadFilter x_hp_filter(kHighPassFilterCoefficients, 1);
332 CascadedBiQuadFilter y_hp_filter(kHighPassFilterCoefficients, 1); 332 CascadedBiQuadFilter y_hp_filter(kHighPassFilterCoefficients, 1);
333 333
334 SCOPED_TRACE(ProduceDebugText(delay_samples)); 334 SCOPED_TRACE(ProduceDebugText(delay_samples));
335 for (size_t k = 0; k < kNumBlocksToProcess; ++k) { 335 for (size_t k = 0; k < kNumBlocksToProcess; ++k) {
336 RandomizeSampleVector(&random_generator, x[0]); 336 RandomizeSampleVector(&random_generator, x[0]);
337 delay_buffer.Delay(x[0], y); 337 delay_buffer.Delay(x[0], y);
338 338
339 RandomizeSampleVector(&random_generator, n); 339 RandomizeSampleVector(&random_generator, n);
340 constexpr float kNoiseScaling = 1.f / 100.f; 340 const float kNoiseScaling = 1.f / 100.f;
341 std::transform( 341 std::transform(
342 y.begin(), y.end(), n.begin(), y.begin(), 342 y.begin(), y.end(), n.begin(), y.begin(),
343 [kNoiseScaling](float a, float b) { return a + b * kNoiseScaling; }); 343 [kNoiseScaling](float a, float b) { return a + b * kNoiseScaling; });
344 344
345 x_hp_filter.Process(x[0]); 345 x_hp_filter.Process(x[0]);
346 y_hp_filter.Process(y); 346 y_hp_filter.Process(y);
347 347
348 render_buffer.Insert(x); 348 render_buffer.Insert(x);
349 render_signal_analyzer.Update(render_buffer, aec_state.FilterDelay()); 349 render_signal_analyzer.Update(render_buffer, aec_state.FilterDelay());
350 350
(...skipping 19 matching lines...) Expand all
370 } 370 }
371 // Verify that the filter is able to perform well. 371 // Verify that the filter is able to perform well.
372 EXPECT_LT(1000 * std::inner_product(e.begin(), e.end(), e.begin(), 0.f), 372 EXPECT_LT(1000 * std::inner_product(e.begin(), e.end(), e.begin(), 0.f),
373 std::inner_product(y.begin(), y.end(), y.begin(), 0.f)); 373 std::inner_product(y.begin(), y.end(), y.begin(), 0.f));
374 ASSERT_TRUE(aec_state.FilterDelay()); 374 ASSERT_TRUE(aec_state.FilterDelay());
375 EXPECT_EQ(delay_samples / kBlockSize, *aec_state.FilterDelay()); 375 EXPECT_EQ(delay_samples / kBlockSize, *aec_state.FilterDelay());
376 } 376 }
377 } 377 }
378 } // namespace aec3 378 } // namespace aec3
379 } // namespace webrtc 379 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698