blob: 0f6de0905278e23a415eacfe0a37c84b22b0f15f [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",
peah522d71b2017-02-23 05:16:26 -080029 "aec3/adaptive_fir_filter.cc",
30 "aec3/adaptive_fir_filter.h",
31 "aec3/aec3_common.cc",
32 "aec3/aec3_common.h",
33 "aec3/aec3_fft.cc",
34 "aec3/aec3_fft.h",
35 "aec3/aec_state.cc",
36 "aec3/aec_state.h",
peahd0263542017-01-03 04:20:34 -080037 "aec3/block_framer.cc",
38 "aec3/block_framer.h",
39 "aec3/block_processor.cc",
40 "aec3/block_processor.h",
peahe985b3f2017-02-28 22:08:53 -080041 "aec3/block_processor_metrics.cc",
42 "aec3/block_processor_metrics.h",
peahd0263542017-01-03 04:20:34 -080043 "aec3/cascaded_biquad_filter.cc",
44 "aec3/cascaded_biquad_filter.h",
peah522d71b2017-02-23 05:16:26 -080045 "aec3/comfort_noise_generator.cc",
46 "aec3/comfort_noise_generator.h",
peah21920892017-02-08 05:08:56 -080047 "aec3/decimator_by_4.cc",
48 "aec3/decimator_by_4.h",
peahcf02cf12017-04-05 14:18:07 -070049 "aec3/downsampled_render_buffer.cc",
50 "aec3/downsampled_render_buffer.h",
peahe0eae3c2016-12-14 01:16:23 -080051 "aec3/echo_canceller3.cc",
52 "aec3/echo_canceller3.h",
peah69221db2017-01-27 03:28:19 -080053 "aec3/echo_path_delay_estimator.cc",
54 "aec3/echo_path_delay_estimator.h",
peah522d71b2017-02-23 05:16:26 -080055 "aec3/echo_path_variability.cc",
peah69221db2017-01-27 03:28:19 -080056 "aec3/echo_path_variability.h",
57 "aec3/echo_remover.cc",
58 "aec3/echo_remover.h",
peahe985b3f2017-02-28 22:08:53 -080059 "aec3/echo_remover_metrics.cc",
60 "aec3/echo_remover_metrics.h",
peah522d71b2017-02-23 05:16:26 -080061 "aec3/erl_estimator.cc",
62 "aec3/erl_estimator.h",
63 "aec3/erle_estimator.cc",
64 "aec3/erle_estimator.h",
peah522d71b2017-02-23 05:16:26 -080065 "aec3/fft_data.h",
peahd0263542017-01-03 04:20:34 -080066 "aec3/frame_blocker.cc",
67 "aec3/frame_blocker.h",
peah522d71b2017-02-23 05:16:26 -080068 "aec3/main_filter_update_gain.cc",
69 "aec3/main_filter_update_gain.h",
peah21920892017-02-08 05:08:56 -080070 "aec3/matched_filter.cc",
71 "aec3/matched_filter.h",
72 "aec3/matched_filter_lag_aggregator.cc",
73 "aec3/matched_filter_lag_aggregator.h",
peah522d71b2017-02-23 05:16:26 -080074 "aec3/output_selector.cc",
75 "aec3/output_selector.h",
peahcf02cf12017-04-05 14:18:07 -070076 "aec3/render_buffer.cc",
77 "aec3/render_buffer.h",
peah69221db2017-01-27 03:28:19 -080078 "aec3/render_delay_buffer.cc",
79 "aec3/render_delay_buffer.h",
80 "aec3/render_delay_controller.cc",
81 "aec3/render_delay_controller.h",
peahe985b3f2017-02-28 22:08:53 -080082 "aec3/render_delay_controller_metrics.cc",
83 "aec3/render_delay_controller_metrics.h",
peah522d71b2017-02-23 05:16:26 -080084 "aec3/render_signal_analyzer.cc",
85 "aec3/render_signal_analyzer.h",
86 "aec3/residual_echo_estimator.cc",
87 "aec3/residual_echo_estimator.h",
88 "aec3/shadow_filter_update_gain.cc",
89 "aec3/shadow_filter_update_gain.h",
90 "aec3/subtractor.cc",
91 "aec3/subtractor.h",
92 "aec3/subtractor_output.h",
93 "aec3/suppression_filter.cc",
94 "aec3/suppression_filter.h",
95 "aec3/suppression_gain.cc",
96 "aec3/suppression_gain.h",
peah5e79b292017-04-12 01:20:45 -070097 "aec3/vector_math.h",
peah27045122016-04-10 22:38:14 -070098 "aecm/aecm_core.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000099 "aecm/aecm_core.h",
peah27045122016-04-10 22:38:14 -0700100 "aecm/echo_control_mobile.cc",
Henrik Kjellander9b72af92015-11-11 20:16:11 +0100101 "aecm/echo_control_mobile.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +0000102 "agc/agc.cc",
103 "agc/agc.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +0000104 "agc/agc_manager_direct.cc",
105 "agc/agc_manager_direct.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +0000106 "agc/gain_map_internal.h",
peahbbe42332016-06-08 06:42:02 -0700107 "agc/loudness_histogram.cc",
108 "agc/loudness_histogram.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +0000109 "agc/utility.cc",
110 "agc/utility.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000111 "audio_buffer.cc",
112 "audio_buffer.h",
113 "audio_processing_impl.cc",
114 "audio_processing_impl.h",
aluebs4a66e4a2015-10-19 18:02:39 -0700115 "beamformer/array_util.cc",
116 "beamformer/array_util.h",
aluebs@webrtc.org0c39e912014-12-18 22:22:04 +0000117 "beamformer/complex_matrix.h",
118 "beamformer/covariance_matrix_generator.cc",
119 "beamformer/covariance_matrix_generator.h",
120 "beamformer/matrix.h",
andrew@webrtc.orgbd8c8652015-03-20 00:28:22 +0000121 "beamformer/nonlinear_beamformer.cc",
122 "beamformer/nonlinear_beamformer.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000123 "common.h",
124 "echo_cancellation_impl.cc",
125 "echo_cancellation_impl.h",
126 "echo_control_mobile_impl.cc",
127 "echo_control_mobile_impl.h",
ivocaf27ed02016-10-28 07:04:03 -0700128 "echo_detector/circular_buffer.cc",
129 "echo_detector/circular_buffer.h",
130 "echo_detector/mean_variance_estimator.cc",
131 "echo_detector/mean_variance_estimator.h",
ivoc4e477a12017-01-15 08:29:46 -0800132 "echo_detector/moving_max.cc",
133 "echo_detector/moving_max.h",
ivocaf27ed02016-10-28 07:04:03 -0700134 "echo_detector/normalized_covariance_estimator.cc",
135 "echo_detector/normalized_covariance_estimator.h",
peahbe615622016-02-13 16:40:47 -0800136 "gain_control_for_experimental_agc.cc",
137 "gain_control_for_experimental_agc.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000138 "gain_control_impl.cc",
139 "gain_control_impl.h",
peahc19f3122016-10-07 14:54:10 -0700140 "include/audio_processing.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000141 "include/audio_processing.h",
solenberg88499ec2016-09-07 07:34:41 -0700142 "include/config.cc",
143 "include/config.h",
peahca4cac72016-06-29 15:26:12 -0700144 "level_controller/biquad_filter.cc",
145 "level_controller/biquad_filter.h",
146 "level_controller/down_sampler.cc",
147 "level_controller/down_sampler.h",
148 "level_controller/gain_applier.cc",
149 "level_controller/gain_applier.h",
150 "level_controller/gain_selector.cc",
151 "level_controller/gain_selector.h",
peahca4cac72016-06-29 15:26:12 -0700152 "level_controller/level_controller.cc",
153 "level_controller/level_controller.h",
peahc19f3122016-10-07 14:54:10 -0700154 "level_controller/level_controller_constants.h",
peahca4cac72016-06-29 15:26:12 -0700155 "level_controller/noise_level_estimator.cc",
156 "level_controller/noise_level_estimator.h",
157 "level_controller/noise_spectrum_estimator.cc",
158 "level_controller/noise_spectrum_estimator.h",
159 "level_controller/peak_level_estimator.cc",
160 "level_controller/peak_level_estimator.h",
161 "level_controller/saturating_gain_estimator.cc",
162 "level_controller/saturating_gain_estimator.h",
163 "level_controller/signal_classifier.cc",
164 "level_controller/signal_classifier.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000165 "level_estimator_impl.cc",
166 "level_estimator_impl.h",
peahb46083e2016-05-03 07:01:18 -0700167 "logging/apm_data_dumper.cc",
168 "logging/apm_data_dumper.h",
peah8271d042016-11-22 07:24:52 -0800169 "low_cut_filter.cc",
170 "low_cut_filter.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000171 "noise_suppression_impl.cc",
172 "noise_suppression_impl.h",
peah737f4b82016-03-10 23:05:28 -0800173 "render_queue_item_verifier.h",
ivoc9f4a4a02016-10-28 05:39:16 -0700174 "residual_echo_detector.cc",
175 "residual_echo_detector.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000176 "rms_level.cc",
177 "rms_level.h",
aluebs@webrtc.orgbe05c742014-11-14 22:18:10 +0000178 "splitting_filter.cc",
179 "splitting_filter.h",
Alejandro Luebs5a92aa82015-04-27 11:34:45 -0700180 "three_band_filter_bank.cc",
181 "three_band_filter_bank.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +0000182 "transient/common.h",
183 "transient/daubechies_8_wavelet_coeffs.h",
184 "transient/dyadic_decimator.h",
185 "transient/moving_moments.cc",
186 "transient/moving_moments.h",
187 "transient/transient_detector.cc",
188 "transient/transient_detector.h",
189 "transient/transient_suppressor.cc",
190 "transient/transient_suppressor.h",
191 "transient/wpd_node.cc",
192 "transient/wpd_node.h",
193 "transient/wpd_tree.cc",
194 "transient/wpd_tree.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000195 "typing_detection.cc",
196 "typing_detection.h",
minyue84db6fa2016-03-24 14:36:25 -0700197 "utility/block_mean_calculator.cc",
198 "utility/block_mean_calculator.h",
peahbdb7af62016-04-12 14:47:40 -0700199 "utility/delay_estimator.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000200 "utility/delay_estimator.h",
201 "utility/delay_estimator_internal.h",
peahbdb7af62016-04-12 14:47:40 -0700202 "utility/delay_estimator_wrapper.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000203 "utility/delay_estimator_wrapper.h",
peah81b92912016-10-06 06:46:20 -0700204 "utility/ooura_fft.cc",
205 "utility/ooura_fft.h",
206 "utility/ooura_fft_tables_common.h",
aluebsecf6b812015-06-25 12:28:48 -0700207 "vad/common.h",
208 "vad/gmm.cc",
209 "vad/gmm.h",
210 "vad/noise_gmm_tables.h",
211 "vad/pitch_based_vad.cc",
212 "vad/pitch_based_vad.h",
213 "vad/pitch_internal.cc",
214 "vad/pitch_internal.h",
215 "vad/pole_zero_filter.cc",
216 "vad/pole_zero_filter.h",
217 "vad/standalone_vad.cc",
218 "vad/standalone_vad.h",
219 "vad/vad_audio_proc.cc",
220 "vad/vad_audio_proc.h",
221 "vad/vad_audio_proc_internal.h",
222 "vad/vad_circular_buffer.cc",
223 "vad/vad_circular_buffer.h",
224 "vad/voice_activity_detector.cc",
225 "vad/voice_activity_detector.h",
226 "vad/voice_gmm_tables.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000227 "voice_detection_impl.cc",
228 "voice_detection_impl.h",
229 ]
230
231 defines = []
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200232 deps = [
233 "../..:webrtc_common",
aleloi6321b492016-12-05 01:46:09 -0800234 "../../audio/utility:audio_frame_operations",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800235 "../../base:gtest_prod",
mbonadei7c2c8432017-04-07 00:59:12 -0700236 "../../base:protobuf_utils",
kwiberg98ab3a42015-09-30 21:54:21 -0700237 "../audio_coding:isac",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200238 ]
kjellander7439f972016-12-05 22:47:46 -0800239 public_deps = [
240 ":audio_processing_c",
241 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000242
peahf28a3892016-09-01 08:58:21 -0700243 if (apm_debug_dump) {
244 defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ]
peahb46083e2016-05-03 07:01:18 -0700245 } else {
peahf28a3892016-09-01 08:58:21 -0700246 defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000247 }
248
249 if (aec_untrusted_delay_for_testing) {
250 defines += [ "WEBRTC_UNTRUSTED_DELAY" ]
251 }
252
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000253 if (rtc_enable_protobuf) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000254 defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ]
255 deps += [ ":audioproc_debug_proto" ]
256 }
257
peah1bcfce52016-08-26 07:16:04 -0700258 if (rtc_enable_intelligibility_enhancer) {
259 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
260 sources += [
261 "intelligibility/intelligibility_enhancer.cc",
262 "intelligibility/intelligibility_enhancer.h",
263 "intelligibility/intelligibility_utils.cc",
264 "intelligibility/intelligibility_utils.h",
265 ]
266 } else {
267 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
268 }
269
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000270 if (rtc_prefer_fixed_point) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000271 defines += [ "WEBRTC_NS_FIXED" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000272 } else {
273 defines += [ "WEBRTC_NS_FLOAT" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000274 }
275
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000276 if (current_cpu == "x86" || current_cpu == "x64") {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000277 deps += [ ":audio_processing_sse2" ]
278 }
279
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700280 if (rtc_build_with_neon) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000281 deps += [ ":audio_processing_neon" ]
282 }
283
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000284 if (current_cpu == "mipsel") {
peah27045122016-04-10 22:38:14 -0700285 sources += [ "aecm/aecm_core_mips.cc" ]
kjellander@webrtc.org6dab6d72015-03-04 09:50:31 +0000286 if (mips_float_abi == "hard") {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000287 sources += [
peah8df5d4f2016-02-23 14:34:59 -0800288 "aec/aec_core_mips.cc",
peah81b92912016-10-06 06:46:20 -0700289 "utility/ooura_fft_mips.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000290 ]
291 }
292 } else {
peah27045122016-04-10 22:38:14 -0700293 sources += [ "aecm/aecm_core_c.cc" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000294 }
295
kjellander8f4419b2016-06-02 02:09:52 -0700296 # TODO(jschuh): Bug 1348: fix this warning.
297 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000298
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000299 deps += [
xians@webrtc.orge46bc772014-10-10 08:36:56 +0000300 "../../base:rtc_base_approved",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000301 "../../common_audio",
302 "../../system_wrappers",
303 ]
304}
305
kjellander7439f972016-12-05 22:47:46 -0800306rtc_source_set("audio_processing_c") {
307 visibility = [ ":*" ] # Only targets in this file can depend on this.
308 sources = [
309 "agc/legacy/analog_agc.c",
310 "agc/legacy/analog_agc.h",
311 "agc/legacy/digital_agc.c",
312 "agc/legacy/digital_agc.h",
313 "agc/legacy/gain_control.h",
314 ]
315
316 if (rtc_prefer_fixed_point) {
317 sources += [
318 "ns/noise_suppression_x.c",
319 "ns/noise_suppression_x.h",
320 "ns/nsx_core.c",
321 "ns/nsx_core.h",
322 "ns/nsx_defines.h",
323 ]
324 if (current_cpu == "mipsel") {
325 sources += [ "ns/nsx_core_mips.c" ]
326 } else {
327 sources += [ "ns/nsx_core_c.c" ]
328 }
329 } else {
330 sources += [
331 "ns/defines.h",
332 "ns/noise_suppression.c",
333 "ns/noise_suppression.h",
334 "ns/ns_core.c",
335 "ns/ns_core.h",
336 "ns/windows_private.h",
337 ]
338 }
339
340 deps = [
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800341 "../..:webrtc_common",
kjellander7439f972016-12-05 22:47:46 -0800342 "../../base:rtc_base_approved",
343 "../../common_audio",
344 "../../system_wrappers",
345 ]
mbonadeie5dc3ce2017-01-25 05:34:46 -0800346
347 if (rtc_build_with_neon) {
348 deps += [ ":audio_processing_neon_c" ]
349 }
kjellander7439f972016-12-05 22:47:46 -0800350}
351
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000352if (rtc_enable_protobuf) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000353 proto_library("audioproc_debug_proto") {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200354 sources = [
355 "debug.proto",
356 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000357
kjellander78ddd732016-02-09 08:13:06 -0800358 proto_out_dir = "webrtc/modules/audio_processing"
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000359 }
360}
361
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000362if (current_cpu == "x86" || current_cpu == "x64") {
kjellanderb62dbbe2016-09-23 00:38:52 -0700363 rtc_static_library("audio_processing_sse2") {
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800364 # TODO(ehmaldonado): Remove (bugs.webrtc.org/6828)
365 # Errors on cyclic dependency with :audio_processing if enabled.
366 check_includes = false
367
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000368 sources = [
peah8df5d4f2016-02-23 14:34:59 -0800369 "aec/aec_core_sse2.cc",
peah81b92912016-10-06 06:46:20 -0700370 "utility/ooura_fft_sse2.cc",
371 "utility/ooura_fft_tables_neon_sse2.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000372 ]
373
Henrik Kjellanderf2497cf2015-04-16 08:57:16 +0200374 if (is_posix) {
375 cflags = [ "-msse2" ]
376 }
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000377
peahf28a3892016-09-01 08:58:21 -0700378 if (apm_debug_dump) {
379 defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ]
peahb46083e2016-05-03 07:01:18 -0700380 } else {
peahf28a3892016-09-01 08:58:21 -0700381 defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ]
peahb46083e2016-05-03 07:01:18 -0700382 }
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000383 }
384}
385
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700386if (rtc_build_with_neon) {
kjellanderb62dbbe2016-09-23 00:38:52 -0700387 rtc_static_library("audio_processing_neon") {
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800388 # TODO(ehmaldonado): Remove (bugs.webrtc.org/6828)
389 # Errors on cyclic dependency with :audio_processing if enabled.
390 check_includes = false
391
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000392 sources = [
peah8df5d4f2016-02-23 14:34:59 -0800393 "aec/aec_core_neon.cc",
peah27045122016-04-10 22:38:14 -0700394 "aecm/aecm_core_neon.cc",
peah81b92912016-10-06 06:46:20 -0700395 "utility/ooura_fft_neon.cc",
396 "utility/ooura_fft_tables_neon_sse2.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000397 ]
398
kjellander@webrtc.org72273912015-02-23 19:08:31 +0000399 if (current_cpu != "arm64") {
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700400 # Enable compilation for the NEON instruction set. This is needed
401 # since //build/config/arm.gni only enables NEON for iOS, not Android.
402 # This provides the same functionality as webrtc/build/arm_neon.gypi.
ehmaldonado38a21322016-09-02 04:10:34 -0700403 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200404 cflags = [ "-mfpu=neon" ]
andrew@webrtc.orga56a2c52014-11-26 17:01:40 +0000405 }
406
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700407 # Disable LTO on NEON targets due to compiler bug.
408 # TODO(fdegans): Enable this. See crbug.com/408997.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000409 if (rtc_use_lto) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000410 cflags -= [
411 "-flto",
412 "-ffat-lto-objects",
413 ]
414 }
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700415
Andrew MacDonaldac4234c2015-06-24 18:25:54 -0700416 deps = [
417 "../../common_audio",
418 ]
kjellander7439f972016-12-05 22:47:46 -0800419 public_deps = [
420 ":audio_processing_neon_c",
421 ]
peahb46083e2016-05-03 07:01:18 -0700422
peahf28a3892016-09-01 08:58:21 -0700423 if (apm_debug_dump) {
424 defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ]
peahb46083e2016-05-03 07:01:18 -0700425 } else {
peahf28a3892016-09-01 08:58:21 -0700426 defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ]
peahb46083e2016-05-03 07:01:18 -0700427 }
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000428 }
kjellander7439f972016-12-05 22:47:46 -0800429
430 rtc_static_library("audio_processing_neon_c") {
mbonadeie5dc3ce2017-01-25 05:34:46 -0800431 # TODO(mbonadei): Remove (bugs.webrtc.org/6828)
432 # Errors on cyclic dependency with :audio_processing_c if enabled.
433 check_includes = false
434
kjellander7439f972016-12-05 22:47:46 -0800435 sources = [
436 "ns/nsx_core_neon.c",
437 ]
438
439 if (current_cpu != "arm64") {
440 # Enable compilation for the NEON instruction set. This is needed
441 # since //build/config/arm.gni only enables NEON for iOS, not Android.
442 # This provides the same functionality as webrtc/build/arm_neon.gypi.
443 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
444 cflags = [ "-mfpu=neon" ]
445 }
446
447 # Disable LTO on NEON targets due to compiler bug.
448 # TODO(fdegans): Enable this. See crbug.com/408997.
449 if (rtc_use_lto) {
450 cflags -= [
451 "-flto",
452 "-ffat-lto-objects",
453 ]
454 }
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800455 deps = [
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800456 "../../base:rtc_base_approved",
457 ]
kjellander7439f972016-12-05 22:47:46 -0800458 }
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +0000459}
kjellanderfb114242016-06-13 00:19:48 -0700460
461if (rtc_include_tests) {
kjellander6ceab082016-10-28 05:44:03 -0700462 group("audio_processing_tests") {
463 testonly = true
464 public_deps = [
kjellander6ceab082016-10-28 05:44:03 -0700465 ":audioproc_test_utils",
466 ":click_annotate",
467 ":nonlinear_beamformer_test",
468 ":transient_suppression_test",
kjellander6ceab082016-10-28 05:44:03 -0700469 ]
470
471 if (rtc_enable_intelligibility_enhancer) {
472 public_deps += [ ":intelligibility_proc" ]
473 }
474
475 if (rtc_enable_protobuf) {
ehmaldonado1fd08c12017-01-17 02:37:34 -0800476 public_deps += [
477 ":audioproc_f",
478 ":audioproc_unittest_proto",
479 ":unpack_aecdump",
alessiob5f32aca2017-03-18 02:29:13 -0700480 "test/conversational_speech",
alessiob306d1bf2017-02-24 05:32:21 -0800481 "test/py_quality_assessment",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800482 ]
kjellander6ceab082016-10-28 05:44:03 -0700483 }
484 }
485
ehmaldonado36268652017-01-19 08:27:11 -0800486 rtc_source_set("audio_processing_unittests") {
487 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700488
489 # Skip restricting visibility on mobile platforms since the tests on those
490 # gets additional generated targets which would require many lines here to
491 # cover (which would be confusing to read and hard to maintain).
492 if (!is_android && !is_ios) {
493 visibility = [ "//webrtc/modules:modules_unittests" ]
494 }
ehmaldonado36268652017-01-19 08:27:11 -0800495 sources = [
496 "aec/echo_cancellation_unittest.cc",
497 "aec/system_delay_unittest.cc",
498 "agc/agc_manager_direct_unittest.cc",
499 "agc/loudness_histogram_unittest.cc",
500 "agc/mock_agc.h",
501 "audio_buffer_unittest.cc",
502 "beamformer/array_util_unittest.cc",
503 "beamformer/complex_matrix_unittest.cc",
504 "beamformer/covariance_matrix_generator_unittest.cc",
505 "beamformer/matrix_unittest.cc",
506 "beamformer/mock_nonlinear_beamformer.h",
ehmaldonado36268652017-01-19 08:27:11 -0800507 "config_unittest.cc",
508 "echo_cancellation_impl_unittest.cc",
509 "splitting_filter_unittest.cc",
510 "transient/dyadic_decimator_unittest.cc",
511 "transient/file_utils.cc",
512 "transient/file_utils.h",
513 "transient/file_utils_unittest.cc",
514 "transient/moving_moments_unittest.cc",
515 "transient/transient_detector_unittest.cc",
516 "transient/transient_suppressor_unittest.cc",
517 "transient/wpd_node_unittest.cc",
518 "transient/wpd_tree_unittest.cc",
519 "utility/block_mean_calculator_unittest.cc",
520 "utility/delay_estimator_unittest.cc",
521 "vad/gmm_unittest.cc",
522 "vad/pitch_based_vad_unittest.cc",
523 "vad/pitch_internal_unittest.cc",
524 "vad/pole_zero_filter_unittest.cc",
525 "vad/standalone_vad_unittest.cc",
526 "vad/vad_audio_proc_unittest.cc",
527 "vad/vad_circular_buffer_unittest.cc",
528 "vad/voice_activity_detector_unittest.cc",
529 ]
530
531 deps = [
532 ":audio_processing",
ehmaldonado36268652017-01-19 08:27:11 -0800533 ":audioproc_test_utils",
534 "../..:webrtc_common",
535 "../../base:gtest_prod",
mbonadei7c2c8432017-04-07 00:59:12 -0700536 "../../base:protobuf_utils",
ehmaldonado36268652017-01-19 08:27:11 -0800537 "../../base:rtc_base",
538 "../../base:rtc_base_approved",
539 "../../common_audio:common_audio",
540 "../../system_wrappers:system_wrappers",
541 "../../test:test_support",
542 "../audio_coding:neteq_unittest_tools",
alessiob4b6463c2017-03-23 05:17:06 -0700543 "test/conversational_speech:unittest",
ehmaldonado36268652017-01-19 08:27:11 -0800544 "//testing/gmock",
545 "//testing/gtest",
546 ]
547
548 defines = []
549
550 if (apm_debug_dump) {
551 defines += [ "WEBRTC_APM_DEBUG_DUMP=1" ]
552 } else {
553 defines += [ "WEBRTC_APM_DEBUG_DUMP=0" ]
554 }
555
556 if (rtc_enable_intelligibility_enhancer) {
557 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
558 sources += [
559 "intelligibility/intelligibility_enhancer_unittest.cc",
560 "intelligibility/intelligibility_utils_unittest.cc",
561 ]
562 } else {
563 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
564 }
565
566 if (rtc_prefer_fixed_point) {
567 defines += [ "WEBRTC_AUDIOPROC_FIXED_PROFILE" ]
568 } else {
569 defines += [ "WEBRTC_AUDIOPROC_FLOAT_PROFILE" ]
570 }
571
572 if (rtc_enable_protobuf) {
573 defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ]
574 deps += [
ehmaldonadof49ff262017-01-23 04:26:02 -0800575 ":audioproc_debug_proto",
ehmaldonado36268652017-01-19 08:27:11 -0800576 ":audioproc_protobuf_utils",
577 ":audioproc_unittest_proto",
578 ]
579 sources += [
peah522d71b2017-02-23 05:16:26 -0800580 "aec3/adaptive_fir_filter_unittest.cc",
581 "aec3/aec3_fft_unittest.cc",
582 "aec3/aec_state_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800583 "aec3/block_framer_unittest.cc",
peahe985b3f2017-02-28 22:08:53 -0800584 "aec3/block_processor_metrics_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800585 "aec3/block_processor_unittest.cc",
586 "aec3/cascaded_biquad_filter_unittest.cc",
peah522d71b2017-02-23 05:16:26 -0800587 "aec3/comfort_noise_generator_unittest.cc",
peah21920892017-02-08 05:08:56 -0800588 "aec3/decimator_by_4_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800589 "aec3/echo_canceller3_unittest.cc",
peah69221db2017-01-27 03:28:19 -0800590 "aec3/echo_path_delay_estimator_unittest.cc",
peah522d71b2017-02-23 05:16:26 -0800591 "aec3/echo_path_variability_unittest.cc",
peahe985b3f2017-02-28 22:08:53 -0800592 "aec3/echo_remover_metrics_unittest.cc",
peah69221db2017-01-27 03:28:19 -0800593 "aec3/echo_remover_unittest.cc",
peah522d71b2017-02-23 05:16:26 -0800594 "aec3/erl_estimator_unittest.cc",
595 "aec3/erle_estimator_unittest.cc",
peah522d71b2017-02-23 05:16:26 -0800596 "aec3/fft_data_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800597 "aec3/frame_blocker_unittest.cc",
peah522d71b2017-02-23 05:16:26 -0800598 "aec3/main_filter_update_gain_unittest.cc",
peah21920892017-02-08 05:08:56 -0800599 "aec3/matched_filter_lag_aggregator_unittest.cc",
600 "aec3/matched_filter_unittest.cc",
peah522d71b2017-02-23 05:16:26 -0800601 "aec3/output_selector_unittest.cc",
peahcf02cf12017-04-05 14:18:07 -0700602 "aec3/render_buffer_unittest.cc",
peah69221db2017-01-27 03:28:19 -0800603 "aec3/render_delay_buffer_unittest.cc",
peahe985b3f2017-02-28 22:08:53 -0800604 "aec3/render_delay_controller_metrics_unittest.cc",
peah69221db2017-01-27 03:28:19 -0800605 "aec3/render_delay_controller_unittest.cc",
peah522d71b2017-02-23 05:16:26 -0800606 "aec3/render_signal_analyzer_unittest.cc",
607 "aec3/residual_echo_estimator_unittest.cc",
608 "aec3/shadow_filter_update_gain_unittest.cc",
609 "aec3/subtractor_unittest.cc",
610 "aec3/suppression_filter_unittest.cc",
611 "aec3/suppression_gain_unittest.cc",
peah5e79b292017-04-12 01:20:45 -0700612 "aec3/vector_math_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800613 "audio_processing_impl_locking_unittest.cc",
614 "audio_processing_impl_unittest.cc",
615 "audio_processing_unittest.cc",
ehmaldonadof49ff262017-01-23 04:26:02 -0800616 "beamformer/nonlinear_beamformer_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800617 "echo_cancellation_bit_exact_unittest.cc",
618 "echo_control_mobile_unittest.cc",
619 "echo_detector/circular_buffer_unittest.cc",
620 "echo_detector/mean_variance_estimator_unittest.cc",
621 "echo_detector/moving_max_unittest.cc",
622 "echo_detector/normalized_covariance_estimator_unittest.cc",
623 "gain_control_unittest.cc",
624 "level_controller/level_controller_unittest.cc",
625 "level_estimator_unittest.cc",
626 "low_cut_filter_unittest.cc",
627 "noise_suppression_unittest.cc",
628 "residual_echo_detector_unittest.cc",
629 "rms_level_unittest.cc",
630 "test/bitexactness_tools.cc",
631 "test/bitexactness_tools.h",
632 "test/debug_dump_replayer.cc",
633 "test/debug_dump_replayer.h",
634 "test/debug_dump_test.cc",
peah69221db2017-01-27 03:28:19 -0800635 "test/echo_canceller_test_tools.cc",
636 "test/echo_canceller_test_tools.h",
637 "test/echo_canceller_test_tools_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800638 "test/test_utils.h",
639 "voice_detection_unittest.cc",
640 ]
641 }
642
643 if ((!build_with_chromium || is_win) && is_clang) {
644 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
645 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
646 }
647 }
648
ehmaldonado021eef32017-01-05 07:09:50 -0800649 rtc_source_set("audio_processing_perf_tests") {
650 # Has problems with autogenerated targets on Android and iOS
651 # Dependency chain (there may also be others):
652 # //webrtc/modules/audio_processing:audio_processing_perf_tests -->
653 # //webrtc/modules:modules_unittests --[private]-->
654 # //webrtc/modules:modules_unittests_apk -->
655 # //webrtc/modules:modules_unittests_apk__create -->
656 # //webrtc/modules:modules_unittests_apk__create__finalize -->
657 # //webrtc/modules:modules_unittests_apk__create__package --[private]-->
658 # //webrtc/modules:_modules_unittests__library
659 check_includes = false
660 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700661
662 # Skip restricting visibility on mobile platforms since the tests on those
663 # gets additional generated targets which would require many lines here to
664 # cover (which would be confusing to read and hard to maintain).
665 if (!is_android && !is_ios) {
666 visibility = [ "//webrtc:webrtc_perf_tests" ]
667 }
ehmaldonado021eef32017-01-05 07:09:50 -0800668 sources = [
669 "audio_processing_performance_unittest.cc",
670 "level_controller/level_controller_complexity_unittest.cc",
671 "residual_echo_detector_complexity_unittest.cc",
672 ]
673 deps = [
674 ":audio_processing",
675 ":audioproc_test_utils",
mbonadei7c2c8432017-04-07 00:59:12 -0700676 "../../base:protobuf_utils",
ehmaldonado021eef32017-01-05 07:09:50 -0800677 "//testing/gtest",
678 ]
mbonadei7c2c8432017-04-07 00:59:12 -0700679
ehmaldonado021eef32017-01-05 07:09:50 -0800680 if (rtc_enable_intelligibility_enhancer) {
681 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
682 } else {
683 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
684 }
685 }
686
ehmaldonado1fd08c12017-01-17 02:37:34 -0800687 if (rtc_enable_protobuf) {
688 rtc_executable("unpack_aecdump") {
689 testonly = true
690 sources = [
691 "test/unpack.cc",
692 ]
peahc3ec1fd2016-08-07 23:19:30 -0700693
ehmaldonado1fd08c12017-01-17 02:37:34 -0800694 deps = [
695 ":audio_processing",
696 ":audioproc_debug_proto",
697 ":audioproc_protobuf_utils",
698 ":audioproc_test_utils",
699 "../..:webrtc_common",
mbonadei7c2c8432017-04-07 00:59:12 -0700700 "../../base:protobuf_utils",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800701 "../../base:rtc_base_approved",
702 "../../common_audio",
703 "../../system_wrappers:system_wrappers_default",
704 "//third_party/gflags:gflags",
705 ]
706 } # unpack_aecdump
peahc3ec1fd2016-08-07 23:19:30 -0700707
ehmaldonado1fd08c12017-01-17 02:37:34 -0800708 rtc_executable("audioproc_f") {
709 testonly = true
710 sources = [
711 "test/aec_dump_based_simulator.cc",
712 "test/aec_dump_based_simulator.h",
713 "test/audio_processing_simulator.cc",
714 "test/audio_processing_simulator.h",
715 "test/audioproc_float.cc",
716 "test/wav_based_simulator.cc",
717 "test/wav_based_simulator.h",
718 ]
peahc3ec1fd2016-08-07 23:19:30 -0700719
ehmaldonado1fd08c12017-01-17 02:37:34 -0800720 deps = [
721 ":audio_processing",
722 ":audioproc_debug_proto",
723 ":audioproc_protobuf_utils",
724 ":audioproc_test_utils",
mbonadei7c2c8432017-04-07 00:59:12 -0700725 "../../base:protobuf_utils",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800726 "../../base:rtc_base_approved",
727 "../../common_audio:common_audio",
728 "../../system_wrappers",
729 "../../system_wrappers:system_wrappers_default",
730 "../../test:test_support",
731 "//testing/gtest",
732 "//third_party/gflags:gflags",
733 ]
734 } # audioproc_f
735 }
peahc3ec1fd2016-08-07 23:19:30 -0700736
ehmaldonado38a21322016-09-02 04:10:34 -0700737 rtc_source_set("audioproc_test_utils") {
kjellanderfb114242016-06-13 00:19:48 -0700738 testonly = true
739 sources = [
ehmaldonado529f83c2016-07-27 08:14:32 -0700740 "test/audio_buffer_tools.cc",
741 "test/audio_buffer_tools.h",
ivoc3cfb3ef2016-11-24 04:17:28 -0800742 "test/performance_timer.cc",
743 "test/performance_timer.h",
744 "test/simulator_buffers.cc",
745 "test/simulator_buffers.h",
kjellanderfb114242016-06-13 00:19:48 -0700746 "test/test_utils.cc",
747 "test/test_utils.h",
748 ]
749
kjellanderfb114242016-06-13 00:19:48 -0700750 deps = [
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800751 ":audio_processing",
kjellanderfb114242016-06-13 00:19:48 -0700752 "../../base:rtc_base_approved",
753 "../../common_audio",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800754 "../../system_wrappers:system_wrappers",
kjellanderfb114242016-06-13 00:19:48 -0700755 ]
756 }
757
ehmaldonado38a21322016-09-02 04:10:34 -0700758 rtc_executable("transient_suppression_test") {
kwiberg7a770e02016-08-25 02:32:43 -0700759 testonly = true
760 sources = [
761 "transient/file_utils.cc",
762 "transient/file_utils.h",
763 "transient/transient_suppression_test.cc",
764 ]
765 deps = [
766 ":audio_processing",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800767 "../..:webrtc_common",
768 "../../common_audio:common_audio",
kwiberg7a770e02016-08-25 02:32:43 -0700769 "../../system_wrappers:metrics_default",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800770 "../../system_wrappers:system_wrappers",
kwiberg7a770e02016-08-25 02:32:43 -0700771 "../../test:test_support",
772 "//testing/gtest",
773 "//third_party/gflags",
774 ]
kwiberg7a770e02016-08-25 02:32:43 -0700775 }
776
ehmaldonado38a21322016-09-02 04:10:34 -0700777 rtc_executable("click_annotate") {
kwiberg7a770e02016-08-25 02:32:43 -0700778 testonly = true
779 sources = [
780 "transient/click_annotate.cc",
781 "transient/file_utils.cc",
782 "transient/file_utils.h",
783 ]
784 deps = [
785 ":audio_processing",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800786 "../..:webrtc_common",
kwiberg7a770e02016-08-25 02:32:43 -0700787 "../../system_wrappers:metrics_default",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800788 "../../system_wrappers:system_wrappers",
kwiberg7a770e02016-08-25 02:32:43 -0700789 ]
790 }
791
ehmaldonado38a21322016-09-02 04:10:34 -0700792 rtc_executable("nonlinear_beamformer_test") {
kwiberg7a770e02016-08-25 02:32:43 -0700793 testonly = true
794 sources = [
795 "beamformer/nonlinear_beamformer_test.cc",
796 ]
797 deps = [
798 ":audio_processing",
799 ":audioproc_test_utils",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800800 "../../base:rtc_base_approved",
801 "../../common_audio:common_audio",
kwiberg7a770e02016-08-25 02:32:43 -0700802 "../../system_wrappers:metrics_default",
803 "//third_party/gflags",
804 ]
kwiberg7a770e02016-08-25 02:32:43 -0700805 }
806
peah1bcfce52016-08-26 07:16:04 -0700807 if (rtc_enable_intelligibility_enhancer) {
ehmaldonado38a21322016-09-02 04:10:34 -0700808 rtc_executable("intelligibility_proc") {
peah1bcfce52016-08-26 07:16:04 -0700809 testonly = true
810 sources = [
811 "intelligibility/test/intelligibility_proc.cc",
812 ]
813 deps = [
814 ":audio_processing",
815 ":audioproc_test_utils",
816 "../../system_wrappers:metrics_default",
817 "../../test:test_support",
818 "//testing/gtest",
819 "//third_party/gflags",
820 ]
kwiberg7a770e02016-08-25 02:32:43 -0700821 }
822 }
823
kjellanderfb114242016-06-13 00:19:48 -0700824 if (rtc_enable_protobuf) {
825 proto_library("audioproc_unittest_proto") {
826 sources = [
827 "test/unittest.proto",
828 ]
kjellandere3e902e2017-02-28 08:01:46 -0800829 proto_out_dir = "webrtc/modules/audio_processing/test"
kjellanderfb114242016-06-13 00:19:48 -0700830 }
831
kjellanderb62dbbe2016-09-23 00:38:52 -0700832 rtc_static_library("audioproc_protobuf_utils") {
kjellanderfb114242016-06-13 00:19:48 -0700833 sources = [
834 "test/protobuf_utils.cc",
835 "test/protobuf_utils.h",
836 ]
837
838 deps = [
ehmaldonadobcba64a2016-08-19 02:11:07 -0700839 ":audioproc_debug_proto",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800840 "../..:webrtc_common",
mbonadei7c2c8432017-04-07 00:59:12 -0700841 "../../base:protobuf_utils",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800842 "../../base:rtc_base_approved",
kjellanderfb114242016-06-13 00:19:48 -0700843 ]
844 }
845 }
846}