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

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

Issue 2543753006: AGC: Route clipping parameter from webrtc::Config to AGC (Closed)
Patch Set: Fix a typo 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/include/audio_processing.h ('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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true)); 380 config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true));
381 config.Set<EchoCanceller3>(new EchoCanceller3(true)); 381 config.Set<EchoCanceller3>(new EchoCanceller3(true));
382 // Arbitrarily set clipping gain to 17, which will never be the default.
383 config.Set<ExperimentalAgc>(new ExperimentalAgc(true, 0, 17));
382 DebugDumpGenerator generator(config, AudioProcessing::Config()); 384 DebugDumpGenerator generator(config, AudioProcessing::Config());
383 generator.StartRecording(); 385 generator.StartRecording();
384 generator.Process(100); 386 generator.Process(100);
385 generator.StopRecording(); 387 generator.StopRecording();
386 388
387 DebugDumpReplayer debug_dump_replayer_; 389 DebugDumpReplayer debug_dump_replayer_;
388 390
389 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name())); 391 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
390 392
391 while (const rtc::Optional<audioproc::Event> event = 393 while (const rtc::Optional<audioproc::Event> event =
392 debug_dump_replayer_.GetNextEvent()) { 394 debug_dump_replayer_.GetNextEvent()) {
393 debug_dump_replayer_.RunNextEvent(); 395 debug_dump_replayer_.RunNextEvent();
394 if (event->type() == audioproc::Event::CONFIG) { 396 if (event->type() == audioproc::Event::CONFIG) {
395 const audioproc::Config* msg = &event->config(); 397 const audioproc::Config* msg = &event->config();
396 ASSERT_TRUE(msg->has_experiments_description()); 398 ASSERT_TRUE(msg->has_experiments_description());
397 EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter", 399 EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter",
398 msg->experiments_description().c_str()); 400 msg->experiments_description().c_str());
399 EXPECT_PRED_FORMAT2(testing::IsSubstring, "AEC3", 401 EXPECT_PRED_FORMAT2(testing::IsSubstring, "AEC3",
400 msg->experiments_description().c_str()); 402 msg->experiments_description().c_str());
403 EXPECT_PRED_FORMAT2(testing::IsSubstring, "AgcClippingLevelExperiment",
404 msg->experiments_description().c_str());
401 } 405 }
402 } 406 }
403 } 407 }
404 408
405 TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) { 409 TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) {
406 Config config; 410 Config config;
407 config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true)); 411 config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true));
408 DebugDumpGenerator generator(config, AudioProcessing::Config()); 412 DebugDumpGenerator generator(config, AudioProcessing::Config());
409 generator.StartRecording(); 413 generator.StartRecording();
410 generator.Process(100); 414 generator.Process(100);
411 generator.StopRecording(); 415 generator.StopRecording();
412 416
413 DebugDumpReplayer debug_dump_replayer_; 417 DebugDumpReplayer debug_dump_replayer_;
414 418
415 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name())); 419 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
416 420
417 while (const rtc::Optional<audioproc::Event> event = 421 while (const rtc::Optional<audioproc::Event> event =
418 debug_dump_replayer_.GetNextEvent()) { 422 debug_dump_replayer_.GetNextEvent()) {
419 debug_dump_replayer_.RunNextEvent(); 423 debug_dump_replayer_.RunNextEvent();
420 if (event->type() == audioproc::Event::CONFIG) { 424 if (event->type() == audioproc::Event::CONFIG) {
421 const audioproc::Config* msg = &event->config(); 425 const audioproc::Config* msg = &event->config();
422 ASSERT_TRUE(msg->has_experiments_description()); 426 ASSERT_TRUE(msg->has_experiments_description());
423 EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter", 427 EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter",
424 msg->experiments_description().c_str()); 428 msg->experiments_description().c_str());
425 EXPECT_PRED_FORMAT2(testing::IsNotSubstring, "AEC3", 429 EXPECT_PRED_FORMAT2(testing::IsNotSubstring, "AEC3",
426 msg->experiments_description().c_str()); 430 msg->experiments_description().c_str());
431 EXPECT_PRED_FORMAT2(testing::IsNotSubstring, "AgcClippingLevelExperiment",
432 msg->experiments_description().c_str());
427 } 433 }
428 } 434 }
429 } 435 }
430 436
431 TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) { 437 TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) {
432 Config config; 438 Config config;
433 config.Set<EchoCanceller3>(new EchoCanceller3(true)); 439 config.Set<EchoCanceller3>(new EchoCanceller3(true));
434 DebugDumpGenerator generator(config, AudioProcessing::Config()); 440 DebugDumpGenerator generator(config, AudioProcessing::Config());
435 generator.StartRecording(); 441 generator.StartRecording();
436 generator.Process(100); 442 generator.Process(100);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 debug_dump_replayer_.RunNextEvent(); 476 debug_dump_replayer_.RunNextEvent();
471 if (event->type() == audioproc::Event::CONFIG) { 477 if (event->type() == audioproc::Event::CONFIG) {
472 const audioproc::Config* msg = &event->config(); 478 const audioproc::Config* msg = &event->config();
473 ASSERT_TRUE(msg->has_experiments_description()); 479 ASSERT_TRUE(msg->has_experiments_description());
474 EXPECT_PRED_FORMAT2(testing::IsSubstring, "LevelController", 480 EXPECT_PRED_FORMAT2(testing::IsSubstring, "LevelController",
475 msg->experiments_description().c_str()); 481 msg->experiments_description().c_str());
476 } 482 }
477 } 483 }
478 } 484 }
479 485
486 TEST_F(DebugDumpTest, VerifyAgcClippingLevelExperimentalString) {
487 Config config;
488 // Arbitrarily set clipping gain to 17, which will never be the default.
489 config.Set<ExperimentalAgc>(new ExperimentalAgc(true, 0, 17));
490 DebugDumpGenerator generator(config, AudioProcessing::Config());
491 generator.StartRecording();
492 generator.Process(100);
493 generator.StopRecording();
494
495 DebugDumpReplayer debug_dump_replayer_;
496
497 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
498
499 while (const rtc::Optional<audioproc::Event> event =
500 debug_dump_replayer_.GetNextEvent()) {
501 debug_dump_replayer_.RunNextEvent();
502 if (event->type() == audioproc::Event::CONFIG) {
503 const audioproc::Config* msg = &event->config();
504 ASSERT_TRUE(msg->has_experiments_description());
505 EXPECT_PRED_FORMAT2(testing::IsSubstring, "AgcClippingLevelExperiment",
506 msg->experiments_description().c_str());
507 }
508 }
509 }
510
480 TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) { 511 TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) {
481 Config config; 512 Config config;
482 DebugDumpGenerator generator(config, AudioProcessing::Config()); 513 DebugDumpGenerator generator(config, AudioProcessing::Config());
483 generator.StartRecording(); 514 generator.StartRecording();
484 generator.Process(100); 515 generator.Process(100);
485 generator.StopRecording(); 516 generator.StopRecording();
486 517
487 DebugDumpReplayer debug_dump_replayer_; 518 DebugDumpReplayer debug_dump_replayer_;
488 519
489 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name())); 520 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 config.Set<ExperimentalNs>(new ExperimentalNs(true)); 586 config.Set<ExperimentalNs>(new ExperimentalNs(true));
556 DebugDumpGenerator generator(config, AudioProcessing::Config()); 587 DebugDumpGenerator generator(config, AudioProcessing::Config());
557 generator.StartRecording(); 588 generator.StartRecording();
558 generator.Process(100); 589 generator.Process(100);
559 generator.StopRecording(); 590 generator.StopRecording();
560 VerifyDebugDump(generator.dump_file_name()); 591 VerifyDebugDump(generator.dump_file_name());
561 } 592 }
562 593
563 } // namespace test 594 } // namespace test
564 } // namespace webrtc 595 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/include/audio_processing.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698