Skip to content

Commit

Permalink
renderer: make default frame mixer consistent
Browse files Browse the repository at this point in the history
Unlike mpv, which has an explicit --interpolation option to enable frame
mixing, our frame mixing is "always on" by default, whenenever you use
the pl_render_frame_mix API (which is used in both vf_libplacebo and
plplay, to name at least two). So we want to avoid pulling in something
with subjective appearance significantly different from the "nearest
neighbour" default.

Oversampling here is fine, since it basically just fixes what is
arguably suboptimal usage anyway, and the alternative is awful judder
from 3:2 pulldown.

Fixes: https://code.videolan.org/videolan/libplacebo/-/issues/308
  • Loading branch information
haasn committed Sep 20, 2023
1 parent b757c2c commit 25b7a71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const struct pl_render_params pl_render_high_quality_params = {
PL_RENDER_DEFAULTS
.upscaler = &pl_filter_ewa_lanczossharp,
.downscaler = &pl_filter_hermite,
.frame_mixer = &pl_filter_hermite,
.frame_mixer = &pl_filter_oversample,
.sigmoid_params = &pl_sigmoid_default_params,
.peak_detect_params = &pl_peak_detect_high_quality_params,
.color_map_params = &pl_color_map_high_quality_params,
Expand Down
4 changes: 2 additions & 2 deletions src/tests/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ int main()
REQUIRE_CMP(*(int *) data->value, =, pl_render_default_params.tile_size, "d");
REQUIRE_STREQ(data->text, "32");

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";
const char *hq_opts = "upscaler=ewa_lanczossharp,downscaler=hermite,frame_mixer=oversample,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=hermite,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=oversample,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 25b7a71

Please sign in to comment.