From a3b466e88df6964a4e0e9b6627dc63264e948c8e Mon Sep 17 00:00:00 2001 From: lucy Date: Tue, 3 Jun 2014 22:49:22 +0200 Subject: 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 . --- video/out/filter_kernels.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'video') 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}, -- cgit v1.2.3