diff options
author | Mirko Bonadei <mbonadei@webrtc.org> | 2018-09-07 13:34:20 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2018-09-07 13:34:39 +0000 |
commit | d7027dc081cb96791b51524210aa249eb301c056 (patch) | |
tree | 6f5b68315386677c114180ffe3a45e5fa28edda4 /modules | |
parent | d8c50780ea6757d2709fef67e2244fd931184323 (diff) | |
download | webrtc-d7027dc081cb96791b51524210aa249eb301c056.tar.gz |
Revert "Fix no_global_constructors in audio_processing/agc2/rnn_vad."
This reverts commit 5e2e66d8a0fd5e1bf9b3efc54a94cba3e7088b00.
Reason for revert: Change implementation.
Original change's description:
> Fix no_global_constructors in audio_processing/agc2/rnn_vad.
>
> Bug: webrtc:9693
> Change-Id: Ica997d5cbe28288720325a51058a40a37c612665
> Reviewed-on: https://webrtc-review.googlesource.com/98583
> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#24617}
TBR=mbonadei@webrtc.org,alessiob@webrtc.org,kwiberg@webrtc.org
Change-Id: I9e30f6ec08baa22a8d6c15546341000738c095b6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9693
Reviewed-on: https://webrtc-review.googlesource.com/98842
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24631}
Diffstat (limited to 'modules')
-rw-r--r-- | modules/audio_processing/agc2/rnn_vad/BUILD.gn | 1 | ||||
-rw-r--r-- | modules/audio_processing/agc2/rnn_vad/spectral_features_internal.cc | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/modules/audio_processing/agc2/rnn_vad/BUILD.gn b/modules/audio_processing/agc2/rnn_vad/BUILD.gn index d1edecea33..867a9bb57f 100644 --- a/modules/audio_processing/agc2/rnn_vad/BUILD.gn +++ b/modules/audio_processing/agc2/rnn_vad/BUILD.gn @@ -9,6 +9,7 @@ import("../../../../webrtc.gni") rtc_source_set("rnn_vad") { + configs += [ "../../../..:no_global_constructors" ] sources = [ "common.h", "features_extraction.cc", diff --git a/modules/audio_processing/agc2/rnn_vad/spectral_features_internal.cc b/modules/audio_processing/agc2/rnn_vad/spectral_features_internal.cc index 2d5a46cc2f..4cbe48a29e 100644 --- a/modules/audio_processing/agc2/rnn_vad/spectral_features_internal.cc +++ b/modules/audio_processing/agc2/rnn_vad/spectral_features_internal.cc @@ -17,6 +17,12 @@ namespace webrtc { namespace rnn_vad { +namespace { + +// DCT scaling factor. +const float kDctScalingFactor = std::sqrt(2.f / kNumBands); + +} // namespace std::array<size_t, kNumBands> ComputeBandBoundaryIndexes( size_t sample_rate_hz, @@ -110,8 +116,6 @@ void ComputeDct(rtc::ArrayView<const float, kNumBands> in, RTC_DCHECK_LE(1, out.size()); RTC_DCHECK_LE(out.size(), in.size()); std::fill(out.begin(), out.end(), 0.f); - // DCT scaling factor. - const float kDctScalingFactor = std::sqrt(2.f / kNumBands); for (size_t i = 0; i < out.size(); ++i) { for (size_t j = 0; j < in.size(); ++j) { out[i] += in[j] * dct_table[j * in.size() + i]; |