mpv icon indicating copy to clipboard operation
mpv copied to clipboard

Correct-downscaling causes ewa_lanczossharp to introduce a half-pixel shift when downsampling sometimes

Open Artoriuz opened this issue 2 years ago • 0 comments

Important Information

  • mpv version: mpv v0.37.0-234-g57d68262
  • Platform and Version: Windows 11 Pro 22H2
  • Source of the mpv binary: Shinchiro
  • If known which version of mpv introduced the problem: No idea
  • GPU model, driver and version: 6600XT Adrenalin 24.1.1
  • Possible screenshot or video of visual glitches: All below

Reproduction steps

magick convert rei.png -filter lanczossharp -distort resize 75% im_ewa_lanczossharp.png im_ewa_lanczossharp

mpv --no-config --vo=gpu-next --gpu-api=vulkan --no-hidpi-window-scale --pause=yes --screenshot-format=png --deband=no --dither-depth=no --screenshot-high-bit-depth=no --dscale=ewa_lanczossharp --linear-downscaling=no --window-scale=0.75 rei.png mpv_ewa_lanczossharp

mpv --no-config --vo=gpu-next --gpu-api=vulkan --no-hidpi-window-scale --pause=yes --screenshot-format=png --deband=no --dither-depth=no --screenshot-high-bit-depth=no --dscale=ewa_lanczossharp --linear-downscaling=no --window-scale=0.75 --correct-downscaling=no rei.png mpv_ewa_lanczossharp_incorrect

Expected behavior

mpv's output should probably roughly match whatever ImageMagick is doing.

Actual behavior

mpv's output with correct-downscaling turned on appears to have a half-pixel shift towards the top-left corner (rounding issue somewhere?). Screenshot with it turned off also provided to show that there's no shift in this case, so the problem seems related to turning it on. Filters with integer supports seem fine as well.

Log file

output.txt

Sample files

rei

Artoriuz avatar Feb 03 '24 21:02 Artoriuz