Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: webrtc/modules/audio_processing/level_controller/signal_classifier.cc

Issue 2348213002: Move the aec_rdft* files to a more proper place beneath APM and make them thread-safe. (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/level_controller/signal_classifier.cc
diff --git a/webrtc/modules/audio_processing/level_controller/signal_classifier.cc b/webrtc/modules/audio_processing/level_controller/signal_classifier.cc
index c9a07e754d8f0e58c3a1cdfcb59600edf6db7d92..dd67737403aba12e9cdf089c4bef463dac53d4a5 100644
--- a/webrtc/modules/audio_processing/level_controller/signal_classifier.cc
+++ b/webrtc/modules/audio_processing/level_controller/signal_classifier.cc
@@ -16,7 +16,6 @@
#include "webrtc/base/array_view.h"
#include "webrtc/base/constructormagic.h"
-#include "webrtc/modules/audio_processing/aec/aec_rdft.h"
#include "webrtc/modules/audio_processing/audio_buffer.h"
#include "webrtc/modules/audio_processing/level_controller/down_sampler.h"
#include "webrtc/modules/audio_processing/level_controller/noise_spectrum_estimator.h"
@@ -35,13 +34,14 @@ void RemoveDcLevel(rtc::ArrayView<float> x) {
}
}
-void PowerSpectrum(rtc::ArrayView<const float> x,
+void PowerSpectrum(const OouraFft* ooura_fft,
+ rtc::ArrayView<const float> x,
rtc::ArrayView<float> spectrum) {
RTC_DCHECK_EQ(65u, spectrum.size());
RTC_DCHECK_EQ(128u, x.size());
float X[128];
std::copy(x.data(), x.data() + x.size(), X);
- aec_rdft_forward_128(X);
+ ooura_fft->Fft(X);
float* X_p = X;
RTC_DCHECK_EQ(X_p, &X[0]);
@@ -118,7 +118,6 @@ SignalClassifier::SignalClassifier(ApmDataDumper* data_dumper)
SignalClassifier::~SignalClassifier() {}
void SignalClassifier::Initialize(int sample_rate_hz) {
- aec_rdft_init();
down_sampler_.Initialize(sample_rate_hz);
noise_spectrum_estimator_.Initialize();
frame_extender_.reset(new FrameExtender(80, 128));
@@ -141,7 +140,7 @@ void SignalClassifier::Analyze(const AudioBuffer& audio,
frame_extender_->ExtendFrame(downsampled_frame, extended_frame);
RemoveDcLevel(extended_frame);
float signal_spectrum[65];
- PowerSpectrum(extended_frame, signal_spectrum);
+ PowerSpectrum(&ooura_fft_, extended_frame, signal_spectrum);
// Classify the signal based on the estimate of the noise spectrum and the
// signal spectrum estimate.

Powered by Google App Engine
This is Rietveld 408576698