blob: 7e363ca55230f1616443a676e11608d6e88f8fa4 [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
Alex Loikoed8ff642018-07-06 14:54:30 +020017rtc_source_set("agc") {
18 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",
Mirko Bonadei17f48782018-09-28 08:51:10 +020035 "../../../system_wrappers:metrics",
Alex Loiko2ffafa82018-07-06 15:35:42 +020036 "../agc2:level_estimation_agc",
Alex Loikoed8ff642018-07-06 14:54:30 +020037 "../vad",
38 ]
39}
40
41rtc_source_set("level_estimation") {
42 sources = [
43 "agc.cc",
44 "agc.h",
45 "loudness_histogram.cc",
46 "loudness_histogram.h",
47 "utility.cc",
48 "utility.h",
49 ]
50 deps = [
Alex Loikoed8ff642018-07-06 14:54:30 +020051 "../../../rtc_base:checks",
52 "../../../rtc_base:macromagic",
53 "../vad",
54 ]
55}
56
57rtc_source_set("agc_legacy_c") {
58 visibility = [
59 ":*",
60 "..:*",
61 ] # Only targets in this file and in
62 # audio_processing can depend on
63 # this.
64
65 sources = [
66 "legacy/analog_agc.c",
67 "legacy/analog_agc.h",
68 "legacy/digital_agc.c",
69 "legacy/digital_agc.h",
70 "legacy/gain_control.h",
71 ]
72
73 deps = [
Alex Loikoed8ff642018-07-06 14:54:30 +020074 "../../../common_audio",
75 "../../../common_audio:common_audio_c",
Artem Titov333a5052018-07-25 16:56:18 +020076 "../../../common_audio/third_party/fft4g",
Alex Loikoed8ff642018-07-06 14:54:30 +020077 "../../../rtc_base:checks",
78 "../../../rtc_base:rtc_base_approved",
79 "../../../system_wrappers:cpu_features_api",
80 ]
81
82 if (rtc_build_with_neon) {
83 if (current_cpu != "arm64") {
Oleh Prypind2f4e8b2018-08-01 12:18:05 +020084 # Enable compilation for the NEON instruction set.
Alex Loikoed8ff642018-07-06 14:54:30 +020085 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
86 cflags = [ "-mfpu=neon" ]
87 }
Alex Loikoed8ff642018-07-06 14:54:30 +020088 }
89}
90
91rtc_source_set("gain_map") {
92 sources = [
93 "gain_map_internal.h",
94 ]
95}
96
97if (rtc_include_tests) {
98 rtc_source_set("agc_unittests") {
99 testonly = true
100 sources = [
101 "agc_manager_direct_unittest.cc",
102 "loudness_histogram_unittest.cc",
103 "mock_agc.h",
104 ]
105 configs += [ "..:apm_debug_dump" ]
106
Alex Loikoed8ff642018-07-06 14:54:30 +0200107 deps = [
108 ":agc",
Sam Zackrisson41478c72019-10-15 10:10:26 +0200109 ":gain_control_interface",
Alex Loikoed8ff642018-07-06 14:54:30 +0200110 ":level_estimation",
111 "..:mocks",
Alex Loikoed8ff642018-07-06 14:54:30 +0200112 "../../../test:fileutils",
113 "../../../test:test_support",
114 "//testing/gtest",
115 ]
116 }
117}