blob: 6fc7d86cf33b574c9542847fe881893ce8be5cff [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")
Kimmo Kinnunen08f6a6c2019-02-26 11:46:17 +020010if (rtc_enable_protobuf) {
Dan Minor9c686132018-01-15 10:20:00 -050011 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
Alessio Bazzica277b6ea2018-11-06 14:24:51 +010029rtc_static_library("config") {
30 visibility = [ ":*" ]
31 sources = [
32 "include/config.cc",
33 "include/config.h",
34 ]
35 deps = [
36 "../../rtc_base:macromagic",
37 "../../rtc_base/system:rtc_export",
38 ]
39}
40
Alessio Bazzica277b6ea2018-11-06 14:24:51 +010041rtc_source_set("api") {
42 visibility = [ "*" ]
Alessio Bazzicab768e882018-11-07 14:29:54 +000043 sources = [
44 "include/audio_processing.cc",
45 "include/audio_processing.h",
46 ]
47 deps = [
48 ":audio_frame_view",
49 ":audio_generator_interface",
50 ":audio_processing_statistics",
51 ":config",
52 ":gain_control_interface",
Mirko Bonadeid9708072019-01-25 20:26:48 +010053 "../../api:scoped_refptr",
Alessio Bazzicab768e882018-11-07 14:29:54 +000054 "../../api/audio:aec3_config",
55 "../../api/audio:echo_control",
56 "../../rtc_base:deprecation",
57 "../../rtc_base:macromagic",
Alessio Bazzicab768e882018-11-07 14:29:54 +000058 "../../rtc_base:rtc_base_approved",
59 "../../rtc_base/system:rtc_export",
60 "//third_party/abseil-cpp/absl/types:optional",
61 ]
Alessio Bazzica277b6ea2018-11-06 14:24:51 +010062}
63
kjellanderb62dbbe2016-09-23 00:38:52 -070064rtc_static_library("audio_processing") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000065 visibility = [ "*" ]
Patrik Höglundd75c8dc2017-12-19 09:45:24 +010066 configs += [ ":apm_debug_dump" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000067 sources = [
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",
72 "common.h",
73 "echo_cancellation_impl.cc",
74 "echo_cancellation_impl.h",
75 "echo_control_mobile_impl.cc",
76 "echo_control_mobile_impl.h",
ivocaf27ed02016-10-28 07:04:03 -070077 "echo_detector/circular_buffer.cc",
78 "echo_detector/circular_buffer.h",
79 "echo_detector/mean_variance_estimator.cc",
80 "echo_detector/mean_variance_estimator.h",
ivoc4e477a12017-01-15 08:29:46 -080081 "echo_detector/moving_max.cc",
82 "echo_detector/moving_max.h",
ivocaf27ed02016-10-28 07:04:03 -070083 "echo_detector/normalized_covariance_estimator.cc",
84 "echo_detector/normalized_covariance_estimator.h",
peahbe615622016-02-13 16:40:47 -080085 "gain_control_for_experimental_agc.cc",
86 "gain_control_for_experimental_agc.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000087 "gain_control_impl.cc",
88 "gain_control_impl.h",
Alex Loikoe36e8bb2018-02-16 11:54:07 +010089 "gain_controller2.cc",
90 "gain_controller2.h",
Alex Loiko1aec5942018-05-15 13:13:22 +020091 "include/aec_dump.cc",
92 "include/aec_dump.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000093 "level_estimator_impl.cc",
94 "level_estimator_impl.h",
peah8271d042016-11-22 07:24:52 -080095 "low_cut_filter.cc",
96 "low_cut_filter.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000097 "noise_suppression_impl.cc",
98 "noise_suppression_impl.h",
peah737f4b82016-03-10 23:05:28 -080099 "render_queue_item_verifier.h",
ivoc9f4a4a02016-10-28 05:39:16 -0700100 "residual_echo_detector.cc",
101 "residual_echo_detector.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000102 "rms_level.cc",
103 "rms_level.h",
aluebs@webrtc.orgbe05c742014-11-14 22:18:10 +0000104 "splitting_filter.cc",
105 "splitting_filter.h",
Alejandro Luebs5a92aa82015-04-27 11:34:45 -0700106 "three_band_filter_bank.cc",
107 "three_band_filter_bank.h",
pbos@webrtc.org788acd12014-12-15 09:41:24 +0000108 "transient/common.h",
109 "transient/daubechies_8_wavelet_coeffs.h",
110 "transient/dyadic_decimator.h",
111 "transient/moving_moments.cc",
112 "transient/moving_moments.h",
113 "transient/transient_detector.cc",
114 "transient/transient_detector.h",
115 "transient/transient_suppressor.cc",
116 "transient/transient_suppressor.h",
117 "transient/wpd_node.cc",
118 "transient/wpd_node.h",
119 "transient/wpd_tree.cc",
120 "transient/wpd_tree.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000121 "typing_detection.cc",
122 "typing_detection.h",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000123 "voice_detection_impl.cc",
124 "voice_detection_impl.h",
125 ]
126
127 defines = []
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200128 deps = [
Alessio Bazzica277b6ea2018-11-06 14:24:51 +0100129 ":api",
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100130 ":apm_logging",
Alex Loikoe36e8bb2018-02-16 11:54:07 +0100131 ":audio_frame_view",
Sam Zackrisson4d364492018-03-02 16:03:21 +0100132 ":audio_generator_interface",
Mirko Bonadei10679932017-12-05 15:07:16 +0100133 ":audio_processing_c",
Ivo Creusen56d46092017-11-24 17:29:59 +0100134 ":audio_processing_statistics",
Alessio Bazzica277b6ea2018-11-06 14:24:51 +0100135 ":config",
Alex Loikoed8ff642018-07-06 14:54:30 +0200136 ":gain_control_interface",
Sam Zackrisson23513132019-01-11 15:10:32 +0100137 ":noise_suppression_proxy",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200138 "../..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -0700139 "../../api:array_view",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +0100140 "../../api/audio:aec3_config",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200141 "../../api/audio:audio_frame_api",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +0100142 "../../api/audio:echo_control",
aleloi6321b492016-12-05 01:46:09 -0800143 "../../audio/utility:audio_frame_operations",
Mirko Bonadeidbbb33c2018-02-05 15:50:41 +0100144 "../../common_audio:common_audio_c",
Artem Titov333a5052018-07-25 16:56:18 +0200145 "../../common_audio/third_party/fft4g:fft4g",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100146 "../../rtc_base:checks",
Patrik Höglund3e113432017-12-15 14:40:10 +0100147 "../../rtc_base:deprecation",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700148 "../../rtc_base:gtest_prod",
Karl Wiberg12edf4c2018-03-07 14:18:56 +0100149 "../../rtc_base:safe_minmax",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100150 "../../rtc_base:sanitizer",
Niels Möllera12c42a2018-07-25 16:05:48 +0200151 "../../rtc_base/system:arch",
Mirko Bonadei3d255302018-10-11 10:50:45 +0200152 "../../rtc_base/system:rtc_export",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100153 "../../system_wrappers:cpu_features_api",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200154 "../../system_wrappers:field_trial",
155 "../../system_wrappers:metrics",
Sam Zackrisson7219d052018-07-09 14:28:15 +0200156 "aec:aec",
157 "aec:aec_core",
158 "aecm:aecm_core",
Alex Loikoed8ff642018-07-06 14:54:30 +0200159 "agc",
160 "agc:agc_legacy_c",
Alex Loiko2bac8962018-03-27 13:38:36 +0200161 "agc2:adaptive_digital",
162 "agc2:fixed_digital",
Alex Loikob5c9a792018-04-16 16:31:22 +0200163 "agc2:gain_applier",
Alex Loiko0488fcf2018-02-05 11:15:23 +0100164 "vad",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200165 "//third_party/abseil-cpp/absl/types:optional",
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200166 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000167
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000168 if (aec_untrusted_delay_for_testing) {
169 defines += [ "WEBRTC_UNTRUSTED_DELAY" ]
170 }
171
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000172 if (rtc_prefer_fixed_point) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000173 defines += [ "WEBRTC_NS_FIXED" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000174 } else {
175 defines += [ "WEBRTC_NS_FLOAT" ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000176 }
177
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000178 deps += [
179 "../../common_audio",
Patrik Höglundf715c532017-11-17 11:04:15 +0100180 "../../common_audio:fir_filter",
181 "../../common_audio:fir_filter_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700182 "../../rtc_base:rtc_base_approved",
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000183 "../../system_wrappers",
184 ]
185}
186
Alex Loikoed8ff642018-07-06 14:54:30 +0200187rtc_source_set("gain_control_interface") {
188 sources = [
189 "include/gain_control.h",
190 ]
191}
192
Sam Zackrisson23513132019-01-11 15:10:32 +0100193rtc_source_set("noise_suppression_proxy") {
194 sources = [
195 "noise_suppression_proxy.cc",
196 "noise_suppression_proxy.h",
197 ]
198 deps = [
199 ":api",
200 "../../rtc_base:macromagic",
201 ]
202}
203
Ivo Creusen56d46092017-11-24 17:29:59 +0100204rtc_source_set("audio_processing_statistics") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000205 visibility = [ "*" ]
Ivo Creusen56d46092017-11-24 17:29:59 +0100206 sources = [
207 "include/audio_processing_statistics.cc",
208 "include/audio_processing_statistics.h",
209 ]
210 deps = [
Mirko Bonadei3d255302018-10-11 10:50:45 +0200211 "../../rtc_base/system:rtc_export",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200212 "//third_party/abseil-cpp/absl/types:optional",
Ivo Creusen56d46092017-11-24 17:29:59 +0100213 ]
214}
215
Alex Loikoe36e8bb2018-02-16 11:54:07 +0100216rtc_source_set("audio_frame_view") {
217 sources = [
218 "include/audio_frame_view.h",
219 ]
220 deps = [
221 "../../api:array_view",
222 ]
223}
224
Sam Zackrisson4d364492018-03-02 16:03:21 +0100225rtc_source_set("audio_generator_interface") {
226 visibility = [ "*" ]
227 sources = [
228 "include/audio_generator.h",
229 ]
230 deps = [
231 ":audio_frame_view",
232 "../../rtc_base:rtc_base_approved",
233 "../../system_wrappers:system_wrappers",
234 ]
235}
236
237rtc_source_set("audio_generator_factory") {
238 visibility = [ "*" ]
239 sources = [
240 "include/audio_generator_factory.cc",
241 "include/audio_generator_factory.h",
242 ]
243 deps = [
244 ":audio_generator_interface",
245 ":file_audio_generator",
246 "../../common_audio:common_audio",
247 "../../rtc_base:rtc_base_approved",
248 "../../system_wrappers:system_wrappers",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200249 "//third_party/abseil-cpp/absl/memory",
Sam Zackrisson4d364492018-03-02 16:03:21 +0100250 ]
251}
252
253rtc_source_set("file_audio_generator") {
254 sources = [
255 "audio_generator/file_audio_generator.cc",
256 "audio_generator/file_audio_generator.h",
257 ]
258 deps = [
259 ":audio_generator_interface",
260 "../../common_audio:common_audio",
261 "../../rtc_base:rtc_base_approved",
262 "../../system_wrappers:system_wrappers",
263 ]
264}
265
kjellander7439f972016-12-05 22:47:46 -0800266rtc_source_set("audio_processing_c") {
267 visibility = [ ":*" ] # Only targets in this file can depend on this.
Alex Loikoed8ff642018-07-06 14:54:30 +0200268 sources = []
kjellander7439f972016-12-05 22:47:46 -0800269
270 if (rtc_prefer_fixed_point) {
271 sources += [
272 "ns/noise_suppression_x.c",
273 "ns/noise_suppression_x.h",
274 "ns/nsx_core.c",
275 "ns/nsx_core.h",
276 "ns/nsx_defines.h",
277 ]
278 if (current_cpu == "mipsel") {
279 sources += [ "ns/nsx_core_mips.c" ]
280 } else {
281 sources += [ "ns/nsx_core_c.c" ]
282 }
283 } else {
284 sources += [
285 "ns/defines.h",
286 "ns/noise_suppression.c",
287 "ns/noise_suppression.h",
288 "ns/ns_core.c",
289 "ns/ns_core.h",
290 "ns/windows_private.h",
291 ]
292 }
293
294 deps = [
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800295 "../..:webrtc_common",
kjellander7439f972016-12-05 22:47:46 -0800296 "../../common_audio",
Mirko Bonadeidbbb33c2018-02-05 15:50:41 +0100297 "../../common_audio:common_audio_c",
Artem Titov333a5052018-07-25 16:56:18 +0200298 "../../common_audio/third_party/fft4g:fft4g",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100299 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700300 "../../rtc_base:rtc_base_approved",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100301 "../../system_wrappers:cpu_features_api",
Alex Loikoed8ff642018-07-06 14:54:30 +0200302 "agc:agc_legacy_c",
kjellander7439f972016-12-05 22:47:46 -0800303 ]
mbonadeie5dc3ce2017-01-25 05:34:46 -0800304
305 if (rtc_build_with_neon) {
Patrik Höglund67c20ae2017-12-18 11:21:14 +0100306 sources += [ "ns/nsx_core_neon.c" ]
307
308 if (current_cpu != "arm64") {
Oleh Prypind2f4e8b2018-08-01 12:18:05 +0200309 # Enable compilation for the NEON instruction set.
Patrik Höglund67c20ae2017-12-18 11:21:14 +0100310 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
311 cflags = [ "-mfpu=neon" ]
312 }
313
314 # Disable LTO on NEON targets due to compiler bug.
315 # TODO(fdegans): Enable this. See crbug.com/408997.
316 if (rtc_use_lto) {
317 cflags -= [
318 "-flto",
319 "-ffat-lto-objects",
320 ]
321 }
mbonadeie5dc3ce2017-01-25 05:34:46 -0800322 }
kjellander7439f972016-12-05 22:47:46 -0800323}
324
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +0000325if (rtc_enable_protobuf) {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000326 proto_library("audioproc_debug_proto") {
Henrik Kjellander57e5fd22015-05-25 12:55:39 +0200327 sources = [
328 "debug.proto",
329 ]
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000330
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200331 proto_out_dir = "modules/audio_processing"
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +0000332 }
333}
334
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100335rtc_source_set("apm_logging") {
Patrik Höglundd75c8dc2017-12-19 09:45:24 +0100336 configs += [ ":apm_debug_dump" ]
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100337 sources = [
338 "logging/apm_data_dumper.cc",
339 "logging/apm_data_dumper.h",
340 ]
341 deps = [
342 "../../api:array_view",
343 "../../common_audio:common_audio",
Alessio Bazzica4bc60452018-11-20 12:44:15 +0100344 "../../rtc_base:checks",
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100345 "../../rtc_base:rtc_base_approved",
346 ]
347 defines = []
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100348}
Patrik Höglunda36d0e22017-12-04 10:11:11 +0000349
kjellanderfb114242016-06-13 00:19:48 -0700350if (rtc_include_tests) {
Patrik Höglund62139292017-12-19 16:44:45 +0100351 rtc_source_set("mocks") {
352 testonly = true
353 sources = [
354 "include/mock_audio_processing.h",
355 ]
356 deps = [
Alessio Bazzicab768e882018-11-07 14:29:54 +0000357 ":api",
Patrik Höglund62139292017-12-19 16:44:45 +0100358 ":audio_processing",
359 ":audio_processing_statistics",
360 "../../test:test_support",
361 ]
362 }
363
kjellander6ceab082016-10-28 05:44:03 -0700364 group("audio_processing_tests") {
365 testonly = true
Mirko Bonadei10679932017-12-05 15:07:16 +0100366 deps = [
kjellander6ceab082016-10-28 05:44:03 -0700367 ":audioproc_test_utils",
368 ":click_annotate",
kjellander6ceab082016-10-28 05:44:03 -0700369 ":transient_suppression_test",
kjellander6ceab082016-10-28 05:44:03 -0700370 ]
371
kjellander6ceab082016-10-28 05:44:03 -0700372 if (rtc_enable_protobuf) {
Mirko Bonadei10679932017-12-05 15:07:16 +0100373 deps += [
ehmaldonado1fd08c12017-01-17 02:37:34 -0800374 ":audioproc_f",
375 ":audioproc_unittest_proto",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200376 "aec_dump:aec_dump_unittests",
alessiob5f32aca2017-03-18 02:29:13 -0700377 "test/conversational_speech",
alessiob306d1bf2017-02-24 05:32:21 -0800378 "test/py_quality_assessment",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800379 ]
kjellander6ceab082016-10-28 05:44:03 -0700380 }
381 }
382
ehmaldonado36268652017-01-19 08:27:11 -0800383 rtc_source_set("audio_processing_unittests") {
384 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700385
Patrik Höglundd75c8dc2017-12-19 09:45:24 +0100386 configs += [ ":apm_debug_dump" ]
ehmaldonado36268652017-01-19 08:27:11 -0800387 sources = [
ehmaldonado36268652017-01-19 08:27:11 -0800388 "audio_buffer_unittest.cc",
Alex Loiko153f11e2018-02-16 12:39:00 +0100389 "audio_frame_view_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800390 "config_unittest.cc",
391 "echo_cancellation_impl_unittest.cc",
Sam Zackrisson8c147b62018-09-28 12:40:47 +0200392 "echo_control_mobile_unittest.cc",
Alex Loiko153f11e2018-02-16 12:39:00 +0100393 "gain_controller2_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800394 "splitting_filter_unittest.cc",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200395 "test/fake_recording_device_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800396 "transient/dyadic_decimator_unittest.cc",
397 "transient/file_utils.cc",
398 "transient/file_utils.h",
399 "transient/file_utils_unittest.cc",
400 "transient/moving_moments_unittest.cc",
401 "transient/transient_detector_unittest.cc",
402 "transient/transient_suppressor_unittest.cc",
403 "transient/wpd_node_unittest.cc",
404 "transient/wpd_tree_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800405 ]
406
407 deps = [
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200408 ":analog_mic_simulation",
Alessio Bazzica277b6ea2018-11-06 14:24:51 +0100409 ":api",
Patrik Höglunde6ffc422017-12-11 10:28:16 +0100410 ":apm_logging",
Alex Loiko153f11e2018-02-16 12:39:00 +0100411 ":audio_frame_view",
ehmaldonado36268652017-01-19 08:27:11 -0800412 ":audio_processing",
ehmaldonado36268652017-01-19 08:27:11 -0800413 ":audioproc_test_utils",
Alessio Bazzica277b6ea2018-11-06 14:24:51 +0100414 ":config",
Sam Zackrisson4d364492018-03-02 16:03:21 +0100415 ":file_audio_generator_unittests",
Patrik Höglund62139292017-12-19 16:44:45 +0100416 ":mocks",
ehmaldonado36268652017-01-19 08:27:11 -0800417 "../..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -0700418 "../../api:array_view",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100419 "../../api:scoped_refptr",
Gustaf Ullberg2ae140a2018-02-16 13:43:49 +0100420 "../../api/audio:aec3_config",
Gustaf Ullberg0efa9412018-02-27 13:58:45 +0100421 "../../api/audio:aec3_factory",
ehmaldonado36268652017-01-19 08:27:11 -0800422 "../../common_audio:common_audio",
Mirko Bonadeidbbb33c2018-02-05 15:50:41 +0100423 "../../common_audio:common_audio_c",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100424 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700425 "../../rtc_base:gtest_prod",
426 "../../rtc_base:protobuf_utils",
427 "../../rtc_base:rtc_base",
428 "../../rtc_base:rtc_base_approved",
Mirko Bonadeie3abb812018-11-23 13:15:08 +0100429 "../../rtc_base:rtc_base_tests_utils",
Karl Wiberg12edf4c2018-03-07 14:18:56 +0100430 "../../rtc_base:safe_minmax",
Niels Möllera12c42a2018-07-25 16:05:48 +0200431 "../../rtc_base/system:arch",
Karl Wiberg6a4d4112018-03-23 10:39:34 +0100432 "../../rtc_base/system:file_wrapper",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100433 "../../system_wrappers",
434 "../../system_wrappers:cpu_features_api",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100435 "../../test:fileutils",
ehmaldonado36268652017-01-19 08:27:11 -0800436 "../../test:test_support",
Ivo Creusen385b10b2017-10-13 12:37:27 +0200437 "../audio_coding:neteq_input_audio_tools",
Sam Zackrisson7219d052018-07-09 14:28:15 +0200438 "aec:aec_core",
439 "aec:aec_unittests",
aleloi20e4a732017-06-08 08:12:46 -0700440 "aec_dump:mock_aec_dump_unittests",
Alex Loikoed8ff642018-07-06 14:54:30 +0200441 "agc:agc_unittests",
Alex Loiko1e48e802018-03-28 09:45:29 +0200442 "agc2:adaptive_digital_unittests",
Alessio Bazzicad8d02142018-05-07 13:26:47 +0200443 "agc2:biquad_filter_unittests",
Alex Loikoe36e8bb2018-02-16 11:54:07 +0100444 "agc2:fixed_digital_unittests",
Alex Loiko4ed47d02018-04-04 15:05:57 +0200445 "agc2:noise_estimator_unittests",
Alessio Bazzica1e2542f2018-11-13 14:44:15 +0100446 "agc2:rnn_vad_with_level_unittests",
Alessio Bazzica3e4c77f2018-11-01 21:31:38 +0100447 "agc2:test_utils",
Alessio Bazzica4736d4e2018-04-17 16:46:45 +0200448 "agc2/rnn_vad:unittests",
alessiob4b6463c2017-03-23 05:17:06 -0700449 "test/conversational_speech:unittest",
Sam Zackrissonb2e17652018-07-05 16:41:55 +0200450 "utility:block_mean_calculator_unittest",
451 "utility:legacy_delay_estimator_unittest",
Alessio Bazzicacaa499b2019-02-21 17:35:43 +0100452 "utility:pffft_wrapper_unittest",
Alex Loiko0488fcf2018-02-05 11:15:23 +0100453 "vad:vad_unittests",
ehmaldonado36268652017-01-19 08:27:11 -0800454 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200455 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200456 "//third_party/abseil-cpp/absl/types:optional",
ehmaldonado36268652017-01-19 08:27:11 -0800457 ]
458
459 defines = []
460
ehmaldonado36268652017-01-19 08:27:11 -0800461 if (rtc_prefer_fixed_point) {
462 defines += [ "WEBRTC_AUDIOPROC_FIXED_PROFILE" ]
463 } else {
464 defines += [ "WEBRTC_AUDIOPROC_FLOAT_PROFILE" ]
465 }
466
467 if (rtc_enable_protobuf) {
468 defines += [ "WEBRTC_AUDIOPROC_DEBUG_DUMP" ]
469 deps += [
ehmaldonadof49ff262017-01-23 04:26:02 -0800470 ":audioproc_debug_proto",
ehmaldonado36268652017-01-19 08:27:11 -0800471 ":audioproc_protobuf_utils",
Sam Zackrissond57f9dd2017-09-13 11:00:04 +0200472 ":audioproc_test_utils",
ehmaldonado36268652017-01-19 08:27:11 -0800473 ":audioproc_unittest_proto",
Alex Loiko62347222018-09-10 10:18:07 +0200474 ":runtime_settings_protobuf_utils",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200475 "../../api/audio:audio_frame_api",
Alessio Bazzicae4498052018-12-17 09:44:06 +0100476 "../../api/audio:echo_control",
477 "../../rtc_base:rtc_base_tests_utils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700478 "../../rtc_base:rtc_task_queue",
aleloif4dd1912017-06-15 01:55:38 -0700479 "aec_dump",
480 "aec_dump:aec_dump_unittests",
ehmaldonado36268652017-01-19 08:27:11 -0800481 ]
482 sources += [
ehmaldonado36268652017-01-19 08:27:11 -0800483 "audio_processing_impl_locking_unittest.cc",
484 "audio_processing_impl_unittest.cc",
485 "audio_processing_unittest.cc",
486 "echo_cancellation_bit_exact_unittest.cc",
Sam Zackrisson8c147b62018-09-28 12:40:47 +0200487 "echo_control_mobile_bit_exact_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800488 "echo_detector/circular_buffer_unittest.cc",
489 "echo_detector/mean_variance_estimator_unittest.cc",
490 "echo_detector/moving_max_unittest.cc",
491 "echo_detector/normalized_covariance_estimator_unittest.cc",
492 "gain_control_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800493 "level_estimator_unittest.cc",
494 "low_cut_filter_unittest.cc",
495 "noise_suppression_unittest.cc",
496 "residual_echo_detector_unittest.cc",
497 "rms_level_unittest.cc",
ehmaldonado36268652017-01-19 08:27:11 -0800498 "test/debug_dump_replayer.cc",
499 "test/debug_dump_replayer.h",
500 "test/debug_dump_test.cc",
peah69221db2017-01-27 03:28:19 -0800501 "test/echo_canceller_test_tools.cc",
502 "test/echo_canceller_test_tools.h",
503 "test/echo_canceller_test_tools_unittest.cc",
Alessio Bazzicae4498052018-12-17 09:44:06 +0100504 "test/echo_control_mock.h",
ehmaldonado36268652017-01-19 08:27:11 -0800505 "test/test_utils.h",
506 "voice_detection_unittest.cc",
507 ]
508 }
509
510 if ((!build_with_chromium || is_win) && is_clang) {
511 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
512 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
513 }
514 }
515
ehmaldonado021eef32017-01-05 07:09:50 -0800516 rtc_source_set("audio_processing_perf_tests") {
ehmaldonado021eef32017-01-05 07:09:50 -0800517 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700518
ehmaldonado021eef32017-01-05 07:09:50 -0800519 sources = [
520 "audio_processing_performance_unittest.cc",
ehmaldonado021eef32017-01-05 07:09:50 -0800521 ]
522 deps = [
523 ":audio_processing",
524 ":audioproc_test_utils",
Ivo Creusen69d276d2017-11-24 15:35:57 +0100525 "../../api:array_view",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700526 "../../rtc_base:protobuf_utils",
Ivo Creusen69d276d2017-11-24 15:35:57 +0100527 "../../rtc_base:rtc_base_approved",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100528 "../../system_wrappers",
Edward Lemure66572b2018-01-05 15:34:09 +0100529 "../../test:perf_test",
Ivo Creusen69d276d2017-11-24 15:35:57 +0100530 "../../test:test_support",
ehmaldonado021eef32017-01-05 07:09:50 -0800531 ]
ehmaldonado021eef32017-01-05 07:09:50 -0800532 }
533
Sam Zackrisson4d364492018-03-02 16:03:21 +0100534 rtc_source_set("file_audio_generator_unittests") {
535 testonly = true
536
537 sources = [
538 "audio_generator/file_audio_generator_unittest.cc",
539 ]
540
541 deps = [
Alessio Bazzicab768e882018-11-07 14:29:54 +0000542 ":api",
Sam Zackrisson4d364492018-03-02 16:03:21 +0100543 ":audio_generator_factory",
544 ":audio_processing",
545 ":file_audio_generator",
546 "../../rtc_base:rtc_base_approved",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100547 "../../test:fileutils",
Sam Zackrisson4d364492018-03-02 16:03:21 +0100548 "../../test:test_support",
549 ]
550 }
551
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200552 rtc_source_set("analog_mic_simulation") {
553 sources = [
554 "test/fake_recording_device.cc",
555 "test/fake_recording_device.h",
556 ]
557 deps = [
558 "../../api:array_view",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200559 "../../api/audio:audio_frame_api",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200560 "../../common_audio:common_audio",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100561 "../../rtc_base:checks",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200562 "../../rtc_base:rtc_base_approved",
Alex Loiko5c71e742018-07-02 11:37:47 +0200563 "../../rtc_base:safe_minmax",
Alex Loikoed8ff642018-07-06 14:54:30 +0200564 "agc:gain_map",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200565 "//third_party/abseil-cpp/absl/memory",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200566 "//third_party/abseil-cpp/absl/types:optional",
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200567 ]
568 }
569
ehmaldonado1fd08c12017-01-17 02:37:34 -0800570 if (rtc_enable_protobuf) {
Ivo Creusen8c812f32018-03-09 17:33:04 +0100571 rtc_source_set("audioproc_f_impl") {
ehmaldonado1fd08c12017-01-17 02:37:34 -0800572 testonly = true
Per Åhgren7a95e0f2018-10-25 09:56:49 +0200573 configs += [ ":apm_debug_dump" ]
ehmaldonado1fd08c12017-01-17 02:37:34 -0800574 sources = [
575 "test/aec_dump_based_simulator.cc",
576 "test/aec_dump_based_simulator.h",
577 "test/audio_processing_simulator.cc",
578 "test/audio_processing_simulator.h",
Ivo Creusen2cb41052018-03-15 12:22:52 +0100579 "test/audioproc_float_impl.cc",
580 "test/audioproc_float_impl.h",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800581 "test/wav_based_simulator.cc",
582 "test/wav_based_simulator.h",
583 ]
peahc3ec1fd2016-08-07 23:19:30 -0700584
ehmaldonado1fd08c12017-01-17 02:37:34 -0800585 deps = [
Alessio Bazzicaca90a552017-09-27 11:51:10 +0200586 ":analog_mic_simulation",
Alessio Bazzicab768e882018-11-07 14:29:54 +0000587 ":api",
Per Åhgren7a95e0f2018-10-25 09:56:49 +0200588 ":apm_logging",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800589 ":audio_processing",
590 ":audioproc_debug_proto",
591 ":audioproc_protobuf_utils",
592 ":audioproc_test_utils",
Alex Loiko62347222018-09-10 10:18:07 +0200593 ":runtime_settings_protobuf_utils",
Sam Zackrissona4c85142018-10-10 10:44:43 +0200594 "../../api/audio:aec3_config_json",
Gustaf Ullberg0efa9412018-02-27 13:58:45 +0100595 "../../api/audio:aec3_factory",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800596 "../../common_audio:common_audio",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100597 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700598 "../../rtc_base:protobuf_utils",
599 "../../rtc_base:rtc_base_approved",
Per Åhgrenad09d742018-03-08 07:47:14 +0100600 "../../rtc_base:rtc_json",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700601 "../../rtc_base:rtc_task_queue",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800602 "../../system_wrappers",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800603 "../../test:test_support",
aleloif4dd1912017-06-15 01:55:38 -0700604 "aec_dump",
605 "aec_dump:aec_dump_impl",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800606 "//testing/gtest",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200607 "//third_party/abseil-cpp/absl/memory",
Alessio Bazzica68170382018-11-20 12:27:20 +0100608 "//third_party/abseil-cpp/absl/strings",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200609 "//third_party/abseil-cpp/absl/types:optional",
ehmaldonado1fd08c12017-01-17 02:37:34 -0800610 ]
Ivo Creusen8c812f32018-03-09 17:33:04 +0100611 } # audioproc_f_impl
612 rtc_executable("audioproc_f") {
613 testonly = true
614 sources = [
615 "test/audioproc_float_main.cc",
616 ]
617 deps = [
Alessio Bazzicab768e882018-11-07 14:29:54 +0000618 ":api",
Ivo Creusen8c812f32018-03-09 17:33:04 +0100619 ":audio_processing",
Ivo Creusen2cb41052018-03-15 12:22:52 +0100620 "../../api:audioproc_f_api",
Ivo Creusen8c812f32018-03-09 17:33:04 +0100621 "../../rtc_base:rtc_base_approved",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200622 "//third_party/abseil-cpp/absl/memory",
Ivo Creusen8c812f32018-03-09 17:33:04 +0100623 ]
ehmaldonado1fd08c12017-01-17 02:37:34 -0800624 } # audioproc_f
625 }
peahc3ec1fd2016-08-07 23:19:30 -0700626
ehmaldonado38a21322016-09-02 04:10:34 -0700627 rtc_source_set("audioproc_test_utils") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000628 visibility = [ "*" ]
kjellanderfb114242016-06-13 00:19:48 -0700629 testonly = true
630 sources = [
ehmaldonado529f83c2016-07-27 08:14:32 -0700631 "test/audio_buffer_tools.cc",
632 "test/audio_buffer_tools.h",
Sam Zackrissond57f9dd2017-09-13 11:00:04 +0200633 "test/bitexactness_tools.cc",
634 "test/bitexactness_tools.h",
ivoc3cfb3ef2016-11-24 04:17:28 -0800635 "test/performance_timer.cc",
636 "test/performance_timer.h",
637 "test/simulator_buffers.cc",
638 "test/simulator_buffers.h",
kjellanderfb114242016-06-13 00:19:48 -0700639 "test/test_utils.cc",
640 "test/test_utils.h",
641 ]
642
kjellanderfb114242016-06-13 00:19:48 -0700643 deps = [
Alessio Bazzicab768e882018-11-07 14:29:54 +0000644 ":api",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800645 ":audio_processing",
kwiberg529662a2017-09-04 05:43:17 -0700646 "../../api:array_view",
Fredrik Solenbergbbf21a32018-04-12 22:44:09 +0200647 "../../api/audio:audio_frame_api",
kjellanderfb114242016-06-13 00:19:48 -0700648 "../../common_audio",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100649 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700650 "../../rtc_base:rtc_base_approved",
Niels Möllera12c42a2018-07-25 16:05:48 +0200651 "../../rtc_base/system:arch",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100652 "../../system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100653 "../../test:fileutils",
Sam Zackrissond57f9dd2017-09-13 11:00:04 +0200654 "../../test:test_support",
Ivo Creusen385b10b2017-10-13 12:37:27 +0200655 "../audio_coding:neteq_input_audio_tools",
Sam Zackrissond57f9dd2017-09-13 11:00:04 +0200656 "//testing/gtest",
Danil Chapovalovdb9f7ab2018-06-19 10:50:11 +0200657 "//third_party/abseil-cpp/absl/types:optional",
kjellanderfb114242016-06-13 00:19:48 -0700658 ]
659 }
660
ehmaldonado38a21322016-09-02 04:10:34 -0700661 rtc_executable("transient_suppression_test") {
kwiberg7a770e02016-08-25 02:32:43 -0700662 testonly = true
663 sources = [
664 "transient/file_utils.cc",
665 "transient/file_utils.h",
666 "transient/transient_suppression_test.cc",
667 ]
668 deps = [
669 ":audio_processing",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800670 "../..:webrtc_common",
671 "../../common_audio:common_audio",
oprypin6e09d872017-08-31 03:21:39 -0700672 "../../rtc_base:rtc_base_approved",
Karl Wiberg6a4d4112018-03-23 10:39:34 +0100673 "../../rtc_base/system:file_wrapper",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100674 "../../system_wrappers",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100675 "../../test:fileutils",
kwiberg7a770e02016-08-25 02:32:43 -0700676 "../../test:test_support",
Alex Loikoed8ff642018-07-06 14:54:30 +0200677 "agc:level_estimation",
kwiberg7a770e02016-08-25 02:32:43 -0700678 "//testing/gtest",
kwiberg7a770e02016-08-25 02:32:43 -0700679 ]
kwiberg7a770e02016-08-25 02:32:43 -0700680 }
681
ehmaldonado38a21322016-09-02 04:10:34 -0700682 rtc_executable("click_annotate") {
kwiberg7a770e02016-08-25 02:32:43 -0700683 testonly = true
684 sources = [
685 "transient/click_annotate.cc",
686 "transient/file_utils.cc",
687 "transient/file_utils.h",
688 ]
689 deps = [
690 ":audio_processing",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800691 "../..:webrtc_common",
Karl Wiberg6a4d4112018-03-23 10:39:34 +0100692 "../../rtc_base/system:file_wrapper",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100693 "../../system_wrappers",
kwiberg7a770e02016-08-25 02:32:43 -0700694 ]
695 }
696
kjellanderfb114242016-06-13 00:19:48 -0700697 if (rtc_enable_protobuf) {
698 proto_library("audioproc_unittest_proto") {
699 sources = [
700 "test/unittest.proto",
701 ]
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200702 proto_out_dir = "modules/audio_processing/test"
kjellanderfb114242016-06-13 00:19:48 -0700703 }
704
kjellanderb62dbbe2016-09-23 00:38:52 -0700705 rtc_static_library("audioproc_protobuf_utils") {
kjellanderfb114242016-06-13 00:19:48 -0700706 sources = [
707 "test/protobuf_utils.cc",
708 "test/protobuf_utils.h",
709 ]
710
711 deps = [
ehmaldonadobcba64a2016-08-19 02:11:07 -0700712 ":audioproc_debug_proto",
ehmaldonado64c4a7e2016-12-08 04:10:01 -0800713 "../..:webrtc_common",
Alex Loiko62347222018-09-10 10:18:07 +0200714 "../../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700715 "../../rtc_base:protobuf_utils",
716 "../../rtc_base:rtc_base_approved",
Niels Möllera12c42a2018-07-25 16:05:48 +0200717 "../../rtc_base/system:arch",
kjellanderfb114242016-06-13 00:19:48 -0700718 ]
719 }
Alex Loiko62347222018-09-10 10:18:07 +0200720
721 rtc_static_library("runtime_settings_protobuf_utils") {
722 testonly = true
723 sources = [
724 "test/runtime_setting_util.cc",
725 "test/runtime_setting_util.h",
726 ]
727
728 deps = [
Alessio Bazzicab768e882018-11-07 14:29:54 +0000729 ":api",
Alex Loiko62347222018-09-10 10:18:07 +0200730 ":audio_processing",
731 ":audioproc_debug_proto",
732 ":audioproc_protobuf_utils",
733 "../../rtc_base:checks",
734 ]
735 }
kjellanderfb114242016-06-13 00:19:48 -0700736 }
737}