Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gpu-next] --sharpen does not work #9387

Closed
NSQY opened this issue Nov 3, 2021 · 1 comment
Closed

[gpu-next] --sharpen does not work #9387

NSQY opened this issue Nov 3, 2021 · 1 comment

Comments

@NSQY
Copy link

NSQY commented Nov 3, 2021

mpv 0.34.0-9-g9d5d9b2424 Copyright © 2000-2021 mpv/MPlayer/mplayer2 projects
 built on Wed Nov  3 23:42:57 ACDT 2021
FFmpeg library versions:
   libavutil       57.7.100
   libavcodec      59.12.100
   libavformat     59.8.100
   libswscale      6.1.100
   libavfilter     8.16.100
   libswresample   4.0.100
FFmpeg version: N-104460-gbf9950446d

Arch
git master via mpv-build
present on vo_placebo branch for as long as I've known about it
Gnome 40
Nvidia proprietary 495.44

Reproduction steps

mpv -v --no-config --vo=gpu-next --sharpen=10 foo.mkv --log-file=sharp.txt

Expected behavior

For the image to look worse but sharper

Actual behavior

Nothing changes

Log file

sharp.txt

@NSQY NSQY added the os:linux label Nov 3, 2021
@haasn
Copy link
Member

haasn commented Nov 3, 2021

This is WONTFIX / an intentional omission. The --sharpen option for a long time has done nothing useful except pre-load a built-in shader. You can accomplish the exact same by loading this using the --glsl-shader option:

//!DESC unsharp masking
//!HOOK MAIN
//!BIND HOOKED
#define PARAM 1.0

vec4 hook()
{
    const float st1 = 1.2;
    vec4 p = HOOKED_tex(HOOKED_pos);
    vec4 sum1 = HOOKED_texOff(st1 * vec2(+1, +1))
              + HOOKED_texOff(st1 * vec2(+1, -1))
              + HOOKED_texOff(st1 * vec2(-1, +1))
              + HOOKED_texOff(st1 * vec2(-1, -1));
    const float st2 = 1.5;
    vec4 sum2 = HOOKED_texOff(st2 * vec2(+1,  0))
              + HOOKED_texOff(st2 * vec2( 0, +1))
              + HOOKED_texOff(st2 * vec2(-1,  0))
              + HOOKED_texOff(st2 * vec2( 0, -1));
    vec4 t = p * 0.859375 + sum2 * -0.1171875 + sum1 * -0.09765625;
    return p + t * PARAM;
}

Admittedly, this one doesn't let you change the param at runtime, but I plan on extending GLSL shaders to allow runtime changeable parameters, so this will soon be a non-issue. As such, I think we can remove this option, which only really exists to make the video look worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants