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

Side by Side Diff: webrtc/modules/audio_processing/test/debug_dump_test.cc

Issue 2567513003: Added basic framework for AEC3 in the audio processing module (Closed)
Patch Set: Changes in response to reviewer comments Created 4 years 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
« no previous file with comments | « webrtc/modules/audio_processing/test/audio_processing_simulator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 const audioproc::Config* msg = &event->config(); 370 const audioproc::Config* msg = &event->config();
371 ASSERT_TRUE(msg->has_experiments_description()); 371 ASSERT_TRUE(msg->has_experiments_description());
372 EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter", 372 EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter",
373 msg->experiments_description().c_str()); 373 msg->experiments_description().c_str());
374 } 374 }
375 } 375 }
376 } 376 }
377 377
378 TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) { 378 TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) {
379 Config config; 379 Config config;
380 AudioProcessing::Config apm_config;
380 config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true)); 381 config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true));
381 config.Set<EchoCanceller3>(new EchoCanceller3(true));
382 // Arbitrarily set clipping gain to 17, which will never be the default. 382 // Arbitrarily set clipping gain to 17, which will never be the default.
383 config.Set<ExperimentalAgc>(new ExperimentalAgc(true, 0, 17)); 383 config.Set<ExperimentalAgc>(new ExperimentalAgc(true, 0, 17));
384 DebugDumpGenerator generator(config, AudioProcessing::Config()); 384 apm_config.echo_canceller3.enabled = true;
385 DebugDumpGenerator generator(config, apm_config);
385 generator.StartRecording(); 386 generator.StartRecording();
386 generator.Process(100); 387 generator.Process(100);
387 generator.StopRecording(); 388 generator.StopRecording();
388 389
389 DebugDumpReplayer debug_dump_replayer_; 390 DebugDumpReplayer debug_dump_replayer_;
390 391
391 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name())); 392 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
392 393
393 while (const rtc::Optional<audioproc::Event> event = 394 while (const rtc::Optional<audioproc::Event> event =
394 debug_dump_replayer_.GetNextEvent()) { 395 debug_dump_replayer_.GetNextEvent()) {
395 debug_dump_replayer_.RunNextEvent(); 396 debug_dump_replayer_.RunNextEvent();
396 if (event->type() == audioproc::Event::CONFIG) { 397 if (event->type() == audioproc::Event::CONFIG) {
397 const audioproc::Config* msg = &event->config(); 398 const audioproc::Config* msg = &event->config();
398 ASSERT_TRUE(msg->has_experiments_description()); 399 ASSERT_TRUE(msg->has_experiments_description());
399 EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter", 400 EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter",
400 msg->experiments_description().c_str()); 401 msg->experiments_description().c_str());
401 EXPECT_PRED_FORMAT2(testing::IsSubstring, "AEC3", 402 EXPECT_PRED_FORMAT2(testing::IsSubstring, "EchoCanceller3",
402 msg->experiments_description().c_str()); 403 msg->experiments_description().c_str());
403 EXPECT_PRED_FORMAT2(testing::IsSubstring, "AgcClippingLevelExperiment", 404 EXPECT_PRED_FORMAT2(testing::IsSubstring, "AgcClippingLevelExperiment",
404 msg->experiments_description().c_str()); 405 msg->experiments_description().c_str());
405 } 406 }
406 } 407 }
407 } 408 }
408 409
409 TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) { 410 TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) {
410 Config config; 411 Config config;
411 config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true)); 412 config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true));
(...skipping 17 matching lines...) Expand all
429 EXPECT_PRED_FORMAT2(testing::IsNotSubstring, "AEC3", 430 EXPECT_PRED_FORMAT2(testing::IsNotSubstring, "AEC3",
430 msg->experiments_description().c_str()); 431 msg->experiments_description().c_str());
431 EXPECT_PRED_FORMAT2(testing::IsNotSubstring, "AgcClippingLevelExperiment", 432 EXPECT_PRED_FORMAT2(testing::IsNotSubstring, "AgcClippingLevelExperiment",
432 msg->experiments_description().c_str()); 433 msg->experiments_description().c_str());
433 } 434 }
434 } 435 }
435 } 436 }
436 437
437 TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) { 438 TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) {
438 Config config; 439 Config config;
439 config.Set<EchoCanceller3>(new EchoCanceller3(true)); 440 AudioProcessing::Config apm_config;
440 DebugDumpGenerator generator(config, AudioProcessing::Config()); 441 apm_config.echo_canceller3.enabled = true;
442 DebugDumpGenerator generator(config, apm_config);
441 generator.StartRecording(); 443 generator.StartRecording();
442 generator.Process(100); 444 generator.Process(100);
443 generator.StopRecording(); 445 generator.StopRecording();
444 446
445 DebugDumpReplayer debug_dump_replayer_; 447 DebugDumpReplayer debug_dump_replayer_;
446 448
447 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name())); 449 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
448 450
449 while (const rtc::Optional<audioproc::Event> event = 451 while (const rtc::Optional<audioproc::Event> event =
450 debug_dump_replayer_.GetNextEvent()) { 452 debug_dump_replayer_.GetNextEvent()) {
451 debug_dump_replayer_.RunNextEvent(); 453 debug_dump_replayer_.RunNextEvent();
452 if (event->type() == audioproc::Event::CONFIG) { 454 if (event->type() == audioproc::Event::CONFIG) {
453 const audioproc::Config* msg = &event->config(); 455 const audioproc::Config* msg = &event->config();
454 ASSERT_TRUE(msg->has_experiments_description()); 456 ASSERT_TRUE(msg->has_experiments_description());
455 EXPECT_PRED_FORMAT2(testing::IsSubstring, "AEC3", 457 EXPECT_PRED_FORMAT2(testing::IsSubstring, "EchoCanceller3",
456 msg->experiments_description().c_str()); 458 msg->experiments_description().c_str());
457 } 459 }
458 } 460 }
459 } 461 }
460 462
461 TEST_F(DebugDumpTest, VerifyLevelControllerExperimentalString) { 463 TEST_F(DebugDumpTest, VerifyLevelControllerExperimentalString) {
462 Config config; 464 Config config;
463 AudioProcessing::Config apm_config; 465 AudioProcessing::Config apm_config;
464 apm_config.level_controller.enabled = true; 466 apm_config.level_controller.enabled = true;
465 DebugDumpGenerator generator(config, apm_config); 467 DebugDumpGenerator generator(config, apm_config);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 config.Set<ExperimentalNs>(new ExperimentalNs(true)); 588 config.Set<ExperimentalNs>(new ExperimentalNs(true));
587 DebugDumpGenerator generator(config, AudioProcessing::Config()); 589 DebugDumpGenerator generator(config, AudioProcessing::Config());
588 generator.StartRecording(); 590 generator.StartRecording();
589 generator.Process(100); 591 generator.Process(100);
590 generator.StopRecording(); 592 generator.StopRecording();
591 VerifyDebugDump(generator.dump_file_name()); 593 VerifyDebugDump(generator.dump_file_name());
592 } 594 }
593 595
594 } // namespace test 596 } // namespace test
595 } // namespace webrtc 597 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/test/audio_processing_simulator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698