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

Unified Diff: webrtc/modules/audio_processing/vad/pitch_based_vad_unittest.cc

Issue 1181933002: Pull the Voice Activity Detector out from the AGC (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove unused files from isolate Created 5 years, 6 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/vad/pitch_based_vad_unittest.cc
diff --git a/webrtc/modules/audio_processing/agc/pitch_based_vad_unittest.cc b/webrtc/modules/audio_processing/vad/pitch_based_vad_unittest.cc
similarity index 73%
rename from webrtc/modules/audio_processing/agc/pitch_based_vad_unittest.cc
rename to webrtc/modules/audio_processing/vad/pitch_based_vad_unittest.cc
index 3ec0baac95cc4fb4e3f193a122b1b40a62f2948e..04ddcab5cb21063c47ca49a3b12de7fa6c80f770 100644
--- a/webrtc/modules/audio_processing/agc/pitch_based_vad_unittest.cc
+++ b/webrtc/modules/audio_processing/vad/pitch_based_vad_unittest.cc
@@ -8,20 +8,21 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "webrtc/modules/audio_processing/agc/pitch_based_vad.h"
+#include "webrtc/modules/audio_processing/vad/pitch_based_vad.h"
#include <math.h>
#include <stdio.h>
-#include <string.h>
-#include "gtest/gtest.h"
+#include <string>
+
+#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/test/testsupport/fileutils.h"
namespace webrtc {
TEST(PitchBasedVadTest, VoicingProbabilityTest) {
- std::string spectral_peak_file_name = test::ResourcePath(
- "audio_processing/agc/agc_spectral_peak", "dat");
+ std::string spectral_peak_file_name =
+ test::ResourcePath("audio_processing/agc/agc_spectral_peak", "dat");
FILE* spectral_peak_file = fopen(spectral_peak_file_name.c_str(), "rb");
ASSERT_TRUE(spectral_peak_file != NULL);
@@ -51,12 +52,15 @@ TEST(PitchBasedVadTest, VoicingProbabilityTest) {
sizeof(audio_features.spectral_peak[0]), 1,
spectral_peak_file) == 1u) {
double p;
- ASSERT_EQ(1u, fread(audio_features.log_pitch_gain, sizeof(
- audio_features.log_pitch_gain[0]), 1, pitch_gain_file));
- ASSERT_EQ(1u, fread(audio_features.pitch_lag_hz, sizeof(
- audio_features.pitch_lag_hz[0]), 1, pitch_lag_file));
- ASSERT_EQ(1u, fread(&reference_activity_probability, sizeof(
- reference_activity_probability), 1, voicing_prob_file));
+ ASSERT_EQ(1u, fread(audio_features.log_pitch_gain,
+ sizeof(audio_features.log_pitch_gain[0]), 1,
+ pitch_gain_file));
+ ASSERT_EQ(1u,
+ fread(audio_features.pitch_lag_hz,
+ sizeof(audio_features.pitch_lag_hz[0]), 1, pitch_lag_file));
+ ASSERT_EQ(1u, fread(&reference_activity_probability,
+ sizeof(reference_activity_probability), 1,
+ voicing_prob_file));
p = 0.5; // Initialize to the neutral value for combining probabilities.
EXPECT_EQ(0, vad_.VoicingProbability(audio_features, &p));
« no previous file with comments | « webrtc/modules/audio_processing/vad/pitch_based_vad.cc ('k') | webrtc/modules/audio_processing/vad/pitch_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698