From db955f0f13671dcd7203c93c2964307c78e24ccb Mon Sep 17 00:00:00 2001 From: Alessio Bazzica Date: Tue, 11 Oct 2022 11:02:50 +0200 Subject: [PATCH] APM: remove unused field trial in `AgcManagerDirect` The removed field trial was added in https://webrtc-review.googlesource.com/c/src/+/160708. Bug: webrtc:7494 Change-Id: I1abe51ea086342666a0420d5c10ddea87810aa26 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278781 Reviewed-by: Sam Zackrisson Commit-Queue: Alessio Bazzica Cr-Commit-Position: refs/heads/main@{#38366} --- .../agc/agc_manager_direct.cc | 27 ++++--------------- .../audio_processing/agc/agc_manager_direct.h | 1 - 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/modules/audio_processing/agc/agc_manager_direct.cc b/modules/audio_processing/agc/agc_manager_direct.cc index d8746b691a..4114eaacf9 100644 --- a/modules/audio_processing/agc/agc_manager_direct.cc +++ b/modules/audio_processing/agc/agc_manager_direct.cc @@ -63,12 +63,6 @@ constexpr int kOverrideWaitFrames = 0; using AnalogAgcConfig = AudioProcessing::Config::GainController1::AnalogGainController; -// Returns whether a fall-back solution to choose the maximum level should be -// chosen. -bool UseMaxAnalogChannelLevel() { - return field_trial::IsEnabled("WebRTC-UseMaxAnalogAgcChannelLevel"); -} - // If the "WebRTC-Audio-2ndAgcMinMicLevelExperiment" field trial is specified, // parses it and returns a value between 0 and 255 depending on the field-trial // string. Returns an unspecified value if the field trial is not specified, if @@ -486,7 +480,6 @@ AgcManagerDirect::AgcManagerDirect(int num_capture_channels, : analog_controller_enabled_(analog_config.enabled), min_mic_level_override_(GetMinMicLevelOverride()), data_dumper_(new ApmDataDumper(instance_counter_.fetch_add(1) + 1)), - use_min_channel_level_(!UseMaxAnalogChannelLevel()), num_capture_channels_(num_capture_channels), disable_digital_adaptive_(!analog_config.enable_digital_adaptive), frames_since_clipped_(analog_config.clipped_wait_frames), @@ -714,21 +707,11 @@ void AgcManagerDirect::AggregateChannelLevels() { int new_recommended_input_volume = channel_agcs_[0]->recommended_analog_level(); channel_controlling_gain_ = 0; - if (use_min_channel_level_) { - for (size_t ch = 1; ch < channel_agcs_.size(); ++ch) { - int level = channel_agcs_[ch]->recommended_analog_level(); - if (level < new_recommended_input_volume) { - new_recommended_input_volume = level; - channel_controlling_gain_ = static_cast(ch); - } - } - } else { - for (size_t ch = 1; ch < channel_agcs_.size(); ++ch) { - int level = channel_agcs_[ch]->recommended_analog_level(); - if (level > new_recommended_input_volume) { - new_recommended_input_volume = level; - channel_controlling_gain_ = static_cast(ch); - } + for (size_t ch = 1; ch < channel_agcs_.size(); ++ch) { + int level = channel_agcs_[ch]->recommended_analog_level(); + if (level < new_recommended_input_volume) { + new_recommended_input_volume = level; + channel_controlling_gain_ = static_cast(ch); } } diff --git a/modules/audio_processing/agc/agc_manager_direct.h b/modules/audio_processing/agc/agc_manager_direct.h index e9cf0b90fc..53d63adef4 100644 --- a/modules/audio_processing/agc/agc_manager_direct.h +++ b/modules/audio_processing/agc/agc_manager_direct.h @@ -153,7 +153,6 @@ class AgcManagerDirect final { const absl::optional min_mic_level_override_; std::unique_ptr data_dumper_; static std::atomic instance_counter_; - const bool use_min_channel_level_; const int num_capture_channels_; const bool disable_digital_adaptive_;