mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 22:00:47 +01:00
Correcting the usage of the estimated echo path gain in AEC3
This CL corrects the usage of the estimated echo path gain to not be hardcoded to 1. In order to retain the tuned behavior, the CL for now maintains the former behavior in the code. Bug: webrtc:9255,chromium:851187 Change-Id: I7f91c72e476680a8a854c22b74b1771fae446110 Reviewed-on: https://webrtc-review.googlesource.com/75510 Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> Commit-Queue: Per Åhgren <peah@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23190}
This commit is contained in:
parent
e05c43cc39
commit
ced31ba1cf
4 changed files with 20 additions and 8 deletions
|
@ -62,9 +62,9 @@ struct EchoCanceller3Config {
|
|||
} erle;
|
||||
|
||||
struct EpStrength {
|
||||
float lf = 10.f;
|
||||
float mf = 10.f;
|
||||
float hf = 10.f;
|
||||
float lf = 1.f;
|
||||
float mf = 1.f;
|
||||
float hf = 1.f;
|
||||
float default_len = 0.f;
|
||||
bool echo_can_saturate = true;
|
||||
bool bounded_erl = false;
|
||||
|
|
|
@ -49,7 +49,7 @@ class AecState {
|
|||
bool UseLinearFilterOutput() const { return use_linear_filter_output_; }
|
||||
|
||||
// Returns the estimated echo path gain.
|
||||
bool EchoPathGain() const { return filter_analyzer_.Gain(); }
|
||||
float EchoPathGain() const { return filter_analyzer_.Gain(); }
|
||||
|
||||
// Returns whether the render signal is currently active.
|
||||
bool ActiveRender() const { return blocks_with_active_render_ > 200; }
|
||||
|
|
|
@ -24,12 +24,17 @@ bool EnableSoftTransparentMode() {
|
|||
return !field_trial::IsEnabled("WebRTC-Aec3SoftTransparentModeKillSwitch");
|
||||
}
|
||||
|
||||
bool OverrideEstimatedEchoPathGain() {
|
||||
return !field_trial::IsEnabled("WebRTC-Aec3OverrideEchoPathGainKillSwitch");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
ResidualEchoEstimator::ResidualEchoEstimator(const EchoCanceller3Config& config)
|
||||
: config_(config),
|
||||
S2_old_(config_.filter.main.length_blocks),
|
||||
soft_transparent_mode_(EnableSoftTransparentMode()) {
|
||||
soft_transparent_mode_(EnableSoftTransparentMode()),
|
||||
override_estimated_echo_path_gain_(OverrideEstimatedEchoPathGain()) {
|
||||
Reset();
|
||||
}
|
||||
|
||||
|
@ -74,9 +79,15 @@ void ResidualEchoEstimator::Estimate(
|
|||
0.f, a - config_.echo_model.stationary_gate_slope * b);
|
||||
});
|
||||
|
||||
float echo_path_gain = aec_state.TransparentMode() && soft_transparent_mode_
|
||||
float echo_path_gain;
|
||||
if (override_estimated_echo_path_gain_) {
|
||||
echo_path_gain =
|
||||
aec_state.TransparentMode() && soft_transparent_mode_ ? 0.01f : 1.f;
|
||||
} else {
|
||||
echo_path_gain = aec_state.TransparentMode() && soft_transparent_mode_
|
||||
? 0.01f
|
||||
: aec_state.EchoPathGain();
|
||||
}
|
||||
NonLinearEstimate(echo_path_gain, X2, Y2, R2);
|
||||
|
||||
// If the echo is saturated, estimate the echo power as the maximum echo
|
||||
|
|
|
@ -83,6 +83,7 @@ class ResidualEchoEstimator {
|
|||
std::array<float, kFftLengthBy2Plus1> X2_noise_floor_;
|
||||
std::array<int, kFftLengthBy2Plus1> X2_noise_floor_counter_;
|
||||
const bool soft_transparent_mode_;
|
||||
const bool override_estimated_echo_path_gain_;
|
||||
|
||||
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(ResidualEchoEstimator);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue