diff options
author | lucy <ne.tetewi@gmail.com> | 2014-06-03 22:49:22 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-06-03 23:00:24 +0200 |
commit | a3b466e88df6964a4e0e9b6627dc63264e948c8e (patch) | |
tree | 12f9f02c5751f8978ae06902a4bc555d737ebbab /video/out | |
parent | 35f87dc6923d94c53a04169ccb97556601e9e20b (diff) | |
download | mpv-a3b466e88df6964a4e0e9b6627dc63264e948c8e.tar.bz2 mpv-a3b466e88df6964a4e0e9b6627dc63264e948c8e.tar.xz |
filter_kernels: add nearest neighbour scaling
This is useful for playing content containing pixel art that hasn't been
pre-scaled, such as TASVideos' high quality encodes. The implementation is
lifted from <https://code.google.com/p/glumpy/source/browse/glumpy/image/filter.py#413>.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/filter_kernels.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/video/out/filter_kernels.c b/video/out/filter_kernels.c index 2c2f56ee51..c56b432f9b 100644 --- a/video/out/filter_kernels.c +++ b/video/out/filter_kernels.c @@ -106,6 +106,11 @@ void mp_compute_lut(struct filter_kernel *filter, int count, float *out_array) typedef struct filter_kernel kernel; +static double nearest(kernel *k, double x) +{ + return 1.0; +} + static double bilinear(kernel *k, double x) { return 1.0 - x; @@ -254,6 +259,7 @@ static double blackman(kernel *k, double x) } const struct filter_kernel mp_filter_kernels[] = { + {"nearest", 0.5, nearest}, {"bilinear_slow", 1, bilinear}, {"hanning", 1, hanning}, {"hamming", 1, hamming}, |