| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 int err = apm_->kNoError; | 89 int err = apm_->kNoError; |
| 90 | 90 |
| 91 // The ordering convention must be followed to pass to the correct AECM. | 91 // The ordering convention must be followed to pass to the correct AECM. |
| 92 size_t handle_index = 0; | 92 size_t handle_index = 0; |
| 93 for (int i = 0; i < apm_->num_output_channels(); i++) { | 93 for (int i = 0; i < apm_->num_output_channels(); i++) { |
| 94 for (int j = 0; j < audio->num_channels(); j++) { | 94 for (int j = 0; j < audio->num_channels(); j++) { |
| 95 Handle* my_handle = static_cast<Handle*>(handle(handle_index)); | 95 Handle* my_handle = static_cast<Handle*>(handle(handle_index)); |
| 96 err = WebRtcAecm_BufferFarend( | 96 err = WebRtcAecm_BufferFarend( |
| 97 my_handle, | 97 my_handle, |
| 98 audio->split_bands_const(j)[kBand0To8kHz], | 98 audio->split_bands_const(j)[kBand0To8kHz], |
| 99 static_cast<int16_t>(audio->num_frames_per_band())); | 99 audio->num_frames_per_band()); |
| 100 | 100 |
| 101 if (err != apm_->kNoError) { | 101 if (err != apm_->kNoError) { |
| 102 return GetHandleError(my_handle); // TODO(ajm): warning possible? | 102 return GetHandleError(my_handle); // TODO(ajm): warning possible? |
| 103 } | 103 } |
| 104 | 104 |
| 105 handle_index++; | 105 handle_index++; |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 return apm_->kNoError; | 109 return apm_->kNoError; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 134 noisy = clean; | 134 noisy = clean; |
| 135 clean = NULL; | 135 clean = NULL; |
| 136 } | 136 } |
| 137 for (int j = 0; j < apm_->num_reverse_channels(); j++) { | 137 for (int j = 0; j < apm_->num_reverse_channels(); j++) { |
| 138 Handle* my_handle = static_cast<Handle*>(handle(handle_index)); | 138 Handle* my_handle = static_cast<Handle*>(handle(handle_index)); |
| 139 err = WebRtcAecm_Process( | 139 err = WebRtcAecm_Process( |
| 140 my_handle, | 140 my_handle, |
| 141 noisy, | 141 noisy, |
| 142 clean, | 142 clean, |
| 143 audio->split_bands(i)[kBand0To8kHz], | 143 audio->split_bands(i)[kBand0To8kHz], |
| 144 static_cast<int16_t>(audio->num_frames_per_band()), | 144 audio->num_frames_per_band(), |
| 145 apm_->stream_delay_ms()); | 145 apm_->stream_delay_ms()); |
| 146 | 146 |
| 147 if (err != apm_->kNoError) { | 147 if (err != apm_->kNoError) { |
| 148 return GetHandleError(my_handle); // TODO(ajm): warning possible? | 148 return GetHandleError(my_handle); // TODO(ajm): warning possible? |
| 149 } | 149 } |
| 150 | 150 |
| 151 handle_index++; | 151 handle_index++; |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 | 154 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 int EchoControlMobileImpl::num_handles_required() const { | 285 int EchoControlMobileImpl::num_handles_required() const { |
| 286 return apm_->num_output_channels() * | 286 return apm_->num_output_channels() * |
| 287 apm_->num_reverse_channels(); | 287 apm_->num_reverse_channels(); |
| 288 } | 288 } |
| 289 | 289 |
| 290 int EchoControlMobileImpl::GetHandleError(void* handle) const { | 290 int EchoControlMobileImpl::GetHandleError(void* handle) const { |
| 291 assert(handle != NULL); | 291 assert(handle != NULL); |
| 292 return MapError(WebRtcAecm_get_error_code(static_cast<Handle*>(handle))); | 292 return MapError(WebRtcAecm_get_error_code(static_cast<Handle*>(handle))); |
| 293 } | 293 } |
| 294 } // namespace webrtc | 294 } // namespace webrtc |
| OLD | NEW |