| OLD | NEW |
| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 for (size_t sample = 0; sample < dest->samples_per_channel_; ++sample) { | 72 for (size_t sample = 0; sample < dest->samples_per_channel_; ++sample) { |
| 73 dest->data_[sample * dest->num_channels_ + ch] = | 73 dest->data_[sample * dest->num_channels_ + ch] = |
| 74 src.channels()[ch][sample] * 32767; | 74 src.channels()[ch][sample] * 32767; |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 | 78 |
| 79 AudioProcessingSimulator::AudioProcessingSimulator( | 79 AudioProcessingSimulator::AudioProcessingSimulator( |
| 80 const SimulationSettings& settings) | 80 const SimulationSettings& settings) |
| 81 : settings_(settings) { | 81 : settings_(settings) { |
| 82 if (settings_.red_graph_output_filename && | 82 if (settings_.ed_graph_output_filename && |
| 83 settings_.red_graph_output_filename->size() > 0) { | 83 settings_.ed_graph_output_filename->size() > 0) { |
| 84 residual_echo_likelihood_graph_writer_.open( | 84 residual_echo_likelihood_graph_writer_.open( |
| 85 *settings_.red_graph_output_filename); | 85 *settings_.ed_graph_output_filename); |
| 86 RTC_CHECK(residual_echo_likelihood_graph_writer_.is_open()); | 86 RTC_CHECK(residual_echo_likelihood_graph_writer_.is_open()); |
| 87 WriteEchoLikelihoodGraphFileHeader(&residual_echo_likelihood_graph_writer_); | 87 WriteEchoLikelihoodGraphFileHeader(&residual_echo_likelihood_graph_writer_); |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 AudioProcessingSimulator::~AudioProcessingSimulator() { | 91 AudioProcessingSimulator::~AudioProcessingSimulator() { |
| 92 if (residual_echo_likelihood_graph_writer_.is_open()) { | 92 if (residual_echo_likelihood_graph_writer_.is_open()) { |
| 93 WriteEchoLikelihoodGraphFileFooter(&residual_echo_likelihood_graph_writer_); | 93 WriteEchoLikelihoodGraphFileFooter(&residual_echo_likelihood_graph_writer_); |
| 94 residual_echo_likelihood_graph_writer_.close(); | 94 residual_echo_likelihood_graph_writer_.close(); |
| 95 } | 95 } |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 apm_config.level_controller.enabled = *settings_.use_lc; | 274 apm_config.level_controller.enabled = *settings_.use_lc; |
| 275 } | 275 } |
| 276 if (settings_.use_refined_adaptive_filter) { | 276 if (settings_.use_refined_adaptive_filter) { |
| 277 config.Set<RefinedAdaptiveFilter>( | 277 config.Set<RefinedAdaptiveFilter>( |
| 278 new RefinedAdaptiveFilter(*settings_.use_refined_adaptive_filter)); | 278 new RefinedAdaptiveFilter(*settings_.use_refined_adaptive_filter)); |
| 279 } | 279 } |
| 280 config.Set<ExtendedFilter>(new ExtendedFilter( | 280 config.Set<ExtendedFilter>(new ExtendedFilter( |
| 281 !settings_.use_extended_filter || *settings_.use_extended_filter)); | 281 !settings_.use_extended_filter || *settings_.use_extended_filter)); |
| 282 config.Set<DelayAgnostic>(new DelayAgnostic(!settings_.use_delay_agnostic || | 282 config.Set<DelayAgnostic>(new DelayAgnostic(!settings_.use_delay_agnostic || |
| 283 *settings_.use_delay_agnostic)); | 283 *settings_.use_delay_agnostic)); |
| 284 if (settings_.use_red) { | 284 if (settings_.use_ed) { |
| 285 apm_config.residual_echo_detector.enabled = *settings_.use_red; | 285 apm_config.residual_echo_detector.enabled = *settings_.use_ed; |
| 286 } | 286 } |
| 287 | 287 |
| 288 ap_.reset(AudioProcessing::Create(config)); | 288 ap_.reset(AudioProcessing::Create(config)); |
| 289 RTC_CHECK(ap_); | 289 RTC_CHECK(ap_); |
| 290 | 290 |
| 291 ap_->ApplyConfig(apm_config); | 291 ap_->ApplyConfig(apm_config); |
| 292 | 292 |
| 293 if (settings_.use_aec) { | 293 if (settings_.use_aec) { |
| 294 RTC_CHECK_EQ(AudioProcessing::kNoError, | 294 RTC_CHECK_EQ(AudioProcessing::kNoError, |
| 295 ap_->echo_cancellation()->Enable(*settings_.use_aec)); | 295 ap_->echo_cancellation()->Enable(*settings_.use_aec)); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 size_t kMaxFilenameSize = AudioProcessing::kMaxFilenameSize; | 382 size_t kMaxFilenameSize = AudioProcessing::kMaxFilenameSize; |
| 383 RTC_CHECK_LE(settings_.aec_dump_output_filename->size(), kMaxFilenameSize); | 383 RTC_CHECK_LE(settings_.aec_dump_output_filename->size(), kMaxFilenameSize); |
| 384 RTC_CHECK_EQ(AudioProcessing::kNoError, | 384 RTC_CHECK_EQ(AudioProcessing::kNoError, |
| 385 ap_->StartDebugRecording( | 385 ap_->StartDebugRecording( |
| 386 settings_.aec_dump_output_filename->c_str(), -1)); | 386 settings_.aec_dump_output_filename->c_str(), -1)); |
| 387 } | 387 } |
| 388 } | 388 } |
| 389 | 389 |
| 390 } // namespace test | 390 } // namespace test |
| 391 } // namespace webrtc | 391 } // namespace webrtc |
| OLD | NEW |