Allow extracting the linear AEC output

This CL enables extracting the linear AEC output,
allowing for more straightforward
testing/development.

Bug: b/140823178
Change-Id: I14f7934008d87066b35500466cb6e6d96f811688
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153672
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29789}
This commit is contained in:
Per Åhgren
2019-11-13 11:12:29 +01:00
committed by Commit Bot
parent 06a394e036
commit c20a19cc4b
26 changed files with 293 additions and 90 deletions

View File

@ -79,6 +79,7 @@ struct RTC_EXPORT EchoCanceller3Config {
bool conservative_initial_phase = false;
bool enable_shadow_filter_output_usage = true;
bool use_linear_filter = true;
bool export_linear_aec_output = false;
} filter;
struct Erle {
@ -185,8 +186,6 @@ struct RTC_EXPORT EchoCanceller3Config {
} high_bands_suppression;
float floor_first_increase = 0.00001f;
bool enforce_transparent = false;
bool enforce_empty_higher_bands = false;
} suppressor;
};
} // namespace webrtc

View File

@ -190,6 +190,8 @@ void Aec3ConfigFromJsonString(absl::string_view json_string,
ReadParam(section, "enable_shadow_filter_output_usage",
&cfg.filter.enable_shadow_filter_output_usage);
ReadParam(section, "use_linear_filter", &cfg.filter.use_linear_filter);
ReadParam(section, "export_linear_aec_output",
&cfg.filter.export_linear_aec_output);
}
if (rtc::GetValueFromJsonObject(aec3_root, "erle", &section)) {
@ -314,10 +316,6 @@ void Aec3ConfigFromJsonString(absl::string_view json_string,
ReadParam(section, "floor_first_increase",
&cfg.suppressor.floor_first_increase);
ReadParam(section, "enforce_transparent",
&cfg.suppressor.enforce_transparent);
ReadParam(section, "enforce_empty_higher_bands",
&cfg.suppressor.enforce_empty_higher_bands);
}
}
@ -408,7 +406,12 @@ std::string Aec3ConfigToJsonString(const EchoCanceller3Config& config) {
ost << "\"conservative_initial_phase\": "
<< (config.filter.conservative_initial_phase ? "true" : "false") << ",";
ost << "\"enable_shadow_filter_output_usage\": "
<< (config.filter.enable_shadow_filter_output_usage ? "true" : "false");
<< (config.filter.enable_shadow_filter_output_usage ? "true" : "false")
<< ",";
ost << "\"use_linear_filter\": "
<< (config.filter.use_linear_filter ? "true" : "false") << ",";
ost << "\"export_linear_aec_output\": "
<< (config.filter.export_linear_aec_output ? "true" : "false");
ost << "},";
@ -545,12 +548,7 @@ std::string Aec3ConfigToJsonString(const EchoCanceller3Config& config) {
ost << "\"max_gain_during_echo\": "
<< config.suppressor.high_bands_suppression.max_gain_during_echo;
ost << "},";
ost << "\"floor_first_increase\": " << config.suppressor.floor_first_increase
<< ",";
ost << "\"enforce_transparent\": "
<< (config.suppressor.enforce_transparent ? "true" : "false") << ",";
ost << "\"enforce_empty_higher_bands\": "
<< (config.suppressor.enforce_empty_higher_bands ? "true" : "false");
ost << "\"floor_first_increase\": " << config.suppressor.floor_first_increase;
ost << "}";
ost << "}";
ost << "}";

View File

@ -31,6 +31,12 @@ class EchoControl {
// Processes the capture signal in order to remove the echo.
virtual void ProcessCapture(AudioBuffer* capture, bool echo_path_change) = 0;
// As above, but also returns the linear filter output.
// TODO(peah): Make pure virtual.
virtual void ProcessCapture(AudioBuffer* capture,
AudioBuffer* linear_output,
bool level_change) {}
struct Metrics {
double echo_return_loss;
double echo_return_loss_enhancement;