summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2015-02-23 16:20:13 +0100
committerNiklas Haas <git@nand.wakku.to>2015-02-23 16:27:10 +0100
commitb17781bbc606d6323a1883b19a81ed41aa928699 (patch)
treea644418a0cafadc23ff667fd2c2fd6335cc8e24d
parent636d6d724d36b90812a0c145bbf40143be9a52e8 (diff)
downloadmpv-b17781bbc606d6323a1883b19a81ed41aa928699.tar.bz2
mpv-b17781bbc606d6323a1883b19a81ed41aa928699.tar.xz
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.
-rw-r--r--video/out/filter_kernels.c6
1 files changed, 1 insertions, 5 deletions
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