summaryrefslogtreecommitdiffstats
path: root/video/out/filter_kernels.c
diff options
context:
space:
mode:
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.