Chromium Code Reviews| 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 bde07a23f8439e7900ee2b610dd1fbba8d4d4fce..11a844adb9afab6a024957973e8dd8b5c835bf40 100644 |
| --- a/media/filters/audio_renderer_algorithm_unittest.cc |
| +++ b/media/filters/audio_renderer_algorithm_unittest.cc |
| @@ -590,7 +590,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; |
| @@ -604,7 +604,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; |
| @@ -613,6 +613,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_NEAR(extremum, 0.0, 1.0); |
|
DaleCurtis
2014/03/29 01:10:01
within 1 seems pretty large?
sandersd (OOO until July 31)
2014/03/29 01:19:37
Since the choice of x = 0 was arbitrary, I'm only
|
| + EXPECT_FLOAT_EQ(extremum_value, 1.0); |
| +} |
| + |
| TEST_F(AudioRendererAlgorithmTest, WsolaSlowdown) { |
| WsolaTest(0.6f); |
| } |