From b17781bbc606d6323a1883b19a81ed41aa928699 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 23 Feb 2015 16:20:13 +0100 Subject: filter_kernels: minor code cleanup of jinc stuff No point in duplicating this check all over the place. No point in really having it in the first place, to be perfectly honest, j1 should not be THAT badly behaved. --- video/out/filter_kernels.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'video') diff --git a/video/out/filter_kernels.c b/video/out/filter_kernels.c index 82ce8ea52a..11aed8e1c2 100644 --- a/video/out/filter_kernels.c +++ b/video/out/filter_kernels.c @@ -277,7 +277,7 @@ static double sinc(kernel *k, double x) static double jinc(kernel *k, double x) { - if (x == 0.0) + if (fabs(x) < 1e-8) return 1.0; double pix = M_PI * x; return 2.0 * j1(pix) / pix; @@ -297,8 +297,6 @@ static double lanczos(kernel *k, double x) static double ginseng(kernel *k, double x) { double radius = k->radius; - if (fabs(x) < 1e-8) - return 1.0; if (fabs(x) >= radius) return 0.0; return jinc(k, x) * sinc(k, x / radius); @@ -307,8 +305,6 @@ static double ginseng(kernel *k, double x) static double ewa_lanczos(kernel *k, double x) { double radius = k->radius; - if (fabs(x) < 1e-8) - return 1.0; if (fabs(x) >= radius) return 0.0; // First zero of the jinc function. We simply scale it to fit into the -- cgit v1.2.3