X-Git-Url: https://git.nihav.org/?p=nihav.git;a=blobdiff_plain;f=nihav-core%2Fsrc%2Fscale%2Fscale%2Fmod.rs;h=5d0776d0ed3caf44851044315816ab6681818ce1;hp=ae39ef33de2f1efb6bfadacb8d92fac0da5f0a13;hb=e6aaad5c5273cd814b5748b7faf3751835a37217;hpb=625751036014b099fd9c126397bc973cb0543130 diff --git a/nihav-core/src/scale/scale/mod.rs b/nihav-core/src/scale/scale/mod.rs index ae39ef3..5d0776d 100644 --- a/nihav-core/src/scale/scale/mod.rs +++ b/nihav-core/src/scale/scale/mod.rs @@ -221,8 +221,8 @@ impl LanczosResize { let a = order as f32; for i in 0..(order * 2) { let x = frac - ((i as f32) + 1.0 - a); - let fp = std::f32::consts::PI * (x as f32); - coeffs[i] = a * fp.sin() * (fp / a).sin() / (norm * (x as f32) * (x as f32)); + let fp = std::f32::consts::PI * x; + coeffs[i] = a * fp.sin() * (fp / a).sin() / (norm * x * x); } } fn create_cache(order: usize, den: usize) -> Vec> {