This CL introduces the new functionality for setting
the APM parameters to the high-pass filter. The introduction will be done in three steps: 1) This CL which introduces the new scheme and changes the code in webrtcvoiceengine.cc to use it. 2) Introduce the scheme into upstream code. 3) Remove the HighPassFilter interface in APM. BUG=webrtc::6220, webrtc::6296, webrtc::6297, webrtc::6181, webrtc::5298 Review-Url: https://codereview.webrtc.org/2415403002 Cr-Commit-Position: refs/heads/master@{#15197}
This commit is contained in:
@ -403,8 +403,7 @@ void AecDumpBasedSimulator::HandleMessage(
|
||||
|
||||
if (msg.has_hpf_enabled() || settings_.use_hpf) {
|
||||
bool enable = settings_.use_hpf ? *settings_.use_hpf : msg.hpf_enabled();
|
||||
RTC_CHECK_EQ(AudioProcessing::kNoError,
|
||||
ap_->high_pass_filter()->Enable(enable));
|
||||
apm_config.high_pass_filter.enabled = enable;
|
||||
if (settings_.use_verbose_logging) {
|
||||
std::cout << " hpf_enabled: " << (enable ? "true" : "false")
|
||||
<< std::endl;
|
||||
|
||||
@ -273,6 +273,10 @@ void AudioProcessingSimulator::CreateAudioProcessor() {
|
||||
if (settings_.use_lc) {
|
||||
apm_config.level_controller.enabled = *settings_.use_lc;
|
||||
}
|
||||
if (settings_.use_hpf) {
|
||||
apm_config.high_pass_filter.enabled = *settings_.use_hpf;
|
||||
}
|
||||
|
||||
if (settings_.use_refined_adaptive_filter) {
|
||||
config.Set<RefinedAdaptiveFilter>(
|
||||
new RefinedAdaptiveFilter(*settings_.use_refined_adaptive_filter));
|
||||
@ -302,10 +306,6 @@ void AudioProcessingSimulator::CreateAudioProcessor() {
|
||||
RTC_CHECK_EQ(AudioProcessing::kNoError,
|
||||
ap_->gain_control()->Enable(*settings_.use_agc));
|
||||
}
|
||||
if (settings_.use_hpf) {
|
||||
RTC_CHECK_EQ(AudioProcessing::kNoError,
|
||||
ap_->high_pass_filter()->Enable(*settings_.use_hpf));
|
||||
}
|
||||
if (settings_.use_ns) {
|
||||
RTC_CHECK_EQ(AudioProcessing::kNoError,
|
||||
ap_->noise_suppression()->Enable(*settings_.use_ns));
|
||||
|
||||
@ -199,6 +199,8 @@ void DebugDumpReplayer::MaybeRecreateApm(const audioproc::Config& msg) {
|
||||
}
|
||||
|
||||
void DebugDumpReplayer::ConfigureApm(const audioproc::Config& msg) {
|
||||
AudioProcessing::Config apm_config;
|
||||
|
||||
// AEC configs.
|
||||
RTC_CHECK(msg.has_aec_enabled());
|
||||
RTC_CHECK_EQ(AudioProcessing::kNoError,
|
||||
@ -247,8 +249,7 @@ void DebugDumpReplayer::ConfigureApm(const audioproc::Config& msg) {
|
||||
|
||||
// HPF configs.
|
||||
RTC_CHECK(msg.has_hpf_enabled());
|
||||
RTC_CHECK_EQ(AudioProcessing::kNoError,
|
||||
apm_->high_pass_filter()->Enable(msg.hpf_enabled()));
|
||||
apm_config.high_pass_filter.enabled = msg.hpf_enabled();
|
||||
|
||||
// NS configs.
|
||||
RTC_CHECK(msg.has_ns_enabled());
|
||||
@ -259,6 +260,8 @@ void DebugDumpReplayer::ConfigureApm(const audioproc::Config& msg) {
|
||||
RTC_CHECK_EQ(AudioProcessing::kNoError,
|
||||
apm_->noise_suppression()->set_level(
|
||||
static_cast<NoiseSuppression::Level>(msg.ns_level())));
|
||||
|
||||
apm_->ApplyConfig(apm_config);
|
||||
}
|
||||
|
||||
void DebugDumpReplayer::LoadNextMessage() {
|
||||
|
||||
Reference in New Issue
Block a user