From ab05e3bee669e8056962fab2fc6fc0be5589c0d1 Mon Sep 17 00:00:00 2001 From: Cyrille Henry Date: Tue, 8 Jul 2008 16:21:39 +0000 Subject: add tabread6c~ svn path=/trunk/externals/nusmuk/; revision=10150 --- tab/tabread4c~.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tab/tabread4c~.c') diff --git a/tab/tabread4c~.c b/tab/tabread4c~.c index 41f4ff3..c4a7804 100644 --- a/tab/tabread4c~.c +++ b/tab/tabread4c~.c @@ -72,7 +72,7 @@ static t_int *tabread4c_tilde_perform(t_int *w) int maxindex; t_word *buf = x->x_vec, *wp; int i; - double a0,a1,a2; // CH + double a3,a1,a2; // CH maxindex = x->x_npoints - 3; @@ -117,10 +117,12 @@ static t_int *tabread4c_tilde_perform(t_int *w) // cminusb - 0.1666667f * (1.-frac) * ( // (d - a - 3.0f * cminusb) * frac + (d + 2.0f*a - 3.0f*b) // CH - a0 = d - c - a + b; - a1 = a - b - a0; - a2 = c - a; - *out++ = ((a0*frac+a1)*frac+a2)*frac+b; + // 4-point, 3rd-order Hermite (x-form) + a1 = 0.5f * (c - a); + a2 = a - 2.5 * b + 2.f * c - 0.5f * d; + a3 = 0.5f * (d - a) + 1.5f * (b - c); + + *out++ = ((a3 * frac + a2) * frac + a1) * frac + b; } return (w+5); zero: -- cgit v1.2.1