From 75b3947b2c07803456483ec6976c037bad91b5dd Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 18 Sep 2023 21:54:47 +0200 Subject: [PATCH] renderer: switch to hermite downscaling by default Scores higher on perceptual metrics and is much faster to compute than mitchell, especially since it has no negative weights. --- src/renderer.c | 4 ++-- src/tests/options.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/renderer.c b/src/renderer.c index 064a5617..0ff37c0c 100644 --- a/src/renderer.c +++ b/src/renderer.c @@ -201,7 +201,7 @@ const struct pl_render_params pl_render_fast_params = { PL_RENDER_DEFAULTS }; const struct pl_render_params pl_render_default_params = { PL_RENDER_DEFAULTS .upscaler = &pl_filter_spline36, - .downscaler = &pl_filter_mitchell, + .downscaler = &pl_filter_hermite, .frame_mixer = &pl_filter_oversample, .sigmoid_params = &pl_sigmoid_default_params, .dither_params = &pl_dither_default_params, @@ -211,7 +211,7 @@ const struct pl_render_params pl_render_default_params = { const struct pl_render_params pl_render_high_quality_params = { PL_RENDER_DEFAULTS .upscaler = &pl_filter_ewa_lanczossharp, - .downscaler = &pl_filter_mitchell, + .downscaler = &pl_filter_hermite, .frame_mixer = &pl_filter_hermite, .sigmoid_params = &pl_sigmoid_default_params, .peak_detect_params = &pl_peak_detect_high_quality_params, diff --git a/src/tests/options.c b/src/tests/options.c index 69c2c82b..a7ddf420 100644 --- a/src/tests/options.c +++ b/src/tests/options.c @@ -29,7 +29,7 @@ int main() REQUIRE(pl_options_load(test, "preset=fast")); REQUIRE_STREQ(pl_options_save(test), ""); - const char *def_opts = "upscaler=spline36,downscaler=mitchell,frame_mixer=oversample,sigmoid=yes,peak_detect=yes,dither=yes"; + const char *def_opts = "upscaler=spline36,downscaler=hermite,frame_mixer=oversample,sigmoid=yes,peak_detect=yes,dither=yes"; pl_options_reset(test, &pl_render_default_params); REQUIRE_STREQ(pl_options_save(test), def_opts); struct pl_options_t def_pre = *test; @@ -53,9 +53,9 @@ int main() REQUIRE_CMP(*(int *) data->value, =, pl_render_default_params.lut_entries, "d"); REQUIRE_STREQ(data->text, "64"); - const char *hq_opts = "upscaler=ewa_lanczossharp,downscaler=mitchell,frame_mixer=hermite,deband=yes,sigmoid=yes,peak_detect=yes,peak_percentile=99.99500274658203,contrast_recovery=0.30000001192092896,dither=yes"; + const char *hq_opts = "upscaler=ewa_lanczossharp,downscaler=hermite,frame_mixer=hermite,deband=yes,sigmoid=yes,peak_detect=yes,peak_percentile=99.99500274658203,contrast_recovery=0.30000001192092896,dither=yes"; // fallback can produce different precision - const char *hq_opts2 = "upscaler=ewa_lanczossharp,downscaler=mitchell,frame_mixer=hermite,deband=yes,sigmoid=yes,peak_detect=yes,peak_percentile=99.99500274658203125,contrast_recovery=0.30000001192092896,dither=yes"; + const char *hq_opts2 = "upscaler=ewa_lanczossharp,downscaler=hermite,frame_mixer=hermite,deband=yes,sigmoid=yes,peak_detect=yes,peak_percentile=99.99500274658203125,contrast_recovery=0.30000001192092896,dither=yes"; pl_options_reset(test, &pl_render_high_quality_params); const char *opts = pl_options_save(test);