| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 |
| 11 #include "webrtc/modules/audio_processing/aec3/output_selector.h" | 11 #include "webrtc/modules/audio_processing/aec3/output_selector.h" |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 #include <numeric> | 14 #include <numeric> |
| 15 | 15 |
| 16 #include "webrtc/rtc_base/checks.h" | 16 #include "webrtc/base/checks.h" |
| 17 | 17 |
| 18 namespace webrtc { | 18 namespace webrtc { |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // Performs the transition between the signals in a smooth manner. | 21 // Performs the transition between the signals in a smooth manner. |
| 22 void SmoothFrameTransition(bool from_y_to_e, | 22 void SmoothFrameTransition(bool from_y_to_e, |
| 23 rtc::ArrayView<const float> e, | 23 rtc::ArrayView<const float> e, |
| 24 rtc::ArrayView<float> y) { | 24 rtc::ArrayView<float> y) { |
| 25 RTC_DCHECK_LT(0u, e.size()); | 25 RTC_DCHECK_LT(0u, e.size()); |
| 26 RTC_DCHECK_EQ(y.size(), e.size()); | 26 RTC_DCHECK_EQ(y.size(), e.size()); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 50 | 50 |
| 51 if (use_subtractor_output != use_subtractor_output_) { | 51 if (use_subtractor_output != use_subtractor_output_) { |
| 52 use_subtractor_output_ = use_subtractor_output; | 52 use_subtractor_output_ = use_subtractor_output; |
| 53 SmoothFrameTransition(use_subtractor_output_, e_main, y); | 53 SmoothFrameTransition(use_subtractor_output_, e_main, y); |
| 54 } else if (use_subtractor_output_) { | 54 } else if (use_subtractor_output_) { |
| 55 std::copy(e_main.begin(), e_main.end(), y.begin()); | 55 std::copy(e_main.begin(), e_main.end(), y.begin()); |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 } // namespace webrtc | 59 } // namespace webrtc |
| OLD | NEW |