diff options
author | Niklas Haas <git@haasn.xyz> | 2017-07-12 19:08:58 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2017-07-12 19:08:58 +0200 |
commit | 18c74f7dfe9cbefe9de818caa00c3f77ce600f71 (patch) | |
tree | 2e73a2686a0fd1fadb7f45740c191741b1e4372c /video/out/filter_kernels.c | |
parent | e18656732995f235516f49a88bd0d6e0e7d3fc7e (diff) | |
download | mpv-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.c | 4 |
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. |