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

Unified Diff: media/filters/audio_renderer_algorithm_unittest.cc

Issue 217553004: Handle near-colinear case in WSOLAS QuadraticInterpolation better. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify cases handled. Created 6 years, 9 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
« no previous file with comments | « no previous file | media/filters/wsola_internals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_algorithm_unittest.cc
diff --git a/media/filters/audio_renderer_algorithm_unittest.cc b/media/filters/audio_renderer_algorithm_unittest.cc
index 13fa28b2d0282ab09d8f3354395ad45482e80bf5..ed6b6ccddf8a0dffc5d445c5f411f172dd99937b 100644
--- a/media/filters/audio_renderer_algorithm_unittest.cc
+++ b/media/filters/audio_renderer_algorithm_unittest.cc
@@ -597,7 +597,7 @@ TEST_F(AudioRendererAlgorithmTest, FullAndDecimatedSearch) {
exclude_interval));
}
-TEST_F(AudioRendererAlgorithmTest, CubicInterpolation) {
+TEST_F(AudioRendererAlgorithmTest, QuadraticInterpolation) {
// Arbitrary coefficients.
const float kA = 0.7f;
const float kB = 1.2f;
@@ -611,7 +611,7 @@ TEST_F(AudioRendererAlgorithmTest, CubicInterpolation) {
float extremum;
float extremum_value;
- internal::CubicInterpolation(y_values, &extremum, &extremum_value);
+ internal::QuadraticInterpolation(y_values, &extremum, &extremum_value);
float x_star = -kB / (2.f * kA);
float y_star = kA * x_star * x_star + kB * x_star + kC;
@@ -620,6 +620,21 @@ TEST_F(AudioRendererAlgorithmTest, CubicInterpolation) {
EXPECT_FLOAT_EQ(y_star, extremum_value);
}
+TEST_F(AudioRendererAlgorithmTest, QuadraticInterpolation_Colinear) {
+ float y_values[3];
+ y_values[0] = 1.0;
+ y_values[1] = 1.0;
+ y_values[2] = 1.0;
+
+ float extremum;
+ float extremum_value;
+
+ internal::QuadraticInterpolation(y_values, &extremum, &extremum_value);
+
+ EXPECT_FLOAT_EQ(extremum, 0.0);
+ EXPECT_FLOAT_EQ(extremum_value, 1.0);
+}
+
TEST_F(AudioRendererAlgorithmTest, WsolaSlowdown) {
WsolaTest(0.6f);
}
« no previous file with comments | « no previous file | media/filters/wsola_internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698