AEC3: Ensure that the data size in the reverb computer is not fixed

This CL ensures that the no data vectors in the reverb computer code
are fixed. This allows arbitrary long filters to be used, and ensures
that a minimum required heap size is used.

Bug: webrtc:8671
Change-Id: I7085ed262a3f5965d796270434b6578f4030606e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162661
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30115}
This commit is contained in:
Per Åhgren
2019-12-19 10:38:01 +01:00
committed by Commit Bot
parent c8f3134b29
commit 9136abb45a
5 changed files with 15 additions and 8 deletions

View File

@ -38,7 +38,6 @@ constexpr size_t kFftLengthBy2Minus1 = kFftLengthBy2 - 1;
constexpr size_t kFftLength = 2 * kFftLengthBy2;
constexpr size_t kFftLengthBy2Log2 = 6;
constexpr int kMaxAdaptiveFilterLength = 50;
constexpr int kRenderTransferQueueSizeFrames = 100;
constexpr size_t kMaxNumBands = 3;

View File

@ -92,8 +92,8 @@ ReverbDecayEstimator::ReverbDecayEstimator(const EchoCanceller3Config& config)
kEarlyReverbMinSizeBlocks),
late_reverb_start_(kEarlyReverbMinSizeBlocks),
late_reverb_end_(kEarlyReverbMinSizeBlocks),
previous_gains_(config.filter.main.length_blocks, 0.f),
decay_(std::fabs(config.ep_strength.default_len)) {
previous_gains_.fill(0.f);
RTC_DCHECK_GT(config.filter.main.length_blocks,
static_cast<size_t>(kEarlyReverbMinSizeBlocks));
}

View File

@ -101,7 +101,7 @@ class ReverbDecayEstimator {
int block_to_analyze_ = 0;
int estimation_region_candidate_size_ = 0;
bool estimation_region_identified_ = false;
std::array<float, kMaxAdaptiveFilterLength> previous_gains_;
std::vector<float> previous_gains_;
float decay_;
float tail_gain_ = 0.f;
float smoothing_constant_ = 0.f;

View File

@ -143,7 +143,7 @@ TEST(SignalDependentErleEstimator, SweepSettings) {
for (size_t num_capture_channels : {1, 2, 4}) {
EchoCanceller3Config cfg;
size_t max_length_blocks = 50;
for (size_t blocks = 0; blocks < max_length_blocks;
for (size_t blocks = 1; blocks < max_length_blocks;
blocks = blocks + 10) {
for (size_t delay_headroom = 0; delay_headroom < 5; ++delay_headroom) {
for (size_t num_sections = 2; num_sections < max_length_blocks;