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 | |
| 9 | import("//build/config/arm.gni") |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 10 | import("../webrtc.gni") |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 11 | |
Karl Wiberg | 1a8fffb | 2017-12-12 10:41:29 +0100 | [diff] [blame] | 12 | visibility = [ ":*" ] |
| 13 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 14 | config("common_audio_config") { |
| 15 | include_dirs = [ |
| 16 | "resampler/include", |
| 17 | "signal_processing/include", |
| 18 | "vad/include", |
| 19 | ] |
| 20 | } |
| 21 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 22 | rtc_static_library("common_audio") { |
Karl Wiberg | 1a8fffb | 2017-12-12 10:41:29 +0100 | [diff] [blame] | 23 | visibility += [ "*" ] |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 24 | sources = [ |
andrew@webrtc.org | aada86b | 2014-10-27 18:18:17 +0000 | [diff] [blame] | 25 | "audio_converter.cc", |
| 26 | "audio_converter.h", |
peah | faed4ab | 2016-04-05 14:57:48 -0700 | [diff] [blame] | 27 | "audio_ring_buffer.cc", |
| 28 | "audio_ring_buffer.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 29 | "audio_util.cc", |
peah | faed4ab | 2016-04-05 14:57:48 -0700 | [diff] [blame] | 30 | "blocker.cc", |
| 31 | "blocker.h", |
andrew@webrtc.org | 04c5098 | 2015-03-19 20:06:29 +0000 | [diff] [blame] | 32 | "channel_buffer.cc", |
| 33 | "channel_buffer.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 34 | "include/audio_util.h", |
peah | faed4ab | 2016-04-05 14:57:48 -0700 | [diff] [blame] | 35 | "lapped_transform.cc", |
| 36 | "lapped_transform.h", |
andrew@webrtc.org | 04c5098 | 2015-03-19 20:06:29 +0000 | [diff] [blame] | 37 | "real_fourier.cc", |
| 38 | "real_fourier.h", |
| 39 | "real_fourier_ooura.cc", |
| 40 | "real_fourier_ooura.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 41 | "resampler/include/push_resampler.h", |
| 42 | "resampler/include/resampler.h", |
| 43 | "resampler/push_resampler.cc", |
| 44 | "resampler/push_sinc_resampler.cc", |
| 45 | "resampler/push_sinc_resampler.h", |
| 46 | "resampler/resampler.cc", |
| 47 | "resampler/sinc_resampler.cc", |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 48 | "smoothing_filter.cc", |
| 49 | "smoothing_filter.h", |
| 50 | "sparse_fir_filter.cc", |
| 51 | "sparse_fir_filter.h", |
| 52 | "vad/include/vad.h", |
| 53 | "vad/vad.cc", |
| 54 | "wav_file.cc", |
| 55 | "wav_file.h", |
| 56 | "wav_header.cc", |
| 57 | "wav_header.h", |
| 58 | "window_generator.cc", |
| 59 | "window_generator.h", |
| 60 | ] |
| 61 | |
| 62 | deps = [ |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 63 | ":common_audio_c", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 64 | ":sinc_resampler", |
| 65 | "..:webrtc_common", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 66 | "../:typedefs", |
kwiberg | 84f6a3f | 2017-09-05 08:43:13 -0700 | [diff] [blame] | 67 | "../api:optional", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 68 | "../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 69 | "../rtc_base:gtest_prod", |
| 70 | "../rtc_base:rtc_base_approved", |
Karl Wiberg | 29e7bee | 2018-03-22 14:11:52 +0100 | [diff] [blame] | 71 | "../rtc_base/memory:aligned_array", |
| 72 | "../rtc_base/memory:aligned_malloc", |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 73 | "../system_wrappers", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 74 | "../system_wrappers:cpu_features_api", |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 75 | ] |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 76 | |
| 77 | defines = [] |
| 78 | if (rtc_use_openmax_dl) { |
| 79 | sources += [ |
| 80 | "real_fourier_openmax.cc", |
| 81 | "real_fourier_openmax.h", |
| 82 | ] |
| 83 | defines += [ "RTC_USE_OPENMAX_DL" ] |
| 84 | if (rtc_build_openmax_dl) { |
| 85 | deps += [ "//third_party/openmax_dl/dl" ] |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | if (rtc_build_with_neon) { |
| 90 | deps += [ ":common_audio_neon" ] |
| 91 | } |
| 92 | |
| 93 | if (is_win) { |
| 94 | cflags = [ "/wd4334" ] # Ignore warning on shift operator promotion. |
| 95 | } |
| 96 | |
| 97 | public_configs = [ ":common_audio_config" ] |
| 98 | |
| 99 | if (!build_with_chromium && is_clang) { |
| 100 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 101 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 102 | } |
| 103 | |
| 104 | if (current_cpu == "x86" || current_cpu == "x64") { |
| 105 | deps += [ ":common_audio_sse2" ] |
| 106 | } |
| 107 | } |
| 108 | |
charujain | 9a45116 | 2017-09-15 03:51:34 -0700 | [diff] [blame] | 109 | rtc_source_set("mock_common_audio") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 110 | visibility += webrtc_default_visibility |
charujain | 9a45116 | 2017-09-15 03:51:34 -0700 | [diff] [blame] | 111 | testonly = true |
| 112 | sources = [ |
| 113 | "mocks/mock_smoothing_filter.h", |
| 114 | "vad/mock/mock_vad.h", |
| 115 | ] |
| 116 | deps = [ |
| 117 | ":common_audio", |
| 118 | "../test:test_support", |
| 119 | ] |
| 120 | } |
| 121 | |
mbonadei | d66072b | 2017-07-06 07:44:14 -0700 | [diff] [blame] | 122 | rtc_source_set("common_audio_c_arm_asm") { |
mbonadei | d66072b | 2017-07-06 07:44:14 -0700 | [diff] [blame] | 123 | sources = [] |
Mirko Bonadei | 6ce0359 | 2018-02-22 15:10:27 +0100 | [diff] [blame] | 124 | deps = [] |
mbonadei | d66072b | 2017-07-06 07:44:14 -0700 | [diff] [blame] | 125 | if (current_cpu == "arm") { |
| 126 | sources += [ |
| 127 | "signal_processing/complex_bit_reverse_arm.S", |
| 128 | "signal_processing/spl_sqrt_floor_arm.S", |
| 129 | ] |
| 130 | |
| 131 | if (arm_version >= 7) { |
| 132 | sources += [ "signal_processing/filter_ar_fast_q12_armv7.S" ] |
| 133 | } else { |
| 134 | sources += [ "signal_processing/filter_ar_fast_q12.c" ] |
| 135 | } |
Karl Wiberg | 7aabd39 | 2018-03-22 02:59:49 +0100 | [diff] [blame] | 136 | deps += [ "../rtc_base/system:asm_defines" ] |
mbonadei | d66072b | 2017-07-06 07:44:14 -0700 | [diff] [blame] | 137 | } |
| 138 | } |
| 139 | |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 140 | rtc_source_set("common_audio_c") { |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 141 | visibility += webrtc_default_visibility |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 142 | sources = [ |
| 143 | "fft4g.c", |
| 144 | "fft4g.h", |
peah | faed4ab | 2016-04-05 14:57:48 -0700 | [diff] [blame] | 145 | "ring_buffer.c", |
| 146 | "ring_buffer.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 147 | "signal_processing/auto_corr_to_refl_coef.c", |
| 148 | "signal_processing/auto_correlation.c", |
| 149 | "signal_processing/complex_fft_tables.h", |
| 150 | "signal_processing/copy_set_operations.c", |
| 151 | "signal_processing/cross_correlation.c", |
| 152 | "signal_processing/division_operations.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 153 | "signal_processing/downsample_fast.c", |
| 154 | "signal_processing/energy.c", |
| 155 | "signal_processing/filter_ar.c", |
| 156 | "signal_processing/filter_ma_fast_q12.c", |
| 157 | "signal_processing/get_hanning_window.c", |
| 158 | "signal_processing/get_scaling_square.c", |
| 159 | "signal_processing/ilbc_specific_functions.c", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 160 | "signal_processing/include/real_fft.h", |
| 161 | "signal_processing/include/signal_processing_library.h", |
| 162 | "signal_processing/include/spl_inl.h", |
charujain | 9a45116 | 2017-09-15 03:51:34 -0700 | [diff] [blame] | 163 | "signal_processing/include/spl_inl_armv7.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 164 | "signal_processing/levinson_durbin.c", |
| 165 | "signal_processing/lpc_to_refl_coef.c", |
| 166 | "signal_processing/min_max_operations.c", |
| 167 | "signal_processing/randomization_functions.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 168 | "signal_processing/real_fft.c", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 169 | "signal_processing/refl_coef_to_lpc.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 170 | "signal_processing/resample.c", |
| 171 | "signal_processing/resample_48khz.c", |
| 172 | "signal_processing/resample_by_2.c", |
| 173 | "signal_processing/resample_by_2_internal.c", |
| 174 | "signal_processing/resample_by_2_internal.h", |
| 175 | "signal_processing/resample_fractional.c", |
| 176 | "signal_processing/spl_init.c", |
kwiberg | 729b21f | 2016-06-02 04:02:12 -0700 | [diff] [blame] | 177 | "signal_processing/spl_inl.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 178 | "signal_processing/spl_sqrt.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 179 | "signal_processing/splitting_filter.c", |
| 180 | "signal_processing/sqrt_of_one_minus_x_squared.c", |
| 181 | "signal_processing/vector_scaling_operations.c", |
| 182 | "vad/include/webrtc_vad.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 183 | "vad/vad_core.c", |
| 184 | "vad/vad_core.h", |
| 185 | "vad/vad_filterbank.c", |
| 186 | "vad/vad_filterbank.h", |
| 187 | "vad/vad_gmm.c", |
| 188 | "vad/vad_gmm.h", |
| 189 | "vad/vad_sp.c", |
| 190 | "vad/vad_sp.h", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 191 | "vad/webrtc_vad.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 192 | ] |
| 193 | |
kjellander@webrtc.org | 7227391 | 2015-02-23 19:08:31 +0000 | [diff] [blame] | 194 | if (current_cpu == "mipsel") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 195 | sources += [ |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 196 | "signal_processing/complex_bit_reverse_mips.c", |
| 197 | "signal_processing/complex_fft_mips.c", |
| 198 | "signal_processing/cross_correlation_mips.c", |
| 199 | "signal_processing/downsample_fast_mips.c", |
| 200 | "signal_processing/filter_ar_fast_q12_mips.c", |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 201 | "signal_processing/include/spl_inl_mips.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 202 | "signal_processing/min_max_operations_mips.c", |
| 203 | "signal_processing/resample_by_2_mips.c", |
| 204 | "signal_processing/spl_sqrt_floor_mips.c", |
| 205 | ] |
| 206 | if (mips_dsp_rev > 0) { |
| 207 | sources += [ "signal_processing/vector_scaling_operations_mips.c" ] |
| 208 | } |
| 209 | } else { |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 210 | sources += [ "signal_processing/complex_fft.c" ] |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 211 | } |
| 212 | |
kjellander@webrtc.org | 7227391 | 2015-02-23 19:08:31 +0000 | [diff] [blame] | 213 | if (current_cpu != "arm" && current_cpu != "mipsel") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 214 | sources += [ |
| 215 | "signal_processing/complex_bit_reverse.c", |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 216 | "signal_processing/filter_ar_fast_q12.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 217 | "signal_processing/spl_sqrt_floor.c", |
| 218 | ] |
| 219 | } |
| 220 | |
| 221 | if (is_win) { |
Henrik Kjellander | 57e5fd2 | 2015-05-25 12:55:39 +0200 | [diff] [blame] | 222 | cflags = [ "/wd4334" ] # Ignore warning on shift operator promotion. |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 223 | } |
| 224 | |
ehmaldonado | e9cc686 | 2016-09-05 06:10:18 -0700 | [diff] [blame] | 225 | public_configs = [ ":common_audio_config" ] |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 226 | deps = [ |
mbonadei | d66072b | 2017-07-06 07:44:14 -0700 | [diff] [blame] | 227 | ":common_audio_c_arm_asm", |
henrik.lundin | d461ffc | 2017-03-07 04:02:47 -0800 | [diff] [blame] | 228 | ":common_audio_cc", |
| 229 | "..:webrtc_common", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 230 | "../:typedefs", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 231 | "../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 232 | "../rtc_base:compile_assert_c", |
| 233 | "../rtc_base:rtc_base_approved", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 234 | "../rtc_base:sanitizer", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 235 | "../system_wrappers", |
| 236 | "../system_wrappers:cpu_features_api", |
henrik.lundin | d461ffc | 2017-03-07 04:02:47 -0800 | [diff] [blame] | 237 | ] |
| 238 | } |
| 239 | |
| 240 | rtc_source_set("common_audio_cc") { |
henrik.lundin | d461ffc | 2017-03-07 04:02:47 -0800 | [diff] [blame] | 241 | sources = [ |
| 242 | "signal_processing/dot_product_with_scale.cc", |
| 243 | "signal_processing/dot_product_with_scale.h", |
| 244 | ] |
| 245 | |
| 246 | public_configs = [ ":common_audio_config" ] |
| 247 | deps = [ |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 248 | "..:webrtc_common", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 249 | "../:typedefs", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 250 | "../rtc_base:rtc_base_approved", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 251 | "../system_wrappers", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 252 | ] |
| 253 | } |
| 254 | |
| 255 | rtc_source_set("sinc_resampler") { |
| 256 | sources = [ |
| 257 | "resampler/sinc_resampler.h", |
| 258 | ] |
| 259 | deps = [ |
| 260 | "..:webrtc_common", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 261 | "../:typedefs", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 262 | "../rtc_base:gtest_prod", |
| 263 | "../rtc_base:rtc_base_approved", |
Karl Wiberg | 29e7bee | 2018-03-22 14:11:52 +0100 | [diff] [blame] | 264 | "../rtc_base/memory:aligned_malloc", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 265 | "../system_wrappers", |
| 266 | ] |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 267 | } |
| 268 | |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 269 | rtc_source_set("fir_filter") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 270 | visibility += webrtc_default_visibility |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 271 | sources = [ |
| 272 | "fir_filter.h", |
| 273 | ] |
| 274 | } |
| 275 | |
| 276 | rtc_source_set("fir_filter_factory") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 277 | visibility += webrtc_default_visibility |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 278 | sources = [ |
| 279 | "fir_filter_c.cc", |
| 280 | "fir_filter_c.h", |
| 281 | "fir_filter_factory.cc", |
| 282 | "fir_filter_factory.h", |
| 283 | ] |
| 284 | deps = [ |
| 285 | ":fir_filter", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 286 | "../rtc_base:checks", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 287 | "../rtc_base:rtc_base_approved", |
| 288 | "../system_wrappers:cpu_features_api", |
| 289 | ] |
| 290 | if (current_cpu == "x86" || current_cpu == "x64") { |
| 291 | deps += [ ":common_audio_sse2" ] |
| 292 | } |
| 293 | if (rtc_build_with_neon) { |
| 294 | deps += [ ":common_audio_neon" ] |
| 295 | } |
| 296 | } |
| 297 | |
kjellander@webrtc.org | 7227391 | 2015-02-23 19:08:31 +0000 | [diff] [blame] | 298 | if (current_cpu == "x86" || current_cpu == "x64") { |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 299 | rtc_static_library("common_audio_sse2") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 300 | sources = [ |
| 301 | "fir_filter_sse.cc", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 302 | "fir_filter_sse.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 303 | "resampler/sinc_resampler_sse.cc", |
| 304 | ] |
| 305 | |
Fabrice de Gans-Riberi | 09a6cd5 | 2018-03-30 10:38:06 -0700 | [diff] [blame] | 306 | if (is_posix || is_fuchsia) { |
Henrik Kjellander | f2497cf | 2015-04-16 08:57:16 +0200 | [diff] [blame] | 307 | cflags = [ "-msse2" ] |
| 308 | } |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 309 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 310 | if (!build_with_chromium && is_clang) { |
| 311 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 312 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 313 | } |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 314 | deps = [ |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 315 | ":fir_filter", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 316 | ":sinc_resampler", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 317 | "../rtc_base:checks", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 318 | "../rtc_base:rtc_base_approved", |
Karl Wiberg | 29e7bee | 2018-03-22 14:11:52 +0100 | [diff] [blame] | 319 | "../rtc_base/memory:aligned_malloc", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 320 | ] |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 321 | } |
| 322 | } |
| 323 | |
Andrew MacDonald | ac4234c | 2015-06-24 18:25:54 -0700 | [diff] [blame] | 324 | if (rtc_build_with_neon) { |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 325 | rtc_static_library("common_audio_neon") { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 326 | sources = [ |
| 327 | "fir_filter_neon.cc", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 328 | "fir_filter_neon.h", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 329 | "resampler/sinc_resampler_neon.cc", |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 330 | ] |
| 331 | |
| 332 | if (current_cpu != "arm64") { |
| 333 | # Enable compilation for the NEON instruction set. This is needed |
| 334 | # since //build/config/arm.gni only enables NEON for iOS, not Android. |
| 335 | # This provides the same functionality as webrtc/build/arm_neon.gypi. |
| 336 | suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ] |
| 337 | cflags = [ "-mfpu=neon" ] |
| 338 | } |
| 339 | |
| 340 | # Disable LTO on NEON targets due to compiler bug. |
| 341 | # TODO(fdegans): Enable this. See crbug.com/408997. |
| 342 | if (rtc_use_lto) { |
| 343 | cflags -= [ |
| 344 | "-flto", |
| 345 | "-ffat-lto-objects", |
| 346 | ] |
| 347 | } |
| 348 | |
| 349 | if (!build_with_chromium && is_clang) { |
| 350 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 351 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 352 | } |
| 353 | |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 354 | deps = [ |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 355 | ":common_audio_neon_c", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 356 | ":fir_filter", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 357 | ":sinc_resampler", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 358 | "../rtc_base:checks", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 359 | "../rtc_base:rtc_base_approved", |
Karl Wiberg | 29e7bee | 2018-03-22 14:11:52 +0100 | [diff] [blame] | 360 | "../rtc_base/memory:aligned_malloc", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 361 | ] |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 362 | } |
| 363 | |
| 364 | rtc_source_set("common_audio_neon_c") { |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 365 | visibility += webrtc_default_visibility |
kjellander | 7439f97 | 2016-12-05 22:47:46 -0800 | [diff] [blame] | 366 | sources = [ |
andrew@webrtc.org | 0933d01 | 2015-03-05 19:13:46 +0000 | [diff] [blame] | 367 | "signal_processing/cross_correlation_neon.c", |
| 368 | "signal_processing/downsample_fast_neon.c", |
| 369 | "signal_processing/min_max_operations_neon.c", |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 370 | ] |
| 371 | |
Andrew MacDonald | ac4234c | 2015-06-24 18:25:54 -0700 | [diff] [blame] | 372 | if (current_cpu != "arm64") { |
| 373 | # Enable compilation for the NEON instruction set. This is needed |
| 374 | # since //build/config/arm.gni only enables NEON for iOS, not Android. |
| 375 | # This provides the same functionality as webrtc/build/arm_neon.gypi. |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 376 | suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ] |
andrew@webrtc.org | 0933d01 | 2015-03-05 19:13:46 +0000 | [diff] [blame] | 377 | cflags = [ "-mfpu=neon" ] |
| 378 | } |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 379 | |
Andrew MacDonald | ac4234c | 2015-06-24 18:25:54 -0700 | [diff] [blame] | 380 | # Disable LTO on NEON targets due to compiler bug. |
| 381 | # TODO(fdegans): Enable this. See crbug.com/408997. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 382 | if (rtc_use_lto) { |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 383 | cflags -= [ |
| 384 | "-flto", |
| 385 | "-ffat-lto-objects", |
| 386 | ] |
| 387 | } |
Andrew MacDonald | ac4234c | 2015-06-24 18:25:54 -0700 | [diff] [blame] | 388 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 389 | if (!build_with_chromium && is_clang) { |
| 390 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 391 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | 080a1e3 | 2016-05-25 11:37:11 -0700 | [diff] [blame] | 392 | } |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 393 | deps = [ |
| 394 | ":common_audio_c", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 395 | "../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 396 | "../rtc_base:rtc_base_approved", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 397 | ] |
kjellander@webrtc.org | 1227ab8 | 2014-06-23 19:21:07 +0000 | [diff] [blame] | 398 | } |
| 399 | } |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 400 | |
| 401 | if (rtc_include_tests) { |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 402 | rtc_test("common_audio_unittests") { |
Per Kjellander | a7f2d84 | 2018-01-10 15:54:53 +0000 | [diff] [blame] | 403 | visibility += webrtc_default_visibility |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 404 | testonly = true |
| 405 | |
| 406 | sources = [ |
| 407 | "audio_converter_unittest.cc", |
| 408 | "audio_ring_buffer_unittest.cc", |
| 409 | "audio_util_unittest.cc", |
| 410 | "blocker_unittest.cc", |
Alejandro Luebs | a181c9a | 2016-06-30 15:33:37 -0700 | [diff] [blame] | 411 | "channel_buffer_unittest.cc", |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 412 | "fir_filter_unittest.cc", |
| 413 | "lapped_transform_unittest.cc", |
| 414 | "real_fourier_unittest.cc", |
| 415 | "resampler/push_resampler_unittest.cc", |
| 416 | "resampler/push_sinc_resampler_unittest.cc", |
| 417 | "resampler/resampler_unittest.cc", |
| 418 | "resampler/sinusoidal_linear_chirp_source.cc", |
| 419 | "resampler/sinusoidal_linear_chirp_source.h", |
| 420 | "ring_buffer_unittest.cc", |
| 421 | "signal_processing/real_fft_unittest.cc", |
| 422 | "signal_processing/signal_processing_unittest.cc", |
minyue | 69b627d | 2016-11-24 11:01:09 -0800 | [diff] [blame] | 423 | "smoothing_filter_unittest.cc", |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 424 | "sparse_fir_filter_unittest.cc", |
| 425 | "vad/vad_core_unittest.cc", |
| 426 | "vad/vad_filterbank_unittest.cc", |
| 427 | "vad/vad_gmm_unittest.cc", |
| 428 | "vad/vad_sp_unittest.cc", |
| 429 | "vad/vad_unittest.cc", |
| 430 | "vad/vad_unittest.h", |
| 431 | "wav_file_unittest.cc", |
| 432 | "wav_header_unittest.cc", |
| 433 | "window_generator_unittest.cc", |
| 434 | ] |
| 435 | |
| 436 | # Does not compile on iOS for arm: webrtc:5544. |
kjellander | 34db033 | 2016-08-30 04:17:12 -0700 | [diff] [blame] | 437 | if (!is_ios || target_cpu != "arm") { |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 438 | sources += [ "resampler/sinc_resampler_unittest.cc" ] |
| 439 | } |
| 440 | |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 441 | if (rtc_use_openmax_dl) { |
| 442 | defines = [ "RTC_USE_OPENMAX_DL" ] |
| 443 | } |
| 444 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 445 | if (!build_with_chromium && is_clang) { |
| 446 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 447 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 448 | } |
| 449 | |
| 450 | deps = [ |
| 451 | ":common_audio", |
Mirko Bonadei | dbbb33c | 2018-02-05 15:50:41 +0100 | [diff] [blame] | 452 | ":common_audio_c", |
Patrik Höglund | f715c53 | 2017-11-17 11:04:15 +0100 | [diff] [blame] | 453 | ":fir_filter", |
| 454 | ":fir_filter_factory", |
kjellander | 50550e1 | 2017-03-01 07:07:10 -0800 | [diff] [blame] | 455 | ":sinc_resampler", |
| 456 | "..:webrtc_common", |
Patrik Höglund | 3e11343 | 2017-12-15 14:40:10 +0100 | [diff] [blame] | 457 | "../:typedefs", |
Patrik Höglund | a8005cf | 2017-12-13 16:05:42 +0100 | [diff] [blame] | 458 | "../rtc_base:checks", |
ehmaldonado | f6a861a | 2017-07-19 10:40:47 -0700 | [diff] [blame] | 459 | "../rtc_base:rtc_base_approved", |
| 460 | "../rtc_base:rtc_base_tests_utils", |
Mirko Bonadei | a498ae8 | 2017-12-06 09:17:14 +0100 | [diff] [blame] | 461 | "../system_wrappers:cpu_features_api", |
Patrik Höglund | 7696bef | 2018-03-15 15:05:39 +0100 | [diff] [blame] | 462 | "../test:fileutils", |
ehmaldonado | 26bddb9 | 2016-11-30 06:12:01 -0800 | [diff] [blame] | 463 | "../test:test_main", |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 464 | "//testing/gtest", |
| 465 | ] |
| 466 | |
| 467 | if (is_android) { |
| 468 | deps += [ "//testing/android/native_test:native_test_support" ] |
sakal | 714dd4e | 2016-08-15 02:29:11 -0700 | [diff] [blame] | 469 | |
| 470 | shard_timeout = 900 |
kjellander | 2a3892a | 2016-06-08 01:27:52 -0700 | [diff] [blame] | 471 | } |
| 472 | } |
| 473 | } |