Added the ability to set the default echo path delay in AEC3.
This CL adds the ability to set a default echo path delay to use in AEC3 when there is prior knowledge about the delay in the echo path. Bug: webrtc:8358 Change-Id: Ie368f9a6dec9f412e09bf0e095f89d84305045f9 Reviewed-on: https://webrtc-review.googlesource.com/7604 Commit-Queue: Per Åhgren <peah@webrtc.org> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20204}
This commit is contained in:
parent
59ff0e216b
commit
0f46441772
@ -42,10 +42,11 @@ class RenderDelayControllerImpl final : public RenderDelayController {
|
||||
private:
|
||||
static int instance_count_;
|
||||
std::unique_ptr<ApmDataDumper> data_dumper_;
|
||||
size_t delay_ = kMinEchoPathDelayBlocks;
|
||||
const size_t default_delay_;
|
||||
size_t delay_;
|
||||
EchoPathDelayEstimator delay_estimator_;
|
||||
size_t blocks_since_last_delay_estimate_ = 300000;
|
||||
int echo_path_delay_samples_ = kMinEchoPathDelayBlocks * kBlockSize;
|
||||
int echo_path_delay_samples_;
|
||||
size_t align_call_counter_ = 0;
|
||||
rtc::Optional<size_t> headroom_samples_;
|
||||
std::vector<float> capture_delay_buffer_;
|
||||
@ -78,7 +79,11 @@ RenderDelayControllerImpl::RenderDelayControllerImpl(
|
||||
int sample_rate_hz)
|
||||
: data_dumper_(
|
||||
new ApmDataDumper(rtc::AtomicOps::Increment(&instance_count_))),
|
||||
default_delay_(
|
||||
std::max(config.param.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) {
|
||||
RTC_DCHECK(ValidFullBandRate(sample_rate_hz));
|
||||
}
|
||||
@ -86,7 +91,7 @@ RenderDelayControllerImpl::RenderDelayControllerImpl(
|
||||
RenderDelayControllerImpl::~RenderDelayControllerImpl() = default;
|
||||
|
||||
void RenderDelayControllerImpl::Reset() {
|
||||
delay_ = kMinEchoPathDelayBlocks;
|
||||
delay_ = default_delay_;
|
||||
blocks_since_last_delay_estimate_ = 300000;
|
||||
echo_path_delay_samples_ = delay_ * kBlockSize;
|
||||
align_call_counter_ = 0;
|
||||
|
||||
@ -272,6 +272,10 @@ class AudioProcessing : public rtc::RefCountInterface {
|
||||
// does not yet have the desired behavior.
|
||||
struct EchoCanceller3 {
|
||||
struct Param {
|
||||
struct Delay {
|
||||
size_t default_delay = 5;
|
||||
} delay;
|
||||
|
||||
struct Erle {
|
||||
float min = 1.f;
|
||||
float max_l = 8.f;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user