| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // | 122 // |
| 123 // Note: The precision did not improve after 2 iterations. | 123 // Note: The precision did not improve after 2 iterations. |
| 124 for (i = 0; i < 2; i++) { | 124 for (i = 0; i < 2; i++) { |
| 125 x = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x, x), s), x); | 125 x = vmulq_f32(vrsqrtsq_f32(vmulq_f32(x, x), s), x); |
| 126 } | 126 } |
| 127 // sqrt(s) = s * 1/sqrt(s) | 127 // sqrt(s) = s * 1/sqrt(s) |
| 128 return vmulq_f32(s, x); | 128 return vmulq_f32(s, x); |
| 129 } | 129 } |
| 130 #endif // WEBRTC_ARCH_ARM64 | 130 #endif // WEBRTC_ARCH_ARM64 |
| 131 | 131 |
| 132 static void ScaleErrorSignalNEON(int extended_filter_enabled, | 132 static void ScaleErrorSignalNEON(float mu, |
| 133 float normal_mu, | 133 float error_threshold, |
| 134 float normal_error_threshold, | |
| 135 float x_pow[PART_LEN1], | 134 float x_pow[PART_LEN1], |
| 136 float ef[2][PART_LEN1]) { | 135 float ef[2][PART_LEN1]) { |
| 137 const float mu = extended_filter_enabled ? kExtendedMu : normal_mu; | |
| 138 const float error_threshold = extended_filter_enabled | |
| 139 ? kExtendedErrorThreshold | |
| 140 : normal_error_threshold; | |
| 141 const float32x4_t k1e_10f = vdupq_n_f32(1e-10f); | 136 const float32x4_t k1e_10f = vdupq_n_f32(1e-10f); |
| 142 const float32x4_t kMu = vmovq_n_f32(mu); | 137 const float32x4_t kMu = vmovq_n_f32(mu); |
| 143 const float32x4_t kThresh = vmovq_n_f32(error_threshold); | 138 const float32x4_t kThresh = vmovq_n_f32(error_threshold); |
| 144 int i; | 139 int i; |
| 145 // vectorized code (four at once) | 140 // vectorized code (four at once) |
| 146 for (i = 0; i + 3 < PART_LEN1; i += 4) { | 141 for (i = 0; i + 3 < PART_LEN1; i += 4) { |
| 147 const float32x4_t x_pow_local = vld1q_f32(&x_pow[i]); | 142 const float32x4_t x_pow_local = vld1q_f32(&x_pow[i]); |
| 148 const float32x4_t ef_re_base = vld1q_f32(&ef[0][i]); | 143 const float32x4_t ef_re_base = vld1q_f32(&ef[0][i]); |
| 149 const float32x4_t ef_im_base = vld1q_f32(&ef[1][i]); | 144 const float32x4_t ef_im_base = vld1q_f32(&ef[1][i]); |
| 150 const float32x4_t xPowPlus = vaddq_f32(x_pow_local, k1e_10f); | 145 const float32x4_t xPowPlus = vaddq_f32(x_pow_local, k1e_10f); |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 WebRtcAec_FilterFar = FilterFarNEON; | 719 WebRtcAec_FilterFar = FilterFarNEON; |
| 725 WebRtcAec_ScaleErrorSignal = ScaleErrorSignalNEON; | 720 WebRtcAec_ScaleErrorSignal = ScaleErrorSignalNEON; |
| 726 WebRtcAec_FilterAdaptation = FilterAdaptationNEON; | 721 WebRtcAec_FilterAdaptation = FilterAdaptationNEON; |
| 727 WebRtcAec_OverdriveAndSuppress = OverdriveAndSuppressNEON; | 722 WebRtcAec_OverdriveAndSuppress = OverdriveAndSuppressNEON; |
| 728 WebRtcAec_SubbandCoherence = SubbandCoherenceNEON; | 723 WebRtcAec_SubbandCoherence = SubbandCoherenceNEON; |
| 729 WebRtcAec_StoreAsComplex = StoreAsComplexNEON; | 724 WebRtcAec_StoreAsComplex = StoreAsComplexNEON; |
| 730 WebRtcAec_PartitionDelay = PartitionDelayNEON; | 725 WebRtcAec_PartitionDelay = PartitionDelayNEON; |
| 731 WebRtcAec_WindowData = WindowDataNEON; | 726 WebRtcAec_WindowData = WindowDataNEON; |
| 732 } | 727 } |
| 733 } // namespace webrtc | 728 } // namespace webrtc |
| OLD | NEW |