InputVolumeController: Use clipped_level_min in clipping prediction
Replace the use of MonoInputController::min_mic_level() with MonoInputVolumeController::clipped_level_min() when estimating input volume adjustment from clipping prediction. The adjustment is later capped in MonoInputVolumeController::HandleClipping() using clipped_level_min_ so no audio changes are expected from this change. Bug: webrtc:7494 Change-Id: Ie26d0aa5cce3eeef06f70a281504889519bb5aca Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282840 Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Hanna Silen <silen@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38593}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
7f2d4afc40
commit
e82d2a1773
@ -440,7 +440,7 @@ void InputVolumeController::AnalyzePreProcess(const AudioBuffer& audio_buffer) {
|
||||
for (int channel = 0; channel < num_capture_channels_; ++channel) {
|
||||
const auto step = clipping_predictor_->EstimateClippedLevelStep(
|
||||
channel, recommended_input_volume_, clipped_level_step_,
|
||||
channel_controllers_[channel]->min_mic_level(), kMaxMicLevel);
|
||||
channel_controllers_[channel]->clipped_level_min(), kMaxMicLevel);
|
||||
if (step.has_value()) {
|
||||
predicted_step = std::max(predicted_step, step.value());
|
||||
clipping_predicted = true;
|
||||
|
||||
@ -208,6 +208,8 @@ class MonoInputVolumeController {
|
||||
|
||||
void ActivateLogging() { log_to_histograms_ = true; }
|
||||
|
||||
int clipped_level_min() const { return clipped_level_min_; }
|
||||
|
||||
// Only used for testing.
|
||||
int min_mic_level() const { return min_mic_level_; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user