diff options
author | Cyrille Henry <nusmuk@users.sourceforge.net> | 2008-07-08 16:21:39 +0000 |
---|---|---|
committer | Cyrille Henry <nusmuk@users.sourceforge.net> | 2008-07-08 16:21:39 +0000 |
commit | ab05e3bee669e8056962fab2fc6fc0be5589c0d1 (patch) | |
tree | 210507d63c9ad04b1109220bfe86d057bc3cd402 /tab/tabread4c~.c | |
parent | 4f59a6ad1f6fff30c4473059d5edd4b60ee9af0e (diff) |
add tabread6c~
svn path=/trunk/externals/nusmuk/; revision=10150
Diffstat (limited to 'tab/tabread4c~.c')
-rw-r--r-- | tab/tabread4c~.c | 12 |
1 files changed, 7 insertions, 5 deletions
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: |