| 1 |
# Copyright (c) 2017 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 |
|
| 9 |
import("../../../webrtc.gni") |
| 10 |
|
| 11 |
group("agc2") { |
| 12 |
deps = [ |
| 13 |
":adaptive_digital", |
| 14 |
":fixed_digital", |
| 15 |
] |
| 16 |
} |
| 17 |
|
| 18 |
rtc_library("adaptive_digital") { |
| 19 |
sources = [ |
| 20 |
"adaptive_agc.cc", |
| 21 |
"adaptive_agc.h", |
| 22 |
"adaptive_digital_gain_applier.cc", |
| 23 |
"adaptive_digital_gain_applier.h", |
| 24 |
"adaptive_mode_level_estimator.cc", |
| 25 |
"adaptive_mode_level_estimator.h", |
| 26 |
"saturation_protector.cc", |
| 27 |
"saturation_protector.h", |
| 28 |
"saturation_protector_buffer.cc", |
| 29 |
"saturation_protector_buffer.h", |
| 30 |
] |
| 31 |
|
| 32 |
configs += [ "..:apm_debug_dump" ] |
| 33 |
|
| 34 |
deps = [ |
| 35 |
":common", |
| 36 |
":cpu_features", |
| 37 |
":gain_applier", |
| 38 |
":noise_level_estimator", |
| 39 |
":rnn_vad_with_level", |
| 40 |
"..:api", |
| 41 |
"..:apm_logging", |
| 42 |
"..:audio_frame_view", |
| 43 |
"../../../api:array_view", |
| 44 |
"../../../common_audio", |
| 45 |
"../../../rtc_base:checks", |
| 46 |
"../../../rtc_base:logging", |
| 47 |
"../../../rtc_base:rtc_base_approved", |
| 48 |
"../../../rtc_base:safe_compare", |
| 49 |
"../../../rtc_base:safe_minmax", |
| 50 |
"../../../system_wrappers:metrics", |
| 51 |
] |
| 52 |
|
| 53 |
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] |
| 54 |
} |
| 55 |
|
| 56 |
rtc_library("biquad_filter") { |
| 57 |
visibility = [ "./*" ] |
| 58 |
sources = [ |
| 59 |
"biquad_filter.cc", |
| 60 |
"biquad_filter.h", |
| 61 |
] |
| 62 |
deps = [ |
| 63 |
"../../../api:array_view", |
| 64 |
"../../../rtc_base:rtc_base_approved", |
| 65 |
] |
| 66 |
} |
| 67 |
|
| 68 |
rtc_source_set("common") { |
| 69 |
sources = [ "agc2_common.h" ] |
| 70 |
} |
| 71 |
|
| 72 |
rtc_library("fixed_digital") { |
| 73 |
sources = [ |
| 74 |
"fixed_digital_level_estimator.cc", |
| 75 |
"fixed_digital_level_estimator.h", |
| 76 |
"interpolated_gain_curve.cc", |
| 77 |
"interpolated_gain_curve.h", |
| 78 |
"limiter.cc", |
| 79 |
"limiter.h", |
| 80 |
] |
| 81 |
|
| 82 |
configs += [ "..:apm_debug_dump" ] |
| 83 |
|
| 84 |
deps = [ |
| 85 |
":common", |
| 86 |
"..:apm_logging", |
| 87 |
"..:audio_frame_view", |
| 88 |
"../../../api:array_view", |
| 89 |
"../../../common_audio", |
| 90 |
"../../../rtc_base:checks", |
| 91 |
"../../../rtc_base:gtest_prod", |
| 92 |
"../../../rtc_base:rtc_base_approved", |
| 93 |
"../../../rtc_base:safe_minmax", |
| 94 |
"../../../system_wrappers:metrics", |
| 95 |
] |
| 96 |
} |
| 97 |
|
| 98 |
rtc_library("gain_applier") { |
| 99 |
sources = [ |
| 100 |
"gain_applier.cc", |
| 101 |
"gain_applier.h", |
| 102 |
] |
| 103 |
deps = [ |
| 104 |
":common", |
| 105 |
"..:audio_frame_view", |
| 106 |
"../../../api:array_view", |
| 107 |
"../../../rtc_base:safe_minmax", |
| 108 |
] |
| 109 |
} |
| 110 |
|
| 111 |
rtc_library("noise_level_estimator") { |
| 112 |
sources = [ |
| 113 |
"down_sampler.cc", |
| 114 |
"down_sampler.h", |
| 115 |
"noise_level_estimator.cc", |
| 116 |
"noise_level_estimator.h", |
| 117 |
"noise_spectrum_estimator.cc", |
| 118 |
"noise_spectrum_estimator.h", |
| 119 |
"signal_classifier.cc", |
| 120 |
"signal_classifier.h", |
| 121 |
] |
| 122 |
deps = [ |
| 123 |
":biquad_filter", |
| 124 |
"..:apm_logging", |
| 125 |
"..:audio_frame_view", |
| 126 |
"../../../api:array_view", |
| 127 |
"../../../common_audio", |
| 128 |
"../../../common_audio/third_party/ooura:fft_size_128", |
| 129 |
"../../../rtc_base:checks", |
| 130 |
"../../../rtc_base:macromagic", |
| 131 |
"../../../system_wrappers", |
| 132 |
] |
| 133 |
|
| 134 |
configs += [ "..:apm_debug_dump" ] |
| 135 |
} |
| 136 |
|
| 137 |
rtc_library("rnn_vad_with_level") { |
| 138 |
sources = [ |
| 139 |
"vad_with_level.cc", |
| 140 |
"vad_with_level.h", |
| 141 |
] |
| 142 |
|
| 143 |
defines = [] |
| 144 |
if (rtc_build_with_neon && current_cpu != "arm64") { |
| 145 |
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ] |
| 146 |
cflags = [ "-mfpu=neon" ] |
| 147 |
} |
| 148 |
|
| 149 |
deps = [ |
| 150 |
":common", |
| 151 |
":cpu_features", |
| 152 |
"..:audio_frame_view", |
| 153 |
"../../../api:array_view", |
| 154 |
"../../../common_audio", |
| 155 |
"../../../rtc_base:checks", |
| 156 |
"rnn_vad", |
| 157 |
"rnn_vad:rnn_vad_common", |
| 158 |
] |
| 159 |
} |
| 160 |
|
| 161 |
rtc_library("cpu_features") { |
| 162 |
sources = [ |
| 163 |
"cpu_features.cc", |
| 164 |
"cpu_features.h", |
| 165 |
] |
| 166 |
visibility = [ "./*" ] |
| 167 |
deps = [ |
| 168 |
"../../../rtc_base:stringutils", |
| 169 |
"../../../rtc_base/system:arch", |
| 170 |
"../../../system_wrappers", |
| 171 |
] |
| 172 |
} |
| 173 |
|
| 174 |
rtc_library("adaptive_digital_unittests") { |
| 175 |
testonly = true |
| 176 |
configs += [ "..:apm_debug_dump" ] |
| 177 |
|
| 178 |
sources = [ |
| 179 |
"adaptive_digital_gain_applier_unittest.cc", |
| 180 |
"adaptive_mode_level_estimator_unittest.cc", |
| 181 |
"gain_applier_unittest.cc", |
| 182 |
"saturation_protector_buffer_unittest.cc", |
| 183 |
"saturation_protector_unittest.cc", |
| 184 |
] |
| 185 |
deps = [ |
| 186 |
":adaptive_digital", |
| 187 |
":common", |
| 188 |
":gain_applier", |
| 189 |
":test_utils", |
| 190 |
"..:apm_logging", |
| 191 |
"..:audio_frame_view", |
| 192 |
"../../../api:array_view", |
| 193 |
"../../../common_audio", |
| 194 |
"../../../rtc_base:checks", |
| 195 |
"../../../rtc_base:gunit_helpers", |
| 196 |
"../../../rtc_base:rtc_base_approved", |
| 197 |
"../../../test:test_support", |
| 198 |
] |
| 199 |
} |
| 200 |
|
| 201 |
rtc_library("biquad_filter_unittests") { |
| 202 |
testonly = true |
| 203 |
sources = [ "biquad_filter_unittest.cc" ] |
| 204 |
deps = [ |
| 205 |
":biquad_filter", |
| 206 |
"../../../rtc_base:gunit_helpers", |
| 207 |
] |
| 208 |
} |
| 209 |
|
| 210 |
rtc_library("fixed_digital_unittests") { |
| 211 |
testonly = true |
| 212 |
configs += [ "..:apm_debug_dump" ] |
| 213 |
|
| 214 |
sources = [ |
| 215 |
"agc2_testing_common_unittest.cc", |
| 216 |
"compute_interpolated_gain_curve.cc", |
| 217 |
"compute_interpolated_gain_curve.h", |
| 218 |
"fixed_digital_level_estimator_unittest.cc", |
| 219 |
"interpolated_gain_curve_unittest.cc", |
| 220 |
"limiter_db_gain_curve.cc", |
| 221 |
"limiter_db_gain_curve.h", |
| 222 |
"limiter_db_gain_curve_unittest.cc", |
| 223 |
"limiter_unittest.cc", |
| 224 |
] |
| 225 |
deps = [ |
| 226 |
":common", |
| 227 |
":fixed_digital", |
| 228 |
":test_utils", |
| 229 |
"..:apm_logging", |
| 230 |
"..:audio_frame_view", |
| 231 |
"../../../api:array_view", |
| 232 |
"../../../common_audio", |
| 233 |
"../../../rtc_base:checks", |
| 234 |
"../../../rtc_base:gunit_helpers", |
| 235 |
"../../../rtc_base:rtc_base_approved", |
| 236 |
"../../../system_wrappers:metrics", |
| 237 |
] |
| 238 |
} |
| 239 |
|
| 240 |
rtc_library("noise_estimator_unittests") { |
| 241 |
testonly = true |
| 242 |
configs += [ "..:apm_debug_dump" ] |
| 243 |
|
| 244 |
sources = [ |
| 245 |
"noise_level_estimator_unittest.cc", |
| 246 |
"signal_classifier_unittest.cc", |
| 247 |
] |
| 248 |
deps = [ |
| 249 |
":noise_level_estimator", |
| 250 |
":test_utils", |
| 251 |
"..:apm_logging", |
| 252 |
"..:audio_frame_view", |
| 253 |
"../../../api:array_view", |
| 254 |
"../../../api:function_view", |
| 255 |
"../../../rtc_base:checks", |
| 256 |
"../../../rtc_base:gunit_helpers", |
| 257 |
"../../../rtc_base:rtc_base_approved", |
| 258 |
] |
| 259 |
} |
| 260 |
|
| 261 |
rtc_library("rnn_vad_with_level_unittests") { |
| 262 |
testonly = true |
| 263 |
sources = [ "vad_with_level_unittest.cc" ] |
| 264 |
deps = [ |
| 265 |
":common", |
| 266 |
":rnn_vad_with_level", |
| 267 |
"..:audio_frame_view", |
| 268 |
"../../../rtc_base:gunit_helpers", |
| 269 |
"../../../rtc_base:safe_compare", |
| 270 |
"../../../test:test_support", |
| 271 |
] |
| 272 |
} |
| 273 |
|
| 274 |
rtc_library("test_utils") { |
| 275 |
testonly = true |
| 276 |
visibility = [ |
| 277 |
":*", |
| 278 |
"..:audio_processing_unittests", |
| 279 |
] |
| 280 |
sources = [ |
| 281 |
"agc2_testing_common.cc", |
| 282 |
"agc2_testing_common.h", |
| 283 |
"vector_float_frame.cc", |
| 284 |
"vector_float_frame.h", |
| 285 |
] |
| 286 |
deps = [ |
| 287 |
"..:audio_frame_view", |
| 288 |
"../../../rtc_base:checks", |
| 289 |
"../../../rtc_base:rtc_base_approved", |
| 290 |
] |
| 291 |
} |