From 7e218040231be30c95575d6ded6ae0080342c563 Mon Sep 17 00:00:00 2001 From: Uranite <62639703+Uranite@users.noreply.github.com> Date: Sat, 6 Apr 2024 20:33:10 +0700 Subject: [PATCH 1/2] Update SSimDownscaler.glsl --- shaders/SSimDownscaler.glsl | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/shaders/SSimDownscaler.glsl b/shaders/SSimDownscaler.glsl index f518476..e2ec778 100644 --- a/shaders/SSimDownscaler.glsl +++ b/shaders/SSimDownscaler.glsl @@ -1,5 +1,3 @@ -// SSimDownscaler by Shiandow -// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either @@ -14,8 +12,8 @@ // License along with this library. //!HOOK POSTKERNEL -//!BIND HOOKED //!BIND PREKERNEL +//!BIND HOOKED //!SAVE L2 //!WIDTH NATIVE_CROPPED.w //!WHEN NATIVE_CROPPED.h POSTKERNEL.h > @@ -45,7 +43,8 @@ vec4 hook() { float rel = (pos[axis] - base[axis])*POSTKERNEL_size[axis]; float w = Kernel(rel); - avg += w * pow(textureLod(PREKERNEL_raw, pos, 0.0) * PREKERNEL_mul, vec4(2.0)); + vec4 tex = textureLod(PREKERNEL_raw, pos, 0.0) * PREKERNEL_mul; + avg += w * tex * tex; W += w; } avg /= W; @@ -54,8 +53,8 @@ vec4 hook() { } //!HOOK POSTKERNEL -//!BIND HOOKED //!BIND L2 +//!BIND HOOKED //!SAVE L2 //!WHEN NATIVE_CROPPED.w POSTKERNEL.w > //!COMPONENTS 3 @@ -98,7 +97,9 @@ vec4 hook() { //!COMPONENTS 4 //!DESC SSimDownscaler mean & R -#define sigma_nsq 49. / (255.*255.) +#define oversharp 0.0 + +#define sigma_nsq 10. / (255.*255.) #define locality 2.0 #define offset vec2(0,0) @@ -148,9 +149,9 @@ vec4 hook() { } avg /= W; - float Sl = Luma(max(avg[1] - avg[0] * avg[0], 0.)) + sigma_nsq; - float Sh = Luma(max(avg[2] - avg[0] * avg[0], 0.)) + sigma_nsq; - return vec4(avg[0], sqrt(Sh / Sl)); + float Sl = Luma(max(avg[1] - avg[0] * avg[0], 0.)); + float Sh = Luma(max(avg[2] - avg[0] * avg[0], 0.)); + return vec4(avg[0], mix(sqrt((Sh + sigma_nsq) / (Sl + sigma_nsq)) * (1. + oversharp), clamp(Sh / Sl, 0., 1.), int(Sl > Sh))); } //!HOOK POSTKERNEL From 6c1bc6fc5039329e5189c7569b4f7c547178ce06 Mon Sep 17 00:00:00 2001 From: Uranite <62639703+Uranite@users.noreply.github.com> Date: Sat, 6 Apr 2024 21:24:58 +0700 Subject: [PATCH 2/2] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d11a5b..817037d 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ Scripts used: * [playlistmanager.lua](https://github.com/noelsimbolon/mpv-config/blob/linux/scripts/playlistmanager.lua) — [source](https://github.com/jonniek/mpv-playlistmanager)\ - Allows you to see and interact with your paylist in an intuitive way. + Allows you to see and interact with your playlist in an intuitive way. * [seek-to.lua](https://github.com/noelsimbolon/mpv-config/blob/linux/scripts/seek-to.lua) — [source](https://github.com/dexeonify/mpv-config/blob/main/scripts/seek-to.lua)\