0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

filter_kernels: fix nearest scaler

The previous commit assumed the filter would be 1x1 (then constant
weight is correct) - but our code in fact uses at least a 2x2 filter. A
1x1 filter would generally be useless, except for nearest scaling - so
it didn't exist.

Insteasd of adding such a 1x1 filter, just turn the nearest weight
function into a scare function, which should take care of the issue.
This commit is contained in:
wm4 2014-06-04 00:23:31 +02:00
parent a3b466e88d
commit 80907d007b

View File

@ -108,7 +108,7 @@ typedef struct filter_kernel kernel;
static double nearest(kernel *k, double x)
{
return 1.0;
return x > 0.5 ? 0.0 : 1.0;
}
static double bilinear(kernel *k, double x)