Add AudioOption for residual echo detector, and enable the echo detector by default on non-mobile platforms.

BUG=webrtc:6525

Review-Url: https://codereview.webrtc.org/2493753002
Cr-Commit-Position: refs/heads/master@{#15079}
This commit is contained in:
ivoc 2016-11-15 02:34:47 -08:00 committed by Commit bot
parent 79dfdadbc8
commit b829d9f2ee
3 changed files with 16 additions and 0 deletions

View File

@ -156,6 +156,7 @@ struct AudioOptions {
SetFrom(&experimental_ns, change.experimental_ns);
SetFrom(&intelligibility_enhancer, change.intelligibility_enhancer);
SetFrom(&level_control, change.level_control);
SetFrom(&residual_echo_detector, change.residual_echo_detector);
SetFrom(&tx_agc_target_dbov, change.tx_agc_target_dbov);
SetFrom(&tx_agc_digital_compression_gain,
change.tx_agc_digital_compression_gain);
@ -187,6 +188,7 @@ struct AudioOptions {
experimental_ns == o.experimental_ns &&
intelligibility_enhancer == o.intelligibility_enhancer &&
level_control == o.level_control &&
residual_echo_detector == o.residual_echo_detector &&
adjust_agc_delta == o.adjust_agc_delta &&
tx_agc_target_dbov == o.tx_agc_target_dbov &&
tx_agc_digital_compression_gain ==
@ -225,6 +227,7 @@ struct AudioOptions {
ost << ToStringIfSet("level_control", level_control);
ost << ToStringIfSet("level_control_initial_peak_level_dbfs",
level_control_initial_peak_level_dbfs);
ost << ToStringIfSet("residual_echo_detector", residual_echo_detector);
ost << ToStringIfSet("tx_agc_target_dbov", tx_agc_target_dbov);
ost << ToStringIfSet("tx_agc_digital_compression_gain",
tx_agc_digital_compression_gain);
@ -269,6 +272,7 @@ struct AudioOptions {
// Specifies an optional initialization value for the level controller.
rtc::Optional<float> level_control_initial_peak_level_dbfs;
// Note that tx_agc_* only applies to non-experimental AGC.
rtc::Optional<bool> residual_echo_detector;
rtc::Optional<uint16_t> tx_agc_target_dbov;
rtc::Optional<uint16_t> tx_agc_digital_compression_gain;
rtc::Optional<bool> tx_agc_limiter;

View File

@ -606,6 +606,13 @@ WebRtcVoiceEngine::WebRtcVoiceEngine(
options.experimental_ns = rtc::Optional<bool>(false);
options.intelligibility_enhancer = rtc::Optional<bool>(false);
options.level_control = rtc::Optional<bool>(false);
// TODO(ivoc): Always enable residual echo detector after benchmarking on
// mobile.
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
options.residual_echo_detector = rtc::Optional<bool>(false);
#else
options.residual_echo_detector = rtc::Optional<bool>(true);
#endif
bool error = ApplyOptions(options);
RTC_DCHECK(error);
}
@ -670,6 +677,7 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) {
options.experimental_agc = rtc::Optional<bool>(false);
options.extended_filter_aec = rtc::Optional<bool>(false);
options.experimental_ns = rtc::Optional<bool>(false);
options.residual_echo_detector = rtc::Optional<bool>(false);
#endif
// Delay Agnostic AEC automatically turns on EC if not set except on iOS

View File

@ -259,7 +259,11 @@ class AudioProcessing {
float initial_peak_level_dbfs = -6.0206f;
} level_controller;
struct ResidualEchoDetector {
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
bool enabled = false;
#else
bool enabled = true;
#endif
} residual_echo_detector;
};