From 8f7403e66f9422557e0a8fbcc6577218f1ffec74 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Mon, 14 Mar 2022 22:57:35 +0100 Subject: [PATCH] mpv: Overhaul selection of shader-based scalers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes ravu-zoom and ravu-lite in favour of standard ravu. It also adds more nnedi3 shaders with neurons between 2^4 and 2^8, each with a window size of 8x4. This should give a wide range of options that work on all machines and still give acceptable results (at least balanced to the performance). The reason for this switch is ravu’s subpar performance, since it often produces more artifacts than it avoids. It also avoids some code duplication at the cost of making it more complex. --- users/simon/modules/mpv/default.nix | 35 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/users/simon/modules/mpv/default.nix b/users/simon/modules/mpv/default.nix index 5df63cf..ef7ca1e 100644 --- a/users/simon/modules/mpv/default.nix +++ b/users/simon/modules/mpv/default.nix @@ -130,23 +130,24 @@ in "c" = "cycle-values audio-channels stereo mono auto"; # Cycle between smart scalers (and /dev/null = disabled) - "K" = cycleShaders [ - "${mpv-prescalers}/compute/ravu-lite-r4.hook" - "${mpv-prescalers}/compute/ravu-lite-r3.hook" - "${mpv-prescalers}/compute/ravu-lite-r2.hook" - "/dev/null" - ]; - "Alt+K" = cycleShaders [ - "${mpv-prescalers}/compute/ravu-zoom-r4-yuv.hook" - "${mpv-prescalers}/compute/ravu-zoom-r3-yuv.hook" - "${mpv-prescalers}/compute/ravu-zoom-r2-yuv.hook" - "/dev/null" - ]; - "Alt+k" = cycleShaders [ - "${mpv-prescalers}/compute/nnedi3-nns256-win8x4.hook" - "${mpv-prescalers}/compute/nnedi3-nns128-win8x4.hook" - "/dev/null" - ]; + "K" = cycleShaders + ((map + (radius: "${mpv-prescalers}/compute/ravu-r${toString radius}.hook") + [ + 4 + 3 + 2 + ]) ++ [ "/dev/null" ]); + "Alt+k" = cycleShaders + ((map + (neurons: "${mpv-prescalers}/compute/nnedi3-nns${toString neurons}-win8x4.hook") + [ + 256 + 128 + 64 + 32 + 16 + ]) ++ [ "/dev/null" ]); # Toggle pitchcontrol "Ctrl+p" = "script-message-to pitchcontrol toggle";