Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Side by Side Diff: webrtc/modules/audio_processing/test/audio_processing_simulator.cc

Issue 2415403002: Introduced the new parameter setting scheme for activating the high-pass filter in APM (Closed)
Patch Set: Changes in response to reviewer comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 230 }
231 if (settings_.use_ie) { 231 if (settings_.use_ie) {
232 config.Set<Intelligibility>(new Intelligibility(*settings_.use_ie)); 232 config.Set<Intelligibility>(new Intelligibility(*settings_.use_ie));
233 } 233 }
234 if (settings_.use_aec3) { 234 if (settings_.use_aec3) {
235 config.Set<EchoCanceller3>(new EchoCanceller3(*settings_.use_aec3)); 235 config.Set<EchoCanceller3>(new EchoCanceller3(*settings_.use_aec3));
236 } 236 }
237 if (settings_.use_lc) { 237 if (settings_.use_lc) {
238 apm_config.level_controller.enabled = *settings_.use_lc; 238 apm_config.level_controller.enabled = *settings_.use_lc;
239 } 239 }
240 if (settings_.use_hpf) {
241 apm_config.high_pass_filter.enabled = *settings_.use_hpf;
242 }
243
240 if (settings_.use_refined_adaptive_filter) { 244 if (settings_.use_refined_adaptive_filter) {
241 config.Set<RefinedAdaptiveFilter>( 245 config.Set<RefinedAdaptiveFilter>(
242 new RefinedAdaptiveFilter(*settings_.use_refined_adaptive_filter)); 246 new RefinedAdaptiveFilter(*settings_.use_refined_adaptive_filter));
243 } 247 }
244 config.Set<ExtendedFilter>(new ExtendedFilter( 248 config.Set<ExtendedFilter>(new ExtendedFilter(
245 !settings_.use_extended_filter || *settings_.use_extended_filter)); 249 !settings_.use_extended_filter || *settings_.use_extended_filter));
246 config.Set<DelayAgnostic>(new DelayAgnostic(!settings_.use_delay_agnostic || 250 config.Set<DelayAgnostic>(new DelayAgnostic(!settings_.use_delay_agnostic ||
247 *settings_.use_delay_agnostic)); 251 *settings_.use_delay_agnostic));
248 252
249 ap_.reset(AudioProcessing::Create(config)); 253 ap_.reset(AudioProcessing::Create(config));
250 RTC_CHECK(ap_); 254 RTC_CHECK(ap_);
251 255
252 ap_->ApplyConfig(apm_config); 256 ap_->ApplyConfig(apm_config);
253 257
254 if (settings_.use_aec) { 258 if (settings_.use_aec) {
255 RTC_CHECK_EQ(AudioProcessing::kNoError, 259 RTC_CHECK_EQ(AudioProcessing::kNoError,
256 ap_->echo_cancellation()->Enable(*settings_.use_aec)); 260 ap_->echo_cancellation()->Enable(*settings_.use_aec));
257 } 261 }
258 if (settings_.use_aecm) { 262 if (settings_.use_aecm) {
259 RTC_CHECK_EQ(AudioProcessing::kNoError, 263 RTC_CHECK_EQ(AudioProcessing::kNoError,
260 ap_->echo_control_mobile()->Enable(*settings_.use_aecm)); 264 ap_->echo_control_mobile()->Enable(*settings_.use_aecm));
261 } 265 }
262 if (settings_.use_agc) { 266 if (settings_.use_agc) {
263 RTC_CHECK_EQ(AudioProcessing::kNoError, 267 RTC_CHECK_EQ(AudioProcessing::kNoError,
264 ap_->gain_control()->Enable(*settings_.use_agc)); 268 ap_->gain_control()->Enable(*settings_.use_agc));
265 } 269 }
266 if (settings_.use_hpf) {
267 RTC_CHECK_EQ(AudioProcessing::kNoError,
268 ap_->high_pass_filter()->Enable(*settings_.use_hpf));
269 }
270 if (settings_.use_ns) { 270 if (settings_.use_ns) {
271 RTC_CHECK_EQ(AudioProcessing::kNoError, 271 RTC_CHECK_EQ(AudioProcessing::kNoError,
272 ap_->noise_suppression()->Enable(*settings_.use_ns)); 272 ap_->noise_suppression()->Enable(*settings_.use_ns));
273 } 273 }
274 if (settings_.use_le) { 274 if (settings_.use_le) {
275 RTC_CHECK_EQ(AudioProcessing::kNoError, 275 RTC_CHECK_EQ(AudioProcessing::kNoError,
276 ap_->level_estimator()->Enable(*settings_.use_le)); 276 ap_->level_estimator()->Enable(*settings_.use_le));
277 } 277 }
278 if (settings_.use_vad) { 278 if (settings_.use_vad) {
279 RTC_CHECK_EQ(AudioProcessing::kNoError, 279 RTC_CHECK_EQ(AudioProcessing::kNoError,
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 size_t kMaxFilenameSize = AudioProcessing::kMaxFilenameSize; 343 size_t kMaxFilenameSize = AudioProcessing::kMaxFilenameSize;
344 RTC_CHECK_LE(settings_.aec_dump_output_filename->size(), kMaxFilenameSize); 344 RTC_CHECK_LE(settings_.aec_dump_output_filename->size(), kMaxFilenameSize);
345 RTC_CHECK_EQ(AudioProcessing::kNoError, 345 RTC_CHECK_EQ(AudioProcessing::kNoError,
346 ap_->StartDebugRecording( 346 ap_->StartDebugRecording(
347 settings_.aec_dump_output_filename->c_str(), -1)); 347 settings_.aec_dump_output_filename->c_str(), -1));
348 } 348 }
349 } 349 }
350 350
351 } // namespace test 351 } // namespace test
352 } // namespace webrtc 352 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698