blob: 69db73dbdf63533f25f8f463ded8be89e903bef6 [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
11rtc_source_set("agc") {
12 sources = [
13 "agc_manager_direct.cc",
14 "agc_manager_direct.h",
15 ]
16 configs += [ "..:apm_debug_dump" ]
17 deps = [
18 ":gain_map",
19 ":level_estimation",
20 "..:apm_logging",
21 "..:gain_control_interface",
Alex Loikoed8ff642018-07-06 14:54:30 +020022 "../../../rtc_base:checks",
Alex Loiko9489c3a2018-08-09 15:04:24 +020023 "../../../rtc_base:gtest_prod",
Alex Loikoed8ff642018-07-06 14:54:30 +020024 "../../../rtc_base:logging",
25 "../../../rtc_base:macromagic",
26 "../../../rtc_base:safe_minmax",
Mirko Bonadei17f48782018-09-28 08:51:10 +020027 "../../../system_wrappers:metrics",
Alex Loiko2ffafa82018-07-06 15:35:42 +020028 "../agc2:level_estimation_agc",
Alex Loikoed8ff642018-07-06 14:54:30 +020029 "../vad",
30 ]
31}
32
33rtc_source_set("level_estimation") {
34 sources = [
35 "agc.cc",
36 "agc.h",
37 "loudness_histogram.cc",
38 "loudness_histogram.h",
39 "utility.cc",
40 "utility.h",
41 ]
42 deps = [
Alex Loikoed8ff642018-07-06 14:54:30 +020043 "../../../rtc_base:checks",
44 "../../../rtc_base:macromagic",
45 "../vad",
46 ]
47}
48
49rtc_source_set("agc_legacy_c") {
50 visibility = [
51 ":*",
52 "..:*",
53 ] # Only targets in this file and in
54 # audio_processing can depend on
55 # this.
56
57 sources = [
58 "legacy/analog_agc.c",
59 "legacy/analog_agc.h",
60 "legacy/digital_agc.c",
61 "legacy/digital_agc.h",
62 "legacy/gain_control.h",
63 ]
64
65 deps = [
Alex Loikoed8ff642018-07-06 14:54:30 +020066 "../../../common_audio",
67 "../../../common_audio:common_audio_c",
Artem Titov333a5052018-07-25 16:56:18 +020068 "../../../common_audio/third_party/fft4g",
Alex Loikoed8ff642018-07-06 14:54:30 +020069 "../../../rtc_base:checks",
70 "../../../rtc_base:rtc_base_approved",
71 "../../../system_wrappers:cpu_features_api",
72 ]
73
74 if (rtc_build_with_neon) {
75 if (current_cpu != "arm64") {
Oleh Prypind2f4e8b2018-08-01 12:18:05 +020076 # Enable compilation for the NEON instruction set.
Alex Loikoed8ff642018-07-06 14:54:30 +020077 suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
78 cflags = [ "-mfpu=neon" ]
79 }
80
81 # Disable LTO on NEON targets due to compiler bug.
82 # TODO(fdegans): Enable this. See crbug.com/408997.
83 if (rtc_use_lto) {
84 cflags -= [
85 "-flto",
86 "-ffat-lto-objects",
87 ]
88 }
89 }
90}
91
92rtc_source_set("gain_map") {
93 sources = [
94 "gain_map_internal.h",
95 ]
96}
97
98if (rtc_include_tests) {
99 rtc_source_set("agc_unittests") {
100 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",
110 ":level_estimation",
111 "..:mocks",
Alex Loikoed8ff642018-07-06 14:54:30 +0200112 "../../../test:fileutils",
113 "../../../test:test_support",
114 "//testing/gtest",
115 ]
116 }
117}