blob: 05eb42d14395b83878fafad042ed0cc02d744ac3 [file] [log] [blame]
Alex Loikoed8ff642018-07-06 14:54:30 +02001# Copyright (c) 2018 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
9import("../../../webrtc.gni")
10
Sam Zackrisson41478c72019-10-15 10:10:26 +020011rtc_source_set("gain_control_interface") {
12 sources = [
13 "gain_control.h",
14 ]
15}
16
Mirko Bonadei86d053c2019-10-17 21:32:04 +020017rtc_library("agc") {
Alex Loikoed8ff642018-07-06 14:54:30 +020018 sources = [
19 "agc_manager_direct.cc",
20 "agc_manager_direct.h",
21 ]
22 configs += [ "..:apm_debug_dump" ]
23 deps = [
Sam Zackrisson41478c72019-10-15 10:10:26 +020024 ":gain_control_interface",
Alex Loikoed8ff642018-07-06 14:54:30 +020025 ":gain_map",
26 ":level_estimation",
27 "..:apm_logging",
Per Ã…hgren928146f2019-08-20 09:19:21 +020028 "../../../common_audio",
29 "../../../common_audio:common_audio_c",
Alex Loikoed8ff642018-07-06 14:54:30 +020030 "../../../rtc_base:checks",
Alex Loiko9489c3a2018-08-09 15:04:24 +020031 "../../../rtc_base:gtest_prod",
Alex Loikoed8ff642018-07-06 14:54:30 +020032 "../../../rtc_base:logging",
33 "../../../rtc_base:macromagic",
34 "../../../rtc_base:safe_minmax",
henrikaebf45522019-11-04 13:59:21 +010035 "../../../system_wrappers:field_trial",
Mirko Bonadei17f48782018-09-28 08:51:10 +020036 "../../../system_wrappers:metrics",
Alex Loiko2ffafa82018-07-06 15:35:42 +020037 "../agc2:level_estimation_agc",
Alex Loikoed8ff642018-07-06 14:54:30 +020038 "../vad",
39 ]
40}
41
Mirko Bonadei86d053c2019-10-17 21:32:04 +020042rtc_library("level_estimation") {
Alex Loikoed8ff642018-07-06 14:54:30 +020043 sources = [
44 "agc.cc",
45 "agc.h",
46 "loudness_histogram.cc",
47 "loudness_histogram.h",
48 "utility.cc",
49 "utility.h",
50 ]
51 deps = [
Alex Loikoed8ff642018-07-06 14:54:30 +020052 "../../../rtc_base:checks",
53 "../../../rtc_base:macromagic",
54 "../vad",
55 ]
56}
57
Mirko Bonadei86d053c2019-10-17 21:32:04 +020058rtc_library("agc_legacy_c") {
Alex Loikoed8ff642018-07-06 14:54:30 +020059 visibility = [
60 ":*",
61 "..:*",
62 ] # Only targets in this file and in
63 # audio_processing can depend on
64 # this.
65
66 sources = [
67 "legacy/analog_agc.c",
68 "legacy/analog_agc.h",
69 "legacy/digital_agc.c",
70 "legacy/digital_agc.h",
71 "legacy/gain_control.h",
72 ]
73
74 deps = [
Alex Loikoed8ff642018-07-06 14:54:30 +020075 "../../../common_audio",
76 "../../../common_audio:common_audio_c",
Artem Titov333a5052018-07-25 16:56:18 +020077 "../../../common_audio/third_party/fft4g",
Alex Loikoed8ff642018-07-06 14:54:30 +020078 "../../../rtc_base:checks",
79 "../../../rtc_base:rtc_base_approved",
80 "../../../system_wrappers:cpu_features_api",
81 ]
82
83 if (rtc_build_with_neon) {
84 if (current_cpu != "arm64") {
Oleh Prypind2f4e8b2018-08-01 12:18:05 +020085 # Enable compilation for the NEON instruction set.
Alex Loikoed8ff642018-07-06 14:54:30 +020086 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
87 cflags = [ "-mfpu=neon" ]
88 }
Alex Loikoed8ff642018-07-06 14:54:30 +020089 }
90}
91
92rtc_source_set("gain_map") {
93 sources = [
94 "gain_map_internal.h",
95 ]
96}
97
98if (rtc_include_tests) {
Mirko Bonadei86d053c2019-10-17 21:32:04 +020099 rtc_library("agc_unittests") {
Alex Loikoed8ff642018-07-06 14:54:30 +0200100 testonly = true
101 sources = [
102 "agc_manager_direct_unittest.cc",
103 "loudness_histogram_unittest.cc",
104 "mock_agc.h",
105 ]
106 configs += [ "..:apm_debug_dump" ]
107
Alex Loikoed8ff642018-07-06 14:54:30 +0200108 deps = [
109 ":agc",
Sam Zackrisson41478c72019-10-15 10:10:26 +0200110 ":gain_control_interface",
Alex Loikoed8ff642018-07-06 14:54:30 +0200111 ":level_estimation",
112 "..:mocks",
henrikaebf45522019-11-04 13:59:21 +0100113 "../../../test:field_trial",
Alex Loikoed8ff642018-07-06 14:54:30 +0200114 "../../../test:fileutils",
115 "../../../test:test_support",
116 "//testing/gtest",
117 ]
118 }
119}