blob: 2684a782c3a200793197f696e368ab7c0cc79178 [file] [log] [blame]
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +00001# 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
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +00009import("//build/config/arm.gni")
10import("//third_party/protobuf/proto_library.gni")
mbonadei9aa3f0a2017-01-24 06:58:22 -080011import("../../webrtc.gni")
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000012
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000013declare_args() {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000014 # Disables the usual mode where we trust the reported system delay
15 # values the AEC receives. The corresponding define is set appropriately
16 # in the code, but it can be force-enabled here for testing.
17 aec_untrusted_delay_for_testing = false
18}
19
kjellanderb62dbbe2016-09-23 00:38:52 -070020rtc_static_library("audio_processing") {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000021 sources = [
peah8df5d4f2016-02-23 14:34:59 -080022 "aec/aec_core.cc",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000023 "aec/aec_core.h",
peahe687f782016-05-09 03:57:33 -070024 "aec/aec_core_optimized_methods.h",
peah88950cf2016-03-04 00:12:40 -080025 "aec/aec_resampler.cc",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000026 "aec/aec_resampler.h",
peah8df5d4f2016-02-23 14:34:59 -080027 "aec/echo_cancellation.cc",
Henrik Kjellander9b72af92015-11-11 20:16:11 +010028 "aec/echo_cancellation.h",
peahd0263542017-01-03 04:20:34 -080029 "aec3/aec3_constants.h",
30 "aec3/block_framer.cc",
31 "aec3/block_framer.h",
32 "aec3/block_processor.cc",
33 "aec3/block_processor.h",
34 "aec3/cascaded_biquad_filter.cc",
35 "aec3/cascaded_biquad_filter.h",
peah21920892017-02-08 05:08:56 -080036 "aec3/decimator_by_4.cc",
37 "aec3/decimator_by_4.h",
peahe0eae3c2016-12-14 01:16:23 -080038 "aec3/echo_canceller3.cc",
39 "aec3/echo_canceller3.h",
peah69221db2017-01-27 03:28:19 -080040 "aec3/echo_path_delay_estimator.cc",
41 "aec3/echo_path_delay_estimator.h",
42 "aec3/echo_path_variability.h",
43 "aec3/echo_remover.cc",
44 "aec3/echo_remover.h",
peahd0263542017-01-03 04:20:34 -080045 "aec3/frame_blocker.cc",
46 "aec3/frame_blocker.h",
peah21920892017-02-08 05:08:56 -080047 "aec3/matched_filter.cc",
48 "aec3/matched_filter.h",
49 "aec3/matched_filter_lag_aggregator.cc",
50 "aec3/matched_filter_lag_aggregator.h",
peah69221db2017-01-27 03:28:19 -080051 "aec3/render_delay_buffer.cc",
52 "aec3/render_delay_buffer.h",
53 "aec3/render_delay_controller.cc",
54 "aec3/render_delay_controller.h",
peah27045122016-04-10 22:38:14 -070055 "aecm/aecm_core.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000056 "aecm/aecm_core.h",
peah27045122016-04-10 22:38:14 -070057 "aecm/echo_control_mobile.cc",
Henrik Kjellander9b72af92015-11-11 20:16:11 +010058 "aecm/echo_control_mobile.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000059 "agc/agc.cc",
60 "agc/agc.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000061 "agc/agc_manager_direct.cc",
62 "agc/agc_manager_direct.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000063 "agc/gain_map_internal.h",
peahbbe42332016-06-08 06:42:02 -070064 "agc/loudness_histogram.cc",
65 "agc/loudness_histogram.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000066 "agc/utility.cc",
67 "agc/utility.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000068 "audio_buffer.cc",
69 "audio_buffer.h",
70 "audio_processing_impl.cc",
71 "audio_processing_impl.h",
aluebs4a66e4a2015-10-19 18:02:39 -070072 "beamformer/array_util.cc",
73 "beamformer/array_util.h",
aluebs@webrtc.org0c39e912014-12-18 22:22:04 +000074 "beamformer/complex_matrix.h",
75 "beamformer/covariance_matrix_generator.cc",
76 "beamformer/covariance_matrix_generator.h",
77 "beamformer/matrix.h",
andrew@webrtc.orgbd8c8652015-03-20 00:28:22 +000078 "beamformer/nonlinear_beamformer.cc",
79 "beamformer/nonlinear_beamformer.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000080 "common.h",
81 "echo_cancellation_impl.cc",
82 "echo_cancellation_impl.h",
83 "echo_control_mobile_impl.cc",
84 "echo_control_mobile_impl.h",
ivocaf27ed02016-10-28 07:04:03 -070085 "echo_detector/circular_buffer.cc",
86 "echo_detector/circular_buffer.h",
87 "echo_detector/mean_variance_estimator.cc",
88 "echo_detector/mean_variance_estimator.h",
ivoc4e477a12017-01-15 08:29:46 -080089 "echo_detector/moving_max.cc",
90 "echo_detector/moving_max.h",
ivocaf27ed02016-10-28 07:04:03 -070091 "echo_detector/normalized_covariance_estimator.cc",
92 "echo_detector/normalized_covariance_estimator.h",
peahbe615622016-02-13 16:40:47 -080093 "gain_control_for_experimental_agc.cc",
94 "gain_control_for_experimental_agc.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000095 "gain_control_impl.cc",
96 "gain_control_impl.h",
peahc19f3122016-10-07 14:54:10 -070097 "include/audio_processing.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000098 "include/audio_processing.h",
solenberg88499ec2016-09-07 07:34:41 -070099 "include/config.cc",
100 "include/config.h",
peahca4cac72016-06-29 15:26:12 -0700101 "level_controller/biquad_filter.cc",
102 "level_controller/biquad_filter.h",
103 "level_controller/down_sampler.cc",
104 "level_controller/down_sampler.h",
105 "level_controller/gain_applier.cc",
106 "level_controller/gain_applier.h",
107 "level_controller/gain_selector.cc",
108 "level_controller/gain_selector.h",
peahca4cac72016-06-29 15:26:12 -0700109 "level_controller/level_controller.cc",
110 "level_controller/level_controller.h",
peahc19f3122016-10-07 14:54:10 -0700111 "level_controller/level_controller_constants.h",
peahca4cac72016-06-29 15:26:12 -0700112 "level_controller/noise_level_estimator.cc",
113 "level_controller/noise_level_estimator.h",
114 "level_controller/noise_spectrum_estimator.cc",
115 "level_controller/noise_spectrum_estimator.h",
116 "level_controller/peak_level_estimator.cc",
117 "level_controller/peak_level_estimator.h",
118 "level_controller/saturating_gain_estimator.cc",
119 "level_controller/saturating_gain_estimator.h",
120 "level_controller/signal_classifier.cc",
121 "level_controller/signal_classifier.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000122 "level_estimator_impl.cc",
123 "level_estimator_impl.h",
peahb46083e2016-05-03 07:01:18 -0700124 "logging/apm_data_dumper.cc",
125 "logging/apm_data_dumper.h",
peah8271d042016-11-22 07:24:52 -0800126 "low_cut_filter.cc",
127 "low_cut_filter.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000128 "noise_suppression_impl.cc",
129 "noise_suppression_impl.h",
peah737f4b82016-03-10 23:05:28 -0800130 "render_queue_item_verifier.h",
ivoc9f4a4a02016-10-28 05:39:16 -0700131 "residual_echo_detector.cc",
132 "residual_echo_detector.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000133 "rms_level.cc",
134 "rms_level.h",
aluebs@webrtc.orgbe05c742014-11-14 22:18:10 +0000135 "splitting_filter.cc",
136 "splitting_filter.h",
Alejandro Luebs5a92aa82015-04-27 11:34:45 -0700137 "three_band_filter_bank.cc",
138 "three_band_filter_bank.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +0000139 "transient/common.h",
140 "transient/daubechies_8_wavelet_coeffs.h",
141 "transient/dyadic_decimator.h",
142 "transient/moving_moments.cc",
143 "transient/moving_moments.h",
144 "transient/transient_detector.cc",
145 "transient/transient_detector.h",
146 "transient/transient_suppressor.cc",
147 "transient/transient_suppressor.h",
148 "transient/wpd_node.cc",
149 "transient/wpd_node.h",
150 "transient/wpd_tree.cc",
151 "transient/wpd_tree.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000152 "typing_detection.cc",
153 "typing_detection.h",
minyue84db6fa2016-03-24 14:36:25 -0700154 "utility/block_mean_calculator.cc",
155 "utility/block_mean_calculator.h",
peahbdb7af62016-04-12 14:47:40 -0700156 "utility/delay_estimator.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000157 "utility/delay_estimator.h",
158 "utility/delay_estimator_internal.h",
peahbdb7af62016-04-12 14:47:40 -0700159 "utility/delay_estimator_wrapper.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000160 "utility/delay_estimator_wrapper.h",
peah81b92912016-10-06 06:46:20 -0700161 "utility/ooura_fft.cc",
162 "utility/ooura_fft.h",
163 "utility/ooura_fft_tables_common.h",
aluebsecf6b812015-06-25 12:28:48 -0700164 "vad/common.h",
165 "vad/gmm.cc",
166 "vad/gmm.h",
167 "vad/noise_gmm_tables.h",
168 "vad/pitch_based_vad.cc",
169 "vad/pitch_based_vad.h",
170 "vad/pitch_internal.cc",
171 "vad/pitch_internal.h",
172 "vad/pole_zero_filter.cc",
173 "vad/pole_zero_filter.h",
174 "vad/standalone_vad.cc",
175 "vad/standalone_vad.h",
176 "vad/vad_audio_proc.cc",
177 "vad/vad_audio_proc.h",
178 "vad/vad_audio_proc_internal.h",
179 "vad/vad_circular_buffer.cc",
180 "vad/vad_circular_buffer.h",
181 "vad/voice_activity_detector.cc",
182 "vad/voice_activity_detector.h",
183 "vad/voice_gmm_tables.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000184 "voice_detection_impl.cc",
185 "voice_detection_impl.h",
186 ]
187
188 defines = []
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200189 deps = [
190 "../..:webrtc_common",
aleloi6321b492016-12-05 01:46:09 -0800191 "../../audio/utility:audio_frame_operations",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800192 "../../base:gtest_prod",
kwiberg98ab3a42015-09-30 21:54:21 -0700193 "../audio_coding:isac",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200194 ]
kjellander7439f972016-12-05 22:47:46 -0800195 public_deps = [
196 ":audio_processing_c",
197 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000198
peahf28a3892016-09-01 08:58:21 -0700199 if (apm_debug_dump) {
200 defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ]
peahb46083e2016-05-03 07:01:18 -0700201 } else {
peahf28a3892016-09-01 08:58:21 -0700202 defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000203 }
204
205 if (aec_untrusted_delay_for_testing) {
206 defines += [ "WEBRTC_UNTRUSTED_DELAY" ]
207 }
208
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000209 if (rtc_enable_protobuf) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000210 defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ]
211 deps += [ ":audioproc_debug_proto" ]
212 }
213
peah1bcfce52016-08-26 07:16:04 -0700214 if (rtc_enable_intelligibility_enhancer) {
215 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
216 sources += [
217 "intelligibility/intelligibility_enhancer.cc",
218 "intelligibility/intelligibility_enhancer.h",
219 "intelligibility/intelligibility_utils.cc",
220 "intelligibility/intelligibility_utils.h",
221 ]
222 } else {
223 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
224 }
225
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000226 if (rtc_prefer_fixed_point) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000227 defines += [ "WEBRTC_NS_FIXED" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000228 } else {
229 defines += [ "WEBRTC_NS_FLOAT" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000230 }
231
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000232 if (current_cpu == "x86" || current_cpu == "x64") {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000233 deps += [ ":audio_processing_sse2" ]
234 }
235
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700236 if (rtc_build_with_neon) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000237 deps += [ ":audio_processing_neon" ]
238 }
239
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000240 if (current_cpu == "mipsel") {
peah27045122016-04-10 22:38:14 -0700241 sources += [ "aecm/aecm_core_mips.cc" ]
kjellander@webrtc.org6dab6d72015-03-04 09:50:31 +0000242 if (mips_float_abi == "hard") {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000243 sources += [
peah8df5d4f2016-02-23 14:34:59 -0800244 "aec/aec_core_mips.cc",
peah81b92912016-10-06 06:46:20 -0700245 "utility/ooura_fft_mips.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000246 ]
247 }
248 } else {
peah27045122016-04-10 22:38:14 -0700249 sources += [ "aecm/aecm_core_c.cc" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000250 }
251
kjellander8f4419b2016-06-02 02:09:52 -0700252 # TODO(jschuh): Bug 1348: fix this warning.
253 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000254
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000255 deps += [
xians@webrtc.orge46bc772014-10-10 08:36:56 +0000256 "../../base:rtc_base_approved",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000257 "../../common_audio",
258 "../../system_wrappers",
259 ]
260}
261
kjellander7439f972016-12-05 22:47:46 -0800262rtc_source_set("audio_processing_c") {
263 visibility = [ ":*" ] # Only targets in this file can depend on this.
264 sources = [
265 "agc/legacy/analog_agc.c",
266 "agc/legacy/analog_agc.h",
267 "agc/legacy/digital_agc.c",
268 "agc/legacy/digital_agc.h",
269 "agc/legacy/gain_control.h",
270 ]
271
272 if (rtc_prefer_fixed_point) {
273 sources += [
274 "ns/noise_suppression_x.c",
275 "ns/noise_suppression_x.h",
276 "ns/nsx_core.c",
277 "ns/nsx_core.h",
278 "ns/nsx_defines.h",
279 ]
280 if (current_cpu == "mipsel") {
281 sources += [ "ns/nsx_core_mips.c" ]
282 } else {
283 sources += [ "ns/nsx_core_c.c" ]
284 }
285 } else {
286 sources += [
287 "ns/defines.h",
288 "ns/noise_suppression.c",
289 "ns/noise_suppression.h",
290 "ns/ns_core.c",
291 "ns/ns_core.h",
292 "ns/windows_private.h",
293 ]
294 }
295
296 deps = [
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800297 "../..:webrtc_common",
kjellander7439f972016-12-05 22:47:46 -0800298 "../../base:rtc_base_approved",
299 "../../common_audio",
300 "../../system_wrappers",
301 ]
mbonadeie5dc3ce2017-01-25 05:34:46 -0800302
303 if (rtc_build_with_neon) {
304 deps += [ ":audio_processing_neon_c" ]
305 }
kjellander7439f972016-12-05 22:47:46 -0800306}
307
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000308if (rtc_enable_protobuf) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000309 proto_library("audioproc_debug_proto") {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200310 sources = [
311 "debug.proto",
312 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000313
kjellander78ddd732016-02-09 08:13:06 -0800314 proto_out_dir = "webrtc/modules/audio_processing"
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000315 }
316}
317
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000318if (current_cpu == "x86" || current_cpu == "x64") {
kjellanderb62dbbe2016-09-23 00:38:52 -0700319 rtc_static_library("audio_processing_sse2") {
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800320 # TODO(ehmaldonado): Remove (bugs.webrtc.org/6828)
321 # Errors on cyclic dependency with :audio_processing if enabled.
322 check_includes = false
323
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000324 sources = [
peah8df5d4f2016-02-23 14:34:59 -0800325 "aec/aec_core_sse2.cc",
peah81b92912016-10-06 06:46:20 -0700326 "utility/ooura_fft_sse2.cc",
327 "utility/ooura_fft_tables_neon_sse2.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000328 ]
329
Henrik Kjellanderf2497cf2015-04-16 08:57:16 +0200330 if (is_posix) {
331 cflags = [ "-msse2" ]
332 }
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000333
peahf28a3892016-09-01 08:58:21 -0700334 if (apm_debug_dump) {
335 defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ]
peahb46083e2016-05-03 07:01:18 -0700336 } else {
peahf28a3892016-09-01 08:58:21 -0700337 defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ]
peahb46083e2016-05-03 07:01:18 -0700338 }
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000339 }
340}
341
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700342if (rtc_build_with_neon) {
kjellanderb62dbbe2016-09-23 00:38:52 -0700343 rtc_static_library("audio_processing_neon") {
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800344 # TODO(ehmaldonado): Remove (bugs.webrtc.org/6828)
345 # Errors on cyclic dependency with :audio_processing if enabled.
346 check_includes = false
347
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000348 sources = [
peah8df5d4f2016-02-23 14:34:59 -0800349 "aec/aec_core_neon.cc",
peah27045122016-04-10 22:38:14 -0700350 "aecm/aecm_core_neon.cc",
peah81b92912016-10-06 06:46:20 -0700351 "utility/ooura_fft_neon.cc",
352 "utility/ooura_fft_tables_neon_sse2.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000353 ]
354
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000355 if (current_cpu != "arm64") {
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700356 # Enable compilation for the NEON instruction set. This is needed
357 # since //build/config/arm.gni only enables NEON for iOS, not Android.
358 # This provides the same functionality as webrtc/build/arm_neon.gypi.
ehmaldonado38a21322016-09-02 04:10:34 -0700359 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200360 cflags = [ "-mfpu=neon" ]
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000361 }
362
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700363 # Disable LTO on NEON targets due to compiler bug.
364 # TODO(fdegans): Enable this. See crbug.com/408997.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000365 if (rtc_use_lto) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000366 cflags -= [
367 "-flto",
368 "-ffat-lto-objects",
369 ]
370 }
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700371
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700372 deps = [
373 "../../common_audio",
374 ]
kjellander7439f972016-12-05 22:47:46 -0800375 public_deps = [
376 ":audio_processing_neon_c",
377 ]
peahb46083e2016-05-03 07:01:18 -0700378
peahf28a3892016-09-01 08:58:21 -0700379 if (apm_debug_dump) {
380 defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ]
peahb46083e2016-05-03 07:01:18 -0700381 } else {
peahf28a3892016-09-01 08:58:21 -0700382 defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ]
peahb46083e2016-05-03 07:01:18 -0700383 }
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000384 }
kjellander7439f972016-12-05 22:47:46 -0800385
386 rtc_static_library("audio_processing_neon_c") {
mbonadeie5dc3ce2017-01-25 05:34:46 -0800387 # TODO(mbonadei): Remove (bugs.webrtc.org/6828)
388 # Errors on cyclic dependency with :audio_processing_c if enabled.
389 check_includes = false
390
kjellander7439f972016-12-05 22:47:46 -0800391 sources = [
392 "ns/nsx_core_neon.c",
393 ]
394
395 if (current_cpu != "arm64") {
396 # Enable compilation for the NEON instruction set. This is needed
397 # since //build/config/arm.gni only enables NEON for iOS, not Android.
398 # This provides the same functionality as webrtc/build/arm_neon.gypi.
399 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
400 cflags = [ "-mfpu=neon" ]
401 }
402
403 # Disable LTO on NEON targets due to compiler bug.
404 # TODO(fdegans): Enable this. See crbug.com/408997.
405 if (rtc_use_lto) {
406 cflags -= [
407 "-flto",
408 "-ffat-lto-objects",
409 ]
410 }
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800411 deps = [
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800412 "../../base:rtc_base_approved",
413 ]
kjellander7439f972016-12-05 22:47:46 -0800414 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000415}
kjellanderfb114242016-06-13 00:19:48 -0700416
417if (rtc_include_tests) {
kjellander6ceab082016-10-28 05:44:03 -0700418 group("audio_processing_tests") {
419 testonly = true
420 public_deps = [
kjellander6ceab082016-10-28 05:44:03 -0700421 ":audioproc_test_utils",
422 ":click_annotate",
423 ":nonlinear_beamformer_test",
424 ":transient_suppression_test",
kjellander6ceab082016-10-28 05:44:03 -0700425 ]
426
427 if (rtc_enable_intelligibility_enhancer) {
428 public_deps += [ ":intelligibility_proc" ]
429 }
430
431 if (rtc_enable_protobuf) {
ehmaldonado1fd08c12017-01-17 02:37:34 -0800432 public_deps += [
433 ":audioproc_f",
434 ":audioproc_unittest_proto",
435 ":unpack_aecdump",
436 ]
kjellander6ceab082016-10-28 05:44:03 -0700437 }
438 }
439
ehmaldonado36268652017-01-19 08:27:11 -0800440 rtc_source_set("audio_processing_unittests") {
441 testonly = true
442 sources = [
443 "aec/echo_cancellation_unittest.cc",
444 "aec/system_delay_unittest.cc",
445 "agc/agc_manager_direct_unittest.cc",
446 "agc/loudness_histogram_unittest.cc",
447 "agc/mock_agc.h",
448 "audio_buffer_unittest.cc",
449 "beamformer/array_util_unittest.cc",
450 "beamformer/complex_matrix_unittest.cc",
451 "beamformer/covariance_matrix_generator_unittest.cc",
452 "beamformer/matrix_unittest.cc",
453 "beamformer/mock_nonlinear_beamformer.h",
ehmaldonado36268652017-01-19 08:27:11 -0800454 "config_unittest.cc",
455 "echo_cancellation_impl_unittest.cc",
456 "splitting_filter_unittest.cc",
457 "transient/dyadic_decimator_unittest.cc",
458 "transient/file_utils.cc",
459 "transient/file_utils.h",
460 "transient/file_utils_unittest.cc",
461 "transient/moving_moments_unittest.cc",
462 "transient/transient_detector_unittest.cc",
463 "transient/transient_suppressor_unittest.cc",
464 "transient/wpd_node_unittest.cc",
465 "transient/wpd_tree_unittest.cc",
466 "utility/block_mean_calculator_unittest.cc",
467 "utility/delay_estimator_unittest.cc",
468 "vad/gmm_unittest.cc",
469 "vad/pitch_based_vad_unittest.cc",
470 "vad/pitch_internal_unittest.cc",
471 "vad/pole_zero_filter_unittest.cc",
472 "vad/standalone_vad_unittest.cc",
473 "vad/vad_audio_proc_unittest.cc",
474 "vad/vad_circular_buffer_unittest.cc",
475 "vad/voice_activity_detector_unittest.cc",
476 ]
477
478 deps = [
479 ":audio_processing",
ehmaldonado36268652017-01-19 08:27:11 -0800480 ":audioproc_test_utils",
481 "../..:webrtc_common",
482 "../../base:gtest_prod",
483 "../../base:rtc_base",
484 "../../base:rtc_base_approved",
485 "../../common_audio:common_audio",
486 "../../system_wrappers:system_wrappers",
487 "../../test:test_support",
488 "../audio_coding:neteq_unittest_tools",
489 "//testing/gmock",
490 "//testing/gtest",
491 ]
492
493 defines = []
494
495 if (apm_debug_dump) {
496 defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ]
497 } else {
498 defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ]
499 }
500
501 if (rtc_enable_intelligibility_enhancer) {
502 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
503 sources += [
504 "intelligibility/intelligibility_enhancer_unittest.cc",
505 "intelligibility/intelligibility_utils_unittest.cc",
506 ]
507 } else {
508 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
509 }
510
511 if (rtc_prefer_fixed_point) {
512 defines += [ "WEBRTC_AUDIOPROC_FIXED_PROFILE" ]
513 } else {
514 defines += [ "WEBRTC_AUDIOPROC_FLOAT_PROFILE" ]
515 }
516
517 if (rtc_enable_protobuf) {
518 defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ]
519 deps += [
ehmaldonadof49ff262017-01-23 04:26:02 -0800520 ":audioproc_debug_proto",
ehmaldonado36268652017-01-19 08:27:11 -0800521 ":audioproc_protobuf_utils",
522 ":audioproc_unittest_proto",
523 ]
524 sources += [
525 "aec3/block_framer_unittest.cc",
526 "aec3/block_processor_unittest.cc",
527 "aec3/cascaded_biquad_filter_unittest.cc",
peah21920892017-02-08 05:08:56 -0800528 "aec3/decimator_by_4_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800529 "aec3/echo_canceller3_unittest.cc",
peah69221db2017-01-27 03:28:19 -0800530 "aec3/echo_path_delay_estimator_unittest.cc",
531 "aec3/echo_remover_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800532 "aec3/frame_blocker_unittest.cc",
peah21920892017-02-08 05:08:56 -0800533 "aec3/matched_filter_lag_aggregator_unittest.cc",
534 "aec3/matched_filter_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800535 "aec3/mock/mock_block_processor.h",
peah69221db2017-01-27 03:28:19 -0800536 "aec3/mock/mock_echo_remover.h",
537 "aec3/mock/mock_render_delay_buffer.h",
538 "aec3/mock/mock_render_delay_controller.h",
539 "aec3/render_delay_buffer_unittest.cc",
540 "aec3/render_delay_controller_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800541 "audio_processing_impl_locking_unittest.cc",
542 "audio_processing_impl_unittest.cc",
543 "audio_processing_unittest.cc",
ehmaldonadof49ff262017-01-23 04:26:02 -0800544 "beamformer/nonlinear_beamformer_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800545 "echo_cancellation_bit_exact_unittest.cc",
546 "echo_control_mobile_unittest.cc",
547 "echo_detector/circular_buffer_unittest.cc",
548 "echo_detector/mean_variance_estimator_unittest.cc",
549 "echo_detector/moving_max_unittest.cc",
550 "echo_detector/normalized_covariance_estimator_unittest.cc",
551 "gain_control_unittest.cc",
552 "level_controller/level_controller_unittest.cc",
553 "level_estimator_unittest.cc",
554 "low_cut_filter_unittest.cc",
555 "noise_suppression_unittest.cc",
556 "residual_echo_detector_unittest.cc",
557 "rms_level_unittest.cc",
558 "test/bitexactness_tools.cc",
559 "test/bitexactness_tools.h",
560 "test/debug_dump_replayer.cc",
561 "test/debug_dump_replayer.h",
562 "test/debug_dump_test.cc",
peah69221db2017-01-27 03:28:19 -0800563 "test/echo_canceller_test_tools.cc",
564 "test/echo_canceller_test_tools.h",
565 "test/echo_canceller_test_tools_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800566 "test/test_utils.h",
567 "voice_detection_unittest.cc",
568 ]
569 }
570
571 if ((!build_with_chromium || is_win) && is_clang) {
572 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
573 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
574 }
575 }
576
ehmaldonado021eef32017-01-05 07:09:50 -0800577 rtc_source_set("audio_processing_perf_tests") {
578 # Has problems with autogenerated targets on Android and iOS
579 # Dependency chain (there may also be others):
580 # //webrtc/modules/audio_processing:audio_processing_perf_tests -->
581 # //webrtc/modules:modules_unittests --[private]-->
582 # //webrtc/modules:modules_unittests_apk -->
583 # //webrtc/modules:modules_unittests_apk__create -->
584 # //webrtc/modules:modules_unittests_apk__create__finalize -->
585 # //webrtc/modules:modules_unittests_apk__create__package --[private]-->
586 # //webrtc/modules:_modules_unittests__library
587 check_includes = false
588 testonly = true
589 sources = [
590 "audio_processing_performance_unittest.cc",
591 "level_controller/level_controller_complexity_unittest.cc",
592 "residual_echo_detector_complexity_unittest.cc",
593 ]
594 deps = [
595 ":audio_processing",
596 ":audioproc_test_utils",
597 "//testing/gtest",
598 ]
599 if (rtc_enable_intelligibility_enhancer) {
600 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
601 } else {
602 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
603 }
604 }
605
ehmaldonado1fd08c12017-01-17 02:37:34 -0800606 if (rtc_enable_protobuf) {
607 rtc_executable("unpack_aecdump") {
608 testonly = true
609 sources = [
610 "test/unpack.cc",
611 ]
peahc3ec1fd2016-08-07 23:19:30 -0700612
ehmaldonado1fd08c12017-01-17 02:37:34 -0800613 deps = [
614 ":audio_processing",
615 ":audioproc_debug_proto",
616 ":audioproc_protobuf_utils",
617 ":audioproc_test_utils",
618 "../..:webrtc_common",
619 "../../base:rtc_base_approved",
620 "../../common_audio",
621 "../../system_wrappers:system_wrappers_default",
622 "//third_party/gflags:gflags",
623 ]
624 } # unpack_aecdump
peahc3ec1fd2016-08-07 23:19:30 -0700625
ehmaldonado1fd08c12017-01-17 02:37:34 -0800626 rtc_executable("audioproc_f") {
627 testonly = true
628 sources = [
629 "test/aec_dump_based_simulator.cc",
630 "test/aec_dump_based_simulator.h",
631 "test/audio_processing_simulator.cc",
632 "test/audio_processing_simulator.h",
633 "test/audioproc_float.cc",
634 "test/wav_based_simulator.cc",
635 "test/wav_based_simulator.h",
636 ]
peahc3ec1fd2016-08-07 23:19:30 -0700637
ehmaldonado1fd08c12017-01-17 02:37:34 -0800638 deps = [
639 ":audio_processing",
640 ":audioproc_debug_proto",
641 ":audioproc_protobuf_utils",
642 ":audioproc_test_utils",
643 "../../base:rtc_base_approved",
644 "../../common_audio:common_audio",
645 "../../system_wrappers",
646 "../../system_wrappers:system_wrappers_default",
647 "../../test:test_support",
648 "//testing/gtest",
649 "//third_party/gflags:gflags",
650 ]
651 } # audioproc_f
652 }
peahc3ec1fd2016-08-07 23:19:30 -0700653
ehmaldonado38a21322016-09-02 04:10:34 -0700654 rtc_source_set("audioproc_test_utils") {
kjellanderfb114242016-06-13 00:19:48 -0700655 testonly = true
656 sources = [
ehmaldonado529f83c2016-07-27 08:14:32 -0700657 "test/audio_buffer_tools.cc",
658 "test/audio_buffer_tools.h",
ivoc3cfb3ef2016-11-24 04:17:28 -0800659 "test/performance_timer.cc",
660 "test/performance_timer.h",
661 "test/simulator_buffers.cc",
662 "test/simulator_buffers.h",
kjellanderfb114242016-06-13 00:19:48 -0700663 "test/test_utils.cc",
664 "test/test_utils.h",
665 ]
666
kjellanderfb114242016-06-13 00:19:48 -0700667 deps = [
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800668 ":audio_processing",
kjellanderfb114242016-06-13 00:19:48 -0700669 "../../base:rtc_base_approved",
670 "../../common_audio",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800671 "../../system_wrappers:system_wrappers",
kjellanderfb114242016-06-13 00:19:48 -0700672 ]
673 }
674
ehmaldonado38a21322016-09-02 04:10:34 -0700675 rtc_executable("transient_suppression_test") {
kwiberg7a770e02016-08-25 02:32:43 -0700676 testonly = true
677 sources = [
678 "transient/file_utils.cc",
679 "transient/file_utils.h",
680 "transient/transient_suppression_test.cc",
681 ]
682 deps = [
683 ":audio_processing",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800684 "../..:webrtc_common",
685 "../../common_audio:common_audio",
kwiberg7a770e02016-08-25 02:32:43 -0700686 "../../system_wrappers:metrics_default",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800687 "../../system_wrappers:system_wrappers",
kwiberg7a770e02016-08-25 02:32:43 -0700688 "../../test:test_support",
689 "//testing/gtest",
690 "//third_party/gflags",
691 ]
kwiberg7a770e02016-08-25 02:32:43 -0700692 }
693
ehmaldonado38a21322016-09-02 04:10:34 -0700694 rtc_executable("click_annotate") {
kwiberg7a770e02016-08-25 02:32:43 -0700695 testonly = true
696 sources = [
697 "transient/click_annotate.cc",
698 "transient/file_utils.cc",
699 "transient/file_utils.h",
700 ]
701 deps = [
702 ":audio_processing",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800703 "../..:webrtc_common",
kwiberg7a770e02016-08-25 02:32:43 -0700704 "../../system_wrappers:metrics_default",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800705 "../../system_wrappers:system_wrappers",
kwiberg7a770e02016-08-25 02:32:43 -0700706 ]
707 }
708
ehmaldonado38a21322016-09-02 04:10:34 -0700709 rtc_executable("nonlinear_beamformer_test") {
kwiberg7a770e02016-08-25 02:32:43 -0700710 testonly = true
711 sources = [
712 "beamformer/nonlinear_beamformer_test.cc",
713 ]
714 deps = [
715 ":audio_processing",
716 ":audioproc_test_utils",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800717 "../../base:rtc_base_approved",
718 "../../common_audio:common_audio",
kwiberg7a770e02016-08-25 02:32:43 -0700719 "../../system_wrappers:metrics_default",
720 "//third_party/gflags",
721 ]
kwiberg7a770e02016-08-25 02:32:43 -0700722 }
723
peah1bcfce52016-08-26 07:16:04 -0700724 if (rtc_enable_intelligibility_enhancer) {
ehmaldonado38a21322016-09-02 04:10:34 -0700725 rtc_executable("intelligibility_proc") {
peah1bcfce52016-08-26 07:16:04 -0700726 testonly = true
727 sources = [
728 "intelligibility/test/intelligibility_proc.cc",
729 ]
730 deps = [
731 ":audio_processing",
732 ":audioproc_test_utils",
733 "../../system_wrappers:metrics_default",
734 "../../test:test_support",
735 "//testing/gtest",
736 "//third_party/gflags",
737 ]
kwiberg7a770e02016-08-25 02:32:43 -0700738 }
739 }
740
kjellanderfb114242016-06-13 00:19:48 -0700741 if (rtc_enable_protobuf) {
742 proto_library("audioproc_unittest_proto") {
743 sources = [
744 "test/unittest.proto",
745 ]
746 proto_out_dir = "webrtc/modules/audio_processing"
747 }
748
kjellanderb62dbbe2016-09-23 00:38:52 -0700749 rtc_static_library("audioproc_protobuf_utils") {
kjellanderfb114242016-06-13 00:19:48 -0700750 sources = [
751 "test/protobuf_utils.cc",
752 "test/protobuf_utils.h",
753 ]
754
755 deps = [
ehmaldonadobcba64a2016-08-19 02:11:07 -0700756 ":audioproc_debug_proto",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800757 "../..:webrtc_common",
758 "../../base:rtc_base_approved",
kjellanderfb114242016-06-13 00:19:48 -0700759 ]
760 }
761 }
762}