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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 if (WebRtc_GetCPUInfo(kSSE2)) { | 54 if (WebRtc_GetCPUInfo(kSSE2)) { |
55 filter = | 55 filter = |
56 new FIRFilterSSE2(coefficients, coefficients_length, max_input_length); | 56 new FIRFilterSSE2(coefficients, coefficients_length, max_input_length); |
57 } else { | 57 } else { |
58 filter = new FIRFilterC(coefficients, coefficients_length); | 58 filter = new FIRFilterC(coefficients, coefficients_length); |
59 } | 59 } |
60 #endif | 60 #endif |
61 #elif defined(WEBRTC_HAS_NEON) | 61 #elif defined(WEBRTC_HAS_NEON) |
62 filter = | 62 filter = |
63 new FIRFilterNEON(coefficients, coefficients_length, max_input_length); | 63 new FIRFilterNEON(coefficients, coefficients_length, max_input_length); |
64 #elif defined(WEBRTC_DETECT_NEON) | |
65 if (WebRtc_GetCPUFeaturesARM() & kCPUFeatureNEON) { | |
66 filter = | |
67 new FIRFilterNEON(coefficients, coefficients_length, max_input_length); | |
68 } else { | |
69 filter = new FIRFilterC(coefficients, coefficients_length); | |
70 } | |
71 #else | 64 #else |
72 filter = new FIRFilterC(coefficients, coefficients_length); | 65 filter = new FIRFilterC(coefficients, coefficients_length); |
73 #endif | 66 #endif |
74 | 67 |
75 return filter; | 68 return filter; |
76 } | 69 } |
77 | 70 |
78 FIRFilterC::FIRFilterC(const float* coefficients, size_t coefficients_length) | 71 FIRFilterC::FIRFilterC(const float* coefficients, size_t coefficients_length) |
79 : coefficients_length_(coefficients_length), | 72 : coefficients_length_(coefficients_length), |
80 state_length_(coefficients_length - 1), | 73 state_length_(coefficients_length - 1), |
(...skipping 27 matching lines...) Expand all Loading... |
108 state_.get(), &in[length - state_length_], state_length_ * sizeof(*in)); | 101 state_.get(), &in[length - state_length_], state_length_ * sizeof(*in)); |
109 } else { | 102 } else { |
110 memmove(state_.get(), | 103 memmove(state_.get(), |
111 &state_[length], | 104 &state_[length], |
112 (state_length_ - length) * sizeof(state_[0])); | 105 (state_length_ - length) * sizeof(state_[0])); |
113 memcpy(&state_[state_length_ - length], in, length * sizeof(*in)); | 106 memcpy(&state_[state_length_ - length], in, length * sizeof(*in)); |
114 } | 107 } |
115 } | 108 } |
116 | 109 |
117 } // namespace webrtc | 110 } // namespace webrtc |
OLD | NEW |