Remove unused APM voice activity detection sub-module

API changes:
- webrtc::AudioProcessing::Config::VoiceDetection removed
- webrtc::AudioProcessingStats::voice_detected deprecated
- cricket::AudioOptions::typing_detection deprecated
- webrtc::StatsReport::StatsValueName::
  kStatsValueNameTypingNoiseState deprecated

PSA: https://groups.google.com/g/discuss-webrtc/c/7X6uwmJarE0

Bug: webrtc:11226,webrtc:11292
Change-Id: I8d008b56708cf62961b9857ec052b59fda3b41bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250666
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35975}
This commit is contained in:
Alessio Bazzica
2022-02-11 10:51:01 +01:00
committed by WebRTC LUCI CQ
parent cc5532f95a
commit b4e06d032e
23 changed files with 18 additions and 483 deletions

View File

@ -141,7 +141,6 @@ bool AudioProcessingImpl::SubmoduleStates::Update(
bool gain_controller2_enabled,
bool gain_adjustment_enabled,
bool echo_controller_enabled,
bool voice_detector_enabled,
bool transient_suppressor_enabled) {
bool changed = false;
changed |= (high_pass_filter_enabled != high_pass_filter_enabled_);
@ -153,7 +152,6 @@ bool AudioProcessingImpl::SubmoduleStates::Update(
changed |= (gain_controller2_enabled != gain_controller2_enabled_);
changed |= (gain_adjustment_enabled != gain_adjustment_enabled_);
changed |= (echo_controller_enabled != echo_controller_enabled_);
changed |= (voice_detector_enabled != voice_detector_enabled_);
changed |= (transient_suppressor_enabled != transient_suppressor_enabled_);
if (changed) {
high_pass_filter_enabled_ = high_pass_filter_enabled;
@ -163,7 +161,6 @@ bool AudioProcessingImpl::SubmoduleStates::Update(
gain_controller2_enabled_ = gain_controller2_enabled;
gain_adjustment_enabled_ = gain_adjustment_enabled;
echo_controller_enabled_ = echo_controller_enabled;
voice_detector_enabled_ = voice_detector_enabled;
transient_suppressor_enabled_ = transient_suppressor_enabled;
}
@ -174,7 +171,7 @@ bool AudioProcessingImpl::SubmoduleStates::Update(
bool AudioProcessingImpl::SubmoduleStates::CaptureMultiBandSubModulesActive()
const {
return CaptureMultiBandProcessingPresent() || voice_detector_enabled_;
return CaptureMultiBandProcessingPresent();
}
bool AudioProcessingImpl::SubmoduleStates::CaptureMultiBandProcessingPresent()
@ -371,7 +368,6 @@ void AudioProcessingImpl::InitializeLocked() {
InitializeGainController1();
InitializeTransientSuppressor();
InitializeHighPassFilter(true);
InitializeVoiceDetector();
InitializeResidualEchoDetector();
InitializeEchoController();
InitializeGainController2(/*config_has_changed=*/true);
@ -506,9 +502,6 @@ void AudioProcessingImpl::ApplyConfig(const AudioProcessing::Config& config) {
const bool agc2_config_changed =
config_.gain_controller2 != config.gain_controller2;
const bool voice_detection_config_changed =
config_.voice_detection.enabled != config.voice_detection.enabled;
const bool ns_config_changed =
config_.noise_suppression.enabled != config.noise_suppression.enabled ||
config_.noise_suppression.level != config.noise_suppression.level;
@ -557,10 +550,6 @@ void AudioProcessingImpl::ApplyConfig(const AudioProcessing::Config& config) {
InitializeCaptureLevelsAdjuster();
}
if (voice_detection_config_changed) {
InitializeVoiceDetector();
}
// Reinitialization must happen after all submodule configuration to avoid
// additional reinitializations on the next capture / render processing call.
if (pipeline_config_changed) {
@ -1215,13 +1204,6 @@ int AudioProcessingImpl::ProcessCaptureStreamLocked() {
}
}
if (config_.voice_detection.enabled) {
capture_.stats.voice_detected =
submodules_.voice_detector->ProcessCaptureAudio(capture_buffer);
} else {
capture_.stats.voice_detected = absl::nullopt;
}
if (submodules_.agc_manager) {
submodules_.agc_manager->Process(capture_buffer);
@ -1682,7 +1664,7 @@ bool AudioProcessingImpl::UpdateActiveSubmoduleStates() {
!!submodules_.gain_controller2,
config_.pre_amplifier.enabled || config_.capture_level_adjustment.enabled,
capture_nonlocked_.echo_controller_enabled,
config_.voice_detection.enabled, !!submodules_.transient_suppressor);
!!submodules_.transient_suppressor);
}
void AudioProcessingImpl::InitializeTransientSuppressor() {
@ -1732,14 +1714,6 @@ void AudioProcessingImpl::InitializeHighPassFilter(bool forced_reset) {
}
}
void AudioProcessingImpl::InitializeVoiceDetector() {
if (config_.voice_detection.enabled) {
submodules_.voice_detector = std::make_unique<VoiceDetection>(
proc_split_sample_rate_hz(), VoiceDetection::kVeryLowLikelihood);
} else {
submodules_.voice_detector.reset();
}
}
void AudioProcessingImpl::InitializeEchoController() {
bool use_echo_controller =
echo_control_factory_ ||