kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 1 | # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 2 | # |
| 3 | # Use of this source code is governed by a BSD-style license |
| 4 | # that can be found in the LICENSE file in the root of the source |
| 5 | # tree. An additional intellectual property rights grant can be found |
| 6 | # in the file PATENTS. All contributing project authors may |
| 7 | # be found in the AUTHORS file in the root of the source tree. |
| 8 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 9 | import("../webrtc.gni") |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 10 | |
Karl Wiberg | 1a8fffb | 2017-12-12 10:41:29 +0100 | [diff] [blame] | 11 | visibility = [ ":*" ] |
| 12 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 13 | rtc_library("common_audio") { |
Karl Wiberg | 1a8fffb | 2017-12-12 10:41:29 +0100 | [diff] [blame] | 14 | visibility += [ "*" ] |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 15 | sources = [ |
andrew@webrtc.org | aada86b | 2014-10-27 18:18:17 +0000 | [diff] [blame] | 16 | "audio_converter.cc", |
| 17 | "audio_converter.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 18 | "audio_util.cc", |
andrew@webrtc.org | 04c5098 | 2015-03-19 20:06:29 +0000 | [diff] [blame] | 19 | "channel_buffer.cc", |
| 20 | "channel_buffer.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 21 | "include/audio_util.h", |
andrew@webrtc.org | 04c5098 | 2015-03-19 20:06:29 +0000 | [diff] [blame] | 22 | "real_fourier.cc", |
| 23 | "real_fourier.h", |
| 24 | "real_fourier_ooura.cc", |
| 25 | "real_fourier_ooura.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 26 | "resampler/include/push_resampler.h", |
| 27 | "resampler/include/resampler.h", |
| 28 | "resampler/push_resampler.cc", |
| 29 | "resampler/push_sinc_resampler.cc", |
| 30 | "resampler/push_sinc_resampler.h", |
| 31 | "resampler/resampler.cc", |
| 32 | "resampler/sinc_resampler.cc", |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 33 | "smoothing_filter.cc", |
| 34 | "smoothing_filter.h", |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 35 | "vad/include/vad.h", |
| 36 | "vad/vad.cc", |
| 37 | "wav_file.cc", |
| 38 | "wav_file.h", |
| 39 | "wav_header.cc", |
| 40 | "wav_header.h", |
| 41 | "window_generator.cc", |
| 42 | "window_generator.h", |
| 43 | ] |
| 44 | |
| 45 | deps = [ |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 46 | ":common_audio_c", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 47 | ":sinc_resampler", |
Per Åhgren | 1883d3e | 2020-02-21 13:31:07 +0100 | [diff] [blame] | 48 | "../api:array_view", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 49 | "../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 50 | "../rtc_base:gtest_prod", |
| 51 | "../rtc_base:rtc_base_approved", |
Alessio Bazzica | a33c7af | 2018-11-08 12:16:11 +0100 | [diff] [blame] | 52 | "../rtc_base:sanitizer", |
Karl Wiberg | 29e7bee | 2018-03-22 14:11:52 +0100 | [diff] [blame] | 53 | "../rtc_base/memory:aligned_malloc", |
Niels Möller | a12c42a | 2018-07-25 16:05:48 +0200 | [diff] [blame] | 54 | "../rtc_base/system:arch", |
Niels Möller | 19a1d50 | 2019-06-13 14:08:24 +0200 | [diff] [blame] | 55 | "../rtc_base/system:file_wrapper", |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 56 | "../system_wrappers", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 57 | "../system_wrappers:cpu_features_api", |
Mirko Bonadei | 146137a | 2020-04-21 09:56:16 +0200 | [diff] [blame] | 58 | "third_party/ooura:fft_size_256", |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 59 | ] |
Mirko Bonadei | 2dcf348 | 2020-06-05 14:30:41 +0200 | [diff] [blame] | 60 | absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 61 | |
| 62 | defines = [] |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 63 | |
| 64 | if (rtc_build_with_neon) { |
| 65 | deps += [ ":common_audio_neon" ] |
| 66 | } |
| 67 | |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 68 | if (current_cpu == "x86" || current_cpu == "x64") { |
| 69 | deps += [ ":common_audio_sse2" ] |
| 70 | } |
| 71 | } |
| 72 | |
charujain | 9a45116 | 2017-09-15 03:51:34 -0700 | [diff] [blame] | 73 | rtc_source_set("mock_common_audio") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 74 | visibility += webrtc_default_visibility |
charujain | 9a45116 | 2017-09-15 03:51:34 -0700 | [diff] [blame] | 75 | testonly = true |
| 76 | sources = [ |
| 77 | "mocks/mock_smoothing_filter.h", |
| 78 | "vad/mock/mock_vad.h", |
| 79 | ] |
| 80 | deps = [ |
| 81 | ":common_audio", |
| 82 | "../test:test_support", |
| 83 | ] |
| 84 | } |
| 85 | |
mbonadei | d66072b | 2017-07-06 07:44:14 -0700 | [diff] [blame] | 86 | rtc_source_set("common_audio_c_arm_asm") { |
mbonadei | d66072b | 2017-07-06 07:44:14 -0700 | [diff] [blame] | 87 | sources = [] |
Mirko Bonadei | 6ce0359 | 2018-02-22 15:10:27 +0100 | [diff] [blame] | 88 | deps = [] |
mbonadei | d66072b | 2017-07-06 07:44:14 -0700 | [diff] [blame] | 89 | if (current_cpu == "arm") { |
Artem Titov | 2983599 | 2018-08-07 11:50:54 +0200 | [diff] [blame] | 90 | sources += [ "signal_processing/complex_bit_reverse_arm.S" ] |
mbonadei | d66072b | 2017-07-06 07:44:14 -0700 | [diff] [blame] | 91 | |
| 92 | if (arm_version >= 7) { |
| 93 | sources += [ "signal_processing/filter_ar_fast_q12_armv7.S" ] |
| 94 | } else { |
| 95 | sources += [ "signal_processing/filter_ar_fast_q12.c" ] |
| 96 | } |
Karl Wiberg | 7aabd39 | 2018-03-22 02:59:49 +0100 | [diff] [blame] | 97 | deps += [ "../rtc_base/system:asm_defines" ] |
mbonadei | d66072b | 2017-07-06 07:44:14 -0700 | [diff] [blame] | 98 | } |
| 99 | } |
| 100 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 101 | rtc_library("common_audio_c") { |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 102 | visibility += webrtc_default_visibility |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 103 | sources = [ |
peah | faed4ab | 2016-04-05 14:57:48 -0700 | [diff] [blame] | 104 | "ring_buffer.c", |
| 105 | "ring_buffer.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 106 | "signal_processing/auto_corr_to_refl_coef.c", |
| 107 | "signal_processing/auto_correlation.c", |
| 108 | "signal_processing/complex_fft_tables.h", |
| 109 | "signal_processing/copy_set_operations.c", |
| 110 | "signal_processing/cross_correlation.c", |
| 111 | "signal_processing/division_operations.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 112 | "signal_processing/downsample_fast.c", |
| 113 | "signal_processing/energy.c", |
| 114 | "signal_processing/filter_ar.c", |
| 115 | "signal_processing/filter_ma_fast_q12.c", |
| 116 | "signal_processing/get_hanning_window.c", |
| 117 | "signal_processing/get_scaling_square.c", |
| 118 | "signal_processing/ilbc_specific_functions.c", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 119 | "signal_processing/include/real_fft.h", |
| 120 | "signal_processing/include/signal_processing_library.h", |
| 121 | "signal_processing/include/spl_inl.h", |
charujain | 9a45116 | 2017-09-15 03:51:34 -0700 | [diff] [blame] | 122 | "signal_processing/include/spl_inl_armv7.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 123 | "signal_processing/levinson_durbin.c", |
| 124 | "signal_processing/lpc_to_refl_coef.c", |
| 125 | "signal_processing/min_max_operations.c", |
| 126 | "signal_processing/randomization_functions.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 127 | "signal_processing/real_fft.c", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 128 | "signal_processing/refl_coef_to_lpc.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 129 | "signal_processing/resample.c", |
| 130 | "signal_processing/resample_48khz.c", |
| 131 | "signal_processing/resample_by_2.c", |
| 132 | "signal_processing/resample_by_2_internal.c", |
| 133 | "signal_processing/resample_by_2_internal.h", |
| 134 | "signal_processing/resample_fractional.c", |
| 135 | "signal_processing/spl_init.c", |
kwiberg | 729b21f | 2016-06-02 04:02:12 -0700 | [diff] [blame] | 136 | "signal_processing/spl_inl.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 137 | "signal_processing/spl_sqrt.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 138 | "signal_processing/splitting_filter.c", |
| 139 | "signal_processing/sqrt_of_one_minus_x_squared.c", |
| 140 | "signal_processing/vector_scaling_operations.c", |
| 141 | "vad/include/webrtc_vad.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 142 | "vad/vad_core.c", |
| 143 | "vad/vad_core.h", |
| 144 | "vad/vad_filterbank.c", |
| 145 | "vad/vad_filterbank.h", |
| 146 | "vad/vad_gmm.c", |
| 147 | "vad/vad_gmm.h", |
| 148 | "vad/vad_sp.c", |
| 149 | "vad/vad_sp.h", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 150 | "vad/webrtc_vad.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 151 | ] |
| 152 | |
kjellander@webrtc.org | 7227391 | 2015-02-23 19:08:31 +0000 | [diff] [blame] | 153 | if (current_cpu == "mipsel") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 154 | sources += [ |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 155 | "signal_processing/complex_bit_reverse_mips.c", |
| 156 | "signal_processing/complex_fft_mips.c", |
| 157 | "signal_processing/cross_correlation_mips.c", |
| 158 | "signal_processing/downsample_fast_mips.c", |
| 159 | "signal_processing/filter_ar_fast_q12_mips.c", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 160 | "signal_processing/include/spl_inl_mips.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 161 | "signal_processing/min_max_operations_mips.c", |
| 162 | "signal_processing/resample_by_2_mips.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 163 | ] |
| 164 | if (mips_dsp_rev > 0) { |
| 165 | sources += [ "signal_processing/vector_scaling_operations_mips.c" ] |
| 166 | } |
| 167 | } else { |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 168 | sources += [ "signal_processing/complex_fft.c" ] |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 169 | } |
| 170 | |
kjellander@webrtc.org | 7227391 | 2015-02-23 19:08:31 +0000 | [diff] [blame] | 171 | if (current_cpu != "arm" && current_cpu != "mipsel") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 172 | sources += [ |
| 173 | "signal_processing/complex_bit_reverse.c", |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 174 | "signal_processing/filter_ar_fast_q12.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 175 | ] |
| 176 | } |
| 177 | |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 178 | deps = [ |
mbonadei | d66072b | 2017-07-06 07:44:14 -0700 | [diff] [blame] | 179 | ":common_audio_c_arm_asm", |
henrik.lundin | d461ffc | 2017-03-07 04:02:47 -0800 | [diff] [blame] | 180 | ":common_audio_cc", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 181 | "../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 182 | "../rtc_base:compile_assert_c", |
| 183 | "../rtc_base:rtc_base_approved", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 184 | "../rtc_base:sanitizer", |
Niels Möller | a12c42a | 2018-07-25 16:05:48 +0200 | [diff] [blame] | 185 | "../rtc_base/system:arch", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 186 | "../system_wrappers", |
| 187 | "../system_wrappers:cpu_features_api", |
Mirko Bonadei | 146137a | 2020-04-21 09:56:16 +0200 | [diff] [blame] | 188 | "third_party/ooura:fft_size_256", |
Artem Titov | 2983599 | 2018-08-07 11:50:54 +0200 | [diff] [blame] | 189 | "third_party/spl_sqrt_floor", |
Artem Titov | df3bcdb | 2018-06-26 14:12:18 +0200 | [diff] [blame] | 190 | ] |
| 191 | } |
| 192 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 193 | rtc_library("common_audio_cc") { |
henrik.lundin | d461ffc | 2017-03-07 04:02:47 -0800 | [diff] [blame] | 194 | sources = [ |
| 195 | "signal_processing/dot_product_with_scale.cc", |
| 196 | "signal_processing/dot_product_with_scale.h", |
| 197 | ] |
| 198 | |
henrik.lundin | d461ffc | 2017-03-07 04:02:47 -0800 | [diff] [blame] | 199 | deps = [ |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 200 | "../rtc_base:rtc_base_approved", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 201 | "../system_wrappers", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 202 | ] |
| 203 | } |
| 204 | |
| 205 | rtc_source_set("sinc_resampler") { |
Mirko Bonadei | ccbe95f | 2020-01-21 12:10:10 +0100 | [diff] [blame] | 206 | sources = [ "resampler/sinc_resampler.h" ] |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 207 | deps = [ |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 208 | "../rtc_base:gtest_prod", |
| 209 | "../rtc_base:rtc_base_approved", |
Karl Wiberg | 29e7bee | 2018-03-22 14:11:52 +0100 | [diff] [blame] | 210 | "../rtc_base/memory:aligned_malloc", |
Niels Möller | a12c42a | 2018-07-25 16:05:48 +0200 | [diff] [blame] | 211 | "../rtc_base/system:arch", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 212 | "../system_wrappers", |
| 213 | ] |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 214 | } |
| 215 | |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 216 | rtc_source_set("fir_filter") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 217 | visibility += webrtc_default_visibility |
Mirko Bonadei | ccbe95f | 2020-01-21 12:10:10 +0100 | [diff] [blame] | 218 | sources = [ "fir_filter.h" ] |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 219 | } |
| 220 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 221 | rtc_library("fir_filter_factory") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 222 | visibility += webrtc_default_visibility |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 223 | sources = [ |
| 224 | "fir_filter_c.cc", |
| 225 | "fir_filter_c.h", |
| 226 | "fir_filter_factory.cc", |
| 227 | "fir_filter_factory.h", |
| 228 | ] |
| 229 | deps = [ |
| 230 | ":fir_filter", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 231 | "../rtc_base:checks", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 232 | "../rtc_base:rtc_base_approved", |
Niels Möller | a12c42a | 2018-07-25 16:05:48 +0200 | [diff] [blame] | 233 | "../rtc_base/system:arch", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 234 | "../system_wrappers:cpu_features_api", |
| 235 | ] |
| 236 | if (current_cpu == "x86" || current_cpu == "x64") { |
| 237 | deps += [ ":common_audio_sse2" ] |
| 238 | } |
| 239 | if (rtc_build_with_neon) { |
| 240 | deps += [ ":common_audio_neon" ] |
| 241 | } |
| 242 | } |
| 243 | |
kjellander@webrtc.org | 7227391 | 2015-02-23 19:08:31 +0000 | [diff] [blame] | 244 | if (current_cpu == "x86" || current_cpu == "x64") { |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 245 | rtc_library("common_audio_sse2") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 246 | sources = [ |
| 247 | "fir_filter_sse.cc", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 248 | "fir_filter_sse.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 249 | "resampler/sinc_resampler_sse.cc", |
| 250 | ] |
| 251 | |
Fabrice de Gans-Riberi | 09a6cd5 | 2018-03-30 10:38:06 -0700 | [diff] [blame] | 252 | if (is_posix || is_fuchsia) { |
Henrik Kjellander | f2497cf | 2015-04-16 08:57:16 +0200 | [diff] [blame] | 253 | cflags = [ "-msse2" ] |
| 254 | } |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 255 | |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 256 | deps = [ |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 257 | ":fir_filter", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 258 | ":sinc_resampler", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 259 | "../rtc_base:checks", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 260 | "../rtc_base:rtc_base_approved", |
Karl Wiberg | 29e7bee | 2018-03-22 14:11:52 +0100 | [diff] [blame] | 261 | "../rtc_base/memory:aligned_malloc", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 262 | ] |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 263 | } |
| 264 | } |
| 265 | |
Andrew MacDonald | ac4234c | 2015-06-24 18:25:54 -0700 | [diff] [blame] | 266 | if (rtc_build_with_neon) { |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 267 | rtc_library("common_audio_neon") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 268 | sources = [ |
| 269 | "fir_filter_neon.cc", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 270 | "fir_filter_neon.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 271 | "resampler/sinc_resampler_neon.cc", |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 272 | ] |
| 273 | |
| 274 | if (current_cpu != "arm64") { |
Oleh Prypin | d2f4e8b | 2018-08-01 12:18:05 +0200 | [diff] [blame] | 275 | # Enable compilation for the NEON instruction set. |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 276 | suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ] |
| 277 | cflags = [ "-mfpu=neon" ] |
| 278 | } |
| 279 | |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 280 | deps = [ |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 281 | ":common_audio_neon_c", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 282 | ":fir_filter", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 283 | ":sinc_resampler", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 284 | "../rtc_base:checks", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 285 | "../rtc_base:rtc_base_approved", |
Karl Wiberg | 29e7bee | 2018-03-22 14:11:52 +0100 | [diff] [blame] | 286 | "../rtc_base/memory:aligned_malloc", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 287 | ] |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 288 | } |
| 289 | |
Mirko Bonadei | 86d053c | 2019-10-17 21:32:04 +0200 | [diff] [blame] | 290 | rtc_library("common_audio_neon_c") { |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 291 | visibility += webrtc_default_visibility |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 292 | sources = [ |
andrew@webrtc.org | 0933d01 | 2015-03-05 19:13:46 +0000 | [diff] [blame] | 293 | "signal_processing/cross_correlation_neon.c", |
| 294 | "signal_processing/downsample_fast_neon.c", |
| 295 | "signal_processing/min_max_operations_neon.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 296 | ] |
| 297 | |
Andrew MacDonald | ac4234c | 2015-06-24 18:25:54 -0700 | [diff] [blame] | 298 | if (current_cpu != "arm64") { |
Oleh Prypin | d2f4e8b | 2018-08-01 12:18:05 +0200 | [diff] [blame] | 299 | # Enable compilation for the NEON instruction set. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 300 | suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ] |
andrew@webrtc.org | 0933d01 | 2015-03-05 19:13:46 +0000 | [diff] [blame] | 301 | cflags = [ "-mfpu=neon" ] |
| 302 | } |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 303 | |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 304 | deps = [ |
| 305 | ":common_audio_c", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 306 | "../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 307 | "../rtc_base:rtc_base_approved", |
Niels Möller | a12c42a | 2018-07-25 16:05:48 +0200 | [diff] [blame] | 308 | "../rtc_base/system:arch", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 309 | ] |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 310 | } |
| 311 | } |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 312 | |
| 313 | if (rtc_include_tests) { |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 314 | rtc_test("common_audio_unittests") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 315 | visibility += webrtc_default_visibility |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 316 | testonly = true |
| 317 | |
| 318 | sources = [ |
| 319 | "audio_converter_unittest.cc", |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 320 | "audio_util_unittest.cc", |
Alejandro Luebs | a181c9a | 2016-06-30 15:33:37 -0700 | [diff] [blame] | 321 | "channel_buffer_unittest.cc", |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 322 | "fir_filter_unittest.cc", |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 323 | "real_fourier_unittest.cc", |
| 324 | "resampler/push_resampler_unittest.cc", |
| 325 | "resampler/push_sinc_resampler_unittest.cc", |
| 326 | "resampler/resampler_unittest.cc", |
| 327 | "resampler/sinusoidal_linear_chirp_source.cc", |
| 328 | "resampler/sinusoidal_linear_chirp_source.h", |
| 329 | "ring_buffer_unittest.cc", |
| 330 | "signal_processing/real_fft_unittest.cc", |
| 331 | "signal_processing/signal_processing_unittest.cc", |
minyue | 69b627d | 2016-11-24 11:01:09 -0800 | [diff] [blame] | 332 | "smoothing_filter_unittest.cc", |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 333 | "vad/vad_core_unittest.cc", |
| 334 | "vad/vad_filterbank_unittest.cc", |
| 335 | "vad/vad_gmm_unittest.cc", |
| 336 | "vad/vad_sp_unittest.cc", |
| 337 | "vad/vad_unittest.cc", |
| 338 | "vad/vad_unittest.h", |
| 339 | "wav_file_unittest.cc", |
| 340 | "wav_header_unittest.cc", |
| 341 | "window_generator_unittest.cc", |
| 342 | ] |
| 343 | |
| 344 | # Does not compile on iOS for arm: webrtc:5544. |
kjellander | 34db033 | 2016-08-30 04:17:12 -0700 | [diff] [blame] | 345 | if (!is_ios || target_cpu != "arm") { |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 346 | sources += [ "resampler/sinc_resampler_unittest.cc" ] |
| 347 | } |
| 348 | |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 349 | deps = [ |
| 350 | ":common_audio", |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 351 | ":common_audio_c", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 352 | ":fir_filter", |
| 353 | ":fir_filter_factory", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 354 | ":sinc_resampler", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 355 | "../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 356 | "../rtc_base:rtc_base_approved", |
| 357 | "../rtc_base:rtc_base_tests_utils", |
Niels Möller | a12c42a | 2018-07-25 16:05:48 +0200 | [diff] [blame] | 358 | "../rtc_base/system:arch", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 359 | "../system_wrappers:cpu_features_api", |
Patrik Höglund | 7696bef | 2018-03-15 15:05:39 +0100 | [diff] [blame] | 360 | "../test:fileutils", |
Artem Titov | 9dc209a | 2019-11-28 17:09:30 +0100 | [diff] [blame] | 361 | "../test:rtc_expect_death", |
ehmaldonado | 26bddb9 | 2016-11-30 06:12:01 -0800 | [diff] [blame] | 362 | "../test:test_main", |
Yves Gerey | 21cddff | 2018-10-30 21:12:42 +0100 | [diff] [blame] | 363 | "../test:test_support", |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 364 | "//testing/gtest", |
| 365 | ] |
| 366 | |
| 367 | if (is_android) { |
| 368 | deps += [ "//testing/android/native_test:native_test_support" ] |
sakal | 714dd4e | 2016-08-15 02:29:11 -0700 | [diff] [blame] | 369 | |
| 370 | shard_timeout = 900 |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 371 | } |
| 372 | } |
| 373 | } |