aboutsummaryrefslogtreecommitdiff
path: root/modules/audio_processing/agc/BUILD.gn
blob: 5ad66443234ecffe32251a6e83aecf3e1eab254c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS.  All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

import("../../../webrtc.gni")

rtc_source_set("gain_control_interface") {
  sources = [ "gain_control.h" ]
}

rtc_library("agc") {
  sources = [
    "agc_manager_direct.cc",
    "agc_manager_direct.h",
  ]
  configs += [ "..:apm_debug_dump" ]
  deps = [
    ":gain_control_interface",
    ":gain_map",
    ":level_estimation",
    "..:apm_logging",
    "..:audio_buffer",
    "../../../common_audio",
    "../../../common_audio:common_audio_c",
    "../../../rtc_base:checks",
    "../../../rtc_base:gtest_prod",
    "../../../rtc_base:logging",
    "../../../rtc_base:rtc_base_approved",
    "../../../rtc_base:safe_minmax",
    "../../../system_wrappers:field_trial",
    "../../../system_wrappers:metrics",
    "../vad",
  ]
  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
}

rtc_library("level_estimation") {
  sources = [
    "agc.cc",
    "agc.h",
    "loudness_histogram.cc",
    "loudness_histogram.h",
    "utility.cc",
    "utility.h",
  ]
  deps = [
    "../../../rtc_base:checks",
    "../vad",
  ]
}

rtc_library("legacy_agc") {
  visibility = [
    ":*",
    "..:*",
  ]  # Only targets in this file and in
     # audio_processing can depend on
     # this.

  sources = [
    "legacy/analog_agc.cc",
    "legacy/analog_agc.h",
    "legacy/digital_agc.cc",
    "legacy/digital_agc.h",
    "legacy/gain_control.h",
  ]

  deps = [
    "../../../common_audio",
    "../../../common_audio:common_audio_c",
    "../../../common_audio/third_party/ooura:fft_size_256",
    "../../../rtc_base:checks",
    "../../../rtc_base:rtc_base_approved",
    "../../../system_wrappers",
  ]

  if (rtc_build_with_neon) {
    if (current_cpu != "arm64") {
      # Enable compilation for the NEON instruction set.
      suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
      cflags = [ "-mfpu=neon" ]
    }
  }
}

rtc_source_set("gain_map") {
  sources = [ "gain_map_internal.h" ]
}

if (rtc_include_tests) {
  rtc_library("agc_unittests") {
    testonly = true
    sources = [
      "agc_manager_direct_unittest.cc",
      "loudness_histogram_unittest.cc",
      "mock_agc.h",
    ]
    configs += [ "..:apm_debug_dump" ]

    deps = [
      ":agc",
      ":gain_control_interface",
      ":level_estimation",
      "..:mocks",
      "../../../test:field_trial",
      "../../../test:fileutils",
      "../../../test:test_support",
      "//testing/gtest",
    ]
  }
}