• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 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("gain_control_interface") {
12  sources = [ "gain_control.h" ]
13}
14
15rtc_library("agc") {
16  sources = [
17    "agc_manager_direct.cc",
18    "agc_manager_direct.h",
19  ]
20  configs += [ "..:apm_debug_dump" ]
21  deps = [
22    ":gain_control_interface",
23    ":gain_map",
24    ":level_estimation",
25    "..:apm_logging",
26    "..:audio_buffer",
27    "../../../common_audio",
28    "../../../common_audio:common_audio_c",
29    "../../../rtc_base:checks",
30    "../../../rtc_base:gtest_prod",
31    "../../../rtc_base:logging",
32    "../../../rtc_base:macromagic",
33    "../../../rtc_base:rtc_base_approved",
34    "../../../rtc_base:safe_minmax",
35    "../../../system_wrappers:field_trial",
36    "../../../system_wrappers:metrics",
37    "../agc2:level_estimation_agc",
38    "../vad",
39  ]
40  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
41}
42
43rtc_library("level_estimation") {
44  sources = [
45    "agc.cc",
46    "agc.h",
47    "loudness_histogram.cc",
48    "loudness_histogram.h",
49    "utility.cc",
50    "utility.h",
51  ]
52  deps = [
53    "../../../rtc_base:checks",
54    "../../../rtc_base:macromagic",
55    "../vad",
56  ]
57}
58
59rtc_library("legacy_agc") {
60  visibility = [
61    ":*",
62    "..:*",
63  ]  # Only targets in this file and in
64     # audio_processing can depend on
65     # this.
66
67  sources = [
68    "legacy/analog_agc.cc",
69    "legacy/analog_agc.h",
70    "legacy/digital_agc.cc",
71    "legacy/digital_agc.h",
72    "legacy/gain_control.h",
73  ]
74
75  deps = [
76    "../../../common_audio",
77    "../../../common_audio:common_audio_c",
78    "../../../common_audio/third_party/ooura:fft_size_256",
79    "../../../rtc_base:checks",
80    "../../../rtc_base:rtc_base_approved",
81    "../../../system_wrappers:cpu_features_api",
82  ]
83
84  if (rtc_build_with_neon) {
85    if (current_cpu != "arm64") {
86      # Enable compilation for the NEON instruction set.
87      suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
88      cflags = [ "-mfpu=neon" ]
89    }
90  }
91}
92
93rtc_source_set("gain_map") {
94  sources = [ "gain_map_internal.h" ]
95}
96
97if (rtc_include_tests) {
98  rtc_library("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
107    deps = [
108      ":agc",
109      ":gain_control_interface",
110      ":level_estimation",
111      "..:mocks",
112      "../../../test:field_trial",
113      "../../../test:fileutils",
114      "../../../test:test_support",
115      "//testing/gtest",
116    ]
117  }
118}
119