AEC3 delay estimator refactoring and introducing ability to customize

This CL refactors the delay estimator in AEC3.
Furthermore, it adds:
1. Allow for a customized delay estimator behavior to simplify
development.
2. Exposes that behavior to clear configuration settings.
3. Adds logging of the delay range supported by the delay
estimator.

Bug: webrtc:8519
Change-Id: I1764a090519a78b021b2e7de565c52a6c02c848e
Reviewed-on: https://webrtc-review.googlesource.com/21166
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20733}
This commit is contained in:
Per Åhgren
2017-11-17 14:54:28 +01:00
committed by Commit Bot
parent 76f2a85027
commit 38e2d95bda
27 changed files with 910 additions and 514 deletions

View File

@ -43,7 +43,6 @@ class RenderDelayControllerImpl final : public RenderDelayController {
std::unique_ptr<ApmDataDumper> data_dumper_;
const size_t default_delay_;
size_t delay_;
EchoPathDelayEstimator delay_estimator_;
size_t blocks_since_last_delay_estimate_ = 300000;
int echo_path_delay_samples_;
size_t align_call_counter_ = 0;
@ -51,6 +50,7 @@ class RenderDelayControllerImpl final : public RenderDelayController {
std::vector<float> capture_delay_buffer_;
int capture_delay_buffer_index_ = 0;
RenderDelayControllerMetrics metrics_;
EchoPathDelayEstimator delay_estimator_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RenderDelayControllerImpl);
};
@ -81,10 +81,12 @@ RenderDelayControllerImpl::RenderDelayControllerImpl(
default_delay_(
std::max(config.delay.default_delay, kMinEchoPathDelayBlocks)),
delay_(default_delay_),
delay_estimator_(data_dumper_.get(), config),
echo_path_delay_samples_(default_delay_ * kBlockSize),
capture_delay_buffer_(kBlockSize * (kMaxApiCallsJitterBlocks + 2), 0.f) {
capture_delay_buffer_(kBlockSize * (kMaxApiCallsJitterBlocks + 2), 0.f),
delay_estimator_(data_dumper_.get(), config) {
RTC_DCHECK(ValidFullBandRate(sample_rate_hz));
delay_estimator_.LogDelayEstimationProperties(sample_rate_hz,
capture_delay_buffer_.size());
}
RenderDelayControllerImpl::~RenderDelayControllerImpl() = default;