Revert 4837 "Add an extended filter mode to AEC."
> Add an extended filter mode to AEC. > > This mode extends the filter length from the current 48 ms to 128 ms. > It is runtime selectable which allows it to be enabled through > experiment. We reuse the DelayCorrection infrastructure to avoid having > to replumb everything up to libjingle. > > Increases AEC complexity by ~50% on modern x86 CPUs. > Measurements (in percent of usage on one core): > > Machine/CPU Normal Extended > MacBook Retina (Early 2013), > Core i7 Ivy Bridge (2.7 GHz, hyperthreaded) 0.6% 0.9% > > MacBook Air (Late 2010), Core 2 Duo (2.13 GHz) 1.4% 2.7% > > Chromebook Pixel, Core i5 Ivy Bridge (1.8 GHz) 0.6% 1.0% > > Samsung ARM Chromebook, > Samsung Exynos 5 Dual (1.7 GHz) 3.2% 5.6% > > The relative value is large of course but the absolute should be > acceptable in order to have a working AEC on some platforms. > > Detailed changes to the algorithm: > - The filter length is changed from 48 to 128 ms. This comes with tuning > of several parameters: i) filter adaptation stepsize and error > threshold; ii) non-linear processing smoothing and overdrive. > - Option to ignore the reported delays on platforms which we deem > sufficiently unreliable. Currently this will be enabled in Chromium for > Mac. > - Faster startup times by removing the excessive "startup phase" > processing of reported delays. > - Much more conservative adjustments to the far-end read pointer. We > smooth the delay difference more heavily, and back off from the > difference more. Adjustments force a readaptation of the filter, so they > should be avoided except when really necessary. > > Corresponds to these changes: > https://chromereviews.googleplex.com/9412014 > https://chromereviews.googleplex.com/9514013 > https://chromereviews.googleplex.com/9960013 > > BUG=454,827,1261 > R=bjornv@webrtc.org > > Review URL: https://webrtc-codereview.appspot.com/2151007 TBR=andrew@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2296005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4839 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
extern "C" {
|
||||
#include "webrtc/modules/audio_processing/aec/aec_core.h"
|
||||
}
|
||||
#include "webrtc/modules/audio_processing/echo_cancellation_impl.h"
|
||||
#include "webrtc/modules/audio_processing/include/audio_processing.h"
|
||||
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
TEST(EchoCancellationInternalTest, DelayCorrection) {
|
||||
scoped_ptr<AudioProcessing> ap(AudioProcessing::Create(0));
|
||||
EXPECT_TRUE(ap->echo_cancellation()->aec_core() == NULL);
|
||||
|
||||
EXPECT_EQ(ap->kNoError, ap->echo_cancellation()->Enable(true));
|
||||
EXPECT_TRUE(ap->echo_cancellation()->is_enabled());
|
||||
|
||||
AecCore* aec_core = ap->echo_cancellation()->aec_core();
|
||||
ASSERT_TRUE(aec_core != NULL);
|
||||
// Disabled by default.
|
||||
EXPECT_EQ(0, WebRtcAec_delay_correction_enabled(aec_core));
|
||||
|
||||
Config config;
|
||||
config.Set<DelayCorrection>(new DelayCorrection(true));
|
||||
ap->SetExtraOptions(config);
|
||||
EXPECT_EQ(1, WebRtcAec_delay_correction_enabled(aec_core));
|
||||
|
||||
// Retains setting after initialization.
|
||||
EXPECT_EQ(ap->kNoError, ap->Initialize());
|
||||
EXPECT_EQ(1, WebRtcAec_delay_correction_enabled(aec_core));
|
||||
|
||||
config.Set<DelayCorrection>(new DelayCorrection(false));
|
||||
ap->SetExtraOptions(config);
|
||||
EXPECT_EQ(0, WebRtcAec_delay_correction_enabled(aec_core));
|
||||
|
||||
// Retains setting after initialization.
|
||||
EXPECT_EQ(ap->kNoError, ap->Initialize());
|
||||
EXPECT_EQ(0, WebRtcAec_delay_correction_enabled(aec_core));
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
Reference in New Issue
Block a user