From 7f2d4afc401d48c1d78feb48b5d52bf8877fc04d Mon Sep 17 00:00:00 2001 From: Alessio Bazzica Date: Wed, 9 Nov 2022 11:15:17 +0100 Subject: [PATCH] APM: mirror "remove unused field trial" in InputVolumeController See https://webrtc-review.googlesource.com/c/src/+/278781 Bug: webrtc:7494 Change-Id: I800a93d321bd8c8c7a71b856e151158ec2655d8a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282822 Reviewed-by: Hanna Silen Commit-Queue: Alessio Bazzica Cr-Commit-Position: refs/heads/main@{#38592} --- .../agc2/input_volume_controller.cc | 27 ++++--------------- .../agc2/input_volume_controller.h | 2 -- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/modules/audio_processing/agc2/input_volume_controller.cc b/modules/audio_processing/agc2/input_volume_controller.cc index aaaa09c464..8617d6c974 100644 --- a/modules/audio_processing/agc2/input_volume_controller.cc +++ b/modules/audio_processing/agc2/input_volume_controller.cc @@ -56,12 +56,6 @@ Agc1ClippingPredictorConfig CreateClippingPredictorConfig(bool enabled) { return config; } -// 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 @@ -347,7 +341,6 @@ InputVolumeController::InputVolumeController(int num_capture_channels, : analog_controller_enabled_(config.enabled), num_capture_channels_(num_capture_channels), min_mic_level_override_(GetMinMicLevelOverride()), - use_min_channel_level_(!UseMaxAnalogChannelLevel()), capture_output_used_(true), clipped_level_step_(config.clipped_level_step), clipped_ratio_threshold_(config.clipped_ratio_threshold), @@ -525,21 +518,11 @@ void InputVolumeController::AggregateChannelLevels() { int new_recommended_input_volume = channel_controllers_[0]->recommended_analog_level(); channel_controlling_gain_ = 0; - if (use_min_channel_level_) { - for (size_t ch = 1; ch < channel_controllers_.size(); ++ch) { - int level = channel_controllers_[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_controllers_.size(); ++ch) { - int level = channel_controllers_[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_controllers_.size(); ++ch) { + int level = channel_controllers_[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/agc2/input_volume_controller.h b/modules/audio_processing/agc2/input_volume_controller.h index c5f000b295..b832176fd4 100644 --- a/modules/audio_processing/agc2/input_volume_controller.h +++ b/modules/audio_processing/agc2/input_volume_controller.h @@ -143,8 +143,6 @@ class InputVolumeController final { // If not empty, the value is used to override the minimum input volume. const absl::optional min_mic_level_override_; - const bool use_min_channel_level_; - // TODO(bugs.webrtc.org/7494): Create a separate member for the applied input // volume. // TODO(bugs.webrtc.org/7494): Once