Skip to content

Commit

Permalink
Merge branch 'windows' of https://github.com/noelsimbolon/mpv-config
Browse files Browse the repository at this point in the history
…into windows
  • Loading branch information
noelsimbolon committed May 2, 2024
2 parents 4dfed80 + 1753e8b commit ac9234c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,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)\
Expand Down
19 changes: 10 additions & 9 deletions shaders/SSimDownscaler.glsl
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 >
Expand Down Expand Up @@ -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;
Expand All @@ -54,8 +53,8 @@ vec4 hook() {
}

//!HOOK POSTKERNEL
//!BIND HOOKED
//!BIND L2
//!BIND HOOKED
//!SAVE L2
//!WHEN NATIVE_CROPPED.w POSTKERNEL.w >
//!COMPONENTS 3
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ac9234c

Please sign in to comment.