blob: 9e714461e9632cade91277a4a97ce439027ef292 [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
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../../webrtc.gni")
Dan Minor9c686132018-01-15 10:20:00 -050010if (!build_with_mozilla) {
11 import("//third_party/protobuf/proto_library.gni")
12}
kjellander@webrtc.org1227ab82014-06-23 19:21:07 +000013
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000014declare_args() {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000015 # Disables the usual mode where we trust the reported system delay
16 # values the AEC receives. The corresponding define is set appropriately
17 # in the code, but it can be force-enabled here for testing.
18 aec_untrusted_delay_for_testing = false
19}
20
Patrik Höglundd75c8dc2017-12-19 09:45:24 +010021config("apm_debug_dump") {
22 if (apm_debug_dump) {
23 defines = [ "WEBRTC_APM_DEBUG_DUMP=1" ]
24 } else {
25 defines = [ "WEBRTC_APM_DEBUG_DUMP=0" ]
26 }
27}
28
kjellanderb62dbbe2016-09-23 00:38:52 -070029rtc_static_library("audio_processing") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000030 visibility = [ "*" ]
Patrik Höglundd75c8dc2017-12-19 09:45:24 +010031 configs += [ ":apm_debug_dump" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000032 sources = [
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000033 "audio_buffer.cc",
34 "audio_buffer.h",
35 "audio_processing_impl.cc",
36 "audio_processing_impl.h",
37 "common.h",
38 "echo_cancellation_impl.cc",
39 "echo_cancellation_impl.h",
Sam Zackrisson74ed7342018-08-16 10:54:07 +020040 "echo_cancellation_proxy.cc",
41 "echo_cancellation_proxy.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000042 "echo_control_mobile_impl.cc",
43 "echo_control_mobile_impl.h",
Sam Zackrisson74ed7342018-08-16 10:54:07 +020044 "echo_control_mobile_proxy.cc",
45 "echo_control_mobile_proxy.h",
ivocaf27ed02016-10-28 07:04:03 -070046 "echo_detector/circular_buffer.cc",
47 "echo_detector/circular_buffer.h",
48 "echo_detector/mean_variance_estimator.cc",
49 "echo_detector/mean_variance_estimator.h",
ivoc4e477a12017-01-15 08:29:46 -080050 "echo_detector/moving_max.cc",
51 "echo_detector/moving_max.h",
ivocaf27ed02016-10-28 07:04:03 -070052 "echo_detector/normalized_covariance_estimator.cc",
53 "echo_detector/normalized_covariance_estimator.h",
peahbe615622016-02-13 16:40:47 -080054 "gain_control_for_experimental_agc.cc",
55 "gain_control_for_experimental_agc.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000056 "gain_control_impl.cc",
57 "gain_control_impl.h",
Alex Loikoe36e8bb2018-02-16 11:54:07 +010058 "gain_controller2.cc",
59 "gain_controller2.h",
Alex Loiko1aec5942018-05-15 13:13:22 +020060 "include/aec_dump.cc",
61 "include/aec_dump.h",
peahc19f3122016-10-07 14:54:10 -070062 "include/audio_processing.cc",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000063 "include/audio_processing.h",
solenberg88499ec2016-09-07 07:34:41 -070064 "include/config.cc",
65 "include/config.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000066 "level_estimator_impl.cc",
67 "level_estimator_impl.h",
peah8271d042016-11-22 07:24:52 -080068 "low_cut_filter.cc",
69 "low_cut_filter.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000070 "noise_suppression_impl.cc",
71 "noise_suppression_impl.h",
peah737f4b82016-03-10 23:05:28 -080072 "render_queue_item_verifier.h",
ivoc9f4a4a02016-10-28 05:39:16 -070073 "residual_echo_detector.cc",
74 "residual_echo_detector.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000075 "rms_level.cc",
76 "rms_level.h",
aluebs@webrtc.orgbe05c742014-11-14 22:18:10 +000077 "splitting_filter.cc",
78 "splitting_filter.h",
Alejandro Luebs5a92aa82015-04-27 11:34:45 -070079 "three_band_filter_bank.cc",
80 "three_band_filter_bank.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +000081 "transient/common.h",
82 "transient/daubechies_8_wavelet_coeffs.h",
83 "transient/dyadic_decimator.h",
84 "transient/moving_moments.cc",
85 "transient/moving_moments.h",
86 "transient/transient_detector.cc",
87 "transient/transient_detector.h",
88 "transient/transient_suppressor.cc",
89 "transient/transient_suppressor.h",
90 "transient/wpd_node.cc",
91 "transient/wpd_node.h",
92 "transient/wpd_tree.cc",
93 "transient/wpd_tree.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000094 "typing_detection.cc",
95 "typing_detection.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000096 "voice_detection_impl.cc",
97 "voice_detection_impl.h",
98 ]
99
100 defines = []
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200101 deps = [
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100102 ":apm_logging",
Alex Loikoe36e8bb2018-02-16 11:54:07 +0100103 ":audio_frame_view",
Sam Zackrisson4d364492018-03-02 16:03:21 +0100104 ":audio_generator_interface",
Mirko Bonadei10679932017-12-05 15:07:16 +0100105 ":audio_processing_c",
Ivo Creusen56d46092017-11-24 17:29:59 +0100106 ":audio_processing_statistics",
Alex Loikoed8ff642018-07-06 14:54:30 +0200107 ":gain_control_interface",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200108 "../..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -0700109 "../../api:array_view",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +0100110 "../../api/audio:aec3_config",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200111 "../../api/audio:audio_frame_api",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +0100112 "../../api/audio:echo_control",
aleloi6321b492016-12-05 01:46:09 -0800113 "../../audio/utility:audio_frame_operations",
Mirko Bonadeidbbb33c2018-02-05 15:50:41 +0100114 "../../common_audio:common_audio_c",
Artem Titov333a5052018-07-25 16:56:18 +0200115 "../../common_audio/third_party/fft4g:fft4g",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100116 "../../rtc_base:checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100117 "../../rtc_base:deprecation",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700118 "../../rtc_base:gtest_prod",
Karl Wiberg12edf4c2018-03-07 14:18:56 +0100119 "../../rtc_base:safe_minmax",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100120 "../../rtc_base:sanitizer",
Niels Möllera12c42a2018-07-25 16:05:48 +0200121 "../../rtc_base/system:arch",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100122 "../../system_wrappers:cpu_features_api",
Per Åhgren11556462017-12-22 16:13:57 +0100123 "../../system_wrappers:field_trial_api",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100124 "../../system_wrappers:metrics_api",
Sam Zackrisson7219d052018-07-09 14:28:15 +0200125 "aec:aec",
126 "aec:aec_core",
127 "aecm:aecm_core",
Alex Loikoed8ff642018-07-06 14:54:30 +0200128 "agc",
129 "agc:agc_legacy_c",
Alex Loiko2bac8962018-03-27 13:38:36 +0200130 "agc2:adaptive_digital",
131 "agc2:fixed_digital",
Alex Loikob5c9a792018-04-16 16:31:22 +0200132 "agc2:gain_applier",
Alex Loiko0488fcf2018-02-05 11:15:23 +0100133 "vad",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200134 "//third_party/abseil-cpp/absl/types:optional",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200135 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000136
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000137 if (aec_untrusted_delay_for_testing) {
138 defines += [ "WEBRTC_UNTRUSTED_DELAY" ]
139 }
140
peah1bcfce52016-08-26 07:16:04 -0700141 if (rtc_enable_intelligibility_enhancer) {
142 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
143 sources += [
144 "intelligibility/intelligibility_enhancer.cc",
145 "intelligibility/intelligibility_enhancer.h",
146 "intelligibility/intelligibility_utils.cc",
147 "intelligibility/intelligibility_utils.h",
148 ]
149 } else {
150 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
151 }
152
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000153 if (rtc_prefer_fixed_point) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000154 defines += [ "WEBRTC_NS_FIXED" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000155 } else {
156 defines += [ "WEBRTC_NS_FLOAT" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000157 }
158
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000159 deps += [
160 "../../common_audio",
Patrik Höglundf715c532017-11-17 11:04:15 +0100161 "../../common_audio:fir_filter",
162 "../../common_audio:fir_filter_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700163 "../../rtc_base:rtc_base_approved",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000164 "../../system_wrappers",
165 ]
166}
167
Alex Loikoed8ff642018-07-06 14:54:30 +0200168rtc_source_set("gain_control_interface") {
169 sources = [
170 "include/gain_control.h",
171 ]
172}
173
Ivo Creusen56d46092017-11-24 17:29:59 +0100174rtc_source_set("audio_processing_statistics") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000175 visibility = [ "*" ]
Ivo Creusen56d46092017-11-24 17:29:59 +0100176 sources = [
177 "include/audio_processing_statistics.cc",
178 "include/audio_processing_statistics.h",
179 ]
180 deps = [
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200181 "//third_party/abseil-cpp/absl/types:optional",
Ivo Creusen56d46092017-11-24 17:29:59 +0100182 ]
183}
184
Alex Loikoe36e8bb2018-02-16 11:54:07 +0100185rtc_source_set("audio_frame_view") {
186 sources = [
187 "include/audio_frame_view.h",
188 ]
189 deps = [
190 "../../api:array_view",
191 ]
192}
193
Sam Zackrisson4d364492018-03-02 16:03:21 +0100194rtc_source_set("audio_generator_interface") {
195 visibility = [ "*" ]
196 sources = [
197 "include/audio_generator.h",
198 ]
199 deps = [
200 ":audio_frame_view",
201 "../../rtc_base:rtc_base_approved",
202 "../../system_wrappers:system_wrappers",
203 ]
204}
205
206rtc_source_set("audio_generator_factory") {
207 visibility = [ "*" ]
208 sources = [
209 "include/audio_generator_factory.cc",
210 "include/audio_generator_factory.h",
211 ]
212 deps = [
213 ":audio_generator_interface",
214 ":file_audio_generator",
215 "../../common_audio:common_audio",
216 "../../rtc_base:rtc_base_approved",
217 "../../system_wrappers:system_wrappers",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200218 "//third_party/abseil-cpp/absl/memory",
Sam Zackrisson4d364492018-03-02 16:03:21 +0100219 ]
220}
221
222rtc_source_set("file_audio_generator") {
223 sources = [
224 "audio_generator/file_audio_generator.cc",
225 "audio_generator/file_audio_generator.h",
226 ]
227 deps = [
228 ":audio_generator_interface",
229 "../../common_audio:common_audio",
230 "../../rtc_base:rtc_base_approved",
231 "../../system_wrappers:system_wrappers",
232 ]
233}
234
kjellander7439f972016-12-05 22:47:46 -0800235rtc_source_set("audio_processing_c") {
236 visibility = [ ":*" ] # Only targets in this file can depend on this.
Alex Loikoed8ff642018-07-06 14:54:30 +0200237 sources = []
kjellander7439f972016-12-05 22:47:46 -0800238
239 if (rtc_prefer_fixed_point) {
240 sources += [
241 "ns/noise_suppression_x.c",
242 "ns/noise_suppression_x.h",
243 "ns/nsx_core.c",
244 "ns/nsx_core.h",
245 "ns/nsx_defines.h",
246 ]
247 if (current_cpu == "mipsel") {
248 sources += [ "ns/nsx_core_mips.c" ]
249 } else {
250 sources += [ "ns/nsx_core_c.c" ]
251 }
252 } else {
253 sources += [
254 "ns/defines.h",
255 "ns/noise_suppression.c",
256 "ns/noise_suppression.h",
257 "ns/ns_core.c",
258 "ns/ns_core.h",
259 "ns/windows_private.h",
260 ]
261 }
262
263 deps = [
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800264 "../..:webrtc_common",
kjellander7439f972016-12-05 22:47:46 -0800265 "../../common_audio",
Mirko Bonadeidbbb33c2018-02-05 15:50:41 +0100266 "../../common_audio:common_audio_c",
Artem Titov333a5052018-07-25 16:56:18 +0200267 "../../common_audio/third_party/fft4g:fft4g",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100268 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700269 "../../rtc_base:rtc_base_approved",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100270 "../../system_wrappers:cpu_features_api",
Alex Loikoed8ff642018-07-06 14:54:30 +0200271 "agc:agc_legacy_c",
kjellander7439f972016-12-05 22:47:46 -0800272 ]
mbonadeie5dc3ce2017-01-25 05:34:46 -0800273
274 if (rtc_build_with_neon) {
Patrik Höglund67c20ae2017-12-18 11:21:14 +0100275 sources += [ "ns/nsx_core_neon.c" ]
276
277 if (current_cpu != "arm64") {
Oleh Prypind2f4e8b2018-08-01 12:18:05 +0200278 # Enable compilation for the NEON instruction set.
Patrik Höglund67c20ae2017-12-18 11:21:14 +0100279 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
280 cflags = [ "-mfpu=neon" ]
281 }
282
283 # Disable LTO on NEON targets due to compiler bug.
284 # TODO(fdegans): Enable this. See crbug.com/408997.
285 if (rtc_use_lto) {
286 cflags -= [
287 "-flto",
288 "-ffat-lto-objects",
289 ]
290 }
mbonadeie5dc3ce2017-01-25 05:34:46 -0800291 }
kjellander7439f972016-12-05 22:47:46 -0800292}
293
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000294if (rtc_enable_protobuf) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000295 proto_library("audioproc_debug_proto") {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200296 sources = [
297 "debug.proto",
298 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000299
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200300 proto_out_dir = "modules/audio_processing"
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000301 }
302}
303
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100304rtc_source_set("apm_logging") {
Patrik Höglundd75c8dc2017-12-19 09:45:24 +0100305 configs += [ ":apm_debug_dump" ]
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100306 sources = [
307 "logging/apm_data_dumper.cc",
308 "logging/apm_data_dumper.h",
309 ]
310 deps = [
311 "../../api:array_view",
312 "../../common_audio:common_audio",
313 "../../rtc_base:rtc_base_approved",
Patrik Höglund3e113432017-12-15 14:40:10 +0100314 "../../rtc_base:stringutils",
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100315 ]
316 defines = []
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100317}
Patrik Höglunda36d0e22017-12-04 10:11:11 +0000318
kjellanderfb114242016-06-13 00:19:48 -0700319if (rtc_include_tests) {
Patrik Höglund62139292017-12-19 16:44:45 +0100320 rtc_source_set("mocks") {
321 testonly = true
322 sources = [
323 "include/mock_audio_processing.h",
324 ]
325 deps = [
Patrik Höglund62139292017-12-19 16:44:45 +0100326 ":audio_processing",
327 ":audio_processing_statistics",
328 "../../test:test_support",
329 ]
330 }
331
kjellander6ceab082016-10-28 05:44:03 -0700332 group("audio_processing_tests") {
333 testonly = true
Mirko Bonadei10679932017-12-05 15:07:16 +0100334 deps = [
kjellander6ceab082016-10-28 05:44:03 -0700335 ":audioproc_test_utils",
336 ":click_annotate",
kjellander6ceab082016-10-28 05:44:03 -0700337 ":transient_suppression_test",
kjellander6ceab082016-10-28 05:44:03 -0700338 ]
339
340 if (rtc_enable_intelligibility_enhancer) {
Mirko Bonadei10679932017-12-05 15:07:16 +0100341 deps += [ ":intelligibility_proc" ]
kjellander6ceab082016-10-28 05:44:03 -0700342 }
343
344 if (rtc_enable_protobuf) {
Mirko Bonadei10679932017-12-05 15:07:16 +0100345 deps += [
ehmaldonado1fd08c12017-01-17 02:37:34 -0800346 ":audioproc_f",
347 ":audioproc_unittest_proto",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200348 "aec_dump:aec_dump_unittests",
alessiob5f32aca2017-03-18 02:29:13 -0700349 "test/conversational_speech",
alessiob306d1bf2017-02-24 05:32:21 -0800350 "test/py_quality_assessment",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800351 ]
kjellander6ceab082016-10-28 05:44:03 -0700352 }
353 }
354
ehmaldonado36268652017-01-19 08:27:11 -0800355 rtc_source_set("audio_processing_unittests") {
356 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700357
Patrik Höglundd75c8dc2017-12-19 09:45:24 +0100358 configs += [ ":apm_debug_dump" ]
ehmaldonado36268652017-01-19 08:27:11 -0800359 sources = [
ehmaldonado36268652017-01-19 08:27:11 -0800360 "audio_buffer_unittest.cc",
Alex Loiko153f11e2018-02-16 12:39:00 +0100361 "audio_frame_view_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800362 "config_unittest.cc",
363 "echo_cancellation_impl_unittest.cc",
Alex Loiko153f11e2018-02-16 12:39:00 +0100364 "gain_controller2_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800365 "splitting_filter_unittest.cc",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200366 "test/fake_recording_device_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800367 "transient/dyadic_decimator_unittest.cc",
368 "transient/file_utils.cc",
369 "transient/file_utils.h",
370 "transient/file_utils_unittest.cc",
371 "transient/moving_moments_unittest.cc",
372 "transient/transient_detector_unittest.cc",
373 "transient/transient_suppressor_unittest.cc",
374 "transient/wpd_node_unittest.cc",
375 "transient/wpd_tree_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800376 ]
377
378 deps = [
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200379 ":analog_mic_simulation",
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100380 ":apm_logging",
Alex Loiko153f11e2018-02-16 12:39:00 +0100381 ":audio_frame_view",
ehmaldonado36268652017-01-19 08:27:11 -0800382 ":audio_processing",
ehmaldonado36268652017-01-19 08:27:11 -0800383 ":audioproc_test_utils",
Sam Zackrisson4d364492018-03-02 16:03:21 +0100384 ":file_audio_generator_unittests",
Patrik Höglund62139292017-12-19 16:44:45 +0100385 ":mocks",
ehmaldonado36268652017-01-19 08:27:11 -0800386 "../..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -0700387 "../../api:array_view",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +0100388 "../../api/audio:aec3_config",
Gustaf Ullberg0efa9412018-02-27 13:58:45 +0100389 "../../api/audio:aec3_factory",
ehmaldonado36268652017-01-19 08:27:11 -0800390 "../../common_audio:common_audio",
Mirko Bonadeidbbb33c2018-02-05 15:50:41 +0100391 "../../common_audio:common_audio_c",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100392 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700393 "../../rtc_base:gtest_prod",
394 "../../rtc_base:protobuf_utils",
395 "../../rtc_base:rtc_base",
396 "../../rtc_base:rtc_base_approved",
Karl Wiberg12edf4c2018-03-07 14:18:56 +0100397 "../../rtc_base:safe_minmax",
Niels Möllera12c42a2018-07-25 16:05:48 +0200398 "../../rtc_base/system:arch",
Karl Wiberg6a4d4112018-03-23 10:39:34 +0100399 "../../rtc_base/system:file_wrapper",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100400 "../../system_wrappers",
401 "../../system_wrappers:cpu_features_api",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100402 "../../test:fileutils",
ehmaldonado36268652017-01-19 08:27:11 -0800403 "../../test:test_support",
Ivo Creusen385b10b2017-10-13 12:37:27 +0200404 "../audio_coding:neteq_input_audio_tools",
Sam Zackrisson7219d052018-07-09 14:28:15 +0200405 "aec:aec_core",
406 "aec:aec_unittests",
aleloi20e4a732017-06-08 08:12:46 -0700407 "aec_dump:mock_aec_dump_unittests",
Alex Loikoed8ff642018-07-06 14:54:30 +0200408 "agc:agc_unittests",
Alex Loiko1e48e802018-03-28 09:45:29 +0200409 "agc2:adaptive_digital_unittests",
Alessio Bazzicad8d02142018-05-07 13:26:47 +0200410 "agc2:biquad_filter_unittests",
Alex Loikoe36e8bb2018-02-16 11:54:07 +0100411 "agc2:fixed_digital_unittests",
Alex Loiko4ed47d02018-04-04 15:05:57 +0200412 "agc2:noise_estimator_unittests",
Alessio Bazzica4736d4e2018-04-17 16:46:45 +0200413 "agc2/rnn_vad:unittests",
alessiob4b6463c2017-03-23 05:17:06 -0700414 "test/conversational_speech:unittest",
Sam Zackrissonb2e17652018-07-05 16:41:55 +0200415 "utility:block_mean_calculator_unittest",
416 "utility:legacy_delay_estimator_unittest",
Alex Loiko0488fcf2018-02-05 11:15:23 +0100417 "vad:vad_unittests",
ehmaldonado36268652017-01-19 08:27:11 -0800418 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200419 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200420 "//third_party/abseil-cpp/absl/types:optional",
ehmaldonado36268652017-01-19 08:27:11 -0800421 ]
422
423 defines = []
424
ehmaldonado36268652017-01-19 08:27:11 -0800425 if (rtc_enable_intelligibility_enhancer) {
426 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
427 sources += [
428 "intelligibility/intelligibility_enhancer_unittest.cc",
429 "intelligibility/intelligibility_utils_unittest.cc",
430 ]
431 } else {
432 defines += [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
433 }
434
435 if (rtc_prefer_fixed_point) {
436 defines += [ "WEBRTC_AUDIOPROC_FIXED_PROFILE" ]
437 } else {
438 defines += [ "WEBRTC_AUDIOPROC_FLOAT_PROFILE" ]
439 }
440
441 if (rtc_enable_protobuf) {
442 defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ]
443 deps += [
ehmaldonadof49ff262017-01-23 04:26:02 -0800444 ":audioproc_debug_proto",
ehmaldonado36268652017-01-19 08:27:11 -0800445 ":audioproc_protobuf_utils",
Sam Zackrissond57f9dd2017-09-13 11:00:04 +0200446 ":audioproc_test_utils",
ehmaldonado36268652017-01-19 08:27:11 -0800447 ":audioproc_unittest_proto",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200448 "../../api/audio:audio_frame_api",
Minyue Li656d6092018-08-10 15:38:52 +0200449 "../../rtc_base:rtc_base_tests_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700450 "../../rtc_base:rtc_task_queue",
aleloif4dd1912017-06-15 01:55:38 -0700451 "aec_dump",
452 "aec_dump:aec_dump_unittests",
ehmaldonado36268652017-01-19 08:27:11 -0800453 ]
454 sources += [
ehmaldonado36268652017-01-19 08:27:11 -0800455 "audio_processing_impl_locking_unittest.cc",
456 "audio_processing_impl_unittest.cc",
457 "audio_processing_unittest.cc",
458 "echo_cancellation_bit_exact_unittest.cc",
459 "echo_control_mobile_unittest.cc",
460 "echo_detector/circular_buffer_unittest.cc",
461 "echo_detector/mean_variance_estimator_unittest.cc",
462 "echo_detector/moving_max_unittest.cc",
463 "echo_detector/normalized_covariance_estimator_unittest.cc",
464 "gain_control_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800465 "level_estimator_unittest.cc",
466 "low_cut_filter_unittest.cc",
467 "noise_suppression_unittest.cc",
468 "residual_echo_detector_unittest.cc",
469 "rms_level_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800470 "test/debug_dump_replayer.cc",
471 "test/debug_dump_replayer.h",
472 "test/debug_dump_test.cc",
peah69221db2017-01-27 03:28:19 -0800473 "test/echo_canceller_test_tools.cc",
474 "test/echo_canceller_test_tools.h",
475 "test/echo_canceller_test_tools_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800476 "test/test_utils.h",
477 "voice_detection_unittest.cc",
478 ]
479 }
480
481 if ((!build_with_chromium || is_win) && is_clang) {
482 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
483 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
484 }
485 }
486
ehmaldonado021eef32017-01-05 07:09:50 -0800487 rtc_source_set("audio_processing_perf_tests") {
ehmaldonado021eef32017-01-05 07:09:50 -0800488 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700489
ehmaldonado021eef32017-01-05 07:09:50 -0800490 sources = [
491 "audio_processing_performance_unittest.cc",
ehmaldonado021eef32017-01-05 07:09:50 -0800492 ]
493 deps = [
494 ":audio_processing",
495 ":audioproc_test_utils",
Ivo Creusen69d276d2017-11-24 15:35:57 +0100496 "../../api:array_view",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700497 "../../rtc_base:protobuf_utils",
Ivo Creusen69d276d2017-11-24 15:35:57 +0100498 "../../rtc_base:rtc_base_approved",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100499 "../../system_wrappers",
Edward Lemure66572b2018-01-05 15:34:09 +0100500 "../../test:perf_test",
Ivo Creusen69d276d2017-11-24 15:35:57 +0100501 "../../test:test_support",
ehmaldonado021eef32017-01-05 07:09:50 -0800502 ]
mbonadei7c2c8432017-04-07 00:59:12 -0700503
ehmaldonado021eef32017-01-05 07:09:50 -0800504 if (rtc_enable_intelligibility_enhancer) {
505 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=1" ]
506 } else {
507 defines = [ "WEBRTC_INTELLIGIBILITY_ENHANCER=0" ]
508 }
509 }
510
Sam Zackrisson4d364492018-03-02 16:03:21 +0100511 rtc_source_set("file_audio_generator_unittests") {
512 testonly = true
513
514 sources = [
515 "audio_generator/file_audio_generator_unittest.cc",
516 ]
517
518 deps = [
519 ":audio_generator_factory",
520 ":audio_processing",
521 ":file_audio_generator",
522 "../../rtc_base:rtc_base_approved",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100523 "../../test:fileutils",
Sam Zackrisson4d364492018-03-02 16:03:21 +0100524 "../../test:test_support",
525 ]
526 }
527
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200528 rtc_source_set("analog_mic_simulation") {
529 sources = [
530 "test/fake_recording_device.cc",
531 "test/fake_recording_device.h",
532 ]
533 deps = [
534 "../../api:array_view",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200535 "../../api/audio:audio_frame_api",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200536 "../../common_audio:common_audio",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100537 "../../rtc_base:checks",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200538 "../../rtc_base:rtc_base_approved",
Alex Loiko5c71e742018-07-02 11:37:47 +0200539 "../../rtc_base:safe_minmax",
Alex Loikoed8ff642018-07-06 14:54:30 +0200540 "agc:gain_map",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200541 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200542 "//third_party/abseil-cpp/absl/types:optional",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200543 ]
544 }
545
ehmaldonado1fd08c12017-01-17 02:37:34 -0800546 if (rtc_enable_protobuf) {
Ivo Creusen8c812f32018-03-09 17:33:04 +0100547 rtc_source_set("audioproc_f_impl") {
ehmaldonado1fd08c12017-01-17 02:37:34 -0800548 testonly = true
549 sources = [
550 "test/aec_dump_based_simulator.cc",
551 "test/aec_dump_based_simulator.h",
552 "test/audio_processing_simulator.cc",
553 "test/audio_processing_simulator.h",
Ivo Creusen2cb41052018-03-15 12:22:52 +0100554 "test/audioproc_float_impl.cc",
555 "test/audioproc_float_impl.h",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800556 "test/wav_based_simulator.cc",
557 "test/wav_based_simulator.h",
558 ]
peahc3ec1fd2016-08-07 23:19:30 -0700559
ehmaldonado1fd08c12017-01-17 02:37:34 -0800560 deps = [
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200561 ":analog_mic_simulation",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800562 ":audio_processing",
563 ":audioproc_debug_proto",
564 ":audioproc_protobuf_utils",
565 ":audioproc_test_utils",
Gustaf Ullberg0efa9412018-02-27 13:58:45 +0100566 "../../api/audio:aec3_factory",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800567 "../../common_audio:common_audio",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100568 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700569 "../../rtc_base:protobuf_utils",
570 "../../rtc_base:rtc_base_approved",
Per Åhgrenad09d742018-03-08 07:47:14 +0100571 "../../rtc_base:rtc_json",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700572 "../../rtc_base:rtc_task_queue",
Patrik Höglund3e113432017-12-15 14:40:10 +0100573 "../../rtc_base:stringutils",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800574 "../../system_wrappers",
575 "../../system_wrappers:system_wrappers_default",
576 "../../test:test_support",
aleloif4dd1912017-06-15 01:55:38 -0700577 "aec_dump",
578 "aec_dump:aec_dump_impl",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800579 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200580 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200581 "//third_party/abseil-cpp/absl/types:optional",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800582 ]
Ivo Creusen8c812f32018-03-09 17:33:04 +0100583 } # audioproc_f_impl
584 rtc_executable("audioproc_f") {
585 testonly = true
586 sources = [
587 "test/audioproc_float_main.cc",
588 ]
589 deps = [
590 ":audio_processing",
Ivo Creusen2cb41052018-03-15 12:22:52 +0100591 "../../api:audioproc_f_api",
Ivo Creusen8c812f32018-03-09 17:33:04 +0100592 "../../rtc_base:rtc_base_approved",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200593 "//third_party/abseil-cpp/absl/memory",
Ivo Creusen8c812f32018-03-09 17:33:04 +0100594 ]
ehmaldonado1fd08c12017-01-17 02:37:34 -0800595 } # audioproc_f
596 }
peahc3ec1fd2016-08-07 23:19:30 -0700597
ehmaldonado38a21322016-09-02 04:10:34 -0700598 rtc_source_set("audioproc_test_utils") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000599 visibility = [ "*" ]
kjellanderfb114242016-06-13 00:19:48 -0700600 testonly = true
601 sources = [
ehmaldonado529f83c2016-07-27 08:14:32 -0700602 "test/audio_buffer_tools.cc",
603 "test/audio_buffer_tools.h",
Sam Zackrissond57f9dd2017-09-13 11:00:04 +0200604 "test/bitexactness_tools.cc",
605 "test/bitexactness_tools.h",
ivoc3cfb3ef2016-11-24 04:17:28 -0800606 "test/performance_timer.cc",
607 "test/performance_timer.h",
608 "test/simulator_buffers.cc",
609 "test/simulator_buffers.h",
kjellanderfb114242016-06-13 00:19:48 -0700610 "test/test_utils.cc",
611 "test/test_utils.h",
612 ]
613
kjellanderfb114242016-06-13 00:19:48 -0700614 deps = [
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800615 ":audio_processing",
kwiberg529662a2017-09-04 05:43:17 -0700616 "../../api:array_view",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200617 "../../api/audio:audio_frame_api",
kjellanderfb114242016-06-13 00:19:48 -0700618 "../../common_audio",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100619 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700620 "../../rtc_base:rtc_base_approved",
Niels Möllera12c42a2018-07-25 16:05:48 +0200621 "../../rtc_base/system:arch",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100622 "../../system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100623 "../../test:fileutils",
Sam Zackrissond57f9dd2017-09-13 11:00:04 +0200624 "../../test:test_support",
Ivo Creusen385b10b2017-10-13 12:37:27 +0200625 "../audio_coding:neteq_input_audio_tools",
Sam Zackrissond57f9dd2017-09-13 11:00:04 +0200626 "//testing/gtest",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200627 "//third_party/abseil-cpp/absl/types:optional",
kjellanderfb114242016-06-13 00:19:48 -0700628 ]
629 }
630
ehmaldonado38a21322016-09-02 04:10:34 -0700631 rtc_executable("transient_suppression_test") {
kwiberg7a770e02016-08-25 02:32:43 -0700632 testonly = true
633 sources = [
634 "transient/file_utils.cc",
635 "transient/file_utils.h",
636 "transient/transient_suppression_test.cc",
637 ]
638 deps = [
639 ":audio_processing",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800640 "../..:webrtc_common",
641 "../../common_audio:common_audio",
oprypin6e09d872017-08-31 03:21:39 -0700642 "../../rtc_base:rtc_base_approved",
Karl Wiberg6a4d4112018-03-23 10:39:34 +0100643 "../../rtc_base/system:file_wrapper",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100644 "../../system_wrappers",
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100645 "../../system_wrappers:metrics_default",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100646 "../../test:fileutils",
kwiberg7a770e02016-08-25 02:32:43 -0700647 "../../test:test_support",
Alex Loikoed8ff642018-07-06 14:54:30 +0200648 "agc:level_estimation",
kwiberg7a770e02016-08-25 02:32:43 -0700649 "//testing/gtest",
kwiberg7a770e02016-08-25 02:32:43 -0700650 ]
kwiberg7a770e02016-08-25 02:32:43 -0700651 }
652
ehmaldonado38a21322016-09-02 04:10:34 -0700653 rtc_executable("click_annotate") {
kwiberg7a770e02016-08-25 02:32:43 -0700654 testonly = true
655 sources = [
656 "transient/click_annotate.cc",
657 "transient/file_utils.cc",
658 "transient/file_utils.h",
659 ]
660 deps = [
661 ":audio_processing",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800662 "../..:webrtc_common",
Karl Wiberg6a4d4112018-03-23 10:39:34 +0100663 "../../rtc_base/system:file_wrapper",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100664 "../../system_wrappers",
kwiberg7a770e02016-08-25 02:32:43 -0700665 "../../system_wrappers:metrics_default",
666 ]
667 }
668
peah1bcfce52016-08-26 07:16:04 -0700669 if (rtc_enable_intelligibility_enhancer) {
ehmaldonado38a21322016-09-02 04:10:34 -0700670 rtc_executable("intelligibility_proc") {
peah1bcfce52016-08-26 07:16:04 -0700671 testonly = true
672 sources = [
673 "intelligibility/test/intelligibility_proc.cc",
674 ]
675 deps = [
676 ":audio_processing",
677 ":audioproc_test_utils",
Alex Loiko0488fcf2018-02-05 11:15:23 +0100678 "../../common_audio",
oprypin6e09d872017-08-31 03:21:39 -0700679 "../../rtc_base:rtc_base_approved",
peah1bcfce52016-08-26 07:16:04 -0700680 "../../system_wrappers:metrics_default",
681 "../../test:test_support",
682 "//testing/gtest",
peah1bcfce52016-08-26 07:16:04 -0700683 ]
kwiberg7a770e02016-08-25 02:32:43 -0700684 }
685 }
686
kjellanderfb114242016-06-13 00:19:48 -0700687 if (rtc_enable_protobuf) {
688 proto_library("audioproc_unittest_proto") {
689 sources = [
690 "test/unittest.proto",
691 ]
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200692 proto_out_dir = "modules/audio_processing/test"
kjellanderfb114242016-06-13 00:19:48 -0700693 }
694
kjellanderb62dbbe2016-09-23 00:38:52 -0700695 rtc_static_library("audioproc_protobuf_utils") {
kjellanderfb114242016-06-13 00:19:48 -0700696 sources = [
697 "test/protobuf_utils.cc",
698 "test/protobuf_utils.h",
699 ]
700
701 deps = [
ehmaldonadobcba64a2016-08-19 02:11:07 -0700702 ":audioproc_debug_proto",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800703 "../..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700704 "../../rtc_base:protobuf_utils",
705 "../../rtc_base:rtc_base_approved",
Niels Möllera12c42a2018-07-25 16:05:48 +0200706 "../../rtc_base/system:arch",
kjellanderfb114242016-06-13 00:19:48 -0700707 ]
708 }
709 }
710}