vo_opengl: clamp filters to their size

This gives better results with fancy-downscaling. The issue here is that
fancy-downscalign "extends" the filter radius by some amount, which
requires using a larger filter size and shader. Then most of the filter
is "unused", but some filters still return non-0 coefficients, which
create heavy artifacts. Just clamp them off.

I'm not sure if this is the right solution, but at least it's better
than before.
This commit is contained in:
wm4 2014-12-06 23:57:50 +01:00
parent 2833670b71
commit 309c5fee59
1 changed files with 2 additions and 1 deletions

View File

@ -91,7 +91,8 @@ void mp_compute_weights(struct filter_kernel *filter, double f, float *out_w)
double sum = 0;
for (int n = 0; n < filter->size; n++) {
double x = f - (n - filter->size / 2 + 1);
double w = filter->weight(filter, fabs(x) / filter->inv_scale);
double c = fabs(x) / filter->inv_scale;
double w = c <= filter->radius ? filter->weight(filter, c) : 0;
out_w[n] = w;
sum += w;
}