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

Unified Diff: webrtc/modules/audio_processing/intelligibility/intelligibility_utils_unittest.cc

Issue 1693823004: Use VAD to get a better speech power estimation in the IntelligibilityEnhancer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@pow
Patch Set: Use f for float Created 4 years, 10 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/intelligibility/intelligibility_utils_unittest.cc
diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_utils_unittest.cc b/webrtc/modules/audio_processing/intelligibility/intelligibility_utils_unittest.cc
index 43ad9a7b1a2b55af324740487057e95e484ade02..28957bb80d14bf1b57d614862b59c146973e8613 100644
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_utils_unittest.cc
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_utils_unittest.cc
@@ -39,17 +39,16 @@ TEST(IntelligibilityUtilsTest, TestPowerEstimator) {
const float kDecay = 0.5f;
const std::vector<std::vector<std::complex<float>>> test_data(
GenerateTestData(kFreqs, kSamples));
- PowerEstimator power_estimator(kFreqs, kDecay);
- EXPECT_EQ(0, power_estimator.Power()[0]);
+ PowerEstimator<std::complex<float>> power_estimator(kFreqs, kDecay);
+ EXPECT_EQ(0, power_estimator.power()[0]);
// Makes sure Step is doing something.
power_estimator.Step(&test_data[0][0]);
for (size_t i = 1; i < kSamples; ++i) {
power_estimator.Step(&test_data[i][0]);
for (size_t j = 0; j < kFreqs; ++j) {
- const float* power = power_estimator.Power();
- EXPECT_GE(power[j], 0.f);
- EXPECT_LE(power[j], 1.f);
+ EXPECT_GE(power_estimator.power()[j], 0.f);
+ EXPECT_LE(power_estimator.power()[j], 1.f);
}
}
}
@@ -62,8 +61,8 @@ TEST(IntelligibilityUtilsTest, TestGainApplier) {
GainApplier gain_applier(kFreqs, kChangeLimit);
const std::vector<std::vector<std::complex<float>>> in_data(
GenerateTestData(kFreqs, kSamples));
- std::vector<std::vector<std::complex<float>>> out_data(GenerateTestData(
- kFreqs, kSamples));
+ std::vector<std::vector<std::complex<float>>> out_data(
+ GenerateTestData(kFreqs, kSamples));
for (size_t i = 0; i < kSamples; ++i) {
gain_applier.Apply(&in_data[i][0], &out_data[i][0]);
for (size_t j = 0; j < kFreqs; ++j) {

Powered by Google App Engine
This is Rietveld 408576698