OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // TODO(dalecurtis): Once Chrome moves to an SSE baseline this can be removed. | 129 // TODO(dalecurtis): Once Chrome moves to an SSE baseline this can be removed. |
130 #define CONVOLVE_FUNC convolve_proc_ | 130 #define CONVOLVE_FUNC convolve_proc_ |
131 | 131 |
132 void SincResampler::InitializeCPUSpecificFeatures() { | 132 void SincResampler::InitializeCPUSpecificFeatures() { |
133 convolve_proc_ = WebRtc_GetCPUInfo(kSSE2) ? Convolve_SSE : Convolve_C; | 133 convolve_proc_ = WebRtc_GetCPUInfo(kSSE2) ? Convolve_SSE : Convolve_C; |
134 } | 134 } |
135 #endif | 135 #endif |
136 #elif defined(WEBRTC_HAS_NEON) | 136 #elif defined(WEBRTC_HAS_NEON) |
137 #define CONVOLVE_FUNC Convolve_NEON | 137 #define CONVOLVE_FUNC Convolve_NEON |
138 void SincResampler::InitializeCPUSpecificFeatures() {} | 138 void SincResampler::InitializeCPUSpecificFeatures() {} |
139 #elif defined(WEBRTC_DETECT_NEON) | |
140 #define CONVOLVE_FUNC convolve_proc_ | |
141 void SincResampler::InitializeCPUSpecificFeatures() { | |
142 convolve_proc_ = WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON ? | |
143 Convolve_NEON : Convolve_C; | |
144 } | |
145 #else | 139 #else |
146 // Unknown architecture. | 140 // Unknown architecture. |
147 #define CONVOLVE_FUNC Convolve_C | 141 #define CONVOLVE_FUNC Convolve_C |
148 void SincResampler::InitializeCPUSpecificFeatures() {} | 142 void SincResampler::InitializeCPUSpecificFeatures() {} |
149 #endif | 143 #endif |
150 | 144 |
151 SincResampler::SincResampler(double io_sample_rate_ratio, | 145 SincResampler::SincResampler(double io_sample_rate_ratio, |
152 size_t request_frames, | 146 size_t request_frames, |
153 SincResamplerCallback* read_cb) | 147 SincResamplerCallback* read_cb) |
154 : io_sample_rate_ratio_(io_sample_rate_ratio), | 148 : io_sample_rate_ratio_(io_sample_rate_ratio), |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 sum1 += *input_ptr * *k1++; | 363 sum1 += *input_ptr * *k1++; |
370 sum2 += *input_ptr++ * *k2++; | 364 sum2 += *input_ptr++ * *k2++; |
371 } | 365 } |
372 | 366 |
373 // Linearly interpolate the two "convolutions". | 367 // Linearly interpolate the two "convolutions". |
374 return static_cast<float>((1.0 - kernel_interpolation_factor) * sum1 + | 368 return static_cast<float>((1.0 - kernel_interpolation_factor) * sum1 + |
375 kernel_interpolation_factor * sum2); | 369 kernel_interpolation_factor * sum2); |
376 } | 370 } |
377 | 371 |
378 } // namespace webrtc | 372 } // namespace webrtc |
OLD | NEW |