Index: webrtc/modules/audio_processing/aec3/suppression_gain.h |
diff --git a/webrtc/modules/audio_processing/aec3/suppression_gain.h b/webrtc/modules/audio_processing/aec3/suppression_gain.h |
index e4ad3fc71476d4d978115681d4e76dbf0e90a8c1..c34b804d2114432c339a6407182bb35f0f970a7f 100644 |
--- a/webrtc/modules/audio_processing/aec3/suppression_gain.h |
+++ b/webrtc/modules/audio_processing/aec3/suppression_gain.h |
@@ -22,20 +22,39 @@ namespace webrtc { |
class SuppressionGain { |
public: |
explicit SuppressionGain(Aec3Optimization optimization); |
- void GetGain(const std::array<float, kFftLengthBy2Plus1>& nearend_power, |
- const std::array<float, kFftLengthBy2Plus1>& residual_echo_power, |
- const std::array<float, kFftLengthBy2Plus1>& comfort_noise_power, |
+ void GetGain(const std::array<float, kFftLengthBy2Plus1>& nearend, |
+ const std::array<float, kFftLengthBy2Plus1>& echo, |
+ const std::array<float, kFftLengthBy2Plus1>& comfort_noise, |
bool saturated_echo, |
const std::vector<std::vector<float>>& render, |
- size_t num_capture_bands, |
bool force_zero_gain, |
float* high_bands_gain, |
std::array<float, kFftLengthBy2Plus1>* low_band_gain); |
private: |
+ void LowerBandGain(bool stationary_with_low_power, |
+ bool saturated_echo, |
+ const std::array<float, kFftLengthBy2Plus1>& nearend, |
+ const std::array<float, kFftLengthBy2Plus1>& echo, |
+ const std::array<float, kFftLengthBy2Plus1>& comfort_noise, |
+ std::array<float, kFftLengthBy2Plus1>* gain); |
+ |
+ class LowNoiseRenderDetector { |
+ public: |
+ bool Detect(const std::vector<std::vector<float>>& render); |
+ |
+ private: |
+ float average_power_ = 32768.f * 32768.f; |
+ }; |
+ |
const Aec3Optimization optimization_; |
- std::array<float, kFftLengthBy2 - 1> previous_gain_squared_; |
- std::array<float, kFftLengthBy2 - 1> previous_masker_; |
+ std::array<float, kFftLengthBy2Plus1> last_gain_; |
+ std::array<float, kFftLengthBy2Plus1> last_masker_; |
+ std::array<float, kFftLengthBy2Plus1> gain_increase_; |
+ std::array<float, kFftLengthBy2Plus1> last_echo_; |
+ |
+ LowNoiseRenderDetector low_render_detector_; |
+ size_t no_saturation_counter_ = 0; |
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SuppressionGain); |
}; |