Reland "Replace the ExperimentalAgc config with the new config format"

This is a reland of f3aa6326b8e21f627b9fba72040122723251999b

Original change's description:
> Replace the ExperimentalAgc config with the new config format
> 
> This CL replaces the use of the ExperimentalAgc config with
> using the new config format.
> 
> Beyond that, some further changes were made to how the analog
> and digital AGCs are initialized/called. While these can be
> made in a separate CL, I believe the code changes becomes more
> clear by bundling those with the replacement of the
> ExperimentalAgc config.
> 
> TBR: saza@webrtc.org
> Bug: webrtc:5298
> Change-Id: Ia19940f3abae048541e6716d0184b4caafc7d53e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163986
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30149}

Bug: webrtc:5298
Change-Id: I6db03628ed3fa2ecd36544fe9181dd8244d7e2df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165760
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30295}
This commit is contained in:
Per Åhgren
2020-01-13 14:43:13 +01:00
committed by Commit Bot
parent fc8279d66c
commit 0695df1a59
16 changed files with 221 additions and 207 deletions

View File

@ -210,6 +210,7 @@ void DebugDumpGenerator::Process(size_t num_blocks) {
ReadAndDeinterleave(&input_audio_, input_file_channels_, input_config_,
input_->channels());
RTC_CHECK_EQ(AudioProcessing::kNoError, apm_->set_stream_delay_ms(100));
apm_->set_stream_analog_level(100);
if (enable_pre_amplifier_) {
apm_->SetRuntimeSetting(
AudioProcessing::RuntimeSetting::CreateCapturePreGain(1 + i % 10));
@ -358,8 +359,10 @@ TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) {
Config config;
AudioProcessing::Config apm_config;
apm_config.echo_canceller.enabled = true;
apm_config.gain_controller1.analog_gain_controller.enabled = true;
apm_config.gain_controller1.analog_gain_controller.startup_min_volume = 0;
// Arbitrarily set clipping gain to 17, which will never be the default.
config.Set<ExperimentalAgc>(new ExperimentalAgc(true, 0, 17));
apm_config.gain_controller1.analog_gain_controller.clipped_level_min = 17;
DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
@ -436,9 +439,12 @@ TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) {
TEST_F(DebugDumpTest, VerifyAgcClippingLevelExperimentalString) {
Config config;
AudioProcessing::Config apm_config;
apm_config.gain_controller1.analog_gain_controller.enabled = true;
apm_config.gain_controller1.analog_gain_controller.startup_min_volume = 0;
// Arbitrarily set clipping gain to 17, which will never be the default.
config.Set<ExperimentalAgc>(new ExperimentalAgc(true, 0, 17));
DebugDumpGenerator generator(config, AudioProcessing::Config());
apm_config.gain_controller1.analog_gain_controller.clipped_level_min = 17;
DebugDumpGenerator generator(config, apm_config);
generator.StartRecording();
generator.Process(100);
generator.StopRecording();