Skip to content

Commit

Permalink
renderer: switch to hermite downscaling by default
Browse files Browse the repository at this point in the history
Scores higher on perceptual metrics and is much faster to compute than
mitchell, especially since it has no negative weights.
  • Loading branch information
haasn committed Sep 19, 2023
1 parent 037c44e commit 75b3947
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/tests/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 75b3947

Please sign in to comment.