From bd8c865f43b5b81b1637b4aa7ce0b775f8dd3575 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Fri, 20 Mar 2015 00:28:22 +0000 Subject: [PATCH] Remove build-time beamformer flags. RealFourier is now unconditionally enabled since we can fall back to the Ooura FFT. We no longer need to condition users on rtc_use_openmax_dl. R=aluebs@webrtc.org, mgraczyk@google.com Review URL: https://webrtc-codereview.appspot.com/50439004 Cr-Commit-Position: refs/heads/master@{#8799} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8799 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/audio_processing/BUILD.gn | 10 +-- .../audio_processing/audio_processing.gypi | 9 +- .../audio_processing/audio_processing_impl.cc | 6 -- .../audio_processing_tests.gypi | 86 +++++++++---------- 4 files changed, 46 insertions(+), 65 deletions(-) diff --git a/webrtc/modules/audio_processing/BUILD.gn b/webrtc/modules/audio_processing/BUILD.gn index e4ee78266..cc1160384 100644 --- a/webrtc/modules/audio_processing/BUILD.gn +++ b/webrtc/modules/audio_processing/BUILD.gn @@ -76,6 +76,8 @@ source_set("audio_processing") { "beamformer/covariance_matrix_generator.cc", "beamformer/covariance_matrix_generator.h", "beamformer/matrix.h", + "beamformer/nonlinear_beamformer.cc", + "beamformer/nonlinear_beamformer.h", "common.h", "echo_cancellation_impl.cc", "echo_cancellation_impl.h", @@ -165,14 +167,6 @@ source_set("audio_processing") { ] } - if (rtc_use_openmax_dl) { - defines += [ "WEBRTC_BEAMFORMER" ] - sources += [ - "beamformer/nonlinear_beamformer.cc", - "beamformer/nonlinear_beamformer.h", - ] - } - if (current_cpu == "x86" || current_cpu == "x64") { deps += [ ":audio_processing_sse2" ] } diff --git a/webrtc/modules/audio_processing/audio_processing.gypi b/webrtc/modules/audio_processing/audio_processing.gypi index 9d1ac8ccb..0b19fd9ad 100644 --- a/webrtc/modules/audio_processing/audio_processing.gypi +++ b/webrtc/modules/audio_processing/audio_processing.gypi @@ -86,6 +86,8 @@ 'beamformer/covariance_matrix_generator.cc', 'beamformer/covariance_matrix_generator.h', 'beamformer/matrix.h', + 'beamformer/nonlinear_beamformer.cc', + 'beamformer/nonlinear_beamformer.h', 'common.h', 'echo_cancellation_impl.cc', 'echo_cancellation_impl.h', @@ -174,13 +176,6 @@ 'ns/windows_private.h', ], }], - ['rtc_use_openmax_dl==1', { - 'defines': ['WEBRTC_BEAMFORMER'], - 'sources': [ - 'beamformer/nonlinear_beamformer.cc', - 'beamformer/nonlinear_beamformer.h', - ], - }], ['target_arch=="ia32" or target_arch=="x64"', { 'dependencies': ['audio_processing_sse2',], }], diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc index d1421f336..e98970861 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl.cc +++ b/webrtc/modules/audio_processing/audio_processing_impl.cc @@ -599,12 +599,10 @@ int AudioProcessingImpl::ProcessStreamLocked() { ca->SplitIntoFrequencyBands(); } -#ifdef WEBRTC_BEAMFORMER if (beamformer_enabled_) { beamformer_->ProcessChunk(ca->split_data_f(), ca->split_data_f()); ca->set_num_channels(1); } -#endif RETURN_ON_ERR(high_pass_filter_->ProcessCaptureAudio(ca)); RETURN_ON_ERR(gain_control_->AnalyzeCaptureAudio(ca)); @@ -986,14 +984,10 @@ int AudioProcessingImpl::InitializeTransient() { void AudioProcessingImpl::InitializeBeamformer() { if (beamformer_enabled_) { -#ifdef WEBRTC_BEAMFORMER if (!beamformer_) { beamformer_.reset(new NonlinearBeamformer(array_geometry_)); } beamformer_->Initialize(kChunkSizeMs, split_rate_); -#else - assert(false); -#endif } } diff --git a/webrtc/modules/audio_processing/audio_processing_tests.gypi b/webrtc/modules/audio_processing/audio_processing_tests.gypi index 861f9cdd6..a53514458 100644 --- a/webrtc/modules/audio_processing/audio_processing_tests.gypi +++ b/webrtc/modules/audio_processing/audio_processing_tests.gypi @@ -7,6 +7,48 @@ # be found in the AUTHORS file in the root of the source tree. { + 'targets': [ + { + 'target_name': 'transient_suppression_test', + 'type': 'executable', + 'dependencies': [ + '<(DEPTH)/testing/gtest.gyp:gtest', + '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', + '<(webrtc_root)/test/test.gyp:test_support', + '<(webrtc_root)/modules/modules.gyp:audio_processing', + ], + 'sources': [ + 'transient/transient_suppression_test.cc', + 'transient/file_utils.cc', + 'transient/file_utils.h', + ], + }, # transient_suppression_test + { + 'target_name': 'click_annotate', + 'type': 'executable', + 'dependencies': [ + '<(webrtc_root)/modules/modules.gyp:audio_processing', + ], + 'sources': [ + 'transient/click_annotate.cc', + 'transient/file_utils.cc', + 'transient/file_utils.h', + ], + }, # click_annotate + { + 'target_name': 'nonlinear_beamformer_test', + 'type': 'executable', + 'dependencies': [ + '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', + '<(webrtc_root)/modules/modules.gyp:audio_processing', + ], + 'sources': [ + 'beamformer/nonlinear_beamformer_test.cc', + 'beamformer/pcm_utils.cc', + 'beamformer/pcm_utils.h', + ], + }, # nonlinear_beamformer_test + ], 'conditions': [ ['enable_protobuf==1', { 'targets': [ @@ -56,50 +98,6 @@ ], 'sources': [ 'test/unpack.cc', ], }, - { - 'target_name': 'transient_suppression_test', - 'type': 'executable', - 'dependencies': [ - '<(DEPTH)/testing/gtest.gyp:gtest', - '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', - '<(webrtc_root)/test/test.gyp:test_support', - '<(webrtc_root)/modules/modules.gyp:audio_processing', - ], - 'sources': [ - 'transient/transient_suppression_test.cc', - 'transient/file_utils.cc', - 'transient/file_utils.h', - ], - }, # transient_suppression_test - { - 'target_name': 'click_annotate', - 'type': 'executable', - 'dependencies': [ - '<(webrtc_root)/modules/modules.gyp:audio_processing', - ], - 'sources': [ - 'transient/click_annotate.cc', - 'transient/file_utils.cc', - 'transient/file_utils.h', - ], - }, # click_annotate - ], - }], - ['rtc_use_openmax_dl==1', { - 'targets': [ - { - 'target_name': 'nonlinear_beamformer_test', - 'type': 'executable', - 'dependencies': [ - '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', - '<(webrtc_root)/modules/modules.gyp:audio_processing', - ], - 'sources': [ - 'beamformer/nonlinear_beamformer_test.cc', - 'beamformer/pcm_utils.cc', - 'beamformer/pcm_utils.h', - ], - }, # nonlinear_beamformer_test ], }], ],