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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 #define _USE_MATH_DEFINES | 86 #define _USE_MATH_DEFINES |
87 | 87 |
88 #include "webrtc/common_audio/resampler/sinc_resampler.h" | 88 #include "webrtc/common_audio/resampler/sinc_resampler.h" |
89 | 89 |
90 #include <assert.h> | 90 #include <assert.h> |
91 #include <math.h> | 91 #include <math.h> |
92 #include <string.h> | 92 #include <string.h> |
93 | 93 |
94 #include <limits> | 94 #include <limits> |
95 | 95 |
96 #include "webrtc/system_wrappers/interface/cpu_features_wrapper.h" | 96 #include "webrtc/system_wrappers/include/cpu_features_wrapper.h" |
97 #include "webrtc/typedefs.h" | 97 #include "webrtc/typedefs.h" |
98 | 98 |
99 namespace webrtc { | 99 namespace webrtc { |
100 | 100 |
101 namespace { | 101 namespace { |
102 | 102 |
103 double SincScaleFactor(double io_ratio) { | 103 double SincScaleFactor(double io_ratio) { |
104 // |sinc_scale_factor| is basically the normalized cutoff frequency of the | 104 // |sinc_scale_factor| is basically the normalized cutoff frequency of the |
105 // low-pass filter. | 105 // low-pass filter. |
106 double sinc_scale_factor = io_ratio > 1.0 ? 1.0 / io_ratio : 1.0; | 106 double sinc_scale_factor = io_ratio > 1.0 ? 1.0 / io_ratio : 1.0; |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 sum1 += *input_ptr * *k1++; | 369 sum1 += *input_ptr * *k1++; |
370 sum2 += *input_ptr++ * *k2++; | 370 sum2 += *input_ptr++ * *k2++; |
371 } | 371 } |
372 | 372 |
373 // Linearly interpolate the two "convolutions". | 373 // Linearly interpolate the two "convolutions". |
374 return static_cast<float>((1.0 - kernel_interpolation_factor) * sum1 + | 374 return static_cast<float>((1.0 - kernel_interpolation_factor) * sum1 + |
375 kernel_interpolation_factor * sum2); | 375 kernel_interpolation_factor * sum2); |
376 } | 376 } |
377 | 377 |
378 } // namespace webrtc | 378 } // namespace webrtc |
OLD | NEW |