summaryrefslogtreecommitdiffstats
path: root/video/out/filter_kernels.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-07-12 19:08:58 +0200
committerNiklas Haas <git@haasn.xyz>2017-07-12 19:08:58 +0200
commit18c74f7dfe9cbefe9de818caa00c3f77ce600f71 (patch)
tree2e73a2686a0fd1fadb7f45740c191741b1e4372c /video/out/filter_kernels.c
parente18656732995f235516f49a88bd0d6e0e7d3fc7e (diff)
downloadmpv-18c74f7dfe9cbefe9de818caa00c3f77ce600f71.tar.bz2
mpv-18c74f7dfe9cbefe9de818caa00c3f77ce600f71.tar.xz
vo_opengl: generalize --scale-clamp etc.
This can help fight ringing without completely killing it, thus providing a middle-ground between ringing and aliasing.
Diffstat (limited to 'video/out/filter_kernels.c')
-rw-r--r--video/out/filter_kernels.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/filter_kernels.c b/video/out/filter_kernels.c
index 09f85af5f4..6c10eb30b5 100644
--- a/video/out/filter_kernels.c
+++ b/video/out/filter_kernels.c
@@ -117,8 +117,8 @@ static double sample_filter(struct filter_kernel *filter, double x)
{
// The window is always stretched to the entire kernel
double w = sample_window(&filter->w, x / filter->f.radius * filter->w.radius);
- double k = sample_window(&filter->f, x);
- return filter->clamp ? fmax(0.0, fmin(1.0, w * k)) : w * k;
+ double k = w * sample_window(&filter->f, x);
+ return k < 0 ? (1 - filter->clamp) * k : k;
}
// Calculate the 1D filtering kernel for N sample points.