#include "modules/audio_coding/neteq/background_noise.h"
#include <string.h>
#include <algorithm>
#include "common_audio/signal_processing/include/signal_processing_library.h"
#include "modules/audio_coding/neteq/audio_multi_vector.h"
#include "modules/audio_coding/neteq/cross_correlation.h"
namespace webrtc {
namespace {
constexpr size_t kMaxSampleRate = …;
}
constexpr size_t BackgroundNoise::kMaxLpcOrder;
BackgroundNoise::BackgroundNoise(size_t num_channels)
: … { … }
BackgroundNoise::~BackgroundNoise() { … }
void BackgroundNoise::Reset() { … }
bool BackgroundNoise::Update(const AudioMultiVector& sync_buffer) { … }
void BackgroundNoise::GenerateBackgroundNoise(
rtc::ArrayView<const int16_t> random_vector,
size_t channel,
int mute_slope,
bool too_many_expands,
size_t num_noise_samples,
int16_t* buffer) { … }
int32_t BackgroundNoise::Energy(size_t channel) const { … }
void BackgroundNoise::SetMuteFactor(size_t channel, int16_t value) { … }
int16_t BackgroundNoise::MuteFactor(size_t channel) const { … }
const int16_t* BackgroundNoise::Filter(size_t channel) const { … }
const int16_t* BackgroundNoise::FilterState(size_t channel) const { … }
void BackgroundNoise::SetFilterState(size_t channel,
rtc::ArrayView<const int16_t> input) { … }
int16_t BackgroundNoise::Scale(size_t channel) const { … }
int16_t BackgroundNoise::ScaleShift(size_t channel) const { … }
int32_t BackgroundNoise::CalculateAutoCorrelation(
const int16_t* signal,
size_t length,
int32_t* auto_correlation) const { … }
void BackgroundNoise::IncrementEnergyThreshold(size_t channel,
int32_t sample_energy) { … }
void BackgroundNoise::SaveParameters(size_t channel,
const int16_t* lpc_coefficients,
const int16_t* filter_state,
int32_t sample_energy,
int32_t residual_energy) { … }
}