diff options
author | Carl Hetherington <carl@carlh.net> | 2012-04-20 17:52:42 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-04-20 17:52:42 +0000 |
commit | 842bddde1ec9943501e3d5d547aed8b809762e97 (patch) | |
tree | a674061a268bb490e10cb24b472bcfc6d52beaf6 /libs/ardour/test | |
parent | ffe5a6c5c2c46df6cc8723219529970ff17d84a9 (diff) |
Fix linear interpolator to avoid error accumulation.
git-svn-id: svn://localhost/ardour2/branches/3.0@12044 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/test')
-rw-r--r-- | libs/ardour/test/interpolation_test.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/libs/ardour/test/interpolation_test.cc b/libs/ardour/test/interpolation_test.cc index 0bbb697b85..23789f826f 100644 --- a/libs/ardour/test/interpolation_test.cc +++ b/libs/ardour/test/interpolation_test.cc @@ -54,15 +54,13 @@ InterpolationTest::linearInterpolationTest () result = linear.interpolate (0, NUM_SAMPLES, input, output); CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result); - /* This one fails due too error accumulation - cout << "\nSpeed: 0.002"; - linear.reset(); - linear.set_speed (0.002); - linear.set_target_speed (linear.speed()); - result = linear.interpolate (0, NUM_SAMPLES, input, output); - linear.speed(); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result); - */ +// cout << "\nSpeed: 0.002"; + linear.reset(); + linear.set_speed (0.002); + linear.set_target_speed (linear.speed()); + result = linear.interpolate (0, NUM_SAMPLES, input, output); + linear.speed(); + CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result); // cout << "\nSpeed: 2.0"; linear.reset(); |