#include "modules/audio_processing/aec3/fullband_erle_estimator.h"
#include <algorithm>
#include <memory>
#include <numeric>
#include "absl/types/optional.h"
#include "api/array_view.h"
#include "modules/audio_processing/aec3/aec3_common.h"
#include "modules/audio_processing/logging/apm_data_dumper.h"
#include "rtc_base/checks.h"
#include "rtc_base/numerics/safe_minmax.h"
namespace webrtc {
namespace {
constexpr float kEpsilon = …;
constexpr float kX2BandEnergyThreshold = …;
constexpr int kBlocksToHoldErle = …;
constexpr int kPointsToAccumulate = …;
}
FullBandErleEstimator::FullBandErleEstimator(
const EchoCanceller3Config::Erle& config,
size_t num_capture_channels)
: … { … }
FullBandErleEstimator::~FullBandErleEstimator() = default;
void FullBandErleEstimator::Reset() { … }
void FullBandErleEstimator::Update(
rtc::ArrayView<const float> X2,
rtc::ArrayView<const std::array<float, kFftLengthBy2Plus1>> Y2,
rtc::ArrayView<const std::array<float, kFftLengthBy2Plus1>> E2,
const std::vector<bool>& converged_filters) { … }
void FullBandErleEstimator::Dump(
const std::unique_ptr<ApmDataDumper>& data_dumper) const { … }
void FullBandErleEstimator::UpdateQualityEstimates() { … }
FullBandErleEstimator::ErleInstantaneous::ErleInstantaneous(
const EchoCanceller3Config::Erle& config)
: … { … }
FullBandErleEstimator::ErleInstantaneous::~ErleInstantaneous() = default;
bool FullBandErleEstimator::ErleInstantaneous::Update(const float Y2_sum,
const float E2_sum) { … }
void FullBandErleEstimator::ErleInstantaneous::Reset() { … }
void FullBandErleEstimator::ErleInstantaneous::ResetAccumulators() { … }
void FullBandErleEstimator::ErleInstantaneous::Dump(
const std::unique_ptr<ApmDataDumper>& data_dumper) const { … }
void FullBandErleEstimator::ErleInstantaneous::UpdateMaxMin() { … }
void FullBandErleEstimator::ErleInstantaneous::UpdateQualityEstimate() { … }
}