Revert "Add core multi-channel pipeline in AEC3"

This reverts commit f3a197e55323aee974a932c52dd19fa88e5d4e38.

Reason for revert: Speculative revert, as this may'be broken some build bots

Original change's description:
> Add core multi-channel pipeline in AEC3
> This CL adds basic the basic pipeline to support multi-channel
> processing in AEC3.
> 
> Apart from that, it removes the 8 kHz processing support in several
> places of the AEC3 code.
> 
> Bug: webrtc:10913
> Change-Id: If5b75fa325ed0071deea94a7546cb4a7adf22137
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150332
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#29017}

TBR=saza@webrtc.org,peah@webrtc.org

Change-Id: I877d2993b9ccf024bd1d57bca1513c3e24d0bed3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10913
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150940
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29022}
This commit is contained in:
Ilya Nikolaevskiy
2019-08-30 10:19:13 +00:00
committed by Commit Bot
parent ddd50ef921
commit e3e30ae5c5
58 changed files with 1116 additions and 1825 deletions

View File

@ -33,23 +33,14 @@ constexpr float kPi = 3.141592f;
void ProduceSinusoid(int sample_rate_hz,
float sinusoidal_frequency_hz,
size_t* sample_counter,
std::vector<std::vector<std::vector<float>>>* x) {
rtc::ArrayView<float> x) {
// Produce a sinusoid of the specified frequency.
for (size_t k = *sample_counter, j = 0; k < (*sample_counter + kBlockSize);
++k, ++j) {
for (size_t channel = 0; channel < (*x)[0].size(); ++channel) {
(*x)[0][channel][j] =
32767.f *
std::sin(2.f * kPi * sinusoidal_frequency_hz * k / sample_rate_hz);
}
x[j] = 32767.f *
std::sin(2.f * kPi * sinusoidal_frequency_hz * k / sample_rate_hz);
}
*sample_counter = *sample_counter + kBlockSize;
for (size_t band = 1; band < x->size(); ++band) {
for (size_t channel = 0; channel < (*x)[band].size(); ++channel) {
std::fill((*x)[band][channel].begin(), (*x)[band][channel].end(), 0.f);
}
}
}
} // namespace
@ -67,17 +58,15 @@ TEST(RenderSignalAnalyzer, NullMaskOutput) {
TEST(RenderSignalAnalyzer, NoFalseDetectionOfNarrowBands) {
RenderSignalAnalyzer analyzer(EchoCanceller3Config{});
Random random_generator(42U);
std::vector<std::vector<std::vector<float>>> x(
3,
std::vector<std::vector<float>>(1, std::vector<float>(kBlockSize, 0.f)));
std::vector<std::vector<float>> x(3, std::vector<float>(kBlockSize, 0.f));
std::array<float, kBlockSize> x_old;
std::unique_ptr<RenderDelayBuffer> render_delay_buffer(
RenderDelayBuffer::Create(EchoCanceller3Config(), 48000, 1));
RenderDelayBuffer::Create(EchoCanceller3Config(), 48000));
std::array<float, kFftLengthBy2Plus1> mask;
x_old.fill(0.f);
for (size_t k = 0; k < 100; ++k) {
RandomizeSampleVector(&random_generator, x[0][0]);
RandomizeSampleVector(&random_generator, x[0]);
render_delay_buffer->Insert(x);
if (k == 0) {
@ -100,17 +89,12 @@ TEST(RenderSignalAnalyzer, NoFalseDetectionOfNarrowBands) {
TEST(RenderSignalAnalyzer, NarrowBandDetection) {
RenderSignalAnalyzer analyzer(EchoCanceller3Config{});
Random random_generator(42U);
constexpr size_t kNumChannels = 1;
constexpr int kSampleRateHz = 48000;
constexpr size_t kNumBands = NumBandsForRate(kSampleRateHz);
std::vector<std::vector<std::vector<float>>> x(
kNumBands, std::vector<std::vector<float>>(
kNumChannels, std::vector<float>(kBlockSize, 0.f)));
std::vector<std::vector<float>> x(3, std::vector<float>(kBlockSize, 0.f));
std::array<float, kBlockSize> x_old;
Aec3Fft fft;
EchoCanceller3Config config;
std::unique_ptr<RenderDelayBuffer> render_delay_buffer(
RenderDelayBuffer::Create(config, kSampleRateHz, kNumChannels));
RenderDelayBuffer::Create(config, 48000));
std::array<float, kFftLengthBy2Plus1> mask;
x_old.fill(0.f);
@ -120,7 +104,7 @@ TEST(RenderSignalAnalyzer, NarrowBandDetection) {
size_t sample_counter = 0;
for (size_t k = 0; k < 100; ++k) {
ProduceSinusoid(16000, 16000 / 2 * kSinusFrequencyBin / kFftLengthBy2,
&sample_counter, &x);
&sample_counter, x[0]);
render_delay_buffer->Insert(x);
if (k == 0) {