#include <stddef.h>
#include <stdlib.h>
#include "modules/audio_processing/aecm/aecm_core.h"
extern "C" {
#include "common_audio/ring_buffer.h"
#include "common_audio/signal_processing/include/real_fft.h"
}
#include "modules/audio_processing/aecm/echo_control_mobile.h"
#include "modules/audio_processing/utility/delay_estimator_wrapper.h"
extern "C" {
#include "system_wrappers/include/cpu_features_wrapper.h"
}
#include "rtc_base/checks.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "rtc_base/sanitizer.h"
namespace webrtc {
namespace {
static const ALIGN8_BEG int16_t WebRtcAecm_kSqrtHanning[] ALIGN8_END = …;
#ifdef AECM_WITH_ABS_APPROX
static const uint16_t kAlpha1 = 32584;
static const uint16_t kBeta1 = 4249;
static const uint16_t kAlpha2 = 30879;
static const uint16_t kBeta2 = 11072;
static const uint16_t kAlpha3 = 26951;
static const uint16_t kBeta3 = 18927;
#endif
static const int16_t kNoiseEstQDomain = …;
static const int16_t kNoiseEstIncCount = …;
static void ComfortNoise(AecmCore* aecm,
const uint16_t* dfa,
ComplexInt16* out,
const int16_t* lambda) { … }
static void WindowAndFFT(AecmCore* aecm,
int16_t* fft,
const int16_t* time_signal,
ComplexInt16* freq_signal,
int time_signal_scaling) { … }
static void InverseFFTAndWindow(AecmCore* aecm,
int16_t* fft,
ComplexInt16* efw,
int16_t* output,
const int16_t* nearendClean) { … }
static int TimeToFrequencyDomain(AecmCore* aecm,
const int16_t* time_signal,
ComplexInt16* freq_signal,
uint16_t* freq_signal_abs,
uint32_t* freq_signal_sum_abs) { … }
}
int RTC_NO_SANITIZE("signed-integer-overflow")
WebRtcAecm_ProcessBlock(AecmCore* aecm,
const int16_t* farend,
const int16_t* nearendNoisy,
const int16_t* nearendClean,
int16_t* output) { … }
}