Made modules/audio_processing/vad its own target.

WHAT: made a BUILD.gn with library and tests in the Audio Processing
Module Voice Activity Detector directory. Updated depending
code. Fixed a Clang warning.

WHY: to make it possible for a target to depend on just the VAD and
not the whole APM. There are other benefits:

* Sometimes faster compilation.

* The VAD takes up 28000 bytes of libjingle_peerconnection_so.so. Making
  a peerconnection shared object file without the VAD has to be done in
  steps. The first step is a custom target for the VAD. Hence this Cl.

Change-Id: Iea0207a0b5979db26baaf46b24beaefbb1c431af
BUG: webrtc:5716, webrtc:7494
Reviewed-on: https://webrtc-review.googlesource.com/47521
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Oleh Prypin <oprypin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21893}
This commit is contained in:
Alex Loiko
2018-02-05 11:15:23 +01:00
committed by Commit Bot
parent 824ef89757
commit 0488fcf293
5 changed files with 75 additions and 30 deletions

View File

@ -206,26 +206,6 @@ rtc_static_library("audio_processing") {
"transient/wpd_tree.h",
"typing_detection.cc",
"typing_detection.h",
"vad/common.h",
"vad/gmm.cc",
"vad/gmm.h",
"vad/noise_gmm_tables.h",
"vad/pitch_based_vad.cc",
"vad/pitch_based_vad.h",
"vad/pitch_internal.cc",
"vad/pitch_internal.h",
"vad/pole_zero_filter.cc",
"vad/pole_zero_filter.h",
"vad/standalone_vad.cc",
"vad/standalone_vad.h",
"vad/vad_audio_proc.cc",
"vad/vad_audio_proc.h",
"vad/vad_audio_proc_internal.h",
"vad/vad_circular_buffer.cc",
"vad/vad_circular_buffer.h",
"vad/voice_activity_detector.cc",
"vad/voice_activity_detector.h",
"vad/voice_gmm_tables.h",
"voice_detection_impl.cc",
"voice_detection_impl.h",
]
@ -251,7 +231,7 @@ rtc_static_library("audio_processing") {
"../../system_wrappers:cpu_features_api",
"../../system_wrappers:field_trial_api",
"../../system_wrappers:metrics_api",
"../audio_coding:isac",
"vad",
]
if (aec_untrusted_delay_for_testing) {
@ -573,14 +553,6 @@ if (rtc_include_tests) {
"transient/wpd_tree_unittest.cc",
"utility/block_mean_calculator_unittest.cc",
"utility/delay_estimator_unittest.cc",
"vad/gmm_unittest.cc",
"vad/pitch_based_vad_unittest.cc",
"vad/pitch_internal_unittest.cc",
"vad/pole_zero_filter_unittest.cc",
"vad/standalone_vad_unittest.cc",
"vad/vad_audio_proc_unittest.cc",
"vad/vad_circular_buffer_unittest.cc",
"vad/voice_activity_detector_unittest.cc",
]
deps = [
@ -607,6 +579,7 @@ if (rtc_include_tests) {
"../audio_coding:neteq_input_audio_tools",
"aec_dump:mock_aec_dump_unittests",
"test/conversational_speech:unittest",
"vad:vad_unittests",
"//testing/gtest",
]
@ -876,6 +849,7 @@ if (rtc_include_tests) {
deps = [
":audio_processing",
":audioproc_test_utils",
"../../common_audio",
"../../rtc_base:rtc_base_approved",
"../../system_wrappers:metrics_default",
"../../test:test_support",

View File

@ -143,6 +143,7 @@ rtc_executable("apm_vad") {
"../../../../common_audio",
"../../../../rtc_base:rtc_base_approved",
"../../../../system_wrappers:metrics_default",
"../../vad",
]
}

View File

@ -0,0 +1,69 @@
# 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_static_library("vad") {
visibility = [
"../*",
"../../../rtc_tools:*",
]
sources = [
"common.h",
"gmm.cc",
"gmm.h",
"noise_gmm_tables.h",
"pitch_based_vad.cc",
"pitch_based_vad.h",
"pitch_internal.cc",
"pitch_internal.h",
"pole_zero_filter.cc",
"pole_zero_filter.h",
"standalone_vad.cc",
"standalone_vad.h",
"vad_audio_proc.cc",
"vad_audio_proc.h",
"vad_audio_proc_internal.h",
"vad_circular_buffer.cc",
"vad_circular_buffer.h",
"voice_activity_detector.cc",
"voice_activity_detector.h",
"voice_gmm_tables.h",
]
deps = [
"../..:module_api",
"../../..:typedefs",
"../../../audio/utility:audio_frame_operations",
"../../../common_audio",
"../../../rtc_base:checks",
"../../audio_coding:isac",
]
}
if (rtc_include_tests) {
rtc_static_library("vad_unittests") {
testonly = true
sources = [
"gmm_unittest.cc",
"pitch_based_vad_unittest.cc",
"pitch_internal_unittest.cc",
"pole_zero_filter_unittest.cc",
"standalone_vad_unittest.cc",
"vad_audio_proc_unittest.cc",
"vad_circular_buffer_unittest.cc",
"voice_activity_detector_unittest.cc",
]
deps = [
":vad",
"../..:module_api",
"../../../common_audio",
"../../../test:test_support",
"//testing/gmock",
"//testing/gtest",
]
}
}

View File

@ -53,7 +53,7 @@ class PoleZeroFilterTest : public ::testing::Test {
kCoeffDenominator,
kFilterOrder)) {}
~PoleZeroFilterTest() {}
~PoleZeroFilterTest() override {}
void FilterSubframes(int num_subframes);

View File

@ -289,6 +289,7 @@ if (rtc_include_tests) {
deps = [
"../modules:module_api",
"../modules/audio_processing",
"../modules/audio_processing/vad",
"../rtc_base:rtc_base_approved",
"../system_wrappers:metrics_default",
"../test:test_support",