From 1168dc0558b35a6e45e9900759081d0ca2edddf3 Mon Sep 17 00:00:00 2001 From: Vesa Date: Tue, 25 Mar 2014 10:45:50 +0200 Subject: [PATCH] Switch back to linear interpolation... --- plugins/watsyn/Watsyn.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/watsyn/Watsyn.h b/plugins/watsyn/Watsyn.h index a6860cbed..a351351a4 100644 --- a/plugins/watsyn/Watsyn.h +++ b/plugins/watsyn/Watsyn.h @@ -99,23 +99,23 @@ public: private: // linear interpolation -/* inline sample_t interpolate( sample_t s1, sample_t s2, float x ) + inline sample_t interpolate( sample_t s1, sample_t s2, float x ) { return s1 + ( s2 - s1 ) * x; - }*/ - + } +/* // quick and dirty approximation of cubic interpolation inline sample_t interpolate( sample_t s1, sample_t s2, float x ) { const float x2 = powf( x, 2 ); const float x3 = powf( x, 3 ); - //const float m = s2 - s1; + const float m = s2 - s1; return ( ( x3 * 2.0 - x2 * 3.0 + 1.0 ) * s1 ) + - ( ( x3 * -2.0 + x2 * 3.0 ) * s2 );// + - //( ( x + x3 * 2.0 - x2 * 3.0 ) * m ); + ( ( x3 * -2.0 + x2 * 3.0 ) * s2 ); + + ( ( x + x3 * 2.0 - x2 * 3.0 ) * m ); } - +*/ // more accurate cubic interpolation... // consumes more cpu than ^ but doesn't bring a marked increase in sound quality IMO /* inline sample_t interpolate( sample_t s0, sample_t s1, sample_t s2, sample_t s3, float x )