mirror of https://github.com/mpv-player/mpv
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:
parent
a3b466e88d
commit
80907d007b
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue