Bump to WebRTC M120 release
Some API deprecation -- ExperimentalAgc and ExperimentalNs are gone. We're continuing to carry iSAC even though it's gone upstream, but maybe we'll want to drop that soon.
This commit is contained in:
@ -12,6 +12,7 @@
|
||||
#define MODULES_AUDIO_PROCESSING_AEC3_SUPPRESSION_GAIN_H_
|
||||
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
@ -25,7 +26,6 @@
|
||||
#include "modules/audio_processing/aec3/nearend_detector.h"
|
||||
#include "modules/audio_processing/aec3/render_signal_analyzer.h"
|
||||
#include "modules/audio_processing/logging/apm_data_dumper.h"
|
||||
#include "rtc_base/constructor_magic.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -36,20 +36,31 @@ class SuppressionGain {
|
||||
int sample_rate_hz,
|
||||
size_t num_capture_channels);
|
||||
~SuppressionGain();
|
||||
|
||||
SuppressionGain(const SuppressionGain&) = delete;
|
||||
SuppressionGain& operator=(const SuppressionGain&) = delete;
|
||||
|
||||
void GetGain(
|
||||
rtc::ArrayView<const std::array<float, kFftLengthBy2Plus1>>
|
||||
nearend_spectrum,
|
||||
rtc::ArrayView<const std::array<float, kFftLengthBy2Plus1>> echo_spectrum,
|
||||
rtc::ArrayView<const std::array<float, kFftLengthBy2Plus1>>
|
||||
residual_echo_spectrum,
|
||||
rtc::ArrayView<const std::array<float, kFftLengthBy2Plus1>>
|
||||
residual_echo_spectrum_unbounded,
|
||||
rtc::ArrayView<const std::array<float, kFftLengthBy2Plus1>>
|
||||
comfort_noise_spectrum,
|
||||
const RenderSignalAnalyzer& render_signal_analyzer,
|
||||
const AecState& aec_state,
|
||||
const std::vector<std::vector<std::vector<float>>>& render,
|
||||
const Block& render,
|
||||
bool clock_drift,
|
||||
float* high_bands_gain,
|
||||
std::array<float, kFftLengthBy2Plus1>* low_band_gain);
|
||||
|
||||
bool IsDominantNearend() {
|
||||
return dominant_nearend_detector_->IsNearendState();
|
||||
}
|
||||
|
||||
// Toggles the usage of the initial state.
|
||||
void SetInitialState(bool state);
|
||||
|
||||
@ -61,7 +72,7 @@ class SuppressionGain {
|
||||
comfort_noise_spectrum,
|
||||
const absl::optional<int>& narrow_peak_band,
|
||||
bool saturated_echo,
|
||||
const std::vector<std::vector<std::vector<float>>>& render,
|
||||
const Block& render,
|
||||
const std::array<float, kFftLengthBy2Plus1>& low_band_gain) const;
|
||||
|
||||
void GainToNoAudibleEcho(const std::array<float, kFftLengthBy2Plus1>& nearend,
|
||||
@ -76,6 +87,7 @@ class SuppressionGain {
|
||||
suppressor_input,
|
||||
rtc::ArrayView<const std::array<float, kFftLengthBy2Plus1>> residual_echo,
|
||||
rtc::ArrayView<const std::array<float, kFftLengthBy2Plus1>> comfort_noise,
|
||||
bool clock_drift,
|
||||
std::array<float, kFftLengthBy2Plus1>* gain);
|
||||
|
||||
void GetMinGain(rtc::ArrayView<const float> weighted_residual_echo,
|
||||
@ -89,7 +101,7 @@ class SuppressionGain {
|
||||
|
||||
class LowNoiseRenderDetector {
|
||||
public:
|
||||
bool Detect(const std::vector<std::vector<std::vector<float>>>& render);
|
||||
bool Detect(const Block& render);
|
||||
|
||||
private:
|
||||
float average_power_ = 32768.f * 32768.f;
|
||||
@ -97,6 +109,8 @@ class SuppressionGain {
|
||||
|
||||
struct GainParameters {
|
||||
explicit GainParameters(
|
||||
int last_lf_band,
|
||||
int first_hf_band,
|
||||
const EchoCanceller3Config::Suppressor::Tuning& tuning);
|
||||
const float max_inc_factor;
|
||||
const float max_dec_factor_lf;
|
||||
@ -105,7 +119,7 @@ class SuppressionGain {
|
||||
std::array<float, kFftLengthBy2Plus1> emr_transparent_;
|
||||
};
|
||||
|
||||
static int instance_count_;
|
||||
static std::atomic<int> instance_count_;
|
||||
std::unique_ptr<ApmDataDumper> data_dumper_;
|
||||
const Aec3Optimization optimization_;
|
||||
const EchoCanceller3Config config_;
|
||||
@ -120,9 +134,10 @@ class SuppressionGain {
|
||||
std::vector<aec3::MovingAverage> nearend_smoothers_;
|
||||
const GainParameters nearend_params_;
|
||||
const GainParameters normal_params_;
|
||||
// Determines if the dominant nearend detector uses the unbounded residual
|
||||
// echo spectrum.
|
||||
const bool use_unbounded_echo_spectrum_;
|
||||
std::unique_ptr<NearendDetector> dominant_nearend_detector_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(SuppressionGain);
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
Reference in New Issue
Block a user