Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Side by Side Diff: webrtc/common_audio/fir_filter.cc

Issue 1955413003: Remove runtime NEON detection (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: gyp syntax Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/build/webrtc.gni ('k') | webrtc/common_audio/resampler/sinc_resampler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webrtc/build/webrtc.gni ('k') | webrtc/common_audio/resampler/sinc_resampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698