diff options
author | Chris Robinson <[email protected]> | 2018-01-07 17:24:29 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-01-07 17:24:29 -0800 |
commit | 70973035dea8a65630a7c2548dd8e85d87bd36a9 (patch) | |
tree | a35e689a283dbbe93639d9b81a7c569c46a9c4b9 /Alc/mixer_c.c | |
parent | c8a30592e81b5ae15a35a0e9f52c395fa75ca752 (diff) |
Use a separate function to get the cubic value
Diffstat (limited to 'Alc/mixer_c.c')
-rw-r--r-- | Alc/mixer_c.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c index 41445fc4..0bb93e8a 100644 --- a/Alc/mixer_c.c +++ b/Alc/mixer_c.c @@ -13,15 +13,7 @@ static inline ALfloat do_point(const ALfloat *restrict vals, ALsizei UNUSED(frac static inline ALfloat do_lerp(const ALfloat *restrict vals, ALsizei frac) { return lerp(vals[0], vals[1], frac * (1.0f/FRACTIONONE)); } static inline ALfloat do_cubic(const ALfloat *restrict vals, ALsizei frac) -{ - ALfloat mu = frac * (1.0f/FRACTIONONE); - ALfloat mu2 = mu*mu, mu3 = mu2*mu; - ALfloat a0 = -0.5f*mu3 + mu2 + -0.5f*mu; - ALfloat a1 = 1.5f*mu3 + -2.5f*mu2 + 1.0f; - ALfloat a2 = -1.5f*mu3 + 2.0f*mu2 + 0.5f*mu; - ALfloat a3 = 0.5f*mu3 + -0.5f*mu2; - return vals[0]*a0 + vals[1]*a1 + vals[2]*a2 + vals[3]*a3; -} +{ return cubic(vals[0], vals[1], vals[2], vals[3], frac * (1.0f/FRACTIONONE)); } const ALfloat *Resample_copy_C(const InterpState* UNUSED(state), const ALfloat *restrict src, ALsizei UNUSED(frac), ALint UNUSED(increment), |