| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 return apm_->kNoError; | 78 return apm_->kNoError; |
| 79 } | 79 } |
| 80 | 80 |
| 81 assert(audio->num_frames_per_band() <= 160); | 81 assert(audio->num_frames_per_band() <= 160); |
| 82 assert(audio->num_channels() == apm_->num_reverse_channels()); | 82 assert(audio->num_channels() == apm_->num_reverse_channels()); |
| 83 | 83 |
| 84 int err = apm_->kNoError; | 84 int err = apm_->kNoError; |
| 85 | 85 |
| 86 // The ordering convention must be followed to pass to the correct AEC. | 86 // The ordering convention must be followed to pass to the correct AEC. |
| 87 size_t handle_index = 0; | 87 size_t handle_index = 0; |
| 88 for (int i = 0; i < apm_->num_output_channels(); i++) { | 88 for (size_t i = 0; i < apm_->num_output_channels(); i++) { |
| 89 for (int j = 0; j < audio->num_channels(); j++) { | 89 for (size_t j = 0; j < audio->num_channels(); j++) { |
| 90 Handle* my_handle = static_cast<Handle*>(handle(handle_index)); | 90 Handle* my_handle = static_cast<Handle*>(handle(handle_index)); |
| 91 err = WebRtcAec_BufferFarend( | 91 err = WebRtcAec_BufferFarend( |
| 92 my_handle, | 92 my_handle, |
| 93 audio->split_bands_const_f(j)[kBand0To8kHz], | 93 audio->split_bands_const_f(j)[kBand0To8kHz], |
| 94 audio->num_frames_per_band()); | 94 audio->num_frames_per_band()); |
| 95 | 95 |
| 96 if (err != apm_->kNoError) { | 96 if (err != apm_->kNoError) { |
| 97 return GetHandleError(my_handle); // TODO(ajm): warning possible? | 97 return GetHandleError(my_handle); // TODO(ajm): warning possible? |
| 98 } | 98 } |
| 99 | 99 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 118 } | 118 } |
| 119 | 119 |
| 120 assert(audio->num_frames_per_band() <= 160); | 120 assert(audio->num_frames_per_band() <= 160); |
| 121 assert(audio->num_channels() == apm_->num_output_channels()); | 121 assert(audio->num_channels() == apm_->num_output_channels()); |
| 122 | 122 |
| 123 int err = apm_->kNoError; | 123 int err = apm_->kNoError; |
| 124 | 124 |
| 125 // The ordering convention must be followed to pass to the correct AEC. | 125 // The ordering convention must be followed to pass to the correct AEC. |
| 126 size_t handle_index = 0; | 126 size_t handle_index = 0; |
| 127 stream_has_echo_ = false; | 127 stream_has_echo_ = false; |
| 128 for (int i = 0; i < audio->num_channels(); i++) { | 128 for (size_t i = 0; i < audio->num_channels(); i++) { |
| 129 for (int j = 0; j < apm_->num_reverse_channels(); j++) { | 129 for (size_t j = 0; j < apm_->num_reverse_channels(); j++) { |
| 130 Handle* my_handle = handle(handle_index); | 130 Handle* my_handle = handle(handle_index); |
| 131 err = WebRtcAec_Process( | 131 err = WebRtcAec_Process( |
| 132 my_handle, | 132 my_handle, |
| 133 audio->split_bands_const_f(i), | 133 audio->split_bands_const_f(i), |
| 134 audio->num_bands(), | 134 audio->num_bands(), |
| 135 audio->split_bands_f(i), | 135 audio->split_bands_f(i), |
| 136 audio->num_frames_per_band(), | 136 audio->num_frames_per_band(), |
| 137 apm_->stream_delay_ms(), | 137 apm_->stream_delay_ms(), |
| 138 stream_drift_samples_); | 138 stream_drift_samples_); |
| 139 | 139 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 362 |
| 363 WebRtcAec_enable_extended_filter( | 363 WebRtcAec_enable_extended_filter( |
| 364 WebRtcAec_aec_core(static_cast<Handle*>(handle)), | 364 WebRtcAec_aec_core(static_cast<Handle*>(handle)), |
| 365 extended_filter_enabled_ ? 1 : 0); | 365 extended_filter_enabled_ ? 1 : 0); |
| 366 WebRtcAec_enable_delay_agnostic( | 366 WebRtcAec_enable_delay_agnostic( |
| 367 WebRtcAec_aec_core(static_cast<Handle*>(handle)), | 367 WebRtcAec_aec_core(static_cast<Handle*>(handle)), |
| 368 delay_agnostic_enabled_ ? 1 : 0); | 368 delay_agnostic_enabled_ ? 1 : 0); |
| 369 return WebRtcAec_set_config(static_cast<Handle*>(handle), config); | 369 return WebRtcAec_set_config(static_cast<Handle*>(handle), config); |
| 370 } | 370 } |
| 371 | 371 |
| 372 int EchoCancellationImpl::num_handles_required() const { | 372 size_t EchoCancellationImpl::num_handles_required() const { |
| 373 return apm_->num_output_channels() * | 373 return apm_->num_output_channels() * |
| 374 apm_->num_reverse_channels(); | 374 apm_->num_reverse_channels(); |
| 375 } | 375 } |
| 376 | 376 |
| 377 int EchoCancellationImpl::GetHandleError(void* handle) const { | 377 int EchoCancellationImpl::GetHandleError(void* handle) const { |
| 378 assert(handle != NULL); | 378 assert(handle != NULL); |
| 379 return MapError(WebRtcAec_get_error_code(static_cast<Handle*>(handle))); | 379 return MapError(WebRtcAec_get_error_code(static_cast<Handle*>(handle))); |
| 380 } | 380 } |
| 381 } // namespace webrtc | 381 } // namespace webrtc |
| OLD | NEW |