From bb54863688e3e02d6b7dc2ed562ba16f12a8d311 Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Sat, 29 Aug 2020 11:44:12 +0800 Subject: [PATCH] mpv: add Anime4K 3.1 --- .config/mpv/input.conf | 8 + .config/mpv/mpv.conf | 18 + .../Anime4K_Auto_Downscale_Pre_x4.glsl | 37 + .../mpv/shaders/Anime4K_DarkLines_Fast.glsl | 195 + .config/mpv/shaders/Anime4K_DarkLines_HQ.glsl | 187 + .../shaders/Anime4K_DarkLines_VeryFast.glsl | 195 + .config/mpv/shaders/Anime4K_Deblur_CNN_L.glsl | 911 ++++ .config/mpv/shaders/Anime4K_Deblur_CNN_M.glsl | 589 +++ .config/mpv/shaders/Anime4K_Deblur_DoG.glsl | 134 + .../mpv/shaders/Anime4K_Deblur_Original.glsl | 274 ++ .../Anime4K_Denoise_Bilateral_Mean.glsl | 65 + .../Anime4K_Denoise_Bilateral_Median.glsl | 105 + .../Anime4K_Denoise_Bilateral_Mode.glsl | 88 + .config/mpv/shaders/Anime4K_LICENSE | 21 + .config/mpv/shaders/Anime4K_RA_CNN_L.glsl | 871 ++++ .config/mpv/shaders/Anime4K_RA_CNN_M.glsl | 552 +++ .config/mpv/shaders/Anime4K_RA_CNN_UL.glsl | 4003 ++++++++++++++++ .config/mpv/shaders/Anime4K_RA_DoG.glsl | 160 + .../mpv/shaders/Anime4K_ThinLines_Fast.glsl | 276 ++ .config/mpv/shaders/Anime4K_ThinLines_HQ.glsl | 268 ++ .../shaders/Anime4K_ThinLines_VeryFast.glsl | 280 ++ .../mpv/shaders/Anime4K_Upscale_CNN_L_x2.glsl | 845 ++++ .../Anime4K_Upscale_CNN_L_x2_Deblur.glsl | 927 ++++ .../Anime4K_Upscale_CNN_L_x2_Denoise.glsl | 867 ++++ .../mpv/shaders/Anime4K_Upscale_CNN_M_x2.glsl | 521 +++ .../Anime4K_Upscale_CNN_M_x2_Deblur.glsl | 603 +++ .../Anime4K_Upscale_CNN_M_x2_Denoise.glsl | 523 +++ .../shaders/Anime4K_Upscale_CNN_UL_x2.glsl | 3995 ++++++++++++++++ .../Anime4K_Upscale_CNN_UL_x2_Deblur.glsl | 4077 +++++++++++++++++ .../Anime4K_Upscale_CNN_UL_x2_Denoise.glsl | 3995 ++++++++++++++++ .../mpv/shaders/Anime4K_Upscale_DTD_x2.glsl | 548 +++ .../mpv/shaders/Anime4K_Upscale_DoG_x2.glsl | 124 + .../Anime4K_Upscale_DoG_x2_Deblur.glsl | 139 + .../shaders/Anime4K_Upscale_Original_x2.glsl | 264 ++ ...Anime4K_Upscale_Original_x2_Deblur_x2.glsl | 264 ++ 35 files changed, 26929 insertions(+) create mode 100644 .config/mpv/input.conf create mode 100644 .config/mpv/shaders/Anime4K_Auto_Downscale_Pre_x4.glsl create mode 100644 .config/mpv/shaders/Anime4K_DarkLines_Fast.glsl create mode 100644 .config/mpv/shaders/Anime4K_DarkLines_HQ.glsl create mode 100644 .config/mpv/shaders/Anime4K_DarkLines_VeryFast.glsl create mode 100644 .config/mpv/shaders/Anime4K_Deblur_CNN_L.glsl create mode 100644 .config/mpv/shaders/Anime4K_Deblur_CNN_M.glsl create mode 100644 .config/mpv/shaders/Anime4K_Deblur_DoG.glsl create mode 100644 .config/mpv/shaders/Anime4K_Deblur_Original.glsl create mode 100644 .config/mpv/shaders/Anime4K_Denoise_Bilateral_Mean.glsl create mode 100644 .config/mpv/shaders/Anime4K_Denoise_Bilateral_Median.glsl create mode 100644 .config/mpv/shaders/Anime4K_Denoise_Bilateral_Mode.glsl create mode 100644 .config/mpv/shaders/Anime4K_LICENSE create mode 100644 .config/mpv/shaders/Anime4K_RA_CNN_L.glsl create mode 100644 .config/mpv/shaders/Anime4K_RA_CNN_M.glsl create mode 100644 .config/mpv/shaders/Anime4K_RA_CNN_UL.glsl create mode 100644 .config/mpv/shaders/Anime4K_RA_DoG.glsl create mode 100644 .config/mpv/shaders/Anime4K_ThinLines_Fast.glsl create mode 100644 .config/mpv/shaders/Anime4K_ThinLines_HQ.glsl create mode 100644 .config/mpv/shaders/Anime4K_ThinLines_VeryFast.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_CNN_L_x2.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_CNN_L_x2_Deblur.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_CNN_L_x2_Denoise.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_CNN_M_x2.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_CNN_M_x2_Denoise.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_CNN_UL_x2.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_CNN_UL_x2_Deblur.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_CNN_UL_x2_Denoise.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_DTD_x2.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_DoG_x2.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_DoG_x2_Deblur.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_Original_x2.glsl create mode 100644 .config/mpv/shaders/Anime4K_Upscale_Original_x2_Deblur_x2.glsl diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf new file mode 100644 index 0000000..7271bee --- /dev/null +++ b/.config/mpv/input.conf @@ -0,0 +1,8 @@ +CTRL+1 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Upscale_CNN_L_x2_Denoise.glsl:~~/shaders/Anime4K_Auto_Downscale_Pre_x4.glsl:~~/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl"; show-text "Anime4k: 480/720p (Faithful)" +CTRL+2 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Upscale_CNN_L_x2_Denoise.glsl:~~/shaders/Anime4K_Auto_Downscale_Pre_x4.glsl:~~/shaders/Anime4K_DarkLines_HQ.glsl:~~/shaders/Anime4K_ThinLines_HQ.glsl:~~/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl"; show-text "Anime4k: 480/720p (Perceptual Quality)" +CTRL+3 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Upscale_CNN_L_x2_Denoise.glsl:~~/shaders/Anime4K_Auto_Downscale_Pre_x4.glsl:~~/shaders/Anime4K_Deblur_DoG.glsl:~~/shaders/Anime4K_DarkLines_HQ.glsl:~~/shaders/Anime4K_ThinLines_HQ.glsl:~~/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl"; show-text "Anime4k: 480/720p (Perceptual Quality and Deblur)" +CTRL+4 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Denoise_Bilateral_Mode.glsl:~~/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl"; show-text "Anime4k: 1080p (Faithful)" +CTRL+5 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Denoise_Bilateral_Mode.glsl:~~/shaders/Anime4K_DarkLines_HQ.glsl:~~/shaders/Anime4K_ThinLines_HQ.glsl:~~/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl"; show-text "Anime4k: 1080p (Perceptual Quality)" +CTRL+6 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Denoise_Bilateral_Mode.glsl:~~/shaders/Anime4K_Deblur_DoG.glsl:~~/shaders/Anime4K_DarkLines_HQ.glsl:~~/shaders/Anime4K_ThinLines_HQ.glsl:~~/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl"; show-text "Anime4k: 1080p (Perceptual Quality and Deblur)" +CTRL+0 no-osd change-list glsl-shaders clr ""; show-text "GLSL shaders cleared" + diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf index 30996bf..de42d53 100644 --- a/.config/mpv/mpv.conf +++ b/.config/mpv/mpv.conf @@ -1,3 +1,21 @@ profile=gpu-hq scale=ewa_lanczossharp cscale=ewa_lanczossharp + +[a4k-hd-faithful] +glsl-shaders="~~/shaders/Anime4K_Upscale_CNN_L_x2_Denoise.glsl:~~/shaders/Anime4K_Auto_Downscale_Pre_x4.glsl:~~/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl" + +[a4k-hd-perceptual] +glsl-shaders="~~/shaders/Anime4K_Upscale_CNN_L_x2_Denoise.glsl:~~/shaders/Anime4K_Auto_Downscale_Pre_x4.glsl:~~/shaders/Anime4K_DarkLines_HQ.glsl:~~/shaders/Anime4K_ThinLines_HQ.glsl:~~/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl" + +[a4k-hd-deblur] +glsl-shaders="~~/shaders/Anime4K_Upscale_CNN_L_x2_Denoise.glsl:~~/shaders/Anime4K_Auto_Downscale_Pre_x4.glsl:~~/shaders/Anime4K_Deblur_DoG.glsl:~~/shaders/Anime4K_DarkLines_HQ.glsl:~~/shaders/Anime4K_ThinLines_HQ.glsl:~~/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl" + +[a4k-fhd-faithful] +glsl-shaders="~~/shaders/Anime4K_Denoise_Bilateral_Mode.glsl:~~/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl" + +[a4k-fhd-perceptual] +glsl-shaders="~~/shaders/Anime4K_Denoise_Bilateral_Mode.glsl:~~/shaders/Anime4K_DarkLines_HQ.glsl:~~/shaders/Anime4K_ThinLines_HQ.glsl:~~/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl" + +[a4k-fhd-deblur] +glsl-shaders="~~/shaders/Anime4K_Denoise_Bilateral_Mode.glsl:~~/shaders/Anime4K_Deblur_DoG.glsl:~~/shaders/Anime4K_DarkLines_HQ.glsl:~~/shaders/Anime4K_ThinLines_HQ.glsl:~~/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl" diff --git a/.config/mpv/shaders/Anime4K_Auto_Downscale_Pre_x4.glsl b/.config/mpv/shaders/Anime4K_Auto_Downscale_Pre_x4.glsl new file mode 100644 index 0000000..ec96068 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Auto_Downscale_Pre_x4.glsl @@ -0,0 +1,37 @@ +//Anime4K v3.1 GLSL + +// This is free and unencumbered software released into the public domain. + +// Anyone is free to copy, modify, publish, use, compile, sell, or +// distribute this software, either in source code form or as a compiled +// binary, for any purpose, commercial or non-commercial, and by any +// means. + +// In jurisdictions that recognize copyright laws, the author or authors +// of this software dedicate any and all copyright interest in the +// software to the public domain. We make this dedication for the benefit +// of the public at large and to the detriment of our heirs and +// successors. We intend this dedication to be an overt act of +// relinquishment in perpetuity of all present and future rights to this +// software under copyright law. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. + +// For more information, please refer to + +//!DESC Anime4K-v3.1-Auto-Downscale-Pre-x4 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w LUMA.w / 4 < OUTPUT.h LUMA.h / 4 < * OUTPUT.w LUMA.w / 2.400 > OUTPUT.h LUMA.h / 2.400 > * * +//!WIDTH OUTPUT.w 2 / +//!HEIGHT OUTPUT.h 2 / + +vec4 hook() { + return HOOKED_tex(HOOKED_pos); +} diff --git a/.config/mpv/shaders/Anime4K_DarkLines_Fast.glsl b/.config/mpv/shaders/Anime4K_DarkLines_Fast.glsl new file mode 100644 index 0000000..5a43024 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_DarkLines_Fast.glsl @@ -0,0 +1,195 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-DarkLines(Fast)-Kernel(X) +//!HOOK NATIVE +//!BIND HOOKED +//!SAVE MMKERNEL +//!WIDTH NATIVE.w 2 / +//!HEIGHT NATIVE.h 2 / +//!COMPONENTS 1 + +#define L_tex HOOKED_tex + +#define SIGMA 1 + +float gaussian(float x, float s, float m) { + return (1 / (s * sqrt(2 * 3.14159))) * exp(-0.5 * pow(abs(x - m) / s, 2.0)); +} + +float lumGaussian(vec2 pos, vec2 d) { + float s = SIGMA * HOOKED_size.y / 1080; + float kernel_size = s * 2 + 1; + + float g = (L_tex(pos).x) * gaussian(0, s, 0); + float gn = gaussian(0, s, 0); + + g += (L_tex(pos - d).x + L_tex(pos + d).x) * gaussian(1, s, 0); + gn += gaussian(1, s, 0) * 2; + + for (int i=2; i NOISE_THRESHOLD) { + c_t = (c_t - NOISE_THRESHOLD) / t_range; + c_t = pow(c_t, BLUR_CURVE); + c_t = c_t * t_range + NOISE_THRESHOLD; + c_t = c_t * sign(c); + } else { + c_t = c; + } + + return vec4(clamp(c_t + L_tex(HOOKED_pos).x, MMKERNEL_tex(HOOKED_pos).x, MMKERNEL_tex(HOOKED_pos).y), HOOKED_tex(HOOKED_pos).yz, 0); +} \ No newline at end of file diff --git a/.config/mpv/shaders/Anime4K_Deblur_CNN_M.glsl b/.config/mpv/shaders/Anime4K_Deblur_CNN_M.glsl new file mode 100644 index 0000000..3195f17 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Deblur_CNN_M.glsl @@ -0,0 +1,589 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Deblur-CNN(M)-Conv-4x3x3x1 +//!HOOK NATIVE +//!BIND HOOKED +//!SAVE LUMAN0 +//!COMPONENTS 4 + +vec4 hook() { + vec2 dp = HOOKED_pt; + float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x; + float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x; + float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x; + float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x; + float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x; + float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x; + float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x; + float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x; + + float s = -0.09440448*a + 0.49120164*b + -0.022703001*c + -0.016553257*d + 0.6272513*e + -0.97632706*f + 0.10815585*g + -0.21898738*h + 0.09604159*i; + float o = s+0.00028890301; + s = 0.061990097*a + -0.87003845*b + -0.037461795*c + 0.13172528*d + 0.87585527*e + -0.13609451*f + -0.070119604*g + -0.051131595*h + 0.09209152*i; + float p = s+-0.017290013; + s = 0.45264956*a + -1.1240269*b + 0.07975403*c + 0.6734861*d + -0.05388544*e + 0.007570164*f + -0.06987841*g + 0.012247365*h + 0.034949988*i; + float q = s+-0.0145500265; + s = -0.035659406*a + 0.043313805*b + -0.056556296*c + 0.08745333*d + 0.6312519*e + -0.24501355*f + -0.13407958*g + -0.18634492*h + -0.08149098*i; + float r = s+-0.009025143; + + return vec4(o, p, q, r); +} + + +//!DESC Anime4K-v3.1-Deblur-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAN0 +//!SAVE LUMAN1 +//!COMPONENTS 4 + +#define L_tex LUMAN0_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.05327107*a.x + -0.07160779*b.x + -0.053545203*c.x + 0.30653647*d.x + -0.623205*e.x + -0.25135925*f.x + -0.18046309*g.x + 0.5326353*h.x + -0.09099461*i.x; + float t = -0.16687301*a.y + 0.29383695*b.y + -0.15116534*c.y + 0.013435781*d.y + -0.3595954*e.y + 0.3222953*f.y + 0.20127103*g.y + 1.1504021*h.y + 0.6521217*i.y; + float u = -0.0015649797*a.z + -0.18814865*b.z + 0.061695296*c.z + 0.013806492*d.z + 0.12745698*e.z + -0.30406427*f.z + -0.05947408*g.z + 0.33141926*h.z + -0.20066342*i.z; + float v = 0.30095318*a.w + 0.36586058*b.w + 0.22645043*c.w + 0.1612967*d.w + -0.37834042*e.w + -0.08229078*f.w + -0.64827895*g.w + 0.04798959*h.w + 0.50426966*i.w; + float w = 0.126555*na.x + 0.079004966*nb.x + -0.06367056*nc.x + -0.16546968*nd.x + 0.50795466*ne.x + 0.18011826*nf.x + 0.16996312*ng.x + -0.51605004*nh.x + 0.10505295*ni.x; + float x = 0.1540833*na.y + -0.26913214*nb.y + 0.13605806*nc.y + -0.12155722*nd.y + 0.21405062*ne.y + -0.27972937*nf.y + -0.41382065*ng.y + -1.7224138*nh.y + -0.60294384*ni.y; + float y = 0.00970452*na.z + 0.20325865*nb.z + 0.0015745827*nc.z + -0.107312985*nd.z + 0.009980262*ne.z + 0.2720558*nf.z + 0.15321876*ng.z + -0.036781967*nh.z + 0.051229585*ni.z; + float z = -0.27454868*na.w + -0.4432009*nb.w + -0.003881375*nc.w + 0.18336153*nd.w + 0.19950926*ne.w + 0.045014136*nf.w + 0.6243142*ng.w + -0.16252244*nh.w + -0.42274413*ni.w; + float o = s+t+u+v+w+x+y+z+0.039423503; + s = -0.10775202*a.x + -0.031339962*b.x + 0.0060642078*c.x + -0.10545187*d.x + 0.12458454*e.x + 0.0021231163*f.x + 0.07905482*g.x + 0.08223747*h.x + 0.04828753*i.x; + t = 0.13271476*a.y + -0.40485632*b.y + 0.054641176*c.y + -0.4327063*d.y + -0.19545476*e.y + 0.09262824*f.y + -0.36247733*g.y + 0.12627794*h.y + -0.075792745*i.y; + u = -0.09226349*a.z + 0.24326*b.z + -0.021355193*c.z + 0.1444612*d.z + -0.102547936*e.z + 0.05568293*f.z + 0.013875915*g.z + 0.19688046*h.z + 0.0154764345*i.z; + v = -0.1431215*a.w + -0.26233566*b.w + -0.020626735*c.w + 0.019540034*d.w + 0.18164286*e.w + -0.16356231*f.w + 0.17014627*g.w + -0.27788106*h.w + 0.0718594*i.w; + w = 0.20348297*na.x + 0.10994786*nb.x + 0.014990544*nc.x + 1.033602*nd.x + 0.024537617*ne.x + 0.009609228*nf.x + 0.12779616*ng.x + 0.06813842*nh.x + -0.04269685*ni.x; + x = -0.2430749*na.y + 0.37466663*nb.y + -0.06150604*nc.y + 0.28204092*nd.y + 0.22226551*ne.y + -0.19715464*nf.y + 0.003657579*ng.y + -0.30363604*nh.y + 0.0542432*ni.y; + y = 0.1447509*na.z + -0.28650913*nb.z + -0.058723953*nc.z + -0.092879236*nd.z + 0.26428574*ne.z + -0.104749136*nf.z + -0.070094705*ng.z + 0.047571726*nh.z + -0.010061374*ni.z; + z = 0.0438258*na.w + 0.34031448*nb.w + -0.013600149*nc.w + 0.28250962*nd.w + -0.73591596*ne.w + 0.21241076*nf.w + -0.27542746*ng.w + 0.14023423*nh.w + -0.10678145*ni.w; + float p = s+t+u+v+w+x+y+z+-0.021502364; + s = 0.032163877*a.x + -0.66642886*b.x + 0.044751197*c.x + 0.05605561*d.x + 0.6945027*e.x + -0.07645503*f.x + -0.04662916*g.x + -0.2509118*h.x + 0.098923184*i.x; + t = 0.03268785*a.y + 0.2343848*b.y + -0.058907576*c.y + -0.6397386*d.y + -0.15121439*e.y + 0.15354797*f.y + -0.3191564*g.y + -0.24138322*h.y + -0.71516746*i.y; + u = -0.069602974*a.z + -0.4111596*b.z + 0.021718252*c.z + 0.2399502*d.z + 0.64263207*e.z + 0.3311527*f.z + -0.2513218*g.z + -0.48004037*h.z + 0.78069997*i.z; + v = -0.6631432*a.w + 0.15360248*b.w + 0.012449814*c.w + -0.9210798*d.w + 0.77063346*e.w + 0.10402895*f.w + 0.26728597*g.w + -0.3063174*h.w + 0.07107563*i.w; + w = -0.22910015*na.x + 0.60668314*nb.x + -0.07472177*nc.x + -0.2976557*nd.x + -0.31179214*ne.x + 0.17979208*nf.x + -0.059973676*ng.x + 0.48262063*nh.x + 0.10012325*ni.x; + x = -0.008694405*na.y + -0.19812866*nb.y + 0.024916848*nc.y + 0.57730144*nd.y + 0.20505147*ne.y + -0.22297408*nf.y + 0.09352177*ng.y + -0.548608*nh.y + 0.56032515*ni.y; + y = 0.05522713*na.z + 0.3843459*nb.z + -0.017952677*nc.z + -0.24958606*nd.z + -0.641729*ne.z + -0.13842992*nf.z + 0.20486256*ng.z + 0.24058507*nh.z + -0.53553283*ni.z; + z = 0.7243502*na.w + -0.16880396*nb.w + 0.11347028*nc.w + 0.98730826*nd.w + -0.4131502*ne.w + -0.605653*nf.w + -0.20231946*ng.w + 0.268739*nh.w + -0.25494024*ni.w; + float q = s+t+u+v+w+x+y+z+-0.011375127; + s = 0.004939782*a.x + 0.04961287*b.x + -0.022315059*c.x + -0.36721465*d.x + 0.02673542*e.x + -0.055127766*f.x + -0.3139398*g.x + 0.011177372*h.x + -0.002486109*i.x; + t = 0.0029139163*a.y + -0.018279694*b.y + 0.23850645*c.y + -0.053427566*d.y + -0.19388364*e.y + 0.25149515*f.y + -0.15969065*g.y + 0.003607878*h.y + 0.47864768*i.y; + u = 0.018587857*a.z + 0.04256821*b.z + -0.084889054*c.z + -0.10649675*d.z + 0.1413508*e.z + -0.014863062*f.z + 0.046072394*g.z + 0.044705987*h.z + -0.3495728*i.z; + v = -0.25952607*a.w + -0.37138674*b.w + -0.31769684*c.w + -0.47086135*d.w + 0.4518305*e.w + 0.23906761*f.w + 0.37785494*g.w + -0.12342203*h.w + -0.18958518*i.w; + w = -0.0987012*na.x + -0.23680592*nb.x + -0.038128883*nc.x + 0.021003952*nd.x + -0.21279961*ne.x + 0.02450331*nf.x + 0.22508678*ng.x + -0.050619982*nh.x + -0.12929344*ni.x; + x = 0.024458453*na.y + 0.07273773*nb.y + -0.26048952*nc.y + 0.18460196*nd.y + 0.4304707*ne.y + -0.17272879*nf.y + 0.28351468*ng.y + 1.3116083*nh.y + -0.29540524*ni.y; + y = -0.041094407*na.z + 0.024719454*nb.z + 0.19896787*nc.z + 0.07664201*nd.z + -0.25621203*ne.z + 0.10749328*nf.z + -0.067182586*ng.z + 0.06065049*nh.z + 0.47074008*ni.z; + z = 0.13518347*na.w + 0.20488833*nb.w + 0.24956091*nc.w + 0.07386013*nd.w + -0.9938687*ne.w + -0.15375653*nf.w + -0.55804706*ng.w + -0.0036114866*nh.w + 0.3378182*ni.w; + float r = s+t+u+v+w+x+y+z+-0.047199935; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Deblur-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAN1 +//!SAVE LUMAN2 +//!COMPONENTS 4 + +#define L_tex LUMAN1_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = 0.062563986*a.x + 0.7022818*b.x + -0.011810557*c.x + 0.25277942*d.x + -0.2097257*e.x + 0.17233184*f.x + -0.28609228*g.x + -0.32957354*h.x + -0.11091415*i.x; + float t = 0.0074290223*a.y + 0.25707433*b.y + 0.02356039*c.y + -0.0033311683*d.y + 0.78796846*e.y + -0.8613285*f.y + 0.020431397*g.y + -0.014993784*h.y + -0.5224642*i.y; + float u = -0.099318005*a.z + 0.096692294*b.z + -0.081225544*c.z + 0.4837614*d.z + 0.40215006*e.z + 0.06631713*f.z + -0.28298393*g.z + -0.15690443*h.z + -0.11722153*i.z; + float v = -0.20104708*a.w + 0.29773432*b.w + -0.059524678*c.w + 0.672484*d.w + 0.58850944*e.w + 0.19088581*f.w + 0.085560724*g.w + -0.3429526*h.w + -0.01970963*i.w; + float w = 0.2530852*na.x + -0.26206517*nb.x + -0.0087517025*nc.x + -0.33815455*nd.x + -0.00843703*ne.x + -0.22927909*nf.x + -0.062886484*ng.x + 0.17524554*nh.x + -0.008373106*ni.x; + float x = 0.17741594*na.y + -0.52788115*nb.y + -0.10984838*nc.y + -0.13678722*nd.y + -0.28618953*ne.y + 0.1595905*nf.y + -0.04411071*ng.y + -0.3234863*nh.y + 0.4967709*ni.y; + float y = 0.042347442*na.z + 0.08541207*nb.z + -0.15857157*nc.z + -0.30902776*nd.z + -0.8957161*ne.z + -0.29276812*nf.z + 0.47053015*ng.z + 0.6092259*nh.z + 0.31623343*ni.z; + float z = 0.17963913*na.w + -0.30821583*nb.w + 0.15316938*nc.w + -0.37125722*nd.w + -0.5975526*ne.w + -0.07182377*nf.w + 0.069451295*ng.w + 0.61750644*nh.w + 0.07411387*ni.w; + float o = s+t+u+v+w+x+y+z+0.025282431; + s = 0.15042752*a.x + 0.76578605*b.x + 0.15916896*c.x + 0.062038895*d.x + 0.90041196*e.x + 0.44829968*f.x + -0.1525204*g.x + -0.0769386*h.x + -0.017208606*i.x; + t = -0.24956173*a.y + -0.4890138*b.y + -0.5667875*c.y + -0.04361386*d.y + -1.2683009*e.y + 0.49874577*f.y + -0.023511255*g.y + -0.44963378*h.y + -0.44784302*i.y; + u = -0.4755887*a.z + 0.5499969*b.z + -0.40806842*c.z + 0.18438272*d.z + -0.24848352*e.z + -0.6397795*f.z + -0.26359263*g.z + 0.48188695*h.z + 0.4296102*i.z; + v = -0.42948166*a.w + 0.47963342*b.w + 0.2660744*c.w + 0.009006623*d.w + -0.20249301*e.w + 0.3191499*f.w + -0.009933394*g.w + 0.022085298*h.w + -0.05937115*i.w; + w = 0.39071006*na.x + 0.96707124*nb.x + 0.5870382*nc.x + -0.0009634084*nd.x + -0.60501117*ne.x + -0.26205206*nf.x + 0.0022803913*ng.x + 0.19914602*nh.x + -0.0075327456*ni.x; + x = 0.6501524*na.y + -0.6191325*nb.y + 0.033584982*nc.y + -0.23792362*nd.y + 0.28443542*ne.y + 0.7995467*nf.y + 0.61443925*ng.y + -0.2151685*nh.y + -0.64213204*ni.y; + y = -0.028933166*na.z + -0.8038524*nb.z + -0.89384586*nc.z + -0.5202012*nd.z + 0.2658711*ne.z + -0.9662124*nf.z + 0.16669375*ng.z + 0.00071032986*nh.z + -0.15632267*ni.z; + z = 0.04982121*na.w + 0.3209018*nb.w + -0.18828197*nc.w + 0.09291354*nd.w + -0.17046586*ne.w + -0.34567246*nf.w + -0.30839518*ng.w + 0.10585062*nh.w + 0.21802926*ni.w; + float p = s+t+u+v+w+x+y+z+-0.038783036; + s = -0.0086537115*a.x + 0.29274273*b.x + -0.14299169*c.x + 0.24355909*d.x + 0.44158313*e.x + 0.3856316*f.x + 0.1826302*g.x + 0.0468175*h.x + 0.08368182*i.x; + t = -0.0030031276*a.y + -0.25766936*b.y + -0.16684678*c.y + -0.07155021*d.y + 0.49751604*e.y + 0.51993954*f.y + -0.055723842*g.y + -0.20152062*h.y + -0.3310546*i.y; + u = -0.19360077*a.z + 0.29092705*b.z + -0.14313088*c.z + -0.12219053*d.z + 0.3336699*e.z + 0.19800198*f.z + 0.12873465*g.z + 0.16162138*h.z + 0.05346552*i.z; + v = -0.12214463*a.w + -0.32187235*b.w + -0.4942458*c.w + 0.047901243*d.w + 0.1315279*e.w + 0.25730842*f.w + -0.03230636*g.w + -0.35371637*h.w + -0.16514161*i.w; + w = 0.06874291*na.x + -0.19512849*nb.x + 0.4657543*nc.x + -0.031914163*nd.x + 0.37405568*ne.x + 0.15239602*nf.x + -0.023567*ng.x + 0.31183028*nh.x + 0.0394527*ni.x; + x = -0.07513823*na.y + 0.041872643*nb.y + 0.35610527*nc.y + -0.1445567*nd.y + -1.024163*ne.y + -0.6282327*nf.y + 0.06843732*ng.y + 0.009273292*nh.y + -0.23500894*ni.y; + y = 0.10864135*na.z + -0.25950822*nb.z + -0.27286842*nc.z + -0.0922535*nd.z + -0.49195388*ne.z + -0.9883521*nf.z + -0.16378482*ng.z + -0.44275576*nh.z + -0.19259977*ni.z; + z = -0.07329517*na.w + 0.73912215*nb.w + -0.27922824*nc.w + -0.19892885*nd.w + -0.029165866*ne.w + -0.64475375*nf.w + -0.1735304*ng.w + 0.030360926*nh.w + 0.023611842*ni.w; + float q = s+t+u+v+w+x+y+z+0.0059805913; + s = 0.0520063*a.x + 0.32099065*b.x + 0.10096528*c.x + -0.3286558*d.x + 0.21782263*e.x + -0.16726571*f.x + -0.0061505553*g.x + -0.006116407*h.x + 0.04923024*i.x; + t = -0.0034328692*a.y + -0.093817174*b.y + -0.16234896*c.y + 0.070740886*d.y + 0.09283234*e.y + -0.5086407*f.y + 0.14033465*g.y + 0.2656622*h.y + -0.069810264*i.y; + u = 0.0036944423*a.z + -0.12574191*b.z + -0.05118089*c.z + -0.57802665*d.z + 0.7782018*e.z + -0.50453955*f.z + 0.020464642*g.z + 0.036232006*h.z + 0.07828021*i.z; + v = 0.14491023*a.w + -0.08246158*b.w + 0.0048284433*c.w + -0.41679582*d.w + -0.37185597*e.w + -0.5086088*f.w + -0.101141416*g.w + 0.021782609*h.w + 0.024443237*i.w; + w = -0.09724159*na.x + -0.13913961*nb.x + 0.13188085*nc.x + 0.4496926*nd.x + -0.2343041*ne.x + 0.30554664*nf.x + 0.10852492*ng.x + 0.09672956*nh.x + 0.06470584*ni.x; + x = -0.22092621*na.y + -0.17034335*nb.y + -0.46865875*nc.y + -0.16638382*nd.y + -0.36817726*ne.y + 2.8126082*nf.y + 0.20136675*ng.y + -0.028155493*nh.y + -0.6738389*ni.y; + y = 0.08178478*na.z + -0.13104321*nb.z + -0.0031215427*nc.z + 0.25492746*nd.z + -0.6011733*ne.z + 1.2705562*nf.z + -0.053312294*ng.z + 0.04038377*nh.z + -0.21168794*ni.z; + z = -0.26104185*na.w + 0.24431077*nb.w + 0.44925603*nc.w + 0.23646158*nd.w + 0.45555523*ne.w + 0.9546111*nf.w + -0.24485165*ng.w + -0.13658847*nh.w + 0.033205047*ni.w; + float r = s+t+u+v+w+x+y+z+-0.039946888; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Deblur-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAN2 +//!SAVE LUMAN3 +//!COMPONENTS 4 + +#define L_tex LUMAN2_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.10675473*a.x + -0.0054621263*b.x + 0.04762056*c.x + -0.09147545*d.x + -0.37308994*e.x + 0.293996*f.x + -0.089725204*g.x + 0.33136362*h.x + -0.052014586*i.x; + float t = 0.02504269*a.y + -0.06090801*b.y + -1.0442187e-05*c.y + 0.06697992*d.y + -0.029154606*e.y + -0.0022566947*f.y + -0.00791601*g.y + 0.09337469*h.y + -0.040103186*i.y; + float u = 0.21693788*a.z + -0.055160753*b.z + -0.009791719*c.z + -0.333904*d.z + 0.27527252*e.z + -0.12840816*f.z + -0.18639135*g.z + -0.13602877*h.z + 0.06346381*i.z; + float v = -0.03963725*a.w + -0.26795068*b.w + 0.012137692*c.w + -0.17869234*d.w + -0.06644175*e.w + 0.010630859*f.w + -0.07681673*g.w + -0.0041983854*h.w + -0.026523955*i.w; + float w = 0.13531718*na.x + 0.12938923*nb.x + -0.050681178*nc.x + 0.062877566*nd.x + -0.08772176*ne.x + 0.006759793*nf.x + 0.15809533*ng.x + -0.08294619*nh.x + 0.06690071*ni.x; + float x = 0.018558182*na.y + -0.16493246*nb.y + 0.02380415*nc.y + 0.08744932*nd.y + -0.021898141*ne.y + 0.026684938*nf.y + 0.032703754*ng.y + 0.052364938*nh.y + 0.056927126*ni.y; + float y = -0.0901643*na.z + -0.09282382*nb.z + 0.07358982*nc.z + 0.3232882*nd.z + -1.0591649*ne.z + 0.17128727*nf.z + 0.22159135*ng.z + -0.3007047*nh.z + -0.05238468*ni.z; + float z = -0.06714734*na.w + 0.04850284*nb.w + -0.011960667*nc.w + -0.18101339*nd.w + -0.34727672*ne.w + 0.030268785*nf.w + -0.09629506*ng.w + -0.28136835*nh.w + -0.13334738*ni.w; + float o = s+t+u+v+w+x+y+z+0.006057905; + s = 0.018881252*a.x + 0.06384664*b.x + -0.011764481*c.x + 0.15501355*d.x + -0.2185426*e.x + -0.07557788*f.x + 0.025938602*g.x + -0.14496502*h.x + 0.024891714*i.x; + t = -0.01996556*a.y + -0.00053282635*b.y + 0.00061660836*c.y + 0.024429671*d.y + 0.054617107*e.y + -0.021867601*f.y + 0.032060657*g.y + 0.0031433336*h.y + -0.012301998*i.y; + u = -0.070778325*a.z + -0.19530736*b.z + 0.011512594*c.z + -0.27479392*d.z + -0.013253852*e.z + -0.022542335*f.z + 0.05682861*g.z + 0.0012437729*h.z + -0.0150462305*i.z; + v = 0.066125244*a.w + 0.020368045*b.w + -0.03502752*c.w + 0.1109599*d.w + -0.060857326*e.w + 0.06733562*f.w + 0.012108426*g.w + 0.0063430844*h.w + -0.004283166*i.w; + w = -0.06497726*na.x + -0.17359954*nb.x + -0.011175394*nc.x + -0.18982106*nd.x + 0.5939919*ne.x + -0.021145599*nf.x + -0.064499505*ng.x + -0.014329371*nh.x + -0.015423945*ni.x; + x = -0.03674411*na.y + -0.0043503637*nb.y + 0.010304639*nc.y + -0.0012494766*nd.y + -0.13278799*ne.y + 0.032555994*nf.y + -0.052385017*ng.y + 0.010176496*nh.y + -0.0026763906*ni.y; + y = 0.06123568*na.z + 0.14374596*nb.z + 0.056109104*nc.z + 0.019599102*nd.z + 0.18616806*ne.z + -0.03179762*nf.z + 0.036342375*ng.z + 0.029431945*nh.z + 0.043751024*ni.z; + z = 0.12073644*na.w + 0.0733359*nb.w + 0.08390864*nc.w + -0.11528834*nd.w + 0.3467376*ne.w + -0.033535313*nf.w + 0.041739017*ng.w + 0.058267288*nh.w + 0.08858209*ni.w; + float p = s+t+u+v+w+x+y+z+-0.0028000006; + s = -0.09027117*a.x + -0.14622006*b.x + -0.16810851*c.x + -0.24796103*d.x + 0.2572285*e.x + 0.47094887*f.x + 0.032027613*g.x + 0.11410892*h.x + 0.1613444*i.x; + t = -0.0012083473*a.y + 0.17305928*b.y + -0.05621104*c.y + 0.036259834*d.y + -0.03851184*e.y + -0.0055326805*f.y + -0.012463582*g.y + 0.35876498*h.y + 0.1724837*i.y; + u = 0.40897495*a.z + 0.17421961*b.z + 0.28644145*c.z + -0.25477505*d.z + -0.4277018*e.z + -0.18726684*f.z + 0.13615106*g.z + 0.026969131*h.z + -0.15176998*i.z; + v = 0.04463327*a.w + -0.04876386*b.w + -0.031818386*c.w + 0.03954202*d.w + 0.09516337*e.w + 0.052471045*f.w + -0.13383369*g.w + -0.21776986*h.w + 0.015097585*i.w; + w = 0.2092236*na.x + 0.48777798*nb.x + 0.2956695*nc.x + 0.23978968*nd.x + -0.59248745*ne.x + -0.13063201*nf.x + 0.061278455*ng.x + -0.10234516*nh.x + 0.002134229*ni.x; + x = 0.07130507*na.y + 0.121942736*nb.y + -0.01583503*nc.y + 0.14037956*nd.y + -0.37520966*ne.y + -0.067429096*nf.y + 0.05821935*ng.y + -0.35461438*nh.y + -0.07123769*ni.y; + y = -0.468684*na.z + -0.30739802*nb.z + -0.38813922*nc.z + -0.33846653*nd.z + -0.08206715*ne.z + 0.15765728*nf.z + -0.16559663*ng.z + -0.055957757*nh.z + -0.11368465*ni.z; + z = -0.4303523*na.w + -0.84991306*nb.w + -0.2505638*nc.w + 0.35179257*nd.w + 1.0163839*ne.w + 0.23950848*nf.w + 0.08583142*ng.w + -0.2591442*nh.w + -0.045323353*ni.w; + float q = s+t+u+v+w+x+y+z+0.017286068; + s = 0.101637*a.x + -0.23477565*b.x + -0.03157821*c.x + -0.20734964*d.x + -0.16431263*e.x + 0.2424383*f.x + -0.11075752*g.x + 0.16768074*h.x + -0.418383*i.x; + t = 0.006255804*a.y + 0.042100485*b.y + 0.0036014041*c.y + -0.08597467*d.y + 0.048351593*e.y + -0.13372381*f.y + -0.061134014*g.y + -0.33137617*h.y + 0.019631254*i.y; + u = 0.18377675*a.z + 0.58994883*b.z + 0.2991301*c.z + 0.74260485*d.z + -0.1369073*e.z + 0.24632849*f.z + -0.03240025*g.z + 0.2981277*h.z + 0.3513618*i.z; + v = -0.04465667*a.w + -0.15135704*b.w + 0.13290188*c.w + -0.049763512*d.w + -0.6689857*e.w + -0.28756517*f.w + 0.04422787*g.w + 0.14173377*h.w + -0.027095031*i.w; + w = 0.010524522*na.x + 0.2286293*nb.x + -0.15575987*nc.x + 0.19659552*nd.x + 0.2584596*ne.x + 0.53996265*nf.x + 0.1819511*ng.x + 0.20248987*nh.x + 0.08608274*ni.x; + x = 0.054287046*na.y + 0.04735612*nb.y + 0.0861212*nc.y + -0.028863167*nd.y + 0.20381325*ne.y + -0.109093554*nf.y + 0.010826272*ng.y + 0.23420005*nh.y + -0.022509871*ni.y; + y = 0.1786933*na.z + 0.126716*nb.z + 0.046265166*nc.z + 0.071686745*nd.z + 0.323193*ne.z + 0.42820987*nf.z + 0.062808044*ng.z + 0.13638002*nh.z + 0.29570308*ni.z; + z = -0.31819153*na.w + -0.4878216*nb.w + -0.33641538*nc.w + -0.43968466*nd.w + -0.588631*ne.w + 0.06131746*nf.w + -0.28163537*ng.w + -0.49008766*nh.w + -0.5446552*ni.w; + float r = s+t+u+v+w+x+y+z+0.020686742; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Deblur-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAN3 +//!SAVE LUMAN4 +//!COMPONENTS 4 + +#define L_tex LUMAN3_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.23822114*a.x + -0.49224076*b.x + -0.2603839*c.x + -0.22270115*d.x + -0.23199631*e.x + -0.08860003*f.x + -0.11150333*g.x + -0.31895813*h.x + -0.035482813*i.x; + float t = 0.06318636*a.y + -0.53629327*b.y + -0.10155968*c.y + -0.06471427*d.y + 0.5817465*e.y + -0.13474646*f.y + 0.0058701304*g.y + 0.1711669*h.y + 0.08656512*i.y; + float u = -0.06168478*a.z + -0.014518998*b.z + -0.038895532*c.z + -0.18411076*d.z + 0.06959173*e.z + -0.03780323*f.z + -0.054073177*g.z + 0.05846756*h.z + 0.0526453*i.z; + float v = 0.1637899*a.w + -0.17392571*b.w + -0.044026185*c.w + -0.36689785*d.w + 0.14791447*e.w + -0.03293263*f.w + -0.13484396*g.w + 0.025672594*h.w + 0.0018860486*i.w; + float w = 0.00056899054*na.x + -0.018397113*nb.x + 0.092683315*nc.x + 0.15637913*nd.x + -0.093613446*ne.x + -0.12215183*nf.x + -0.01812064*ng.x + 0.052842487*nh.x + 0.024374953*ni.x; + float x = -0.18763757*na.y + 0.30196622*nb.y + 0.08883403*nc.y + -0.054503135*nd.y + -0.6387117*ne.y + -0.051367637*nf.y + 0.062047742*ng.y + -0.25852874*nh.y + -0.16576186*ni.y; + float y = 0.13587122*na.z + 0.08522579*nb.z + 0.03095689*nc.z + 0.25446168*nd.z + -0.1795436*ne.z + 0.12887624*nf.z + 0.16522995*ng.z + -0.12371819*nh.z + 0.018461064*ni.z; + float z = 0.33695576*na.w + 0.27555978*nb.w + 0.12422293*nc.w + 0.4810716*nd.w + 0.24170946*ne.w + 0.109018564*nf.w + 0.1475024*ng.w + 0.008883083*nh.w + -0.06614558*ni.w; + float o = s+t+u+v+w+x+y+z+-0.009210918; + s = 0.011271452*a.x + -0.42887446*b.x + -0.16086382*c.x + -0.2105586*d.x + 0.24786222*e.x + -0.13847941*f.x + -0.18258463*g.x + -0.32100454*h.x + 0.014219074*i.x; + t = 0.023105236*a.y + -0.01578845*b.y + -0.050536994*c.y + 0.039284714*d.y + 0.16437066*e.y + 0.0356428*f.y + -0.062688194*g.y + 0.07783894*h.y + 0.009747119*i.y; + u = 0.030821703*a.z + 0.06083882*b.z + 0.025873283*c.z + 0.017223293*d.z + 0.08845148*e.z + 0.061377097*f.z + 0.06515027*g.z + 0.0019544929*h.z + 0.017247573*i.z; + v = 0.012934576*a.w + 0.07368678*b.w + -0.040340308*c.w + 0.067247815*d.w + -0.08931617*e.w + 0.031227414*f.w + -0.06303663*g.w + 0.03044627*h.w + 0.012112707*i.w; + w = -0.024660507*na.x + -0.009060651*nb.x + -0.0035039044*nc.x + 0.06341225*nd.x + -0.52527195*ne.x + -0.005501108*nf.x + 0.0588685*ng.x + 0.09516038*nh.x + 0.04720441*ni.x; + x = -0.063695304*na.y + -0.067882225*nb.y + 0.009680431*nc.y + 0.11614084*nd.y + 0.07604306*ne.y + -0.2850213*nf.y + 0.06081603*ng.y + -0.078130275*nh.y + 0.010210937*ni.y; + y = 0.020847162*na.z + 0.08855373*nb.z + 0.0023585085*nc.z + 0.046964426*nd.z + 0.029082319*ne.z + -0.010446979*nf.z + 0.069331944*ng.z + -0.1097909*nh.z + 0.0066273385*ni.z; + z = 0.07595761*na.w + 0.21096602*nb.w + -0.0016103018*nc.w + 0.01423776*nd.w + 0.39817473*ne.w + 0.017830608*nf.w + 0.10896886*ng.w + 0.05775906*nh.w + -0.008378969*ni.w; + float p = s+t+u+v+w+x+y+z+0.007218698; + s = 0.034728855*a.x + -0.24261177*b.x + 0.28377128*c.x + -0.07902698*d.x + 0.53327984*e.x + 0.25865844*f.x + -0.0034399142*g.x + -0.43674976*h.x + 0.032661323*i.x; + t = -0.07738957*a.y + 0.057249602*b.y + 0.2050702*c.y + 0.17566027*d.y + 0.011081271*e.y + -0.23351799*f.y + -0.09890139*g.y + 0.018036745*h.y + 0.047635887*i.y; + u = -0.020469286*a.z + 0.047594436*b.z + -0.002022923*c.z + -0.20256907*d.z + -0.78263223*e.z + 0.0072576823*f.z + -0.0490066*g.z + 0.029040253*h.z + 0.017826209*i.z; + v = -0.020083593*a.w + 0.06858024*b.w + 0.06368863*c.w + 0.20496108*d.w + -0.16528691*e.w + -0.10180708*f.w + -0.16950546*g.w + 0.10020681*h.w + 0.012377215*i.w; + w = -0.03253046*na.x + 0.066873014*nb.x + -0.068452045*nc.x + -0.010155748*nd.x + -0.46329933*ne.x + -0.1307425*nf.x + 0.048001047*ng.x + 0.123704046*nh.x + 0.074856944*ni.x; + x = 0.062060773*na.y + 0.13428265*nb.y + -0.24431407*nc.y + -0.072135694*nd.y + 0.9167748*ne.y + 0.23750597*nf.y + 0.04223396*ng.y + -0.39293385*nh.y + -0.2623536*ni.y; + y = 0.021315947*na.z + 0.09439878*nb.z + 0.015211157*nc.z + 0.2038265*nd.z + 0.69010055*ne.z + 0.042161886*nf.z + 0.0677661*ng.z + -0.023256699*nh.z + 0.014574618*ni.z; + z = -0.04407271*na.w + 0.11794614*nb.w + 0.03630912*nc.w + 0.7663727*nd.w + 0.39717525*ne.w + 0.22002636*nf.w + -0.010754877*ng.w + -0.051768698*nh.w + -0.010918847*ni.w; + float q = s+t+u+v+w+x+y+z+0.024105644; + s = 0.030766528*a.x + 0.16373588*b.x + 0.21841961*c.x + 0.10914003*d.x + 0.05621998*e.x + 0.25531125*f.x + 0.058601663*g.x + -0.029884653*h.x + -0.03693911*i.x; + t = -0.045011982*a.y + 0.093240164*b.y + 0.09846852*c.y + 0.06726326*d.y + 0.628559*e.y + -0.02637863*f.y + 0.0064472784*g.y + 0.042976446*h.y + 0.0080402335*i.y; + u = -0.017018517*a.z + -0.0002487334*b.z + 0.051482406*c.z + 0.09698756*d.z + -0.06515222*e.z + 0.020085098*f.z + 0.049856555*g.z + 0.09850702*h.z + 0.06601598*i.z; + v = 0.0029910787*a.w + 0.027113425*b.w + 0.056177218*c.w + 0.1544931*d.w + 0.28678927*e.w + -0.031562537*f.w + -0.015119418*g.w + 0.059966877*h.w + 0.009752991*i.w; + w = -0.06231565*na.x + -0.03341734*nb.x + -0.072572425*nc.x + -0.04877089*nd.x + -0.047237467*ne.x + -0.10683365*nf.x + -0.002816312*ng.x + -0.05710042*nh.x + -0.01591127*ni.x; + x = 0.025939502*na.y + 0.10218501*nb.y + -0.10536432*nc.y + -0.071161434*nd.y + -0.3066342*ne.y + 0.061602294*nf.y + 0.03169828*ng.y + 0.005768011*nh.y + -0.18946463*ni.y; + y = -0.013577987*na.z + -0.025278145*nb.z + 0.00625481*nc.z + -0.08724931*nd.z + 0.15522881*ne.z + -0.015623531*nf.z + -0.040420238*ng.z + 0.07587788*nh.z + -0.026974916*ni.z; + z = 0.05199736*na.w + -0.046465985*nb.w + 0.020043945*nc.w + -0.1230899*nd.w + -0.26674423*ne.w + 0.039947394*nf.w + -0.039006326*ng.w + -0.08176985*nh.w + 0.030418074*ni.w; + float r = s+t+u+v+w+x+y+z+-0.012540265; + + return vec4(o, p, q, r); +} +//!DESC Anime4K-v3.1-Deblur-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAN4 +//!SAVE LUMAN5 +//!COMPONENTS 4 + +#define L_tex LUMAN4_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = 0.00025631802*a.x + 0.057320878*b.x + -0.041412644*c.x + 0.16791897*d.x + 0.16617729*e.x + -0.48703465*f.x + -0.12931561*g.x + 0.4140343*h.x + -0.33470672*i.x; + float t = 0.03830889*a.y + -0.051282525*b.y + 0.09902938*c.y + 0.051170327*d.y + -1.0059495*e.y + 0.3998207*f.y + -0.026771523*g.y + -0.23292333*h.y + 0.23323184*i.y; + float u = 0.033804324*a.z + -0.16789144*b.z + 0.11551676*c.z + 0.2096383*d.z + -0.5732962*e.z + 0.37778842*f.z + -0.035116088*g.z + 0.089063995*h.z + 0.070677355*i.z; + float v = 0.22857346*a.w + -0.079091504*b.w + -0.31563935*c.w + 0.5057771*d.w + -1.3217461*e.w + -0.12721835*f.w + 0.16177909*g.w + -0.2629097*h.w + -0.0029459773*i.w; + float w = -0.030586343*na.x + -0.13376898*nb.x + 0.13974473*nc.x + -0.24266301*nd.x + -0.11947399*ne.x + 0.19367288*nf.x + -0.34237102*ng.x + 0.3096073*nh.x + 0.043135814*ni.x; + float x = -0.14012407*na.y + 0.016800448*nb.y + 0.1570266*nc.y + 0.7430246*nd.y + -0.005562219*ne.y + 0.26139715*nf.y + 0.64244574*ng.y + -0.51432157*nh.y + -0.114942044*ni.y; + float y = -0.10178008*na.z + 0.23307206*nb.z + -0.29321644*nc.z + 0.24498452*nd.z + -1.1282628*ne.z + 0.022412058*nf.z + -0.16838956*ng.z + 0.40056717*nh.z + -0.21463306*ni.z; + float z = -1.005476*na.w + 0.8050052*nb.w + 0.12235334*nc.w + -0.6732282*nd.w + 0.3369146*ne.w + 0.06454999*nf.w + -0.17765191*ng.w + 0.10384625*nh.w + -0.11302512*ni.w; + float o = s+t+u+v+w+x+y+z+-0.061198946; + s = 0.08390676*a.x + -0.011123063*b.x + -0.03269317*c.x + -0.19219291*d.x + -0.050676446*e.x + 0.07472215*f.x + 0.085977115*g.x + 0.11578824*h.x + -0.28158212*i.x; + t = -0.02405043*a.y + -0.13468283*b.y + 0.014654289*c.y + 0.28977296*d.y + 0.6254546*e.y + 0.16947387*f.y + -0.026750885*g.y + 0.037516773*h.y + 0.29321685*i.y; + u = 0.017659916*a.z + -0.0513346*b.z + 0.014308151*c.z + -0.07032843*d.z + -0.124652594*e.z + 0.027099187*f.z + -0.042692557*g.z + -0.32160884*h.z + -0.124402575*i.z; + v = 0.173668*a.w + 0.16868736*b.w + 0.105285004*c.w + -0.27488157*d.w + -0.62909824*e.w + -0.28937566*f.w + 0.021574946*g.w + 0.090454094*h.w + 0.088722266*i.w; + w = 0.011426444*na.x + -0.16358133*nb.x + -0.24628234*nc.x + -0.12582813*nd.x + 0.37491634*ne.x + 0.66146225*nf.x + 0.17739972*ng.x + -0.24103446*nh.x + -0.12512414*ni.x; + x = 0.049656067*na.y + 0.35043705*nb.y + -0.06541586*nc.y + 0.036384188*nd.y + -0.88243604*ne.y + 0.15085825*nf.y + 0.01566454*ng.y + 0.26099333*nh.y + -0.23653607*ni.y; + y = -0.05713696*na.z + 0.31915048*nb.z + 0.09413395*nc.z + -0.056367278*nd.z + 0.500199*ne.z + -0.10129501*nf.z + 0.22792955*ng.z + 0.27008235*nh.z + 0.11766709*ni.z; + z = -0.30272278*na.w + -0.032818265*nb.w + -0.0091206925*nc.w + 0.7295555*nd.w + 0.078978635*ne.w + -0.036731187*nf.w + -0.04899552*ng.w + -0.23233992*nh.w + 0.120634325*ni.w; + float p = s+t+u+v+w+x+y+z+-0.006999369; + s = -0.021856444*a.x + -0.0006963466*b.x + 0.02784665*c.x + -0.1285126*d.x + -0.47980213*e.x + 0.3816084*f.x + 0.11308428*g.x + -0.43742862*h.x + 0.43896514*i.x; + t = -0.053421438*a.y + 0.0963073*b.y + -0.13441114*c.y + -0.12122123*d.y + -0.15046698*e.y + -0.39540198*f.y + -0.0028491614*g.y + 0.22168712*h.y + -0.33935112*i.y; + u = -0.02753673*a.z + 0.13554272*b.z + -0.08918299*c.z + -0.17173594*d.z + 0.46268475*e.z + -0.35359815*f.z + 0.046332352*g.z + 0.02462448*h.z + -0.023167444*i.z; + v = -0.23453364*a.w + 0.07788929*b.w + 0.16012788*c.w + -0.41643515*d.w + -0.6417199*e.w + 0.3087294*f.w + -0.14682502*g.w + 0.25157255*h.w + -0.0602734*i.w; + w = 0.028217131*na.x + 0.12867944*nb.x + -0.05617058*nc.x + 0.28762993*nd.x + -0.5784438*ne.x + -0.36014605*nf.x + 0.21616842*ng.x + -0.18586996*nh.x + -0.009710477*ni.x; + x = 0.123937346*na.y + -0.112089925*nb.y + -0.079855986*nc.y + -0.65935284*nd.y + 1.6843947*ne.y + -0.37654027*nf.y + -0.5687655*ng.y + 0.36904392*nh.y + 0.22348003*ni.y; + y = 0.10575013*na.z + -0.28616336*nb.z + 0.22265147*nc.z + -0.2137293*nd.z + -0.91093117*ne.z + 0.011338876*nf.z + 0.10558912*ng.z + -0.47041062*nh.z + 0.16206238*ni.z; + z = 0.9702835*na.w + -0.82380474*nb.w + -0.0043063024*nc.w + 0.4436007*nd.w + -0.69435906*ne.w + -0.11961962*nf.w + 0.18174438*ng.w + -0.050473217*nh.w + 0.07299529*ni.w; + float q = s+t+u+v+w+x+y+z+-0.042621654; + s = 0.012985117*a.x + 0.069789566*b.x + 0.012881662*c.x + -0.013086082*d.x + -0.16663207*e.x + 0.18778817*f.x + -0.009702196*g.x + 0.038190898*h.x + -0.050225593*i.x; + t = -0.07929176*a.y + -0.06990447*b.y + -0.06669893*c.y + 0.025257275*d.y + 0.7689759*e.y + -0.10249004*f.y + 0.017197285*g.y + -0.10194497*h.y + 0.090725824*i.y; + u = 0.0030403193*a.z + 0.012294587*b.z + -0.023400322*c.z + -0.043591868*d.z + -0.16327766*e.z + -0.02788577*f.z + 0.018733488*g.z + -0.034326617*h.z + -0.05105706*i.z; + v = -0.062092993*a.w + 0.18108387*b.w + 0.0864376*c.w + -0.16197896*d.w + -0.12865224*e.w + -0.069327936*f.w + 0.0015153112*g.w + 0.018491505*h.w + 0.049098536*i.w; + w = 0.019960985*na.x + 0.051785935*nb.x + -0.21044643*nc.x + 0.09824475*nd.x + -0.14958306*ne.x + 0.3990458*nf.x + 0.016052058*ng.x + 0.049709063*nh.x + -0.17706677*ni.x; + x = 0.019563846*na.y + 0.18184721*nb.y + -0.11986355*nc.y + -0.2601329*nd.y + -0.28785226*ne.y + 0.085305505*nf.y + 0.024360009*ng.y + -0.20685866*nh.y + -0.086421244*ni.y; + y = -0.0028385085*na.z + -0.007392961*nb.z + 0.12550405*nc.z + 0.05340696*nd.z + -0.24601264*ne.z + -0.19635704*nf.z + -0.035968296*ng.z + 0.10348485*nh.z + -0.009769748*ni.z; + z = 0.26647258*na.w + -0.63420767*nb.w + -0.02826515*nc.w + 0.06637238*nd.w + 0.57809395*ne.w + 0.06882983*nf.w + -0.004849368*ng.w + -0.093381576*nh.w + -0.10812531*ni.w; + float r = s+t+u+v+w+x+y+z+-0.018241946; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Deblur-CNN(M)-Conv-Reduce +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAN1 +//!BIND LUMAN2 +//!BIND LUMAN3 +//!BIND LUMAN4 +//!BIND LUMAN5 +//!SAVE LUMAN0 +//!COMPONENTS 4 + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = LUMAN1_tex(HOOKED_pos); + vec4 b = LUMAN2_tex(HOOKED_pos); + vec4 c = LUMAN3_tex(HOOKED_pos); + vec4 d = LUMAN4_tex(HOOKED_pos); + vec4 e = LUMAN5_tex(HOOKED_pos); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + + float o = 0.016170086*a.x + -0.07807932*a.y + -0.01608141*a.z + 0.04596583*a.w + 0.0010671375*na.x + 0.13604787*na.y + -0.103508055*na.z + -0.053727165*na.w + 0.05931074*b.x + -0.03741526*b.y + 0.007310368*b.z + 0.021383934*b.w + 0.07797022*nb.x + 0.010276286*nb.y + -0.044151705*nb.z + 0.018349322*nb.w + -0.10480624*c.x + -0.19607827*c.y + -0.017716367*c.z + -0.03210694*c.w + 0.030397506*nc.x + 0.13205609*nc.y + 0.027324466*nc.z + 0.011638977*nc.w + -0.046764173*d.x + -0.14180084*d.y + -0.041110236*d.z + -0.3233351*d.w + -0.13833268*nd.x + 0.35512686*nd.y + -0.08653635*nd.z + -0.15801503*nd.w + -0.26316383*e.x + -0.2056243*e.y + -0.09891177*e.z + 0.09735771*e.w + 0.17222679*ne.x + 0.10222737*ne.y + 0.17698137*ne.z + -0.045976873*ne.w + -0.016519222; + float p = -0.0070673134*a.x + -0.10279413*a.y + -0.030861663*a.z + 0.019370042*a.w + -0.0014143038*na.x + 0.05432107*na.y + -0.15635669*na.z + -0.05455238*na.w + 0.027550258*b.x + 0.014056243*b.y + -0.016198097*b.z + 0.03419058*b.w + -0.004207751*nb.x + -0.0113672*nb.y + 0.034180697*nb.z + 0.04015298*nb.w + -0.06339332*c.x + 0.0036280584*c.y + -0.010639602*c.z + 0.026508855*c.w + -0.02524984*nc.x + 0.11936996*nc.y + -0.031202994*nc.z + -0.021372601*nc.w + -0.025080366*d.x + -0.021841787*d.y + 0.06487728*d.z + -0.06460682*d.w + 0.04119384*nd.x + -0.008643975*nd.y + -0.2078446*nd.z + 0.11259166*nd.w + -0.10560037*e.x + 0.14785078*e.y + 0.1384287*e.z + -0.06915313*e.w + 0.010694984*ne.x + -0.034556255*ne.y + -0.03377371*ne.z + 0.06635877*ne.w + -0.002248366; + float q = 0.02117986*a.x + -0.051776726*a.y + 0.15544093*a.z + 0.070309296*a.w + -0.011411071*na.x + 0.0055163414*na.y + 0.06413486*na.z + -0.045615938*na.w + 0.033726115*b.x + -0.052270424*b.y + 0.019222505*b.z + 0.02011268*b.w + -0.11609392*nb.x + 0.033497345*nb.y + -0.06132894*nb.z + -0.10658528*nb.w + 0.038067166*c.x + 0.086731836*c.y + 0.08148008*c.z + 0.010150495*c.w + -0.016870074*nc.x + 0.01104681*nc.y + 0.009952575*nc.z + 0.020137098*nc.w + -0.06427216*d.x + -0.12534674*d.y + -0.09109642*d.z + -0.46550632*d.w + -0.1370387*nd.x + 0.24063608*nd.y + -0.33579165*nd.z + -0.08938409*nd.w + -0.09131308*e.x + -0.17998323*e.y + -0.33354574*e.z + -0.20851119*e.w + 0.21100727*ne.x + 0.0667875*ne.y + 0.23766036*ne.z + 0.10573718*ne.w + -0.023920521; + float r = -0.06296154*a.x + 0.06051705*a.y + 0.11386459*a.z + 0.019399049*a.w + -0.015610163*na.x + 0.0037772388*na.y + 0.04038177*na.z + 0.020901382*na.w + 0.0468376*b.x + 0.004552797*b.y + 0.08530895*b.z + -0.0020661093*b.w + -0.075115256*nb.x + 0.01650069*nb.y + 0.025982859*nb.z + -0.063966826*nb.w + 0.14024706*c.x + 0.03896333*c.y + -0.070236415*c.z + 0.013854423*c.w + -0.023396354*nc.x + -0.10749727*nc.y + 0.018419292*nc.z + 0.0051121856*nc.w + -0.098157406*d.x + -0.24840991*d.y + -0.01761279*d.z + -0.48552045*d.w + -0.11399571*nd.x + 0.2751265*nd.y + -0.4713016*nd.z + 0.009285934*nd.w + -0.11395686*e.x + 0.04294104*e.y + -0.33598495*e.z + 0.14753135*e.w + 0.18233627*ne.x + 0.06840005*ne.y + 0.23921333*ne.z + -0.087927036*ne.w + -0.020836344; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Deblur-CNN(M)-Kernel(X) +//!HOOK NATIVE +//!BIND HOOKED +//!SAVE MMKERNEL +//!COMPONENTS 2 + +#define L_tex HOOKED_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a = L_tex(pos - d).x; + float b = L_tex(pos).x; + float c = L_tex(pos + d).x; + + return vec2(min3v(a, b, c), max3v(a, b, c)); +} + +vec4 hook() { + return vec4(minmax3(HOOKED_pos, vec2(HOOKED_pt.x, 0)), 0, 0); +} + +//!DESC Anime4K-v3.1-Deblur-CNN(M)-Kernel(Y) +//!HOOK NATIVE +//!BIND HOOKED +//!BIND MMKERNEL +//!SAVE MMKERNEL +//!COMPONENTS 2 + +#define L_tex MMKERNEL_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a0 = L_tex(pos - d).x; + float b0 = L_tex(pos).x; + float c0 = L_tex(pos + d).x; + + float a1 = L_tex(pos - d).y; + float b1 = L_tex(pos).y; + float c1 = L_tex(pos + d).y; + + return vec2(min3v(a0, b0, c0), max3v(a1, b1, c1)); +} + +vec4 hook() { + return vec4(minmax3(HOOKED_pos, vec2(HOOKED_pt.x, 0)), 0, 0); +} + +//!HOOK NATIVE +//!BIND HOOKED +//!BIND MMKERNEL +//!BIND LUMAN0 +//!DESC Anime4K-v3.1-Deblur-CNN(M) + +#define STRENGTH 1 //De-blur proportional strength, higher is sharper. However, it is better to tweak BLUR_CURVE instead to avoid ringing. +#define BLUR_CURVE 0.6 //De-blur power curve, lower is sharper. Good values are between 0.3 - 1. Values greater than 1 softens the image; +#define BLUR_THRESHOLD 0.1 //Value where curve kicks in, used to not de-blur already sharp edges. Only de-blur values that fall below this threshold. +#define NOISE_THRESHOLD 0.001 //Value where curve stops, used to not sharpen noise. Only de-blur values that fall above this threshold. + +#define L_tex HOOKED_tex + +vec4 hook() { + vec4 r = LUMAN0_tex(LUMAN0_pos); + float c = (r.x + r.y + r.z + r.w) / 4 * STRENGTH; + + float t_range = BLUR_THRESHOLD - NOISE_THRESHOLD; + + float c_t = abs(c); + if (c_t > NOISE_THRESHOLD) { + c_t = (c_t - NOISE_THRESHOLD) / t_range; + c_t = pow(c_t, BLUR_CURVE); + c_t = c_t * t_range + NOISE_THRESHOLD; + c_t = c_t * sign(c); + } else { + c_t = c; + } + + return vec4(clamp(c_t + L_tex(HOOKED_pos).x, MMKERNEL_tex(HOOKED_pos).x, MMKERNEL_tex(HOOKED_pos).y), HOOKED_tex(HOOKED_pos).yz, 0); +} \ No newline at end of file diff --git a/.config/mpv/shaders/Anime4K_Deblur_DoG.glsl b/.config/mpv/shaders/Anime4K_Deblur_DoG.glsl new file mode 100644 index 0000000..b786464 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Deblur_DoG.glsl @@ -0,0 +1,134 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Deblur-DoG-Kernel(X) +//!HOOK NATIVE +//!BIND HOOKED +//!SAVE MMKERNEL +//!COMPONENTS 3 + +#define L_tex HOOKED_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a = L_tex(pos - d).x; + float b = L_tex(pos).x; + float c = L_tex(pos + d).x; + + return vec2(min3v(a, b, c), max3v(a, b, c)); +} + +float lumGaussian7(vec2 pos, vec2 d) { + float g = (L_tex(pos - (d + d)).x + L_tex(pos + (d + d)).x) * 0.06136; + g = g + (L_tex(pos - d).x + L_tex(pos + d).x) * 0.24477; + g = g + (L_tex(pos).x) * 0.38774; + + return g; +} + + +vec4 hook() { + return vec4(lumGaussian7(HOOKED_pos, vec2(HOOKED_pt.x, 0)), minmax3(HOOKED_pos, vec2(HOOKED_pt.x, 0)), 0); +} + + +//!DESC Anime4K-v3.1-Deblur-DoG-Kernel(Y) +//!HOOK NATIVE +//!BIND HOOKED +//!BIND MMKERNEL +//!SAVE MMKERNEL +//!COMPONENTS 3 + +#define L_tex MMKERNEL_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a0 = L_tex(pos - d).y; + float b0 = L_tex(pos).y; + float c0 = L_tex(pos + d).y; + + float a1 = L_tex(pos - d).z; + float b1 = L_tex(pos).z; + float c1 = L_tex(pos + d).z; + + return vec2(min3v(a0, b0, c0), max3v(a1, b1, c1)); +} + +float lumGaussian7(vec2 pos, vec2 d) { + float g = (L_tex(pos - (d + d)).x + L_tex(pos + (d + d)).x) * 0.06136; + g = g + (L_tex(pos - d).x + L_tex(pos + d).x) * 0.24477; + g = g + (L_tex(pos).x) * 0.38774; + + return g; +} + + +vec4 hook() { + return vec4(lumGaussian7(HOOKED_pos, vec2(0, HOOKED_pt.y)), minmax3(HOOKED_pos, vec2(0, HOOKED_pt.y)), 0); +} + +//!DESC Anime4K-v3.1-Deblur-DoG +//!HOOK NATIVE +//!BIND HOOKED +//!BIND MMKERNEL + +#define STRENGTH 0.6 //De-blur proportional strength, higher is sharper. However, it is better to tweak BLUR_CURVE instead to avoid ringing. +#define BLUR_CURVE 0.6 //De-blur power curve, lower is sharper. Good values are between 0.3 - 1. Values greater than 1 softens the image; +#define BLUR_THRESHOLD 0.1 //Value where curve kicks in, used to not de-blur already sharp edges. Only de-blur values that fall below this threshold. +#define NOISE_THRESHOLD 0.001 //Value where curve stops, used to not sharpen noise. Only de-blur values that fall above this threshold. + +#define L_tex HOOKED_tex + +vec4 hook() { + float c = (L_tex(HOOKED_pos).x - MMKERNEL_tex(HOOKED_pos).x) * STRENGTH; + + float t_range = BLUR_THRESHOLD - NOISE_THRESHOLD; + + float c_t = abs(c); + if (c_t > NOISE_THRESHOLD) { + c_t = (c_t - NOISE_THRESHOLD) / t_range; + c_t = pow(c_t, BLUR_CURVE); + c_t = c_t * t_range + NOISE_THRESHOLD; + c_t = c_t * sign(c); + } else { + c_t = c; + } + return vec4(clamp(c_t + L_tex(HOOKED_pos).x, MMKERNEL_tex(HOOKED_pos).y, MMKERNEL_tex(HOOKED_pos).z), HOOKED_tex(HOOKED_pos).yz, 0); +} + + + diff --git a/.config/mpv/shaders/Anime4K_Deblur_Original.glsl b/.config/mpv/shaders/Anime4K_Deblur_Original.glsl new file mode 100644 index 0000000..332586e --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Deblur_Original.glsl @@ -0,0 +1,274 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Deblur-Original-Kernel(X) +//!HOOK NATIVE +//!BIND HOOKED +//!SAVE LUMAD +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!COMPONENTS 2 + +vec4 hook() { + vec2 d = HOOKED_pt; + + //[tl t tr] + //[ l c r] + //[bl b br] + float l = HOOKED_tex(HOOKED_pos + vec2(-d.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos).x; + float r = HOOKED_tex(HOOKED_pos + vec2(d.x, 0)).x; + + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (-l + r); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (l + c + c + r); + + //Computes the luminance's gradient + return vec4(xgrad, ygrad, 0, 0); +} + + +//!DESC Anime4K-v3.1-Deblur-Original-Kernel(Y) +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAD +//!SAVE LUMAD +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!COMPONENTS 2 + + +/* --------------------- SETTINGS --------------------- */ + +//Strength of edge refinement, good values are between 0.2 and 4 +#define REFINE_STRENGTH 1 + + +/* --- MODIFY THESE SETTINGS BELOW AT YOUR OWN RISK --- */ + +//Bias of the refinement function, good values are between 0 and 1 +#define REFINE_BIAS 0 + +//Polynomial fit obtained by minimizing MSE error on image +#define P5 ( 11.68129591) +#define P4 (-42.46906057) +#define P3 ( 60.28286266) +#define P2 (-41.84451327) +#define P1 ( 14.05517353) +#define P0 (-1.081521930) + +/* ----------------- END OF SETTINGS ----------------- */ + +float power_function(float x) { + float x2 = x * x; + float x3 = x2 * x; + float x4 = x2 * x2; + float x5 = x2 * x3; + + return P5*x5 + P4*x4 + P3*x3 + P2*x2 + P1*x + P0; +} + +vec4 hook() { + vec2 d = HOOKED_pt; + + //[tl t tr] + //[ l cc r] + //[bl b br] + float tx = LUMAD_tex(HOOKED_pos + vec2(0, -d.y)).x; + float cx = LUMAD_tex(HOOKED_pos).x; + float bx = LUMAD_tex(HOOKED_pos + vec2(0, d.y)).x; + + + float ty = LUMAD_tex(HOOKED_pos + vec2(0, -d.y)).y; + //float cy = LUMAD_tex(HOOKED_pos).y; + float by = LUMAD_tex(HOOKED_pos + vec2(0, d.y)).y; + + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (tx + cx + cx + bx); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (-ty + by); + + //Computes the luminance's gradient + float sobel_norm = clamp(sqrt(xgrad * xgrad + ygrad * ygrad), 0, 1); + + float dval = clamp(power_function(clamp(sobel_norm, 0, 1)) * REFINE_STRENGTH + REFINE_BIAS, 0, 1); + + return vec4(sobel_norm, dval, 0, 0); +} + +//!DESC Anime4K-v3.1-Deblur-Original-Kernel(X) +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAD +//!SAVE LUMAMM +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!COMPONENTS 2 + + +vec4 hook() { + vec2 d = HOOKED_pt; + + if (LUMAD_tex(HOOKED_pos).y < 0.1) { + return vec4(0); + } + + //[tl t tr] + //[ l c r] + //[bl b br] + float l = LUMAD_tex(HOOKED_pos + vec2(-d.x, 0)).x; + float c = LUMAD_tex(HOOKED_pos).x; + float r = LUMAD_tex(HOOKED_pos + vec2(d.x, 0)).x; + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (-l + r); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (l + c + c + r); + + + return vec4(xgrad, ygrad, 0, 0); +} + + +//!DESC Anime4K-v3.1-Deblur-Original-Kernel(Y) +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAD +//!BIND LUMAMM +//!SAVE LUMAMM +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!COMPONENTS 2 + +vec4 hook() { + vec2 d = HOOKED_pt; + + if (LUMAD_tex(HOOKED_pos).y < 0.1) { + return vec4(0); + } + + //[tl t tr] + //[ l cc r] + //[bl b br] + float tx = LUMAMM_tex(HOOKED_pos + vec2(0, -d.y)).x; + float cx = LUMAMM_tex(HOOKED_pos).x; + float bx = LUMAMM_tex(HOOKED_pos + vec2(0, d.y)).x; + + float ty = LUMAMM_tex(HOOKED_pos + vec2(0, -d.y)).y; + //float cy = LUMAMM_tex(HOOKED_pos).y; + float by = LUMAMM_tex(HOOKED_pos + vec2(0, d.y)).y; + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (tx + cx + cx + bx); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (-ty + by); + + float norm = sqrt(xgrad * xgrad + ygrad * ygrad); + if (norm <= 0.001) { + xgrad = 0; + ygrad = 0; + norm = 1; + } + + return vec4(xgrad/norm, ygrad/norm, 0, 0); +} + + +//!DESC Anime4K-v3.1-Deblur-Original +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAD +//!BIND LUMAMM +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!SAVE RESAMPLED + + +vec4 hook() { + vec2 d = HOOKED_pt; + + float dval = LUMAD_tex(HOOKED_pos).y; + if (dval < 0.1) { + return HOOKED_tex(HOOKED_pos); + } + + vec4 dc = LUMAMM_tex(HOOKED_pos); + if (abs(dc.x + dc.y) <= 0.0001) { + return HOOKED_tex(HOOKED_pos); + } + + float xpos = -sign(dc.x); + float ypos = -sign(dc.y); + + vec4 xval = HOOKED_tex(HOOKED_pos + vec2(d.x * xpos, 0)); + vec4 yval = HOOKED_tex(HOOKED_pos + vec2(0, d.y * ypos)); + + float xyratio = abs(dc.x) / (abs(dc.x) + abs(dc.y)); + + vec4 avg = xyratio * xval + (1-xyratio) * yval; + + return avg * dval + HOOKED_tex(HOOKED_pos) * (1 - dval); + +} + +//!DESC Anime4K-v3.1-Deblur-Original-Resample +//!HOOK NATIVE +//!BIND HOOKED +//!BIND RESAMPLED + +vec4 hook() { + return RESAMPLED_tex(HOOKED_pos); +} \ No newline at end of file diff --git a/.config/mpv/shaders/Anime4K_Denoise_Bilateral_Mean.glsl b/.config/mpv/shaders/Anime4K_Denoise_Bilateral_Mean.glsl new file mode 100644 index 0000000..0fcde93 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Denoise_Bilateral_Mean.glsl @@ -0,0 +1,65 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Denoise-Bilateral-Mean +//!HOOK NATIVE +//!BIND HOOKED + +#define INTENSITY_SIGMA 0.1 //Intensity window size, higher is stronger denoise, must be a positive real number +#define SPATIAL_SIGMA 1.0 //Spatial window size, higher is stronger denoise, must be a positive real number. + + +#define INTENSITY_POWER_CURVE 1.0 //Intensity window power curve. Setting it to 0 will make the intensity window treat all intensities equally, while increasing it will make the window narrower in darker intensities and wider in brighter intensities. + +#define KERNELSIZE int(max(int(SPATIAL_SIGMA), 1) * 2 + 1) //Kernel size, must be an positive odd integer. +#define KERNELHALFSIZE (int(KERNELSIZE/2)) //Half of the kernel size without remainder. Must be equal to trunc(KERNELSIZE/2). +#define KERNELLEN (KERNELSIZE * KERNELSIZE) //Total area of kernel. Must be equal to KERNELSIZE * KERNELSIZE. + +#define GETOFFSET(i) vec2((i % KERNELSIZE) - KERNELHALFSIZE, (i / KERNELSIZE) - KERNELHALFSIZE) + +float gaussian(float x, float s, float m) { + float scaled = (x - m) / s; + return exp(-0.5 * scaled * scaled); +} + +vec4 hook() { + vec4 sum = vec4(0); + float n = 0; + + float vc = HOOKED_tex(HOOKED_pos).x; + + float is = pow(vc + 0.0001, INTENSITY_POWER_CURVE) * INTENSITY_SIGMA; + float ss = SPATIAL_SIGMA; + + for (int i=0; i v[i].x) { + w_above += w[j]; + } else if (v[j].x < v[i].x) { + w_below += w[j]; + } + } + + if ((n - w_above) / n >= 0.5 && w_below / n <= 0.5) { + return v[i]; + } + } +} + +vec4 hook() { + vec4 histogram_v[KERNELLEN]; + float histogram_w[KERNELLEN]; + float n = 0; + + float vc = HOOKED_tex(HOOKED_pos).x; + + float is = pow(vc + 0.0001, INTENSITY_POWER_CURVE) * INTENSITY_SIGMA; + float ss = SPATIAL_SIGMA; + + for (int i=0; i 0) { + float histogram_wn[KERNELLEN]; + n = 0; + + for (int i=0; i= maxw) { + maxw = w[i]; + maxv = v[i]; + } + } + + return maxv; +} + +vec4 hook() { + vec4 histogram_v[KERNELLEN]; + float histogram_w[KERNELLEN]; + float histogram_wn[KERNELLEN]; + + float vc = HOOKED_tex(HOOKED_pos).x; + + float is = pow(vc + 0.0001, INTENSITY_POWER_CURVE) * INTENSITY_SIGMA; + float ss = SPATIAL_SIGMA; + + for (int i=0; i OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!SAVE LUMAN0 + +vec4 hook() { + vec2 dp = HOOKED_pt; + float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x; + float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x; + float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x; + float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x; + float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x; + float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x; + float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x; + float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x; + float s = 0.10397486*a + 0.6959855*b + 0.3576091*c + -0.048129864*d + -1.0134345*e + -0.02346323*f + 0.018850459*g + -0.106389955*h + 0.028658116*i + 0.04803684; + float t = 0.354869*a + -0.39392647*b + 0.003622437*c + -0.18034431*d + 0.88706636*e + -0.31342724*f + -0.022048054*g + -0.3557178*h + 0.0018092435*i + -0.037158098; + float u = 0.32695425*a + -0.32558918*b + 0.00059630745*c + -0.018950976*d + 0.01774775*e + -0.004043651*f + 0.0027214154*g + -0.0034390602*h + 0.0025048833*i + 0.0007407871; + float v = -0.071759045*a + -0.42592436*b + -0.14482588*c + 1.5960604*d + -0.63252157*e + -0.36544406*f + -0.15239236*g + 0.12528165*h + 0.08432576*i + -0.08232925; + return vec4(s, t, u, v); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN0 +//!SAVE LUMAN1 + +#define L_tex LUMAN0_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = 0.06639665*a0.x + 0.28223944*b0.x + 0.004304705*c0.x + -0.32451394*d0.x + 0.43342906*e0.x + -0.024424514*f0.x + -0.49240196*g0.x + -0.88034385*h0.x + -0.12338143*i0.x; + float j = -0.6820241*a0.y + 0.25317526*b0.y + -0.09791629*c0.y + 0.3271639*d0.y + -0.6224342*e0.y + -0.154204*f0.y + -0.029958222*g0.y + 0.32977268*h0.y + -0.031524904*i0.y; + float k = 0.6709632*a0.z + -0.24324693*b0.z + -0.049306735*c0.z + -0.8970901*d0.z + 0.56715167*e0.z + -0.14102495*f0.z + -1.0995007*g0.z + 0.5427549*h0.z + 0.36576506*i0.z; + float l = 0.13722713*a0.w + 0.41282004*b0.w + 0.19782153*c0.w + 0.28570884*d0.w + -0.6406399*e0.w + -0.18080634*f0.w + -0.03796595*g0.w + -0.019462103*h0.w + 0.19691238*i0.w; + float m = 0.022774132*na0.x + -0.4075716*nb0.x + -0.0019649733*nc0.x + 0.5934201*nd0.x + -0.31279135*ne0.x + -0.009237561*nf0.x + 0.4158437*ng0.x + 0.8021286*nh0.x + 0.11572698*ni0.x; + float n = 0.6584185*na0.y + -0.43536583*nb0.y + 0.112234406*nc0.y + -0.11827302*nd0.y + 0.47007844*ne0.y + 0.2900137*nf0.y + 0.12348495*ng0.y + -0.6027396*nh0.y + 0.08154192*ni0.y; + float o = -0.7349083*na0.z + 0.24339297*nb0.z + 0.012427026*nc0.z + 0.9602159*nd0.z + -0.8431948*ne0.z + -0.17023432*nf0.z + 0.7244754*ng0.z + 0.13925964*nh0.z + -0.38444963*ni0.z; + float p = -0.14070114*na0.w + -0.42214736*nb0.w + -0.0472595*nc0.w + -0.2583746*nd0.w + 0.49701452*ne0.w + 0.072298154*nf0.w + 0.027000604*ng0.w + 0.077047*nh0.w + -0.11605896*ni0.w; + float o0 = i+j+k+l+m+n+o+p+0.053626187; + i = 0.06845743*a0.x + 0.7203445*b0.x + -0.009160133*c0.x + -0.47423828*d0.x + 0.0040186336*e0.x + -0.13636078*f0.x + -0.16735902*g0.x + -0.095058076*h0.x + -0.1748559*i0.x; + j = 0.95788497*a0.y + 0.5390323*b0.y + -0.23857942*c0.y + -0.015868062*d0.y + 0.065215364*e0.y + 0.35074416*f0.y + 0.14792109*g0.y + 0.012528532*h0.y + -0.08329774*i0.y; + k = -0.8304687*a0.z + -0.2803149*b0.z + 0.8455862*c0.z + -0.31274366*d0.z + 0.49027762*e0.z + -2.568119*f0.z + -0.5816856*g0.z + -0.24438478*h0.z + -1.576034*i0.z; + l = 0.33903894*a0.w + 0.18856564*b0.w + -0.085718796*c0.w + 0.14994945*d0.w + 0.4343596*e0.w + -0.10266155*f0.w + 0.09709637*g0.w + -0.2009859*h0.w + 0.011091642*i0.w; + m = 0.11521898*na0.x + -0.3218118*nb0.x + -0.003314331*nc0.x + 0.38280985*nd0.x + -0.9900221*ne0.x + 0.2372697*nf0.x + 0.17255092*ng0.x + 0.20525312*nh0.x + 0.39674228*ni0.x; + n = -0.47868168*na0.y + -0.8024517*nb0.y + 0.10802533*nc0.y + 0.003150858*nd0.y + 0.17614411*ne0.y + 0.09025896*nf0.y + -0.19619498*ng0.y + 0.06488243*nh0.y + 0.26845673*ni0.y; + o = 0.8002209*na0.z + 0.73399717*nb0.z + -0.35711604*nc0.z + 0.35695946*nd0.z + -0.87510985*ne0.z + -2.083351*nf0.z + 0.30222148*ng0.z + 0.47206184*nh0.z + -0.4826941*ni0.z; + p = -0.2594144*na0.w + -0.23693322*nb0.w + 0.09217326*nc0.w + -0.0690688*nd0.w + -0.01309805*ne0.w + 0.06419221*nf0.w + 0.018290445*ng0.w + 0.27774101*nh0.w + 0.108097576*ni0.w; + float p0 = i+j+k+l+m+n+o+p+0.102133505; + i = 0.0643423*a0.x + 0.018541882*b0.x + 0.08350226*c0.x + -0.004340104*d0.x + -0.03433379*e0.x + 0.01880579*f0.x + 0.03353465*g0.x + -0.3056104*h0.x + -0.19704679*i0.x; + j = -0.15946428*a0.y + 0.21165088*b0.y + 0.12410154*c0.y + 0.27272165*d0.y + -0.65606165*e0.y + 0.12557049*f0.y + -0.17287672*g0.y + -0.04488873*h0.y + 0.03603188*i0.y; + k = 0.062299795*a0.z + -0.14047587*b0.z + 0.024050632*c0.z + 0.31575218*d0.z + 1.8625292*e0.z + -0.43774956*f0.z + 1.5006273*g0.z + 3.9281907*h0.z + -0.13422425*i0.z; + l = -0.04318438*a0.w + 0.08911396*b0.w + 0.05187426*c0.w + -0.028754652*d0.w + -0.50872475*e0.w + -0.30725425*f0.w + -0.043555077*g0.w + 0.11037375*h0.w + -0.12379002*i0.w; + m = 0.005490416*na0.x + -0.009724751*nb0.x + -0.06905491*nc0.x + 0.35613546*nd0.x + 0.2776101*ne0.x + -0.13444975*nf0.x + -0.12958236*ng0.x + 0.27827492*nh0.x + 0.19111122*ni0.x; + n = 0.08052509*na0.y + -0.16101089*nb0.y + -0.11118997*nc0.y + -0.17190972*nd0.y + 0.28470594*ne0.y + -0.02071287*nf0.y + 0.0063910377*ng0.y + 0.13593876*nh0.y + 0.046352968*ni0.y; + o = -0.13271736*na0.z + -0.010725217*nb0.z + -0.26716524*nc0.z + -0.39615706*nd0.z + -0.7941645*ne0.z + -0.046327833*nf0.z + -0.8656559*ng0.z + 3.0924113*nh0.z + 1.2674434*ni0.z; + p = 0.1013534*na0.w + -0.06801255*nb0.w + 0.03251423*nc0.w + 0.18332215*nd0.w + 0.12801744*ne0.w + 0.28137314*nf0.w + 0.007990733*ng0.w + -0.2692326*nh0.w + -0.062365714*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.060032938; + i = 0.117412865*a0.x + -0.22560671*b0.x + -0.14794402*c0.x + 0.34914464*d0.x + 0.45673132*e0.x + -0.35118288*f0.x + 0.33961612*g0.x + 0.11392481*h0.x + -0.13414447*i0.x; + j = -0.11333446*a0.y + 0.2393889*b0.y + 0.0027701098*c0.y + 0.60629034*d0.y + -0.75975823*e0.y + -0.16403528*f0.y + -0.019105319*g0.y + 0.061169848*h0.y + -0.101013266*i0.y; + k = 0.076263286*a0.z + -0.553907*b0.z + -0.4970874*c0.z + -1.5819451*d0.z + 0.64838296*e0.z + 1.7086831*f0.z + 0.09729768*g0.z + -1.2366847*h0.z + -0.24660581*i0.z; + l = 0.08548202*a0.w + -0.17481433*b0.w + -0.34403273*c0.w + 0.012375519*d0.w + 0.08745941*e0.w + -0.070196316*f0.w + 0.00729971*g0.w + 0.29530787*h0.w + -0.21760395*i0.w; + m = -0.24691077*na0.x + 0.2311278*nb0.x + 0.19753166*nc0.x + -0.404209*nd0.x + 0.18452622*ne0.x + 0.29987976*nf0.x + -0.27267244*ng0.x + -0.14402863*nh0.x + 0.073582985*ni0.x; + n = -0.083637685*na0.y + 0.019198107*nb0.y + -0.0853492*nc0.y + -0.7212835*nd0.y + 0.742372*ne0.y + -0.32987705*nf0.y + -0.0026051754*ng0.y + 0.015593551*nh0.y + -0.050979447*ni0.y; + o = -0.02741548*na0.z + 0.2884727*nb0.z + 0.38504106*nc0.z + 1.6370418*nd0.z + -0.31865364*ne0.z + 0.6172546*nf0.z + -0.30839926*ng0.z + -0.37191314*nh0.z + 0.9595531*ni0.z; + p = -0.12116755*na0.w + 0.18340635*nb0.w + 0.24062845*nc0.w + 0.00054277224*nd0.w + -0.040880762*ne0.w + 0.17774053*nf0.w + -0.044756617*ng0.w + -0.29897058*nh0.w + 0.11243821*ni0.w; + float r0 = i+j+k+l+m+n+o+p+-0.0830924; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN1 +//!SAVE LUMAN2 + +#define L_tex LUMAN1_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = 0.1296995*a0.x + 0.58585095*b0.x + 0.32923958*c0.x + -0.029538905*d0.x + 0.12424867*e0.x + 0.06688472*f0.x + -0.024876455*g0.x + 0.081395976*h0.x + 0.07730565*i0.x; + float j = 0.0835473*a0.y + -0.0692147*b0.y + -0.07067511*c0.y + 0.019754365*d0.y + -0.24134408*e0.y + -0.23151338*f0.y + -0.019295152*g0.y + 0.100035846*h0.y + -0.016351536*i0.y; + float k = -0.050630216*a0.z + -0.033612493*b0.z + -0.19357617*c0.z + -0.07101453*d0.z + 0.17056477*e0.z + 0.060211252*f0.z + 0.0033124269*g0.z + 0.09456133*h0.z + -0.037142575*i0.z; + float l = 0.051075853*a0.w + 0.2913882*b0.w + 0.058661155*c0.w + 0.22263865*d0.w + -0.23906778*e0.w + -0.14503716*f0.w + 0.082726575*g0.w + 0.11113719*h0.w + 0.14532568*i0.w; + float m = -0.100905254*na0.x + -0.26352566*nb0.x + -0.24404018*nc0.x + 0.11224881*nd0.x + 0.51329523*ne0.x + -0.053486858*nf0.x + 0.09148782*ng0.x + 0.0037240295*nh0.x + -0.088871725*ni0.x; + float n = -0.050803714*na0.y + -0.0416797*nb0.y + -0.07453628*nc0.y + -0.23378085*nd0.y + 0.137114*ne0.y + -0.020378582*nf0.y + -0.013943721*ng0.y + -0.12330325*nh0.y + -0.1303406*ni0.y; + float o = -0.081222475*na0.z + 0.02552934*nb0.z + 0.29423392*nc0.z + -0.010700949*nd0.z + 0.44353056*ne0.z + -0.025496874*nf0.z + -0.0717391*ng0.z + 0.009533622*nh0.z + 0.12127055*ni0.z; + float p = -0.015820552*na0.w + -0.17862697*nb0.w + -0.02356494*nc0.w + -0.10123709*nd0.w + 0.39525294*ne0.w + 0.15487084*nf0.w + -0.01085165*ng0.w + -0.24515375*nh0.w + -0.06711949*ni0.w; + float o0 = i+j+k+l+m+n+o+p+-0.030414568; + i = -0.17145431*a0.x + -0.20274077*b0.x + -0.13539806*c0.x + -0.15229994*d0.x + 0.21967621*e0.x + -0.14581895*f0.x + 0.011627536*g0.x + 0.054711625*h0.x + -0.10415255*i0.x; + j = -0.032065842*a0.y + 0.01507945*b0.y + 0.014360462*c0.y + -0.07954877*d0.y + 0.4554514*e0.y + -0.02500351*f0.y + 0.09280885*g0.y + 0.08076883*h0.y + 0.012532978*i0.y; + k = -0.040672652*a0.z + -0.011551944*b0.z + 0.017042167*c0.z + -0.034443982*d0.z + 0.017515173*e0.z + -0.012364212*f0.z + 0.012219225*g0.z + -0.033760473*h0.z + -0.026314916*i0.z; + l = -0.1833554*a0.w + -0.20858614*b0.w + -0.04312281*c0.w + -0.4133038*d0.w + 0.7893293*e0.w + 0.039180417*f0.w + 0.08793949*g0.w + 0.21557106*h0.w + 0.026690673*i0.w; + m = -0.05162859*na0.x + -0.058755793*nb0.x + 0.048020624*nc0.x + 0.019536454*nd0.x + -0.4237037*ne0.x + -0.031836376*nf0.x + -0.008829477*ng0.x + -0.11413442*nh0.x + 0.1083338*ni0.x; + n = 0.13001607*na0.y + 0.14846794*nb0.y + 0.03834157*nc0.y + 0.06404169*nd0.y + -0.5548147*ne0.y + -0.002337565*nf0.y + 0.07660518*ng0.y + 0.2561992*nh0.y + 0.11988241*ni0.y; + o = 0.039745063*na0.z + -0.08055183*nb0.z + -0.1303704*nc0.z + 0.022918316*nd0.z + -0.056718633*ne0.z + 0.06251301*nf0.z + -0.024526184*ng0.z + -0.15459415*nh0.z + -0.002799402*ni0.z; + p = 0.21387257*na0.w + 0.29624957*nb0.w + 0.023706648*nc0.w + 0.3816746*nd0.w + -0.6914615*ne0.w + 0.074115634*nf0.w + -0.0032766939*ng0.w + -0.1846047*nh0.w + 0.006624912*ni0.w; + float p0 = i+j+k+l+m+n+o+p+-0.03056522; + i = -0.11029118*a0.x + 0.3337483*b0.x + 0.077408336*c0.x + -0.42610714*d0.x + -1.2206199*e0.x + 0.19516373*f0.x + -0.15404113*g0.x + -0.20634995*h0.x + 0.06588952*i0.x; + j = -0.04082908*a0.y + -0.12006161*b0.y + -0.05597222*c0.y + -0.3542818*d0.y + -0.35644907*e0.y + -0.14614798*f0.y + -0.20449866*g0.y + -0.09893636*h0.y + -0.092030644*i0.y; + k = 0.1502402*a0.z + 0.1726779*b0.z + 0.062496457*c0.z + 0.28070614*d0.z + 0.016571306*e0.z + 0.12977904*f0.z + 0.037328202*g0.z + 0.06063515*h0.z + 0.22138344*i0.z; + l = 0.2236037*a0.w + 0.0039381385*b0.w + -0.12040037*c0.w + -0.13418862*d0.w + -0.034812238*e0.w + -0.05243254*f0.w + -0.34639022*g0.w + -0.18946312*h0.w + 0.045312986*i0.w; + m = -0.30953258*na0.x + -0.8356361*nb0.x + -0.1887177*nc0.x + 0.014400998*nd0.x + -0.3064453*ne0.x + -0.11070782*nf0.x + 0.041681726*ng0.x + -0.11717862*nh0.x + -0.07595453*ni0.x; + n = -0.01094574*na0.y + -0.0011181692*nb0.y + -0.14214927*nc0.y + 0.27722216*nd0.y + 0.3271789*ne0.y + 0.049340714*nf0.y + -0.030088885*ng0.y + 0.06712784*nh0.y + -0.06951951*ni0.y; + o = 0.19824019*na0.z + 0.37815058*nb0.z + 0.28591436*nc0.z + 0.13495544*nd0.z + 0.33094874*ne0.z + 0.35384452*nf0.z + 0.30736896*ng0.z + 0.0750831*nh0.z + 0.26549867*ni0.z; + p = -0.11226634*na0.w + -0.27737*nb0.w + -0.014325423*nc0.w + 0.19669802*nd0.w + 0.1702417*ne0.w + -0.18681495*nf0.w + 0.6464465*ng0.w + 0.51191556*nh0.w + -0.11019807*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.0062645413; + i = -0.7524125*a0.x + 0.15982255*b0.x + -0.38003713*c0.x + -0.18294491*d0.x + -0.011609704*e0.x + 0.1644678*f0.x + -0.080624536*g0.x + 0.03851575*h0.x + -0.018073043*i0.x; + j = -0.20548582*a0.y + -0.087626405*b0.y + -0.24111056*c0.y + -0.20929506*d0.y + -0.05862193*e0.y + 0.21097149*f0.y + 0.37784964*g0.y + -0.3371335*h0.y + 0.21661137*i0.y; + k = -0.056834865*a0.z + 0.07880648*b0.z + 0.24440387*c0.z + 0.035857998*d0.z + -0.05498326*e0.z + -0.016055869*f0.z + -0.24461745*g0.z + -0.04416979*h0.z + -0.008112517*i0.z; + l = -0.32616344*a0.w + -0.024567882*b0.w + -0.35107398*c0.w + -1.1010243*d0.w + -0.3698656*e0.w + 0.32266977*f0.w + -0.24221507*g0.w + -0.6740687*h0.w + -0.14333092*i0.w; + m = 0.39440885*na0.x + -0.6442062*nb0.x + 0.13425396*nc0.x + 0.51738626*nd0.x + -0.67044*ne0.x + 0.15458697*nf0.x + -0.09434363*ng0.x + 0.11851308*nh0.x + -0.023352176*ni0.x; + n = 0.29104593*na0.y + 0.041593533*nb0.y + 0.11439773*nc0.y + -0.003218177*nd0.y + 0.42421842*ne0.y + 0.08495443*nf0.y + -0.3131501*ng0.y + -0.16917372*nh0.y + 0.1289088*ni0.y; + o = 0.09410875*na0.z + -0.11588178*nb0.z + 0.13947532*nc0.z + 0.23592931*nd0.z + -0.72784305*ne0.z + -0.23903714*nf0.z + 0.08198044*ng0.z + -0.25076246*nh0.z + -0.11394936*ni0.z; + p = 0.669559*na0.w + -0.025986305*nb0.w + 0.44193423*nc0.w + 1.2048185*nd0.w + 0.7560385*ne0.w + -0.4745804*nf0.w + -0.095279634*ng0.w + 0.7421271*nh0.w + -0.056005523*ni0.w; + float r0 = i+j+k+l+m+n+o+p+-0.06872939; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN2 +//!SAVE LUMAN3 + +#define L_tex LUMAN2_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = -0.06717315*a0.x + -0.18625546*b0.x + -0.18535699*c0.x + -0.25209853*d0.x + 0.04015934*e0.x + 0.26530865*f0.x + -0.04327326*g0.x + 0.086863905*h0.x + -0.10865201*i0.x; + float j = 0.31827033*a0.y + 0.22865397*b0.y + 0.028610421*c0.y + 0.6276318*d0.y + 0.22509193*e0.y + 0.1573462*f0.y + 0.10111941*g0.y + 0.1917281*h0.y + -0.14345117*i0.y; + float k = -0.22344574*a0.z + -0.22601207*b0.z + -0.011553535*c0.z + -0.181191*d0.z + -0.2725799*e0.z + 0.06439458*f0.z + 0.048038308*g0.z + 0.12983559*h0.z + -0.079764694*i0.z; + float l = -0.016861046*a0.w + -0.019494308*b0.w + -0.017669018*c0.w + -0.06530767*d0.w + 0.09395054*e0.w + 0.061136525*f0.w + -0.04735494*g0.w + 0.18924968*h0.w + -0.023836756*i0.w; + float m = -0.3547175*na0.x + 0.1358826*nb0.x + 0.07858271*nc0.x + -0.23430872*nd0.x + 0.43895817*ne0.x + -0.22928667*nf0.x + 0.032354854*ng0.x + 0.006439356*nh0.x + 0.062181197*ni0.x; + float n = -0.2425591*na0.y + 0.08514424*nb0.y + 0.22871092*nc0.y + -0.46338332*nd0.y + 0.5336361*ne0.y + -0.40562704*nf0.y + 0.01311291*ng0.y + -0.06778306*nh0.y + 0.17169508*ni0.y; + float o = 0.10230756*na0.z + -0.20127158*nb0.z + -0.07916379*nc0.z + -0.07754846*nd0.z + -0.116193995*ne0.z + 0.06341818*nf0.z + -0.00801396*ng0.z + -0.09713724*nh0.z + 0.072695844*ni0.z; + float p = 0.14998771*na0.w + 0.13864347*nb0.w + 0.068318844*nc0.w + 0.045116886*nd0.w + -0.042385302*ne0.w + -0.12741679*nf0.w + 0.12546733*ng0.w + -0.061053857*nh0.w + 0.013063541*ni0.w; + float o0 = i+j+k+l+m+n+o+p+-0.025009213; + i = 0.19007389*a0.x + -0.1583994*b0.x + 0.032637432*c0.x + -0.028661437*d0.x + 0.048821084*e0.x + 0.10179253*f0.x + -0.06565897*g0.x + 0.5590187*h0.x + 0.037958134*i0.x; + j = 0.12815921*a0.y + 0.17668153*b0.y + -0.12790684*c0.y + 0.1956624*d0.y + 0.97611785*e0.y + 0.060223907*f0.y + 0.14199442*g0.y + 0.102231756*h0.y + 0.117724344*i0.y; + k = -0.18413326*a0.z + -0.17708266*b0.z + -0.20034097*c0.z + -0.3124793*d0.z + 0.026309077*e0.z + -0.0925308*f0.z + -0.016788289*g0.z + -0.16716176*h0.z + 0.004230467*i0.z; + l = -0.038007755*a0.w + -0.008115078*b0.w + 0.07480802*c0.w + 0.04666423*d0.w + -0.10847974*e0.w + 0.12687379*f0.w + -0.07406638*g0.w + 0.15683106*h0.w + 0.071306415*i0.w; + m = -0.3524179*na0.x + -0.08746631*nb0.x + -0.055358827*nc0.x + -0.005121702*nd0.x + 0.2238154*ne0.x + 0.04734714*nf0.x + 0.38855964*ng0.x + -0.61724895*nh0.x + 0.06885853*ni0.x; + n = -0.14331289*na0.y + -0.2050787*nb0.y + 0.1991135*nc0.y + -0.46040756*nd0.y + -0.6366871*ne0.y + -0.41664663*nf0.y + -0.16958122*ng0.y + -0.3761652*nh0.y + -0.18120718*ni0.y; + o = 0.11750789*na0.z + -0.013673033*nb0.z + 0.14197573*nc0.z + 0.10468691*nd0.z + 0.0014566277*ne0.z + 0.09031144*nf0.z + 0.0037937157*ng0.z + -0.02874946*nh0.z + -0.026509108*ni0.z; + p = 0.100215666*na0.w + 0.040169634*nb0.w + 0.013164925*nc0.w + -0.118727714*nd0.w + -0.03184685*ne0.w + -0.14043786*nf0.w + 0.024457283*ng0.w + -0.15660675*nh0.w + -0.05200356*ni0.w; + float p0 = i+j+k+l+m+n+o+p+0.071153864; + i = 0.23885481*a0.x + 0.009627908*b0.x + -0.07391904*c0.x + -0.028175073*d0.x + 0.30320242*e0.x + 0.10949589*f0.x + -0.21194275*g0.x + 0.091189414*h0.x + 0.11207269*i0.x; + j = 0.02364771*a0.y + 0.24171546*b0.y + -0.085548185*c0.y + -0.13059966*d0.y + 0.7769793*e0.y + 0.1368896*f0.y + 0.019515332*g0.y + -0.2813097*h0.y + 0.12159547*i0.y; + k = 0.31217164*a0.z + 0.41959077*b0.z + 0.1990368*c0.z + 0.17852639*d0.z + 1.0253936*e0.z + 0.12014064*f0.z + 0.030470015*g0.z + 0.116894834*h0.z + 0.12033049*i0.z; + l = -0.14778642*a0.w + -0.12812881*b0.w + -0.027680345*c0.w + -0.14777774*d0.w + -0.1661101*e0.w + 0.012757367*f0.w + -0.0023989049*g0.w + -0.15380865*h0.w + 0.033649914*i0.w; + m = 0.332305*na0.x + 0.117145285*nb0.x + 0.31137946*nc0.x + 0.284246*nd0.x + 0.24726851*ne0.x + 0.17240214*nf0.x + 0.15286899*ng0.x + -0.31956202*nh0.x + 0.027743679*ni0.x; + n = -0.096838504*na0.y + -0.23554324*nb0.y + 0.05768958*nc0.y + 0.25250152*nd0.y + -0.26971808*ne0.y + -0.41672847*nf0.y + 0.1148402*ng0.y + 0.18528111*nh0.y + -0.08624775*ni0.y; + o = -0.12979779*na0.z + -0.04953356*nb0.z + 0.03002859*nc0.z + 0.06834822*nd0.z + -0.32774958*ne0.z + 0.045808665*nf0.z + -0.050698712*ng0.z + 0.044419024*nh0.z + 0.046608027*ni0.z; + p = -0.06442882*na0.w + -0.04786282*nb0.w + 0.017273132*nc0.w + 0.18142362*nd0.w + 0.07271175*ne0.w + -0.11233566*nf0.w + -0.06878901*ng0.w + -0.048930436*nh0.w + -0.1138723*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.0014894; + i = -0.19751294*a0.x + 0.25861272*b0.x + -0.0066198874*c0.x + 0.112890586*d0.x + -0.26875597*e0.x + -0.26113203*f0.x + 0.24095851*g0.x + -0.18970534*h0.x + -0.025890965*i0.x; + j = 0.019675067*a0.y + -0.07642529*b0.y + 0.159886*c0.y + -0.06923781*d0.y + -0.38018093*e0.y + -0.48206782*f0.y + -0.118144274*g0.y + 0.28994203*h0.y + -0.051686626*i0.y; + k = 0.034843404*a0.z + -0.21872765*b0.z + 0.01100473*c0.z + 0.11592991*d0.z + -0.7518377*e0.z + -0.42115083*f0.z + -0.0321754*g0.z + 0.20926285*h0.z + -0.17526312*i0.z; + l = -0.015074366*a0.w + -0.083057426*b0.w + -0.15830547*c0.w + -0.0009947944*d0.w + 0.31531596*e0.w + -0.17569509*f0.w + 0.14843346*g0.w + -0.0026129466*h0.w + 0.05092144*i0.w; + m = 0.41312754*na0.x + -0.096808426*nb0.x + 0.120561026*nc0.x + -0.003183892*nd0.x + 0.046201833*ne0.x + 0.32055348*nf0.x + -0.53987944*ng0.x + 0.43310902*nh0.x + 0.002572001*ni0.x; + n = 0.020376818*na0.y + 0.032837477*nb0.y + -0.2895329*nc0.y + 0.19988254*nd0.y + -0.28621992*ne0.y + 0.82064044*nf0.y + 0.073460415*ng0.y + -0.029826678*nh0.y + 0.07131397*ni0.y; + o = -0.039654482*na0.z + 0.10681176*nb0.z + -0.22279368*nc0.z + -0.037715416*nd0.z + 0.1909092*ne0.z + 0.030304825*nf0.z + -0.02703714*ng0.z + -0.046335116*nh0.z + 0.05017316*ni0.z; + p = -0.041754566*na0.w + 0.06949629*nb0.w + 0.082980104*nc0.w + 0.056356948*nd0.w + -0.17428519*ne0.w + 0.21060298*nf0.w + -0.07780234*ng0.w + 0.07410131*nh0.w + -0.025585834*ni0.w; + float r0 = i+j+k+l+m+n+o+p+-0.0040146387; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN3 +//!SAVE LUMAN4 + +#define L_tex LUMAN3_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = -0.13935597*a0.x + -0.11091113*b0.x + -0.03688676*c0.x + 0.28064582*d0.x + 0.19852728*e0.x + 0.0315579*f0.x + -0.17065585*g0.x + -0.2283964*h0.x + 0.14495629*i0.x; + float j = -0.16179775*a0.y + 0.16048649*b0.y + -0.370548*c0.y + -0.35172173*d0.y + 0.48003772*e0.y + -0.105164304*f0.y + 0.093682155*g0.y + -0.3915796*h0.y + -0.26049125*i0.y; + float k = -0.19633873*a0.z + -0.21336922*b0.z + 0.013648553*c0.z + 0.39576057*d0.z + -0.29565853*e0.z + -0.011219808*f0.z + -0.0716942*g0.z + -0.19690439*h0.z + -0.09431168*i0.z; + float l = -0.05934762*a0.w + 0.08727595*b0.w + 0.12611376*c0.w + 0.14969496*d0.w + 0.72159785*e0.w + 0.122124545*f0.w + 0.21124533*g0.w + -0.12930311*h0.w + 0.253542*i0.w; + float m = 0.12843879*na0.x + -0.020566197*nb0.x + -0.0660588*nc0.x + -0.66884834*nd0.x + 0.06484056*ne0.x + 0.023970712*nf0.x + 0.23006171*ng0.x + 0.33466932*nh0.x + -0.29759154*ni0.x; + float n = 0.059693146*na0.y + -0.045831673*nb0.y + 0.05568022*nc0.y + 0.084064946*nd0.y + -0.97029793*ne0.y + -0.013524799*nf0.y + -0.18485625*ng0.y + -0.12563172*nh0.y + -0.047100443*ni0.y; + float o = 0.13252054*na0.z + 0.25632593*nb0.z + -0.20554997*nc0.z + 0.13906007*nd0.z + 0.3876675*ne0.z + 0.05157098*nf0.z + 0.01824493*ng0.z + 0.3791039*nh0.z + -0.24203013*ni0.z; + float p = 0.42681953*na0.w + 0.37215272*nb0.w + 0.14401126*nc0.w + 0.22729643*nd0.w + -0.4240743*ne0.w + 0.01858027*nf0.w + 0.05341485*ng0.w + 0.27715722*nh0.w + -0.05586885*ni0.w; + float o0 = i+j+k+l+m+n+o+p+-0.101345845; + i = 0.06435059*a0.x + -0.05780327*b0.x + -0.13576104*c0.x + 0.10006792*d0.x + 0.06577253*e0.x + 0.2616236*f0.x + -0.116230436*g0.x + -0.12689975*h0.x + 0.13806346*i0.x; + j = 0.047965724*a0.y + 0.46820837*b0.y + 0.27155674*c0.y + 0.02126596*d0.y + -0.67418236*e0.y + 0.04438237*f0.y + 0.027345048*g0.y + -0.07970538*h0.y + -0.078592815*i0.y; + k = 0.13051371*a0.z + 0.039749797*b0.z + 0.080169655*c0.z + 0.117129445*d0.z + 0.066928*e0.z + -0.09933843*f0.z + -0.10919095*g0.z + -0.019560996*h0.z + -0.112840146*i0.z; + l = 0.08679252*a0.w + 0.21411163*b0.w + -0.028519686*c0.w + 0.18093598*d0.w + -0.7020097*e0.w + 0.023516914*f0.w + -0.020827917*g0.w + 0.015421594*h0.w + 0.009241537*i0.w; + m = -0.077041484*na0.x + 0.059386946*nb0.x + 0.13958155*nc0.x + -0.19068196*nd0.x + -0.28006217*ne0.x + -0.41987765*nf0.x + 0.12358269*ng0.x + -0.014031638*nh0.x + 0.006307132*ni0.x; + n = -0.035933975*na0.y + -0.3855368*nb0.y + -0.18497427*nc0.y + -0.040697515*nd0.y + 0.7990711*ne0.y + -0.08418051*nf0.y + 0.034800954*ng0.y + 0.012859377*nh0.y + 0.076540396*ni0.y; + o = -0.09628029*na0.z + -0.0017863213*nb0.z + -0.016388003*nc0.z + 0.13073064*nd0.z + 0.35412386*ne0.z + 0.33087295*nf0.z + -0.002519779*ng0.z + -0.050436858*nh0.z + 0.06708438*ni0.z; + p = -0.047076955*na0.w + -0.1717576*nb0.w + 0.06098623*nc0.w + -0.04829171*nd0.w + 0.97778696*ne0.w + 0.0683018*nf0.w + 0.0480603*ng0.w + -0.115571074*nh0.w + -0.0324209*ni0.w; + float p0 = i+j+k+l+m+n+o+p+0.03690847; + i = -0.04003973*a0.x + 0.08684451*b0.x + 0.056973178*c0.x + 0.12580861*d0.x + -0.70770407*e0.x + -0.26232213*f0.x + -0.14605756*g0.x + 0.2185047*h0.x + 0.16081442*i0.x; + j = 0.22752708*a0.y + 0.14125547*b0.y + 0.21185426*c0.y + 0.20745178*d0.y + 1.6950947*e0.y + 0.32192886*f0.y + -0.010275441*g0.y + 0.20508891*h0.y + 0.23286316*i0.y; + k = 0.026558029*a0.z + 0.27036312*b0.z + 0.06793841*c0.z + 0.021423433*d0.z + 0.1314685*e0.z + 0.046734232*f0.z + -0.11433229*g0.z + 0.21536611*h0.z + -0.0028018088*i0.z; + l = 0.19790274*a0.w + 0.08455251*b0.w + -0.042842302*c0.w + 0.06765321*d0.w + 0.80784225*e0.w + 0.17140552*f0.w + -0.036292873*g0.w + 0.1945151*h0.w + 0.029864661*i0.w; + m = 0.019306317*na0.x + -0.08108237*nb0.x + -0.060932275*nc0.x + -0.07590298*nd0.x + 0.36097065*ne0.x + -0.49187797*nf0.x + 0.042565785*ng0.x + -0.18200454*nh0.x + -0.042538855*ni0.x; + n = -0.1909921*na0.y + -0.24054891*nb0.y + -0.2331106*nc0.y + 0.06388691*nd0.y + -1.3733596*ne0.y + -0.3168477*nf0.y + -0.018475877*ng0.y + -0.27689803*nh0.y + -0.17154175*ni0.y; + o = 0.03147376*na0.z + -0.07079819*nb0.z + 0.037092578*nc0.z + 0.059319854*nd0.z + 0.058872327*ne0.z + -0.2145504*nf0.z + 0.16398452*ng0.z + 0.0017471232*nh0.z + 0.26451096*ni0.z; + p = -0.19085382*na0.w + -0.18272428*nb0.w + -0.02961356*nc0.w + 0.07483331*nd0.w + -0.53736925*ne0.w + -0.031511623*nf0.w + 0.09394558*ng0.w + -0.38817772*nh0.w + -0.17405929*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.19037424; + i = 0.080417514*a0.x + 0.014180711*b0.x + 0.11582896*c0.x + -0.016692005*d0.x + -0.17195204*e0.x + -0.011422261*f0.x + 0.03137781*g0.x + 0.3729293*h0.x + -0.09650351*i0.x; + j = 0.43793023*a0.y + -0.5691589*b0.y + 0.25009406*c0.y + 0.36788806*d0.y + 1.1486416*e0.y + -0.11426902*f0.y + -0.10744571*g0.y + 0.5247666*h0.y + 0.26761994*i0.y; + k = 0.19873822*a0.z + 0.3752259*b0.z + -0.13712035*c0.z + -0.24905545*d0.z + 0.6611504*e0.z + 0.10681574*f0.z + -0.04248269*g0.z + 0.34954542*h0.z + 0.00978403*i0.z; + l = 0.34088975*a0.w + -0.3931476*b0.w + -0.1533515*c0.w + -0.10607013*d0.w + 0.06654374*e0.w + -0.07201185*f0.w + -0.29845902*g0.w + 0.25622308*h0.w + -0.31139874*i0.w; + m = -0.078585304*na0.x + 0.036581147*nb0.x + -0.13068384*nc0.x + 0.3932218*nd0.x + 0.0708958*ne0.x + -0.12966925*nf0.x + -0.109731354*ng0.x + -0.31248894*nh0.x + 0.37464958*ni0.x; + n = -0.41372105*na0.y + 0.32846758*nb0.y + -0.060158603*nc0.y + -0.128198*nd0.y + -0.18438801*ne0.y + 0.18057844*nf0.y + 0.16595858*ng0.y + -0.16415259*nh0.y + 0.0032799111*ni0.y; + o = -0.06727605*na0.z + -0.24573149*nb0.z + 0.230882*nc0.z + -0.1278132*nd0.z + -0.8236421*ne0.z + -0.05967563*nf0.z + 0.14988032*ng0.z + -0.2628639*nh0.z + 0.22783533*ni0.z; + p = -0.7405207*na0.w + 0.008293306*nb0.w + -0.044343967*nc0.w + -0.30809087*nd0.w + -0.5533927*ne0.w + -0.062474877*nf0.w + 0.11649958*ng0.w + -0.5585487*nh0.w + 0.07918267*ni0.w; + float r0 = i+j+k+l+m+n+o+p+0.03127807; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN4 +//!SAVE LUMAN5 + +#define L_tex LUMAN4_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = -0.09597852*a0.x + 0.3242088*b0.x + -0.124179676*c0.x + 0.226565*d0.x + -0.31539622*e0.x + 0.10865023*f0.x + 0.012854597*g0.x + 0.18704954*h0.x + 0.019613743*i0.x; + float j = -0.2956743*a0.y + 0.45493945*b0.y + -0.07076282*c0.y + -0.30141243*d0.y + 0.174262*e0.y + -0.02470263*f0.y + 0.08572248*g0.y + -0.019336598*h0.y + 0.09933937*i0.y; + float k = 0.07753791*a0.z + -0.3395634*b0.z + 0.19251195*c0.z + -0.10877227*d0.z + -0.014677417*e0.z + -0.110752806*f0.z + -0.022234734*g0.z + 0.0043019606*h0.z + -0.00083276356*i0.z; + float l = -0.037600517*a0.w + 0.124577194*b0.w + -0.28245094*c0.w + 0.09897185*d0.w + -0.56897277*e0.w + 0.016489267*f0.w + 0.07564196*g0.w + 0.14769527*h0.w + 0.044005074*i0.w; + float m = 0.00643241*na0.x + -0.32315695*nb0.x + 0.11598279*nc0.x + -0.20983832*nd0.x + 0.258951*ne0.x + -0.025683874*nf0.x + -0.0635544*ng0.x + -0.2206535*nh0.x + -0.10333466*ni0.x; + float n = 0.21132493*na0.y + -0.3065043*nb0.y + 0.17681308*nc0.y + 0.2733732*nd0.y + -0.08235636*ne0.y + -0.10921411*nf0.y + -0.11584987*ng0.y + -0.024039356*nh0.y + -0.062137943*ni0.y; + float o = -0.059854202*na0.z + 0.18879688*nb0.z + -0.123816796*nc0.z + 0.25184757*nd0.z + -0.32263234*ne0.z + 0.15706868*nf0.z + 0.02998877*ng0.z + 0.053161293*nh0.z + -0.0017673605*ni0.z; + float p = 0.05801878*na0.w + -0.042743735*nb0.w + 0.026558312*nc0.w + -0.04256158*nd0.w + 0.4289233*ne0.w + -0.0007625228*nf0.w + -0.038216792*ng0.w + -0.116650924*nh0.w + 0.06503088*ni0.w; + float o0 = i+j+k+l+m+n+o+p+-0.0019418459; + i = 0.054116286*a0.x + 0.010684147*b0.x + 0.082293995*c0.x + -0.032138538*d0.x + 0.36239687*e0.x + -0.012221512*f0.x + 0.044298165*g0.x + -0.014412877*h0.x + -0.0063282046*i0.x; + j = 0.11786986*a0.y + -0.011583431*b0.y + 0.12155917*c0.y + 0.12135634*d0.y + -0.3782435*e0.y + 0.104112595*f0.y + 0.1437231*g0.y + -0.011320157*h0.y + 0.060530275*i0.y; + k = -0.003993353*a0.z + 0.022192514*b0.z + -0.0034327002*c0.z + 0.002901846*d0.z + 0.42262754*e0.z + -0.0020970134*f0.z + 0.022101413*g0.z + -0.031948846*h0.z + 0.1050437*i0.z; + l = 0.015842827*a0.w + 0.0798861*b0.w + 0.08568371*c0.w + 0.04673564*d0.w + 0.094226986*e0.w + 0.06733949*f0.w + -0.0060305153*g0.w + 0.15045756*h0.w + -0.03379621*i0.w; + m = -0.06038104*na0.x + -0.034142923*nb0.x + -0.05546382*nc0.x + -0.018901724*nd0.x + -0.18012096*ne0.x + -0.00062798214*nf0.x + 0.009348149*ng0.x + -0.014474368*nh0.x + 0.04329652*ni0.x; + n = -0.059717417*na0.y + 0.119962394*nb0.y + -0.064958826*nc0.y + -0.11596286*nd0.y + 0.39725938*ne0.y + -0.114478305*nf0.y + -0.018322872*ng0.y + -0.006377172*nh0.y + 0.06362352*ni0.y; + o = 0.0054720687*na0.z + -0.030189699*nb0.z + -0.015235566*nc0.z + -0.03068064*nd0.z + -0.11610397*ne0.z + -0.03191193*nf0.z + -0.0356475*ng0.z + 0.030068565*nh0.z + -0.050685633*ni0.z; + p = -0.046274967*na0.w + -0.099142164*nb0.w + -0.085632615*nc0.w + -0.038272157*nd0.w + -0.19368412*ne0.w + 0.0003223275*nf0.w + -0.085437156*ng0.w + -0.12736909*nh0.w + -0.05320479*ni0.w; + float p0 = i+j+k+l+m+n+o+p+0.078778625; + i = 0.08257098*a0.x + -0.0022579352*b0.x + -0.012156828*c0.x + 0.072632305*d0.x + -0.6072154*e0.x + -0.17004661*f0.x + 0.016802631*g0.x + -0.22717783*h0.x + -0.061564326*i0.x; + j = 0.045760617*a0.y + 0.061521515*b0.y + -0.029007988*c0.y + 0.015811957*d0.y + 0.11330114*e0.y + 0.009119976*f0.y + -0.16409592*g0.y + 0.029125696*h0.y + -0.35173532*i0.y; + k = -0.045531336*a0.z + -0.017925687*b0.z + -0.104570106*c0.z + 0.103260145*d0.z + 0.085039206*e0.z + 0.06908408*f0.z + -0.07742414*g0.z + 0.33436036*h0.z + -0.078238*i0.z; + l = 0.012518328*a0.w + -0.043969885*b0.w + 0.0506132*c0.w + -0.17977312*d0.w + -0.1145595*e0.w + -0.1745484*f0.w + 0.20776495*g0.w + -0.56244034*h0.w + -0.07415478*i0.w; + m = -0.0675551*na0.x + 0.05070468*nb0.x + 0.08408123*nc0.x + 0.10902953*nd0.x + 0.26186886*ne0.x + 0.16379848*nf0.x + -0.005975606*ng0.x + 0.40121752*nh0.x + 0.1860966*ni0.x; + n = -0.034864623*na0.y + -0.015901396*nb0.y + -0.056751534*nc0.y + 0.224934*nd0.y + -0.06753463*ne0.y + 0.051636614*nf0.y + 0.18318632*ng0.y + 0.53643245*nh0.y + 0.6492825*ni0.y; + o = -0.03634967*na0.z + -0.0062806685*nb0.z + 0.06752919*nc0.z + -0.04426068*nd0.z + -0.25008643*ne0.z + -0.08242178*nf0.z + 0.06756477*ng0.z + -0.2764806*nh0.z + 0.03919717*ni0.z; + p = 0.10824321*na0.w + 0.0719615*nb0.w + 0.022836633*nc0.w + 0.032870874*nd0.w + 0.07953821*ne0.w + 0.20360455*nf0.w + -0.09071379*ng0.w + 0.15641631*nh0.w + 0.108754955*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.0703419; + i = 0.054530073*a0.x + -0.35720757*b0.x + 0.09167906*c0.x + 0.39694676*d0.x + 0.26749727*e0.x + 0.28771624*f0.x + 0.5681281*g0.x + -0.23950431*h0.x + -0.102100216*i0.x; + j = -0.5799231*a0.y + -0.90738946*b0.y + 0.4949409*c0.y + -0.04932236*d0.y + 0.7942325*e0.y + 0.35240924*f0.y + 0.2044775*g0.y + 0.6994759*h0.y + 0.019353973*i0.y; + k = 0.3347879*a0.z + 0.5091003*b0.z + -0.17031951*c0.z + 0.123048164*d0.z + 0.64878803*e0.z + -0.36329588*f0.z + -0.46817833*g0.z + 0.2079882*h0.z + -0.05412046*i0.z; + l = -0.6893422*a0.w + -0.2170392*b0.w + 0.027153356*c0.w + 0.7168854*d0.w + -0.26940683*e0.w + -0.58671874*f0.w + 0.23477685*g0.w + -0.26849586*h0.w + 0.30201417*i0.w; + m = 0.78675926*na0.x + 0.29757124*nb0.x + -0.20282929*nc0.x + -1.0505095*nd0.x + 0.58935297*ne0.x + -0.10334289*nf0.x + -0.2843835*ng0.x + 0.059788395*nh0.x + 0.011678273*ni0.x; + n = 0.34996793*na0.y + 0.24947307*nb0.y + -0.29364213*nc0.y + 0.20136362*nd0.y + -0.2727407*ne0.y + -0.43054128*nf0.y + -0.32888436*ng0.y + -0.7454652*nh0.y + 0.4059068*ni0.y; + o = -0.07356504*na0.z + -0.35029906*nb0.z + 0.09862612*nc0.z + 0.06451627*nd0.z + 0.15965298*ne0.z + 0.043233983*nf0.z + 0.29421222*ng0.z + -0.38419172*nh0.z + -0.05866892*ni0.z; + p = 0.3664988*na0.w + 0.3596013*nb0.w + -0.12897122*nc0.w + 0.14208052*nd0.w + 0.089192405*ne0.w + 0.27535722*nf0.w + -0.3438804*ng0.w + -0.079981126*nh0.w + 0.045426715*ni0.w; + float r0 = i+j+k+l+m+n+o+p+0.1524787; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN5 +//!SAVE LUMAN6 + +#define L_tex LUMAN5_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = 0.04046324*a0.x + 0.014735389*b0.x + -0.0002682781*c0.x + -0.039319854*d0.x + 0.22058657*e0.x + 0.07695267*f0.x + 0.077418946*g0.x + 0.13325845*h0.x + 0.038691103*i0.x; + float j = 0.040963832*a0.y + 0.105689086*b0.y + 0.033340584*c0.y + 0.1200134*d0.y + 1.2192141*e0.y + 0.18370426*f0.y + 0.03399801*g0.y + 0.13453613*h0.y + -0.009928808*i0.y; + float k = 0.08902621*a0.z + -0.085483715*b0.z + 0.052993882*c0.z + -0.10525024*d0.z + 0.0610996*e0.z + -0.026467444*f0.z + 0.018025948*g0.z + -0.00589767*h0.z + 0.024196783*i0.z; + float l = 0.009467872*a0.w + -0.015330612*b0.w + 0.0030996029*c0.w + -0.0076471744*d0.w + -0.020749047*e0.w + 0.022791933*f0.w + -0.016549883*g0.w + 0.019890876*h0.w + -0.0010098215*i0.w; + float m = -0.02717888*na0.x + 0.0036335315*nb0.x + -0.019823067*nc0.x + 0.004060834*nd0.x + 0.022675946*ne0.x + -0.03507232*nf0.x + -0.0029503133*ng0.x + -0.025005482*nh0.x + -0.01091259*ni0.x; + float n = -0.030934187*na0.y + -0.03229802*nb0.y + -0.0065935743*nc0.y + 0.025710566*nd0.y + -0.8996815*ne0.y + -0.1178852*nf0.y + 0.0017351187*ng0.y + -0.013789157*nh0.y + -0.019477608*ni0.y; + float o = 0.013771308*na0.z + 0.06256136*nb0.z + -0.027475204*nc0.z + -0.0023379435*nd0.z + -0.0824879*ne0.z + -0.013148455*nf0.z + -0.013476471*ng0.z + 0.036603387*nh0.z + 0.04276819*ni0.z; + float p = -0.0052243336*na0.w + 0.0011435063*nb0.w + -0.010922929*nc0.w + 0.012664938*nd0.w + -0.13092975*ne0.w + -0.03561616*nf0.w + 0.012207904*ng0.w + -0.007603144*nh0.w + -0.055635393*ni0.w; + float o0 = i+j+k+l+m+n+o+p+0.0048964093; + i = -0.39574856*a0.x + -0.1648057*b0.x + 0.048852682*c0.x + -0.8832539*d0.x + -1.3857893*e0.x + 0.10910333*f0.x + 0.24659039*g0.x + -0.83078027*h0.x + -0.20966282*i0.x; + j = -0.4591745*a0.y + -0.29594332*b0.y + 0.11969786*c0.y + 0.55155253*d0.y + -0.6095633*e0.y + -0.01989395*f0.y + -0.087100305*g0.y + 0.21315934*h0.y + -0.24447405*i0.y; + k = -0.18299514*a0.z + 0.09148732*b0.z + 0.074729174*c0.z + 0.01451769*d0.z + -0.16411151*e0.z + -0.046350308*f0.z + -0.08558227*g0.z + 0.26311517*h0.z + -0.13392153*i0.z; + l = -0.0327498*a0.w + 0.07924664*b0.w + 0.020369893*c0.w + 0.00036012995*d0.w + 0.18644504*e0.w + 0.021062836*f0.w + -0.0047752066*g0.w + -0.019535767*h0.w + 0.009709619*i0.w; + m = 0.13288204*na0.x + 0.029656962*nb0.x + 0.07311512*nc0.x + 0.14313999*nd0.x + 0.56644523*ne0.x + 0.14797804*nf0.x + 0.12596226*ng0.x + 0.22742471*nh0.x + 0.089742064*ni0.x; + n = 0.1892585*na0.y + 0.023231648*nb0.y + -0.18776754*nc0.y + -0.7594511*nd0.y + 0.8324623*ne0.y + 0.015639866*nf0.y + 0.13374005*ng0.y + -0.32821357*nh0.y + 0.11980797*ni0.y; + o = 0.50891566*na0.z + -0.061541505*nb0.z + -0.22972333*nc0.z + 0.21540114*nd0.z + -0.18484059*ne0.z + -0.025804685*nf0.z + 0.0028910888*ng0.z + -0.1935325*nh0.z + 0.31634408*ni0.z; + p = 0.0014322877*na0.w + -0.015277725*nb0.w + 0.0017917431*nc0.w + 0.1006944*nd0.w + 0.18176948*ne0.w + 0.014831943*nf0.w + 0.1483141*ng0.w + 0.081011966*nh0.w + 0.09606741*ni0.w; + float p0 = i+j+k+l+m+n+o+p+-0.07033543; + i = 0.46537486*a0.x + 0.35346523*b0.x + -0.034309685*c0.x + -0.43613064*d0.x + -0.8117452*e0.x + -0.14820647*f0.x + -0.36851904*g0.x + 0.36691928*h0.x + 0.09633467*i0.x; + j = 0.03274515*a0.y + 0.12292336*b0.y + -0.1621055*c0.y + -0.37666368*d0.y + 0.9280238*e0.y + 0.03958912*f0.y + 0.17052563*g0.y + 0.09307256*h0.y + -0.11879444*i0.y; + k = 0.011698497*a0.z + -0.19269797*b0.z + -0.16302618*c0.z + 0.037150856*d0.z + -0.16392735*e0.z + -0.12373209*f0.z + -0.18614432*g0.z + -0.12011694*h0.z + 0.09273491*i0.z; + l = -0.046311308*a0.w + 0.04476493*b0.w + -0.041215967*c0.w + 0.018216522*d0.w + 0.11473393*e0.w + -0.10053504*f0.w + -0.060967118*g0.w + -0.03618437*h0.w + 0.001688976*i0.w; + m = -0.24747224*na0.x + -0.0076296516*nb0.x + 0.1111047*nc0.x + 0.3819905*nd0.x + 0.3970804*ne0.x + 0.3104748*nf0.x + -0.051673863*ng0.x + -0.049815454*nh0.x + -0.12487531*ni0.x; + n = -0.13329297*na0.y + -0.06950387*nb0.y + -0.1768481*nc0.y + 0.21811922*nd0.y + 0.378857*ne0.y + -0.21782632*nf0.y + -0.116539694*ng0.y + 0.17979085*nh0.y + 0.18095481*ni0.y; + o = 0.43092886*na0.z + 0.4126806*nb0.z + 0.40301523*nc0.z + 0.4705472*nd0.z + 0.57200426*ne0.z + 0.60878164*nf0.z + -0.06799496*ng0.z + 0.10386602*nh0.z + -0.18540111*ni0.z; + p = 0.041190043*na0.w + 0.14185017*nb0.w + 0.09648255*nc0.w + 0.09766787*nd0.w + -0.37151045*ne0.w + -0.03486635*nf0.w + 0.14197278*ng0.w + 0.29088745*nh0.w + 0.16969803*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.16171035; + i = 0.4303196*a0.x + 0.064631134*b0.x + -0.039682325*c0.x + 0.25032383*d0.x + -0.7347892*e0.x + 0.26412666*f0.x + -0.08636694*g0.x + -0.40137205*h0.x + 0.052083053*i0.x; + j = 0.2614006*a0.y + 0.14647369*b0.y + -0.014280629*c0.y + -0.6632378*d0.y + -1.3091056*e0.y + 0.00048285414*f0.y + 0.33573303*g0.y + 0.9322179*h0.y + 0.25560188*i0.y; + k = 0.30360696*a0.z + 0.21467467*b0.z + -0.044186305*c0.z + -0.3108944*d0.z + -0.7687483*e0.z + -0.053097602*f0.z + 0.073559746*g0.z + -0.05820314*h0.z + -0.06039339*i0.z; + l = 0.012419113*a0.w + -0.041542303*b0.w + -0.0030724593*c0.w + 0.10136853*d0.w + -0.059104513*e0.w + -0.029450646*f0.w + 0.0037148865*g0.w + 0.026545389*h0.w + 0.023753045*i0.w; + m = -0.27366745*na0.x + 0.026242163*nb0.x + 0.10695166*nc0.x + 0.024651896*nd0.x + -0.067803666*ne0.x + 0.21709773*nf0.x + 0.17141151*ng0.x + 0.39313924*nh0.x + 0.05491188*ni0.x; + n = -0.24999681*na0.y + -0.0149813965*nb0.y + -0.11390382*nc0.y + 0.38644975*nd0.y + 1.091798*ne0.y + 0.049615655*nf0.y + -0.3450869*ng0.y + -0.66309226*nh0.y + -0.18472806*ni0.y; + o = 0.22231762*na0.z + 0.17065015*nb0.z + 0.15852334*nc0.z + 0.2802539*nd0.z + 1.3999426*ne0.z + -0.07246133*nf0.z + 0.20702864*ng0.z + 0.39279854*nh0.z + 0.2664954*ni0.z; + p = 0.004953836*na0.w + 0.13166036*nb0.w + 0.039747827*nc0.w + -0.092738666*nd0.w + -0.16943815*ne0.w + -0.07694382*nf0.w + -0.15704772*ng0.w + 0.00020125543*nh0.w + -0.0033851033*ni0.w; + float r0 = i+j+k+l+m+n+o+p+-0.19337739; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN6 +//!SAVE LUMAN7 + +#define L_tex LUMAN6_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = -0.027537398*a0.x + -0.03832216*b0.x + -0.1591863*c0.x + -0.26930097*d0.x + 1.496357*e0.x + -0.732409*f0.x + -0.08807835*g0.x + -0.3267168*h0.x + -0.027697973*i0.x; + float j = 0.045650784*a0.y + 0.07423937*b0.y + -0.28104565*c0.y + -0.16404267*d0.y + -0.27688447*e0.y + 0.1753845*f0.y + 0.08667494*g0.y + -0.24310407*h0.y + -0.2387649*i0.y; + float k = 0.011307029*a0.z + -0.15920246*b0.z + 0.1749019*c0.z + 0.0864728*d0.z + 0.32644588*e0.z + -0.021537697*f0.z + 0.052467912*g0.z + 0.04679955*h0.z + 0.047825363*i0.z; + float l = -0.022269413*a0.w + 0.33980212*b0.w + 0.16864336*c0.w + 0.082288966*d0.w + -0.06350156*e0.w + 0.13752197*f0.w + 0.042304493*g0.w + 0.15443622*h0.w + 0.046571467*i0.w; + float m = 0.0038585584*na0.x + -0.036202244*nb0.x + -0.29005575*nc0.x + -0.06418919*nd0.x + -1.419668*ne0.x + 0.14456362*nf0.x + -0.005725012*ng0.x + 0.5045954*nh0.x + 0.11732795*ni0.x; + float n = -0.16101104*na0.y + -0.02420836*nb0.y + 0.13611177*nc0.y + 0.029370116*nd0.y + 1.1994928*ne0.y + -0.15178941*nf0.y + 0.0090092765*ng0.y + -0.20478143*nh0.y + -0.17148101*ni0.y; + float o = -0.053002063*na0.z + -0.035893742*nb0.z + -0.110651344*nc0.z + -0.37151214*nd0.z + -0.9576195*ne0.z + -0.46538743*nf0.z + 0.17428482*ng0.z + 0.25815699*nh0.z + 0.14889659*ni0.z; + float p = -0.2277235*na0.w + -0.6884181*nb0.w + -0.63734025*nc0.w + -0.13596478*nd0.w + -0.55789053*ne0.w + -0.3439862*nf0.w + -0.059143618*ng0.w + 0.030058485*nh0.w + 0.10810205*ni0.w; + float o0 = i+j+k+l+m+n+o+p+0.39991605; + i = -0.28546834*a0.x + 0.06982972*b0.x + 0.36571932*c0.x + 0.025255322*d0.x + 0.4913122*e0.x + -0.54014283*f0.x + -0.04262618*g0.x + -0.014767507*h0.x + 0.1157787*i0.x; + j = -0.033387233*a0.y + 0.1438295*b0.y + 0.043908857*c0.y + 0.23875113*d0.y + 0.23944983*e0.y + 0.38140768*f0.y + 0.10405573*g0.y + -0.28033695*h0.y + 0.19296218*i0.y; + k = 0.0795919*a0.z + -0.009298124*b0.z + -0.1966298*c0.z + -0.10623091*d0.z + -0.13389623*e0.z + -0.20906673*f0.z + 0.012903121*g0.z + 0.13463002*h0.z + 0.0069053117*i0.z; + l = 0.07620989*a0.w + 0.444145*b0.w + 0.21698916*c0.w + -0.059253845*d0.w + 0.33355483*e0.w + 0.25932938*f0.w + -0.13568759*g0.w + -0.12767054*h0.w + -0.051579196*i0.w; + m = 0.10081049*na0.x + -0.34150627*nb0.x + -0.035512667*nc0.x + -0.29685998*nd0.x + 1.7315077*ne0.x + 0.28415534*nf0.x + 0.0022732737*ng0.x + -0.61264104*nh0.x + -0.16202453*ni0.x; + n = 0.062643774*na0.y + 0.2885083*nb0.y + -0.027835878*nc0.y + -0.029790701*nd0.y + -0.5481254*ne0.y + -0.2478993*nf0.y + -0.033092864*ng0.y + 0.33226776*nh0.y + 0.22110416*ni0.y; + o = -0.26636478*na0.z + -0.10020174*nb0.z + 0.24355102*nc0.z + -0.15196387*nd0.z + 0.25725785*ne0.z + -0.105960734*nf0.z + -0.053724907*ng0.z + -0.61655164*nh0.z + -0.3888296*ni0.z; + p = 0.05319454*na0.w + -0.3448596*nb0.w + 0.02398366*nc0.w + 0.17685084*nd0.w + 0.088528976*ne0.w + -0.006480539*nf0.w + 0.22043355*ng0.w + -0.11913634*nh0.w + -0.24229069*ni0.w; + float p0 = i+j+k+l+m+n+o+p+0.0698082; + i = -0.29397583*a0.x + 0.1783425*b0.x + -0.016915536*c0.x + 0.18143447*d0.x + 0.050463*e0.x + -0.5750633*f0.x + -0.09805144*g0.x + -0.23439899*h0.x + 0.014174429*i0.x; + j = 0.030622737*a0.y + 0.09131598*b0.y + -0.27484027*c0.y + -0.042807933*d0.y + -0.49584112*e0.y + 0.47780067*f0.y + 0.07179059*g0.y + -0.21984039*h0.y + -0.25448912*i0.y; + k = 0.064491056*a0.z + -0.04929943*b0.z + 0.03411262*c0.z + 0.02332043*d0.z + 0.259224*e0.z + -0.16006759*f0.z + 0.052105837*g0.z + 0.15662266*h0.z + 0.05741607*i0.z; + l = 0.03419898*a0.w + 0.27976283*b0.w + 0.19813572*c0.w + -0.03766979*d0.w + -0.0044533233*e0.w + 0.2983032*f0.w + -0.07778916*g0.w + 0.10094576*h0.w + 0.060812432*i0.w; + m = 0.12805411*na0.x + -0.51367366*nb0.x + 0.008197258*nc0.x + -0.56395197*nd0.x + -1.243085*ne0.x + 0.116005324*nf0.x + 0.03238612*ng0.x + 0.26990584*nh0.x + 0.06575366*ni0.x; + n = -0.19594547*na0.y + 0.22430868*nb0.y + 0.057090167*nc0.y + 0.122728884*nd0.y + 0.5113698*ne0.y + -0.25419077*nf0.y + -0.009283693*ng0.y + -0.12308158*nh0.y + -0.11459907*ni0.y; + o = -0.2136807*na0.z + -0.1401248*nb0.z + 0.06467563*nc0.z + -0.31790277*nd0.z + -0.92976284*ne0.z + -0.44703412*nf0.z + 0.08179573*ng0.z + 0.007016923*nh0.z + 0.06663411*ni0.z; + p = -0.18492955*na0.w + -0.6510635*nb0.w + -0.50176597*nc0.w + 0.070071384*nd0.w + -0.33312446*ne0.w + -0.40393078*nf0.w + 0.025449356*ng0.w + 0.0062464178*nh0.w + -0.0042728786*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.14438835; + i = -0.084957816*a0.x + 0.21759176*b0.x + -0.12676741*c0.x + -0.17032051*d0.x + 0.21418823*e0.x + 0.0516223*f0.x + -0.05529637*g0.x + 0.17844404*h0.x + -0.04393412*i0.x; + j = -0.09776986*a0.y + 0.29587868*b0.y + -0.17895019*c0.y + 0.23705244*d0.y + -0.23508924*e0.y + 0.23233664*f0.y + 0.11280542*g0.y + -0.10736791*h0.y + -7.6242926e-05*i0.y; + k = 0.008180588*a0.z + -0.21015471*b0.z + 0.08178927*c0.z + -0.051615402*d0.z + -0.18805277*e0.z + 0.07897466*f0.z + -0.054359443*g0.z + -0.011516885*h0.z + -0.0064640474*i0.z; + l = -0.120380774*a0.w + 0.6387797*b0.w + -0.18016112*c0.w + 0.040899348*d0.w + 0.1949798*e0.w + -0.082700744*f0.w + -0.018996445*g0.w + -0.109704494*h0.w + -0.00053294667*i0.w; + m = 0.08493739*na0.x + 0.023677751*nb0.x + -0.050535593*nc0.x + 0.36929327*nd0.x + 0.21340472*ne0.x + -0.32169485*nf0.x + 0.11782148*ng0.x + -0.09112837*nh0.x + -0.018984098*ni0.x; + n = -0.023597453*na0.y + 0.024977108*nb0.y + -0.027003283*nc0.y + -0.1414026*nd0.y + 0.099894576*ne0.y + 0.03973678*nf0.y + 0.0010171765*ng0.y + 0.051153578*nh0.y + -0.0027343174*ni0.y; + o = -0.13675037*na0.z + 0.2364966*nb0.z + -0.08819653*nc0.z + 0.17875879*nd0.z + 0.18237808*ne0.z + -0.14008285*nf0.z + 0.092474155*ng0.z + -0.07054796*nh0.z + -0.08649826*ni0.z; + p = 0.09751934*na0.w + -0.28854543*nb0.w + 0.081181064*nc0.w + -0.016613048*nd0.w + -0.0985543*ne0.w + 0.13922796*nf0.w + 0.009947558*ng0.w + -0.050309543*nh0.w + 0.0055232816*ni0.w; + float r0 = i+j+k+l+m+n+o+p+-0.005724964; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN7 +//!SAVE LUMAN8 + +#define L_tex LUMAN7_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = 0.023095222*a0.x + 0.088675804*b0.x + 0.019515652*c0.x + 0.03876863*d0.x + 0.28370586*e0.x + 0.052443158*f0.x + 0.012073562*g0.x + 0.054533053*h0.x + 0.009309134*i0.x; + float j = -0.010418687*a0.y + -0.031180434*b0.y + -0.027810663*c0.y + -0.031218817*d0.y + 0.08831375*e0.y + 0.048364963*f0.y + -0.013520621*g0.y + -0.024290506*h0.y + -0.0071420255*i0.y; + float k = 0.06729409*a0.z + -0.18290426*b0.z + -0.04015622*c0.z + -0.06585363*d0.z + -0.04277582*e0.z + -0.0031648334*f0.z + -0.036526777*g0.z + 0.019262873*h0.z + -0.06440996*i0.z; + float l = -0.024598632*a0.w + 0.06775653*b0.w + -0.027943304*c0.w + -0.060332987*d0.w + -0.06108914*e0.w + -0.38447067*f0.w + -0.028799307*g0.w + -0.32565302*h0.w + -0.0820627*i0.w; + float m = -0.036973793*na0.x + -0.004178863*nb0.x + -0.013591895*nc0.x + -0.028666824*nd0.x + -0.20259032*ne0.x + -0.047049534*nf0.x + 0.03513545*ng0.x + 0.031252332*nh0.x + -0.00072113174*ni0.x; + float n = -0.023275118*na0.y + 0.12866385*nb0.y + -0.0047646784*nc0.y + 0.09065336*nd0.y + 0.19106166*ne0.y + 0.07720742*nf0.y + 0.07348565*ng0.y + -0.010560173*nh0.y + -0.0021694326*ni0.y; + float o = -0.0074641155*na0.z + 0.11848335*nb0.z + 0.033949424*nc0.z + 0.102563836*nd0.z + 0.11375473*ne0.z + 0.09258311*nf0.z + -0.033664387*ng0.z + 0.0197137*nh0.z + 0.032966334*ni0.z; + float p = 0.024047868*na0.w + -0.24709022*nb0.w + -0.2601394*nc0.w + 0.027225772*nd0.w + -0.23746225*ne0.w + -0.012594051*nf0.w + -0.07349794*ng0.w + -0.15158227*nh0.w + -0.2104957*ni0.w; + float o0 = i+j+k+l+m+n+o+p+-0.25017452; + i = -0.076065876*a0.x + 0.02043564*b0.x + 0.036401585*c0.x + 0.043759227*d0.x + 0.371543*e0.x + 0.0017194746*f0.x + 0.07603999*g0.x + -0.018234106*h0.x + 0.09166208*i0.x; + j = 0.10994385*a0.y + -0.036372717*b0.y + -0.007901915*c0.y + -0.13689917*d0.y + 0.31160897*e0.y + -0.099066*f0.y + -0.008666954*g0.y + -0.058747575*h0.y + 0.051024612*i0.y; + k = -0.23377013*a0.z + 0.07197715*b0.z + 0.032386325*c0.z + 0.25607866*d0.z + -0.57679576*e0.z + -0.17958632*f0.z + -0.09288573*g0.z + 0.032775987*h0.z + -0.032033086*i0.z; + l = -0.06958261*a0.w + -0.38490036*b0.w + -0.16421184*c0.w + 0.03861677*d0.w + 1.0647631*e0.w + 0.17515695*f0.w + -0.08448393*g0.w + -0.39466596*h0.w + -0.27870917*i0.w; + m = 0.05919463*na0.x + -0.055675797*nb0.x + -0.018722864*nc0.x + -0.12993331*nd0.x + -0.40171558*ne0.x + -0.07768799*nf0.x + -0.06001731*ng0.x + 0.14385901*nh0.x + -0.12873684*ni0.x; + n = 0.093186125*na0.y + 0.112590514*nb0.y + 0.13324285*nc0.y + -0.0469093*nd0.y + 0.032717*ne0.y + -0.061363228*nf0.y + 0.14042394*ng0.y + 0.13547798*nh0.y + 0.015560506*ni0.y; + o = 0.03303404*na0.z + -0.1882256*nb0.z + 0.093654186*nc0.z + 0.05690944*nd0.z + 0.869429*ne0.z + -0.07732642*nf0.z + 0.029356474*ng0.z + -0.14269826*nh0.z + 0.08325262*ni0.z; + p = 1.3574028e-05*na0.w + 0.16500515*nb0.w + -0.22035407*nc0.w + 0.12756291*nd0.w + -1.2695918*ne0.w + -0.06583852*nf0.w + -0.02346539*ng0.w + -0.29050758*nh0.w + -0.00058551447*ni0.w; + float p0 = i+j+k+l+m+n+o+p+-0.32460514; + i = -0.028411858*a0.x + -0.06502476*b0.x + 0.005506057*c0.x + -0.02065754*d0.x + -0.27725258*e0.x + -0.16733906*f0.x + -0.03028571*g0.x + -0.025893265*h0.x + 0.11180306*i0.x; + j = 0.044810914*a0.y + 0.0014952115*b0.y + 0.007166974*c0.y + 0.0030764928*d0.y + -0.48590574*e0.y + -0.0049648457*f0.y + -0.003955563*g0.y + -0.030718582*h0.y + 0.045998596*i0.y; + k = -0.033717085*a0.z + 0.17641076*b0.z + 0.0064347754*c0.z + 0.19182369*d0.z + 0.24730518*e0.z + 0.058232464*f0.z + 0.04889152*g0.z + 0.22933209*h0.z + -0.07484277*i0.z; + l = 0.008050995*a0.w + -0.041974865*b0.w + 0.03150534*c0.w + 0.15421486*d0.w + 1.0763092*e0.w + 0.33450183*f0.w + 0.007857187*g0.w + 0.17052104*h0.w + -0.17598473*i0.w; + m = 0.05216849*na0.x + -0.02699838*nb0.x + -0.0016451366*nc0.x + 0.026851216*nd0.x + 0.27528808*ne0.x + 0.17918247*nf0.x + 0.00075830554*ng0.x + 0.041555487*nh0.x + -0.08034286*ni0.x; + n = -0.030616183*na0.y + 0.030711962*nb0.y + 0.0100233685*nc0.y + -0.06026578*nd0.y + 0.32679543*ne0.y + -0.20025784*nf0.y + -0.030410208*ng0.y + 0.09807905*nh0.y + 0.051524427*ni0.y; + o = 0.008445165*na0.z + -0.13049273*nb0.z + 0.015668884*nc0.z + -0.13367654*nd0.z + -0.133823*ne0.z + -0.17434305*nf0.z + 0.07695557*ng0.z + -0.21806277*nh0.z + 0.10826007*ni0.z; + p = 0.09218729*na0.w + 0.3068162*nb0.w + 0.16703202*nc0.w + -0.08007084*nd0.w + -0.7652071*ne0.w + -0.054645624*nf0.w + 0.08314212*ng0.w + 0.11377628*nh0.w + 0.2098345*ni0.w; + float q0 = i+j+k+l+m+n+o+p+0.29825854; + i = 0.008392284*a0.x + -0.011715544*b0.x + 0.023170955*c0.x + 0.093332864*d0.x + 0.4111941*e0.x + 0.040952653*f0.x + 0.027631473*g0.x + 0.159317*h0.x + -0.063353576*i0.x; + j = -0.017223362*a0.y + 0.09427027*b0.y + 0.02895971*c0.y + 0.033313658*d0.y + 0.15276653*e0.y + -0.081052944*f0.y + -0.052108422*g0.y + 0.0800538*h0.y + -0.019928783*i0.y; + k = 0.0131623475*a0.z + 0.10337944*b0.z + -0.023866715*c0.z + -0.08219934*d0.z + -0.41991413*e0.z + 0.1393256*f0.z + 0.08876665*g0.z + -0.008065249*h0.z + 0.06677936*i0.z; + l = -0.084787*a0.w + -0.21261129*b0.w + -0.12980078*c0.w + -0.03659002*d0.w + 0.37194324*e0.w + 0.40455315*f0.w + 0.0060305526*g0.w + -0.10518265*h0.w + -0.010430722*i0.w; + m = -0.012547314*na0.x + -0.08181393*nb0.x + -0.04246661*nc0.x + 0.0040180096*nd0.x + -0.40135285*ne0.x + -0.036973383*nf0.x + -0.0069499887*ng0.x + -0.066302136*nh0.x + 0.02571455*ni0.x; + n = 0.21166039*na0.y + 0.17538953*nb0.y + 0.031203225*nc0.y + 0.025797121*nd0.y + -0.5401104*ne0.y + 0.065669365*nf0.y + 0.053330794*ng0.y + 0.18131651*nh0.y + 0.19454113*ni0.y; + o = 0.08176905*na0.z + -0.06013371*nb0.z + 0.0018070769*nc0.z + 0.0034025863*nd0.z + 0.49186924*ne0.z + -0.03564626*nf0.z + -0.15229581*ng0.z + 0.107180454*nh0.z + -0.011461588*ni0.z; + p = -0.012074635*na0.w + 0.2919535*nb0.w + 0.42858946*nc0.w + -0.11339507*nd0.w + -0.51076794*ne0.w + -0.44883406*nf0.w + -0.016805425*ng0.w + 0.316627*nh0.w + -0.106291555*ni0.w; + float r0 = i+j+k+l+m+n+o+p+-0.30891928; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN8 +//!SAVE LUMAN9 + +#define L_tex LUMAN8_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = 0.011191786*a0.x + 0.23951381*b0.x + -0.10570748*c0.x + -0.0015254265*d0.x + -0.3949229*e0.x + 0.15096109*f0.x + 0.13656913*g0.x + -0.3877109*h0.x + 0.18022504*i0.x; + float j = 0.024491772*a0.y + 0.035906848*b0.y + -0.0005005115*c0.y + -0.007313129*d0.y + 0.55162466*e0.y + -0.08579296*f0.y + -0.018405797*g0.y + 0.12538382*h0.y + -0.08658713*i0.y; + float k = 0.028113367*a0.z + 0.2766013*b0.z + -0.13962306*c0.z + -0.3118571*d0.z + -0.19919883*e0.z + -0.3087286*f0.z + -0.02967599*g0.z + -0.021850891*h0.z + 0.043625243*i0.z; + float l = -0.082083434*a0.w + 0.038183037*b0.w + -0.04495785*c0.w + 0.05067031*d0.w + -0.12048432*e0.w + 0.008085282*f0.w + -0.033083208*g0.w + -0.032013528*h0.w + -0.018831285*i0.w; + float m = -0.071037754*na0.x + -0.0583042*nb0.x + 0.0033310892*nc0.x + 0.011530962*nd0.x + 0.4835722*ne0.x + 0.116438776*nf0.x + 0.07681682*ng0.x + 0.028977543*nh0.x + -0.102326706*ni0.x; + float n = 0.011561477*na0.y + -0.06370286*nb0.y + 0.09494302*nc0.y + 0.15852202*nd0.y + -0.6013122*ne0.y + 0.31835455*nf0.y + 0.07656031*ng0.y + -0.15250978*nh0.y + 0.0660804*ni0.y; + float o = -0.012869594*na0.z + -0.1694734*nb0.z + 0.007840592*nc0.z + 0.13365789*nd0.z + 0.5910324*ne0.z + 0.023994336*nf0.z + -0.1231746*ng0.z + 0.1182651*nh0.z + -0.073815055*ni0.z; + float p = -0.015364551*na0.w + 0.032263234*nb0.w + -0.16016856*nc0.w + 0.08521244*nd0.w + 0.36012435*ne0.w + 0.15904869*nf0.w + -0.12220308*ng0.w + 0.12974344*nh0.w + -0.040795863*ni0.w; + float o0 = i+j+k+l+m+n+o+p+0.053871352; + i = -0.1588499*a0.x + -0.21851647*b0.x + 0.25986034*c0.x + -0.24344647*d0.x + -1.6035624*e0.x + -0.5991394*f0.x + 0.07953742*g0.x + -0.8776652*h0.x + 0.3819521*i0.x; + j = -0.043418065*a0.y + -0.12881063*b0.y + -0.024456538*c0.y + -0.1573027*d0.y + 0.06311247*e0.y + 0.06984885*f0.y + 0.025448142*g0.y + 0.19670363*h0.y + 0.081706375*i0.y; + k = -0.11016761*a0.z + -0.8923534*b0.z + 0.06994402*c0.z + -0.22224432*d0.z + -1.7209625*e0.z + 0.13240254*f0.z + -0.34291184*g0.z + 0.098353565*h0.z + -0.008249665*i0.z; + l = 0.123915665*a0.w + 0.039321687*b0.w + 0.024920449*c0.w + 0.041610703*d0.w + -0.13273434*e0.w + -0.012516724*f0.w + 0.010549669*g0.w + 0.029736295*h0.w + -0.009006617*i0.w; + m = 0.1347265*na0.x + 0.12257134*nb0.x + -0.03426787*nc0.x + -0.29054257*nd0.x + 1.5492249*ne0.x + -0.15956564*nf0.x + 0.30979466*ng0.x + -0.22267725*nh0.x + 0.2648195*ni0.x; + n = -0.04218395*na0.y + 0.25030056*nb0.y + -0.13068442*nc0.y + 0.07904602*nd0.y + -1.0424439*ne0.y + -0.41004273*nf0.y + -0.09722738*ng0.y + -0.24588263*nh0.y + 0.060979873*ni0.y; + o = -0.03040991*na0.z + 0.2839475*nb0.z + 0.039652344*nc0.z + -0.02847107*nd0.z + -0.04163423*ne0.z + 0.024968851*nf0.z + 0.07027608*ng0.z + 0.11467834*nh0.z + 0.10754681*ni0.z; + p = 0.06490522*na0.w + 0.18249801*nb0.w + 0.689666*nc0.w + 0.08065804*nd0.w + -1.0966055*ne0.w + -0.9221953*nf0.w + 0.04199578*ng0.w + 0.28271073*nh0.w + 0.061096374*ni0.w; + float p0 = i+j+k+l+m+n+o+p+-0.09490294; + i = 0.22382683*a0.x + -0.23359734*b0.x + -0.010614761*c0.x + 0.12763542*d0.x + 0.07141207*e0.x + -0.070608266*f0.x + -0.37325507*g0.x + 0.48005813*h0.x + -0.25752664*i0.x; + j = -0.023048563*a0.y + 0.10949794*b0.y + -0.022621715*c0.y + 0.12152201*d0.y + -0.27487656*e0.y + 0.06214247*f0.y + 0.10162017*g0.y + -0.020285988*h0.y + -0.005366798*i0.y; + k = 0.11171756*a0.z + -0.012062316*b0.z + 0.124257565*c0.z + 0.37239715*d0.z + 0.14933206*e0.z + 0.08563614*f0.z + 0.15544249*g0.z + -0.3293271*h0.z + -0.07382031*i0.z; + l = -0.038293127*a0.w + -0.123794444*b0.w + 0.06780399*c0.w + -0.13198623*d0.w + -0.18499732*e0.w + -0.06403023*f0.w + -0.01241917*g0.w + -0.052804*h0.w + -0.06691653*i0.w; + m = -0.06774789*na0.x + 0.023599042*nb0.x + -0.020330759*nc0.x + 0.22454411*nd0.x + 1.1471069*ne0.x + 0.117351554*nf0.x + -0.15335907*ng0.x + 0.338719*nh0.x + -0.042319488*ni0.x; + n = 0.03664181*na0.y + -0.0138222305*nb0.y + 0.048081644*nc0.y + -0.049309026*nd0.y + -0.62234706*ne0.y + 0.10059077*nf0.y + -0.15487589*ng0.y + 0.25435567*nh0.y + -0.057935156*ni0.y; + o = 0.018089186*na0.z + 0.020494046*nb0.z + -0.066466086*nc0.z + -0.041628707*nd0.z + -0.082925685*ne0.z + -0.040409505*nf0.z + 0.09522753*ng0.z + -0.072019234*nh0.z + 0.026274689*ni0.z; + p = -0.008643523*na0.w + 0.2802247*nb0.w + 0.09669575*nc0.w + -0.19446205*nd0.w + -1.3981148*ne0.w + 0.3947671*nf0.w + 0.3277589*ng0.w + 0.1827564*nh0.w + -0.037608545*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.33811548; + i = 0.508959*a0.x + -1.1897582*b0.x + 0.27264822*c0.x + -0.08196677*d0.x + 1.0336326*e0.x + -0.9140986*f0.x + -0.8927567*g0.x + 0.92622685*h0.x + -0.83850926*i0.x; + j = -0.09935804*a0.y + 0.1434052*b0.y + -0.03832266*c0.y + 0.33068126*d0.y + 0.69079924*e0.y + 0.37703332*f0.y + 0.26853803*g0.y + 0.051550016*h0.y + 0.1365815*i0.y; + k = 0.50282323*a0.z + -0.8693461*b0.z + 0.68779755*c0.z + 1.2486949*d0.z + -3.4707944*e0.z + 0.91403955*f0.z + 0.380638*g0.z + -0.5875639*h0.z + -0.2996781*i0.z; + l = 0.089513*a0.w + -0.49879786*b0.w + 0.27097106*c0.w + -0.54017377*d0.w + 0.7231357*e0.w + -0.12225226*f0.w + -0.061104745*g0.w + -0.12059939*h0.w + -0.22460648*i0.w; + m = 0.111952856*na0.x + -0.06090702*nb0.x + -0.14363275*nc0.x + 0.07970135*nd0.x + 1.2029066*ne0.x + -0.06887455*nf0.x + -0.2361067*ng0.x + 0.22621937*nh0.x + 0.34217682*ni0.x; + n = 0.057109337*na0.y + 0.25379825*nb0.y + -0.03310617*nc0.y + -0.51321745*nd0.y + 0.27301365*ne0.y + -0.2702349*nf0.y + -0.40828884*ng0.y + 0.48985386*nh0.y + -0.2279193*ni0.y; + o = 0.01117149*na0.z + 0.34376913*nb0.z + -0.18173458*nc0.z + -0.013281286*nd0.z + 1.6062312*ne0.z + -0.3641134*nf0.z + 0.40594944*ng0.z + -0.14061864*nh0.z + 0.1831309*ni0.z; + p = 0.0046956087*na0.w + 0.24169385*nb0.w + 1.0654216*nc0.w + 0.2112037*nd0.w + 1.1477715*ne0.w + 0.16534662*nf0.w + 0.6379531*ng0.w + 0.68865937*nh0.w + 0.038767826*ni0.w; + float r0 = i+j+k+l+m+n+o+p+0.11570526; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN-(L)-Conv-Reduce +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN1 +//!BIND LUMAN2 +//!BIND LUMAN3 +//!BIND LUMAN4 +//!BIND LUMAN5 +//!BIND LUMAN6 +//!BIND LUMAN7 +//!BIND LUMAN8 +//!BIND LUMAN9 +//!SAVE LUMAN0 + +vec4 hook() { + vec4 a = LUMAN1_tex(HOOKED_pos); + vec4 b = LUMAN2_tex(HOOKED_pos); + vec4 c = LUMAN3_tex(HOOKED_pos); + vec4 d = LUMAN4_tex(HOOKED_pos); + vec4 e = LUMAN5_tex(HOOKED_pos); + vec4 f = LUMAN6_tex(HOOKED_pos); + vec4 g = LUMAN7_tex(HOOKED_pos); + vec4 h = LUMAN8_tex(HOOKED_pos); + vec4 i = LUMAN9_tex(HOOKED_pos); + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + float o = -0.047081478*a.x + -0.032881256*a.y + -0.043644037*a.z + -0.036561083*a.w + 0.021485493*na.x + 0.018438356*na.y + -0.03554129*na.z + 0.043506186*na.w + 0.014266481*b.x + -0.035737853*b.y + -0.012823628*b.z + 0.0009264891*b.w + -0.05006617*nb.x + -4.4093795e-05*nb.y + 0.0135566415*nb.z + 0.0045723473*nb.w + 0.021764634*c.x + 0.026693553*c.y + 0.0032707953*c.z + 0.013746871*c.w + 0.007973638*nc.x + -0.025660595*nc.y + -0.017825818*nc.z + -0.010194548*nc.w + -0.017283116*d.x + 0.029000388*d.y + -0.025827635*d.z + 0.0014580291*d.w + 0.009698671*nd.x + -0.07251702*nd.y + 0.025386544*nd.z + 0.0102123*nd.w + -0.029390823*e.x + 0.1449412*e.y + -0.004747693*e.z + 0.0015781911*e.w + -0.012161642*ne.x + 0.020992773*ne.y + 0.0025863629*ne.z + 0.020216871*ne.w + -0.014964326*f.x + 0.0057226857*f.y + 0.004602058*f.z + -0.0017072024*f.w + 0.00014010703*nf.x + 0.027396023*nf.y + 0.053284008*nf.z + -0.00054560095*nf.w + -0.08465135*g.x + -0.025449844*g.y + 0.07974024*g.z + -0.026081605*g.w + 0.08998345*ng.x + -0.020028451*ng.y + -0.088179365*ng.z + 0.017214278*ng.w + 0.13374187*h.x + 0.0687001*h.y + 0.07197837*h.z + 0.10976076*h.w + -0.32598913*nh.x + 0.114709705*nh.y + 0.025096709*nh.z + 0.15262882*nh.w + 0.039497968*i.x + 0.081186056*i.y + 0.1575838*i.z + -0.040441483*i.w + -0.12779029*ni.x + -0.053493083*ni.y + -0.1554511*ni.z + 0.06450098*ni.w + 0.10196622; + float p = -0.05084896*a.x + -0.025864055*a.y + -0.0423675*a.z + -4.0772065e-06*a.w + 0.02803127*na.x + 0.035999373*na.y + 0.007870865*na.z + 0.05825513*na.w + 0.035351537*b.x + -0.07360655*b.y + -0.031453885*b.z + 0.0008590724*b.w + -0.007686636*nb.x + 0.03919155*nb.y + -0.0066824555*nb.z + 0.010864427*nb.w + 0.01694384*c.x + 0.002156429*c.y + -0.01584152*c.z + -0.022033762*c.w + -0.0027367529*nc.x + 0.04000485*nc.y + -0.050542578*nc.z + 0.030587258*nc.w + 0.029927408*d.x + 0.0050946497*d.y + -0.015805498*d.z + 0.023864375*d.w + -0.022649534*nd.x + 0.0028476734*nd.y + 0.012264402*nd.z + 0.031465337*nd.w + -0.10100293*e.x + -0.108228765*e.y + -0.005136694*e.z + -0.00098771*e.w + 0.009984722*ne.x + -0.11651231*ne.y + -0.004329168*ne.z + -0.0034827406*ne.w + 0.05612544*f.x + -0.004895536*f.y + 0.011656533*f.z + 0.011320819*f.w + 0.070911035*nf.x + 0.03044718*nf.y + -0.10531979*nf.z + -0.015752617*nf.w + 0.027381636*g.x + 0.013853647*g.y + -0.013681497*g.z + -0.034121756*g.w + -0.035334572*ng.x + 0.041340206*ng.y + 0.030327082*ng.z + 0.025534922*ng.w + -0.03690772*h.x + -0.08182541*h.y + 0.09829379*h.z + -0.07628125*h.w + 0.15156227*nh.x + -0.07646339*nh.y + -0.12581073*nh.z + -0.14322214*nh.w + 0.07712991*i.x + -0.043189485*i.y + -0.101967454*i.z + 0.031779*i.w + -0.21496733*ni.x + 0.028987886*ni.y + 0.12496805*ni.z + 0.001070264*ni.w + -0.07167466; + float q = -0.036076654*a.x + -0.023033194*a.y + -0.013268468*a.z + -0.10439581*a.w + 0.02900405*na.x + 0.06569822*na.y + 0.0015899669*na.z + 0.06309523*na.w + 0.01696686*b.x + 0.0018624541*b.y + 0.003093909*b.z + -0.0066021513*b.w + -0.032570347*nb.x + 0.016426489*nb.y + 0.008362462*nb.z + 0.0018623052*nb.w + 0.037616305*c.x + -0.019541427*c.y + 0.030132027*c.z + -0.029543463*c.w + -0.019351475*nc.x + 0.035037447*nc.y + -0.021529585*nc.z + 0.004689821*nc.w + -0.061487217*d.x + -0.017658396*d.y + 0.05177372*d.z + -0.06273585*d.w + 0.05520659*nd.x + -0.014126777*nd.y + -0.04915284*nd.z + 0.026295919*nd.w + 0.17304975*e.x + 0.01705942*e.y + -0.022067694*e.z + -0.0010175292*e.w + -0.011640876*ne.x + -0.07899215*ne.y + 0.02021127*ne.z + -0.022522984*ne.w + -0.014083511*f.x + 0.0072853453*f.y + -0.012230998*f.z + -0.0054261815*f.w + 0.08040602*nf.x + -0.024123095*nf.y + 0.09503648*nf.z + 0.021111265*nf.w + -0.0058723064*g.x + 0.014009066*g.y + -0.0199055*g.z + -0.048992727*g.w + 0.0146807665*ng.x + -0.07463385*ng.y + -0.0023119887*ng.z + 0.0733726*ng.w + 0.16678292*h.x + -0.038813323*h.y + 0.2020253*h.z + 0.0286461*h.w + -0.09631731*nh.x + 0.05879235*nh.y + -0.089875296*nh.z + -0.110792235*nh.w + 0.021833958*i.x + 0.011621068*i.y + -0.002211656*i.z + 0.01791743*i.w + 0.095421486*ni.x + -0.04211359*ni.y + -0.0024988165*ni.z + -0.055464126*ni.w + 0.0059085004; + float r = -0.061712302*a.x + -0.04130629*a.y + -0.019526359*a.z + -0.12467788*a.w + 0.029681372*na.x + 0.061640427*na.y + -0.0011297357*na.z + 0.09371664*na.w + 0.035102453*b.x + -0.004270386*b.y + 0.008078298*b.z + -0.026749663*b.w + -0.032711815*nb.x + 0.0110498015*nb.y + -0.008478087*nb.z + 0.025791116*nb.w + 0.01243721*c.x + -0.03316*c.y + 0.030688679*c.z + -0.019696997*c.w + -0.022907877*nc.x + 0.013164236*nc.y + -0.008400274*nc.z + -0.014558874*nc.w + -0.010408095*d.x + -0.017213805*d.y + 0.018412916*d.z + -0.023305846*d.w + 0.0009747286*nd.x + 0.04383806*nd.y + -0.019491175*nd.z + 0.014150079*nd.w + -0.003928558*e.x + 0.053480823*e.y + 0.032579094*e.z + 0.006049208*e.w + -0.0025383723*ne.x + 0.079490945*ne.y + -0.03156533*ne.z + -0.019017974*ne.w + -0.024016002*f.x + 0.0016876411*f.y + 0.01778236*f.z + -0.007140162*f.w + -0.047252163*nf.x + 0.0031894948*nf.y + -0.07527481*nf.z + -0.01373366*nf.w + -0.01434254*g.x + -0.026031932*g.y + 0.02796686*g.z + 0.09758574*g.w + 0.007164799*ng.x + 0.065844*ng.y + -0.01628951*ng.z + -0.09932834*ng.w + -0.2192365*h.x + 0.045124453*h.y + -0.31844327*h.z + -0.052317273*h.w + 0.2420633*nh.x + -0.085638754*nh.y + 0.14658552*nh.z + 0.068354204*nh.w + -0.11164648*i.x + -0.030088436*i.y + -0.08107349*i.z + -0.004874011*i.w + 0.2173053*ni.x + 0.059565175*ni.y + 0.045205507*ni.z + -0.015653528*ni.w + 0.0017200519; + return vec4(o, p, q, r); +} + +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN0 +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(L) + + +vec4 hook() { + vec2 f = fract(LUMAN0_pos * LUMAN0_size); + ivec2 i = ivec2(f * vec2(2)); + float c = LUMAN0_tex((vec2(0.5) - f) * LUMAN0_pt + LUMAN0_pos)[i.y * 2 + i.x]; + return vec4(c + HOOKED_tex(HOOKED_pos).x, HOOKED_tex(HOOKED_pos).yz, 0); +} diff --git a/.config/mpv/shaders/Anime4K_Upscale_CNN_L_x2_Deblur.glsl b/.config/mpv/shaders/Anime4K_Upscale_CNN_L_x2_Deblur.glsl new file mode 100644 index 0000000..9849ed5 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_CNN_L_x2_Deblur.glsl @@ -0,0 +1,927 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN-(L)-Conv-4x3x3x1 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!SAVE LUMAN0 + +vec4 hook() { + vec2 dp = HOOKED_pt; + float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x; + float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x; + float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x; + float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x; + float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x; + float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x; + float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x; + float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x; + float s = 0.10397486*a + 0.6959855*b + 0.3576091*c + -0.048129864*d + -1.0134345*e + -0.02346323*f + 0.018850459*g + -0.106389955*h + 0.028658116*i + 0.04803684; + float t = 0.354869*a + -0.39392647*b + 0.003622437*c + -0.18034431*d + 0.88706636*e + -0.31342724*f + -0.022048054*g + -0.3557178*h + 0.0018092435*i + -0.037158098; + float u = 0.32695425*a + -0.32558918*b + 0.00059630745*c + -0.018950976*d + 0.01774775*e + -0.004043651*f + 0.0027214154*g + -0.0034390602*h + 0.0025048833*i + 0.0007407871; + float v = -0.071759045*a + -0.42592436*b + -0.14482588*c + 1.5960604*d + -0.63252157*e + -0.36544406*f + -0.15239236*g + 0.12528165*h + 0.08432576*i + -0.08232925; + return vec4(s, t, u, v); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN0 +//!SAVE LUMAN1 + +#define L_tex LUMAN0_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = 0.06639665*a0.x + 0.28223944*b0.x + 0.004304705*c0.x + -0.32451394*d0.x + 0.43342906*e0.x + -0.024424514*f0.x + -0.49240196*g0.x + -0.88034385*h0.x + -0.12338143*i0.x; + float j = -0.6820241*a0.y + 0.25317526*b0.y + -0.09791629*c0.y + 0.3271639*d0.y + -0.6224342*e0.y + -0.154204*f0.y + -0.029958222*g0.y + 0.32977268*h0.y + -0.031524904*i0.y; + float k = 0.6709632*a0.z + -0.24324693*b0.z + -0.049306735*c0.z + -0.8970901*d0.z + 0.56715167*e0.z + -0.14102495*f0.z + -1.0995007*g0.z + 0.5427549*h0.z + 0.36576506*i0.z; + float l = 0.13722713*a0.w + 0.41282004*b0.w + 0.19782153*c0.w + 0.28570884*d0.w + -0.6406399*e0.w + -0.18080634*f0.w + -0.03796595*g0.w + -0.019462103*h0.w + 0.19691238*i0.w; + float m = 0.022774132*na0.x + -0.4075716*nb0.x + -0.0019649733*nc0.x + 0.5934201*nd0.x + -0.31279135*ne0.x + -0.009237561*nf0.x + 0.4158437*ng0.x + 0.8021286*nh0.x + 0.11572698*ni0.x; + float n = 0.6584185*na0.y + -0.43536583*nb0.y + 0.112234406*nc0.y + -0.11827302*nd0.y + 0.47007844*ne0.y + 0.2900137*nf0.y + 0.12348495*ng0.y + -0.6027396*nh0.y + 0.08154192*ni0.y; + float o = -0.7349083*na0.z + 0.24339297*nb0.z + 0.012427026*nc0.z + 0.9602159*nd0.z + -0.8431948*ne0.z + -0.17023432*nf0.z + 0.7244754*ng0.z + 0.13925964*nh0.z + -0.38444963*ni0.z; + float p = -0.14070114*na0.w + -0.42214736*nb0.w + -0.0472595*nc0.w + -0.2583746*nd0.w + 0.49701452*ne0.w + 0.072298154*nf0.w + 0.027000604*ng0.w + 0.077047*nh0.w + -0.11605896*ni0.w; + float o0 = i+j+k+l+m+n+o+p+0.053626187; + i = 0.06845743*a0.x + 0.7203445*b0.x + -0.009160133*c0.x + -0.47423828*d0.x + 0.0040186336*e0.x + -0.13636078*f0.x + -0.16735902*g0.x + -0.095058076*h0.x + -0.1748559*i0.x; + j = 0.95788497*a0.y + 0.5390323*b0.y + -0.23857942*c0.y + -0.015868062*d0.y + 0.065215364*e0.y + 0.35074416*f0.y + 0.14792109*g0.y + 0.012528532*h0.y + -0.08329774*i0.y; + k = -0.8304687*a0.z + -0.2803149*b0.z + 0.8455862*c0.z + -0.31274366*d0.z + 0.49027762*e0.z + -2.568119*f0.z + -0.5816856*g0.z + -0.24438478*h0.z + -1.576034*i0.z; + l = 0.33903894*a0.w + 0.18856564*b0.w + -0.085718796*c0.w + 0.14994945*d0.w + 0.4343596*e0.w + -0.10266155*f0.w + 0.09709637*g0.w + -0.2009859*h0.w + 0.011091642*i0.w; + m = 0.11521898*na0.x + -0.3218118*nb0.x + -0.003314331*nc0.x + 0.38280985*nd0.x + -0.9900221*ne0.x + 0.2372697*nf0.x + 0.17255092*ng0.x + 0.20525312*nh0.x + 0.39674228*ni0.x; + n = -0.47868168*na0.y + -0.8024517*nb0.y + 0.10802533*nc0.y + 0.003150858*nd0.y + 0.17614411*ne0.y + 0.09025896*nf0.y + -0.19619498*ng0.y + 0.06488243*nh0.y + 0.26845673*ni0.y; + o = 0.8002209*na0.z + 0.73399717*nb0.z + -0.35711604*nc0.z + 0.35695946*nd0.z + -0.87510985*ne0.z + -2.083351*nf0.z + 0.30222148*ng0.z + 0.47206184*nh0.z + -0.4826941*ni0.z; + p = -0.2594144*na0.w + -0.23693322*nb0.w + 0.09217326*nc0.w + -0.0690688*nd0.w + -0.01309805*ne0.w + 0.06419221*nf0.w + 0.018290445*ng0.w + 0.27774101*nh0.w + 0.108097576*ni0.w; + float p0 = i+j+k+l+m+n+o+p+0.102133505; + i = 0.0643423*a0.x + 0.018541882*b0.x + 0.08350226*c0.x + -0.004340104*d0.x + -0.03433379*e0.x + 0.01880579*f0.x + 0.03353465*g0.x + -0.3056104*h0.x + -0.19704679*i0.x; + j = -0.15946428*a0.y + 0.21165088*b0.y + 0.12410154*c0.y + 0.27272165*d0.y + -0.65606165*e0.y + 0.12557049*f0.y + -0.17287672*g0.y + -0.04488873*h0.y + 0.03603188*i0.y; + k = 0.062299795*a0.z + -0.14047587*b0.z + 0.024050632*c0.z + 0.31575218*d0.z + 1.8625292*e0.z + -0.43774956*f0.z + 1.5006273*g0.z + 3.9281907*h0.z + -0.13422425*i0.z; + l = -0.04318438*a0.w + 0.08911396*b0.w + 0.05187426*c0.w + -0.028754652*d0.w + -0.50872475*e0.w + -0.30725425*f0.w + -0.043555077*g0.w + 0.11037375*h0.w + -0.12379002*i0.w; + m = 0.005490416*na0.x + -0.009724751*nb0.x + -0.06905491*nc0.x + 0.35613546*nd0.x + 0.2776101*ne0.x + -0.13444975*nf0.x + -0.12958236*ng0.x + 0.27827492*nh0.x + 0.19111122*ni0.x; + n = 0.08052509*na0.y + -0.16101089*nb0.y + -0.11118997*nc0.y + -0.17190972*nd0.y + 0.28470594*ne0.y + -0.02071287*nf0.y + 0.0063910377*ng0.y + 0.13593876*nh0.y + 0.046352968*ni0.y; + o = -0.13271736*na0.z + -0.010725217*nb0.z + -0.26716524*nc0.z + -0.39615706*nd0.z + -0.7941645*ne0.z + -0.046327833*nf0.z + -0.8656559*ng0.z + 3.0924113*nh0.z + 1.2674434*ni0.z; + p = 0.1013534*na0.w + -0.06801255*nb0.w + 0.03251423*nc0.w + 0.18332215*nd0.w + 0.12801744*ne0.w + 0.28137314*nf0.w + 0.007990733*ng0.w + -0.2692326*nh0.w + -0.062365714*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.060032938; + i = 0.117412865*a0.x + -0.22560671*b0.x + -0.14794402*c0.x + 0.34914464*d0.x + 0.45673132*e0.x + -0.35118288*f0.x + 0.33961612*g0.x + 0.11392481*h0.x + -0.13414447*i0.x; + j = -0.11333446*a0.y + 0.2393889*b0.y + 0.0027701098*c0.y + 0.60629034*d0.y + -0.75975823*e0.y + -0.16403528*f0.y + -0.019105319*g0.y + 0.061169848*h0.y + -0.101013266*i0.y; + k = 0.076263286*a0.z + -0.553907*b0.z + -0.4970874*c0.z + -1.5819451*d0.z + 0.64838296*e0.z + 1.7086831*f0.z + 0.09729768*g0.z + -1.2366847*h0.z + -0.24660581*i0.z; + l = 0.08548202*a0.w + -0.17481433*b0.w + -0.34403273*c0.w + 0.012375519*d0.w + 0.08745941*e0.w + -0.070196316*f0.w + 0.00729971*g0.w + 0.29530787*h0.w + -0.21760395*i0.w; + m = -0.24691077*na0.x + 0.2311278*nb0.x + 0.19753166*nc0.x + -0.404209*nd0.x + 0.18452622*ne0.x + 0.29987976*nf0.x + -0.27267244*ng0.x + -0.14402863*nh0.x + 0.073582985*ni0.x; + n = -0.083637685*na0.y + 0.019198107*nb0.y + -0.0853492*nc0.y + -0.7212835*nd0.y + 0.742372*ne0.y + -0.32987705*nf0.y + -0.0026051754*ng0.y + 0.015593551*nh0.y + -0.050979447*ni0.y; + o = -0.02741548*na0.z + 0.2884727*nb0.z + 0.38504106*nc0.z + 1.6370418*nd0.z + -0.31865364*ne0.z + 0.6172546*nf0.z + -0.30839926*ng0.z + -0.37191314*nh0.z + 0.9595531*ni0.z; + p = -0.12116755*na0.w + 0.18340635*nb0.w + 0.24062845*nc0.w + 0.00054277224*nd0.w + -0.040880762*ne0.w + 0.17774053*nf0.w + -0.044756617*ng0.w + -0.29897058*nh0.w + 0.11243821*ni0.w; + float r0 = i+j+k+l+m+n+o+p+-0.0830924; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN1 +//!SAVE LUMAN2 + +#define L_tex LUMAN1_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = 0.1296995*a0.x + 0.58585095*b0.x + 0.32923958*c0.x + -0.029538905*d0.x + 0.12424867*e0.x + 0.06688472*f0.x + -0.024876455*g0.x + 0.081395976*h0.x + 0.07730565*i0.x; + float j = 0.0835473*a0.y + -0.0692147*b0.y + -0.07067511*c0.y + 0.019754365*d0.y + -0.24134408*e0.y + -0.23151338*f0.y + -0.019295152*g0.y + 0.100035846*h0.y + -0.016351536*i0.y; + float k = -0.050630216*a0.z + -0.033612493*b0.z + -0.19357617*c0.z + -0.07101453*d0.z + 0.17056477*e0.z + 0.060211252*f0.z + 0.0033124269*g0.z + 0.09456133*h0.z + -0.037142575*i0.z; + float l = 0.051075853*a0.w + 0.2913882*b0.w + 0.058661155*c0.w + 0.22263865*d0.w + -0.23906778*e0.w + -0.14503716*f0.w + 0.082726575*g0.w + 0.11113719*h0.w + 0.14532568*i0.w; + float m = -0.100905254*na0.x + -0.26352566*nb0.x + -0.24404018*nc0.x + 0.11224881*nd0.x + 0.51329523*ne0.x + -0.053486858*nf0.x + 0.09148782*ng0.x + 0.0037240295*nh0.x + -0.088871725*ni0.x; + float n = -0.050803714*na0.y + -0.0416797*nb0.y + -0.07453628*nc0.y + -0.23378085*nd0.y + 0.137114*ne0.y + -0.020378582*nf0.y + -0.013943721*ng0.y + -0.12330325*nh0.y + -0.1303406*ni0.y; + float o = -0.081222475*na0.z + 0.02552934*nb0.z + 0.29423392*nc0.z + -0.010700949*nd0.z + 0.44353056*ne0.z + -0.025496874*nf0.z + -0.0717391*ng0.z + 0.009533622*nh0.z + 0.12127055*ni0.z; + float p = -0.015820552*na0.w + -0.17862697*nb0.w + -0.02356494*nc0.w + -0.10123709*nd0.w + 0.39525294*ne0.w + 0.15487084*nf0.w + -0.01085165*ng0.w + -0.24515375*nh0.w + -0.06711949*ni0.w; + float o0 = i+j+k+l+m+n+o+p+-0.030414568; + i = -0.17145431*a0.x + -0.20274077*b0.x + -0.13539806*c0.x + -0.15229994*d0.x + 0.21967621*e0.x + -0.14581895*f0.x + 0.011627536*g0.x + 0.054711625*h0.x + -0.10415255*i0.x; + j = -0.032065842*a0.y + 0.01507945*b0.y + 0.014360462*c0.y + -0.07954877*d0.y + 0.4554514*e0.y + -0.02500351*f0.y + 0.09280885*g0.y + 0.08076883*h0.y + 0.012532978*i0.y; + k = -0.040672652*a0.z + -0.011551944*b0.z + 0.017042167*c0.z + -0.034443982*d0.z + 0.017515173*e0.z + -0.012364212*f0.z + 0.012219225*g0.z + -0.033760473*h0.z + -0.026314916*i0.z; + l = -0.1833554*a0.w + -0.20858614*b0.w + -0.04312281*c0.w + -0.4133038*d0.w + 0.7893293*e0.w + 0.039180417*f0.w + 0.08793949*g0.w + 0.21557106*h0.w + 0.026690673*i0.w; + m = -0.05162859*na0.x + -0.058755793*nb0.x + 0.048020624*nc0.x + 0.019536454*nd0.x + -0.4237037*ne0.x + -0.031836376*nf0.x + -0.008829477*ng0.x + -0.11413442*nh0.x + 0.1083338*ni0.x; + n = 0.13001607*na0.y + 0.14846794*nb0.y + 0.03834157*nc0.y + 0.06404169*nd0.y + -0.5548147*ne0.y + -0.002337565*nf0.y + 0.07660518*ng0.y + 0.2561992*nh0.y + 0.11988241*ni0.y; + o = 0.039745063*na0.z + -0.08055183*nb0.z + -0.1303704*nc0.z + 0.022918316*nd0.z + -0.056718633*ne0.z + 0.06251301*nf0.z + -0.024526184*ng0.z + -0.15459415*nh0.z + -0.002799402*ni0.z; + p = 0.21387257*na0.w + 0.29624957*nb0.w + 0.023706648*nc0.w + 0.3816746*nd0.w + -0.6914615*ne0.w + 0.074115634*nf0.w + -0.0032766939*ng0.w + -0.1846047*nh0.w + 0.006624912*ni0.w; + float p0 = i+j+k+l+m+n+o+p+-0.03056522; + i = -0.11029118*a0.x + 0.3337483*b0.x + 0.077408336*c0.x + -0.42610714*d0.x + -1.2206199*e0.x + 0.19516373*f0.x + -0.15404113*g0.x + -0.20634995*h0.x + 0.06588952*i0.x; + j = -0.04082908*a0.y + -0.12006161*b0.y + -0.05597222*c0.y + -0.3542818*d0.y + -0.35644907*e0.y + -0.14614798*f0.y + -0.20449866*g0.y + -0.09893636*h0.y + -0.092030644*i0.y; + k = 0.1502402*a0.z + 0.1726779*b0.z + 0.062496457*c0.z + 0.28070614*d0.z + 0.016571306*e0.z + 0.12977904*f0.z + 0.037328202*g0.z + 0.06063515*h0.z + 0.22138344*i0.z; + l = 0.2236037*a0.w + 0.0039381385*b0.w + -0.12040037*c0.w + -0.13418862*d0.w + -0.034812238*e0.w + -0.05243254*f0.w + -0.34639022*g0.w + -0.18946312*h0.w + 0.045312986*i0.w; + m = -0.30953258*na0.x + -0.8356361*nb0.x + -0.1887177*nc0.x + 0.014400998*nd0.x + -0.3064453*ne0.x + -0.11070782*nf0.x + 0.041681726*ng0.x + -0.11717862*nh0.x + -0.07595453*ni0.x; + n = -0.01094574*na0.y + -0.0011181692*nb0.y + -0.14214927*nc0.y + 0.27722216*nd0.y + 0.3271789*ne0.y + 0.049340714*nf0.y + -0.030088885*ng0.y + 0.06712784*nh0.y + -0.06951951*ni0.y; + o = 0.19824019*na0.z + 0.37815058*nb0.z + 0.28591436*nc0.z + 0.13495544*nd0.z + 0.33094874*ne0.z + 0.35384452*nf0.z + 0.30736896*ng0.z + 0.0750831*nh0.z + 0.26549867*ni0.z; + p = -0.11226634*na0.w + -0.27737*nb0.w + -0.014325423*nc0.w + 0.19669802*nd0.w + 0.1702417*ne0.w + -0.18681495*nf0.w + 0.6464465*ng0.w + 0.51191556*nh0.w + -0.11019807*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.0062645413; + i = -0.7524125*a0.x + 0.15982255*b0.x + -0.38003713*c0.x + -0.18294491*d0.x + -0.011609704*e0.x + 0.1644678*f0.x + -0.080624536*g0.x + 0.03851575*h0.x + -0.018073043*i0.x; + j = -0.20548582*a0.y + -0.087626405*b0.y + -0.24111056*c0.y + -0.20929506*d0.y + -0.05862193*e0.y + 0.21097149*f0.y + 0.37784964*g0.y + -0.3371335*h0.y + 0.21661137*i0.y; + k = -0.056834865*a0.z + 0.07880648*b0.z + 0.24440387*c0.z + 0.035857998*d0.z + -0.05498326*e0.z + -0.016055869*f0.z + -0.24461745*g0.z + -0.04416979*h0.z + -0.008112517*i0.z; + l = -0.32616344*a0.w + -0.024567882*b0.w + -0.35107398*c0.w + -1.1010243*d0.w + -0.3698656*e0.w + 0.32266977*f0.w + -0.24221507*g0.w + -0.6740687*h0.w + -0.14333092*i0.w; + m = 0.39440885*na0.x + -0.6442062*nb0.x + 0.13425396*nc0.x + 0.51738626*nd0.x + -0.67044*ne0.x + 0.15458697*nf0.x + -0.09434363*ng0.x + 0.11851308*nh0.x + -0.023352176*ni0.x; + n = 0.29104593*na0.y + 0.041593533*nb0.y + 0.11439773*nc0.y + -0.003218177*nd0.y + 0.42421842*ne0.y + 0.08495443*nf0.y + -0.3131501*ng0.y + -0.16917372*nh0.y + 0.1289088*ni0.y; + o = 0.09410875*na0.z + -0.11588178*nb0.z + 0.13947532*nc0.z + 0.23592931*nd0.z + -0.72784305*ne0.z + -0.23903714*nf0.z + 0.08198044*ng0.z + -0.25076246*nh0.z + -0.11394936*ni0.z; + p = 0.669559*na0.w + -0.025986305*nb0.w + 0.44193423*nc0.w + 1.2048185*nd0.w + 0.7560385*ne0.w + -0.4745804*nf0.w + -0.095279634*ng0.w + 0.7421271*nh0.w + -0.056005523*ni0.w; + float r0 = i+j+k+l+m+n+o+p+-0.06872939; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN2 +//!SAVE LUMAN3 + +#define L_tex LUMAN2_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = -0.06717315*a0.x + -0.18625546*b0.x + -0.18535699*c0.x + -0.25209853*d0.x + 0.04015934*e0.x + 0.26530865*f0.x + -0.04327326*g0.x + 0.086863905*h0.x + -0.10865201*i0.x; + float j = 0.31827033*a0.y + 0.22865397*b0.y + 0.028610421*c0.y + 0.6276318*d0.y + 0.22509193*e0.y + 0.1573462*f0.y + 0.10111941*g0.y + 0.1917281*h0.y + -0.14345117*i0.y; + float k = -0.22344574*a0.z + -0.22601207*b0.z + -0.011553535*c0.z + -0.181191*d0.z + -0.2725799*e0.z + 0.06439458*f0.z + 0.048038308*g0.z + 0.12983559*h0.z + -0.079764694*i0.z; + float l = -0.016861046*a0.w + -0.019494308*b0.w + -0.017669018*c0.w + -0.06530767*d0.w + 0.09395054*e0.w + 0.061136525*f0.w + -0.04735494*g0.w + 0.18924968*h0.w + -0.023836756*i0.w; + float m = -0.3547175*na0.x + 0.1358826*nb0.x + 0.07858271*nc0.x + -0.23430872*nd0.x + 0.43895817*ne0.x + -0.22928667*nf0.x + 0.032354854*ng0.x + 0.006439356*nh0.x + 0.062181197*ni0.x; + float n = -0.2425591*na0.y + 0.08514424*nb0.y + 0.22871092*nc0.y + -0.46338332*nd0.y + 0.5336361*ne0.y + -0.40562704*nf0.y + 0.01311291*ng0.y + -0.06778306*nh0.y + 0.17169508*ni0.y; + float o = 0.10230756*na0.z + -0.20127158*nb0.z + -0.07916379*nc0.z + -0.07754846*nd0.z + -0.116193995*ne0.z + 0.06341818*nf0.z + -0.00801396*ng0.z + -0.09713724*nh0.z + 0.072695844*ni0.z; + float p = 0.14998771*na0.w + 0.13864347*nb0.w + 0.068318844*nc0.w + 0.045116886*nd0.w + -0.042385302*ne0.w + -0.12741679*nf0.w + 0.12546733*ng0.w + -0.061053857*nh0.w + 0.013063541*ni0.w; + float o0 = i+j+k+l+m+n+o+p+-0.025009213; + i = 0.19007389*a0.x + -0.1583994*b0.x + 0.032637432*c0.x + -0.028661437*d0.x + 0.048821084*e0.x + 0.10179253*f0.x + -0.06565897*g0.x + 0.5590187*h0.x + 0.037958134*i0.x; + j = 0.12815921*a0.y + 0.17668153*b0.y + -0.12790684*c0.y + 0.1956624*d0.y + 0.97611785*e0.y + 0.060223907*f0.y + 0.14199442*g0.y + 0.102231756*h0.y + 0.117724344*i0.y; + k = -0.18413326*a0.z + -0.17708266*b0.z + -0.20034097*c0.z + -0.3124793*d0.z + 0.026309077*e0.z + -0.0925308*f0.z + -0.016788289*g0.z + -0.16716176*h0.z + 0.004230467*i0.z; + l = -0.038007755*a0.w + -0.008115078*b0.w + 0.07480802*c0.w + 0.04666423*d0.w + -0.10847974*e0.w + 0.12687379*f0.w + -0.07406638*g0.w + 0.15683106*h0.w + 0.071306415*i0.w; + m = -0.3524179*na0.x + -0.08746631*nb0.x + -0.055358827*nc0.x + -0.005121702*nd0.x + 0.2238154*ne0.x + 0.04734714*nf0.x + 0.38855964*ng0.x + -0.61724895*nh0.x + 0.06885853*ni0.x; + n = -0.14331289*na0.y + -0.2050787*nb0.y + 0.1991135*nc0.y + -0.46040756*nd0.y + -0.6366871*ne0.y + -0.41664663*nf0.y + -0.16958122*ng0.y + -0.3761652*nh0.y + -0.18120718*ni0.y; + o = 0.11750789*na0.z + -0.013673033*nb0.z + 0.14197573*nc0.z + 0.10468691*nd0.z + 0.0014566277*ne0.z + 0.09031144*nf0.z + 0.0037937157*ng0.z + -0.02874946*nh0.z + -0.026509108*ni0.z; + p = 0.100215666*na0.w + 0.040169634*nb0.w + 0.013164925*nc0.w + -0.118727714*nd0.w + -0.03184685*ne0.w + -0.14043786*nf0.w + 0.024457283*ng0.w + -0.15660675*nh0.w + -0.05200356*ni0.w; + float p0 = i+j+k+l+m+n+o+p+0.071153864; + i = 0.23885481*a0.x + 0.009627908*b0.x + -0.07391904*c0.x + -0.028175073*d0.x + 0.30320242*e0.x + 0.10949589*f0.x + -0.21194275*g0.x + 0.091189414*h0.x + 0.11207269*i0.x; + j = 0.02364771*a0.y + 0.24171546*b0.y + -0.085548185*c0.y + -0.13059966*d0.y + 0.7769793*e0.y + 0.1368896*f0.y + 0.019515332*g0.y + -0.2813097*h0.y + 0.12159547*i0.y; + k = 0.31217164*a0.z + 0.41959077*b0.z + 0.1990368*c0.z + 0.17852639*d0.z + 1.0253936*e0.z + 0.12014064*f0.z + 0.030470015*g0.z + 0.116894834*h0.z + 0.12033049*i0.z; + l = -0.14778642*a0.w + -0.12812881*b0.w + -0.027680345*c0.w + -0.14777774*d0.w + -0.1661101*e0.w + 0.012757367*f0.w + -0.0023989049*g0.w + -0.15380865*h0.w + 0.033649914*i0.w; + m = 0.332305*na0.x + 0.117145285*nb0.x + 0.31137946*nc0.x + 0.284246*nd0.x + 0.24726851*ne0.x + 0.17240214*nf0.x + 0.15286899*ng0.x + -0.31956202*nh0.x + 0.027743679*ni0.x; + n = -0.096838504*na0.y + -0.23554324*nb0.y + 0.05768958*nc0.y + 0.25250152*nd0.y + -0.26971808*ne0.y + -0.41672847*nf0.y + 0.1148402*ng0.y + 0.18528111*nh0.y + -0.08624775*ni0.y; + o = -0.12979779*na0.z + -0.04953356*nb0.z + 0.03002859*nc0.z + 0.06834822*nd0.z + -0.32774958*ne0.z + 0.045808665*nf0.z + -0.050698712*ng0.z + 0.044419024*nh0.z + 0.046608027*ni0.z; + p = -0.06442882*na0.w + -0.04786282*nb0.w + 0.017273132*nc0.w + 0.18142362*nd0.w + 0.07271175*ne0.w + -0.11233566*nf0.w + -0.06878901*ng0.w + -0.048930436*nh0.w + -0.1138723*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.0014894; + i = -0.19751294*a0.x + 0.25861272*b0.x + -0.0066198874*c0.x + 0.112890586*d0.x + -0.26875597*e0.x + -0.26113203*f0.x + 0.24095851*g0.x + -0.18970534*h0.x + -0.025890965*i0.x; + j = 0.019675067*a0.y + -0.07642529*b0.y + 0.159886*c0.y + -0.06923781*d0.y + -0.38018093*e0.y + -0.48206782*f0.y + -0.118144274*g0.y + 0.28994203*h0.y + -0.051686626*i0.y; + k = 0.034843404*a0.z + -0.21872765*b0.z + 0.01100473*c0.z + 0.11592991*d0.z + -0.7518377*e0.z + -0.42115083*f0.z + -0.0321754*g0.z + 0.20926285*h0.z + -0.17526312*i0.z; + l = -0.015074366*a0.w + -0.083057426*b0.w + -0.15830547*c0.w + -0.0009947944*d0.w + 0.31531596*e0.w + -0.17569509*f0.w + 0.14843346*g0.w + -0.0026129466*h0.w + 0.05092144*i0.w; + m = 0.41312754*na0.x + -0.096808426*nb0.x + 0.120561026*nc0.x + -0.003183892*nd0.x + 0.046201833*ne0.x + 0.32055348*nf0.x + -0.53987944*ng0.x + 0.43310902*nh0.x + 0.002572001*ni0.x; + n = 0.020376818*na0.y + 0.032837477*nb0.y + -0.2895329*nc0.y + 0.19988254*nd0.y + -0.28621992*ne0.y + 0.82064044*nf0.y + 0.073460415*ng0.y + -0.029826678*nh0.y + 0.07131397*ni0.y; + o = -0.039654482*na0.z + 0.10681176*nb0.z + -0.22279368*nc0.z + -0.037715416*nd0.z + 0.1909092*ne0.z + 0.030304825*nf0.z + -0.02703714*ng0.z + -0.046335116*nh0.z + 0.05017316*ni0.z; + p = -0.041754566*na0.w + 0.06949629*nb0.w + 0.082980104*nc0.w + 0.056356948*nd0.w + -0.17428519*ne0.w + 0.21060298*nf0.w + -0.07780234*ng0.w + 0.07410131*nh0.w + -0.025585834*ni0.w; + float r0 = i+j+k+l+m+n+o+p+-0.0040146387; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN3 +//!SAVE LUMAN4 + +#define L_tex LUMAN3_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = -0.13935597*a0.x + -0.11091113*b0.x + -0.03688676*c0.x + 0.28064582*d0.x + 0.19852728*e0.x + 0.0315579*f0.x + -0.17065585*g0.x + -0.2283964*h0.x + 0.14495629*i0.x; + float j = -0.16179775*a0.y + 0.16048649*b0.y + -0.370548*c0.y + -0.35172173*d0.y + 0.48003772*e0.y + -0.105164304*f0.y + 0.093682155*g0.y + -0.3915796*h0.y + -0.26049125*i0.y; + float k = -0.19633873*a0.z + -0.21336922*b0.z + 0.013648553*c0.z + 0.39576057*d0.z + -0.29565853*e0.z + -0.011219808*f0.z + -0.0716942*g0.z + -0.19690439*h0.z + -0.09431168*i0.z; + float l = -0.05934762*a0.w + 0.08727595*b0.w + 0.12611376*c0.w + 0.14969496*d0.w + 0.72159785*e0.w + 0.122124545*f0.w + 0.21124533*g0.w + -0.12930311*h0.w + 0.253542*i0.w; + float m = 0.12843879*na0.x + -0.020566197*nb0.x + -0.0660588*nc0.x + -0.66884834*nd0.x + 0.06484056*ne0.x + 0.023970712*nf0.x + 0.23006171*ng0.x + 0.33466932*nh0.x + -0.29759154*ni0.x; + float n = 0.059693146*na0.y + -0.045831673*nb0.y + 0.05568022*nc0.y + 0.084064946*nd0.y + -0.97029793*ne0.y + -0.013524799*nf0.y + -0.18485625*ng0.y + -0.12563172*nh0.y + -0.047100443*ni0.y; + float o = 0.13252054*na0.z + 0.25632593*nb0.z + -0.20554997*nc0.z + 0.13906007*nd0.z + 0.3876675*ne0.z + 0.05157098*nf0.z + 0.01824493*ng0.z + 0.3791039*nh0.z + -0.24203013*ni0.z; + float p = 0.42681953*na0.w + 0.37215272*nb0.w + 0.14401126*nc0.w + 0.22729643*nd0.w + -0.4240743*ne0.w + 0.01858027*nf0.w + 0.05341485*ng0.w + 0.27715722*nh0.w + -0.05586885*ni0.w; + float o0 = i+j+k+l+m+n+o+p+-0.101345845; + i = 0.06435059*a0.x + -0.05780327*b0.x + -0.13576104*c0.x + 0.10006792*d0.x + 0.06577253*e0.x + 0.2616236*f0.x + -0.116230436*g0.x + -0.12689975*h0.x + 0.13806346*i0.x; + j = 0.047965724*a0.y + 0.46820837*b0.y + 0.27155674*c0.y + 0.02126596*d0.y + -0.67418236*e0.y + 0.04438237*f0.y + 0.027345048*g0.y + -0.07970538*h0.y + -0.078592815*i0.y; + k = 0.13051371*a0.z + 0.039749797*b0.z + 0.080169655*c0.z + 0.117129445*d0.z + 0.066928*e0.z + -0.09933843*f0.z + -0.10919095*g0.z + -0.019560996*h0.z + -0.112840146*i0.z; + l = 0.08679252*a0.w + 0.21411163*b0.w + -0.028519686*c0.w + 0.18093598*d0.w + -0.7020097*e0.w + 0.023516914*f0.w + -0.020827917*g0.w + 0.015421594*h0.w + 0.009241537*i0.w; + m = -0.077041484*na0.x + 0.059386946*nb0.x + 0.13958155*nc0.x + -0.19068196*nd0.x + -0.28006217*ne0.x + -0.41987765*nf0.x + 0.12358269*ng0.x + -0.014031638*nh0.x + 0.006307132*ni0.x; + n = -0.035933975*na0.y + -0.3855368*nb0.y + -0.18497427*nc0.y + -0.040697515*nd0.y + 0.7990711*ne0.y + -0.08418051*nf0.y + 0.034800954*ng0.y + 0.012859377*nh0.y + 0.076540396*ni0.y; + o = -0.09628029*na0.z + -0.0017863213*nb0.z + -0.016388003*nc0.z + 0.13073064*nd0.z + 0.35412386*ne0.z + 0.33087295*nf0.z + -0.002519779*ng0.z + -0.050436858*nh0.z + 0.06708438*ni0.z; + p = -0.047076955*na0.w + -0.1717576*nb0.w + 0.06098623*nc0.w + -0.04829171*nd0.w + 0.97778696*ne0.w + 0.0683018*nf0.w + 0.0480603*ng0.w + -0.115571074*nh0.w + -0.0324209*ni0.w; + float p0 = i+j+k+l+m+n+o+p+0.03690847; + i = -0.04003973*a0.x + 0.08684451*b0.x + 0.056973178*c0.x + 0.12580861*d0.x + -0.70770407*e0.x + -0.26232213*f0.x + -0.14605756*g0.x + 0.2185047*h0.x + 0.16081442*i0.x; + j = 0.22752708*a0.y + 0.14125547*b0.y + 0.21185426*c0.y + 0.20745178*d0.y + 1.6950947*e0.y + 0.32192886*f0.y + -0.010275441*g0.y + 0.20508891*h0.y + 0.23286316*i0.y; + k = 0.026558029*a0.z + 0.27036312*b0.z + 0.06793841*c0.z + 0.021423433*d0.z + 0.1314685*e0.z + 0.046734232*f0.z + -0.11433229*g0.z + 0.21536611*h0.z + -0.0028018088*i0.z; + l = 0.19790274*a0.w + 0.08455251*b0.w + -0.042842302*c0.w + 0.06765321*d0.w + 0.80784225*e0.w + 0.17140552*f0.w + -0.036292873*g0.w + 0.1945151*h0.w + 0.029864661*i0.w; + m = 0.019306317*na0.x + -0.08108237*nb0.x + -0.060932275*nc0.x + -0.07590298*nd0.x + 0.36097065*ne0.x + -0.49187797*nf0.x + 0.042565785*ng0.x + -0.18200454*nh0.x + -0.042538855*ni0.x; + n = -0.1909921*na0.y + -0.24054891*nb0.y + -0.2331106*nc0.y + 0.06388691*nd0.y + -1.3733596*ne0.y + -0.3168477*nf0.y + -0.018475877*ng0.y + -0.27689803*nh0.y + -0.17154175*ni0.y; + o = 0.03147376*na0.z + -0.07079819*nb0.z + 0.037092578*nc0.z + 0.059319854*nd0.z + 0.058872327*ne0.z + -0.2145504*nf0.z + 0.16398452*ng0.z + 0.0017471232*nh0.z + 0.26451096*ni0.z; + p = -0.19085382*na0.w + -0.18272428*nb0.w + -0.02961356*nc0.w + 0.07483331*nd0.w + -0.53736925*ne0.w + -0.031511623*nf0.w + 0.09394558*ng0.w + -0.38817772*nh0.w + -0.17405929*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.19037424; + i = 0.080417514*a0.x + 0.014180711*b0.x + 0.11582896*c0.x + -0.016692005*d0.x + -0.17195204*e0.x + -0.011422261*f0.x + 0.03137781*g0.x + 0.3729293*h0.x + -0.09650351*i0.x; + j = 0.43793023*a0.y + -0.5691589*b0.y + 0.25009406*c0.y + 0.36788806*d0.y + 1.1486416*e0.y + -0.11426902*f0.y + -0.10744571*g0.y + 0.5247666*h0.y + 0.26761994*i0.y; + k = 0.19873822*a0.z + 0.3752259*b0.z + -0.13712035*c0.z + -0.24905545*d0.z + 0.6611504*e0.z + 0.10681574*f0.z + -0.04248269*g0.z + 0.34954542*h0.z + 0.00978403*i0.z; + l = 0.34088975*a0.w + -0.3931476*b0.w + -0.1533515*c0.w + -0.10607013*d0.w + 0.06654374*e0.w + -0.07201185*f0.w + -0.29845902*g0.w + 0.25622308*h0.w + -0.31139874*i0.w; + m = -0.078585304*na0.x + 0.036581147*nb0.x + -0.13068384*nc0.x + 0.3932218*nd0.x + 0.0708958*ne0.x + -0.12966925*nf0.x + -0.109731354*ng0.x + -0.31248894*nh0.x + 0.37464958*ni0.x; + n = -0.41372105*na0.y + 0.32846758*nb0.y + -0.060158603*nc0.y + -0.128198*nd0.y + -0.18438801*ne0.y + 0.18057844*nf0.y + 0.16595858*ng0.y + -0.16415259*nh0.y + 0.0032799111*ni0.y; + o = -0.06727605*na0.z + -0.24573149*nb0.z + 0.230882*nc0.z + -0.1278132*nd0.z + -0.8236421*ne0.z + -0.05967563*nf0.z + 0.14988032*ng0.z + -0.2628639*nh0.z + 0.22783533*ni0.z; + p = -0.7405207*na0.w + 0.008293306*nb0.w + -0.044343967*nc0.w + -0.30809087*nd0.w + -0.5533927*ne0.w + -0.062474877*nf0.w + 0.11649958*ng0.w + -0.5585487*nh0.w + 0.07918267*ni0.w; + float r0 = i+j+k+l+m+n+o+p+0.03127807; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN4 +//!SAVE LUMAN5 + +#define L_tex LUMAN4_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = -0.09597852*a0.x + 0.3242088*b0.x + -0.124179676*c0.x + 0.226565*d0.x + -0.31539622*e0.x + 0.10865023*f0.x + 0.012854597*g0.x + 0.18704954*h0.x + 0.019613743*i0.x; + float j = -0.2956743*a0.y + 0.45493945*b0.y + -0.07076282*c0.y + -0.30141243*d0.y + 0.174262*e0.y + -0.02470263*f0.y + 0.08572248*g0.y + -0.019336598*h0.y + 0.09933937*i0.y; + float k = 0.07753791*a0.z + -0.3395634*b0.z + 0.19251195*c0.z + -0.10877227*d0.z + -0.014677417*e0.z + -0.110752806*f0.z + -0.022234734*g0.z + 0.0043019606*h0.z + -0.00083276356*i0.z; + float l = -0.037600517*a0.w + 0.124577194*b0.w + -0.28245094*c0.w + 0.09897185*d0.w + -0.56897277*e0.w + 0.016489267*f0.w + 0.07564196*g0.w + 0.14769527*h0.w + 0.044005074*i0.w; + float m = 0.00643241*na0.x + -0.32315695*nb0.x + 0.11598279*nc0.x + -0.20983832*nd0.x + 0.258951*ne0.x + -0.025683874*nf0.x + -0.0635544*ng0.x + -0.2206535*nh0.x + -0.10333466*ni0.x; + float n = 0.21132493*na0.y + -0.3065043*nb0.y + 0.17681308*nc0.y + 0.2733732*nd0.y + -0.08235636*ne0.y + -0.10921411*nf0.y + -0.11584987*ng0.y + -0.024039356*nh0.y + -0.062137943*ni0.y; + float o = -0.059854202*na0.z + 0.18879688*nb0.z + -0.123816796*nc0.z + 0.25184757*nd0.z + -0.32263234*ne0.z + 0.15706868*nf0.z + 0.02998877*ng0.z + 0.053161293*nh0.z + -0.0017673605*ni0.z; + float p = 0.05801878*na0.w + -0.042743735*nb0.w + 0.026558312*nc0.w + -0.04256158*nd0.w + 0.4289233*ne0.w + -0.0007625228*nf0.w + -0.038216792*ng0.w + -0.116650924*nh0.w + 0.06503088*ni0.w; + float o0 = i+j+k+l+m+n+o+p+-0.0019418459; + i = 0.054116286*a0.x + 0.010684147*b0.x + 0.082293995*c0.x + -0.032138538*d0.x + 0.36239687*e0.x + -0.012221512*f0.x + 0.044298165*g0.x + -0.014412877*h0.x + -0.0063282046*i0.x; + j = 0.11786986*a0.y + -0.011583431*b0.y + 0.12155917*c0.y + 0.12135634*d0.y + -0.3782435*e0.y + 0.104112595*f0.y + 0.1437231*g0.y + -0.011320157*h0.y + 0.060530275*i0.y; + k = -0.003993353*a0.z + 0.022192514*b0.z + -0.0034327002*c0.z + 0.002901846*d0.z + 0.42262754*e0.z + -0.0020970134*f0.z + 0.022101413*g0.z + -0.031948846*h0.z + 0.1050437*i0.z; + l = 0.015842827*a0.w + 0.0798861*b0.w + 0.08568371*c0.w + 0.04673564*d0.w + 0.094226986*e0.w + 0.06733949*f0.w + -0.0060305153*g0.w + 0.15045756*h0.w + -0.03379621*i0.w; + m = -0.06038104*na0.x + -0.034142923*nb0.x + -0.05546382*nc0.x + -0.018901724*nd0.x + -0.18012096*ne0.x + -0.00062798214*nf0.x + 0.009348149*ng0.x + -0.014474368*nh0.x + 0.04329652*ni0.x; + n = -0.059717417*na0.y + 0.119962394*nb0.y + -0.064958826*nc0.y + -0.11596286*nd0.y + 0.39725938*ne0.y + -0.114478305*nf0.y + -0.018322872*ng0.y + -0.006377172*nh0.y + 0.06362352*ni0.y; + o = 0.0054720687*na0.z + -0.030189699*nb0.z + -0.015235566*nc0.z + -0.03068064*nd0.z + -0.11610397*ne0.z + -0.03191193*nf0.z + -0.0356475*ng0.z + 0.030068565*nh0.z + -0.050685633*ni0.z; + p = -0.046274967*na0.w + -0.099142164*nb0.w + -0.085632615*nc0.w + -0.038272157*nd0.w + -0.19368412*ne0.w + 0.0003223275*nf0.w + -0.085437156*ng0.w + -0.12736909*nh0.w + -0.05320479*ni0.w; + float p0 = i+j+k+l+m+n+o+p+0.078778625; + i = 0.08257098*a0.x + -0.0022579352*b0.x + -0.012156828*c0.x + 0.072632305*d0.x + -0.6072154*e0.x + -0.17004661*f0.x + 0.016802631*g0.x + -0.22717783*h0.x + -0.061564326*i0.x; + j = 0.045760617*a0.y + 0.061521515*b0.y + -0.029007988*c0.y + 0.015811957*d0.y + 0.11330114*e0.y + 0.009119976*f0.y + -0.16409592*g0.y + 0.029125696*h0.y + -0.35173532*i0.y; + k = -0.045531336*a0.z + -0.017925687*b0.z + -0.104570106*c0.z + 0.103260145*d0.z + 0.085039206*e0.z + 0.06908408*f0.z + -0.07742414*g0.z + 0.33436036*h0.z + -0.078238*i0.z; + l = 0.012518328*a0.w + -0.043969885*b0.w + 0.0506132*c0.w + -0.17977312*d0.w + -0.1145595*e0.w + -0.1745484*f0.w + 0.20776495*g0.w + -0.56244034*h0.w + -0.07415478*i0.w; + m = -0.0675551*na0.x + 0.05070468*nb0.x + 0.08408123*nc0.x + 0.10902953*nd0.x + 0.26186886*ne0.x + 0.16379848*nf0.x + -0.005975606*ng0.x + 0.40121752*nh0.x + 0.1860966*ni0.x; + n = -0.034864623*na0.y + -0.015901396*nb0.y + -0.056751534*nc0.y + 0.224934*nd0.y + -0.06753463*ne0.y + 0.051636614*nf0.y + 0.18318632*ng0.y + 0.53643245*nh0.y + 0.6492825*ni0.y; + o = -0.03634967*na0.z + -0.0062806685*nb0.z + 0.06752919*nc0.z + -0.04426068*nd0.z + -0.25008643*ne0.z + -0.08242178*nf0.z + 0.06756477*ng0.z + -0.2764806*nh0.z + 0.03919717*ni0.z; + p = 0.10824321*na0.w + 0.0719615*nb0.w + 0.022836633*nc0.w + 0.032870874*nd0.w + 0.07953821*ne0.w + 0.20360455*nf0.w + -0.09071379*ng0.w + 0.15641631*nh0.w + 0.108754955*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.0703419; + i = 0.054530073*a0.x + -0.35720757*b0.x + 0.09167906*c0.x + 0.39694676*d0.x + 0.26749727*e0.x + 0.28771624*f0.x + 0.5681281*g0.x + -0.23950431*h0.x + -0.102100216*i0.x; + j = -0.5799231*a0.y + -0.90738946*b0.y + 0.4949409*c0.y + -0.04932236*d0.y + 0.7942325*e0.y + 0.35240924*f0.y + 0.2044775*g0.y + 0.6994759*h0.y + 0.019353973*i0.y; + k = 0.3347879*a0.z + 0.5091003*b0.z + -0.17031951*c0.z + 0.123048164*d0.z + 0.64878803*e0.z + -0.36329588*f0.z + -0.46817833*g0.z + 0.2079882*h0.z + -0.05412046*i0.z; + l = -0.6893422*a0.w + -0.2170392*b0.w + 0.027153356*c0.w + 0.7168854*d0.w + -0.26940683*e0.w + -0.58671874*f0.w + 0.23477685*g0.w + -0.26849586*h0.w + 0.30201417*i0.w; + m = 0.78675926*na0.x + 0.29757124*nb0.x + -0.20282929*nc0.x + -1.0505095*nd0.x + 0.58935297*ne0.x + -0.10334289*nf0.x + -0.2843835*ng0.x + 0.059788395*nh0.x + 0.011678273*ni0.x; + n = 0.34996793*na0.y + 0.24947307*nb0.y + -0.29364213*nc0.y + 0.20136362*nd0.y + -0.2727407*ne0.y + -0.43054128*nf0.y + -0.32888436*ng0.y + -0.7454652*nh0.y + 0.4059068*ni0.y; + o = -0.07356504*na0.z + -0.35029906*nb0.z + 0.09862612*nc0.z + 0.06451627*nd0.z + 0.15965298*ne0.z + 0.043233983*nf0.z + 0.29421222*ng0.z + -0.38419172*nh0.z + -0.05866892*ni0.z; + p = 0.3664988*na0.w + 0.3596013*nb0.w + -0.12897122*nc0.w + 0.14208052*nd0.w + 0.089192405*ne0.w + 0.27535722*nf0.w + -0.3438804*ng0.w + -0.079981126*nh0.w + 0.045426715*ni0.w; + float r0 = i+j+k+l+m+n+o+p+0.1524787; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN5 +//!SAVE LUMAN6 + +#define L_tex LUMAN5_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = 0.04046324*a0.x + 0.014735389*b0.x + -0.0002682781*c0.x + -0.039319854*d0.x + 0.22058657*e0.x + 0.07695267*f0.x + 0.077418946*g0.x + 0.13325845*h0.x + 0.038691103*i0.x; + float j = 0.040963832*a0.y + 0.105689086*b0.y + 0.033340584*c0.y + 0.1200134*d0.y + 1.2192141*e0.y + 0.18370426*f0.y + 0.03399801*g0.y + 0.13453613*h0.y + -0.009928808*i0.y; + float k = 0.08902621*a0.z + -0.085483715*b0.z + 0.052993882*c0.z + -0.10525024*d0.z + 0.0610996*e0.z + -0.026467444*f0.z + 0.018025948*g0.z + -0.00589767*h0.z + 0.024196783*i0.z; + float l = 0.009467872*a0.w + -0.015330612*b0.w + 0.0030996029*c0.w + -0.0076471744*d0.w + -0.020749047*e0.w + 0.022791933*f0.w + -0.016549883*g0.w + 0.019890876*h0.w + -0.0010098215*i0.w; + float m = -0.02717888*na0.x + 0.0036335315*nb0.x + -0.019823067*nc0.x + 0.004060834*nd0.x + 0.022675946*ne0.x + -0.03507232*nf0.x + -0.0029503133*ng0.x + -0.025005482*nh0.x + -0.01091259*ni0.x; + float n = -0.030934187*na0.y + -0.03229802*nb0.y + -0.0065935743*nc0.y + 0.025710566*nd0.y + -0.8996815*ne0.y + -0.1178852*nf0.y + 0.0017351187*ng0.y + -0.013789157*nh0.y + -0.019477608*ni0.y; + float o = 0.013771308*na0.z + 0.06256136*nb0.z + -0.027475204*nc0.z + -0.0023379435*nd0.z + -0.0824879*ne0.z + -0.013148455*nf0.z + -0.013476471*ng0.z + 0.036603387*nh0.z + 0.04276819*ni0.z; + float p = -0.0052243336*na0.w + 0.0011435063*nb0.w + -0.010922929*nc0.w + 0.012664938*nd0.w + -0.13092975*ne0.w + -0.03561616*nf0.w + 0.012207904*ng0.w + -0.007603144*nh0.w + -0.055635393*ni0.w; + float o0 = i+j+k+l+m+n+o+p+0.0048964093; + i = -0.39574856*a0.x + -0.1648057*b0.x + 0.048852682*c0.x + -0.8832539*d0.x + -1.3857893*e0.x + 0.10910333*f0.x + 0.24659039*g0.x + -0.83078027*h0.x + -0.20966282*i0.x; + j = -0.4591745*a0.y + -0.29594332*b0.y + 0.11969786*c0.y + 0.55155253*d0.y + -0.6095633*e0.y + -0.01989395*f0.y + -0.087100305*g0.y + 0.21315934*h0.y + -0.24447405*i0.y; + k = -0.18299514*a0.z + 0.09148732*b0.z + 0.074729174*c0.z + 0.01451769*d0.z + -0.16411151*e0.z + -0.046350308*f0.z + -0.08558227*g0.z + 0.26311517*h0.z + -0.13392153*i0.z; + l = -0.0327498*a0.w + 0.07924664*b0.w + 0.020369893*c0.w + 0.00036012995*d0.w + 0.18644504*e0.w + 0.021062836*f0.w + -0.0047752066*g0.w + -0.019535767*h0.w + 0.009709619*i0.w; + m = 0.13288204*na0.x + 0.029656962*nb0.x + 0.07311512*nc0.x + 0.14313999*nd0.x + 0.56644523*ne0.x + 0.14797804*nf0.x + 0.12596226*ng0.x + 0.22742471*nh0.x + 0.089742064*ni0.x; + n = 0.1892585*na0.y + 0.023231648*nb0.y + -0.18776754*nc0.y + -0.7594511*nd0.y + 0.8324623*ne0.y + 0.015639866*nf0.y + 0.13374005*ng0.y + -0.32821357*nh0.y + 0.11980797*ni0.y; + o = 0.50891566*na0.z + -0.061541505*nb0.z + -0.22972333*nc0.z + 0.21540114*nd0.z + -0.18484059*ne0.z + -0.025804685*nf0.z + 0.0028910888*ng0.z + -0.1935325*nh0.z + 0.31634408*ni0.z; + p = 0.0014322877*na0.w + -0.015277725*nb0.w + 0.0017917431*nc0.w + 0.1006944*nd0.w + 0.18176948*ne0.w + 0.014831943*nf0.w + 0.1483141*ng0.w + 0.081011966*nh0.w + 0.09606741*ni0.w; + float p0 = i+j+k+l+m+n+o+p+-0.07033543; + i = 0.46537486*a0.x + 0.35346523*b0.x + -0.034309685*c0.x + -0.43613064*d0.x + -0.8117452*e0.x + -0.14820647*f0.x + -0.36851904*g0.x + 0.36691928*h0.x + 0.09633467*i0.x; + j = 0.03274515*a0.y + 0.12292336*b0.y + -0.1621055*c0.y + -0.37666368*d0.y + 0.9280238*e0.y + 0.03958912*f0.y + 0.17052563*g0.y + 0.09307256*h0.y + -0.11879444*i0.y; + k = 0.011698497*a0.z + -0.19269797*b0.z + -0.16302618*c0.z + 0.037150856*d0.z + -0.16392735*e0.z + -0.12373209*f0.z + -0.18614432*g0.z + -0.12011694*h0.z + 0.09273491*i0.z; + l = -0.046311308*a0.w + 0.04476493*b0.w + -0.041215967*c0.w + 0.018216522*d0.w + 0.11473393*e0.w + -0.10053504*f0.w + -0.060967118*g0.w + -0.03618437*h0.w + 0.001688976*i0.w; + m = -0.24747224*na0.x + -0.0076296516*nb0.x + 0.1111047*nc0.x + 0.3819905*nd0.x + 0.3970804*ne0.x + 0.3104748*nf0.x + -0.051673863*ng0.x + -0.049815454*nh0.x + -0.12487531*ni0.x; + n = -0.13329297*na0.y + -0.06950387*nb0.y + -0.1768481*nc0.y + 0.21811922*nd0.y + 0.378857*ne0.y + -0.21782632*nf0.y + -0.116539694*ng0.y + 0.17979085*nh0.y + 0.18095481*ni0.y; + o = 0.43092886*na0.z + 0.4126806*nb0.z + 0.40301523*nc0.z + 0.4705472*nd0.z + 0.57200426*ne0.z + 0.60878164*nf0.z + -0.06799496*ng0.z + 0.10386602*nh0.z + -0.18540111*ni0.z; + p = 0.041190043*na0.w + 0.14185017*nb0.w + 0.09648255*nc0.w + 0.09766787*nd0.w + -0.37151045*ne0.w + -0.03486635*nf0.w + 0.14197278*ng0.w + 0.29088745*nh0.w + 0.16969803*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.16171035; + i = 0.4303196*a0.x + 0.064631134*b0.x + -0.039682325*c0.x + 0.25032383*d0.x + -0.7347892*e0.x + 0.26412666*f0.x + -0.08636694*g0.x + -0.40137205*h0.x + 0.052083053*i0.x; + j = 0.2614006*a0.y + 0.14647369*b0.y + -0.014280629*c0.y + -0.6632378*d0.y + -1.3091056*e0.y + 0.00048285414*f0.y + 0.33573303*g0.y + 0.9322179*h0.y + 0.25560188*i0.y; + k = 0.30360696*a0.z + 0.21467467*b0.z + -0.044186305*c0.z + -0.3108944*d0.z + -0.7687483*e0.z + -0.053097602*f0.z + 0.073559746*g0.z + -0.05820314*h0.z + -0.06039339*i0.z; + l = 0.012419113*a0.w + -0.041542303*b0.w + -0.0030724593*c0.w + 0.10136853*d0.w + -0.059104513*e0.w + -0.029450646*f0.w + 0.0037148865*g0.w + 0.026545389*h0.w + 0.023753045*i0.w; + m = -0.27366745*na0.x + 0.026242163*nb0.x + 0.10695166*nc0.x + 0.024651896*nd0.x + -0.067803666*ne0.x + 0.21709773*nf0.x + 0.17141151*ng0.x + 0.39313924*nh0.x + 0.05491188*ni0.x; + n = -0.24999681*na0.y + -0.0149813965*nb0.y + -0.11390382*nc0.y + 0.38644975*nd0.y + 1.091798*ne0.y + 0.049615655*nf0.y + -0.3450869*ng0.y + -0.66309226*nh0.y + -0.18472806*ni0.y; + o = 0.22231762*na0.z + 0.17065015*nb0.z + 0.15852334*nc0.z + 0.2802539*nd0.z + 1.3999426*ne0.z + -0.07246133*nf0.z + 0.20702864*ng0.z + 0.39279854*nh0.z + 0.2664954*ni0.z; + p = 0.004953836*na0.w + 0.13166036*nb0.w + 0.039747827*nc0.w + -0.092738666*nd0.w + -0.16943815*ne0.w + -0.07694382*nf0.w + -0.15704772*ng0.w + 0.00020125543*nh0.w + -0.0033851033*ni0.w; + float r0 = i+j+k+l+m+n+o+p+-0.19337739; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN6 +//!SAVE LUMAN7 + +#define L_tex LUMAN6_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = -0.027537398*a0.x + -0.03832216*b0.x + -0.1591863*c0.x + -0.26930097*d0.x + 1.496357*e0.x + -0.732409*f0.x + -0.08807835*g0.x + -0.3267168*h0.x + -0.027697973*i0.x; + float j = 0.045650784*a0.y + 0.07423937*b0.y + -0.28104565*c0.y + -0.16404267*d0.y + -0.27688447*e0.y + 0.1753845*f0.y + 0.08667494*g0.y + -0.24310407*h0.y + -0.2387649*i0.y; + float k = 0.011307029*a0.z + -0.15920246*b0.z + 0.1749019*c0.z + 0.0864728*d0.z + 0.32644588*e0.z + -0.021537697*f0.z + 0.052467912*g0.z + 0.04679955*h0.z + 0.047825363*i0.z; + float l = -0.022269413*a0.w + 0.33980212*b0.w + 0.16864336*c0.w + 0.082288966*d0.w + -0.06350156*e0.w + 0.13752197*f0.w + 0.042304493*g0.w + 0.15443622*h0.w + 0.046571467*i0.w; + float m = 0.0038585584*na0.x + -0.036202244*nb0.x + -0.29005575*nc0.x + -0.06418919*nd0.x + -1.419668*ne0.x + 0.14456362*nf0.x + -0.005725012*ng0.x + 0.5045954*nh0.x + 0.11732795*ni0.x; + float n = -0.16101104*na0.y + -0.02420836*nb0.y + 0.13611177*nc0.y + 0.029370116*nd0.y + 1.1994928*ne0.y + -0.15178941*nf0.y + 0.0090092765*ng0.y + -0.20478143*nh0.y + -0.17148101*ni0.y; + float o = -0.053002063*na0.z + -0.035893742*nb0.z + -0.110651344*nc0.z + -0.37151214*nd0.z + -0.9576195*ne0.z + -0.46538743*nf0.z + 0.17428482*ng0.z + 0.25815699*nh0.z + 0.14889659*ni0.z; + float p = -0.2277235*na0.w + -0.6884181*nb0.w + -0.63734025*nc0.w + -0.13596478*nd0.w + -0.55789053*ne0.w + -0.3439862*nf0.w + -0.059143618*ng0.w + 0.030058485*nh0.w + 0.10810205*ni0.w; + float o0 = i+j+k+l+m+n+o+p+0.39991605; + i = -0.28546834*a0.x + 0.06982972*b0.x + 0.36571932*c0.x + 0.025255322*d0.x + 0.4913122*e0.x + -0.54014283*f0.x + -0.04262618*g0.x + -0.014767507*h0.x + 0.1157787*i0.x; + j = -0.033387233*a0.y + 0.1438295*b0.y + 0.043908857*c0.y + 0.23875113*d0.y + 0.23944983*e0.y + 0.38140768*f0.y + 0.10405573*g0.y + -0.28033695*h0.y + 0.19296218*i0.y; + k = 0.0795919*a0.z + -0.009298124*b0.z + -0.1966298*c0.z + -0.10623091*d0.z + -0.13389623*e0.z + -0.20906673*f0.z + 0.012903121*g0.z + 0.13463002*h0.z + 0.0069053117*i0.z; + l = 0.07620989*a0.w + 0.444145*b0.w + 0.21698916*c0.w + -0.059253845*d0.w + 0.33355483*e0.w + 0.25932938*f0.w + -0.13568759*g0.w + -0.12767054*h0.w + -0.051579196*i0.w; + m = 0.10081049*na0.x + -0.34150627*nb0.x + -0.035512667*nc0.x + -0.29685998*nd0.x + 1.7315077*ne0.x + 0.28415534*nf0.x + 0.0022732737*ng0.x + -0.61264104*nh0.x + -0.16202453*ni0.x; + n = 0.062643774*na0.y + 0.2885083*nb0.y + -0.027835878*nc0.y + -0.029790701*nd0.y + -0.5481254*ne0.y + -0.2478993*nf0.y + -0.033092864*ng0.y + 0.33226776*nh0.y + 0.22110416*ni0.y; + o = -0.26636478*na0.z + -0.10020174*nb0.z + 0.24355102*nc0.z + -0.15196387*nd0.z + 0.25725785*ne0.z + -0.105960734*nf0.z + -0.053724907*ng0.z + -0.61655164*nh0.z + -0.3888296*ni0.z; + p = 0.05319454*na0.w + -0.3448596*nb0.w + 0.02398366*nc0.w + 0.17685084*nd0.w + 0.088528976*ne0.w + -0.006480539*nf0.w + 0.22043355*ng0.w + -0.11913634*nh0.w + -0.24229069*ni0.w; + float p0 = i+j+k+l+m+n+o+p+0.0698082; + i = -0.29397583*a0.x + 0.1783425*b0.x + -0.016915536*c0.x + 0.18143447*d0.x + 0.050463*e0.x + -0.5750633*f0.x + -0.09805144*g0.x + -0.23439899*h0.x + 0.014174429*i0.x; + j = 0.030622737*a0.y + 0.09131598*b0.y + -0.27484027*c0.y + -0.042807933*d0.y + -0.49584112*e0.y + 0.47780067*f0.y + 0.07179059*g0.y + -0.21984039*h0.y + -0.25448912*i0.y; + k = 0.064491056*a0.z + -0.04929943*b0.z + 0.03411262*c0.z + 0.02332043*d0.z + 0.259224*e0.z + -0.16006759*f0.z + 0.052105837*g0.z + 0.15662266*h0.z + 0.05741607*i0.z; + l = 0.03419898*a0.w + 0.27976283*b0.w + 0.19813572*c0.w + -0.03766979*d0.w + -0.0044533233*e0.w + 0.2983032*f0.w + -0.07778916*g0.w + 0.10094576*h0.w + 0.060812432*i0.w; + m = 0.12805411*na0.x + -0.51367366*nb0.x + 0.008197258*nc0.x + -0.56395197*nd0.x + -1.243085*ne0.x + 0.116005324*nf0.x + 0.03238612*ng0.x + 0.26990584*nh0.x + 0.06575366*ni0.x; + n = -0.19594547*na0.y + 0.22430868*nb0.y + 0.057090167*nc0.y + 0.122728884*nd0.y + 0.5113698*ne0.y + -0.25419077*nf0.y + -0.009283693*ng0.y + -0.12308158*nh0.y + -0.11459907*ni0.y; + o = -0.2136807*na0.z + -0.1401248*nb0.z + 0.06467563*nc0.z + -0.31790277*nd0.z + -0.92976284*ne0.z + -0.44703412*nf0.z + 0.08179573*ng0.z + 0.007016923*nh0.z + 0.06663411*ni0.z; + p = -0.18492955*na0.w + -0.6510635*nb0.w + -0.50176597*nc0.w + 0.070071384*nd0.w + -0.33312446*ne0.w + -0.40393078*nf0.w + 0.025449356*ng0.w + 0.0062464178*nh0.w + -0.0042728786*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.14438835; + i = -0.084957816*a0.x + 0.21759176*b0.x + -0.12676741*c0.x + -0.17032051*d0.x + 0.21418823*e0.x + 0.0516223*f0.x + -0.05529637*g0.x + 0.17844404*h0.x + -0.04393412*i0.x; + j = -0.09776986*a0.y + 0.29587868*b0.y + -0.17895019*c0.y + 0.23705244*d0.y + -0.23508924*e0.y + 0.23233664*f0.y + 0.11280542*g0.y + -0.10736791*h0.y + -7.6242926e-05*i0.y; + k = 0.008180588*a0.z + -0.21015471*b0.z + 0.08178927*c0.z + -0.051615402*d0.z + -0.18805277*e0.z + 0.07897466*f0.z + -0.054359443*g0.z + -0.011516885*h0.z + -0.0064640474*i0.z; + l = -0.120380774*a0.w + 0.6387797*b0.w + -0.18016112*c0.w + 0.040899348*d0.w + 0.1949798*e0.w + -0.082700744*f0.w + -0.018996445*g0.w + -0.109704494*h0.w + -0.00053294667*i0.w; + m = 0.08493739*na0.x + 0.023677751*nb0.x + -0.050535593*nc0.x + 0.36929327*nd0.x + 0.21340472*ne0.x + -0.32169485*nf0.x + 0.11782148*ng0.x + -0.09112837*nh0.x + -0.018984098*ni0.x; + n = -0.023597453*na0.y + 0.024977108*nb0.y + -0.027003283*nc0.y + -0.1414026*nd0.y + 0.099894576*ne0.y + 0.03973678*nf0.y + 0.0010171765*ng0.y + 0.051153578*nh0.y + -0.0027343174*ni0.y; + o = -0.13675037*na0.z + 0.2364966*nb0.z + -0.08819653*nc0.z + 0.17875879*nd0.z + 0.18237808*ne0.z + -0.14008285*nf0.z + 0.092474155*ng0.z + -0.07054796*nh0.z + -0.08649826*ni0.z; + p = 0.09751934*na0.w + -0.28854543*nb0.w + 0.081181064*nc0.w + -0.016613048*nd0.w + -0.0985543*ne0.w + 0.13922796*nf0.w + 0.009947558*ng0.w + -0.050309543*nh0.w + 0.0055232816*ni0.w; + float r0 = i+j+k+l+m+n+o+p+-0.005724964; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN7 +//!SAVE LUMAN8 + +#define L_tex LUMAN7_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = 0.023095222*a0.x + 0.088675804*b0.x + 0.019515652*c0.x + 0.03876863*d0.x + 0.28370586*e0.x + 0.052443158*f0.x + 0.012073562*g0.x + 0.054533053*h0.x + 0.009309134*i0.x; + float j = -0.010418687*a0.y + -0.031180434*b0.y + -0.027810663*c0.y + -0.031218817*d0.y + 0.08831375*e0.y + 0.048364963*f0.y + -0.013520621*g0.y + -0.024290506*h0.y + -0.0071420255*i0.y; + float k = 0.06729409*a0.z + -0.18290426*b0.z + -0.04015622*c0.z + -0.06585363*d0.z + -0.04277582*e0.z + -0.0031648334*f0.z + -0.036526777*g0.z + 0.019262873*h0.z + -0.06440996*i0.z; + float l = -0.024598632*a0.w + 0.06775653*b0.w + -0.027943304*c0.w + -0.060332987*d0.w + -0.06108914*e0.w + -0.38447067*f0.w + -0.028799307*g0.w + -0.32565302*h0.w + -0.0820627*i0.w; + float m = -0.036973793*na0.x + -0.004178863*nb0.x + -0.013591895*nc0.x + -0.028666824*nd0.x + -0.20259032*ne0.x + -0.047049534*nf0.x + 0.03513545*ng0.x + 0.031252332*nh0.x + -0.00072113174*ni0.x; + float n = -0.023275118*na0.y + 0.12866385*nb0.y + -0.0047646784*nc0.y + 0.09065336*nd0.y + 0.19106166*ne0.y + 0.07720742*nf0.y + 0.07348565*ng0.y + -0.010560173*nh0.y + -0.0021694326*ni0.y; + float o = -0.0074641155*na0.z + 0.11848335*nb0.z + 0.033949424*nc0.z + 0.102563836*nd0.z + 0.11375473*ne0.z + 0.09258311*nf0.z + -0.033664387*ng0.z + 0.0197137*nh0.z + 0.032966334*ni0.z; + float p = 0.024047868*na0.w + -0.24709022*nb0.w + -0.2601394*nc0.w + 0.027225772*nd0.w + -0.23746225*ne0.w + -0.012594051*nf0.w + -0.07349794*ng0.w + -0.15158227*nh0.w + -0.2104957*ni0.w; + float o0 = i+j+k+l+m+n+o+p+-0.25017452; + i = -0.076065876*a0.x + 0.02043564*b0.x + 0.036401585*c0.x + 0.043759227*d0.x + 0.371543*e0.x + 0.0017194746*f0.x + 0.07603999*g0.x + -0.018234106*h0.x + 0.09166208*i0.x; + j = 0.10994385*a0.y + -0.036372717*b0.y + -0.007901915*c0.y + -0.13689917*d0.y + 0.31160897*e0.y + -0.099066*f0.y + -0.008666954*g0.y + -0.058747575*h0.y + 0.051024612*i0.y; + k = -0.23377013*a0.z + 0.07197715*b0.z + 0.032386325*c0.z + 0.25607866*d0.z + -0.57679576*e0.z + -0.17958632*f0.z + -0.09288573*g0.z + 0.032775987*h0.z + -0.032033086*i0.z; + l = -0.06958261*a0.w + -0.38490036*b0.w + -0.16421184*c0.w + 0.03861677*d0.w + 1.0647631*e0.w + 0.17515695*f0.w + -0.08448393*g0.w + -0.39466596*h0.w + -0.27870917*i0.w; + m = 0.05919463*na0.x + -0.055675797*nb0.x + -0.018722864*nc0.x + -0.12993331*nd0.x + -0.40171558*ne0.x + -0.07768799*nf0.x + -0.06001731*ng0.x + 0.14385901*nh0.x + -0.12873684*ni0.x; + n = 0.093186125*na0.y + 0.112590514*nb0.y + 0.13324285*nc0.y + -0.0469093*nd0.y + 0.032717*ne0.y + -0.061363228*nf0.y + 0.14042394*ng0.y + 0.13547798*nh0.y + 0.015560506*ni0.y; + o = 0.03303404*na0.z + -0.1882256*nb0.z + 0.093654186*nc0.z + 0.05690944*nd0.z + 0.869429*ne0.z + -0.07732642*nf0.z + 0.029356474*ng0.z + -0.14269826*nh0.z + 0.08325262*ni0.z; + p = 1.3574028e-05*na0.w + 0.16500515*nb0.w + -0.22035407*nc0.w + 0.12756291*nd0.w + -1.2695918*ne0.w + -0.06583852*nf0.w + -0.02346539*ng0.w + -0.29050758*nh0.w + -0.00058551447*ni0.w; + float p0 = i+j+k+l+m+n+o+p+-0.32460514; + i = -0.028411858*a0.x + -0.06502476*b0.x + 0.005506057*c0.x + -0.02065754*d0.x + -0.27725258*e0.x + -0.16733906*f0.x + -0.03028571*g0.x + -0.025893265*h0.x + 0.11180306*i0.x; + j = 0.044810914*a0.y + 0.0014952115*b0.y + 0.007166974*c0.y + 0.0030764928*d0.y + -0.48590574*e0.y + -0.0049648457*f0.y + -0.003955563*g0.y + -0.030718582*h0.y + 0.045998596*i0.y; + k = -0.033717085*a0.z + 0.17641076*b0.z + 0.0064347754*c0.z + 0.19182369*d0.z + 0.24730518*e0.z + 0.058232464*f0.z + 0.04889152*g0.z + 0.22933209*h0.z + -0.07484277*i0.z; + l = 0.008050995*a0.w + -0.041974865*b0.w + 0.03150534*c0.w + 0.15421486*d0.w + 1.0763092*e0.w + 0.33450183*f0.w + 0.007857187*g0.w + 0.17052104*h0.w + -0.17598473*i0.w; + m = 0.05216849*na0.x + -0.02699838*nb0.x + -0.0016451366*nc0.x + 0.026851216*nd0.x + 0.27528808*ne0.x + 0.17918247*nf0.x + 0.00075830554*ng0.x + 0.041555487*nh0.x + -0.08034286*ni0.x; + n = -0.030616183*na0.y + 0.030711962*nb0.y + 0.0100233685*nc0.y + -0.06026578*nd0.y + 0.32679543*ne0.y + -0.20025784*nf0.y + -0.030410208*ng0.y + 0.09807905*nh0.y + 0.051524427*ni0.y; + o = 0.008445165*na0.z + -0.13049273*nb0.z + 0.015668884*nc0.z + -0.13367654*nd0.z + -0.133823*ne0.z + -0.17434305*nf0.z + 0.07695557*ng0.z + -0.21806277*nh0.z + 0.10826007*ni0.z; + p = 0.09218729*na0.w + 0.3068162*nb0.w + 0.16703202*nc0.w + -0.08007084*nd0.w + -0.7652071*ne0.w + -0.054645624*nf0.w + 0.08314212*ng0.w + 0.11377628*nh0.w + 0.2098345*ni0.w; + float q0 = i+j+k+l+m+n+o+p+0.29825854; + i = 0.008392284*a0.x + -0.011715544*b0.x + 0.023170955*c0.x + 0.093332864*d0.x + 0.4111941*e0.x + 0.040952653*f0.x + 0.027631473*g0.x + 0.159317*h0.x + -0.063353576*i0.x; + j = -0.017223362*a0.y + 0.09427027*b0.y + 0.02895971*c0.y + 0.033313658*d0.y + 0.15276653*e0.y + -0.081052944*f0.y + -0.052108422*g0.y + 0.0800538*h0.y + -0.019928783*i0.y; + k = 0.0131623475*a0.z + 0.10337944*b0.z + -0.023866715*c0.z + -0.08219934*d0.z + -0.41991413*e0.z + 0.1393256*f0.z + 0.08876665*g0.z + -0.008065249*h0.z + 0.06677936*i0.z; + l = -0.084787*a0.w + -0.21261129*b0.w + -0.12980078*c0.w + -0.03659002*d0.w + 0.37194324*e0.w + 0.40455315*f0.w + 0.0060305526*g0.w + -0.10518265*h0.w + -0.010430722*i0.w; + m = -0.012547314*na0.x + -0.08181393*nb0.x + -0.04246661*nc0.x + 0.0040180096*nd0.x + -0.40135285*ne0.x + -0.036973383*nf0.x + -0.0069499887*ng0.x + -0.066302136*nh0.x + 0.02571455*ni0.x; + n = 0.21166039*na0.y + 0.17538953*nb0.y + 0.031203225*nc0.y + 0.025797121*nd0.y + -0.5401104*ne0.y + 0.065669365*nf0.y + 0.053330794*ng0.y + 0.18131651*nh0.y + 0.19454113*ni0.y; + o = 0.08176905*na0.z + -0.06013371*nb0.z + 0.0018070769*nc0.z + 0.0034025863*nd0.z + 0.49186924*ne0.z + -0.03564626*nf0.z + -0.15229581*ng0.z + 0.107180454*nh0.z + -0.011461588*ni0.z; + p = -0.012074635*na0.w + 0.2919535*nb0.w + 0.42858946*nc0.w + -0.11339507*nd0.w + -0.51076794*ne0.w + -0.44883406*nf0.w + -0.016805425*ng0.w + 0.316627*nh0.w + -0.106291555*ni0.w; + float r0 = i+j+k+l+m+n+o+p+-0.30891928; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN-(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN8 +//!SAVE LUMAN9 + +#define L_tex LUMAN8_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + float i = 0.011191786*a0.x + 0.23951381*b0.x + -0.10570748*c0.x + -0.0015254265*d0.x + -0.3949229*e0.x + 0.15096109*f0.x + 0.13656913*g0.x + -0.3877109*h0.x + 0.18022504*i0.x; + float j = 0.024491772*a0.y + 0.035906848*b0.y + -0.0005005115*c0.y + -0.007313129*d0.y + 0.55162466*e0.y + -0.08579296*f0.y + -0.018405797*g0.y + 0.12538382*h0.y + -0.08658713*i0.y; + float k = 0.028113367*a0.z + 0.2766013*b0.z + -0.13962306*c0.z + -0.3118571*d0.z + -0.19919883*e0.z + -0.3087286*f0.z + -0.02967599*g0.z + -0.021850891*h0.z + 0.043625243*i0.z; + float l = -0.082083434*a0.w + 0.038183037*b0.w + -0.04495785*c0.w + 0.05067031*d0.w + -0.12048432*e0.w + 0.008085282*f0.w + -0.033083208*g0.w + -0.032013528*h0.w + -0.018831285*i0.w; + float m = -0.071037754*na0.x + -0.0583042*nb0.x + 0.0033310892*nc0.x + 0.011530962*nd0.x + 0.4835722*ne0.x + 0.116438776*nf0.x + 0.07681682*ng0.x + 0.028977543*nh0.x + -0.102326706*ni0.x; + float n = 0.011561477*na0.y + -0.06370286*nb0.y + 0.09494302*nc0.y + 0.15852202*nd0.y + -0.6013122*ne0.y + 0.31835455*nf0.y + 0.07656031*ng0.y + -0.15250978*nh0.y + 0.0660804*ni0.y; + float o = -0.012869594*na0.z + -0.1694734*nb0.z + 0.007840592*nc0.z + 0.13365789*nd0.z + 0.5910324*ne0.z + 0.023994336*nf0.z + -0.1231746*ng0.z + 0.1182651*nh0.z + -0.073815055*ni0.z; + float p = -0.015364551*na0.w + 0.032263234*nb0.w + -0.16016856*nc0.w + 0.08521244*nd0.w + 0.36012435*ne0.w + 0.15904869*nf0.w + -0.12220308*ng0.w + 0.12974344*nh0.w + -0.040795863*ni0.w; + float o0 = i+j+k+l+m+n+o+p+0.053871352; + i = -0.1588499*a0.x + -0.21851647*b0.x + 0.25986034*c0.x + -0.24344647*d0.x + -1.6035624*e0.x + -0.5991394*f0.x + 0.07953742*g0.x + -0.8776652*h0.x + 0.3819521*i0.x; + j = -0.043418065*a0.y + -0.12881063*b0.y + -0.024456538*c0.y + -0.1573027*d0.y + 0.06311247*e0.y + 0.06984885*f0.y + 0.025448142*g0.y + 0.19670363*h0.y + 0.081706375*i0.y; + k = -0.11016761*a0.z + -0.8923534*b0.z + 0.06994402*c0.z + -0.22224432*d0.z + -1.7209625*e0.z + 0.13240254*f0.z + -0.34291184*g0.z + 0.098353565*h0.z + -0.008249665*i0.z; + l = 0.123915665*a0.w + 0.039321687*b0.w + 0.024920449*c0.w + 0.041610703*d0.w + -0.13273434*e0.w + -0.012516724*f0.w + 0.010549669*g0.w + 0.029736295*h0.w + -0.009006617*i0.w; + m = 0.1347265*na0.x + 0.12257134*nb0.x + -0.03426787*nc0.x + -0.29054257*nd0.x + 1.5492249*ne0.x + -0.15956564*nf0.x + 0.30979466*ng0.x + -0.22267725*nh0.x + 0.2648195*ni0.x; + n = -0.04218395*na0.y + 0.25030056*nb0.y + -0.13068442*nc0.y + 0.07904602*nd0.y + -1.0424439*ne0.y + -0.41004273*nf0.y + -0.09722738*ng0.y + -0.24588263*nh0.y + 0.060979873*ni0.y; + o = -0.03040991*na0.z + 0.2839475*nb0.z + 0.039652344*nc0.z + -0.02847107*nd0.z + -0.04163423*ne0.z + 0.024968851*nf0.z + 0.07027608*ng0.z + 0.11467834*nh0.z + 0.10754681*ni0.z; + p = 0.06490522*na0.w + 0.18249801*nb0.w + 0.689666*nc0.w + 0.08065804*nd0.w + -1.0966055*ne0.w + -0.9221953*nf0.w + 0.04199578*ng0.w + 0.28271073*nh0.w + 0.061096374*ni0.w; + float p0 = i+j+k+l+m+n+o+p+-0.09490294; + i = 0.22382683*a0.x + -0.23359734*b0.x + -0.010614761*c0.x + 0.12763542*d0.x + 0.07141207*e0.x + -0.070608266*f0.x + -0.37325507*g0.x + 0.48005813*h0.x + -0.25752664*i0.x; + j = -0.023048563*a0.y + 0.10949794*b0.y + -0.022621715*c0.y + 0.12152201*d0.y + -0.27487656*e0.y + 0.06214247*f0.y + 0.10162017*g0.y + -0.020285988*h0.y + -0.005366798*i0.y; + k = 0.11171756*a0.z + -0.012062316*b0.z + 0.124257565*c0.z + 0.37239715*d0.z + 0.14933206*e0.z + 0.08563614*f0.z + 0.15544249*g0.z + -0.3293271*h0.z + -0.07382031*i0.z; + l = -0.038293127*a0.w + -0.123794444*b0.w + 0.06780399*c0.w + -0.13198623*d0.w + -0.18499732*e0.w + -0.06403023*f0.w + -0.01241917*g0.w + -0.052804*h0.w + -0.06691653*i0.w; + m = -0.06774789*na0.x + 0.023599042*nb0.x + -0.020330759*nc0.x + 0.22454411*nd0.x + 1.1471069*ne0.x + 0.117351554*nf0.x + -0.15335907*ng0.x + 0.338719*nh0.x + -0.042319488*ni0.x; + n = 0.03664181*na0.y + -0.0138222305*nb0.y + 0.048081644*nc0.y + -0.049309026*nd0.y + -0.62234706*ne0.y + 0.10059077*nf0.y + -0.15487589*ng0.y + 0.25435567*nh0.y + -0.057935156*ni0.y; + o = 0.018089186*na0.z + 0.020494046*nb0.z + -0.066466086*nc0.z + -0.041628707*nd0.z + -0.082925685*ne0.z + -0.040409505*nf0.z + 0.09522753*ng0.z + -0.072019234*nh0.z + 0.026274689*ni0.z; + p = -0.008643523*na0.w + 0.2802247*nb0.w + 0.09669575*nc0.w + -0.19446205*nd0.w + -1.3981148*ne0.w + 0.3947671*nf0.w + 0.3277589*ng0.w + 0.1827564*nh0.w + -0.037608545*ni0.w; + float q0 = i+j+k+l+m+n+o+p+-0.33811548; + i = 0.508959*a0.x + -1.1897582*b0.x + 0.27264822*c0.x + -0.08196677*d0.x + 1.0336326*e0.x + -0.9140986*f0.x + -0.8927567*g0.x + 0.92622685*h0.x + -0.83850926*i0.x; + j = -0.09935804*a0.y + 0.1434052*b0.y + -0.03832266*c0.y + 0.33068126*d0.y + 0.69079924*e0.y + 0.37703332*f0.y + 0.26853803*g0.y + 0.051550016*h0.y + 0.1365815*i0.y; + k = 0.50282323*a0.z + -0.8693461*b0.z + 0.68779755*c0.z + 1.2486949*d0.z + -3.4707944*e0.z + 0.91403955*f0.z + 0.380638*g0.z + -0.5875639*h0.z + -0.2996781*i0.z; + l = 0.089513*a0.w + -0.49879786*b0.w + 0.27097106*c0.w + -0.54017377*d0.w + 0.7231357*e0.w + -0.12225226*f0.w + -0.061104745*g0.w + -0.12059939*h0.w + -0.22460648*i0.w; + m = 0.111952856*na0.x + -0.06090702*nb0.x + -0.14363275*nc0.x + 0.07970135*nd0.x + 1.2029066*ne0.x + -0.06887455*nf0.x + -0.2361067*ng0.x + 0.22621937*nh0.x + 0.34217682*ni0.x; + n = 0.057109337*na0.y + 0.25379825*nb0.y + -0.03310617*nc0.y + -0.51321745*nd0.y + 0.27301365*ne0.y + -0.2702349*nf0.y + -0.40828884*ng0.y + 0.48985386*nh0.y + -0.2279193*ni0.y; + o = 0.01117149*na0.z + 0.34376913*nb0.z + -0.18173458*nc0.z + -0.013281286*nd0.z + 1.6062312*ne0.z + -0.3641134*nf0.z + 0.40594944*ng0.z + -0.14061864*nh0.z + 0.1831309*ni0.z; + p = 0.0046956087*na0.w + 0.24169385*nb0.w + 1.0654216*nc0.w + 0.2112037*nd0.w + 1.1477715*ne0.w + 0.16534662*nf0.w + 0.6379531*ng0.w + 0.68865937*nh0.w + 0.038767826*ni0.w; + float r0 = i+j+k+l+m+n+o+p+0.11570526; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN-(L)-Conv-Reduce +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN1 +//!BIND LUMAN2 +//!BIND LUMAN3 +//!BIND LUMAN4 +//!BIND LUMAN5 +//!BIND LUMAN6 +//!BIND LUMAN7 +//!BIND LUMAN8 +//!BIND LUMAN9 +//!SAVE LUMAN0 + +vec4 hook() { + vec4 a = LUMAN1_tex(HOOKED_pos); + vec4 b = LUMAN2_tex(HOOKED_pos); + vec4 c = LUMAN3_tex(HOOKED_pos); + vec4 d = LUMAN4_tex(HOOKED_pos); + vec4 e = LUMAN5_tex(HOOKED_pos); + vec4 f = LUMAN6_tex(HOOKED_pos); + vec4 g = LUMAN7_tex(HOOKED_pos); + vec4 h = LUMAN8_tex(HOOKED_pos); + vec4 i = LUMAN9_tex(HOOKED_pos); + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + float o = -0.047081478*a.x + -0.032881256*a.y + -0.043644037*a.z + -0.036561083*a.w + 0.021485493*na.x + 0.018438356*na.y + -0.03554129*na.z + 0.043506186*na.w + 0.014266481*b.x + -0.035737853*b.y + -0.012823628*b.z + 0.0009264891*b.w + -0.05006617*nb.x + -4.4093795e-05*nb.y + 0.0135566415*nb.z + 0.0045723473*nb.w + 0.021764634*c.x + 0.026693553*c.y + 0.0032707953*c.z + 0.013746871*c.w + 0.007973638*nc.x + -0.025660595*nc.y + -0.017825818*nc.z + -0.010194548*nc.w + -0.017283116*d.x + 0.029000388*d.y + -0.025827635*d.z + 0.0014580291*d.w + 0.009698671*nd.x + -0.07251702*nd.y + 0.025386544*nd.z + 0.0102123*nd.w + -0.029390823*e.x + 0.1449412*e.y + -0.004747693*e.z + 0.0015781911*e.w + -0.012161642*ne.x + 0.020992773*ne.y + 0.0025863629*ne.z + 0.020216871*ne.w + -0.014964326*f.x + 0.0057226857*f.y + 0.004602058*f.z + -0.0017072024*f.w + 0.00014010703*nf.x + 0.027396023*nf.y + 0.053284008*nf.z + -0.00054560095*nf.w + -0.08465135*g.x + -0.025449844*g.y + 0.07974024*g.z + -0.026081605*g.w + 0.08998345*ng.x + -0.020028451*ng.y + -0.088179365*ng.z + 0.017214278*ng.w + 0.13374187*h.x + 0.0687001*h.y + 0.07197837*h.z + 0.10976076*h.w + -0.32598913*nh.x + 0.114709705*nh.y + 0.025096709*nh.z + 0.15262882*nh.w + 0.039497968*i.x + 0.081186056*i.y + 0.1575838*i.z + -0.040441483*i.w + -0.12779029*ni.x + -0.053493083*ni.y + -0.1554511*ni.z + 0.06450098*ni.w + 0.10196622; + float p = -0.05084896*a.x + -0.025864055*a.y + -0.0423675*a.z + -4.0772065e-06*a.w + 0.02803127*na.x + 0.035999373*na.y + 0.007870865*na.z + 0.05825513*na.w + 0.035351537*b.x + -0.07360655*b.y + -0.031453885*b.z + 0.0008590724*b.w + -0.007686636*nb.x + 0.03919155*nb.y + -0.0066824555*nb.z + 0.010864427*nb.w + 0.01694384*c.x + 0.002156429*c.y + -0.01584152*c.z + -0.022033762*c.w + -0.0027367529*nc.x + 0.04000485*nc.y + -0.050542578*nc.z + 0.030587258*nc.w + 0.029927408*d.x + 0.0050946497*d.y + -0.015805498*d.z + 0.023864375*d.w + -0.022649534*nd.x + 0.0028476734*nd.y + 0.012264402*nd.z + 0.031465337*nd.w + -0.10100293*e.x + -0.108228765*e.y + -0.005136694*e.z + -0.00098771*e.w + 0.009984722*ne.x + -0.11651231*ne.y + -0.004329168*ne.z + -0.0034827406*ne.w + 0.05612544*f.x + -0.004895536*f.y + 0.011656533*f.z + 0.011320819*f.w + 0.070911035*nf.x + 0.03044718*nf.y + -0.10531979*nf.z + -0.015752617*nf.w + 0.027381636*g.x + 0.013853647*g.y + -0.013681497*g.z + -0.034121756*g.w + -0.035334572*ng.x + 0.041340206*ng.y + 0.030327082*ng.z + 0.025534922*ng.w + -0.03690772*h.x + -0.08182541*h.y + 0.09829379*h.z + -0.07628125*h.w + 0.15156227*nh.x + -0.07646339*nh.y + -0.12581073*nh.z + -0.14322214*nh.w + 0.07712991*i.x + -0.043189485*i.y + -0.101967454*i.z + 0.031779*i.w + -0.21496733*ni.x + 0.028987886*ni.y + 0.12496805*ni.z + 0.001070264*ni.w + -0.07167466; + float q = -0.036076654*a.x + -0.023033194*a.y + -0.013268468*a.z + -0.10439581*a.w + 0.02900405*na.x + 0.06569822*na.y + 0.0015899669*na.z + 0.06309523*na.w + 0.01696686*b.x + 0.0018624541*b.y + 0.003093909*b.z + -0.0066021513*b.w + -0.032570347*nb.x + 0.016426489*nb.y + 0.008362462*nb.z + 0.0018623052*nb.w + 0.037616305*c.x + -0.019541427*c.y + 0.030132027*c.z + -0.029543463*c.w + -0.019351475*nc.x + 0.035037447*nc.y + -0.021529585*nc.z + 0.004689821*nc.w + -0.061487217*d.x + -0.017658396*d.y + 0.05177372*d.z + -0.06273585*d.w + 0.05520659*nd.x + -0.014126777*nd.y + -0.04915284*nd.z + 0.026295919*nd.w + 0.17304975*e.x + 0.01705942*e.y + -0.022067694*e.z + -0.0010175292*e.w + -0.011640876*ne.x + -0.07899215*ne.y + 0.02021127*ne.z + -0.022522984*ne.w + -0.014083511*f.x + 0.0072853453*f.y + -0.012230998*f.z + -0.0054261815*f.w + 0.08040602*nf.x + -0.024123095*nf.y + 0.09503648*nf.z + 0.021111265*nf.w + -0.0058723064*g.x + 0.014009066*g.y + -0.0199055*g.z + -0.048992727*g.w + 0.0146807665*ng.x + -0.07463385*ng.y + -0.0023119887*ng.z + 0.0733726*ng.w + 0.16678292*h.x + -0.038813323*h.y + 0.2020253*h.z + 0.0286461*h.w + -0.09631731*nh.x + 0.05879235*nh.y + -0.089875296*nh.z + -0.110792235*nh.w + 0.021833958*i.x + 0.011621068*i.y + -0.002211656*i.z + 0.01791743*i.w + 0.095421486*ni.x + -0.04211359*ni.y + -0.0024988165*ni.z + -0.055464126*ni.w + 0.0059085004; + float r = -0.061712302*a.x + -0.04130629*a.y + -0.019526359*a.z + -0.12467788*a.w + 0.029681372*na.x + 0.061640427*na.y + -0.0011297357*na.z + 0.09371664*na.w + 0.035102453*b.x + -0.004270386*b.y + 0.008078298*b.z + -0.026749663*b.w + -0.032711815*nb.x + 0.0110498015*nb.y + -0.008478087*nb.z + 0.025791116*nb.w + 0.01243721*c.x + -0.03316*c.y + 0.030688679*c.z + -0.019696997*c.w + -0.022907877*nc.x + 0.013164236*nc.y + -0.008400274*nc.z + -0.014558874*nc.w + -0.010408095*d.x + -0.017213805*d.y + 0.018412916*d.z + -0.023305846*d.w + 0.0009747286*nd.x + 0.04383806*nd.y + -0.019491175*nd.z + 0.014150079*nd.w + -0.003928558*e.x + 0.053480823*e.y + 0.032579094*e.z + 0.006049208*e.w + -0.0025383723*ne.x + 0.079490945*ne.y + -0.03156533*ne.z + -0.019017974*ne.w + -0.024016002*f.x + 0.0016876411*f.y + 0.01778236*f.z + -0.007140162*f.w + -0.047252163*nf.x + 0.0031894948*nf.y + -0.07527481*nf.z + -0.01373366*nf.w + -0.01434254*g.x + -0.026031932*g.y + 0.02796686*g.z + 0.09758574*g.w + 0.007164799*ng.x + 0.065844*ng.y + -0.01628951*ng.z + -0.09932834*ng.w + -0.2192365*h.x + 0.045124453*h.y + -0.31844327*h.z + -0.052317273*h.w + 0.2420633*nh.x + -0.085638754*nh.y + 0.14658552*nh.z + 0.068354204*nh.w + -0.11164648*i.x + -0.030088436*i.y + -0.08107349*i.z + -0.004874011*i.w + 0.2173053*ni.x + 0.059565175*ni.y + 0.045205507*ni.z + -0.015653528*ni.w + 0.0017200519; + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(L)-Kernel(X) +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!SAVE MMKERNEL +//!COMPONENTS 2 + +#define L_tex HOOKED_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a = L_tex(pos - d).x; + float b = L_tex(pos).x; + float c = L_tex(pos + d).x; + + return vec2(min3v(a, b, c), max3v(a, b, c)); +} + +vec4 hook() { + return vec4(minmax3(HOOKED_pos, vec2(HOOKED_pt.x, 0)), 0, 0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(L)-Kernel(Y) +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND MMKERNEL +//!SAVE MMKERNEL +//!COMPONENTS 2 + +#define L_tex MMKERNEL_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a0 = L_tex(pos - d).x; + float b0 = L_tex(pos).x; + float c0 = L_tex(pos + d).x; + + float a1 = L_tex(pos - d).y; + float b1 = L_tex(pos).y; + float c1 = L_tex(pos + d).y; + + return vec2(min3v(a0, b0, c0), max3v(a1, b1, c1)); +} + +vec4 hook() { + return vec4(minmax3(HOOKED_pos, vec2(0, HOOKED_pt.y)), 0, 0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(L) +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND MMKERNEL +//!BIND LUMAN0 +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * + +#define STRENGTH 1 //De-blur proportional strength, higher is sharper. However, it is better to tweak BLUR_CURVE instead to avoid ringing. +#define BLUR_CURVE 0.6 //De-blur power curve, lower is sharper. Good values are between 0.3 - 1. Values greater than 1 softens the image; +#define BLUR_THRESHOLD 0.1 //Value where curve kicks in, used to not de-blur already sharp edges. Only de-blur values that fall below this threshold. +#define NOISE_THRESHOLD 0.001 //Value where curve stops, used to not sharpen noise. Only de-blur values that fall above this threshold. + +vec4 hook() { + vec2 f = fract(LUMAN0_pos * LUMAN0_size); + ivec2 i = ivec2(f * vec2(2)); + float c0 = LUMAN0_tex((vec2(0.5) - f) * LUMAN0_pt + LUMAN0_pos)[i.y * 2 + i.x]; + float c = c0 * STRENGTH; + + vec2 mm = MMKERNEL_tex((vec2(0.5) - f) * MMKERNEL_pt + MMKERNEL_pos).xy; + + float t_range = BLUR_THRESHOLD - NOISE_THRESHOLD; + + float c_t = abs(c); + if (c_t > NOISE_THRESHOLD && c_t < BLUR_THRESHOLD) { + c_t = (c_t - NOISE_THRESHOLD) / t_range; + c_t = pow(c_t, BLUR_CURVE); + c_t = c_t * t_range + NOISE_THRESHOLD; + c_t = c_t * sign(c); + return vec4(clamp(c_t + HOOKED_tex(HOOKED_pos).x, MMKERNEL_tex(HOOKED_pos).x, MMKERNEL_tex(HOOKED_pos).y), HOOKED_tex(HOOKED_pos).yz, 0); + } else { + return vec4(c + HOOKED_tex(HOOKED_pos).x, HOOKED_tex(HOOKED_pos).yz, 0); + } + +} \ No newline at end of file diff --git a/.config/mpv/shaders/Anime4K_Upscale_CNN_L_x2_Denoise.glsl b/.config/mpv/shaders/Anime4K_Upscale_CNN_L_x2_Denoise.glsl new file mode 100644 index 0000000..d15cc82 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_CNN_L_x2_Denoise.glsl @@ -0,0 +1,867 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(L)-Conv-4x3x3x1 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!SAVE LUMAN0 +//!COMPONENTS 4 + + +vec4 hook() { + vec2 dp = HOOKED_pt; + float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x; + float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x; + float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x; + float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x; + float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x; + float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x; + float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x; + float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x; + + float s = 0.4215035*a + 0.41656324*b + 0.57168597*c + -0.07139752*d + -1.0765523*e + 0.04791426*f + -0.074310005*g + -0.20214646*h + 0.21949938*i; + float o = s+0.080419116; + s = 0.47888502*a + -0.5302326*b + 0.044158366*c + -0.061843097*d + 0.93260187*e + -0.48089626*f + -0.0035360905*g + -0.46852994*h + -0.040424205*i; + float p = s+-0.021478968; + s = 1.0640558*a + -1.0064243*b + -0.07889837*c + 0.094287656*d + -0.1063593*e + 0.03934059*f + 0.030866144*g + -0.029255068*h + -0.022191582*i; + float q = s+-0.00651517; + s = 0.0032808038*a + -0.41636068*b + -0.43624774*c + 1.7085389*d + -0.31619057*e + -0.6808209*f + 0.12012518*g + 0.008737675*h + -0.035705682*i; + float r = s+-0.10506958; + + return vec4(o, p, q, r); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN0 +//!SAVE LUMAN1 +//!COMPONENTS 4 + +#define L_tex LUMAN0_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = 0.11412825*a.x + 0.1840317*b.x + -0.10466666*c.x + -0.12713116*d.x + 0.35276088*e.x + -0.02395153*f.x + -0.28461823*g.x + -0.96569353*h.x + -0.18971665*i.x; + float t = -1.1137404*a.y + 0.43714485*b.y + -0.044679902*c.y + -0.2501947*d.y + -1.2947936*e.y + -0.31301048*f.y + 0.3053378*g.y + 0.29979745*h.y + -0.51788515*i.y; + float u = 0.47026485*a.z + -0.31839973*b.z + 0.055645958*c.z + -0.29835618*d.z + 0.81404704*e.z + 0.34622005*f.z + -0.5541774*g.z + 0.22531238*h.z + 0.40981588*i.z; + float v = 0.24740729*a.w + 0.23572107*b.w + -0.08851564*c.w + 0.28490144*d.w + -0.44812602*e.w + -0.11019879*f.w + -0.027907236*g.w + -0.10703253*h.w + 0.25705412*i.w; + float w = -0.028948177*na.x + -0.3628554*nb.x + 0.15084967*nc.x + 0.51021785*nd.x + -0.28001648*ne.x + -0.014126939*nf.x + -0.067092106*ng.x + 1.1658121*nh.x + 0.1256911*ni.x; + float x = 1.0376894*na.y + -0.48707172*nb.y + -0.009269018*nc.y + 0.55338943*nd.y + 0.90316075*ne.y + 0.5183273*nf.y + -0.32279676*ng.y + -0.34821483*nh.y + 0.41045278*ni.y; + float y = -0.4172725*na.z + 0.2591147*nb.z + -0.011703725*nc.z + 0.21599749*nd.z + -0.754353*ne.z + -0.24588206*nf.z + 0.45339534*ng.z + 0.02932943*nh.z + -0.27703565*ni.z; + float z = -0.28587815*na.w + -0.20535208*nb.w + 0.14220202*nc.w + -0.2592008*nd.w + 0.24861126*ne.w + 0.07041689*nf.w + 0.0374483*ng.w + 0.14708018*nh.w + -0.31886858*ni.w; + float o = s+t+u+v+w+x+y+z+0.07075245; + s = 0.22809531*a.x + 0.713199*b.x + 0.020191291*c.x + -0.42702183*d.x + 0.079573214*e.x + -0.20965911*f.x + -0.16740705*g.x + -0.015297627*h.x + -0.09801453*i.x; + t = 0.80420643*a.y + 0.42259648*b.y + -0.795659*c.y + 0.0325615*d.y + -0.33446467*e.y + 0.41807374*f.y + 0.0836409*g.y + 0.23192492*h.y + -0.1460712*i.y; + u = -0.26335868*a.z + -0.15078981*b.z + 0.25765446*c.z + -0.07761006*d.z + 0.39791512*e.z + -1.5991426*f.z + -0.27469876*g.z + -0.34801024*h.z + -0.8188961*i.z; + v = 0.43287337*a.w + 0.124613665*b.w + 0.22592716*c.w + 0.2346119*d.w + 0.49975863*e.w + -0.14529376*f.w + -0.017041866*g.w + -0.11588172*h.w + -0.052651063*i.w; + w = 0.025791507*na.x + -0.3686168*nb.x + 0.07106921*nc.x + 0.491538*nd.x + -1.0039831*ne.x + 0.013333708*nf.x + 0.34352425*ng.x + 0.43233067*nh.x + 0.5134391*ni.x; + x = -0.2640387*na.y + -0.3845837*nb.y + 0.3327947*nc.y + 0.05188843*nd.y + 0.34995463*ne.y + 0.20881203*nf.y + -0.10452135*ng.y + -0.12896696*nh.y + 0.12609659*ni.y; + y = 0.2306687*na.z + 0.35035846*nb.z + -0.23430833*nc.z + 0.10205449*nd.z + -0.7719395*ne.z + -1.7360915*nf.z + 0.116180964*ng.z + 0.3520401*nh.z + -0.1896886*ni.z; + z = -0.32307857*na.w + -0.13180432*nb.w + 0.102697425*nc.w + -0.058036186*nd.w + -0.029107057*ne.w + -0.10502086*nf.w + 0.055922143*ng.w + 0.27744582*nh.w + 0.20273137*ni.w; + float p = s+t+u+v+w+x+y+z+0.17738186; + s = 0.25096753*a.x + -0.1439386*b.x + 0.06863364*c.x + -0.023040973*d.x + -0.087104216*e.x + 0.025757983*f.x + -0.13160077*g.x + -0.31460378*h.x + -0.2810511*i.x; + t = -0.037828647*a.y + 0.46088392*b.y + 0.16697082*c.y + -0.32181877*d.y + -0.8034469*e.y + -0.007853226*f.y + 0.22245245*g.y + -0.17000756*h.y + -0.3170783*i.y; + u = -0.05339165*a.z + -0.23307642*b.z + -0.27752477*c.z + 0.57795924*d.z + 2.4150634*e.z + -0.1553794*f.z + 0.91762215*g.z + 2.9205158*h.z + -0.62780726*i.z; + v = 0.008431615*a.w + -0.3139873*b.w + 0.077316776*c.w + -0.48687732*d.w + -0.26484016*e.w + -0.30870837*f.w + 0.074478514*g.w + -0.017214324*h.w + -0.23271704*i.w; + w = 0.019084003*na.x + -0.27042627*nb.x + 0.35310376*nc.x + 0.9040677*nd.x + -0.22280133*ne.x + 0.038271353*nf.x + 0.29289967*ng.x + 0.73126876*nh.x + 0.5824376*ni.x; + x = 0.20054185*na.y + -0.5243122*nb.y + -0.2988139*nc.y + 0.5042576*nd.y + 0.19609748*ne.y + 0.10971252*nf.y + -0.23124342*ng.y + 0.0101277875*nh.y + 0.03808317*ni.y; + y = -0.029705035*na.z + -0.01676097*nb.z + 0.16964933*nc.z + -0.38320288*nd.z + -0.20108853*ne.z + 0.52724063*nf.z + -0.45516887*ng.z + 1.8857152*nh.z + 1.1747494*ni.z; + z = 0.07067171*na.w + 0.075052306*nb.w + -0.047203705*nc.w + 0.43481615*nd.w + -0.13102*ne.w + 0.29182047*nf.w + -0.1287183*ng.w + -0.37939408*nh.w + 0.070292786*ni.w; + float q = s+t+u+v+w+x+y+z+-0.115625635; + s = 0.35827693*a.x + -0.30227056*b.x + -0.44081002*c.x + 0.26017424*d.x + 0.8550553*e.x + -0.55716866*f.x + 0.054754138*g.x + -0.080581844*h.x + -0.15080602*i.x; + t = -0.062642284*a.y + -0.14259076*b.y + 0.33019453*c.y + 0.71486366*d.y + -1.0258917*e.y + -0.11104437*f.y + 0.015965585*g.y + 0.10489625*h.y + -0.10499223*i.y; + u = -0.15696016*a.z + -0.12249757*b.z + -0.22436732*c.z + -0.857205*d.z + 0.61505085*e.z + 1.3274351*f.z + -0.18885106*g.z + -0.7410624*h.z + 0.4326501*i.z; + v = 0.24964753*a.w + -0.24759892*b.w + -0.64394045*c.w + 0.10346697*d.w + 0.17717692*e.w + -0.07325081*f.w + 0.03706077*g.w + 0.2017116*h.w + -0.33281687*i.w; + w = -0.50056964*na.x + 0.40377027*nb.x + 0.43643215*nc.x + -0.41446805*nd.x + -0.20904464*ne.x + 0.6639448*nf.x + -0.0852812*ng.x + 0.0454402*nh.x + 0.05429976*ni.x; + x = -0.18911883*na.y + 0.32083353*nb.y + -0.13942093*nc.y + -1.0000733*nd.y + 0.96402824*ne.y + -0.35260603*nf.y + -0.10849313*ng.y + -0.077746384*nh.y + 0.01527712*ni.y; + y = 0.17753036*na.z + 0.010192072*nb.z + 0.24215275*nc.z + 0.89387465*nd.z + -0.36714798*ne.z + 0.24506041*nf.z + 0.036823828*ng.z + 0.06819655*nh.z + 0.27566668*ni.z; + z = -0.18686979*na.w + 0.25775823*nb.w + 0.3835672*nc.w + -0.051711187*nd.w + -0.106725216*ne.w + 0.20422176*nf.w + -0.08836096*ng.w + -0.24972022*nh.w + 0.35029697*ni.w; + float r = s+t+u+v+w+x+y+z+-0.115707986; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN1 +//!SAVE LUMAN2 +//!COMPONENTS 4 + +#define L_tex LUMAN1_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = 0.19531512*a.x + 0.75661004*b.x + 0.3096166*c.x + 0.06358046*d.x + 0.1499614*e.x + -0.030383693*f.x + -0.033407122*g.x + 0.048501644*h.x + 0.049986936*i.x; + float t = 0.06886095*a.y + 0.03402651*b.y + 0.01457621*c.y + -0.21454492*d.y + -0.36702567*e.y + -0.1630866*f.y + 0.13787402*g.y + -0.024016507*h.y + -0.109474584*i.y; + float u = 0.0069454503*a.z + -0.034396306*b.z + -0.12354474*c.z + 0.07201203*d.z + -0.10630567*e.z + 0.18307814*f.z + -0.03039953*g.z + 0.07355419*h.z + -0.021904688*i.z; + float v = 0.016922433*a.w + 0.30183804*b.w + 0.11077736*c.w + 0.35945925*d.w + -0.4954182*e.w + -0.38786575*f.w + 0.09543617*g.w + 0.24686292*h.w + 0.05511377*i.w; + float w = -0.15380311*na.x + -0.40750685*nb.x + -0.11207901*nc.x + -0.046549615*nd.x + 0.39128157*ne.x + 0.24458118*nf.x + 0.102530785*ng.x + 0.06391891*nh.x + -0.03831063*ni.x; + float x = -0.05588117*na.y + -0.1881189*nb.y + -0.09076967*nc.y + -0.16613042*nd.y + 0.020559976*ne.y + -0.008077824*nf.y + -0.17901485*ng.y + -0.04537302*nh.y + -0.11788763*ni.y; + float y = -0.007689388*na.z + -0.05978623*nb.z + 0.14321665*nc.z + 0.042092275*nd.z + 0.34321675*ne.z + -0.03005287*nf.z + 0.011204766*ng.z + -0.105857685*nh.z + 0.13019703*ni.z; + float z = -0.04347269*na.w + -0.4376902*nb.w + -0.04843904*nc.w + -0.059588917*nd.w + 0.46535304*ne.w + 0.4958977*nf.w + -0.03444163*ng.w + -0.18499602*nh.w + -0.012110156*ni.w; + float o = s+t+u+v+w+x+y+z+-0.074530095; + s = -0.06742854*a.x + -0.12321965*b.x + -0.14357084*c.x + -0.01815457*d.x + 0.17294414*e.x + -0.18659571*f.x + 0.06692644*g.x + 0.09908733*h.x + -0.11809575*i.x; + t = -0.005772749*a.y + -0.013990392*b.y + -0.0020466307*c.y + -0.036487233*d.y + 0.4806164*e.y + -0.0046594343*f.y + 0.042192*g.y + 0.26031008*h.y + 0.009724199*i.y; + u = -0.024550475*a.z + -0.038105283*b.z + 0.030287327*c.z + -0.027531162*d.z + 0.08877715*e.z + -0.027587755*f.z + -0.0028527123*g.z + -0.07279942*h.z + -0.010473134*i.z; + v = -0.18172199*a.w + -0.29467285*b.w + -0.047669973*c.w + -0.40614647*d.w + 0.9024393*e.w + 0.10957179*f.w + 0.007726905*g.w + -0.028344521*h.w + -0.021076318*i.w; + w = -0.024287289*na.x + -0.08251041*nb.x + 0.13607152*nc.x + 0.056396626*nd.x + -0.30565166*ne.x + -0.06323622*nf.x + 0.0034147159*ng.x + -0.068183005*nh.x + 0.09750015*ni.x; + x = 0.11207607*na.y + 0.19217284*nb.y + 0.060664564*nc.y + -0.0028700104*nd.y + -0.44213495*ne.y + -0.010552949*nf.y + 0.09471371*ng.y + 0.07775542*nh.y + 0.1293176*ni.y; + y = -0.021849515*na.z + -0.103380375*nb.z + -0.1386149*nc.z + 0.035920314*nd.z + -0.034096282*ne.z + -0.011182113*nf.z + -0.07874607*ng.z + -0.0998542*nh.z + -0.11313594*ni.z; + z = 0.26100898*na.w + 0.26773435*nb.w + 0.07979528*nc.w + 0.4306503*nd.w + -0.709519*ne.w + -0.028593455*nf.w + -0.0013585149*ng.w + -0.08628674*nh.w + 0.031180594*ni.w; + float p = s+t+u+v+w+x+y+z+-0.1715465; + s = -0.14666776*a.x + 0.26855308*b.x + -0.10737497*c.x + -0.478907*d.x + -1.2726359*e.x + 0.3092185*f.x + -0.17867793*g.x + -0.0936289*h.x + 0.12641555*i.x; + t = 0.008328487*a.y + -0.037953213*b.y + -0.025492352*c.y + -0.19912837*d.y + -0.3742934*e.y + -0.10713854*f.y + -0.22536866*g.y + -0.11653662*h.y + -0.029667256*i.y; + u = 0.0976369*a.z + 0.05373832*b.z + 0.10847769*c.z + 0.15022285*d.z + -0.19162357*e.z + -0.07674518*f.z + -0.026067028*g.z + 0.08050421*h.z + 0.107850924*i.z; + v = 0.21821137*a.w + 0.2239173*b.w + -0.040711384*c.w + 0.010436842*d.w + -0.33070624*e.w + -0.07766937*f.w + -0.547517*g.w + -0.22036882*h.w + 0.068507455*i.w; + w = -0.27923876*na.x + -0.83953506*nb.x + -0.04937735*nc.x + -0.12517925*nd.x + -0.34880203*ne.x + -0.03229114*nf.x + 0.07304*ng.x + -0.099752046*nh.x + -0.09073451*ni.x; + x = 0.0071992767*na.y + -0.17674018*nb.y + -0.165915*nc.y + 0.24181545*nd.y + 0.39054248*ne.y + 0.01080755*nf.y + 0.13797866*ng.y + 0.096533135*nh.y + -0.18103594*ni.y; + y = 0.10480431*na.z + 0.27455416*nb.z + 0.24250263*nc.z + 0.0921634*nd.z + 0.057761982*ne.z + 0.1963843*nf.z + 0.2117321*ng.z + 0.089583576*nh.z + 0.26418045*ni.z; + z = -0.06917119*na.w + -0.27698052*nb.w + -0.00064422615*nc.w + 0.16140637*nd.w + 0.3779389*ne.w + -0.11035467*nf.w + 0.5129668*ng.w + 0.5356295*nh.w + -0.13237986*ni.w; + float q = s+t+u+v+w+x+y+z+0.10023738; + s = -0.23887102*a.x + 0.24277607*b.x + -0.41683316*c.x + -0.2895234*d.x + 0.00010446638*e.x + 0.36765575*f.x + -0.024521258*g.x + 0.14120218*h.x + 0.16108708*i.x; + t = -0.33275175*a.y + 0.007576721*b.y + -0.13189057*c.y + -0.0536059*d.y + 0.19288039*e.y + 0.15331933*f.y + -0.16995217*g.y + -0.23417917*h.y + 0.38105*i.y; + u = 0.09834787*a.z + 0.1253177*b.z + -0.028776247*c.z + -0.07806128*d.z + 0.3587465*e.z + -0.046493925*f.z + -0.016537353*g.z + -0.27969596*h.z + 0.1458732*i.z; + v = -0.57924134*a.w + 0.24679546*b.w + -0.22474492*c.w + -1.2378064*d.w + -0.33317074*e.w + 0.22736992*f.w + 0.014587293*g.w + -0.65192467*h.w + 0.023514273*i.w; + w = 0.26154968*na.x + -0.75984037*nb.x + 0.03717654*nc.x + 0.37500888*nd.x + -0.56587577*ne.x + -0.48871645*nf.x + -0.2826228*ng.x + 0.08908507*nh.x + -0.086056955*ni.x; + x = 0.042194832*na.y + -0.11804398*nb.y + 0.0643243*nc.y + 0.22535841*nd.y + 0.36214152*ne.y + 0.10931784*nf.y + 0.18903424*ng.y + -0.08267276*nh.y + 0.22756808*ni.y; + y = 0.068569325*na.z + -0.0023039673*nb.z + -0.04598484*nc.z + 0.3297236*nd.z + -0.32703748*ne.z + 0.07459695*nf.z + 0.10545363*ng.z + 0.18110338*nh.z + -0.26289833*ni.z; + z = 0.8522838*na.w + -0.11771054*nb.w + 0.11908337*nc.w + 1.3367181*nd.w + 0.7088517*ne.w + -0.62825435*nf.w + 0.087871*ng.w + 1.1323127*nh.w + -0.15303938*ni.w; + float r = s+t+u+v+w+x+y+z+0.08765152; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN2 +//!SAVE LUMAN3 +//!COMPONENTS 4 + +#define L_tex LUMAN2_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.071484216*a.x + -0.15379138*b.x + -0.011637495*c.x + -0.12485528*d.x + 0.05375508*e.x + 0.022603117*f.x + 0.049010042*g.x + 0.06119798*h.x + -0.0343863*i.x; + float t = 0.20201275*a.y + 0.19588579*b.y + -0.07735335*c.y + 0.47221488*d.y + 0.16061525*e.y + 0.29085115*f.y + 0.17465873*g.y + 0.24865559*h.y + -0.14413305*i.y; + float u = -0.15183356*a.z + -0.06946449*b.z + -0.13527918*c.z + -0.009835063*d.z + -0.07576131*e.z + 0.16591768*f.z + -0.011752567*g.z + 0.051701143*h.z + -0.055118393*i.z; + float v = 0.0100477245*a.w + 0.026903853*b.w + 0.048386924*c.w + -0.040059995*d.w + 0.026380781*e.w + -0.0033332172*f.w + -0.073551245*g.w + 0.06826868*h.w + -0.015563708*i.w; + float w = -0.13719939*na.x + 0.13114864*nb.x + -0.02011338*nc.x + -0.045670643*nd.x + 0.009785428*ne.x + -0.0940287*nf.x + 0.06100234*ng.x + -0.050412152*nh.x + 0.14110225*ni.x; + float x = -0.16927695*na.y + -0.058850475*nb.y + 0.15892337*nc.y + -0.3816563*nd.y + 0.42354158*ne.y + -0.31966108*nf.y + -0.074423924*ng.y + -0.19131769*nh.y + 0.13021442*ni.y; + float y = 0.014524241*na.z + -0.054700878*nb.z + -0.011205598*nc.z + -0.056959968*nd.z + -0.044072304*ne.z + -0.053675648*nf.z + -0.03056575*ng.z + -0.10361115*nh.z + 0.044025842*ni.z; + float z = 0.09876018*na.w + 0.059865728*nb.w + -0.013275731*nc.w + 0.047606464*nd.w + -0.020946808*ne.w + -0.013572179*nf.w + 0.106707744*ng.w + -0.0496323*nh.w + 0.0055612717*ni.w; + float o = s+t+u+v+w+x+y+z+0.0060072606; + s = 0.17296407*a.x + -0.02353393*b.x + 0.03221925*c.x + 0.0029942524*d.x + 0.10439903*e.x + 0.12231822*f.x + -0.0648184*g.x + 0.37160578*h.x + 0.050405774*i.x; + t = 0.056227725*a.y + 0.090547815*b.y + -0.1280931*c.y + 0.12094268*d.y + 0.7131343*e.y + -0.05858293*f.y + -0.10204301*g.y + 0.30663434*h.y + 0.027529169*i.y; + u = -0.09819936*a.z + 0.06856007*b.z + 0.010322064*c.z + -0.022368576*d.z + 0.17078836*e.z + 0.13764809*f.z + -0.042109784*g.z + -0.028037867*h.z + 0.043926377*i.z; + v = -0.028774306*a.w + -0.02652384*b.w + 0.031702884*c.w + -0.037220463*d.w + -0.039529596*e.w + 0.03946858*f.w + -0.038924288*g.w + 0.030092617*h.w + 0.0024306113*i.w; + w = -0.16252601*na.x + -0.025766501*nb.x + 0.07263466*nc.x + 0.11477501*nd.x + 0.0019494815*ne.x + -0.10480847*nf.x + 0.23158173*ng.x + -0.4040528*nh.x + 0.052536312*ni.x; + x = -0.09707612*na.y + -0.20994882*nb.y + 0.04613562*nc.y + -0.31773815*nd.y + -0.27689534*ne.y + -0.3284137*nf.y + -0.0038156905*ng.y + -0.32932884*nh.y + -0.24467573*ni.y; + y = 0.048376214*na.z + -0.06355544*nb.z + 0.022650821*nc.z + -0.07016279*nd.z + -0.009721295*ne.z + 0.03617427*nf.z + 0.012988838*ng.z + -0.08307036*nh.z + -0.015296994*ni.z; + z = 0.03248693*na.w + 0.055572554*nb.w + 0.015513567*nc.w + 0.037825506*nd.w + 0.00948496*ne.w + -0.06464796*nf.w + 0.036613774*ng.w + -0.04314624*nh.w + -0.028679999*ni.w; + float p = s+t+u+v+w+x+y+z+0.2829641; + s = 0.320721*a.x + 0.035459336*b.x + 0.023306018*c.x + 0.119004264*d.x + 0.20438322*e.x + 0.17621407*f.x + -0.31589565*g.x + -0.18008752*h.x + 0.03621878*i.x; + t = 0.040115036*a.y + 0.32931724*b.y + -0.114885755*c.y + -0.08075643*d.y + 0.32371774*e.y + 0.16414165*f.y + 0.008934278*g.y + 0.00058803306*h.y + -0.058671538*i.y; + u = 0.46319002*a.z + 0.5111636*b.z + 0.28321937*c.z + 0.27626333*d.z + 0.734393*e.z + 0.14846851*f.z + 0.07379987*g.z + 0.18866524*h.z + 0.16969498*i.z; + v = -0.074738964*a.w + -0.13338739*b.w + -0.09041253*c.w + -0.114089765*d.w + -0.1643739*e.w + -0.060028445*f.w + -0.017498652*g.w + -0.13155481*h.w + -0.043019716*i.w; + w = 0.16080199*na.x + -0.011583823*nb.x + 0.08729478*nc.x + 0.11836629*nd.x + 0.18851641*ne.x + -0.015855411*nf.x + 0.04861083*ng.x + -0.14782971*nh.x + -0.025266634*ni.x; + x = 0.01589688*na.y + -0.17345417*nb.y + -0.08792109*nc.y + 0.3921203*nd.y + -0.10856708*ne.y + -0.32589427*nf.y + 0.11128785*ng.y + 0.26814553*nh.y + -0.11513526*ni.y; + y = -0.14557354*na.z + -0.06748066*nb.z + -0.029917005*nc.z + 0.07269401*nd.z + -0.20973498*ne.z + -0.04152044*nf.z + 0.012080292*ng.z + 0.07383861*nh.z + 0.014937096*ni.z; + z = -0.07913194*na.w + -0.08965903*nb.w + 0.010154432*nc.w + 0.10218615*nd.w + -0.041559584*ne.w + -0.061589126*nf.w + -0.0672816*ng.w + -0.0072393185*nh.w + -0.0646147*ni.w; + float q = s+t+u+v+w+x+y+z+0.022043083; + s = -0.27225387*a.x + 0.2828754*b.x + -0.10630629*c.x + 0.019877*d.x + -0.3263776*e.x + -0.23130926*f.x + 0.2440649*g.x + -0.42757595*h.x + -0.020886745*i.x; + t = 0.014259129*a.y + -0.2630813*b.y + 0.08917837*c.y + -0.027197517*d.y + -0.42261592*e.y + -0.44196936*f.y + 0.060653217*g.y + -0.33134687*h.y + -0.048561227*i.y; + u = 0.091200985*a.z + -0.21007726*b.z + -0.058688443*c.z + 0.094780594*d.z + -0.5010706*e.z + -0.375842*f.z + 0.05078212*g.z + 0.052483276*h.z + -0.20040707*i.z; + v = -0.023157451*a.w + 0.0056420853*b.w + -0.066936195*c.w + -0.014182511*d.w + 0.12831312*e.w + -0.09974167*f.w + 0.09050297*g.w + -0.018599695*h.w + 0.06922196*i.w; + w = 0.3577923*na.x + -0.1555226*nb.x + -0.011806127*nc.x + 0.014978679*nd.x + 0.49296147*ne.x + 0.33308923*nf.x + -0.44142124*ng.x + 0.70373046*nh.x + -0.03331094*ni.x; + x = 0.08271521*na.y + 0.37149724*nb.y + -0.13579668*nc.y + 0.27287593*nd.y + -0.22429353*ne.y + 0.9060158*nf.y + 0.03304059*ng.y + 0.31473508*nh.y + 0.3542939*ni.y; + y = -0.02708005*na.z + 0.08278668*nb.z + -0.030191392*nc.z + -0.018278172*nd.z + 0.0730759*ne.z + 0.05692738*nf.z + -0.01901399*ng.z + 0.04840379*nh.z + 0.064143375*ni.z; + z = -0.026436036*na.w + -0.0831705*nb.w + -0.015898217*nc.w + -0.0042800093*nd.w + -0.10546304*ne.w + 0.11703322*nf.w + -0.051917955*ng.w + 0.06514161*nh.w + -0.03650162*ni.w; + float r = s+t+u+v+w+x+y+z+-0.26078916; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN3 +//!SAVE LUMAN4 +//!COMPONENTS 4 + +#define L_tex LUMAN3_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.107556306*a.x + -0.04081029*b.x + -0.008938213*c.x + 0.24670267*d.x + 0.01085363*e.x + 0.075738996*f.x + -0.0067675672*g.x + -0.05323595*h.x + -0.13599646*i.x; + float t = -0.37925526*a.y + 0.22347686*b.y + -0.1767171*c.y + -0.08196524*d.y + 0.18382895*e.y + -0.35576165*f.y + -0.03806031*g.y + -0.5451033*h.y + -0.2305202*i.y; + float u = -0.15359999*a.z + -0.006875495*b.z + -0.09655429*c.z + 0.21034376*d.z + -0.64395905*e.z + -0.03866011*f.z + 0.0029128285*g.z + -0.3779341*h.z + -0.14098142*i.z; + float v = -0.19084647*a.w + 0.030812489*b.w + -0.059366476*c.w + 0.18756826*d.w + 0.6189365*e.w + 0.26788878*f.w + 0.21478464*g.w + -0.44997966*h.w + 0.22089215*i.w; + float w = 0.17184879*na.x + 0.0033282684*nb.x + 0.054216553*nc.x + -0.5273202*nd.x + 0.2670501*ne.x + 0.076237395*nf.x + -0.030878715*ng.x + 0.21421494*nh.x + -0.29449406*ni.x; + float x = 0.18188754*na.y + -0.3733855*nb.y + 0.038874805*nc.y + -0.14291866*nd.y + -0.6214685*ne.y + -0.10476491*nf.y + -0.19340777*ng.y + 0.2156583*nh.y + -0.050107118*ni.y; + float y = 0.059755128*na.z + 0.07389861*nb.z + -0.006266912*nc.z + -0.16210014*nd.z + 0.52666557*ne.z + -0.06711788*nf.z + 0.15005633*ng.z + 0.16562483*nh.z + -0.22913584*ni.z; + float z = 0.6047426*na.w + 0.20271854*nb.w + 0.3384107*nc.w + 0.33195493*nd.w + -0.22297256*ne.w + -0.12546994*nf.w + 0.059544683*ng.w + 0.52085406*nh.w + -0.00873421*ni.w; + float o = s+t+u+v+w+x+y+z+-0.13064185; + s = 0.08732821*a.x + -0.05341844*b.x + 0.06901437*c.x + 0.09303019*d.x + -0.0096632475*e.x + 0.1702191*f.x + -0.1589017*g.x + -0.11956275*h.x + 0.09487855*i.x; + t = 0.3286443*a.y + 0.45296693*b.y + 0.23995438*c.y + 0.060606387*d.y + -0.703761*e.y + -0.16169147*f.y + -0.10184594*g.y + 0.045386706*h.y + -0.03909988*i.y; + u = 0.024303712*a.z + 0.012471365*b.z + -0.01730113*c.z + 0.1404732*d.z + 0.18380049*e.z + 0.0479657*f.z + -0.06476113*g.z + 0.023015436*h.z + 0.02297177*i.z; + v = 0.08092012*a.w + 0.14953266*b.w + -0.016252734*c.w + 0.009759683*d.w + -0.7273685*e.w + 0.008518111*f.w + -0.10309023*g.w + 0.12540577*h.w + 0.031582095*i.w; + w = -0.10731416*na.x + -0.1368941*nb.x + -0.13317919*nc.x + -0.30966043*nd.x + -0.1918782*ne.x + -0.44585067*nf.x + 0.15991306*ng.x + 0.024030292*nh.x + -0.024647191*ni.x; + x = -0.1979266*na.y + -0.646615*nb.y + -0.20555265*nc.y + 0.024128452*nd.y + 1.219782*ne.y + 0.15514997*nf.y + 0.09696628*ng.y + -0.25017464*nh.y + 0.059785355*ni.y; + y = -0.04753436*na.z + -0.05745985*nb.z + 0.010196696*nc.z + -0.009032149*nd.z + 0.16765115*ne.z + 0.14833985*nf.z + 0.06543748*ng.z + -0.01792832*nh.z + -0.009773784*ni.z; + z = -0.23816025*na.w + -0.07474088*nb.w + -0.023512343*nc.w + -0.034709882*nd.w + 0.5064627*ne.w + 0.12378374*nf.w + 0.11695783*ng.w + -0.15038316*nh.w + -0.10991656*ni.w; + float p = s+t+u+v+w+x+y+z+0.111566626; + s = 0.04803703*a.x + 0.09719456*b.x + 0.037009735*c.x + -0.14740345*d.x + -0.84762454*e.x + 0.26000938*f.x + -0.0018342865*g.x + 0.21009481*h.x + 0.32474878*i.x; + t = 0.540793*a.y + 0.40065685*b.y + 0.19238408*c.y + 0.61297274*d.y + 1.796825*e.y + 0.39143816*f.y + 0.3346262*g.y + 0.5160184*h.y + 0.23154403*i.y; + u = 0.068333425*a.z + 0.2247325*b.z + -0.0012861274*c.z + -0.13434076*d.z + -0.065552816*e.z + -0.115094036*f.z + 0.0074256705*g.z + 0.19417994*h.z + 0.053342123*i.z; + v = 0.22789666*a.w + 0.2571478*b.w + -0.09805842*c.w + -0.012676717*d.w + 0.29140922*e.w + 0.2520991*f.w + 0.007481838*g.w + -0.019897738*h.w + 0.011071546*i.w; + w = -0.11999563*na.x + -0.49221912*nb.x + -0.23500362*nc.x + 0.15113503*nd.x + 0.21974513*ne.x + -0.80736375*nf.x + -0.045717135*ng.x + -0.42507663*nh.x + -0.13569136*ni.x; + x = -0.4226151*na.y + -0.40575272*nb.y + -0.15956134*nc.y + -0.34036857*nd.y + -1.102862*ne.y + -0.42583948*nf.y + -0.3897435*ng.y + -0.3760679*nh.y + -0.22287402*ni.y; + y = -0.06418248*na.z + -0.19241585*nb.z + 0.021428568*nc.z + 0.033025675*nd.z + 0.33696234*ne.z + -0.15845138*nf.z + -0.009344784*ng.z + -0.29591*nh.z + 0.2119428*ni.z; + z = -0.49135718*na.w + -0.2149747*nb.w + 0.010947395*nc.w + -0.23447789*nd.w + -0.57303745*ne.w + -0.26816955*nf.w + -0.06945182*ng.w + -0.41862604*nh.w + -0.20820309*ni.w; + float q = s+t+u+v+w+x+y+z+-0.17401248; + s = 0.024169812*a.x + 0.12276286*b.x + 0.072896846*c.x + 0.013356247*d.x + -0.29824728*e.x + 0.3640592*f.x + -0.021671157*g.x + 0.17517301*h.x + 0.20794316*i.x; + t = 0.73604757*a.y + -0.40369877*b.y + -0.047552362*c.y + 0.5976236*d.y + 1.2667477*e.y + 0.120913014*f.y + -0.086337656*g.y + 0.57444984*h.y + 0.1568324*i.y; + u = 0.09157643*a.z + 0.120509826*b.z + 0.0963957*c.z + -0.17727146*d.z + 0.41721648*e.z + 0.13159907*f.z + -0.03929071*g.z + 0.33859134*h.z + 0.11599431*i.z; + v = 0.41087788*a.w + -0.050653685*b.w + -0.03918905*c.w + 0.06573269*d.w + -0.20179011*e.w + -0.035744686*f.w + -0.42498958*g.w + 0.3335128*h.w + -0.15998083*i.w; + w = -0.18987572*na.x + -0.08540897*nb.x + -0.114256285*nc.x + 0.22100426*nd.x + 0.12920749*ne.x + -0.2667084*nf.x + 0.08685889*ng.x + -0.2826793*nh.x + 0.31001362*ni.x; + x = -0.5575261*na.y + 0.505366*nb.y + 0.13648646*nc.y + -0.45204118*nd.y + -0.42505625*ne.y + 0.17850064*nf.y + 0.17871024*ng.y + -0.24247022*nh.y + 0.013947173*ni.y; + y = -0.050637517*na.z + -0.16217881*nb.z + 0.016173797*nc.z + 0.034584884*nd.z + -0.40451482*ne.z + -0.0717917*nf.z + -0.07246215*ng.z + -0.19490081*nh.z + 0.23232709*ni.z; + z = -0.83920246*na.w + -0.11618735*nb.w + -0.1241044*nc.w + -0.56043375*nd.w + -0.467935*ne.w + -0.019662065*nf.w + 0.16833934*ng.w + -0.54890954*nh.w + -0.036264963*ni.w; + float r = s+t+u+v+w+x+y+z+-0.0033602072; + + return vec4(o, p, q, r); +} +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN4 +//!SAVE LUMAN5 +//!COMPONENTS 4 + +#define L_tex LUMAN4_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.059548892*a.x + 0.43702522*b.x + -0.13668647*c.x + 0.123984024*d.x + -0.2343888*e.x + 0.025218552*f.x + -0.06524572*g.x + 0.04462251*h.x + 0.16215426*i.x; + float t = -0.23212624*a.y + 0.5297861*b.y + -0.08972621*c.y + -0.29718494*d.y + 0.24537762*e.y + -0.13523978*f.y + -0.0004026576*g.y + -0.04473626*h.y + 0.05336481*i.y; + float u = 0.017119335*a.z + -0.3263757*b.z + 0.12577404*c.z + -0.029412897*d.z + -0.041355725*e.z + -0.15547447*f.z + 0.0076208394*g.z + 0.011133262*h.z + -0.09348499*i.z; + float v = 0.038146578*a.w + 0.12203401*b.w + -0.19569762*c.w + 0.069038145*d.w + -0.47764647*e.w + -0.037598196*f.w + -0.03700972*g.w + -0.011845992*h.w + 0.06614768*i.w; + float w = -0.008910504*na.x + -0.36844528*nb.x + 0.095519766*nc.x + -0.043147206*nd.x + 0.22098836*ne.x + 0.058772195*nf.x + 0.005588626*ng.x + -0.032535374*nh.x + -0.12800957*ni.x; + float x = 0.13014328*na.y + -0.2560215*nb.y + 0.12146188*nc.y + 0.3076815*nd.y + -0.19066697*ne.y + -0.026679447*nf.y + -0.16170867*ng.y + 0.0062916437*nh.y + -0.042638574*ni.y; + float y = -0.09460875*na.z + 0.33835813*nb.z + -0.13774352*nc.z + 0.09747969*nd.z + -0.2775574*ne.z + 0.10525732*nf.z + 0.002360881*ng.z + -0.07545961*nh.z + 0.083646305*ni.z; + float z = -0.017314918*na.w + -0.16075635*nb.w + 0.019418081*nc.w + -0.00021538461*nd.w + 0.37484276*ne.w + 0.04987272*nf.w + 0.045123585*ng.w + -0.011118931*nh.w + 0.008850806*ni.w; + float o = s+t+u+v+w+x+y+z+-0.01168409; + s = 0.04390882*a.x + 0.00028676892*b.x + 0.1369192*c.x + 0.09192912*d.x + 0.40848687*e.x + -0.07258693*f.x + 0.051216785*g.x + -0.042233836*h.x + -0.10429957*i.x; + t = 0.19647208*a.y + -0.17864986*b.y + 0.14890863*c.y + 0.36475497*d.y + -0.66949457*e.y + 0.2154419*f.y + 0.24297847*g.y + -0.41431725*h.y + 0.05826373*i.y; + u = -0.08638336*a.z + 0.07897926*b.z + -0.12295154*c.z + -0.06136639*d.z + 0.3678849*e.z + 0.14977399*f.z + 0.052167486*g.z + 0.07076993*h.z + 0.14226422*i.z; + v = -0.022243215*a.w + 0.1288933*b.w + 0.17433701*c.w + 0.095396556*d.w + 0.33610657*e.w + -0.0039668*f.w + -0.04683302*g.w + 0.068621494*h.w + -0.25429747*i.w; + w = 0.034006625*na.x + -0.042580634*nb.x + -0.09349343*nc.x + -0.13119647*nd.x + -0.29319564*ne.x + -0.07300171*nf.x + 0.044772662*ng.x + -0.04995681*nh.x + 0.22140417*ni.x; + x = -0.16712625*na.y + 0.10423614*nb.y + -0.17219703*nc.y + -0.4457812*nd.y + 0.61158*ne.y + -0.29955527*nf.y + -0.10820896*ng.y + 0.1999257*nh.y + 0.06247788*ni.y; + y = 0.0608084*na.z + -0.07334189*nb.z + 0.047938384*nc.z + 0.09157263*nd.z + -0.35632375*ne.z + -0.024168178*nf.z + -0.08407318*ng.z + -0.017649708*nh.z + -0.14972878*ni.z; + z = 0.02588695*na.w + -0.08707571*nb.w + -0.09017493*nc.w + -0.023196384*nd.w + -0.48675185*ne.w + 0.085413784*nf.w + -0.08183361*ng.w + 0.079769425*nh.w + 0.17876361*ni.w; + float p = s+t+u+v+w+x+y+z+0.08974541; + s = 0.11793741*a.x + 0.17236432*b.x + 0.007316329*c.x + -0.029080074*d.x + -0.5462617*e.x + -0.21368095*f.x + -0.03163705*g.x + -0.18045929*h.x + 0.033423495*i.x; + t = -0.07487674*a.y + 0.039981645*b.y + 0.04123286*c.y + 0.0026752134*d.y + 0.025552675*e.y + 0.14129147*f.y + -0.052356925*g.y + 0.080669664*h.y + -0.1604305*i.y; + u = 0.014396548*a.z + -0.15668866*b.z + -0.086082*c.z + 0.20217386*d.z + 0.26358724*e.z + -0.053174455*f.z + -0.0226553*g.z + 0.1240673*h.z + -0.10206111*i.z; + v = 0.09398775*a.w + 0.18773827*b.w + 0.17133693*c.w + -0.23268327*d.w + -0.3664219*e.w + -0.26318702*f.w + -0.095037445*g.w + -0.41657946*h.w + 0.15929739*i.w; + w = -0.106357284*na.x + -0.085850805*nb.x + -0.0362939*nc.x + 0.11971479*nd.x + 0.17938587*ne.x + 0.1855791*nf.x + 0.11161726*ng.x + 0.23719479*nh.x + -0.06750009*ni.x; + x = 0.017156227*na.y + -0.15604517*nb.y + -0.052415892*nc.y + 0.41085327*nd.y + 0.29584593*ne.y + 0.0076787835*nf.y + 0.24328612*ng.y + 0.44541475*nh.y + 0.47811326*ni.y; + y = -0.08137792*na.z + 0.0054794652*nb.z + 0.010020674*nc.z + 0.010480144*nd.z + -0.039868042*ne.z + -0.07489741*nf.z + 0.07070988*ng.z + -0.21065474*nh.z + 0.021973649*ni.z; + z = 0.064107254*na.w + -0.0053908625*nb.w + -0.114863224*nc.w + 0.16731638*nd.w + 0.25538787*ne.w + 0.1866355*nf.w + -0.093945995*ng.w + -0.06418409*nh.w + 0.0345877*ni.w; + float q = s+t+u+v+w+x+y+z+-0.2105562; + s = -0.055774365*a.x + -0.11095068*b.x + 0.21099071*c.x + 0.76015043*d.x + 0.70880866*e.x + 0.4252973*f.x + 0.33279955*g.x + -0.02746693*h.x + 0.035472445*i.x; + t = -0.4341578*a.y + -1.1611111*b.y + 0.08520569*c.y + -0.46149805*d.y + 1.0809829*e.y + 1.0949802*f.y + 0.6203274*g.y + 0.6198926*h.y + -0.32556617*i.y; + u = 0.23835486*a.z + 0.52716905*b.z + 0.26488614*c.z + -0.14032772*d.z + 0.57221615*e.z + -0.2149275*f.z + -0.12058982*g.z + 0.026753379*h.z + 0.04769247*i.z; + v = -0.21759552*a.w + -0.1794376*b.w + 0.13685067*c.w + 0.5899814*d.w + -0.3134837*e.w + -0.63145995*f.w + 0.027390439*g.w + -0.3019604*h.w + 0.22841412*i.w; + w = 0.49606472*na.x + 0.28688988*nb.x + 0.041773863*nc.x + -1.0630385*nd.x + 0.3604913*ne.x + 0.35036606*nf.x + 0.1582547*ng.x + 0.101572216*nh.x + -0.17073904*ni.x; + x = 0.04452118*na.y + 0.6793677*nb.y + -0.3826497*nc.y + 0.9849937*nd.y + -0.37544703*ne.y + -0.576944*nf.y + -0.7299865*ng.y + -0.5656419*nh.y + 0.47959635*ni.y; + y = -0.1702095*na.z + -0.6615286*nb.z + 0.20921148*nc.z + 0.22325529*nd.z + 0.39463216*ne.z + 0.03648698*nf.z + 0.14656936*ng.z + -0.056198504*nh.z + 0.11951617*ni.z; + z = -0.1369188*na.w + 0.024898373*nb.w + 0.11420796*nc.w + 0.38682333*nd.w + 0.6144158*ne.w + 0.12780511*nf.w + -0.3802895*ng.w + -0.3029823*nh.w + -0.12185999*ni.w; + float r = s+t+u+v+w+x+y+z+0.13825609; + + return vec4(o, p, q, r); +} +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN5 +//!SAVE LUMAN6 +//!COMPONENTS 4 + +#define L_tex LUMAN5_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = 0.11009468*a.x + 0.15513662*b.x + -0.007939103*c.x + 0.048910838*d.x + 0.3156732*e.x + 0.16871493*f.x + -0.04735453*g.x + 0.07840642*h.x + 0.01043032*i.x; + float t = 0.0603009*a.y + 0.15049285*b.y + 0.031496715*c.y + 0.1218871*d.y + 0.83518285*e.y + 0.21006268*f.y + 0.070826806*g.y + 0.12967728*h.y + -0.021242341*i.y; + float u = 0.041648302*a.z + -0.06679761*b.z + 0.0326429*c.z + -0.042804968*d.z + 0.009708471*e.z + 0.0055857953*f.z + 0.037250772*g.z + -0.038288858*h.z + 0.012428109*i.z; + float v = -2.5322544e-05*a.w + 0.0024099427*b.w + -0.000615236*c.w + 0.0055611636*d.w + 0.022731034*e.w + 0.009610867*f.w + -0.0034642597*g.w + 0.041869152*h.w + 0.012283638*i.w; + float w = -0.05471599*na.x + -0.062206052*nb.x + -0.014943314*nc.x + 0.06406119*nd.x + -0.14147298*ne.x + -0.05516727*nf.x + 0.0071981153*ng.x + -0.014024714*nh.x + 0.0036288039*ni.x; + float x = 0.024135597*na.y + -0.04542887*nb.y + -0.04953123*nc.y + -0.0053452025*nd.y + -0.68761176*ne.y + -0.14826675*nf.y + -0.023273345*ng.y + 0.0069940654*nh.y + 0.0012266012*ni.y; + float y = -0.02337356*na.z + 0.034824524*nb.z + -0.052677378*nc.z + -0.0016783525*nd.z + -0.025233837*ne.z + -0.022239193*nf.z + -0.0020268154*ng.z + 0.025603252*nh.z + -0.002237668*ni.z; + float z = -0.00023191393*na.w + 0.0002701566*nb.w + 0.009119059*nc.w + 0.0056037884*nd.w + -0.106378235*ne.w + -0.027843285*nf.w + 0.007191847*ng.w + -0.037982292*nh.w + -0.023501761*ni.w; + float o = s+t+u+v+w+x+y+z+0.029863132; + s = -0.66817456*a.x + -0.17347263*b.x + 0.080370635*c.x + -1.775243*d.x + -1.9561555*e.x + 0.02470279*f.x + -5.9847964e-05*g.x + -1.3914839*h.x + -0.26987377*i.x; + t = -0.4700984*a.y + -0.50769645*b.y + -0.045086645*c.y + 0.00030881853*d.y + -0.93926907*e.y + -0.3561231*f.y + -0.040285986*g.y + 0.0388076*h.y + -0.19906054*i.y; + u = -0.37273812*a.z + 0.23507157*b.z + -0.037670404*c.z + 0.13803919*d.z + -0.26558334*e.z + -0.112284966*f.z + -0.12488504*g.z + 0.24608758*h.z + -0.21625374*i.z; + v = 0.0014740598*a.w + 0.11752688*b.w + -0.064109504*c.w + 0.0066263312*d.w + 0.23817827*e.w + 0.012854009*f.w + 0.03952307*g.w + -0.035320062*h.w + 0.06463719*i.w; + w = 0.08255567*na.x + 0.05223393*nb.x + 0.1343985*nc.x + 0.39146107*nd.x + 0.6095351*ne.x + 0.3864864*nf.x + 0.21635368*ng.x + 0.46070915*nh.x + 0.19115895*ni.x; + x = 0.32835186*na.y + 0.040014826*nb.y + -0.13152607*nc.y + -0.8299666*nd.y + 0.48882028*ne.y + -0.07651838*nf.y + -0.16252832*ng.y + -0.538613*nh.y + -0.07108342*ni.y; + y = 0.4021103*na.z + -0.09048767*nb.z + -0.115632*nc.z + 0.19079824*nd.z + 0.043100078*ne.z + 0.17494403*nf.z + -0.029845314*ng.z + -0.3444861*nh.z + 0.31939086*ni.z; + z = 0.012830754*na.w + -0.00422419*nb.w + 0.12061506*nc.w + -0.036665943*nd.w + -0.035168063*ne.w + 0.07614391*nf.w + 0.059708446*ng.w + 0.025309797*nh.w + -0.0062844246*ni.w; + float p = s+t+u+v+w+x+y+z+0.002471427; + s = 0.20465308*a.x + 0.542538*b.x + -0.19668695*c.x + -0.46615118*d.x + -0.7388785*e.x + 0.1529125*f.x + -0.2751929*g.x + 0.6901443*h.x + 0.1376039*i.x; + t = -0.017125504*a.y + 0.12224764*b.y + -0.08542459*c.y + -0.24185401*d.y + 0.47374752*e.y + -0.0033960456*f.y + 0.14010258*g.y + 0.028386783*h.y + -0.11714224*i.y; + u = -0.23188816*a.z + 0.043953367*b.z + -0.16183634*c.z + 0.09362778*d.z + -0.09717627*e.z + -0.20605122*f.z + -0.12872243*g.z + -0.10989092*h.z + 0.057827067*i.z; + v = -0.002244122*a.w + 0.09510225*b.w + -0.08434639*c.w + -0.040398773*d.w + 0.15733676*e.w + -0.060302224*f.w + -0.098776944*g.w + 0.07610583*h.w + -0.017036678*i.w; + w = -0.20887235*na.x + -0.034263313*nb.x + -0.024945809*nc.x + 0.85824406*nd.x + 0.51730734*ne.x + 0.38317314*nf.x + -0.10828173*ng.x + -0.21163985*nh.x + -0.15301323*ni.x; + x = -0.03789462*na.y + 0.03121076*nb.y + -0.12869243*nc.y + 0.1547663*nd.y + 0.31563655*ne.y + -0.31219396*nf.y + -0.08229911*ng.y + 0.0006357061*nh.y + 0.099844694*ni.y; + y = 0.52138287*na.z + 0.012390004*nb.z + 0.21885982*nc.z + 0.38221806*nd.z + 0.29663363*ne.z + 0.41821536*nf.z + -0.1269795*ng.z + 0.21488404*nh.z + -0.06741776*ni.z; + z = 0.0212839*na.w + 0.05015271*nb.w + 0.121716134*nc.w + 0.055636514*nd.w + -0.44407418*ne.w + 0.008133906*nf.w + 0.10648469*ng.w + 0.1383999*nh.w + 0.08884415*ni.w; + float q = s+t+u+v+w+x+y+z+-0.27760294; + s = 0.4786117*a.x + 0.358807*b.x + -0.06828353*c.x + 0.3529208*d.x + -1.1123186*e.x + -0.19466123*f.x + -0.027625978*g.x + -0.63549286*h.x + 0.6956727*i.x; + t = 0.26915464*a.y + 0.0823444*b.y + 0.023828594*c.y + -0.65952504*d.y + -1.1619157*e.y + -0.36460975*f.y + 0.46075603*g.y + 1.1788677*h.y + 0.2645987*i.y; + u = 0.264061*a.z + 0.09876012*b.z + -0.15258524*c.z + -0.4519789*d.z + -0.3031103*e.z + 0.025894605*f.z + 0.06110853*g.z + 0.011523663*h.z + -0.23029587*i.z; + v = 0.06102014*a.w + -0.0018368509*b.w + -0.04596994*c.w + 0.047891494*d.w + 0.038071867*e.w + -0.15030977*f.w + -0.10674307*g.w + 0.0449417*h.w + 0.08584883*i.w; + w = -0.2798041*na.x + -0.01905936*nb.x + -0.00607432*nc.x + 0.23136932*nd.x + 0.31604388*ne.x + 0.3732394*nf.x + 0.33444604*ng.x + 0.26030633*nh.x + -0.19958955*ni.x; + x = -0.32725465*na.y + 0.14851013*nb.y + 0.0063473266*nc.y + 1.0751069*nd.y + 2.0589304*ne.y + -0.081835136*nf.y + -0.29807976*ng.y + -0.6531924*nh.y + -0.533299*ni.y; + y = 0.16828158*na.z + 0.2584582*nb.z + 0.3255441*nc.z + 0.073779166*nd.z + 0.85978925*ne.z + -0.04444849*nf.z + 0.29215494*ng.z + 0.36225298*nh.z + 0.5460576*ni.z; + z = -0.0040158187*na.w + 0.09762142*nb.w + 0.024949705*nc.w + 0.010230338*nd.w + -0.27563623*ne.w + 0.023636622*nf.w + -0.23736711*ng.w + -0.036448788*nh.w + -0.006399815*ni.w; + float r = s+t+u+v+w+x+y+z+-0.3031631; + + return vec4(o, p, q, r); +} +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN6 +//!SAVE LUMAN7 +//!COMPONENTS 4 + +#define L_tex LUMAN6_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.058837105*a.x + -0.06594728*b.x + -0.120181195*c.x + -0.15464571*d.x + 1.7877747*e.x + -0.6247841*f.x + -0.42160726*g.x + -0.33591035*h.x + -0.11929968*i.x; + float t = -0.04083831*a.y + 0.12604362*b.y + -0.22171828*c.y + -0.031979512*d.y + -0.35148853*e.y + 0.18371807*f.y + -0.18025142*g.y + -0.21343473*h.y + -0.17652942*i.y; + float u = 0.1296916*a.z + -0.34561402*b.z + 0.15583903*c.z + -0.009572381*d.z + 0.24573243*e.z + 0.23531769*f.z + 0.043407425*g.z + 0.031191947*h.z + 0.05083483*i.z; + float v = 0.041308045*a.w + 0.42653918*b.w + 0.057123598*c.w + 0.1467786*d.w + 0.084570505*e.w + 0.049585123*f.w + 0.07951087*g.w + 0.023403723*h.w + 0.058703538*i.w; + float w = -0.29908794*na.x + -0.11057356*nb.x + -0.19249663*nc.x + -0.120062664*nd.x + -1.4294766*ne.x + 0.31442398*nf.x + 0.0059633995*ng.x + 0.2249554*nh.x + 0.08491458*ni.x; + float x = -0.19419838*na.y + -0.17405464*nb.y + 0.054804742*nc.y + -0.1721043*nd.y + 1.0572225*ne.y + -0.17402618*nf.y + -0.010076491*ng.y + -0.18260245*nh.y + -0.07440039*ni.y; + float y = -0.08780574*na.z + 0.21823792*nb.z + 0.042452354*nc.z + -0.4371129*nd.z + -1.1089542*ne.z + -0.9202084*nf.z + 0.23421216*ng.z + 0.3200002*nh.z + 0.16972181*ni.z; + float z = -0.18576154*na.w + -0.9690735*nb.w + -0.438257*nc.w + -0.30590606*nd.w + -0.20159644*ne.w + -0.28393722*nf.w + -0.082253136*ng.w + -0.02268838*nh.w + 0.12528493*ni.w; + float o = s+t+u+v+w+x+y+z+0.55023825; + s = -0.51214135*a.x + 0.1587179*b.x + 0.305341*c.x + 0.05605032*d.x + 0.9423743*e.x + -0.4808295*f.x + 0.11528174*g.x + -0.14417756*h.x + 0.0129921865*i.x; + t = -0.07586892*a.y + 0.24033594*b.y + 0.14581378*c.y + 0.26807228*d.y + 0.06457829*e.y + 0.08675401*f.y + 0.020429688*g.y + -0.07649382*h.y + 0.10409905*i.y; + u = 0.106955506*a.z + -0.1377736*b.z + -0.19970961*c.z + 0.0904285*d.z + -0.28510383*e.z + -0.12552631*f.z + -0.045292355*g.z + 0.103908435*h.z + 0.05300471*i.z; + v = -0.019068277*a.w + 0.34505695*b.w + 0.112522*c.w + -0.1256843*d.w + 0.16478562*e.w + 0.131798*f.w + -0.032958005*g.w + -0.07537802*h.w + -0.033006195*i.w; + w = 0.06426005*na.x + -0.9773888*nb.x + -0.19099084*nc.x + -0.14661065*nd.x + 1.2671355*ne.x + 0.29711735*nf.x + 0.044925593*ng.x + -0.1830269*nh.x + 0.017887615*ni.x; + x = 0.06334686*na.y + 0.098540165*nb.y + -0.033426896*nc.y + 0.020740842*nd.y + -0.27653226*ne.y + -0.081057064*nf.y + -0.054287493*ng.y + 0.1748596*nh.y + 0.071279585*ni.y; + y = -0.37052953*na.z + -0.0927202*nb.z + 0.10979261*nc.z + -0.046625905*nd.z + 0.62244016*ne.z + 0.06752621*nf.z + -0.008467355*ng.z + -0.28500867*nh.z + -0.36461726*ni.z; + z = -0.020395795*na.w + -0.27024668*nb.w + 0.11460854*nc.w + 0.28669026*nd.w + -0.10853164*ne.w + -0.18687932*nf.w + 0.104976*ng.w + -0.044547517*nh.w + -0.20245767*ni.w; + float p = s+t+u+v+w+x+y+z+-0.020145543; + s = -0.21427825*a.x + 0.24354467*b.x + -0.18458553*c.x + 0.45293218*d.x + -0.09833768*e.x + -0.24275231*f.x + -0.2929853*g.x + -0.38809168*h.x + -0.14154571*i.x; + t = -0.01905719*a.y + 0.105777286*b.y + -0.15444006*c.y + -0.11596759*d.y + -0.47393703*e.y + 0.46603683*f.y + -0.1404903*g.y + -0.0428205*h.y + -0.28013608*i.y; + u = 0.119027026*a.z + -0.17662995*b.z + 0.019392667*c.z + 0.06876451*d.z + 0.14729378*e.z + -0.064709045*f.z + 0.06468247*g.z + 0.12282632*h.z + -0.03295381*i.z; + v = 0.05555683*a.w + 0.27148938*b.w + 0.1483462*c.w + -0.018142568*d.w + 0.04831512*e.w + 0.082228415*f.w + 0.03016951*g.w + 0.041722942*h.w + 0.064237125*i.w; + w = -0.1274535*na.x + -0.74423933*nb.x + 0.094309576*nc.x + -0.6064515*nd.x + -0.7374763*ne.x + -0.037755545*nf.x + 0.11237847*ng.x + 0.043476455*nh.x + 0.37125015*ni.x; + x = -0.15306838*na.y + -0.073084116*nb.y + 0.045736372*nc.y + -0.0021994396*nd.y + 0.57814497*ne.y + -0.23400332*nf.y + -0.032077234*ng.y + -0.15969266*nh.y + -0.009385252*ni.y; + y = -0.1314027*na.z + -0.010501284*nb.z + 0.06986638*nc.z + -0.37545362*nd.z + -0.62438697*ne.z + -0.7353602*nf.z + 0.0557151*ng.z + 0.0988044*nh.z + 0.2847317*ni.z; + z = -0.17195743*na.w + -0.639232*nb.w + -0.3238178*nc.w + -0.082515515*nd.w + -0.19047117*ne.w + -0.45840627*nf.w + -0.015534327*ng.w + 0.009699336*nh.w + 0.05022438*ni.w; + float q = s+t+u+v+w+x+y+z+-0.15954065; + s = -0.10845235*a.x + 0.24572098*b.x + -0.06379948*c.x + -0.10001011*d.x + 0.13738203*e.x + 0.04018451*f.x + -0.071444474*g.x + 0.22664078*h.x + -0.02070635*i.x; + t = -0.07616105*a.y + 0.23639366*b.y + -0.09321473*c.y + 0.19796714*d.y + -0.14075017*e.y + -0.0449301*f.y + 0.029756686*g.y + -0.09885688*h.y + 0.08356498*i.y; + u = 0.06800984*a.z + -0.2931856*b.z + 0.100556076*c.z + -0.048377596*d.z + -0.1781981*e.z + 0.20730834*f.z + -0.050653838*g.z + -0.04698904*h.z + 0.05376993*i.z; + v = -0.057300698*a.w + 0.3078168*b.w + -0.10591571*c.w + 0.074197516*d.w + 0.018544165*e.w + -0.055442665*f.w + 0.027493756*g.w + -0.057727467*h.w + -0.0016655796*i.w; + w = -0.081195965*na.x + -0.08301429*nb.x + 0.040080633*nc.x + 0.12346547*nd.x + 0.18738393*ne.x + -0.03630349*nf.x + 0.037644714*ng.x + 0.06655326*nh.x + -0.20145845*ni.x; + x = -0.0056442716*na.y + -0.05646837*nb.y + -0.029295942*nc.y + -0.12593834*nd.y + 0.14838746*ne.y + 0.07026047*nf.y + 0.018739218*ng.y + 0.025475666*nh.y + -0.060179282*ni.y; + y = -0.17208712*na.z + 0.30523688*nb.z + -0.046919305*nc.z + 0.044572577*nd.z + 0.14609618*ne.z + -0.14204772*nf.z + 0.12861522*ng.z + 0.022710633*nh.z + -0.13174535*ni.z; + z = 0.04883451*na.w + -0.18461144*nb.w + 0.030086063*nc.w + -0.042053822*nd.w + -0.0111156525*ne.w + 0.13287982*nf.w + -0.033152506*ng.w + -0.015516242*nh.w + 0.014659999*ni.w; + float r = s+t+u+v+w+x+y+z+-0.018601736; + + return vec4(o, p, q, r); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN7 +//!SAVE LUMAN8 +//!COMPONENTS 4 + +#define L_tex LUMAN7_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = 0.0043343515*a.x + 0.031900514*b.x + 0.02680601*c.x + 0.008120107*d.x + 0.12049021*e.x + 0.02749568*f.x + 0.026941638*g.x + 0.045876786*h.x + -0.01782276*i.x; + float t = -0.008756276*a.y + 0.0073754247*b.y + -0.008660523*c.y + -0.021356458*d.y + 0.06971389*e.y + 0.012638647*f.y + 0.00094445737*g.y + -0.029716656*h.y + 0.009664455*i.y; + float u = 0.023963265*a.z + -0.07385482*b.z + -0.008637229*c.z + 0.011912516*d.z + -0.11463661*e.z + -0.044297565*f.z + -0.03391417*g.z + -0.08568166*h.z + 0.0030300939*i.z; + float v = -0.02145077*a.w + -0.027281249*b.w + -0.07125093*c.w + -0.014157959*d.w + -0.11553326*e.w + -0.24110094*f.w + -0.08401101*g.w + -0.17157026*h.w + -0.0044118585*i.w; + float w = -0.0023835276*na.x + -0.02092952*nb.x + -0.019703476*nc.x + -0.00941571*nd.x + -0.10274844*ne.x + -0.0050635873*nf.x + -0.014229466*ng.x + -0.018546402*nh.x + 0.011970106*ni.x; + float x = 0.011714406*na.y + -0.0131633775*nb.y + -0.032575697*nc.y + 0.015258186*nd.y + 0.019382585*ne.y + 0.032736704*nf.y + 0.00022378328*ng.y + 0.025328603*nh.y + -0.0068634544*ni.y; + float y = -0.0059372336*na.z + 0.042804737*nb.z + 0.035751443*nc.z + 0.024954861*nd.z + 0.11153299*ne.z + 0.04162905*nf.z + -0.0015105935*ng.z + 0.08583687*nh.z + -0.020246334*ni.z; + float z = 0.00062923395*na.w + -0.09963906*nb.w + -0.10948316*nc.w + -0.0023887279*nd.w + -0.15891573*ne.w + 0.078041255*nf.w + -0.0327718*ng.w + -0.06652081*nh.w + -0.14793763*ni.w; + float o = s+t+u+v+w+x+y+z+-0.15004753; + s = -0.045950558*a.x + 0.08526373*b.x + 0.0015848293*c.x + 0.051914793*d.x + 0.4589526*e.x + 0.12101746*f.x + 0.14604174*g.x + -0.046519924*h.x + 0.037631262*i.x; + t = 0.031554867*a.y + 0.10354585*b.y + 0.029392516*c.y + -0.09057631*d.y + 0.60485184*e.y + -0.21951634*f.y + 0.07822993*g.y + -0.13727486*h.y + 0.020326601*i.y; + u = -0.24499135*a.z + 0.26627466*b.z + -0.030018428*c.z + 0.19534595*d.z + -1.0132202*e.z + -0.07760421*f.z + -0.08407245*g.z + 0.36748743*h.z + -0.023003025*i.z; + v = -0.01961517*a.w + -0.5236786*b.w + -0.21719319*c.w + 0.13156417*d.w + 0.9680923*e.w + 0.7953026*f.w + -0.27221867*g.w + 0.5287818*h.w + -0.28001225*i.w; + w = 0.041952703*na.x + -0.14607002*nb.x + 0.0115916515*nc.x + 0.071879886*nd.x + -0.49262965*ne.x + -0.2333565*nf.x + -0.14631014*ng.x + 0.20252785*nh.x + -0.047205925*ni.x; + x = 0.41004127*na.y + -0.023229387*nb.y + 0.3145412*nc.y + -0.10125493*nd.y + -0.29814953*ne.y + -0.30311933*nf.y + 0.16076022*ng.y + 0.44950342*nh.y + 0.30537477*ni.y; + y = 0.097353384*na.z + -0.2591137*nb.z + 0.10219444*nc.z + -0.10034551*nd.z + 1.0460515*ne.z + -0.027748754*nf.z + -0.049792234*ng.z + -0.18423916*nh.z + 0.039041415*ni.z; + z = -0.07199283*na.w + 0.9118068*nb.w + -0.11371128*nc.w + -0.1457156*nd.w + -1.3157147*ne.w + 0.032120865*nf.w + 0.43028107*ng.w + -0.60653263*nh.w + -0.18424125*ni.w; + float p = s+t+u+v+w+x+y+z+-0.21027789; + s = 0.015061524*a.x + -0.042695962*b.x + -0.027390774*c.x + -0.021753458*d.x + -0.28389663*e.x + -0.087922245*f.x + -0.04256834*g.x + -0.07680529*h.x + 0.09721116*i.x; + t = 0.03526287*a.y + -0.05655033*b.y + 0.011230106*c.y + 0.0505008*d.y + -0.31851402*e.y + 0.028345106*f.y + -0.00942657*g.y + -0.000914478*h.y + 0.01844695*i.y; + u = -0.050099995*a.z + 0.1496227*b.z + 0.03834261*c.z + 0.058271393*d.z + 0.3408369*e.z + 0.05830523*f.z + 0.0609813*g.z + 0.21783021*h.z + -0.104018345*i.z; + v = 0.00960184*a.w + 0.10341055*b.w + 0.07877837*c.w + 0.044007037*d.w + 0.85637236*e.w + 0.23916075*f.w + 0.10500761*g.w + 0.30397025*h.w + -0.17380545*i.w; + w = -0.015112898*na.x + 0.018385632*nb.x + 0.014311772*nc.x + 0.011377564*nd.x + 0.26749414*ne.x + 0.06939789*nf.x + -0.0041372473*ng.x + 0.0898865*nh.x + -0.0643906*ni.x; + x = -0.049965397*na.y + 0.09991889*nb.y + 0.019229416*nc.y + 0.007982338*nd.y + 0.19790286*ne.y + -0.15425439*nf.y + -0.012504278*ng.y + 0.013296758*nh.y + 0.059106532*ni.y; + y = 0.03129402*na.z + -0.07959529*nb.z + -0.027276205*nc.z + -0.084852204*nd.z + -0.2994552*ne.z + -0.08323548*nf.z + 0.056710556*ng.z + -0.23716407*nh.z + 0.106749184*ni.z; + z = 0.06815949*na.w + 0.09474177*nb.w + 0.11548853*nc.w + -0.07429912*nd.w + -0.81639*ne.w + -0.055724826*nf.w + 0.027693715*ng.w + -0.2331348*nh.w + 0.3457547*ni.w; + float q = s+t+u+v+w+x+y+z+0.31094915; + s = 0.0013066636*a.x + -0.014470875*b.x + 0.02128841*c.x + 0.07338732*d.x + 0.20127793*e.x + 0.011061661*f.x + 0.033728953*g.x + 0.0985754*h.x + -0.050257705*i.x; + t = -0.031690102*a.y + 0.08306357*b.y + -0.032130457*c.y + -0.038631335*d.y + 0.12435732*e.y + -0.038088728*f.y + 0.0183084*g.y + 0.027007373*h.y + -0.035241753*i.y; + u = 0.0022380766*a.z + -0.030015426*b.z + -0.017416682*c.z + -0.051282678*d.z + -0.06903824*e.z + 0.18370411*f.z + -0.007649599*g.z + 0.17488697*h.z + 0.021375295*i.z; + v = -0.039706558*a.w + -0.18508846*b.w + -0.17433922*c.w + -0.019243676*d.w + 0.41235447*e.w + 0.5118561*f.w + -0.046311516*g.w + -0.049719848*h.w + -0.046298645*i.w; + w = -0.00018484949*na.x + -0.027503032*nb.x + -0.0055394815*nc.x + -0.011507984*nd.x + -0.15373719*ne.x + -0.0014909318*nf.x + 0.021079242*ng.x + -0.0021839878*nh.x + 0.014581417*ni.x; + x = 0.2559631*na.y + 0.20557807*nb.y + 0.17747739*nc.y + -0.0077582854*nd.y + -0.33705455*ne.y + -0.03593226*nf.y + 0.09016103*ng.y + 0.26824155*nh.y + 0.15681592*ni.y; + y = -0.0006438971*na.z + -0.05665117*nb.z + -0.01930691*nc.z + 0.055304658*nd.z + 0.2226201*ne.z + -0.115618564*nf.z + -0.17851204*ng.z + 0.02309775*nh.z + -0.0020957827*ni.z; + z = -0.12483319*na.w + 0.17680287*nb.w + 0.07221295*nc.w + -0.14756423*nd.w + -0.575894*ne.w + -0.5924514*nf.w + -0.18334259*ng.w + 0.21495773*nh.w + -0.28770602*ni.w; + float r = s+t+u+v+w+x+y+z+-0.14252092; + + return vec4(o, p, q, r); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(L)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN8 +//!SAVE LUMAN9 +//!COMPONENTS 4 + +#define L_tex LUMAN8_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = 0.0045221616*a.x + 0.13361083*b.x + -0.10101074*c.x + -0.3104477*d.x + 0.014453704*e.x + 0.16743605*f.x + 0.42815346*g.x + -0.43762806*h.x + 0.13747907*i.x; + float t = -0.0025087043*a.y + 0.034502532*b.y + -0.024045702*c.y + -0.06813702*d.y + 0.37240034*e.y + -0.048689447*f.y + -0.017587204*g.y + 0.07796901*h.y + -0.019994954*i.y; + float u = -0.004463331*a.z + -0.04021734*b.z + -0.1710686*c.z + -0.3861281*d.z + -0.27769396*e.z + -0.17114232*f.z + 0.008659706*g.z + -0.13689534*h.z + -0.017564151*i.z; + float v = -0.03719927*a.w + -0.060866248*b.w + -0.0005154834*c.w + 0.13105202*d.w + -0.4756373*e.w + 0.038031157*f.w + 0.007987142*g.w + -0.1287741*h.w + 0.0044731162*i.w; + float w = -0.1588144*na.x + -0.17861399*nb.x + 0.20677862*nc.x + 0.27629393*nd.x + -0.8962142*ne.x + 0.08535742*nf.x + 0.1059245*ng.x + -0.21035257*nh.x + 0.12790036*ni.x; + float x = 0.016721228*na.y + -0.043781657*nb.y + 0.0063481582*nc.y + 0.020839894*nd.y + -0.33675256*ne.y + 0.07076052*nf.y + -0.021649923*ng.y + 0.030575788*nh.y + 0.0031574676*ni.y; + float y = -0.03249512*na.z + -0.059435222*nb.z + 0.019422397*nc.z + 0.060571607*nd.z + 0.51076144*ne.z + -0.11944391*nf.z + -0.18080437*ng.z + 0.13912733*nh.z + -0.03084553*ni.z; + float z = -0.027890082*na.w + 0.074107096*nb.w + -0.025465522*nc.w + 0.052459516*nd.w + 0.35346648*ne.w + 0.0057676597*nf.w + -0.09199142*ng.w + 0.13720098*nh.w + -0.026844189*ni.w; + float o = s+t+u+v+w+x+y+z+-0.07062165; + s = -0.36914617*a.x + -0.387709*b.x + 0.24546379*c.x + -0.13407065*d.x + -1.3985281*e.x + -0.38215598*f.x + -0.4253273*g.x + -0.6018277*h.x + -0.1896727*i.x; + t = 0.059232086*a.y + -0.03218242*b.y + 0.0854699*c.y + -0.0541505*d.y + -0.29609218*e.y + 0.11369224*f.y + 0.040713545*g.y + -0.0018869163*h.y + 0.006187881*i.y; + u = -0.008775295*a.z + -0.5102556*b.z + 0.7375027*c.z + 0.072452776*d.z + -1.2024788*e.z + 0.46121085*f.z + 0.058012936*g.z + 0.18176034*h.z + 0.048703782*i.z; + v = 0.044314258*a.w + 0.109136716*b.w + 0.01512838*c.w + 0.123235516*d.w + 0.012212226*e.w + -0.058148805*f.w + -0.037189372*g.w + 0.15093021*h.w + 0.1898863*i.w; + w = 0.21549232*na.x + 0.65820724*nb.x + -0.48491365*nc.x + 0.42730922*nd.x + 1.6641526*ne.x + -0.65468395*nf.x + -0.023389338*ng.x + 0.814365*nh.x + -0.11903003*ni.x; + x = -0.10621744*na.y + 0.028651522*nb.y + -0.03911892*nc.y + 0.2328494*nd.y + -0.79811394*ne.y + -0.07812101*nf.y + -0.0048260875*ng.y + -0.20159449*nh.y + 0.012622353*ni.y; + y = 0.16155821*na.z + 0.17430165*nb.z + -0.11564172*nc.z + -0.09045215*nd.z + -0.17220502*ne.z + 0.033265576*nf.z + 0.19950038*ng.z + 0.15146245*nh.z + -0.0076287147*ni.z; + z = -0.042550612*na.w + 0.52137315*nb.w + 0.17050217*nc.w + -0.30661416*nd.w + -0.7809509*ne.w + -0.4212841*nf.w + 0.20205358*ng.w + -0.030464187*nh.w + 0.0151808495*ni.w; + float p = s+t+u+v+w+x+y+z+0.021308308; + s = 0.13723312*a.x + -0.13058148*b.x + 0.02991709*c.x + 0.17664903*d.x + 0.80338216*e.x + -0.16452265*f.x + -0.52892923*g.x + 0.5847315*h.x + -0.13948771*i.x; + t = -0.05281949*a.y + -0.013688717*b.y + 0.0066821994*c.y + 0.18340334*d.y + 0.17611703*e.y + 0.014302875*f.y + 0.027431076*g.y + -0.03286966*h.y + 0.00777125*i.y; + u = -0.030233394*a.z + -0.1516942*b.z + 0.023113774*c.z + 0.5036234*d.z + 0.35019687*e.z + 0.083215944*f.z + -0.10124035*g.z + -0.4368648*h.z + -0.09983686*i.z; + v = 0.08234885*a.w + -0.12858762*b.w + 0.011945575*c.w + -0.3161481*d.w + 0.73186344*e.w + -0.08109684*f.w + -0.068002164*g.w + -0.00015807863*h.w + -0.14903568*i.w; + w = -0.01809736*na.x + 0.106148295*nb.x + -0.11458607*nc.x + -0.24150115*nd.x + 0.6235813*ne.x + 0.29316586*nf.x + -0.38179514*ng.x + 0.08143321*nh.x + 0.11211959*ni.x; + x = 0.018066866*na.y + 0.00932761*nb.y + 0.020590544*nc.y + -0.19661997*nd.y + -0.1589172*ne.y + -0.024075199*nf.y + 0.037923746*ng.y + 0.075451836*nh.y + -0.016839966*ni.y; + y = 0.01555148*na.z + 0.07518228*nb.z + 0.014010743*nc.z + 0.074753106*nd.z + 0.16666804*ne.z + -0.04246754*nf.z + 0.23196241*ng.z + -0.08842999*nh.z + 0.13125029*ni.z; + z = -0.023343185*na.w + -0.011415688*nb.w + 0.13216138*nc.w + 0.0020203877*nd.w + -0.82738686*ne.w + 0.18328057*nf.w + 0.1155263*ng.w + 0.2484653*nh.w + 0.024372995*ni.w; + float q = s+t+u+v+w+x+y+z+0.1330845; + s = 0.058917314*a.x + -0.59722525*b.x + 0.1952677*c.x + -0.8540309*d.x + 1.8505293*e.x + -0.34204116*f.x + -0.90100527*g.x + 0.9598115*h.x + -0.6574991*i.x; + t = -0.061550487*a.y + -0.041244105*b.y + 0.089612804*c.y + 0.274677*d.y + 0.20550548*e.y + 0.12090422*f.y + 0.07600108*g.y + 0.039211385*h.y + 0.0569241*i.y; + u = 0.11367846*a.z + -1.2503271*b.z + 0.60662305*c.z + 0.80728525*d.z + -3.170348*e.z + 0.6594199*f.z + -0.32941318*g.z + -0.48758575*h.z + -0.23526128*i.z; + v = 0.14170112*a.w + -0.39299014*b.w + 0.07595085*c.w + -0.36611298*d.w + -0.19472311*e.w + -0.25320992*f.w + -0.16693003*g.w + -0.08744426*h.w + -0.30629703*i.w; + w = 0.23633157*na.x + 0.1263963*nb.x + -0.5513621*nc.x + -0.9526632*nd.x + 0.8599824*ne.x + -0.24109666*nf.x + -0.26302767*ng.x + -0.83445895*nh.x + 0.49014238*ni.x; + x = 0.06461769*na.y + -0.09234017*nb.y + 0.0017150213*nc.y + -0.36574394*nd.y + 0.5042944*ne.y + -0.09363131*nf.y + 0.04096498*ng.y + 0.13416007*nh.y + -0.08434449*ni.y; + y = 0.22188498*na.z + 0.22532557*nb.z + -0.16574928*nc.z + 0.298751*nd.z + 0.64085424*ne.z + -0.553648*nf.z + 0.43413857*ng.z + -0.08766077*nh.z + 0.27797157*ni.z; + z = -0.14811756*na.w + 0.16666892*nb.w + 0.6009881*nc.w + -0.031475574*nd.w + 0.73704195*ne.w + -0.13920692*nf.w + 0.21735713*ng.w + 0.40883866*nh.w + 0.22915195*ni.w; + float r = s+t+u+v+w+x+y+z+-0.11533214; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(L)-Conv-Reduce +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN0 +//!BIND LUMAN1 +//!BIND LUMAN2 +//!BIND LUMAN3 +//!BIND LUMAN4 +//!BIND LUMAN5 +//!BIND LUMAN6 +//!BIND LUMAN7 +//!BIND LUMAN8 +//!BIND LUMAN9 +//!SAVE LUMAN0 +//!COMPONENTS 4 + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = LUMAN1_tex(HOOKED_pos); + vec4 b = LUMAN2_tex(HOOKED_pos); + vec4 c = LUMAN3_tex(HOOKED_pos); + vec4 d = LUMAN4_tex(HOOKED_pos); + vec4 e = LUMAN5_tex(HOOKED_pos); + vec4 f = LUMAN6_tex(HOOKED_pos); + vec4 g = LUMAN7_tex(HOOKED_pos); + vec4 h = LUMAN8_tex(HOOKED_pos); + vec4 i = LUMAN9_tex(HOOKED_pos); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float o = -0.025345499*a.x + -0.0021511635*a.y + -0.01552223*a.z + 0.0030616536*a.w + 0.0032075346*na.x + 0.015554411*na.y + -0.016889228*na.z + -0.025014572*na.w + 0.0325229*b.x + -0.024351532*b.y + -0.008672373*b.z + 0.005590789*b.w + -0.020257758*nb.x + -0.018104428*nb.y + 0.005594391*nb.z + -0.0038329903*nb.w + 0.0383081*c.x + 0.0256335*c.y + -0.0046722684*c.z + 0.012396267*c.w + 0.0072566173*nc.x + -0.030656457*nc.y + -0.015092298*nc.z + -0.018772159*nc.w + -0.007535416*d.x + 0.006674194*d.y + 0.008633592*d.z + 0.0062616826*d.w + 0.008656795*nd.x + -0.068955205*nd.y + 0.02067291*nd.z + 0.007096046*nd.w + 0.01846029*e.x + 0.0638565*e.y + -0.00031000233*e.z + -9.5327276e-05*e.w + -0.029591039*ne.x + 0.03750348*ne.y + 0.006678989*ne.z + 0.014006669*ne.w + 0.008463897*f.x + 0.0070520015*f.y + 0.011277146*f.z + -0.0012753214*f.w + -0.023588767*nf.x + 0.004832184*nf.y + 0.034385283*nf.z + 0.008817432*nf.w + -0.07026202*g.x + -0.014893343*g.y + 0.06503661*g.z + 0.060461916*g.w + 0.073642954*ng.x + -0.039829027*ng.y + -0.069101036*ng.z + -0.05795985*ng.w + 0.19353457*h.x + -0.04431774*h.y + 0.14139234*h.z + 0.029222706*h.w + -0.13620058*nh.x + 0.1519176*nh.y + -0.11167681*nh.z + -0.007895559*nh.w + 0.16441825*i.x + 0.072630785*i.y + 0.07183864*i.z + -0.026890865*i.w + -0.26577094*ni.x + -0.06758755*ni.y + -0.16738161*ni.z + 0.05678283*ni.w + 0.05050823; + float p = -0.026869139*a.x + 0.002010285*a.y + -0.016674858*a.z + 0.021867773*a.w + -0.0028898043*na.x + 0.010733717*na.y + -0.009715258*na.z + -0.011681211*na.w + 0.028584342*b.x + -0.034911852*b.y + -0.022455417*b.z + 0.0026852142*b.w + 0.001420245*nb.x + 0.004688186*nb.y + 0.0030484367*nb.z + -0.0011866139*nb.w + 0.027579257*c.x + -0.015300072*c.y + -0.0014369268*c.z + -0.023694385*c.w + 0.008272616*nc.x + 0.04187405*nc.y + -0.022349909*nc.z + 0.005638889*nc.w + 0.048093572*d.x + 0.014570987*d.y + 0.0094069885*d.z + 0.02643197*d.w + -0.023413727*nd.x + -0.018971106*nd.y + 0.009009003*nd.z + 0.02342026*nd.w + -0.08019369*e.x + -0.06362331*e.y + 0.019364605*e.z + -0.007610332*e.w + 0.0048531704*ne.x + 0.030215567*ne.y + -0.009395934*ne.z + -0.0039095255*ne.w + 0.029369153*f.x + 0.0009064993*f.y + 0.007748084*f.z + -0.0042151194*f.w + -0.012785969*nf.x + -4.0651157e-05*nf.y + -0.06834957*nf.z + -0.018293295*nf.w + 0.0041621197*g.x + 0.005473837*g.y + 0.011909403*g.z + 0.021833688*g.w + -0.00785828*ng.x + 0.046268523*ng.y + 0.0041527576*ng.z + -0.0073750536*ng.w + 0.051478274*h.x + 0.0048867916*h.y + 0.21436256*h.z + 0.0848831*h.w + 0.19794522*nh.x + -0.078197576*nh.y + -0.010980174*nh.z + -0.1313427*nh.w + 0.003084501*i.x + -0.03095605*i.y + -0.15071087*i.z + 0.049830485*i.w + -0.12544242*ni.x + 0.037474785*ni.y + 0.21824111*ni.z + -0.020350412*ni.w + 0.034696534; + float q = -0.011473843*a.x + -0.008500929*a.y + -0.006225505*a.z + -0.06859053*a.w + -0.002649979*na.x + 0.0349027*na.y + 0.004008673*na.z + 0.010730329*na.w + 0.02279527*b.x + 0.011611871*b.y + 0.0053784857*b.z + -0.0014197611*b.w + -0.012508805*nb.x + -0.008713889*nb.y + 0.0055506355*nb.z + 0.0034218444*nb.w + 0.037574526*c.x + 0.018567413*c.y + 0.009479835*c.z + 0.0030985347*c.w + 0.012783179*nc.x + 0.03769012*nc.y + -0.022271728*nc.z + -0.022396212*nc.w + -0.023644615*d.x + -0.01713754*d.y + 0.036613688*d.z + -0.028280022*d.w + 0.01478604*nd.x + -0.047950666*nd.y + -0.028563306*nd.z + 0.01610751*nd.w + 0.18479255*e.x + 0.03375349*e.y + -0.006211228*e.z + 0.0013715967*e.w + -0.011906715*ne.x + -0.027515646*ne.y + -0.0014491043*ne.z + -0.010461221*ne.w + -0.027081*f.x + -0.00024475018*f.y + 0.0016701716*f.z + -0.0051322295*f.w + 0.08178321*nf.x + -0.0039486554*nf.y + 0.048087467*nf.z + 0.0062712957*nf.w + -0.0060339626*g.x + 0.01327678*g.y + -0.015740184*g.z + -0.04198038*g.w + 0.017990626*ng.x + -0.05803023*ng.y + 0.008065028*ng.z + 0.09840205*ng.w + 0.21650502*h.x + -0.044883523*h.y + 0.35736752*h.z + 0.13069746*h.w + -0.0055992976*nh.x + -0.0070668226*nh.y + -0.13867852*nh.z + -0.15813062*nh.w + 0.07502654*i.x + 0.037590154*i.y + -0.05456113*i.z + 0.04583868*i.w + -0.005933467*ni.x + -0.028233645*ni.y + 0.036081396*ni.z + -0.09075903*ni.w + 0.031019757; + float r = -0.012266471*a.x + -0.01038637*a.y + -0.006403305*a.z + -0.061549455*a.w + -0.0020815514*na.x + 0.025403013*na.y + 0.0030878584*na.z + 0.025642337*na.w + 0.021623747*b.x + 0.025759231*b.y + 0.016868886*b.z + -0.011757056*b.w + 0.018949974*nb.x + -0.03879046*nb.y + -0.008584741*nb.z + 0.010319324*nb.w + 0.009948425*c.x + 0.053120364*c.y + 0.0014052548*c.z + 0.015825326*c.w + 0.0032175633*nc.x + -0.010692245*nc.y + -0.0076005645*nc.z + -0.052508987*nc.w + -0.009496796*d.x + 0.0066874796*d.y + 0.013183267*d.z + -0.017360926*d.w + 0.010480816*nd.x + -0.02319759*nd.y + 0.00336114*nd.z + 0.022330863*nd.w + 0.058043666*e.x + 0.08283237*e.y + 0.030803166*e.z + -0.0032534911*e.w + -0.03677484*ne.x + 0.03213852*ne.y + -0.018663544*ne.z + -0.012127*ne.w + -0.018157737*f.x + 0.009688269*f.y + 0.018519528*f.z + 0.0061194277*f.w + 0.007688681*nf.x + 0.004965012*nf.y + -0.06950929*nf.z + -0.024124136*nf.w + -0.06957238*g.x + -0.032947022*g.y + 0.07435419*g.z + 0.13112263*g.w + 0.055360015*ng.x + 0.05605465*ng.y + -0.076736465*ng.z + -0.14243616*ng.w + -0.11771925*h.x + 0.04998612*h.y + -0.13548268*h.z + 0.030703869*h.w + 0.110005826*nh.x + -0.09178284*nh.y + 0.15351678*nh.z + -0.05320431*nh.w + -0.15733768*i.x + -0.023674926*i.y + -0.13662882*i.z + 0.03777956*i.w + 0.24352121*ni.x + 0.05974571*ni.y + 0.13660003*ni.z + -0.06796056*ni.w + 0.0752347; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(L) +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN0 +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * + + +vec4 hook() { + vec2 f = fract(LUMAN0_pos * LUMAN0_size); + ivec2 i = ivec2(f * vec2(2)); + float c = LUMAN0_tex((vec2(0.5) - f) * LUMAN0_pt + LUMAN0_pos)[i.y * 2 + i.x]; + return vec4(c + HOOKED_tex(HOOKED_pos).x, HOOKED_tex(HOOKED_pos).yz, 0); +} diff --git a/.config/mpv/shaders/Anime4K_Upscale_CNN_M_x2.glsl b/.config/mpv/shaders/Anime4K_Upscale_CNN_M_x2.glsl new file mode 100644 index 0000000..db9ed03 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_CNN_M_x2.glsl @@ -0,0 +1,521 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(M)-Conv-4x3x3x1 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!SAVE LUMAN0 +//!COMPONENTS 4 + + +vec4 hook() { + vec2 dp = HOOKED_pt; + float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x; + float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x; + float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x; + float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x; + float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x; + float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x; + float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x; + float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x; + + float s = -0.09440448*a + 0.49120164*b + -0.022703001*c + -0.016553257*d + 0.6272513*e + -0.97632706*f + 0.10815585*g + -0.21898738*h + 0.09604159*i; + float o = s+0.00028890301; + s = 0.061990097*a + -0.87003845*b + -0.037461795*c + 0.13172528*d + 0.87585527*e + -0.13609451*f + -0.070119604*g + -0.051131595*h + 0.09209152*i; + float p = s+-0.017290013; + s = 0.45264956*a + -1.1240269*b + 0.07975403*c + 0.6734861*d + -0.05388544*e + 0.007570164*f + -0.06987841*g + 0.012247365*h + 0.034949988*i; + float q = s+-0.0145500265; + s = -0.035659406*a + 0.043313805*b + -0.056556296*c + 0.08745333*d + 0.6312519*e + -0.24501355*f + -0.13407958*g + -0.18634492*h + -0.08149098*i; + float r = s+-0.009025143; + + return vec4(o, p, q, r); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN0 +//!SAVE LUMAN1 +//!COMPONENTS 4 + +#define L_tex LUMAN0_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.05327107*a.x + -0.07160779*b.x + -0.053545203*c.x + 0.30653647*d.x + -0.623205*e.x + -0.25135925*f.x + -0.18046309*g.x + 0.5326353*h.x + -0.09099461*i.x; + float t = -0.16687301*a.y + 0.29383695*b.y + -0.15116534*c.y + 0.013435781*d.y + -0.3595954*e.y + 0.3222953*f.y + 0.20127103*g.y + 1.1504021*h.y + 0.6521217*i.y; + float u = -0.0015649797*a.z + -0.18814865*b.z + 0.061695296*c.z + 0.013806492*d.z + 0.12745698*e.z + -0.30406427*f.z + -0.05947408*g.z + 0.33141926*h.z + -0.20066342*i.z; + float v = 0.30095318*a.w + 0.36586058*b.w + 0.22645043*c.w + 0.1612967*d.w + -0.37834042*e.w + -0.08229078*f.w + -0.64827895*g.w + 0.04798959*h.w + 0.50426966*i.w; + float w = 0.126555*na.x + 0.079004966*nb.x + -0.06367056*nc.x + -0.16546968*nd.x + 0.50795466*ne.x + 0.18011826*nf.x + 0.16996312*ng.x + -0.51605004*nh.x + 0.10505295*ni.x; + float x = 0.1540833*na.y + -0.26913214*nb.y + 0.13605806*nc.y + -0.12155722*nd.y + 0.21405062*ne.y + -0.27972937*nf.y + -0.41382065*ng.y + -1.7224138*nh.y + -0.60294384*ni.y; + float y = 0.00970452*na.z + 0.20325865*nb.z + 0.0015745827*nc.z + -0.107312985*nd.z + 0.009980262*ne.z + 0.2720558*nf.z + 0.15321876*ng.z + -0.036781967*nh.z + 0.051229585*ni.z; + float z = -0.27454868*na.w + -0.4432009*nb.w + -0.003881375*nc.w + 0.18336153*nd.w + 0.19950926*ne.w + 0.045014136*nf.w + 0.6243142*ng.w + -0.16252244*nh.w + -0.42274413*ni.w; + float o = s+t+u+v+w+x+y+z+0.039423503; + s = -0.10775202*a.x + -0.031339962*b.x + 0.0060642078*c.x + -0.10545187*d.x + 0.12458454*e.x + 0.0021231163*f.x + 0.07905482*g.x + 0.08223747*h.x + 0.04828753*i.x; + t = 0.13271476*a.y + -0.40485632*b.y + 0.054641176*c.y + -0.4327063*d.y + -0.19545476*e.y + 0.09262824*f.y + -0.36247733*g.y + 0.12627794*h.y + -0.075792745*i.y; + u = -0.09226349*a.z + 0.24326*b.z + -0.021355193*c.z + 0.1444612*d.z + -0.102547936*e.z + 0.05568293*f.z + 0.013875915*g.z + 0.19688046*h.z + 0.0154764345*i.z; + v = -0.1431215*a.w + -0.26233566*b.w + -0.020626735*c.w + 0.019540034*d.w + 0.18164286*e.w + -0.16356231*f.w + 0.17014627*g.w + -0.27788106*h.w + 0.0718594*i.w; + w = 0.20348297*na.x + 0.10994786*nb.x + 0.014990544*nc.x + 1.033602*nd.x + 0.024537617*ne.x + 0.009609228*nf.x + 0.12779616*ng.x + 0.06813842*nh.x + -0.04269685*ni.x; + x = -0.2430749*na.y + 0.37466663*nb.y + -0.06150604*nc.y + 0.28204092*nd.y + 0.22226551*ne.y + -0.19715464*nf.y + 0.003657579*ng.y + -0.30363604*nh.y + 0.0542432*ni.y; + y = 0.1447509*na.z + -0.28650913*nb.z + -0.058723953*nc.z + -0.092879236*nd.z + 0.26428574*ne.z + -0.104749136*nf.z + -0.070094705*ng.z + 0.047571726*nh.z + -0.010061374*ni.z; + z = 0.0438258*na.w + 0.34031448*nb.w + -0.013600149*nc.w + 0.28250962*nd.w + -0.73591596*ne.w + 0.21241076*nf.w + -0.27542746*ng.w + 0.14023423*nh.w + -0.10678145*ni.w; + float p = s+t+u+v+w+x+y+z+-0.021502364; + s = 0.032163877*a.x + -0.66642886*b.x + 0.044751197*c.x + 0.05605561*d.x + 0.6945027*e.x + -0.07645503*f.x + -0.04662916*g.x + -0.2509118*h.x + 0.098923184*i.x; + t = 0.03268785*a.y + 0.2343848*b.y + -0.058907576*c.y + -0.6397386*d.y + -0.15121439*e.y + 0.15354797*f.y + -0.3191564*g.y + -0.24138322*h.y + -0.71516746*i.y; + u = -0.069602974*a.z + -0.4111596*b.z + 0.021718252*c.z + 0.2399502*d.z + 0.64263207*e.z + 0.3311527*f.z + -0.2513218*g.z + -0.48004037*h.z + 0.78069997*i.z; + v = -0.6631432*a.w + 0.15360248*b.w + 0.012449814*c.w + -0.9210798*d.w + 0.77063346*e.w + 0.10402895*f.w + 0.26728597*g.w + -0.3063174*h.w + 0.07107563*i.w; + w = -0.22910015*na.x + 0.60668314*nb.x + -0.07472177*nc.x + -0.2976557*nd.x + -0.31179214*ne.x + 0.17979208*nf.x + -0.059973676*ng.x + 0.48262063*nh.x + 0.10012325*ni.x; + x = -0.008694405*na.y + -0.19812866*nb.y + 0.024916848*nc.y + 0.57730144*nd.y + 0.20505147*ne.y + -0.22297408*nf.y + 0.09352177*ng.y + -0.548608*nh.y + 0.56032515*ni.y; + y = 0.05522713*na.z + 0.3843459*nb.z + -0.017952677*nc.z + -0.24958606*nd.z + -0.641729*ne.z + -0.13842992*nf.z + 0.20486256*ng.z + 0.24058507*nh.z + -0.53553283*ni.z; + z = 0.7243502*na.w + -0.16880396*nb.w + 0.11347028*nc.w + 0.98730826*nd.w + -0.4131502*ne.w + -0.605653*nf.w + -0.20231946*ng.w + 0.268739*nh.w + -0.25494024*ni.w; + float q = s+t+u+v+w+x+y+z+-0.011375127; + s = 0.004939782*a.x + 0.04961287*b.x + -0.022315059*c.x + -0.36721465*d.x + 0.02673542*e.x + -0.055127766*f.x + -0.3139398*g.x + 0.011177372*h.x + -0.002486109*i.x; + t = 0.0029139163*a.y + -0.018279694*b.y + 0.23850645*c.y + -0.053427566*d.y + -0.19388364*e.y + 0.25149515*f.y + -0.15969065*g.y + 0.003607878*h.y + 0.47864768*i.y; + u = 0.018587857*a.z + 0.04256821*b.z + -0.084889054*c.z + -0.10649675*d.z + 0.1413508*e.z + -0.014863062*f.z + 0.046072394*g.z + 0.044705987*h.z + -0.3495728*i.z; + v = -0.25952607*a.w + -0.37138674*b.w + -0.31769684*c.w + -0.47086135*d.w + 0.4518305*e.w + 0.23906761*f.w + 0.37785494*g.w + -0.12342203*h.w + -0.18958518*i.w; + w = -0.0987012*na.x + -0.23680592*nb.x + -0.038128883*nc.x + 0.021003952*nd.x + -0.21279961*ne.x + 0.02450331*nf.x + 0.22508678*ng.x + -0.050619982*nh.x + -0.12929344*ni.x; + x = 0.024458453*na.y + 0.07273773*nb.y + -0.26048952*nc.y + 0.18460196*nd.y + 0.4304707*ne.y + -0.17272879*nf.y + 0.28351468*ng.y + 1.3116083*nh.y + -0.29540524*ni.y; + y = -0.041094407*na.z + 0.024719454*nb.z + 0.19896787*nc.z + 0.07664201*nd.z + -0.25621203*ne.z + 0.10749328*nf.z + -0.067182586*ng.z + 0.06065049*nh.z + 0.47074008*ni.z; + z = 0.13518347*na.w + 0.20488833*nb.w + 0.24956091*nc.w + 0.07386013*nd.w + -0.9938687*ne.w + -0.15375653*nf.w + -0.55804706*ng.w + -0.0036114866*nh.w + 0.3378182*ni.w; + float r = s+t+u+v+w+x+y+z+-0.047199935; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN1 +//!SAVE LUMAN2 +//!COMPONENTS 4 + +#define L_tex LUMAN1_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = 0.062563986*a.x + 0.7022818*b.x + -0.011810557*c.x + 0.25277942*d.x + -0.2097257*e.x + 0.17233184*f.x + -0.28609228*g.x + -0.32957354*h.x + -0.11091415*i.x; + float t = 0.0074290223*a.y + 0.25707433*b.y + 0.02356039*c.y + -0.0033311683*d.y + 0.78796846*e.y + -0.8613285*f.y + 0.020431397*g.y + -0.014993784*h.y + -0.5224642*i.y; + float u = -0.099318005*a.z + 0.096692294*b.z + -0.081225544*c.z + 0.4837614*d.z + 0.40215006*e.z + 0.06631713*f.z + -0.28298393*g.z + -0.15690443*h.z + -0.11722153*i.z; + float v = -0.20104708*a.w + 0.29773432*b.w + -0.059524678*c.w + 0.672484*d.w + 0.58850944*e.w + 0.19088581*f.w + 0.085560724*g.w + -0.3429526*h.w + -0.01970963*i.w; + float w = 0.2530852*na.x + -0.26206517*nb.x + -0.0087517025*nc.x + -0.33815455*nd.x + -0.00843703*ne.x + -0.22927909*nf.x + -0.062886484*ng.x + 0.17524554*nh.x + -0.008373106*ni.x; + float x = 0.17741594*na.y + -0.52788115*nb.y + -0.10984838*nc.y + -0.13678722*nd.y + -0.28618953*ne.y + 0.1595905*nf.y + -0.04411071*ng.y + -0.3234863*nh.y + 0.4967709*ni.y; + float y = 0.042347442*na.z + 0.08541207*nb.z + -0.15857157*nc.z + -0.30902776*nd.z + -0.8957161*ne.z + -0.29276812*nf.z + 0.47053015*ng.z + 0.6092259*nh.z + 0.31623343*ni.z; + float z = 0.17963913*na.w + -0.30821583*nb.w + 0.15316938*nc.w + -0.37125722*nd.w + -0.5975526*ne.w + -0.07182377*nf.w + 0.069451295*ng.w + 0.61750644*nh.w + 0.07411387*ni.w; + float o = s+t+u+v+w+x+y+z+0.025282431; + s = 0.15042752*a.x + 0.76578605*b.x + 0.15916896*c.x + 0.062038895*d.x + 0.90041196*e.x + 0.44829968*f.x + -0.1525204*g.x + -0.0769386*h.x + -0.017208606*i.x; + t = -0.24956173*a.y + -0.4890138*b.y + -0.5667875*c.y + -0.04361386*d.y + -1.2683009*e.y + 0.49874577*f.y + -0.023511255*g.y + -0.44963378*h.y + -0.44784302*i.y; + u = -0.4755887*a.z + 0.5499969*b.z + -0.40806842*c.z + 0.18438272*d.z + -0.24848352*e.z + -0.6397795*f.z + -0.26359263*g.z + 0.48188695*h.z + 0.4296102*i.z; + v = -0.42948166*a.w + 0.47963342*b.w + 0.2660744*c.w + 0.009006623*d.w + -0.20249301*e.w + 0.3191499*f.w + -0.009933394*g.w + 0.022085298*h.w + -0.05937115*i.w; + w = 0.39071006*na.x + 0.96707124*nb.x + 0.5870382*nc.x + -0.0009634084*nd.x + -0.60501117*ne.x + -0.26205206*nf.x + 0.0022803913*ng.x + 0.19914602*nh.x + -0.0075327456*ni.x; + x = 0.6501524*na.y + -0.6191325*nb.y + 0.033584982*nc.y + -0.23792362*nd.y + 0.28443542*ne.y + 0.7995467*nf.y + 0.61443925*ng.y + -0.2151685*nh.y + -0.64213204*ni.y; + y = -0.028933166*na.z + -0.8038524*nb.z + -0.89384586*nc.z + -0.5202012*nd.z + 0.2658711*ne.z + -0.9662124*nf.z + 0.16669375*ng.z + 0.00071032986*nh.z + -0.15632267*ni.z; + z = 0.04982121*na.w + 0.3209018*nb.w + -0.18828197*nc.w + 0.09291354*nd.w + -0.17046586*ne.w + -0.34567246*nf.w + -0.30839518*ng.w + 0.10585062*nh.w + 0.21802926*ni.w; + float p = s+t+u+v+w+x+y+z+-0.038783036; + s = -0.0086537115*a.x + 0.29274273*b.x + -0.14299169*c.x + 0.24355909*d.x + 0.44158313*e.x + 0.3856316*f.x + 0.1826302*g.x + 0.0468175*h.x + 0.08368182*i.x; + t = -0.0030031276*a.y + -0.25766936*b.y + -0.16684678*c.y + -0.07155021*d.y + 0.49751604*e.y + 0.51993954*f.y + -0.055723842*g.y + -0.20152062*h.y + -0.3310546*i.y; + u = -0.19360077*a.z + 0.29092705*b.z + -0.14313088*c.z + -0.12219053*d.z + 0.3336699*e.z + 0.19800198*f.z + 0.12873465*g.z + 0.16162138*h.z + 0.05346552*i.z; + v = -0.12214463*a.w + -0.32187235*b.w + -0.4942458*c.w + 0.047901243*d.w + 0.1315279*e.w + 0.25730842*f.w + -0.03230636*g.w + -0.35371637*h.w + -0.16514161*i.w; + w = 0.06874291*na.x + -0.19512849*nb.x + 0.4657543*nc.x + -0.031914163*nd.x + 0.37405568*ne.x + 0.15239602*nf.x + -0.023567*ng.x + 0.31183028*nh.x + 0.0394527*ni.x; + x = -0.07513823*na.y + 0.041872643*nb.y + 0.35610527*nc.y + -0.1445567*nd.y + -1.024163*ne.y + -0.6282327*nf.y + 0.06843732*ng.y + 0.009273292*nh.y + -0.23500894*ni.y; + y = 0.10864135*na.z + -0.25950822*nb.z + -0.27286842*nc.z + -0.0922535*nd.z + -0.49195388*ne.z + -0.9883521*nf.z + -0.16378482*ng.z + -0.44275576*nh.z + -0.19259977*ni.z; + z = -0.07329517*na.w + 0.73912215*nb.w + -0.27922824*nc.w + -0.19892885*nd.w + -0.029165866*ne.w + -0.64475375*nf.w + -0.1735304*ng.w + 0.030360926*nh.w + 0.023611842*ni.w; + float q = s+t+u+v+w+x+y+z+0.0059805913; + s = 0.0520063*a.x + 0.32099065*b.x + 0.10096528*c.x + -0.3286558*d.x + 0.21782263*e.x + -0.16726571*f.x + -0.0061505553*g.x + -0.006116407*h.x + 0.04923024*i.x; + t = -0.0034328692*a.y + -0.093817174*b.y + -0.16234896*c.y + 0.070740886*d.y + 0.09283234*e.y + -0.5086407*f.y + 0.14033465*g.y + 0.2656622*h.y + -0.069810264*i.y; + u = 0.0036944423*a.z + -0.12574191*b.z + -0.05118089*c.z + -0.57802665*d.z + 0.7782018*e.z + -0.50453955*f.z + 0.020464642*g.z + 0.036232006*h.z + 0.07828021*i.z; + v = 0.14491023*a.w + -0.08246158*b.w + 0.0048284433*c.w + -0.41679582*d.w + -0.37185597*e.w + -0.5086088*f.w + -0.101141416*g.w + 0.021782609*h.w + 0.024443237*i.w; + w = -0.09724159*na.x + -0.13913961*nb.x + 0.13188085*nc.x + 0.4496926*nd.x + -0.2343041*ne.x + 0.30554664*nf.x + 0.10852492*ng.x + 0.09672956*nh.x + 0.06470584*ni.x; + x = -0.22092621*na.y + -0.17034335*nb.y + -0.46865875*nc.y + -0.16638382*nd.y + -0.36817726*ne.y + 2.8126082*nf.y + 0.20136675*ng.y + -0.028155493*nh.y + -0.6738389*ni.y; + y = 0.08178478*na.z + -0.13104321*nb.z + -0.0031215427*nc.z + 0.25492746*nd.z + -0.6011733*ne.z + 1.2705562*nf.z + -0.053312294*ng.z + 0.04038377*nh.z + -0.21168794*ni.z; + z = -0.26104185*na.w + 0.24431077*nb.w + 0.44925603*nc.w + 0.23646158*nd.w + 0.45555523*ne.w + 0.9546111*nf.w + -0.24485165*ng.w + -0.13658847*nh.w + 0.033205047*ni.w; + float r = s+t+u+v+w+x+y+z+-0.039946888; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN2 +//!SAVE LUMAN3 +//!COMPONENTS 4 + +#define L_tex LUMAN2_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.10675473*a.x + -0.0054621263*b.x + 0.04762056*c.x + -0.09147545*d.x + -0.37308994*e.x + 0.293996*f.x + -0.089725204*g.x + 0.33136362*h.x + -0.052014586*i.x; + float t = 0.02504269*a.y + -0.06090801*b.y + -1.0442187e-05*c.y + 0.06697992*d.y + -0.029154606*e.y + -0.0022566947*f.y + -0.00791601*g.y + 0.09337469*h.y + -0.040103186*i.y; + float u = 0.21693788*a.z + -0.055160753*b.z + -0.009791719*c.z + -0.333904*d.z + 0.27527252*e.z + -0.12840816*f.z + -0.18639135*g.z + -0.13602877*h.z + 0.06346381*i.z; + float v = -0.03963725*a.w + -0.26795068*b.w + 0.012137692*c.w + -0.17869234*d.w + -0.06644175*e.w + 0.010630859*f.w + -0.07681673*g.w + -0.0041983854*h.w + -0.026523955*i.w; + float w = 0.13531718*na.x + 0.12938923*nb.x + -0.050681178*nc.x + 0.062877566*nd.x + -0.08772176*ne.x + 0.006759793*nf.x + 0.15809533*ng.x + -0.08294619*nh.x + 0.06690071*ni.x; + float x = 0.018558182*na.y + -0.16493246*nb.y + 0.02380415*nc.y + 0.08744932*nd.y + -0.021898141*ne.y + 0.026684938*nf.y + 0.032703754*ng.y + 0.052364938*nh.y + 0.056927126*ni.y; + float y = -0.0901643*na.z + -0.09282382*nb.z + 0.07358982*nc.z + 0.3232882*nd.z + -1.0591649*ne.z + 0.17128727*nf.z + 0.22159135*ng.z + -0.3007047*nh.z + -0.05238468*ni.z; + float z = -0.06714734*na.w + 0.04850284*nb.w + -0.011960667*nc.w + -0.18101339*nd.w + -0.34727672*ne.w + 0.030268785*nf.w + -0.09629506*ng.w + -0.28136835*nh.w + -0.13334738*ni.w; + float o = s+t+u+v+w+x+y+z+0.006057905; + s = 0.018881252*a.x + 0.06384664*b.x + -0.011764481*c.x + 0.15501355*d.x + -0.2185426*e.x + -0.07557788*f.x + 0.025938602*g.x + -0.14496502*h.x + 0.024891714*i.x; + t = -0.01996556*a.y + -0.00053282635*b.y + 0.00061660836*c.y + 0.024429671*d.y + 0.054617107*e.y + -0.021867601*f.y + 0.032060657*g.y + 0.0031433336*h.y + -0.012301998*i.y; + u = -0.070778325*a.z + -0.19530736*b.z + 0.011512594*c.z + -0.27479392*d.z + -0.013253852*e.z + -0.022542335*f.z + 0.05682861*g.z + 0.0012437729*h.z + -0.0150462305*i.z; + v = 0.066125244*a.w + 0.020368045*b.w + -0.03502752*c.w + 0.1109599*d.w + -0.060857326*e.w + 0.06733562*f.w + 0.012108426*g.w + 0.0063430844*h.w + -0.004283166*i.w; + w = -0.06497726*na.x + -0.17359954*nb.x + -0.011175394*nc.x + -0.18982106*nd.x + 0.5939919*ne.x + -0.021145599*nf.x + -0.064499505*ng.x + -0.014329371*nh.x + -0.015423945*ni.x; + x = -0.03674411*na.y + -0.0043503637*nb.y + 0.010304639*nc.y + -0.0012494766*nd.y + -0.13278799*ne.y + 0.032555994*nf.y + -0.052385017*ng.y + 0.010176496*nh.y + -0.0026763906*ni.y; + y = 0.06123568*na.z + 0.14374596*nb.z + 0.056109104*nc.z + 0.019599102*nd.z + 0.18616806*ne.z + -0.03179762*nf.z + 0.036342375*ng.z + 0.029431945*nh.z + 0.043751024*ni.z; + z = 0.12073644*na.w + 0.0733359*nb.w + 0.08390864*nc.w + -0.11528834*nd.w + 0.3467376*ne.w + -0.033535313*nf.w + 0.041739017*ng.w + 0.058267288*nh.w + 0.08858209*ni.w; + float p = s+t+u+v+w+x+y+z+-0.0028000006; + s = -0.09027117*a.x + -0.14622006*b.x + -0.16810851*c.x + -0.24796103*d.x + 0.2572285*e.x + 0.47094887*f.x + 0.032027613*g.x + 0.11410892*h.x + 0.1613444*i.x; + t = -0.0012083473*a.y + 0.17305928*b.y + -0.05621104*c.y + 0.036259834*d.y + -0.03851184*e.y + -0.0055326805*f.y + -0.012463582*g.y + 0.35876498*h.y + 0.1724837*i.y; + u = 0.40897495*a.z + 0.17421961*b.z + 0.28644145*c.z + -0.25477505*d.z + -0.4277018*e.z + -0.18726684*f.z + 0.13615106*g.z + 0.026969131*h.z + -0.15176998*i.z; + v = 0.04463327*a.w + -0.04876386*b.w + -0.031818386*c.w + 0.03954202*d.w + 0.09516337*e.w + 0.052471045*f.w + -0.13383369*g.w + -0.21776986*h.w + 0.015097585*i.w; + w = 0.2092236*na.x + 0.48777798*nb.x + 0.2956695*nc.x + 0.23978968*nd.x + -0.59248745*ne.x + -0.13063201*nf.x + 0.061278455*ng.x + -0.10234516*nh.x + 0.002134229*ni.x; + x = 0.07130507*na.y + 0.121942736*nb.y + -0.01583503*nc.y + 0.14037956*nd.y + -0.37520966*ne.y + -0.067429096*nf.y + 0.05821935*ng.y + -0.35461438*nh.y + -0.07123769*ni.y; + y = -0.468684*na.z + -0.30739802*nb.z + -0.38813922*nc.z + -0.33846653*nd.z + -0.08206715*ne.z + 0.15765728*nf.z + -0.16559663*ng.z + -0.055957757*nh.z + -0.11368465*ni.z; + z = -0.4303523*na.w + -0.84991306*nb.w + -0.2505638*nc.w + 0.35179257*nd.w + 1.0163839*ne.w + 0.23950848*nf.w + 0.08583142*ng.w + -0.2591442*nh.w + -0.045323353*ni.w; + float q = s+t+u+v+w+x+y+z+0.017286068; + s = 0.101637*a.x + -0.23477565*b.x + -0.03157821*c.x + -0.20734964*d.x + -0.16431263*e.x + 0.2424383*f.x + -0.11075752*g.x + 0.16768074*h.x + -0.418383*i.x; + t = 0.006255804*a.y + 0.042100485*b.y + 0.0036014041*c.y + -0.08597467*d.y + 0.048351593*e.y + -0.13372381*f.y + -0.061134014*g.y + -0.33137617*h.y + 0.019631254*i.y; + u = 0.18377675*a.z + 0.58994883*b.z + 0.2991301*c.z + 0.74260485*d.z + -0.1369073*e.z + 0.24632849*f.z + -0.03240025*g.z + 0.2981277*h.z + 0.3513618*i.z; + v = -0.04465667*a.w + -0.15135704*b.w + 0.13290188*c.w + -0.049763512*d.w + -0.6689857*e.w + -0.28756517*f.w + 0.04422787*g.w + 0.14173377*h.w + -0.027095031*i.w; + w = 0.010524522*na.x + 0.2286293*nb.x + -0.15575987*nc.x + 0.19659552*nd.x + 0.2584596*ne.x + 0.53996265*nf.x + 0.1819511*ng.x + 0.20248987*nh.x + 0.08608274*ni.x; + x = 0.054287046*na.y + 0.04735612*nb.y + 0.0861212*nc.y + -0.028863167*nd.y + 0.20381325*ne.y + -0.109093554*nf.y + 0.010826272*ng.y + 0.23420005*nh.y + -0.022509871*ni.y; + y = 0.1786933*na.z + 0.126716*nb.z + 0.046265166*nc.z + 0.071686745*nd.z + 0.323193*ne.z + 0.42820987*nf.z + 0.062808044*ng.z + 0.13638002*nh.z + 0.29570308*ni.z; + z = -0.31819153*na.w + -0.4878216*nb.w + -0.33641538*nc.w + -0.43968466*nd.w + -0.588631*ne.w + 0.06131746*nf.w + -0.28163537*ng.w + -0.49008766*nh.w + -0.5446552*ni.w; + float r = s+t+u+v+w+x+y+z+0.020686742; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN3 +//!SAVE LUMAN4 +//!COMPONENTS 4 + +#define L_tex LUMAN3_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.23822114*a.x + -0.49224076*b.x + -0.2603839*c.x + -0.22270115*d.x + -0.23199631*e.x + -0.08860003*f.x + -0.11150333*g.x + -0.31895813*h.x + -0.035482813*i.x; + float t = 0.06318636*a.y + -0.53629327*b.y + -0.10155968*c.y + -0.06471427*d.y + 0.5817465*e.y + -0.13474646*f.y + 0.0058701304*g.y + 0.1711669*h.y + 0.08656512*i.y; + float u = -0.06168478*a.z + -0.014518998*b.z + -0.038895532*c.z + -0.18411076*d.z + 0.06959173*e.z + -0.03780323*f.z + -0.054073177*g.z + 0.05846756*h.z + 0.0526453*i.z; + float v = 0.1637899*a.w + -0.17392571*b.w + -0.044026185*c.w + -0.36689785*d.w + 0.14791447*e.w + -0.03293263*f.w + -0.13484396*g.w + 0.025672594*h.w + 0.0018860486*i.w; + float w = 0.00056899054*na.x + -0.018397113*nb.x + 0.092683315*nc.x + 0.15637913*nd.x + -0.093613446*ne.x + -0.12215183*nf.x + -0.01812064*ng.x + 0.052842487*nh.x + 0.024374953*ni.x; + float x = -0.18763757*na.y + 0.30196622*nb.y + 0.08883403*nc.y + -0.054503135*nd.y + -0.6387117*ne.y + -0.051367637*nf.y + 0.062047742*ng.y + -0.25852874*nh.y + -0.16576186*ni.y; + float y = 0.13587122*na.z + 0.08522579*nb.z + 0.03095689*nc.z + 0.25446168*nd.z + -0.1795436*ne.z + 0.12887624*nf.z + 0.16522995*ng.z + -0.12371819*nh.z + 0.018461064*ni.z; + float z = 0.33695576*na.w + 0.27555978*nb.w + 0.12422293*nc.w + 0.4810716*nd.w + 0.24170946*ne.w + 0.109018564*nf.w + 0.1475024*ng.w + 0.008883083*nh.w + -0.06614558*ni.w; + float o = s+t+u+v+w+x+y+z+-0.009210918; + s = 0.011271452*a.x + -0.42887446*b.x + -0.16086382*c.x + -0.2105586*d.x + 0.24786222*e.x + -0.13847941*f.x + -0.18258463*g.x + -0.32100454*h.x + 0.014219074*i.x; + t = 0.023105236*a.y + -0.01578845*b.y + -0.050536994*c.y + 0.039284714*d.y + 0.16437066*e.y + 0.0356428*f.y + -0.062688194*g.y + 0.07783894*h.y + 0.009747119*i.y; + u = 0.030821703*a.z + 0.06083882*b.z + 0.025873283*c.z + 0.017223293*d.z + 0.08845148*e.z + 0.061377097*f.z + 0.06515027*g.z + 0.0019544929*h.z + 0.017247573*i.z; + v = 0.012934576*a.w + 0.07368678*b.w + -0.040340308*c.w + 0.067247815*d.w + -0.08931617*e.w + 0.031227414*f.w + -0.06303663*g.w + 0.03044627*h.w + 0.012112707*i.w; + w = -0.024660507*na.x + -0.009060651*nb.x + -0.0035039044*nc.x + 0.06341225*nd.x + -0.52527195*ne.x + -0.005501108*nf.x + 0.0588685*ng.x + 0.09516038*nh.x + 0.04720441*ni.x; + x = -0.063695304*na.y + -0.067882225*nb.y + 0.009680431*nc.y + 0.11614084*nd.y + 0.07604306*ne.y + -0.2850213*nf.y + 0.06081603*ng.y + -0.078130275*nh.y + 0.010210937*ni.y; + y = 0.020847162*na.z + 0.08855373*nb.z + 0.0023585085*nc.z + 0.046964426*nd.z + 0.029082319*ne.z + -0.010446979*nf.z + 0.069331944*ng.z + -0.1097909*nh.z + 0.0066273385*ni.z; + z = 0.07595761*na.w + 0.21096602*nb.w + -0.0016103018*nc.w + 0.01423776*nd.w + 0.39817473*ne.w + 0.017830608*nf.w + 0.10896886*ng.w + 0.05775906*nh.w + -0.008378969*ni.w; + float p = s+t+u+v+w+x+y+z+0.007218698; + s = 0.034728855*a.x + -0.24261177*b.x + 0.28377128*c.x + -0.07902698*d.x + 0.53327984*e.x + 0.25865844*f.x + -0.0034399142*g.x + -0.43674976*h.x + 0.032661323*i.x; + t = -0.07738957*a.y + 0.057249602*b.y + 0.2050702*c.y + 0.17566027*d.y + 0.011081271*e.y + -0.23351799*f.y + -0.09890139*g.y + 0.018036745*h.y + 0.047635887*i.y; + u = -0.020469286*a.z + 0.047594436*b.z + -0.002022923*c.z + -0.20256907*d.z + -0.78263223*e.z + 0.0072576823*f.z + -0.0490066*g.z + 0.029040253*h.z + 0.017826209*i.z; + v = -0.020083593*a.w + 0.06858024*b.w + 0.06368863*c.w + 0.20496108*d.w + -0.16528691*e.w + -0.10180708*f.w + -0.16950546*g.w + 0.10020681*h.w + 0.012377215*i.w; + w = -0.03253046*na.x + 0.066873014*nb.x + -0.068452045*nc.x + -0.010155748*nd.x + -0.46329933*ne.x + -0.1307425*nf.x + 0.048001047*ng.x + 0.123704046*nh.x + 0.074856944*ni.x; + x = 0.062060773*na.y + 0.13428265*nb.y + -0.24431407*nc.y + -0.072135694*nd.y + 0.9167748*ne.y + 0.23750597*nf.y + 0.04223396*ng.y + -0.39293385*nh.y + -0.2623536*ni.y; + y = 0.021315947*na.z + 0.09439878*nb.z + 0.015211157*nc.z + 0.2038265*nd.z + 0.69010055*ne.z + 0.042161886*nf.z + 0.0677661*ng.z + -0.023256699*nh.z + 0.014574618*ni.z; + z = -0.04407271*na.w + 0.11794614*nb.w + 0.03630912*nc.w + 0.7663727*nd.w + 0.39717525*ne.w + 0.22002636*nf.w + -0.010754877*ng.w + -0.051768698*nh.w + -0.010918847*ni.w; + float q = s+t+u+v+w+x+y+z+0.024105644; + s = 0.030766528*a.x + 0.16373588*b.x + 0.21841961*c.x + 0.10914003*d.x + 0.05621998*e.x + 0.25531125*f.x + 0.058601663*g.x + -0.029884653*h.x + -0.03693911*i.x; + t = -0.045011982*a.y + 0.093240164*b.y + 0.09846852*c.y + 0.06726326*d.y + 0.628559*e.y + -0.02637863*f.y + 0.0064472784*g.y + 0.042976446*h.y + 0.0080402335*i.y; + u = -0.017018517*a.z + -0.0002487334*b.z + 0.051482406*c.z + 0.09698756*d.z + -0.06515222*e.z + 0.020085098*f.z + 0.049856555*g.z + 0.09850702*h.z + 0.06601598*i.z; + v = 0.0029910787*a.w + 0.027113425*b.w + 0.056177218*c.w + 0.1544931*d.w + 0.28678927*e.w + -0.031562537*f.w + -0.015119418*g.w + 0.059966877*h.w + 0.009752991*i.w; + w = -0.06231565*na.x + -0.03341734*nb.x + -0.072572425*nc.x + -0.04877089*nd.x + -0.047237467*ne.x + -0.10683365*nf.x + -0.002816312*ng.x + -0.05710042*nh.x + -0.01591127*ni.x; + x = 0.025939502*na.y + 0.10218501*nb.y + -0.10536432*nc.y + -0.071161434*nd.y + -0.3066342*ne.y + 0.061602294*nf.y + 0.03169828*ng.y + 0.005768011*nh.y + -0.18946463*ni.y; + y = -0.013577987*na.z + -0.025278145*nb.z + 0.00625481*nc.z + -0.08724931*nd.z + 0.15522881*ne.z + -0.015623531*nf.z + -0.040420238*ng.z + 0.07587788*nh.z + -0.026974916*ni.z; + z = 0.05199736*na.w + -0.046465985*nb.w + 0.020043945*nc.w + -0.1230899*nd.w + -0.26674423*ne.w + 0.039947394*nf.w + -0.039006326*ng.w + -0.08176985*nh.w + 0.030418074*ni.w; + float r = s+t+u+v+w+x+y+z+-0.012540265; + + return vec4(o, p, q, r); +} +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN4 +//!SAVE LUMAN5 +//!COMPONENTS 4 + +#define L_tex LUMAN4_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = 0.00025631802*a.x + 0.057320878*b.x + -0.041412644*c.x + 0.16791897*d.x + 0.16617729*e.x + -0.48703465*f.x + -0.12931561*g.x + 0.4140343*h.x + -0.33470672*i.x; + float t = 0.03830889*a.y + -0.051282525*b.y + 0.09902938*c.y + 0.051170327*d.y + -1.0059495*e.y + 0.3998207*f.y + -0.026771523*g.y + -0.23292333*h.y + 0.23323184*i.y; + float u = 0.033804324*a.z + -0.16789144*b.z + 0.11551676*c.z + 0.2096383*d.z + -0.5732962*e.z + 0.37778842*f.z + -0.035116088*g.z + 0.089063995*h.z + 0.070677355*i.z; + float v = 0.22857346*a.w + -0.079091504*b.w + -0.31563935*c.w + 0.5057771*d.w + -1.3217461*e.w + -0.12721835*f.w + 0.16177909*g.w + -0.2629097*h.w + -0.0029459773*i.w; + float w = -0.030586343*na.x + -0.13376898*nb.x + 0.13974473*nc.x + -0.24266301*nd.x + -0.11947399*ne.x + 0.19367288*nf.x + -0.34237102*ng.x + 0.3096073*nh.x + 0.043135814*ni.x; + float x = -0.14012407*na.y + 0.016800448*nb.y + 0.1570266*nc.y + 0.7430246*nd.y + -0.005562219*ne.y + 0.26139715*nf.y + 0.64244574*ng.y + -0.51432157*nh.y + -0.114942044*ni.y; + float y = -0.10178008*na.z + 0.23307206*nb.z + -0.29321644*nc.z + 0.24498452*nd.z + -1.1282628*ne.z + 0.022412058*nf.z + -0.16838956*ng.z + 0.40056717*nh.z + -0.21463306*ni.z; + float z = -1.005476*na.w + 0.8050052*nb.w + 0.12235334*nc.w + -0.6732282*nd.w + 0.3369146*ne.w + 0.06454999*nf.w + -0.17765191*ng.w + 0.10384625*nh.w + -0.11302512*ni.w; + float o = s+t+u+v+w+x+y+z+-0.061198946; + s = 0.08390676*a.x + -0.011123063*b.x + -0.03269317*c.x + -0.19219291*d.x + -0.050676446*e.x + 0.07472215*f.x + 0.085977115*g.x + 0.11578824*h.x + -0.28158212*i.x; + t = -0.02405043*a.y + -0.13468283*b.y + 0.014654289*c.y + 0.28977296*d.y + 0.6254546*e.y + 0.16947387*f.y + -0.026750885*g.y + 0.037516773*h.y + 0.29321685*i.y; + u = 0.017659916*a.z + -0.0513346*b.z + 0.014308151*c.z + -0.07032843*d.z + -0.124652594*e.z + 0.027099187*f.z + -0.042692557*g.z + -0.32160884*h.z + -0.124402575*i.z; + v = 0.173668*a.w + 0.16868736*b.w + 0.105285004*c.w + -0.27488157*d.w + -0.62909824*e.w + -0.28937566*f.w + 0.021574946*g.w + 0.090454094*h.w + 0.088722266*i.w; + w = 0.011426444*na.x + -0.16358133*nb.x + -0.24628234*nc.x + -0.12582813*nd.x + 0.37491634*ne.x + 0.66146225*nf.x + 0.17739972*ng.x + -0.24103446*nh.x + -0.12512414*ni.x; + x = 0.049656067*na.y + 0.35043705*nb.y + -0.06541586*nc.y + 0.036384188*nd.y + -0.88243604*ne.y + 0.15085825*nf.y + 0.01566454*ng.y + 0.26099333*nh.y + -0.23653607*ni.y; + y = -0.05713696*na.z + 0.31915048*nb.z + 0.09413395*nc.z + -0.056367278*nd.z + 0.500199*ne.z + -0.10129501*nf.z + 0.22792955*ng.z + 0.27008235*nh.z + 0.11766709*ni.z; + z = -0.30272278*na.w + -0.032818265*nb.w + -0.0091206925*nc.w + 0.7295555*nd.w + 0.078978635*ne.w + -0.036731187*nf.w + -0.04899552*ng.w + -0.23233992*nh.w + 0.120634325*ni.w; + float p = s+t+u+v+w+x+y+z+-0.006999369; + s = -0.021856444*a.x + -0.0006963466*b.x + 0.02784665*c.x + -0.1285126*d.x + -0.47980213*e.x + 0.3816084*f.x + 0.11308428*g.x + -0.43742862*h.x + 0.43896514*i.x; + t = -0.053421438*a.y + 0.0963073*b.y + -0.13441114*c.y + -0.12122123*d.y + -0.15046698*e.y + -0.39540198*f.y + -0.0028491614*g.y + 0.22168712*h.y + -0.33935112*i.y; + u = -0.02753673*a.z + 0.13554272*b.z + -0.08918299*c.z + -0.17173594*d.z + 0.46268475*e.z + -0.35359815*f.z + 0.046332352*g.z + 0.02462448*h.z + -0.023167444*i.z; + v = -0.23453364*a.w + 0.07788929*b.w + 0.16012788*c.w + -0.41643515*d.w + -0.6417199*e.w + 0.3087294*f.w + -0.14682502*g.w + 0.25157255*h.w + -0.0602734*i.w; + w = 0.028217131*na.x + 0.12867944*nb.x + -0.05617058*nc.x + 0.28762993*nd.x + -0.5784438*ne.x + -0.36014605*nf.x + 0.21616842*ng.x + -0.18586996*nh.x + -0.009710477*ni.x; + x = 0.123937346*na.y + -0.112089925*nb.y + -0.079855986*nc.y + -0.65935284*nd.y + 1.6843947*ne.y + -0.37654027*nf.y + -0.5687655*ng.y + 0.36904392*nh.y + 0.22348003*ni.y; + y = 0.10575013*na.z + -0.28616336*nb.z + 0.22265147*nc.z + -0.2137293*nd.z + -0.91093117*ne.z + 0.011338876*nf.z + 0.10558912*ng.z + -0.47041062*nh.z + 0.16206238*ni.z; + z = 0.9702835*na.w + -0.82380474*nb.w + -0.0043063024*nc.w + 0.4436007*nd.w + -0.69435906*ne.w + -0.11961962*nf.w + 0.18174438*ng.w + -0.050473217*nh.w + 0.07299529*ni.w; + float q = s+t+u+v+w+x+y+z+-0.042621654; + s = 0.012985117*a.x + 0.069789566*b.x + 0.012881662*c.x + -0.013086082*d.x + -0.16663207*e.x + 0.18778817*f.x + -0.009702196*g.x + 0.038190898*h.x + -0.050225593*i.x; + t = -0.07929176*a.y + -0.06990447*b.y + -0.06669893*c.y + 0.025257275*d.y + 0.7689759*e.y + -0.10249004*f.y + 0.017197285*g.y + -0.10194497*h.y + 0.090725824*i.y; + u = 0.0030403193*a.z + 0.012294587*b.z + -0.023400322*c.z + -0.043591868*d.z + -0.16327766*e.z + -0.02788577*f.z + 0.018733488*g.z + -0.034326617*h.z + -0.05105706*i.z; + v = -0.062092993*a.w + 0.18108387*b.w + 0.0864376*c.w + -0.16197896*d.w + -0.12865224*e.w + -0.069327936*f.w + 0.0015153112*g.w + 0.018491505*h.w + 0.049098536*i.w; + w = 0.019960985*na.x + 0.051785935*nb.x + -0.21044643*nc.x + 0.09824475*nd.x + -0.14958306*ne.x + 0.3990458*nf.x + 0.016052058*ng.x + 0.049709063*nh.x + -0.17706677*ni.x; + x = 0.019563846*na.y + 0.18184721*nb.y + -0.11986355*nc.y + -0.2601329*nd.y + -0.28785226*ne.y + 0.085305505*nf.y + 0.024360009*ng.y + -0.20685866*nh.y + -0.086421244*ni.y; + y = -0.0028385085*na.z + -0.007392961*nb.z + 0.12550405*nc.z + 0.05340696*nd.z + -0.24601264*ne.z + -0.19635704*nf.z + -0.035968296*ng.z + 0.10348485*nh.z + -0.009769748*ni.z; + z = 0.26647258*na.w + -0.63420767*nb.w + -0.02826515*nc.w + 0.06637238*nd.w + 0.57809395*ne.w + 0.06882983*nf.w + -0.004849368*ng.w + -0.093381576*nh.w + -0.10812531*ni.w; + float r = s+t+u+v+w+x+y+z+-0.018241946; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(M)-Conv-Reduce +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN1 +//!BIND LUMAN2 +//!BIND LUMAN3 +//!BIND LUMAN4 +//!BIND LUMAN5 +//!SAVE LUMAN0 +//!COMPONENTS 4 + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = LUMAN1_tex(HOOKED_pos); + vec4 b = LUMAN2_tex(HOOKED_pos); + vec4 c = LUMAN3_tex(HOOKED_pos); + vec4 d = LUMAN4_tex(HOOKED_pos); + vec4 e = LUMAN5_tex(HOOKED_pos); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + + float o = 0.016170086*a.x + -0.07807932*a.y + -0.01608141*a.z + 0.04596583*a.w + 0.0010671375*na.x + 0.13604787*na.y + -0.103508055*na.z + -0.053727165*na.w + 0.05931074*b.x + -0.03741526*b.y + 0.007310368*b.z + 0.021383934*b.w + 0.07797022*nb.x + 0.010276286*nb.y + -0.044151705*nb.z + 0.018349322*nb.w + -0.10480624*c.x + -0.19607827*c.y + -0.017716367*c.z + -0.03210694*c.w + 0.030397506*nc.x + 0.13205609*nc.y + 0.027324466*nc.z + 0.011638977*nc.w + -0.046764173*d.x + -0.14180084*d.y + -0.041110236*d.z + -0.3233351*d.w + -0.13833268*nd.x + 0.35512686*nd.y + -0.08653635*nd.z + -0.15801503*nd.w + -0.26316383*e.x + -0.2056243*e.y + -0.09891177*e.z + 0.09735771*e.w + 0.17222679*ne.x + 0.10222737*ne.y + 0.17698137*ne.z + -0.045976873*ne.w + -0.016519222; + float p = -0.0070673134*a.x + -0.10279413*a.y + -0.030861663*a.z + 0.019370042*a.w + -0.0014143038*na.x + 0.05432107*na.y + -0.15635669*na.z + -0.05455238*na.w + 0.027550258*b.x + 0.014056243*b.y + -0.016198097*b.z + 0.03419058*b.w + -0.004207751*nb.x + -0.0113672*nb.y + 0.034180697*nb.z + 0.04015298*nb.w + -0.06339332*c.x + 0.0036280584*c.y + -0.010639602*c.z + 0.026508855*c.w + -0.02524984*nc.x + 0.11936996*nc.y + -0.031202994*nc.z + -0.021372601*nc.w + -0.025080366*d.x + -0.021841787*d.y + 0.06487728*d.z + -0.06460682*d.w + 0.04119384*nd.x + -0.008643975*nd.y + -0.2078446*nd.z + 0.11259166*nd.w + -0.10560037*e.x + 0.14785078*e.y + 0.1384287*e.z + -0.06915313*e.w + 0.010694984*ne.x + -0.034556255*ne.y + -0.03377371*ne.z + 0.06635877*ne.w + -0.002248366; + float q = 0.02117986*a.x + -0.051776726*a.y + 0.15544093*a.z + 0.070309296*a.w + -0.011411071*na.x + 0.0055163414*na.y + 0.06413486*na.z + -0.045615938*na.w + 0.033726115*b.x + -0.052270424*b.y + 0.019222505*b.z + 0.02011268*b.w + -0.11609392*nb.x + 0.033497345*nb.y + -0.06132894*nb.z + -0.10658528*nb.w + 0.038067166*c.x + 0.086731836*c.y + 0.08148008*c.z + 0.010150495*c.w + -0.016870074*nc.x + 0.01104681*nc.y + 0.009952575*nc.z + 0.020137098*nc.w + -0.06427216*d.x + -0.12534674*d.y + -0.09109642*d.z + -0.46550632*d.w + -0.1370387*nd.x + 0.24063608*nd.y + -0.33579165*nd.z + -0.08938409*nd.w + -0.09131308*e.x + -0.17998323*e.y + -0.33354574*e.z + -0.20851119*e.w + 0.21100727*ne.x + 0.0667875*ne.y + 0.23766036*ne.z + 0.10573718*ne.w + -0.023920521; + float r = -0.06296154*a.x + 0.06051705*a.y + 0.11386459*a.z + 0.019399049*a.w + -0.015610163*na.x + 0.0037772388*na.y + 0.04038177*na.z + 0.020901382*na.w + 0.0468376*b.x + 0.004552797*b.y + 0.08530895*b.z + -0.0020661093*b.w + -0.075115256*nb.x + 0.01650069*nb.y + 0.025982859*nb.z + -0.063966826*nb.w + 0.14024706*c.x + 0.03896333*c.y + -0.070236415*c.z + 0.013854423*c.w + -0.023396354*nc.x + -0.10749727*nc.y + 0.018419292*nc.z + 0.0051121856*nc.w + -0.098157406*d.x + -0.24840991*d.y + -0.01761279*d.z + -0.48552045*d.w + -0.11399571*nd.x + 0.2751265*nd.y + -0.4713016*nd.z + 0.009285934*nd.w + -0.11395686*e.x + 0.04294104*e.y + -0.33598495*e.z + 0.14753135*e.w + 0.18233627*ne.x + 0.06840005*ne.y + 0.23921333*ne.z + -0.087927036*ne.w + -0.020836344; + + return vec4(o, p, q, r); +} + +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN0 +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(M) + +vec4 hook() { + vec2 f = fract(LUMAN0_pos * LUMAN0_size); + ivec2 i = ivec2(f * vec2(2)); + float c = LUMAN0_tex((vec2(0.5) - f) * LUMAN0_pt + LUMAN0_pos)[i.y * 2 + i.x]; + return vec4(c + HOOKED_tex(HOOKED_pos).x, HOOKED_tex(HOOKED_pos).yz, 0); +} diff --git a/.config/mpv/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl b/.config/mpv/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl new file mode 100644 index 0000000..e99dea0 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_CNN_M_x2_Deblur.glsl @@ -0,0 +1,603 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(M)-Conv-4x3x3x1 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!SAVE LUMAN0 +//!COMPONENTS 4 + +vec4 hook() { + vec2 dp = HOOKED_pt; + float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x; + float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x; + float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x; + float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x; + float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x; + float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x; + float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x; + float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x; + + float s = -0.09440448*a + 0.49120164*b + -0.022703001*c + -0.016553257*d + 0.6272513*e + -0.97632706*f + 0.10815585*g + -0.21898738*h + 0.09604159*i; + float o = s+0.00028890301; + s = 0.061990097*a + -0.87003845*b + -0.037461795*c + 0.13172528*d + 0.87585527*e + -0.13609451*f + -0.070119604*g + -0.051131595*h + 0.09209152*i; + float p = s+-0.017290013; + s = 0.45264956*a + -1.1240269*b + 0.07975403*c + 0.6734861*d + -0.05388544*e + 0.007570164*f + -0.06987841*g + 0.012247365*h + 0.034949988*i; + float q = s+-0.0145500265; + s = -0.035659406*a + 0.043313805*b + -0.056556296*c + 0.08745333*d + 0.6312519*e + -0.24501355*f + -0.13407958*g + -0.18634492*h + -0.08149098*i; + float r = s+-0.009025143; + + return vec4(o, p, q, r); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN0 +//!SAVE LUMAN1 +//!COMPONENTS 4 + +#define L_tex LUMAN0_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.05327107*a.x + -0.07160779*b.x + -0.053545203*c.x + 0.30653647*d.x + -0.623205*e.x + -0.25135925*f.x + -0.18046309*g.x + 0.5326353*h.x + -0.09099461*i.x; + float t = -0.16687301*a.y + 0.29383695*b.y + -0.15116534*c.y + 0.013435781*d.y + -0.3595954*e.y + 0.3222953*f.y + 0.20127103*g.y + 1.1504021*h.y + 0.6521217*i.y; + float u = -0.0015649797*a.z + -0.18814865*b.z + 0.061695296*c.z + 0.013806492*d.z + 0.12745698*e.z + -0.30406427*f.z + -0.05947408*g.z + 0.33141926*h.z + -0.20066342*i.z; + float v = 0.30095318*a.w + 0.36586058*b.w + 0.22645043*c.w + 0.1612967*d.w + -0.37834042*e.w + -0.08229078*f.w + -0.64827895*g.w + 0.04798959*h.w + 0.50426966*i.w; + float w = 0.126555*na.x + 0.079004966*nb.x + -0.06367056*nc.x + -0.16546968*nd.x + 0.50795466*ne.x + 0.18011826*nf.x + 0.16996312*ng.x + -0.51605004*nh.x + 0.10505295*ni.x; + float x = 0.1540833*na.y + -0.26913214*nb.y + 0.13605806*nc.y + -0.12155722*nd.y + 0.21405062*ne.y + -0.27972937*nf.y + -0.41382065*ng.y + -1.7224138*nh.y + -0.60294384*ni.y; + float y = 0.00970452*na.z + 0.20325865*nb.z + 0.0015745827*nc.z + -0.107312985*nd.z + 0.009980262*ne.z + 0.2720558*nf.z + 0.15321876*ng.z + -0.036781967*nh.z + 0.051229585*ni.z; + float z = -0.27454868*na.w + -0.4432009*nb.w + -0.003881375*nc.w + 0.18336153*nd.w + 0.19950926*ne.w + 0.045014136*nf.w + 0.6243142*ng.w + -0.16252244*nh.w + -0.42274413*ni.w; + float o = s+t+u+v+w+x+y+z+0.039423503; + s = -0.10775202*a.x + -0.031339962*b.x + 0.0060642078*c.x + -0.10545187*d.x + 0.12458454*e.x + 0.0021231163*f.x + 0.07905482*g.x + 0.08223747*h.x + 0.04828753*i.x; + t = 0.13271476*a.y + -0.40485632*b.y + 0.054641176*c.y + -0.4327063*d.y + -0.19545476*e.y + 0.09262824*f.y + -0.36247733*g.y + 0.12627794*h.y + -0.075792745*i.y; + u = -0.09226349*a.z + 0.24326*b.z + -0.021355193*c.z + 0.1444612*d.z + -0.102547936*e.z + 0.05568293*f.z + 0.013875915*g.z + 0.19688046*h.z + 0.0154764345*i.z; + v = -0.1431215*a.w + -0.26233566*b.w + -0.020626735*c.w + 0.019540034*d.w + 0.18164286*e.w + -0.16356231*f.w + 0.17014627*g.w + -0.27788106*h.w + 0.0718594*i.w; + w = 0.20348297*na.x + 0.10994786*nb.x + 0.014990544*nc.x + 1.033602*nd.x + 0.024537617*ne.x + 0.009609228*nf.x + 0.12779616*ng.x + 0.06813842*nh.x + -0.04269685*ni.x; + x = -0.2430749*na.y + 0.37466663*nb.y + -0.06150604*nc.y + 0.28204092*nd.y + 0.22226551*ne.y + -0.19715464*nf.y + 0.003657579*ng.y + -0.30363604*nh.y + 0.0542432*ni.y; + y = 0.1447509*na.z + -0.28650913*nb.z + -0.058723953*nc.z + -0.092879236*nd.z + 0.26428574*ne.z + -0.104749136*nf.z + -0.070094705*ng.z + 0.047571726*nh.z + -0.010061374*ni.z; + z = 0.0438258*na.w + 0.34031448*nb.w + -0.013600149*nc.w + 0.28250962*nd.w + -0.73591596*ne.w + 0.21241076*nf.w + -0.27542746*ng.w + 0.14023423*nh.w + -0.10678145*ni.w; + float p = s+t+u+v+w+x+y+z+-0.021502364; + s = 0.032163877*a.x + -0.66642886*b.x + 0.044751197*c.x + 0.05605561*d.x + 0.6945027*e.x + -0.07645503*f.x + -0.04662916*g.x + -0.2509118*h.x + 0.098923184*i.x; + t = 0.03268785*a.y + 0.2343848*b.y + -0.058907576*c.y + -0.6397386*d.y + -0.15121439*e.y + 0.15354797*f.y + -0.3191564*g.y + -0.24138322*h.y + -0.71516746*i.y; + u = -0.069602974*a.z + -0.4111596*b.z + 0.021718252*c.z + 0.2399502*d.z + 0.64263207*e.z + 0.3311527*f.z + -0.2513218*g.z + -0.48004037*h.z + 0.78069997*i.z; + v = -0.6631432*a.w + 0.15360248*b.w + 0.012449814*c.w + -0.9210798*d.w + 0.77063346*e.w + 0.10402895*f.w + 0.26728597*g.w + -0.3063174*h.w + 0.07107563*i.w; + w = -0.22910015*na.x + 0.60668314*nb.x + -0.07472177*nc.x + -0.2976557*nd.x + -0.31179214*ne.x + 0.17979208*nf.x + -0.059973676*ng.x + 0.48262063*nh.x + 0.10012325*ni.x; + x = -0.008694405*na.y + -0.19812866*nb.y + 0.024916848*nc.y + 0.57730144*nd.y + 0.20505147*ne.y + -0.22297408*nf.y + 0.09352177*ng.y + -0.548608*nh.y + 0.56032515*ni.y; + y = 0.05522713*na.z + 0.3843459*nb.z + -0.017952677*nc.z + -0.24958606*nd.z + -0.641729*ne.z + -0.13842992*nf.z + 0.20486256*ng.z + 0.24058507*nh.z + -0.53553283*ni.z; + z = 0.7243502*na.w + -0.16880396*nb.w + 0.11347028*nc.w + 0.98730826*nd.w + -0.4131502*ne.w + -0.605653*nf.w + -0.20231946*ng.w + 0.268739*nh.w + -0.25494024*ni.w; + float q = s+t+u+v+w+x+y+z+-0.011375127; + s = 0.004939782*a.x + 0.04961287*b.x + -0.022315059*c.x + -0.36721465*d.x + 0.02673542*e.x + -0.055127766*f.x + -0.3139398*g.x + 0.011177372*h.x + -0.002486109*i.x; + t = 0.0029139163*a.y + -0.018279694*b.y + 0.23850645*c.y + -0.053427566*d.y + -0.19388364*e.y + 0.25149515*f.y + -0.15969065*g.y + 0.003607878*h.y + 0.47864768*i.y; + u = 0.018587857*a.z + 0.04256821*b.z + -0.084889054*c.z + -0.10649675*d.z + 0.1413508*e.z + -0.014863062*f.z + 0.046072394*g.z + 0.044705987*h.z + -0.3495728*i.z; + v = -0.25952607*a.w + -0.37138674*b.w + -0.31769684*c.w + -0.47086135*d.w + 0.4518305*e.w + 0.23906761*f.w + 0.37785494*g.w + -0.12342203*h.w + -0.18958518*i.w; + w = -0.0987012*na.x + -0.23680592*nb.x + -0.038128883*nc.x + 0.021003952*nd.x + -0.21279961*ne.x + 0.02450331*nf.x + 0.22508678*ng.x + -0.050619982*nh.x + -0.12929344*ni.x; + x = 0.024458453*na.y + 0.07273773*nb.y + -0.26048952*nc.y + 0.18460196*nd.y + 0.4304707*ne.y + -0.17272879*nf.y + 0.28351468*ng.y + 1.3116083*nh.y + -0.29540524*ni.y; + y = -0.041094407*na.z + 0.024719454*nb.z + 0.19896787*nc.z + 0.07664201*nd.z + -0.25621203*ne.z + 0.10749328*nf.z + -0.067182586*ng.z + 0.06065049*nh.z + 0.47074008*ni.z; + z = 0.13518347*na.w + 0.20488833*nb.w + 0.24956091*nc.w + 0.07386013*nd.w + -0.9938687*ne.w + -0.15375653*nf.w + -0.55804706*ng.w + -0.0036114866*nh.w + 0.3378182*ni.w; + float r = s+t+u+v+w+x+y+z+-0.047199935; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN1 +//!SAVE LUMAN2 +//!COMPONENTS 4 + +#define L_tex LUMAN1_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = 0.062563986*a.x + 0.7022818*b.x + -0.011810557*c.x + 0.25277942*d.x + -0.2097257*e.x + 0.17233184*f.x + -0.28609228*g.x + -0.32957354*h.x + -0.11091415*i.x; + float t = 0.0074290223*a.y + 0.25707433*b.y + 0.02356039*c.y + -0.0033311683*d.y + 0.78796846*e.y + -0.8613285*f.y + 0.020431397*g.y + -0.014993784*h.y + -0.5224642*i.y; + float u = -0.099318005*a.z + 0.096692294*b.z + -0.081225544*c.z + 0.4837614*d.z + 0.40215006*e.z + 0.06631713*f.z + -0.28298393*g.z + -0.15690443*h.z + -0.11722153*i.z; + float v = -0.20104708*a.w + 0.29773432*b.w + -0.059524678*c.w + 0.672484*d.w + 0.58850944*e.w + 0.19088581*f.w + 0.085560724*g.w + -0.3429526*h.w + -0.01970963*i.w; + float w = 0.2530852*na.x + -0.26206517*nb.x + -0.0087517025*nc.x + -0.33815455*nd.x + -0.00843703*ne.x + -0.22927909*nf.x + -0.062886484*ng.x + 0.17524554*nh.x + -0.008373106*ni.x; + float x = 0.17741594*na.y + -0.52788115*nb.y + -0.10984838*nc.y + -0.13678722*nd.y + -0.28618953*ne.y + 0.1595905*nf.y + -0.04411071*ng.y + -0.3234863*nh.y + 0.4967709*ni.y; + float y = 0.042347442*na.z + 0.08541207*nb.z + -0.15857157*nc.z + -0.30902776*nd.z + -0.8957161*ne.z + -0.29276812*nf.z + 0.47053015*ng.z + 0.6092259*nh.z + 0.31623343*ni.z; + float z = 0.17963913*na.w + -0.30821583*nb.w + 0.15316938*nc.w + -0.37125722*nd.w + -0.5975526*ne.w + -0.07182377*nf.w + 0.069451295*ng.w + 0.61750644*nh.w + 0.07411387*ni.w; + float o = s+t+u+v+w+x+y+z+0.025282431; + s = 0.15042752*a.x + 0.76578605*b.x + 0.15916896*c.x + 0.062038895*d.x + 0.90041196*e.x + 0.44829968*f.x + -0.1525204*g.x + -0.0769386*h.x + -0.017208606*i.x; + t = -0.24956173*a.y + -0.4890138*b.y + -0.5667875*c.y + -0.04361386*d.y + -1.2683009*e.y + 0.49874577*f.y + -0.023511255*g.y + -0.44963378*h.y + -0.44784302*i.y; + u = -0.4755887*a.z + 0.5499969*b.z + -0.40806842*c.z + 0.18438272*d.z + -0.24848352*e.z + -0.6397795*f.z + -0.26359263*g.z + 0.48188695*h.z + 0.4296102*i.z; + v = -0.42948166*a.w + 0.47963342*b.w + 0.2660744*c.w + 0.009006623*d.w + -0.20249301*e.w + 0.3191499*f.w + -0.009933394*g.w + 0.022085298*h.w + -0.05937115*i.w; + w = 0.39071006*na.x + 0.96707124*nb.x + 0.5870382*nc.x + -0.0009634084*nd.x + -0.60501117*ne.x + -0.26205206*nf.x + 0.0022803913*ng.x + 0.19914602*nh.x + -0.0075327456*ni.x; + x = 0.6501524*na.y + -0.6191325*nb.y + 0.033584982*nc.y + -0.23792362*nd.y + 0.28443542*ne.y + 0.7995467*nf.y + 0.61443925*ng.y + -0.2151685*nh.y + -0.64213204*ni.y; + y = -0.028933166*na.z + -0.8038524*nb.z + -0.89384586*nc.z + -0.5202012*nd.z + 0.2658711*ne.z + -0.9662124*nf.z + 0.16669375*ng.z + 0.00071032986*nh.z + -0.15632267*ni.z; + z = 0.04982121*na.w + 0.3209018*nb.w + -0.18828197*nc.w + 0.09291354*nd.w + -0.17046586*ne.w + -0.34567246*nf.w + -0.30839518*ng.w + 0.10585062*nh.w + 0.21802926*ni.w; + float p = s+t+u+v+w+x+y+z+-0.038783036; + s = -0.0086537115*a.x + 0.29274273*b.x + -0.14299169*c.x + 0.24355909*d.x + 0.44158313*e.x + 0.3856316*f.x + 0.1826302*g.x + 0.0468175*h.x + 0.08368182*i.x; + t = -0.0030031276*a.y + -0.25766936*b.y + -0.16684678*c.y + -0.07155021*d.y + 0.49751604*e.y + 0.51993954*f.y + -0.055723842*g.y + -0.20152062*h.y + -0.3310546*i.y; + u = -0.19360077*a.z + 0.29092705*b.z + -0.14313088*c.z + -0.12219053*d.z + 0.3336699*e.z + 0.19800198*f.z + 0.12873465*g.z + 0.16162138*h.z + 0.05346552*i.z; + v = -0.12214463*a.w + -0.32187235*b.w + -0.4942458*c.w + 0.047901243*d.w + 0.1315279*e.w + 0.25730842*f.w + -0.03230636*g.w + -0.35371637*h.w + -0.16514161*i.w; + w = 0.06874291*na.x + -0.19512849*nb.x + 0.4657543*nc.x + -0.031914163*nd.x + 0.37405568*ne.x + 0.15239602*nf.x + -0.023567*ng.x + 0.31183028*nh.x + 0.0394527*ni.x; + x = -0.07513823*na.y + 0.041872643*nb.y + 0.35610527*nc.y + -0.1445567*nd.y + -1.024163*ne.y + -0.6282327*nf.y + 0.06843732*ng.y + 0.009273292*nh.y + -0.23500894*ni.y; + y = 0.10864135*na.z + -0.25950822*nb.z + -0.27286842*nc.z + -0.0922535*nd.z + -0.49195388*ne.z + -0.9883521*nf.z + -0.16378482*ng.z + -0.44275576*nh.z + -0.19259977*ni.z; + z = -0.07329517*na.w + 0.73912215*nb.w + -0.27922824*nc.w + -0.19892885*nd.w + -0.029165866*ne.w + -0.64475375*nf.w + -0.1735304*ng.w + 0.030360926*nh.w + 0.023611842*ni.w; + float q = s+t+u+v+w+x+y+z+0.0059805913; + s = 0.0520063*a.x + 0.32099065*b.x + 0.10096528*c.x + -0.3286558*d.x + 0.21782263*e.x + -0.16726571*f.x + -0.0061505553*g.x + -0.006116407*h.x + 0.04923024*i.x; + t = -0.0034328692*a.y + -0.093817174*b.y + -0.16234896*c.y + 0.070740886*d.y + 0.09283234*e.y + -0.5086407*f.y + 0.14033465*g.y + 0.2656622*h.y + -0.069810264*i.y; + u = 0.0036944423*a.z + -0.12574191*b.z + -0.05118089*c.z + -0.57802665*d.z + 0.7782018*e.z + -0.50453955*f.z + 0.020464642*g.z + 0.036232006*h.z + 0.07828021*i.z; + v = 0.14491023*a.w + -0.08246158*b.w + 0.0048284433*c.w + -0.41679582*d.w + -0.37185597*e.w + -0.5086088*f.w + -0.101141416*g.w + 0.021782609*h.w + 0.024443237*i.w; + w = -0.09724159*na.x + -0.13913961*nb.x + 0.13188085*nc.x + 0.4496926*nd.x + -0.2343041*ne.x + 0.30554664*nf.x + 0.10852492*ng.x + 0.09672956*nh.x + 0.06470584*ni.x; + x = -0.22092621*na.y + -0.17034335*nb.y + -0.46865875*nc.y + -0.16638382*nd.y + -0.36817726*ne.y + 2.8126082*nf.y + 0.20136675*ng.y + -0.028155493*nh.y + -0.6738389*ni.y; + y = 0.08178478*na.z + -0.13104321*nb.z + -0.0031215427*nc.z + 0.25492746*nd.z + -0.6011733*ne.z + 1.2705562*nf.z + -0.053312294*ng.z + 0.04038377*nh.z + -0.21168794*ni.z; + z = -0.26104185*na.w + 0.24431077*nb.w + 0.44925603*nc.w + 0.23646158*nd.w + 0.45555523*ne.w + 0.9546111*nf.w + -0.24485165*ng.w + -0.13658847*nh.w + 0.033205047*ni.w; + float r = s+t+u+v+w+x+y+z+-0.039946888; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN2 +//!SAVE LUMAN3 +//!COMPONENTS 4 + +#define L_tex LUMAN2_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.10675473*a.x + -0.0054621263*b.x + 0.04762056*c.x + -0.09147545*d.x + -0.37308994*e.x + 0.293996*f.x + -0.089725204*g.x + 0.33136362*h.x + -0.052014586*i.x; + float t = 0.02504269*a.y + -0.06090801*b.y + -1.0442187e-05*c.y + 0.06697992*d.y + -0.029154606*e.y + -0.0022566947*f.y + -0.00791601*g.y + 0.09337469*h.y + -0.040103186*i.y; + float u = 0.21693788*a.z + -0.055160753*b.z + -0.009791719*c.z + -0.333904*d.z + 0.27527252*e.z + -0.12840816*f.z + -0.18639135*g.z + -0.13602877*h.z + 0.06346381*i.z; + float v = -0.03963725*a.w + -0.26795068*b.w + 0.012137692*c.w + -0.17869234*d.w + -0.06644175*e.w + 0.010630859*f.w + -0.07681673*g.w + -0.0041983854*h.w + -0.026523955*i.w; + float w = 0.13531718*na.x + 0.12938923*nb.x + -0.050681178*nc.x + 0.062877566*nd.x + -0.08772176*ne.x + 0.006759793*nf.x + 0.15809533*ng.x + -0.08294619*nh.x + 0.06690071*ni.x; + float x = 0.018558182*na.y + -0.16493246*nb.y + 0.02380415*nc.y + 0.08744932*nd.y + -0.021898141*ne.y + 0.026684938*nf.y + 0.032703754*ng.y + 0.052364938*nh.y + 0.056927126*ni.y; + float y = -0.0901643*na.z + -0.09282382*nb.z + 0.07358982*nc.z + 0.3232882*nd.z + -1.0591649*ne.z + 0.17128727*nf.z + 0.22159135*ng.z + -0.3007047*nh.z + -0.05238468*ni.z; + float z = -0.06714734*na.w + 0.04850284*nb.w + -0.011960667*nc.w + -0.18101339*nd.w + -0.34727672*ne.w + 0.030268785*nf.w + -0.09629506*ng.w + -0.28136835*nh.w + -0.13334738*ni.w; + float o = s+t+u+v+w+x+y+z+0.006057905; + s = 0.018881252*a.x + 0.06384664*b.x + -0.011764481*c.x + 0.15501355*d.x + -0.2185426*e.x + -0.07557788*f.x + 0.025938602*g.x + -0.14496502*h.x + 0.024891714*i.x; + t = -0.01996556*a.y + -0.00053282635*b.y + 0.00061660836*c.y + 0.024429671*d.y + 0.054617107*e.y + -0.021867601*f.y + 0.032060657*g.y + 0.0031433336*h.y + -0.012301998*i.y; + u = -0.070778325*a.z + -0.19530736*b.z + 0.011512594*c.z + -0.27479392*d.z + -0.013253852*e.z + -0.022542335*f.z + 0.05682861*g.z + 0.0012437729*h.z + -0.0150462305*i.z; + v = 0.066125244*a.w + 0.020368045*b.w + -0.03502752*c.w + 0.1109599*d.w + -0.060857326*e.w + 0.06733562*f.w + 0.012108426*g.w + 0.0063430844*h.w + -0.004283166*i.w; + w = -0.06497726*na.x + -0.17359954*nb.x + -0.011175394*nc.x + -0.18982106*nd.x + 0.5939919*ne.x + -0.021145599*nf.x + -0.064499505*ng.x + -0.014329371*nh.x + -0.015423945*ni.x; + x = -0.03674411*na.y + -0.0043503637*nb.y + 0.010304639*nc.y + -0.0012494766*nd.y + -0.13278799*ne.y + 0.032555994*nf.y + -0.052385017*ng.y + 0.010176496*nh.y + -0.0026763906*ni.y; + y = 0.06123568*na.z + 0.14374596*nb.z + 0.056109104*nc.z + 0.019599102*nd.z + 0.18616806*ne.z + -0.03179762*nf.z + 0.036342375*ng.z + 0.029431945*nh.z + 0.043751024*ni.z; + z = 0.12073644*na.w + 0.0733359*nb.w + 0.08390864*nc.w + -0.11528834*nd.w + 0.3467376*ne.w + -0.033535313*nf.w + 0.041739017*ng.w + 0.058267288*nh.w + 0.08858209*ni.w; + float p = s+t+u+v+w+x+y+z+-0.0028000006; + s = -0.09027117*a.x + -0.14622006*b.x + -0.16810851*c.x + -0.24796103*d.x + 0.2572285*e.x + 0.47094887*f.x + 0.032027613*g.x + 0.11410892*h.x + 0.1613444*i.x; + t = -0.0012083473*a.y + 0.17305928*b.y + -0.05621104*c.y + 0.036259834*d.y + -0.03851184*e.y + -0.0055326805*f.y + -0.012463582*g.y + 0.35876498*h.y + 0.1724837*i.y; + u = 0.40897495*a.z + 0.17421961*b.z + 0.28644145*c.z + -0.25477505*d.z + -0.4277018*e.z + -0.18726684*f.z + 0.13615106*g.z + 0.026969131*h.z + -0.15176998*i.z; + v = 0.04463327*a.w + -0.04876386*b.w + -0.031818386*c.w + 0.03954202*d.w + 0.09516337*e.w + 0.052471045*f.w + -0.13383369*g.w + -0.21776986*h.w + 0.015097585*i.w; + w = 0.2092236*na.x + 0.48777798*nb.x + 0.2956695*nc.x + 0.23978968*nd.x + -0.59248745*ne.x + -0.13063201*nf.x + 0.061278455*ng.x + -0.10234516*nh.x + 0.002134229*ni.x; + x = 0.07130507*na.y + 0.121942736*nb.y + -0.01583503*nc.y + 0.14037956*nd.y + -0.37520966*ne.y + -0.067429096*nf.y + 0.05821935*ng.y + -0.35461438*nh.y + -0.07123769*ni.y; + y = -0.468684*na.z + -0.30739802*nb.z + -0.38813922*nc.z + -0.33846653*nd.z + -0.08206715*ne.z + 0.15765728*nf.z + -0.16559663*ng.z + -0.055957757*nh.z + -0.11368465*ni.z; + z = -0.4303523*na.w + -0.84991306*nb.w + -0.2505638*nc.w + 0.35179257*nd.w + 1.0163839*ne.w + 0.23950848*nf.w + 0.08583142*ng.w + -0.2591442*nh.w + -0.045323353*ni.w; + float q = s+t+u+v+w+x+y+z+0.017286068; + s = 0.101637*a.x + -0.23477565*b.x + -0.03157821*c.x + -0.20734964*d.x + -0.16431263*e.x + 0.2424383*f.x + -0.11075752*g.x + 0.16768074*h.x + -0.418383*i.x; + t = 0.006255804*a.y + 0.042100485*b.y + 0.0036014041*c.y + -0.08597467*d.y + 0.048351593*e.y + -0.13372381*f.y + -0.061134014*g.y + -0.33137617*h.y + 0.019631254*i.y; + u = 0.18377675*a.z + 0.58994883*b.z + 0.2991301*c.z + 0.74260485*d.z + -0.1369073*e.z + 0.24632849*f.z + -0.03240025*g.z + 0.2981277*h.z + 0.3513618*i.z; + v = -0.04465667*a.w + -0.15135704*b.w + 0.13290188*c.w + -0.049763512*d.w + -0.6689857*e.w + -0.28756517*f.w + 0.04422787*g.w + 0.14173377*h.w + -0.027095031*i.w; + w = 0.010524522*na.x + 0.2286293*nb.x + -0.15575987*nc.x + 0.19659552*nd.x + 0.2584596*ne.x + 0.53996265*nf.x + 0.1819511*ng.x + 0.20248987*nh.x + 0.08608274*ni.x; + x = 0.054287046*na.y + 0.04735612*nb.y + 0.0861212*nc.y + -0.028863167*nd.y + 0.20381325*ne.y + -0.109093554*nf.y + 0.010826272*ng.y + 0.23420005*nh.y + -0.022509871*ni.y; + y = 0.1786933*na.z + 0.126716*nb.z + 0.046265166*nc.z + 0.071686745*nd.z + 0.323193*ne.z + 0.42820987*nf.z + 0.062808044*ng.z + 0.13638002*nh.z + 0.29570308*ni.z; + z = -0.31819153*na.w + -0.4878216*nb.w + -0.33641538*nc.w + -0.43968466*nd.w + -0.588631*ne.w + 0.06131746*nf.w + -0.28163537*ng.w + -0.49008766*nh.w + -0.5446552*ni.w; + float r = s+t+u+v+w+x+y+z+0.020686742; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN3 +//!SAVE LUMAN4 +//!COMPONENTS 4 + +#define L_tex LUMAN3_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.23822114*a.x + -0.49224076*b.x + -0.2603839*c.x + -0.22270115*d.x + -0.23199631*e.x + -0.08860003*f.x + -0.11150333*g.x + -0.31895813*h.x + -0.035482813*i.x; + float t = 0.06318636*a.y + -0.53629327*b.y + -0.10155968*c.y + -0.06471427*d.y + 0.5817465*e.y + -0.13474646*f.y + 0.0058701304*g.y + 0.1711669*h.y + 0.08656512*i.y; + float u = -0.06168478*a.z + -0.014518998*b.z + -0.038895532*c.z + -0.18411076*d.z + 0.06959173*e.z + -0.03780323*f.z + -0.054073177*g.z + 0.05846756*h.z + 0.0526453*i.z; + float v = 0.1637899*a.w + -0.17392571*b.w + -0.044026185*c.w + -0.36689785*d.w + 0.14791447*e.w + -0.03293263*f.w + -0.13484396*g.w + 0.025672594*h.w + 0.0018860486*i.w; + float w = 0.00056899054*na.x + -0.018397113*nb.x + 0.092683315*nc.x + 0.15637913*nd.x + -0.093613446*ne.x + -0.12215183*nf.x + -0.01812064*ng.x + 0.052842487*nh.x + 0.024374953*ni.x; + float x = -0.18763757*na.y + 0.30196622*nb.y + 0.08883403*nc.y + -0.054503135*nd.y + -0.6387117*ne.y + -0.051367637*nf.y + 0.062047742*ng.y + -0.25852874*nh.y + -0.16576186*ni.y; + float y = 0.13587122*na.z + 0.08522579*nb.z + 0.03095689*nc.z + 0.25446168*nd.z + -0.1795436*ne.z + 0.12887624*nf.z + 0.16522995*ng.z + -0.12371819*nh.z + 0.018461064*ni.z; + float z = 0.33695576*na.w + 0.27555978*nb.w + 0.12422293*nc.w + 0.4810716*nd.w + 0.24170946*ne.w + 0.109018564*nf.w + 0.1475024*ng.w + 0.008883083*nh.w + -0.06614558*ni.w; + float o = s+t+u+v+w+x+y+z+-0.009210918; + s = 0.011271452*a.x + -0.42887446*b.x + -0.16086382*c.x + -0.2105586*d.x + 0.24786222*e.x + -0.13847941*f.x + -0.18258463*g.x + -0.32100454*h.x + 0.014219074*i.x; + t = 0.023105236*a.y + -0.01578845*b.y + -0.050536994*c.y + 0.039284714*d.y + 0.16437066*e.y + 0.0356428*f.y + -0.062688194*g.y + 0.07783894*h.y + 0.009747119*i.y; + u = 0.030821703*a.z + 0.06083882*b.z + 0.025873283*c.z + 0.017223293*d.z + 0.08845148*e.z + 0.061377097*f.z + 0.06515027*g.z + 0.0019544929*h.z + 0.017247573*i.z; + v = 0.012934576*a.w + 0.07368678*b.w + -0.040340308*c.w + 0.067247815*d.w + -0.08931617*e.w + 0.031227414*f.w + -0.06303663*g.w + 0.03044627*h.w + 0.012112707*i.w; + w = -0.024660507*na.x + -0.009060651*nb.x + -0.0035039044*nc.x + 0.06341225*nd.x + -0.52527195*ne.x + -0.005501108*nf.x + 0.0588685*ng.x + 0.09516038*nh.x + 0.04720441*ni.x; + x = -0.063695304*na.y + -0.067882225*nb.y + 0.009680431*nc.y + 0.11614084*nd.y + 0.07604306*ne.y + -0.2850213*nf.y + 0.06081603*ng.y + -0.078130275*nh.y + 0.010210937*ni.y; + y = 0.020847162*na.z + 0.08855373*nb.z + 0.0023585085*nc.z + 0.046964426*nd.z + 0.029082319*ne.z + -0.010446979*nf.z + 0.069331944*ng.z + -0.1097909*nh.z + 0.0066273385*ni.z; + z = 0.07595761*na.w + 0.21096602*nb.w + -0.0016103018*nc.w + 0.01423776*nd.w + 0.39817473*ne.w + 0.017830608*nf.w + 0.10896886*ng.w + 0.05775906*nh.w + -0.008378969*ni.w; + float p = s+t+u+v+w+x+y+z+0.007218698; + s = 0.034728855*a.x + -0.24261177*b.x + 0.28377128*c.x + -0.07902698*d.x + 0.53327984*e.x + 0.25865844*f.x + -0.0034399142*g.x + -0.43674976*h.x + 0.032661323*i.x; + t = -0.07738957*a.y + 0.057249602*b.y + 0.2050702*c.y + 0.17566027*d.y + 0.011081271*e.y + -0.23351799*f.y + -0.09890139*g.y + 0.018036745*h.y + 0.047635887*i.y; + u = -0.020469286*a.z + 0.047594436*b.z + -0.002022923*c.z + -0.20256907*d.z + -0.78263223*e.z + 0.0072576823*f.z + -0.0490066*g.z + 0.029040253*h.z + 0.017826209*i.z; + v = -0.020083593*a.w + 0.06858024*b.w + 0.06368863*c.w + 0.20496108*d.w + -0.16528691*e.w + -0.10180708*f.w + -0.16950546*g.w + 0.10020681*h.w + 0.012377215*i.w; + w = -0.03253046*na.x + 0.066873014*nb.x + -0.068452045*nc.x + -0.010155748*nd.x + -0.46329933*ne.x + -0.1307425*nf.x + 0.048001047*ng.x + 0.123704046*nh.x + 0.074856944*ni.x; + x = 0.062060773*na.y + 0.13428265*nb.y + -0.24431407*nc.y + -0.072135694*nd.y + 0.9167748*ne.y + 0.23750597*nf.y + 0.04223396*ng.y + -0.39293385*nh.y + -0.2623536*ni.y; + y = 0.021315947*na.z + 0.09439878*nb.z + 0.015211157*nc.z + 0.2038265*nd.z + 0.69010055*ne.z + 0.042161886*nf.z + 0.0677661*ng.z + -0.023256699*nh.z + 0.014574618*ni.z; + z = -0.04407271*na.w + 0.11794614*nb.w + 0.03630912*nc.w + 0.7663727*nd.w + 0.39717525*ne.w + 0.22002636*nf.w + -0.010754877*ng.w + -0.051768698*nh.w + -0.010918847*ni.w; + float q = s+t+u+v+w+x+y+z+0.024105644; + s = 0.030766528*a.x + 0.16373588*b.x + 0.21841961*c.x + 0.10914003*d.x + 0.05621998*e.x + 0.25531125*f.x + 0.058601663*g.x + -0.029884653*h.x + -0.03693911*i.x; + t = -0.045011982*a.y + 0.093240164*b.y + 0.09846852*c.y + 0.06726326*d.y + 0.628559*e.y + -0.02637863*f.y + 0.0064472784*g.y + 0.042976446*h.y + 0.0080402335*i.y; + u = -0.017018517*a.z + -0.0002487334*b.z + 0.051482406*c.z + 0.09698756*d.z + -0.06515222*e.z + 0.020085098*f.z + 0.049856555*g.z + 0.09850702*h.z + 0.06601598*i.z; + v = 0.0029910787*a.w + 0.027113425*b.w + 0.056177218*c.w + 0.1544931*d.w + 0.28678927*e.w + -0.031562537*f.w + -0.015119418*g.w + 0.059966877*h.w + 0.009752991*i.w; + w = -0.06231565*na.x + -0.03341734*nb.x + -0.072572425*nc.x + -0.04877089*nd.x + -0.047237467*ne.x + -0.10683365*nf.x + -0.002816312*ng.x + -0.05710042*nh.x + -0.01591127*ni.x; + x = 0.025939502*na.y + 0.10218501*nb.y + -0.10536432*nc.y + -0.071161434*nd.y + -0.3066342*ne.y + 0.061602294*nf.y + 0.03169828*ng.y + 0.005768011*nh.y + -0.18946463*ni.y; + y = -0.013577987*na.z + -0.025278145*nb.z + 0.00625481*nc.z + -0.08724931*nd.z + 0.15522881*ne.z + -0.015623531*nf.z + -0.040420238*ng.z + 0.07587788*nh.z + -0.026974916*ni.z; + z = 0.05199736*na.w + -0.046465985*nb.w + 0.020043945*nc.w + -0.1230899*nd.w + -0.26674423*ne.w + 0.039947394*nf.w + -0.039006326*ng.w + -0.08176985*nh.w + 0.030418074*ni.w; + float r = s+t+u+v+w+x+y+z+-0.012540265; + + return vec4(o, p, q, r); +} +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN4 +//!SAVE LUMAN5 +//!COMPONENTS 4 + +#define L_tex LUMAN4_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = 0.00025631802*a.x + 0.057320878*b.x + -0.041412644*c.x + 0.16791897*d.x + 0.16617729*e.x + -0.48703465*f.x + -0.12931561*g.x + 0.4140343*h.x + -0.33470672*i.x; + float t = 0.03830889*a.y + -0.051282525*b.y + 0.09902938*c.y + 0.051170327*d.y + -1.0059495*e.y + 0.3998207*f.y + -0.026771523*g.y + -0.23292333*h.y + 0.23323184*i.y; + float u = 0.033804324*a.z + -0.16789144*b.z + 0.11551676*c.z + 0.2096383*d.z + -0.5732962*e.z + 0.37778842*f.z + -0.035116088*g.z + 0.089063995*h.z + 0.070677355*i.z; + float v = 0.22857346*a.w + -0.079091504*b.w + -0.31563935*c.w + 0.5057771*d.w + -1.3217461*e.w + -0.12721835*f.w + 0.16177909*g.w + -0.2629097*h.w + -0.0029459773*i.w; + float w = -0.030586343*na.x + -0.13376898*nb.x + 0.13974473*nc.x + -0.24266301*nd.x + -0.11947399*ne.x + 0.19367288*nf.x + -0.34237102*ng.x + 0.3096073*nh.x + 0.043135814*ni.x; + float x = -0.14012407*na.y + 0.016800448*nb.y + 0.1570266*nc.y + 0.7430246*nd.y + -0.005562219*ne.y + 0.26139715*nf.y + 0.64244574*ng.y + -0.51432157*nh.y + -0.114942044*ni.y; + float y = -0.10178008*na.z + 0.23307206*nb.z + -0.29321644*nc.z + 0.24498452*nd.z + -1.1282628*ne.z + 0.022412058*nf.z + -0.16838956*ng.z + 0.40056717*nh.z + -0.21463306*ni.z; + float z = -1.005476*na.w + 0.8050052*nb.w + 0.12235334*nc.w + -0.6732282*nd.w + 0.3369146*ne.w + 0.06454999*nf.w + -0.17765191*ng.w + 0.10384625*nh.w + -0.11302512*ni.w; + float o = s+t+u+v+w+x+y+z+-0.061198946; + s = 0.08390676*a.x + -0.011123063*b.x + -0.03269317*c.x + -0.19219291*d.x + -0.050676446*e.x + 0.07472215*f.x + 0.085977115*g.x + 0.11578824*h.x + -0.28158212*i.x; + t = -0.02405043*a.y + -0.13468283*b.y + 0.014654289*c.y + 0.28977296*d.y + 0.6254546*e.y + 0.16947387*f.y + -0.026750885*g.y + 0.037516773*h.y + 0.29321685*i.y; + u = 0.017659916*a.z + -0.0513346*b.z + 0.014308151*c.z + -0.07032843*d.z + -0.124652594*e.z + 0.027099187*f.z + -0.042692557*g.z + -0.32160884*h.z + -0.124402575*i.z; + v = 0.173668*a.w + 0.16868736*b.w + 0.105285004*c.w + -0.27488157*d.w + -0.62909824*e.w + -0.28937566*f.w + 0.021574946*g.w + 0.090454094*h.w + 0.088722266*i.w; + w = 0.011426444*na.x + -0.16358133*nb.x + -0.24628234*nc.x + -0.12582813*nd.x + 0.37491634*ne.x + 0.66146225*nf.x + 0.17739972*ng.x + -0.24103446*nh.x + -0.12512414*ni.x; + x = 0.049656067*na.y + 0.35043705*nb.y + -0.06541586*nc.y + 0.036384188*nd.y + -0.88243604*ne.y + 0.15085825*nf.y + 0.01566454*ng.y + 0.26099333*nh.y + -0.23653607*ni.y; + y = -0.05713696*na.z + 0.31915048*nb.z + 0.09413395*nc.z + -0.056367278*nd.z + 0.500199*ne.z + -0.10129501*nf.z + 0.22792955*ng.z + 0.27008235*nh.z + 0.11766709*ni.z; + z = -0.30272278*na.w + -0.032818265*nb.w + -0.0091206925*nc.w + 0.7295555*nd.w + 0.078978635*ne.w + -0.036731187*nf.w + -0.04899552*ng.w + -0.23233992*nh.w + 0.120634325*ni.w; + float p = s+t+u+v+w+x+y+z+-0.006999369; + s = -0.021856444*a.x + -0.0006963466*b.x + 0.02784665*c.x + -0.1285126*d.x + -0.47980213*e.x + 0.3816084*f.x + 0.11308428*g.x + -0.43742862*h.x + 0.43896514*i.x; + t = -0.053421438*a.y + 0.0963073*b.y + -0.13441114*c.y + -0.12122123*d.y + -0.15046698*e.y + -0.39540198*f.y + -0.0028491614*g.y + 0.22168712*h.y + -0.33935112*i.y; + u = -0.02753673*a.z + 0.13554272*b.z + -0.08918299*c.z + -0.17173594*d.z + 0.46268475*e.z + -0.35359815*f.z + 0.046332352*g.z + 0.02462448*h.z + -0.023167444*i.z; + v = -0.23453364*a.w + 0.07788929*b.w + 0.16012788*c.w + -0.41643515*d.w + -0.6417199*e.w + 0.3087294*f.w + -0.14682502*g.w + 0.25157255*h.w + -0.0602734*i.w; + w = 0.028217131*na.x + 0.12867944*nb.x + -0.05617058*nc.x + 0.28762993*nd.x + -0.5784438*ne.x + -0.36014605*nf.x + 0.21616842*ng.x + -0.18586996*nh.x + -0.009710477*ni.x; + x = 0.123937346*na.y + -0.112089925*nb.y + -0.079855986*nc.y + -0.65935284*nd.y + 1.6843947*ne.y + -0.37654027*nf.y + -0.5687655*ng.y + 0.36904392*nh.y + 0.22348003*ni.y; + y = 0.10575013*na.z + -0.28616336*nb.z + 0.22265147*nc.z + -0.2137293*nd.z + -0.91093117*ne.z + 0.011338876*nf.z + 0.10558912*ng.z + -0.47041062*nh.z + 0.16206238*ni.z; + z = 0.9702835*na.w + -0.82380474*nb.w + -0.0043063024*nc.w + 0.4436007*nd.w + -0.69435906*ne.w + -0.11961962*nf.w + 0.18174438*ng.w + -0.050473217*nh.w + 0.07299529*ni.w; + float q = s+t+u+v+w+x+y+z+-0.042621654; + s = 0.012985117*a.x + 0.069789566*b.x + 0.012881662*c.x + -0.013086082*d.x + -0.16663207*e.x + 0.18778817*f.x + -0.009702196*g.x + 0.038190898*h.x + -0.050225593*i.x; + t = -0.07929176*a.y + -0.06990447*b.y + -0.06669893*c.y + 0.025257275*d.y + 0.7689759*e.y + -0.10249004*f.y + 0.017197285*g.y + -0.10194497*h.y + 0.090725824*i.y; + u = 0.0030403193*a.z + 0.012294587*b.z + -0.023400322*c.z + -0.043591868*d.z + -0.16327766*e.z + -0.02788577*f.z + 0.018733488*g.z + -0.034326617*h.z + -0.05105706*i.z; + v = -0.062092993*a.w + 0.18108387*b.w + 0.0864376*c.w + -0.16197896*d.w + -0.12865224*e.w + -0.069327936*f.w + 0.0015153112*g.w + 0.018491505*h.w + 0.049098536*i.w; + w = 0.019960985*na.x + 0.051785935*nb.x + -0.21044643*nc.x + 0.09824475*nd.x + -0.14958306*ne.x + 0.3990458*nf.x + 0.016052058*ng.x + 0.049709063*nh.x + -0.17706677*ni.x; + x = 0.019563846*na.y + 0.18184721*nb.y + -0.11986355*nc.y + -0.2601329*nd.y + -0.28785226*ne.y + 0.085305505*nf.y + 0.024360009*ng.y + -0.20685866*nh.y + -0.086421244*ni.y; + y = -0.0028385085*na.z + -0.007392961*nb.z + 0.12550405*nc.z + 0.05340696*nd.z + -0.24601264*ne.z + -0.19635704*nf.z + -0.035968296*ng.z + 0.10348485*nh.z + -0.009769748*ni.z; + z = 0.26647258*na.w + -0.63420767*nb.w + -0.02826515*nc.w + 0.06637238*nd.w + 0.57809395*ne.w + 0.06882983*nf.w + -0.004849368*ng.w + -0.093381576*nh.w + -0.10812531*ni.w; + float r = s+t+u+v+w+x+y+z+-0.018241946; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(M)-Conv-Reduce +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN1 +//!BIND LUMAN2 +//!BIND LUMAN3 +//!BIND LUMAN4 +//!BIND LUMAN5 +//!SAVE LUMAN0 +//!COMPONENTS 4 + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = LUMAN1_tex(HOOKED_pos); + vec4 b = LUMAN2_tex(HOOKED_pos); + vec4 c = LUMAN3_tex(HOOKED_pos); + vec4 d = LUMAN4_tex(HOOKED_pos); + vec4 e = LUMAN5_tex(HOOKED_pos); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + + float o = 0.016170086*a.x + -0.07807932*a.y + -0.01608141*a.z + 0.04596583*a.w + 0.0010671375*na.x + 0.13604787*na.y + -0.103508055*na.z + -0.053727165*na.w + 0.05931074*b.x + -0.03741526*b.y + 0.007310368*b.z + 0.021383934*b.w + 0.07797022*nb.x + 0.010276286*nb.y + -0.044151705*nb.z + 0.018349322*nb.w + -0.10480624*c.x + -0.19607827*c.y + -0.017716367*c.z + -0.03210694*c.w + 0.030397506*nc.x + 0.13205609*nc.y + 0.027324466*nc.z + 0.011638977*nc.w + -0.046764173*d.x + -0.14180084*d.y + -0.041110236*d.z + -0.3233351*d.w + -0.13833268*nd.x + 0.35512686*nd.y + -0.08653635*nd.z + -0.15801503*nd.w + -0.26316383*e.x + -0.2056243*e.y + -0.09891177*e.z + 0.09735771*e.w + 0.17222679*ne.x + 0.10222737*ne.y + 0.17698137*ne.z + -0.045976873*ne.w + -0.016519222; + float p = -0.0070673134*a.x + -0.10279413*a.y + -0.030861663*a.z + 0.019370042*a.w + -0.0014143038*na.x + 0.05432107*na.y + -0.15635669*na.z + -0.05455238*na.w + 0.027550258*b.x + 0.014056243*b.y + -0.016198097*b.z + 0.03419058*b.w + -0.004207751*nb.x + -0.0113672*nb.y + 0.034180697*nb.z + 0.04015298*nb.w + -0.06339332*c.x + 0.0036280584*c.y + -0.010639602*c.z + 0.026508855*c.w + -0.02524984*nc.x + 0.11936996*nc.y + -0.031202994*nc.z + -0.021372601*nc.w + -0.025080366*d.x + -0.021841787*d.y + 0.06487728*d.z + -0.06460682*d.w + 0.04119384*nd.x + -0.008643975*nd.y + -0.2078446*nd.z + 0.11259166*nd.w + -0.10560037*e.x + 0.14785078*e.y + 0.1384287*e.z + -0.06915313*e.w + 0.010694984*ne.x + -0.034556255*ne.y + -0.03377371*ne.z + 0.06635877*ne.w + -0.002248366; + float q = 0.02117986*a.x + -0.051776726*a.y + 0.15544093*a.z + 0.070309296*a.w + -0.011411071*na.x + 0.0055163414*na.y + 0.06413486*na.z + -0.045615938*na.w + 0.033726115*b.x + -0.052270424*b.y + 0.019222505*b.z + 0.02011268*b.w + -0.11609392*nb.x + 0.033497345*nb.y + -0.06132894*nb.z + -0.10658528*nb.w + 0.038067166*c.x + 0.086731836*c.y + 0.08148008*c.z + 0.010150495*c.w + -0.016870074*nc.x + 0.01104681*nc.y + 0.009952575*nc.z + 0.020137098*nc.w + -0.06427216*d.x + -0.12534674*d.y + -0.09109642*d.z + -0.46550632*d.w + -0.1370387*nd.x + 0.24063608*nd.y + -0.33579165*nd.z + -0.08938409*nd.w + -0.09131308*e.x + -0.17998323*e.y + -0.33354574*e.z + -0.20851119*e.w + 0.21100727*ne.x + 0.0667875*ne.y + 0.23766036*ne.z + 0.10573718*ne.w + -0.023920521; + float r = -0.06296154*a.x + 0.06051705*a.y + 0.11386459*a.z + 0.019399049*a.w + -0.015610163*na.x + 0.0037772388*na.y + 0.04038177*na.z + 0.020901382*na.w + 0.0468376*b.x + 0.004552797*b.y + 0.08530895*b.z + -0.0020661093*b.w + -0.075115256*nb.x + 0.01650069*nb.y + 0.025982859*nb.z + -0.063966826*nb.w + 0.14024706*c.x + 0.03896333*c.y + -0.070236415*c.z + 0.013854423*c.w + -0.023396354*nc.x + -0.10749727*nc.y + 0.018419292*nc.z + 0.0051121856*nc.w + -0.098157406*d.x + -0.24840991*d.y + -0.01761279*d.z + -0.48552045*d.w + -0.11399571*nd.x + 0.2751265*nd.y + -0.4713016*nd.z + 0.009285934*nd.w + -0.11395686*e.x + 0.04294104*e.y + -0.33598495*e.z + 0.14753135*e.w + 0.18233627*ne.x + 0.06840005*ne.y + 0.23921333*ne.z + -0.087927036*ne.w + -0.020836344; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(M)-Kernel(X) +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!SAVE MMKERNEL +//!COMPONENTS 2 + +#define L_tex HOOKED_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a = L_tex(pos - d).x; + float b = L_tex(pos).x; + float c = L_tex(pos + d).x; + + return vec2(min3v(a, b, c), max3v(a, b, c)); +} + +vec4 hook() { + return vec4(minmax3(HOOKED_pos, vec2(HOOKED_pt.x, 0)), 0, 0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(M)-Kernel(Y) +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND MMKERNEL +//!SAVE MMKERNEL +//!COMPONENTS 2 + +#define L_tex MMKERNEL_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a0 = L_tex(pos - d).x; + float b0 = L_tex(pos).x; + float c0 = L_tex(pos + d).x; + + float a1 = L_tex(pos - d).y; + float b1 = L_tex(pos).y; + float c1 = L_tex(pos + d).y; + + return vec2(min3v(a0, b0, c0), max3v(a1, b1, c1)); +} + +vec4 hook() { + return vec4(minmax3(HOOKED_pos, vec2(0, HOOKED_pt.y)), 0, 0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(M) +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND MMKERNEL +//!BIND LUMAN0 +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * + +#define STRENGTH 1 //De-blur proportional strength, higher is sharper. However, it is better to tweak BLUR_CURVE instead to avoid ringing. +#define BLUR_CURVE 0.6 //De-blur power curve, lower is sharper. Good values are between 0.3 - 1. Values greater than 1 softens the image; +#define BLUR_THRESHOLD 0.1 //Value where curve kicks in, used to not de-blur already sharp edges. Only de-blur values that fall below this threshold. +#define NOISE_THRESHOLD 0.001 //Value where curve stops, used to not sharpen noise. Only de-blur values that fall above this threshold. + +vec4 hook() { + vec2 f = fract(LUMAN0_pos * LUMAN0_size); + ivec2 i = ivec2(f * vec2(2)); + float c0 = LUMAN0_tex((vec2(0.5) - f) * LUMAN0_pt + LUMAN0_pos)[i.y * 2 + i.x]; + float c = c0 * STRENGTH; + + vec2 mm = MMKERNEL_tex((vec2(0.5) - f) * MMKERNEL_pt + MMKERNEL_pos).xy; + + float t_range = BLUR_THRESHOLD - NOISE_THRESHOLD; + + float c_t = abs(c); + if (c_t > NOISE_THRESHOLD && c_t < BLUR_THRESHOLD) { + c_t = (c_t - NOISE_THRESHOLD) / t_range; + c_t = pow(c_t, BLUR_CURVE); + c_t = c_t * t_range + NOISE_THRESHOLD; + c_t = c_t * sign(c); + return vec4(clamp(c_t + HOOKED_tex(HOOKED_pos).x, MMKERNEL_tex(HOOKED_pos).x, MMKERNEL_tex(HOOKED_pos).y), HOOKED_tex(HOOKED_pos).yz, 0); + } else { + return vec4(c + HOOKED_tex(HOOKED_pos).x, HOOKED_tex(HOOKED_pos).yz, 0); + } + +} \ No newline at end of file diff --git a/.config/mpv/shaders/Anime4K_Upscale_CNN_M_x2_Denoise.glsl b/.config/mpv/shaders/Anime4K_Upscale_CNN_M_x2_Denoise.glsl new file mode 100644 index 0000000..e9312ff --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_CNN_M_x2_Denoise.glsl @@ -0,0 +1,523 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(M)-Conv-4x3x3x1 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!SAVE LUMAN0 +//!COMPONENTS 4 + + +vec4 hook() { + vec2 dp = HOOKED_pt; + float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x; + float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x; + float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x; + float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x; + float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x; + float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x; + float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x; + float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x; + + float s = -0.096334584*a + 0.4884673*b + -0.03821645*c + 0.025493674*d + 0.6071791*e + -0.97234*f + 0.099867396*g + -0.20816612*h + 0.08195157*i; + float o = s+-0.008229233; + s = 0.0356221*a + -0.8889586*b + -0.041130573*c + 0.15342546*d + 0.8915476*e + -0.12391313*f + -0.069834635*g + -0.04377315*h + 0.080039404*i; + float p = s+-0.023339543; + s = 0.47696692*a + -1.1180642*b + 0.09315012*c + 0.6659025*d + -0.06723025*e + 0.020558799*f + -0.03196199*g + -0.003144155*h + -0.005075667*i; + float q = s+-0.045330495; + s = -0.035183977*a + 0.00825989*b + -0.07498109*c + 0.109649256*d + 0.5719336*e + -0.1938904*f + -0.137681*g + -0.1617649*h + -0.032986585*i; + float r = s+-0.019567212; + + return vec4(o, p, q, r); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN0 +//!SAVE LUMAN1 +//!COMPONENTS 4 + +#define L_tex LUMAN0_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.015687061*a.x + -0.005086804*b.x + -0.08009774*c.x + 0.4036132*d.x + -0.55772984*e.x + -0.2755099*f.x + -0.1277555*g.x + 0.48264486*h.x + -0.039350368*i.x; + float t = -0.1956287*a.y + 0.24631155*b.y + -0.1362055*c.y + -0.017237768*d.y + -0.31328484*e.y + 0.32078618*f.y + 0.17252642*g.y + 1.288781*h.y + 0.6368975*i.y; + float u = 0.02843324*a.z + -0.18332094*b.z + 0.049802452*c.z + -0.010743182*d.z + 0.17832276*e.z + -0.2522149*f.z + -0.099589445*g.z + 0.37256712*h.z + -0.28898144*i.z; + float v = 0.30594558*a.w + 0.3486534*b.w + 0.26476768*c.w + -0.076578766*d.w + -0.3232688*e.w + -0.14864787*f.w + -0.6317181*g.w + -0.06437228*h.w + 0.640803*i.w; + float w = 0.17802098*na.x + 0.05835295*nb.x + -0.058673255*nc.x + -0.014066361*nd.x + 0.33812046*ne.x + 0.25138128*nf.x + -0.072104186*ng.x + -0.36128563*nh.x + 0.07699219*ni.x; + float x = 0.16941643*na.y + -0.15021013*nb.y + 0.15018505*nc.y + -0.05500566*nd.y + 0.15511088*ne.y + -0.2458257*nf.y + -0.5108843*ng.y + -1.476235*nh.y + -0.71722806*ni.y; + float y = 0.00975281*na.z + 0.19094622*nb.z + 0.021969974*nc.z + -0.04512019*nd.z + -0.044636417*ne.z + 0.21892478*nf.z + 0.070494205*ng.z + 0.0051582125*nh.z + 0.103034526*ni.z; + float z = -0.31174728*na.w + -0.52086604*nb.w + -0.13394079*nc.w + 0.19892856*nd.w + 0.36054957*ne.w + 0.09852359*nf.w + 0.51038855*ng.w + -0.1278927*nh.w + -0.4340372*ni.w; + float o = s+t+u+v+w+x+y+z+0.035186045; + s = -0.09755112*a.x + 0.007670719*b.x + 0.015862316*c.x + -0.074987575*d.x + 0.15913595*e.x + -0.021152943*f.x + 0.18060294*g.x + 0.022476852*h.x + 0.029400269*i.x; + t = 0.13646232*a.y + -0.41485998*b.y + 0.017277138*c.y + -0.38909444*d.y + -0.1432292*e.y + 0.15183213*f.y + -0.34036225*g.y + 0.210981*h.y + -0.14121912*i.y; + u = -0.0792608*a.z + 0.27101266*b.z + 0.009590067*c.z + 0.12913375*d.z + -0.07959797*e.z + -0.048253924*f.z + 0.047642067*g.z + 0.2640562*h.z + 0.11656182*i.z; + v = -0.059286937*a.w + -0.27622*b.w + -0.042677224*c.w + 0.03761667*d.w + 0.029374314*e.w + -0.099095084*f.w + 0.109775394*g.w + -0.27415258*h.w + 0.07044724*i.w; + w = 0.24230115*na.x + 0.17628567*nb.x + 0.0020990286*nc.x + 0.96724355*nd.x + 0.02996021*ne.x + 0.019217826*nf.x + 0.1365564*ng.x + 0.071021535*nh.x + -0.06381019*ni.x; + x = -0.20798545*na.y + 0.34536365*nb.y + -0.02818564*nc.y + 0.18876718*nd.y + 0.15433654*ne.y + -0.18622455*nf.y + 0.11045272*ng.y + -0.2562474*nh.y + 0.04179886*ni.y; + y = 0.10773426*na.z + -0.28337282*nb.z + -0.08160168*nc.z + -0.06236418*nd.z + 0.312426*ne.z + -0.03483054*nf.z + -0.09783074*ng.z + 0.013053401*nh.z + -0.09047153*ni.z; + z = 0.12738748*na.w + 0.32590875*nb.w + 0.017520528*nc.w + 0.28071648*nd.w + -0.78307766*ne.w + 0.078845695*nf.w + -0.2234345*ng.w + 0.11153006*nh.w + -0.044529624*ni.w; + float p = s+t+u+v+w+x+y+z+-0.038306642; + s = -0.035723098*a.x + -0.68245345*b.x + -0.002786794*c.x + 0.122930825*d.x + 0.62216485*e.x + -0.009912186*f.x + 0.028877307*g.x + -0.16926426*h.x + 0.06577198*i.x; + t = 0.05365136*a.y + 0.25071046*b.y + -0.098311916*c.y + -0.6723615*d.y + 0.008480647*e.y + 0.12375723*f.y + -0.3281113*g.y + -0.27574605*h.y + -0.6595807*i.y; + u = -0.13840118*a.z + -0.44505855*b.z + 0.030087678*c.z + 0.2731763*d.z + 0.5879375*e.z + 0.41888592*f.z + -0.26414788*g.z + -0.5527709*h.z + 0.8234306*i.z; + v = -0.6976394*a.w + 0.1321562*b.w + 0.060074754*c.w + -1.0131954*d.w + 0.7812007*e.w + 0.09399807*f.w + 0.20834799*g.w + -0.25666532*h.w + 0.10436948*i.w; + w = -0.11991033*na.x + 0.5989035*nb.x + -0.008915402*nc.x + -0.25999224*nd.x + -0.24793556*ne.x + 0.08827613*nf.x + -0.014217819*ng.x + 0.41833654*nh.x + 0.011899245*ni.x; + x = -0.058299407*na.y + -0.2646685*nb.y + 0.0028501004*nc.y + 0.5013734*nd.y + 0.18170716*ne.y + -0.32118702*nf.y + 0.18985182*ng.y + -0.6646725*nh.y + 0.66861767*ni.y; + y = 0.09095102*na.z + 0.4223372*nb.z + -0.017415347*nc.z + -0.30837548*nd.z + -0.57201403*ne.z + -0.21062538*nf.z + 0.22605824*ng.z + 0.11097055*nh.z + -0.47204867*ni.z; + z = 0.77669513*na.w + -0.19212194*nb.w + 0.07572081*nc.w + 0.97353625*nd.w + -0.5117217*ne.w + -0.5606905*nf.w + -0.20132294*ng.w + 0.22203396*nh.w + -0.38304013*ni.w; + float q = s+t+u+v+w+x+y+z+-0.0053037074; + s = 0.013148909*a.x + -0.018101854*b.x + -0.02898365*c.x + -0.3221552*d.x + 0.041935045*e.x + -0.09236182*f.x + -0.1982523*g.x + 0.07636514*h.x + 0.011796842*i.x; + t = -0.011906759*a.y + 0.0047230097*b.y + 0.2781825*c.y + -0.03722119*d.y + -0.18879256*e.y + 0.20578861*f.y + -0.024139037*g.y + 0.12750165*h.y + 0.5047841*i.y; + u = 0.033963*a.z + 0.027810164*b.z + -0.07853949*c.z + -0.13363425*d.z + 0.030586613*e.z + -0.07423147*f.z + 0.042373702*g.z + 0.0150760105*h.z + -0.26815572*i.z; + v = -0.25720397*a.w + -0.38199362*b.w + -0.3775784*c.w + -0.14141917*d.w + 0.42101896*e.w + 0.3119284*f.w + 0.37579316*g.w + -0.14884286*h.w + -0.20396978*i.w; + w = -0.07763323*na.x + -0.2494878*nb.x + -0.05896541*nc.x + 0.06702383*nd.x + -0.1958453*ne.x + 0.10558022*nf.x + 0.23849143*ng.x + -0.027347537*nh.x + -0.092861*ni.x; + x = 0.059992112*na.y + 0.0670551*nb.y + -0.2532366*nc.y + 0.21315406*nd.y + 0.5451952*ne.y + -0.17559859*nf.y + 0.31270707*ng.y + 1.1990402*nh.y + -0.2656133*ni.y; + y = -0.06375488*na.z + 0.03755093*nb.z + 0.1775088*nc.z + 0.074394844*nd.z + -0.21401094*ne.z + 0.093671985*nf.z + -0.068302386*ng.z + 0.057559006*nh.z + 0.4602701*ni.z; + z = 0.07200058*na.w + 0.2625209*nb.w + 0.2245587*nc.w + -0.032449882*nd.w + -0.9196903*ne.w + -0.27814385*nf.w + -0.544985*ng.w + -0.10481027*nh.w + 0.4820764*ni.w; + float r = s+t+u+v+w+x+y+z+-0.09481775; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN1 +//!SAVE LUMAN2 +//!COMPONENTS 4 + +#define L_tex LUMAN1_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = 0.018682314*a.x + 0.44203937*b.x + 0.011201117*c.x + 0.1707163*d.x + -0.13163331*e.x + 0.10832957*f.x + -0.25094667*g.x + -0.37710962*h.x + -0.099689476*i.x; + float t = -0.0066981018*a.y + 0.26694995*b.y + 0.057795994*c.y + 0.045658633*d.y + 0.86929697*e.y + -0.8076145*f.y + 0.048658714*g.y + -0.082118966*h.y + -0.45287862*i.y; + float u = -0.27032706*a.z + 0.15319459*b.z + -0.18298155*c.z + 0.39646947*d.z + 0.44529167*e.z + -0.03776809*f.z + -0.23567463*g.z + -0.088091925*h.z + -0.060605783*i.z; + float v = -0.17260903*a.w + 0.29680675*b.w + -0.11133945*c.w + 0.7379717*d.w + 0.57794976*e.w + 0.15571105*f.w + 0.032278296*g.w + -0.45364308*h.w + 0.011278548*i.w; + float w = 0.23664898*na.x + -0.20770212*nb.x + 0.08866236*nc.x + -0.3988166*nd.x + -0.06265793*ne.x + -0.23789996*nf.x + -0.073015444*ng.x + 0.3039035*nh.x + 0.022692805*ni.x; + float x = 0.08930171*na.y + -0.58211017*nb.y + -0.1497316*nc.y + -0.476922*nd.y + 0.16330953*ne.y + -0.24215609*nf.y + 0.022338377*ng.y + -0.24107097*nh.y + 0.1570652*ni.y; + float y = 0.008214529*na.z + 0.16042182*nb.z + -0.14862658*nc.z + -0.3509392*nd.z + -0.9592652*ne.z + -0.24547556*nf.z + 0.3663963*ng.z + 0.72054815*nh.z + 0.29660952*ni.z; + float z = 0.28773922*na.w + -0.4086489*nb.w + 0.20410532*nc.w + -0.36254752*nd.w + -0.44383284*ne.w + -0.047999498*nf.w + -0.038450666*ng.w + 0.49856558*nh.w + 0.14509656*ni.w; + float o = s+t+u+v+w+x+y+z+0.047628842; + s = 0.1842036*a.x + 0.69354624*b.x + 0.2072707*c.x + 0.2558653*d.x + 0.9648104*e.x + 0.51031196*f.x + -0.107327186*g.x + 0.0013468182*h.x + -0.019195512*i.x; + t = -0.28576428*a.y + -0.42089957*b.y + -0.47228622*c.y + -0.098811954*d.y + -1.2135493*e.y + 0.59586686*f.y + -0.002664521*g.y + -0.3705708*h.y + -0.37632635*i.y; + u = -0.3551953*a.z + 0.4631558*b.z + -0.49070838*c.z + 0.286012*d.z + -0.3025882*e.z + -0.44014844*f.z + -0.1937611*g.z + 0.3830139*h.z + 0.36162966*i.z; + v = -0.3278485*a.w + 0.75486267*b.w + 0.43210003*c.w + -0.0147996545*d.w + -0.23216681*e.w + 0.2740509*f.w + 0.042906776*g.w + 0.05781658*h.w + -0.0086696*i.w; + w = 0.28949758*na.x + 0.90602577*nb.x + 0.5258729*nc.x + 0.03663859*nd.x + -0.5505775*ne.x + -0.29051554*nf.x + -0.076815076*ng.x + 0.19885658*nh.x + -0.087935984*ni.x; + x = 0.70628744*na.y + -0.22958279*nb.y + 0.08402731*nc.y + 0.15837549*nd.y + 0.39830247*ne.y + 1.1849017*nf.y + 0.35547593*ng.y + -0.202646*nh.y + -0.24137132*ni.y; + y = 0.08127177*na.z + -0.7835795*nb.z + -0.78620285*nc.z + -0.48470613*nd.z + 0.4768066*ne.z + -0.87363476*nf.z + 0.11905553*ng.z + -0.11505627*nh.z + -0.110398*ni.z; + z = -0.062861845*na.w + 0.56250936*nb.w + -0.08572646*nc.w + -0.03632719*nd.w + -0.31594795*ne.w + -0.17919087*nf.w + -0.13694055*ng.w + 0.27909452*nh.w + 0.19670367*ni.w; + float p = s+t+u+v+w+x+y+z+-0.07143907; + s = 0.05651364*a.x + 0.24637659*b.x + -0.16196722*c.x + 0.25773972*d.x + 0.33928764*e.x + 0.30295405*f.x + 0.25079685*g.x + -0.026224324*h.x + 0.10382699*i.x; + t = -0.03018759*a.y + -0.32138908*b.y + -0.22939964*c.y + -0.06819758*d.y + 0.60410833*e.y + 0.6038164*f.y + -0.062554374*g.y + -0.22067818*h.y + -0.33446926*i.y; + u = -0.11069349*a.z + 0.22467056*b.z + -0.22629468*c.z + -0.036879618*d.z + 0.24277517*e.z + 0.013148594*f.z + 0.17209497*g.z + 0.1183592*h.z + -0.018353969*i.z; + v = -0.0933339*a.w + -0.36371025*b.w + -0.41810217*c.w + 0.065053195*d.w + 0.23782931*e.w + 0.3557887*f.w + 0.011487943*g.w + -0.32776782*h.w + -0.22873801*i.w; + w = 0.07554202*na.x + -0.09785583*nb.x + 0.39642334*nc.x + -0.14174528*nd.x + 0.40234557*ne.x + 0.10772596*nf.x + -0.100343354*ng.x + 0.3403603*nh.x + 0.08025647*ni.x; + x = 0.14248708*na.y + -0.16136892*nb.y + 0.52202225*nc.y + -0.26288292*nd.y + -0.7474859*ne.y + -0.7591303*nf.y + 0.16527072*ng.y + 0.2446596*nh.y + -0.1825532*ni.y; + y = 0.09868614*na.z + -0.10381665*nb.z + -0.25812206*nc.z + -0.08914129*nd.z + -0.5686791*ne.z + -0.9652397*nf.z + -0.30101392*ng.z + -0.4405244*nh.z + -0.17934786*ni.z; + z = -0.05868854*na.w + 0.6854232*nb.w + -0.17763789*nc.w + -0.2133866*nd.w + 0.0042767767*ne.w + -0.501675*nf.w + -0.23358314*ng.w + 0.032784555*nh.w + 0.060270388*ni.w; + float q = s+t+u+v+w+x+y+z+0.011247989; + s = 0.03503288*a.x + 0.2845259*b.x + 0.16413508*c.x + -0.34577143*d.x + 0.44561076*e.x + 0.030196154*f.x + -0.0065472857*g.x + -0.042291068*h.x + 0.06683734*i.x; + t = 0.059763495*a.y + -0.25460613*b.y + -0.041759964*c.y + 0.11462825*d.y + 0.24414043*e.y + -0.541063*f.y + -0.004890282*g.y + 0.42774653*h.y + -0.07330144*i.y; + u = 0.019507758*a.z + -0.04953541*b.z + -0.007673771*c.z + -0.6131209*d.z + 0.7618412*e.z + -0.48944667*f.z + -0.00863334*g.z + 0.29244134*h.z + 0.15565501*i.z; + v = 0.23191626*a.w + -0.18614769*b.w + 0.2090005*c.w + -0.3833056*d.w + -0.3266635*e.w + -0.4969288*f.w + 0.017049763*g.w + 0.0011545217*h.w + 0.037597295*i.w; + w = -0.09295784*na.x + -0.22808313*nb.x + 0.1440326*nc.x + 0.44798684*nd.x + -0.20869905*ne.x + 0.29082736*nf.x + 0.053629175*ng.x + 0.10080793*nh.x + 0.097120985*ni.x; + x = -0.21155189*na.y + -0.057156052*nb.y + -0.43517458*nc.y + -0.30298027*nd.y + 0.034714725*ne.y + 2.3735354*nf.y + 0.16829175*ng.y + 0.025805125*nh.y + -0.70330936*ni.y; + y = 0.012663191*na.z + -0.116386354*nb.z + -0.09403862*nc.z + 0.3583474*nd.z + -0.67109364*ne.z + 1.4337319*nf.z + -0.04739808*ng.z + 0.053359438*nh.z + -0.24203655*ni.z; + z = -0.24584045*na.w + 0.21607958*nb.w + 0.61612964*nc.w + 0.15417401*nd.w + 0.39434698*ne.w + 0.91960156*nf.w + -0.32311833*ng.w + -0.040789135*nh.w + 0.25973907*ni.w; + float r = s+t+u+v+w+x+y+z+-0.08489115; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN2 +//!SAVE LUMAN3 +//!COMPONENTS 4 + +#define L_tex LUMAN2_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.11332997*a.x + -0.030096909*b.x + 0.08148866*c.x + -0.010003128*d.x + -0.3719025*e.x + 0.42076835*f.x + -0.054107253*g.x + 0.38734847*h.x + -0.11231825*i.x; + float t = 0.025680946*a.y + -0.024454257*b.y + 0.014810714*c.y + 0.036770396*d.y + -0.0070939185*e.y + -0.0018907397*f.y + -0.0069138035*g.y + 0.042922944*h.y + -0.026554981*i.y; + float u = 0.17945814*a.z + 0.013098164*b.z + 0.054402053*c.z + -0.36088273*d.z + 0.2196976*e.z + -0.14696789*f.z + -0.1504518*g.z + -0.07471018*h.z + 0.09389284*i.z; + float v = -0.03949051*a.w + -0.3112672*b.w + 0.03312816*c.w + -0.15758176*d.w + 0.012970425*e.w + -0.032173485*f.w + 0.0059135878*g.w + -0.018274516*h.w + 0.006665848*i.w; + float w = 0.060758714*na.x + 0.119630076*nb.x + -0.055826433*nc.x + 0.024306111*nd.x + -0.17980659*ne.x + 0.06985393*nf.x + 0.12661703*ng.x + -0.19770502*nh.x + 0.13595854*ni.x; + float x = 0.029055506*na.y + -0.12881005*nb.y + 0.036180172*nc.y + 0.08952762*nd.y + 0.043251947*ne.y + 0.0309519*nf.y + -0.027306352*ng.y + 0.090683386*nh.y + 0.02579988*ni.y; + float y = -0.085502416*na.z + -0.112721406*nb.z + 0.097885445*nc.z + 0.37216458*nd.z + -0.96167123*ne.z + 0.18936911*nf.z + 0.2518813*ng.z + -0.34743145*nh.z + -0.042477675*ni.z; + float z = -0.1021104*na.w + -0.0024531253*nb.w + -0.05186199*nc.w + -0.10294499*nd.w + -0.40830356*ne.w + 0.08315621*nf.w + -0.16157012*ng.w + -0.21950066*nh.w + -0.1614427*ni.w; + float o = s+t+u+v+w+x+y+z+-0.002265523; + s = 0.021600334*a.x + 0.10832676*b.x + -0.024148826*c.x + 0.13570073*d.x + -0.21699049*e.x + -0.06750743*f.x + -0.029798364*g.x + -0.09693352*h.x + 0.0147330705*i.x; + t = -0.013208378*a.y + -0.048681907*b.y + 0.008304722*c.y + 0.02060466*d.y + 0.060887072*e.y + -0.029299827*f.y + 0.026754655*g.y + -0.021247081*h.y + -0.0038295237*i.y; + u = -0.03708045*a.z + -0.21871905*b.z + -0.021733213*c.z + -0.2442365*d.z + -0.13438821*e.z + 0.010540137*f.z + 0.0020230296*g.z + 0.03257546*h.z + -0.021659117*i.z; + v = 0.072284244*a.w + -0.0068167807*b.w + -0.039564237*c.w + 0.08290029*d.w + -0.023164112*e.w + 0.05348939*f.w + 0.0016720649*g.w + 0.012663401*h.w + -0.02184872*i.w; + w = -0.07998153*na.x + -0.18709537*nb.x + -0.005292238*nc.x + -0.1348702*nd.x + 0.49248907*ne.x + -0.05204193*nf.x + -0.06340117*ng.x + 0.007885183*nh.x + -0.029052222*ni.x; + x = -0.05064604*na.y + -0.035637096*nb.y + 0.013302106*nc.y + 0.01650534*nd.y + -0.1477934*ne.y + 0.043521415*nf.y + -0.030470217*ng.y + -0.031236814*nh.y + -0.0046578054*ni.y; + y = 0.07605579*na.z + 0.15499325*nb.z + 0.029893741*nc.z + -0.03078108*nd.z + 0.19679599*ne.z + 0.0116642965*nf.z + 0.024839424*ng.z + 0.055510025*nh.z + 0.0051100547*ni.z; + z = 0.16119163*na.w + 0.114809826*nb.w + 0.07049681*nc.w + -0.133776*nd.w + 0.32676715*ne.w + -0.048946135*nf.w + 0.030700788*ng.w + 0.009784126*nh.w + 0.08081439*ni.w; + float p = s+t+u+v+w+x+y+z+-0.008238084; + s = -0.11814972*a.x + -0.22662362*b.x + -0.32331735*c.x + -0.32201746*d.x + 0.36564782*e.x + 0.4426983*f.x + 0.07923639*g.x + -0.021336399*h.x + 0.20492047*i.x; + t = 0.023790328*a.y + 0.21819559*b.y + -0.0030968755*c.y + 0.008919413*d.y + -0.05898664*e.y + -0.01876806*f.y + -0.023788428*g.y + 0.3268361*h.y + 0.20320326*i.y; + u = 0.3627926*a.z + 0.24333648*b.z + 0.36114886*c.z + -0.22440743*d.z + -0.33366778*e.z + -0.2563366*f.z + 0.17747861*g.z + -0.036596447*h.z + -0.14797947*i.z; + v = 0.044698503*a.w + -0.08930945*b.w + 0.003949861*c.w + 0.06074132*d.w + 0.033413503*e.w + 0.031703018*f.w + -0.12555575*g.w + -0.17760313*h.w + -0.023225365*i.w; + w = 0.2835165*na.x + 0.5397253*nb.x + 0.43220985*nc.x + 0.21800578*nd.x + -0.49878022*ne.x + -0.14049673*nf.x + 0.0635294*ng.x + -0.061934207*nh.x + -0.09326524*ni.x; + x = 0.12654181*na.y + 0.17621928*nb.y + -0.008198183*nc.y + 0.104607224*nd.y + -0.33173743*ne.y + -0.09671909*nf.y + 0.048836842*ng.y + -0.33907175*nh.y + -0.106737114*ni.y; + y = -0.5081512*na.z + -0.380074*nb.z + -0.37692118*nc.z + -0.24946907*nd.z + 0.040042657*ne.z + 0.14976257*nf.z + -0.1887001*ng.z + -0.08455224*nh.z + -0.057611104*ni.z; + z = -0.64085907*na.w + -0.8459774*nb.w + -0.2510755*nc.w + 0.42802453*nd.w + 0.91313195*ne.w + 0.13899519*nf.w + 0.06350987*ng.w + -0.18764617*nh.w + 0.02081424*ni.w; + float q = s+t+u+v+w+x+y+z+0.027070472; + s = 0.085782826*a.x + -0.1726551*b.x + 0.043658435*c.x + -0.19243051*d.x + -0.15005304*e.x + 0.4900343*f.x + -0.10336709*g.x + 0.18312618*h.x + -0.27707884*i.x; + t = -0.004284496*a.y + 0.037800293*b.y + -0.064419575*c.y + -0.09865947*d.y + 0.080926254*e.y + -0.08812109*f.y + -0.03724518*g.y + -0.3518894*h.y + 0.006982196*i.y; + u = 0.27069104*a.z + 0.50021005*b.z + 0.36097506*c.z + 0.6951922*d.z + -0.037900347*e.z + 0.2528657*f.z + 0.05860036*g.z + 0.27981114*h.z + 0.3613525*i.z; + v = -0.05924939*a.w + -0.22080211*b.w + 0.09578901*c.w + -0.10867603*d.w + -0.5372019*e.w + -0.35316542*f.w + 0.10804751*g.w + 0.15515941*h.w + -0.0054505514*i.w; + w = 0.010304433*na.x + 0.1640876*nb.x + -0.17266113*nc.x + 0.21446994*nd.x + 0.23574792*ne.x + 0.5137865*nf.x + 0.21062104*ng.x + 0.17340744*nh.x + 0.15868759*ni.x; + x = 0.06865077*na.y + 0.04066122*nb.y + 0.07871106*nc.y + 0.04974146*nd.y + 0.24277933*ne.y + -0.13853991*nf.y + -0.0046235975*ng.y + 0.3110683*nh.y + -0.055814896*ni.y; + y = 0.18448246*na.z + 0.23644273*nb.z + 0.1740395*nc.z + 0.056280363*nd.z + 0.321761*ne.z + 0.3599845*nf.z + 0.049847838*ng.z + 0.12761155*nh.z + 0.25527006*ni.z; + z = -0.40113544*na.w + -0.5755716*nb.w + -0.45964563*nc.w + -0.47008777*nd.w + -0.5389698*ne.w + 0.04141921*nf.w + -0.35219887*ng.w + -0.5849454*nh.w + -0.5195555*ni.w; + float r = s+t+u+v+w+x+y+z+0.04324416; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN3 +//!SAVE LUMAN4 +//!COMPONENTS 4 + +#define L_tex LUMAN3_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = -0.11336011*a.x + -0.5546093*b.x + -0.1980563*c.x + -0.09243965*d.x + -0.30328315*e.x + 0.002288521*f.x + -0.1719883*g.x + -0.25393653*h.x + -0.106638394*i.x; + float t = 0.060408574*a.y + -0.4343821*b.y + -0.09417895*c.y + 0.04474836*d.y + 0.66423136*e.y + -0.16684487*f.y + -0.046044365*g.y + 0.1707526*h.y + 0.13041699*i.y; + float u = -0.062083997*a.z + 0.036378354*b.z + -0.053244796*c.z + -0.07462912*d.z + 0.009707783*e.z + -0.007606468*f.z + -0.14536221*g.z + 0.12193374*h.z + 0.08321257*i.z; + float v = 0.13822994*a.w + -0.16968055*b.w + -0.029302116*c.w + -0.36366686*d.w + 0.12202857*e.w + -0.04416427*f.w + -0.101989016*g.w + 0.0015375882*h.w + 0.05370286*i.w; + float w = 0.009522841*na.x + 0.0050035953*nb.x + 0.047815464*nc.x + 0.13878924*nd.x + -0.12706435*ne.x + -0.17028658*nf.x + 0.03381212*ng.x + 0.04619007*nh.x + 0.040886693*ni.x; + float x = -0.21648684*na.y + 0.4527824*nb.y + 0.062216494*nc.y + -0.0760834*nd.y + -0.6288988*ne.y + -0.07717104*nf.y + 0.031264722*ng.y + -0.1372035*nh.y + -0.24431548*ni.y; + float y = 0.12201707*na.z + 0.1075342*nb.z + 0.064964525*nc.z + 0.24627735*nd.z + -0.20334174*ne.z + 0.17362922*nf.z + 0.14341247*ng.z + -0.10367405*nh.z + 0.018187301*ni.z; + float z = 0.29656824*na.w + 0.36550194*nb.w + 0.08121883*nc.w + 0.5109051*nd.w + 0.15495986*ne.w + 0.14060786*nf.w + 0.16695265*ng.w + 0.08530239*nh.w + -0.012310244*ni.w; + float o = s+t+u+v+w+x+y+z+-0.016565753; + s = -0.005542627*a.x + -0.4815576*b.x + -0.16739582*c.x + -0.17829932*d.x + 0.16477403*e.x + -0.13324437*f.x + -0.18502134*g.x + -0.29108498*h.x + 0.05097406*i.x; + t = -0.005128074*a.y + 0.07065858*b.y + -0.10661442*c.y + 0.0008864973*d.y + 0.10546469*e.y + 0.014007102*f.y + -0.008473495*g.y + 0.10157764*h.y + 0.08799642*i.y; + u = 0.032889523*a.z + 0.031691857*b.z + 0.012797057*c.z + -0.047379013*d.z + 0.035736393*e.z + 0.091394894*f.z + 0.039340183*g.z + 0.02964313*h.z + 0.0028917622*i.z; + v = -0.02029337*a.w + 0.094220296*b.w + -0.069206014*c.w + 0.07011055*d.w + -0.14635274*e.w + 0.026304023*f.w + -0.0646385*g.w + 0.041667704*h.w + 0.042158034*i.w; + w = 0.04289771*na.x + -0.011802231*nb.x + -0.03529944*nc.x + 0.03370418*nd.x + -0.5103195*ne.x + -0.014530308*nf.x + 0.029903982*ng.x + 0.029009927*nh.x + 0.03932113*ni.x; + x = -0.058687404*na.y + -0.032492165*nb.y + 0.039978307*nc.y + 0.0805997*nd.y + 0.16392574*ne.y + -0.26796678*nf.y + 0.05706328*ng.y + -0.026416704*nh.y + -0.009198004*ni.y; + y = 0.036424693*na.z + 0.076260746*nb.z + 0.039109852*nc.z + 0.06012574*nd.z + 0.029961608*ne.z + 0.000601677*nf.z + 0.08278338*ng.z + -0.104361504*nh.z + -0.010410115*ni.z; + z = 0.045120504*na.w + 0.15542893*nb.w + 0.018970646*nc.w + -0.040475003*nd.w + 0.41810912*ne.w + 0.046625525*nf.w + 0.11266217*ng.w + 0.03605587*nh.w + 0.010441441*ni.w; + float p = s+t+u+v+w+x+y+z+0.026173912; + s = -0.01932058*a.x + -0.15786819*b.x + 0.34817162*c.x + -0.085794635*d.x + 0.61148757*e.x + 0.1997698*f.x + 0.04283192*g.x + -0.40659058*h.x + 0.031031879*i.x; + t = -0.14110667*a.y + 0.09737822*b.y + 0.2136361*c.y + 0.21648659*d.y + 0.057102222*e.y + -0.32274124*f.y + -0.041056994*g.y + 0.062500246*h.y + 0.058675725*i.y; + u = -0.05310352*a.z + 0.06363739*b.z + -0.02352861*c.z + -0.19859853*d.z + -0.6924276*e.z + -0.052719172*f.z + -0.022153398*g.z + 0.022755368*h.z + 0.044493068*i.z; + v = -0.020281073*a.w + 0.049738068*b.w + 0.05115416*c.w + 0.1943825*d.w + -0.15483907*e.w + -0.13703728*f.w + -0.21366403*g.w + 0.12213289*h.w + 0.07315763*i.w; + w = -0.01340149*na.x + 0.039190706*nb.x + -0.06010495*nc.x + -0.031242317*nd.x + -0.3344305*ne.x + -0.15759717*nf.x + 0.035195023*ng.x + 0.09947819*nh.x + 0.06487847*ni.x; + x = 0.100255184*na.y + 0.16374993*nb.y + -0.26901463*nc.y + -0.088238806*nd.y + 0.9469761*ne.y + 0.20339924*nf.y + 0.013781394*ng.y + -0.40143126*nh.y + -0.3224882*ni.y; + y = 0.06307512*na.z + 0.103746325*nb.z + 0.07068691*nc.z + 0.21719252*nd.z + 0.643172*ne.z + 0.044743262*nf.z + 0.02847355*ng.z + -0.044767838*nh.z + 0.026216555*ni.z; + z = -0.04675472*na.w + 0.09125546*nb.w + -0.015525009*nc.w + 0.7057314*nd.w + 0.37025008*ne.w + 0.27427557*nf.w + -0.03265264*ng.w + -0.06721917*nh.w + -0.0419604*ni.w; + float q = s+t+u+v+w+x+y+z+0.024316467; + s = -0.00033182523*a.x + 0.047188014*b.x + 0.29892203*c.x + 0.09357643*d.x + 0.030232515*e.x + 0.19758245*f.x + 0.13172227*g.x + -0.12781778*h.x + 0.02373677*i.x; + t = -0.03755632*a.y + 0.093976915*b.y + 0.070628785*c.y + 0.05336897*d.y + 0.85352725*e.y + -0.10880546*f.y + 0.051450137*g.y + 0.09816019*h.y + 0.07808459*i.y; + u = 0.011919896*a.z + -0.020400822*b.z + 0.04710827*c.z + 0.08461272*d.z + -0.11439534*e.z + 0.037500232*f.z + 0.113371514*g.z + 0.086692594*h.z + 0.06414449*i.z; + v = 0.011173226*a.w + 0.049693275*b.w + 0.03778407*c.w + 0.16974896*d.w + 0.30079946*e.w + -0.060604237*f.w + -0.0018831388*g.w + 0.07333319*h.w + 0.014693669*i.w; + w = -0.11176503*na.x + -0.0652572*nb.x + -0.08387277*nc.x + -0.07379581*nd.x + -0.07855383*ne.x + -0.14641859*nf.x + -0.02941203*ng.x + -0.06744651*nh.x + -0.052957434*ni.x; + x = 0.03692434*na.y + 0.06360258*nb.y + -0.031729735*nc.y + -0.10867498*nd.y + -0.3276245*ne.y + 0.17300029*nf.y + 0.036537584*ng.y + -0.025287196*nh.y + -0.1810677*ni.y; + y = 0.006600475*na.z + -0.00840068*nb.z + 0.0028671592*nc.z + -0.14595534*nd.z + 0.20311914*ne.z + -0.023778193*nf.z + -0.05664581*ng.z + 0.09111506*nh.z + -0.051484156*ni.z; + z = 0.07922705*na.w + -0.011248128*nb.w + 0.011819444*nc.w + -0.11729043*nd.w + -0.28706518*ne.w + 0.07792864*nf.w + -0.013736298*ng.w + -0.15252969*nh.w + 0.0014625692*ni.w; + float r = s+t+u+v+w+x+y+z+-0.017528493; + + return vec4(o, p, q, r); +} +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(M)-Conv-4x3x3x8 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN4 +//!SAVE LUMAN5 +//!COMPONENTS 4 + +#define L_tex LUMAN4_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = L_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b = L_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c = L_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d = L_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e = L_tex(HOOKED_pos + vec2(0, 0)); + vec4 f = L_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g = L_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h = L_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i = L_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + vec4 nf = -min(f, 0); + vec4 ng = -min(g, 0); + vec4 nh = -min(h, 0); + vec4 ni = -min(i, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + f = max(f, 0); + g = max(g, 0); + h = max(h, 0); + i = max(i, 0); + + float s = 0.038567036*a.x + 0.0705653*b.x + -0.08456429*c.x + 0.17830919*d.x + 0.15700413*e.x + -0.48310483*f.x + -0.13568404*g.x + 0.38844487*h.x + -0.24666616*i.x; + float t = -0.022864863*a.y + -0.09708212*b.y + 0.080999635*c.y + 0.10234689*d.y + -0.9441054*e.y + 0.37205943*f.y + 0.023142772*g.y + -0.30508518*h.y + 0.23074047*i.y; + float u = 0.026479473*a.z + -0.21789004*b.z + 0.16894147*c.z + 0.24001078*d.z + -0.5764876*e.z + 0.37745288*f.z + -0.08588339*g.z + 0.09972613*h.z + 0.09875314*i.z; + float v = 0.23032863*a.w + -0.0054795295*b.w + -0.29228735*c.w + 0.49698094*d.w + -1.3256943*e.w + -0.029346323*f.w + 0.15363467*g.w + -0.23334587*h.w + -0.020885304*i.w; + float w = -0.08072811*na.x + -0.12015889*nb.x + 0.08035302*nc.x + -0.2672039*nd.x + -0.11779888*ne.x + 0.2646977*nf.x + -0.37465525*ng.x + 0.29485774*nh.x + -0.02784101*ni.x; + float x = -0.19388446*na.y + 0.057232708*nb.y + 0.11700054*nc.y + 0.7411195*nd.y + 0.07168483*ne.y + 0.03476339*nf.y + 0.606746*ng.y + -0.6688325*nh.y + -0.0019025522*ni.y; + float y = -0.19526717*na.z + 0.3453801*nb.z + -0.26843297*nc.z + 0.29258463*nd.z + -0.9860014*ne.z + -0.029417401*nf.z + -0.1935398*ng.z + 0.3000599*nh.z + -0.13897806*ni.z; + float z = -1.1220787*na.w + 0.79593414*nb.w + 0.08730238*nc.w + -0.56224525*nd.w + 0.2729329*ne.w + -0.028041862*nf.w + -0.08895821*ng.w + 0.07971253*nh.w + -0.1097084*ni.w; + float o = s+t+u+v+w+x+y+z+-0.053113442; + s = 0.04177622*a.x + -0.0036336621*b.x + -0.031431884*c.x + -0.13659629*d.x + -0.059160918*e.x + 0.031841677*f.x + 0.07246833*g.x + 0.112269066*h.x + -0.242079*i.x; + t = 0.019453337*a.y + -0.060118888*b.y + -0.0056063943*c.y + 0.37430856*d.y + 0.66169596*e.y + 0.22895052*f.y + -0.116621315*g.y + 0.019051338*h.y + 0.2796385*i.y; + u = 0.025202444*a.z + -0.063063145*b.z + 0.03306231*c.z + -0.087987594*d.z + -0.15086448*e.z + 0.015091712*f.z + -0.016382191*g.z + -0.2719014*h.z + -0.1213443*i.z; + v = 0.15685205*a.w + 0.16103153*b.w + 0.12104904*c.w + -0.31669632*d.w + -0.5131755*e.w + -0.2940805*f.w + 0.03922636*g.w + 0.10866127*h.w + 0.08225846*i.w; + w = 0.027171694*na.x + -0.19411181*nb.x + -0.17554177*nc.x + -0.06920469*nd.x + 0.35313594*ne.x + 0.5729236*nf.x + 0.15976419*ng.x + -0.22865002*nh.x + -0.14128903*ni.x; + x = 0.06538863*na.y + 0.3888246*nb.y + -0.06093744*nc.y + -0.0021450054*nd.y + -0.7144259*ne.y + 0.19505557*nf.y + 0.017545538*ng.y + 0.27564743*nh.y + -0.1891801*ni.y; + y = -0.04018616*na.z + 0.3965399*nb.z + 0.03547221*nc.z + -0.10051028*nd.z + 0.5457805*ne.z + -0.058937907*nf.z + 0.24849786*ng.z + 0.29411504*nh.z + 0.09580802*ni.z; + z = -0.2584023*na.w + -0.06644846*nb.w + -0.0073378505*nc.w + 0.59547085*nd.w + 0.14581262*ne.w + -0.025333082*nf.w + -0.105372205*ng.w + -0.14488424*nh.w + 0.10319663*ni.w; + float p = s+t+u+v+w+x+y+z+-0.030240078; + s = -0.024701372*a.x + 0.025341522*b.x + 0.06547468*c.x + -0.1478955*d.x + -0.48662245*e.x + 0.29320917*f.x + 0.119131036*g.x + -0.44793203*h.x + 0.4688749*i.x; + t = -0.108995534*a.y + 0.070233956*b.y + -0.13956581*c.y + -0.21479332*d.y + -0.12898977*e.y + -0.40991426*f.y + 0.020437365*g.y + 0.17140286*h.y + -0.40149483*i.y; + u = -0.00905909*a.z + 0.10485684*b.z + -0.08578809*c.z + -0.17500319*d.z + 0.4865422*e.z + -0.38730884*f.z + 0.061339755*g.z + 0.034676336*h.z + -0.020573441*i.z; + v = -0.2025594*a.w + 0.0911606*b.w + 0.082284346*c.w + -0.35355926*d.w + -0.61544394*e.w + 0.32040882*f.w + -0.14619522*g.w + 0.2941107*h.w + -0.078201585*i.w; + w = 0.0495746*na.x + 0.08055962*nb.x + -0.078246616*nc.x + 0.26895896*nd.x + -0.52850366*ne.x + -0.28460968*nf.x + 0.21908188*ng.x + -0.14934134*nh.x + -0.022079289*ni.x; + x = 0.18326212*na.y + -0.1183244*nb.y + -0.026135176*nc.y + -0.63453907*nd.y + 1.6052349*ne.y + -0.3253275*nf.y + -0.51091814*ng.y + 0.42029953*nh.y + 0.1379729*ni.y; + y = 0.13548519*na.z + -0.28737086*nb.z + 0.19119221*nc.z + -0.2149449*nd.z + -0.9226876*ne.z + 0.033711042*nf.z + 0.10450268*ng.z + -0.4635861*nh.z + 0.120921664*ni.z; + z = 0.95850354*na.w + -0.86698693*nb.w + 0.13464972*nc.w + 0.46481287*nd.w + -0.6893183*ne.w + -0.12460651*nf.w + 0.10310439*ng.w + -0.067780524*nh.w + 0.06973546*ni.w; + float q = s+t+u+v+w+x+y+z+-0.03733598; + s = 0.0053327214*a.x + 0.06828431*b.x + 0.017400311*c.x + -0.022229843*d.x + 0.021846429*e.x + 0.17038181*f.x + -0.0036154294*g.x + -0.0076043517*h.x + 0.03144882*i.x; + t = -0.09128217*a.y + -0.019056903*b.y + -0.10658804*c.y + -0.07005582*d.y + 1.0119812*e.y + -0.18679373*f.y + 0.0014865986*g.y + -0.13718273*h.y + 0.011373519*i.y; + u = 0.007684441*a.z + -0.0024304984*b.z + -0.0005824064*c.z + -0.046654146*d.z + -0.18832356*e.z + -0.06836408*f.z + 0.03383738*g.z + 0.0031701874*h.z + -0.045616426*i.z; + v = -0.07080597*a.w + 0.12452656*b.w + 0.055096764*c.w + -0.11060644*d.w + 0.16163704*e.w + -0.028699806*f.w + -0.02837693*g.w + 0.057780527*h.w + 0.01604268*i.w; + w = 0.031746984*na.x + 0.037449647*nb.x + -0.17273042*nc.x + 0.13193378*nd.x + -0.083798654*ne.x + 0.2653949*nf.x + -0.022535313*ng.x + 0.0860065*nh.x + -0.15048456*ni.x; + x = 0.039347745*na.y + 0.10379977*nb.y + -0.062039107*nc.y + -0.32586884*nd.y + -0.3929803*ne.y + -0.021611424*nf.y + 0.06064707*ng.y + -0.28440315*nh.y + 0.025921293*ni.y; + y = -0.016964613*na.z + -0.0066489074*nb.z + 0.13551117*nc.z + 0.12154996*nd.z + -0.104811326*ne.z + -0.18939951*nf.z + -0.08372982*ng.z + 0.055679534*nh.z + -0.0070043216*ni.z; + z = 0.3667913*na.w + -0.73069835*nb.w + 0.06653495*nc.w + -0.045829143*nd.w + 0.84753215*ne.w + -0.011205747*nf.w + 0.062056217*ng.w + -0.083614476*nh.w + -0.05290749*ni.w; + float r = s+t+u+v+w+x+y+z+-0.066139325; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(M)-Conv-Reduce +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN0 +//!BIND LUMAN1 +//!BIND LUMAN2 +//!BIND LUMAN3 +//!BIND LUMAN4 +//!BIND LUMAN5 +//!SAVE LUMAN0 +//!COMPONENTS 4 + +vec4 hook() { + vec2 dp = HOOKED_pt; + vec4 a = LUMAN1_tex(HOOKED_pos); + vec4 b = LUMAN2_tex(HOOKED_pos); + vec4 c = LUMAN3_tex(HOOKED_pos); + vec4 d = LUMAN4_tex(HOOKED_pos); + vec4 e = LUMAN5_tex(HOOKED_pos); + + vec4 na = -min(a, 0); + vec4 nb = -min(b, 0); + vec4 nc = -min(c, 0); + vec4 nd = -min(d, 0); + vec4 ne = -min(e, 0); + + a = max(a, 0); + b = max(b, 0); + c = max(c, 0); + d = max(d, 0); + e = max(e, 0); + + float o = 0.048128415*a.x + -0.10200983*a.y + 0.0026888845*a.z + 0.03718083*a.w + 0.0038677044*na.x + 0.19192158*na.y + -0.07810309*na.z + 0.010487845*na.w + 0.03670921*b.x + -0.038882297*b.y + -0.037679777*b.z + -0.012084925*b.w + 0.090262465*nb.x + -0.004547179*nb.y + 0.0059687584*nb.z + 0.051256124*nb.w + -0.11432519*c.x + -0.25872356*c.y + 0.0054702796*c.z + -0.012581099*c.w + 0.015949834*nc.x + 0.21601027*nc.y + 0.035843574*nc.z + 0.017208261*nc.w + -0.056919403*d.x + -0.18486539*d.y + -0.02737798*d.z + -0.3186765*d.w + -0.13511881*nd.x + 0.35757625*nd.y + -0.07571729*nd.z + -0.11691222*nd.w + -0.2406404*e.x + -0.18846813*e.y + -0.090694115*e.z + 0.08896013*e.w + 0.16347*ne.x + 0.099284545*ne.y + 0.16371554*ne.z + -0.042760517*ne.w + -0.014356738; + float p = 0.034463048*a.x + -0.10106072*a.y + 0.0153113*a.z + 0.013266783*a.w + -0.0050172983*na.x + 0.15015306*na.y + -0.1432366*na.z + -0.0013678991*na.w + 0.008594857*b.x + 0.004623611*b.y + -0.059459336*b.z + -0.013174561*b.w + 0.021199493*nb.x + -0.025345081*nb.y + 0.083974496*nb.z + 0.08165798*nb.w + -0.09537475*c.x + -0.08943068*c.y + -0.02914935*c.z + 0.010825835*c.w + -0.04871495*nc.x + 0.21459627*nc.y + -0.0050241314*nc.z + -0.008088038*nc.w + -0.0045245662*d.x + -0.053880397*d.y + 0.04765565*d.z + -0.06589436*d.w + 0.031551003*nd.x + -0.02856088*nd.y + -0.21330751*nd.z + 0.14608456*nd.w + -0.12683192*e.x + 0.15810186*e.y + 0.11550806*e.z + -0.058062166*e.w + 0.037682347*ne.x + -0.03632457*ne.y + -0.021607846*ne.z + 0.09143093*ne.w + -0.0076093744; + float q = 0.026701592*a.x + -0.078241214*a.y + 0.118998125*a.z + 0.06534085*a.w + -0.018886134*na.x + 0.11944017*na.y + 0.06824227*na.z + 0.013486396*na.w + 0.020998007*b.x + -0.055520564*b.y + 0.002212575*b.z + -0.00065796264*b.w + -0.081669435*nb.x + 0.014998951*nb.y + -0.026731629*nb.z + -0.057044547*nb.w + 0.06701295*c.x + 0.084943585*c.y + 0.07812323*c.z + 0.027192006*c.w + -0.025491228*nc.x + 0.058227003*nc.y + 0.007927143*nc.z + 0.0028146622*nc.w + -0.070682466*d.x + -0.08310049*d.y + -0.0860419*d.z + -0.4338729*d.w + -0.09763112*nd.x + 0.18996777*nd.y + -0.24132325*nd.z + 0.0043926323*nd.w + -0.10540394*e.x + -0.19668445*e.y + -0.30052847*e.z + -0.14361969*e.w + 0.20132412*ne.x + 0.08645794*ne.y + 0.21893042*ne.z + 0.110118836*ne.w + -0.032480482; + float r = -0.012988379*a.x + 0.01449243*a.y + 0.1186362*a.z + 0.021411385*a.w + -0.02190659*na.x + 0.08573852*na.y + 0.029420571*na.z + 0.04271885*na.w + 0.020516774*b.x + -0.008869406*b.y + 0.06774458*b.z + -0.02412687*b.w + -0.06278506*nb.x + 0.0015959308*nb.y + 0.06922979*nb.z + -0.014656813*nb.w + 0.13683714*c.x + 0.0055245673*c.y + -0.039630424*c.z + 0.023636617*c.w + -0.031803787*nc.x + -0.01460251*nc.y + 0.015318757*nc.z + -0.0058491337*nc.w + -0.120180495*d.x + -0.28844154*d.y + 0.0075656036*d.z + -0.446147*d.w + -0.108871296*nd.x + 0.28307307*nd.y + -0.47336864*nd.z + 0.0047260863*nd.w + -0.10478753*e.x + 0.082965665*e.y + -0.30823767*e.z + 0.11182321*e.w + 0.16890883*ne.x + 0.042257413*ne.y + 0.22344704*ne.z + -0.07987242*ne.w + -0.017264554; + + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(M) +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN0 +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * + + +vec4 hook() { + vec2 f = fract(LUMAN0_pos * LUMAN0_size); + ivec2 i = ivec2(f * vec2(2)); + float c = LUMAN0_tex((vec2(0.5) - f) * LUMAN0_pt + LUMAN0_pos)[i.y * 2 + i.x]; + return vec4(c + HOOKED_tex(HOOKED_pos).x, HOOKED_tex(HOOKED_pos).yz, 0); +} diff --git a/.config/mpv/shaders/Anime4K_Upscale_CNN_UL_x2.glsl b/.config/mpv/shaders/Anime4K_Upscale_CNN_UL_x2.glsl new file mode 100644 index 0000000..fbad44a --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_CNN_UL_x2.glsl @@ -0,0 +1,3995 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x1 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!SAVE LUMAN00 + +vec4 hook() { + vec2 dp = HOOKED_pt; + float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x; + float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x; + float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x; + float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x; + float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x; + float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x; + float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x; + float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x; + float s = 0.4227713*a + 0.65122205*b + -0.5894138*c + 0.12043042*d + 0.0069211754*e + -0.39494568*f + -0.099531725*g + -0.19280484*h + 0.0692256*i + 0.0059006587; + float t = 0.56819385*a + -0.3877415*b + -0.55708647*c + -0.3175206*d + -0.3950954*e + 0.3758771*f + -0.5951176*g + 0.43890274*h + 0.69218725*i + -0.018986855; + float u = 0.78672326*a + -0.50350785*b + -0.07692569*c + -0.7258339*d + 0.5834824*e + -0.067126095*f + -0.07342367*g + -0.029570417*h + 0.10244534*i + -0.00014415548; + float v = -0.32709953*a + 0.05759759*b + 0.15932003*c + 0.19741072*d + 0.471859*e + -0.10562332*f + -0.39081043*g + -0.6708356*h + -0.035092503*i + -0.0720328; + return vec4(s, t, u, v); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x1 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!SAVE LUMAN01 + +vec4 hook() { + vec2 dp = HOOKED_pt; + float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x; + float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x; + float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x; + float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x; + float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x; + float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x; + float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x; + float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x; + float s = 0.14976382*a + -0.339064*b + 0.41322896*c + -0.56487453*d + -0.2509627*e + 0.19731471*f + 0.43869543*g + -0.09666573*h + -0.00792537*i + 0.06936363; + float t = 0.10662149*a + -0.30642352*b + 0.3910136*c + -0.24240156*d + 0.4359778*e + -0.036186576*f + -0.016642952*g + -0.31993437*h + 0.3249198*i + 0.010320611; + float u = 0.07377618*a + 0.5356365*b + -0.27441797*c + 0.13227409*d + -0.60764945*e + 0.28083587*f + 0.18271726*g + -0.9480309*h + 0.6223682*i + 0.015635386; + float v = -0.43209586*a + 0.6188276*b + 0.27700275*c + -0.3111068*d + -0.22504452*e + 0.3990561*f + 0.11323281*g + -0.38872832*h + -0.110977426*i + 0.09095626; + return vec4(s, t, u, v); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN00 +//!BIND LUMAN01 +//!SAVE LUMAN10 + +#define L0_tex LUMAN00_tex +#define L1_tex LUMAN01_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.16713218*a0.x + -0.22038573*b0.x + -0.13005029*c0.x + 0.35234368*d0.x + -0.24986069*e0.x + -0.03652803*f0.x + -0.0035137152*g0.x + -0.13065901*h0.x + 0.050993465*i0.x; + float j = -0.15454529*a0.y + -0.18509507*b0.y + -0.070899874*c0.y + -0.055521097*d0.y + -0.08797286*e0.y + 0.017017594*f0.y + -0.07720207*g0.y + 0.030161398*h0.y + 0.07854566*i0.y; + float k = -0.069296815*a0.z + 0.034658875*b0.z + 0.06815528*c0.z + 0.07031576*d0.z + 0.074399784*e0.z + -0.030513955*f0.z + 0.15191276*g0.z + 0.17954811*h0.z + 0.083867356*i0.z; + float l = -0.2704385*a0.w + -0.143406*b0.w + -0.1905286*c0.w + 0.2303636*d0.w + -0.18995604*e0.w + -0.22714588*f0.w + 0.001024007*g0.w + 0.074870616*h0.w + 0.023121383*i0.w; + float m = 0.0139397*a1.x + -0.22468825*b1.x + -0.19181927*c1.x + -0.18277143*d1.x + 0.14706787*e1.x + 0.19927207*f1.x + 0.13652366*g1.x + 0.06386827*h1.x + 0.00095346326*i1.x; + float n = 0.14147504*a1.y + -0.14072193*b1.y + 0.1730557*c1.y + -0.002492399*d1.y + -0.55425644*e1.y + -0.19250399*f1.y + -0.20097452*g1.y + -0.29845634*h1.y + -0.094047815*i1.y; + float o = 0.11046322*a1.z + -0.09760678*b1.z + -0.18652314*c1.z + 0.108983986*d1.z + 0.18999153*e1.z + -0.02505891*f1.z + 0.029467393*g1.z + 0.049988672*h1.z + -0.089773245*i1.z; + float p = 0.18450986*a1.w + 0.109294355*b1.w + -0.112934336*c1.w + 0.047062654*d1.w + -0.04816292*e1.w + 0.13094686*f1.w + -0.0065878364*g1.w + 0.08924863*h1.w + 0.11312074*i1.w; + float q = -0.12602906*na0.x + 0.37861553*nb0.x + 0.074422106*nc0.x + -0.3033126*nd0.x + -0.028096324*ne0.x + 0.050496474*nf0.x + 0.2239116*ng0.x + 0.1933884*nh0.x + -0.025817746*ni0.x; + float r = 0.17847398*na0.y + 0.15596001*nb0.y + 0.09058693*nc0.y + 0.088395216*nd0.y + 0.05719792*ne0.y + -0.050784174*nf0.y + 0.04196272*ng0.y + -0.020845385*nh0.y + -0.0832895*ni0.y; + float s = -0.24801292*na0.z + -0.37903556*nb0.z + -0.06962685*nc0.z + -0.194872*nd0.z + -0.13542567*ne0.z + -0.047440834*nf0.z + -0.20618482*ng0.z + 0.036017656*nh0.z + -0.083059475*ni0.z; + float t = -0.050698828*na0.w + 0.076336786*nb0.w + 0.18337938*nc0.w + 0.067153335*nd0.w + 0.2950129*ne0.w + 0.015040506*nf0.w + -0.04881478*ng0.w + -0.06797305*nh0.w + 0.06590701*ni0.w; + float u = -0.03218409*na1.x + 0.25265154*nb1.x + 0.24500562*nc1.x + 0.25738174*nd1.x + -0.21151006*ne1.x + -0.30471176*nf1.x + -0.06567392*ng1.x + -0.13929898*nh1.x + -0.05080991*ni1.x; + float v = -0.22504985*na1.y + -0.030114856*nb1.y + -0.14878646*nc1.y + 0.076497145*nd1.y + 0.8536939*ne1.y + 0.11066291*nf1.y + 0.25284055*ng1.y + 0.3632721*nh1.y + 0.18241458*ni1.y; + float w = 0.18823417*na1.z + 0.122003764*nb1.z + 0.1791294*nc1.z + 0.0069658747*nd1.z + -0.18533462*ne1.z + 0.06976361*nf1.z + -0.07724821*ng1.z + -0.02718515*nh1.z + 1.7301045e-05*ni1.z; + float x = -0.12598836*na1.w + -0.1243634*nb1.w + 0.0985588*nc1.w + -0.06536376*nd1.w + 0.08385393*ne1.w + -0.09142982*nf1.w + -0.03531486*ng1.w + -0.038505223*nh1.w + -0.13392809*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.080690674; + i = -0.01283581*a0.x + -0.018502438*b0.x + -0.02645647*c0.x + 0.42137372*d0.x + -0.31610605*e0.x + 0.1444233*f0.x + 0.0064831083*g0.x + -0.34260628*h0.x + -0.21241646*i0.x; + j = 0.08500891*a0.y + -0.02485644*b0.y + -0.097824536*c0.y + -0.15899487*d0.y + -0.005132324*e0.y + 0.07605907*f0.y + -0.119112104*g0.y + -0.05230375*h0.y + 0.15778321*i0.y; + k = -0.045043983*a0.z + 0.22099558*b0.z + 0.09173644*c0.z + -0.14121144*d0.z + -0.3364683*e0.z + 0.6992921*f0.z + 0.1879735*g0.z + 0.43442908*h0.z + 0.2507738*i0.z; + l = 0.014832014*a0.w + -0.3057155*b0.w + -0.26674822*c0.w + 0.65893346*d0.w + 0.13837902*e0.w + 0.26448116*f0.w + 0.01925406*g0.w + 0.24712183*h0.w + 0.11824173*i0.w; + m = -0.17148696*a1.x + -0.034435242*b1.x + -0.16856827*c1.x + 0.24088557*d1.x + 0.27181336*e1.x + 0.35544765*f1.x + -0.0637484*g1.x + 0.1394016*h1.x + 0.07805505*i1.x; + n = -0.036200132*a1.y + -0.32828653*b1.y + -0.12464492*c1.y + 0.07681443*d1.y + -0.31755948*e1.y + -0.16249253*f1.y + 0.1459527*g1.y + -0.055870246*h1.y + -0.2188885*i1.y; + o = -0.10257012*a1.z + 0.1738694*b1.z + 0.011674502*c1.z + 0.014357164*d1.z + 0.05336581*e1.z + -0.10754941*f1.z + 0.0053562997*g1.z + -0.20323943*h1.z + -0.044117864*i1.z; + p = -0.00781972*a1.w + 0.2752947*b1.w + 0.07748963*c1.w + 0.0701277*d1.w + -0.1437367*e1.w + 0.27562895*f1.w + -0.09910902*g1.w + 0.10083873*h1.w + -0.12653753*i1.w; + q = -0.0744636*na0.x + 0.030761313*nb0.x + 0.17157815*nc0.x + -0.27698746*nd0.x + 0.20659466*ne0.x + -0.12475179*nf0.x + 0.097487606*ng0.x + 0.47216818*nh0.x + 0.18254276*ni0.x; + r = -0.17130595*na0.y + 0.08279622*nb0.y + 0.1008618*nc0.y + 0.10624062*nd0.y + 0.09339325*ne0.y + -0.12885687*nf0.y + 0.10866262*ng0.y + 0.015784606*nh0.y + -0.156208*ni0.y; + s = 0.13901633*na0.z + -0.19871095*nb0.z + -0.1233926*nc0.z + 0.22571099*nd0.z + 0.5192358*ne0.z + -0.006695737*nf0.z + -0.23417531*ng0.z + -0.53020126*nh0.z + 0.0348989*ni0.z; + t = 0.019743124*na0.w + 0.113042444*nb0.w + 0.044767845*nc0.w + -0.12496372*nd0.w + 0.7285443*ne0.w + 0.075844646*nf0.w + 0.003659028*ng0.w + -0.081003755*nh0.w + -0.1571919*ni0.w; + u = 0.17188495*na1.x + 0.15267436*nb1.x + 0.12122173*nc1.x + -0.17361204*nd1.x + -0.35425422*ne1.x + -0.30314827*nf1.x + 0.112297654*ng1.x + -0.19984588*nh1.x + -0.17648791*ni1.x; + v = 0.064333946*na1.y + 0.2798676*nb1.y + 0.029879512*nc1.y + -0.44719884*nd1.y + 0.37984368*ne1.y + 0.24928248*nf1.y + -0.26490667*ng1.y + -0.042627275*nh1.y + 0.34140655*ni1.y; + w = 0.13693564*na1.z + -0.014451857*nb1.z + -0.13929443*nc1.z + 0.09930806*nd1.z + -0.0018792403*ne1.z + 0.14395392*nf1.z + 0.013773326*ng1.z + 0.28621295*nh1.z + 0.12418545*ni1.z; + x = -0.07243978*na1.w + -0.20915549*nb1.w + -0.1439757*nc1.w + -0.030371284*nd1.w + 0.066944584*ne1.w + -0.19054636*nf1.w + 0.11164318*ng1.w + 0.013230124*nh1.w + 0.12154718*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.13904701; + i = 0.08556065*a0.x + -0.06385027*b0.x + 0.08451666*c0.x + -0.16397515*d0.x + -0.12554236*e0.x + 0.51485914*f0.x + -0.3609132*g0.x + 0.22237258*h0.x + -0.14084372*i0.x; + j = -0.29552463*a0.y + -0.07839635*b0.y + 0.023714216*c0.y + -0.39852586*d0.y + -0.0037621707*e0.y + 0.12410286*f0.y + 0.28074482*g0.y + 0.19966023*h0.y + -0.1299575*i0.y; + k = -0.018056538*a0.z + -0.29889175*b0.z + 0.12264207*c0.z + 0.399607*d0.z + -0.08105918*e0.z + -0.006207723*f0.z + 0.19156073*g0.z + -0.4190811*h0.z + 0.41379926*i0.z; + l = 0.25313407*a0.w + 0.2056271*b0.w + 0.1281935*c0.w + -0.4088654*d0.w + -0.75592035*e0.w + 0.677332*f0.w + -0.17531727*g0.w + -0.09792362*h0.w + 0.38767898*i0.w; + m = 0.32970557*a1.x + 0.03836402*b1.x + -0.08182981*c1.x + 0.23050149*d1.x + 0.2949245*e1.x + -0.031266343*f1.x + 0.011828161*g1.x + 0.18952376*h1.x + -0.08358268*i1.x; + n = 0.03825189*a1.y + 0.34718156*b1.y + 0.27608556*c1.y + -0.11617564*d1.y + -0.66690236*e1.y + 0.36254305*f1.y + -0.5285547*g1.y + 0.108788565*h1.y + -0.23637791*i1.y; + o = 0.29810092*a1.z + -0.18387158*b1.z + -0.082416594*c1.z + -0.34253722*d1.z + 0.0759425*e1.z + -0.060609326*f1.z + -0.043806862*g1.z + 0.1224182*h1.z + 0.28538787*i1.z; + p = -0.1166321*a1.w + -0.14290577*b1.w + -0.088152096*c1.w + 0.13844585*d1.w + 0.37557498*e1.w + 0.2985052*f1.w + 0.47108272*g1.w + -0.3133265*h1.w + 0.2837646*i1.w; + q = -0.08935695*na0.x + -0.011969543*nb0.x + 0.11739229*nc0.x + 0.22418295*nd0.x + 0.51131123*ne0.x + 0.06826982*nf0.x + 0.06986366*ng0.x + -0.13083175*nh0.x + -0.0384642*ni0.x; + r = 0.32759568*na0.y + 0.058782384*nb0.y + -0.097732335*nc0.y + 0.51180387*nd0.y + -0.062388137*ne0.y + -0.036372434*nf0.y + -0.28633046*ng0.y + -0.18776499*nh0.y + 0.13661087*ni0.y; + s = -0.090851374*na0.z + 0.42352006*nb0.z + 0.39775237*nc0.z + -0.5250993*nd0.z + -0.28369164*ne0.z + 0.56977206*nf0.z + -0.32605034*ng0.z + -0.3297984*nh0.z + -0.9174496*ni0.z; + t = -0.20263617*na0.w + 0.014055401*nb0.w + -0.015539904*nc0.w + -0.0056373915*nd0.w + 0.46529755*ne0.w + 0.20198935*nf0.w + 0.10306982*ng0.w + -0.1603279*nh0.w + -0.09719618*ni0.w; + u = -0.37491882*na1.x + 0.0065687397*nb1.x + -0.075094976*nc1.x + -0.2910323*nd1.x + -0.31070456*ne1.x + -0.3181396*nf1.x + -0.2874679*ng1.x + -0.05630924*nh1.x + -0.08283336*ni1.x; + v = 0.22579186*na1.y + -0.008379712*nb1.y + -0.13981205*nc1.y + 0.4876711*nd1.y + 0.75476116*ne1.y + -0.3979911*nf1.y + 0.17194936*ng1.y + 0.063620836*nh1.y + -0.2838596*ni1.y; + w = -0.59080386*na1.z + 0.10265678*nb1.z + 0.44757754*nc1.z + 0.118315265*nd1.z + -0.17929387*ne1.z + 0.53549635*nf1.z + -0.16386764*ng1.z + -0.18721534*nh1.z + -0.07925579*ni1.z; + x = 0.12679473*na1.w + 0.09201327*nb1.w + 0.11743293*nc1.w + -0.089954264*nd1.w + 0.025260787*ne1.w + -0.29346317*nf1.w + -0.40280733*ng1.w + 0.3339367*nh1.w + -0.2733761*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.18129607; + i = -0.17462935*a0.x + 0.08743981*b0.x + 0.116527654*c0.x + -0.11788807*d0.x + 0.345168*e0.x + 0.12373737*f0.x + 0.061705504*g0.x + -0.03186453*h0.x + -0.14678453*i0.x; + j = 0.3424341*a0.y + 0.18152006*b0.y + 0.10626323*c0.y + 0.080005355*d0.y + 0.27044943*e0.y + -0.05666261*f0.y + 0.08009715*g0.y + -0.038603935*h0.y + 0.1343475*i0.y; + k = -0.076163*a0.z + -0.10620224*b0.z + 0.0471776*c0.z + -0.18697739*d0.z + 0.81948966*e0.z + 0.104977295*f0.z + -0.049898446*g0.z + 0.030969273*h0.z + -0.24446999*i0.z; + l = 0.11316597*a0.w + -0.72845197*b0.w + 0.14612307*c0.w + -0.05467936*d0.w + 0.33790386*e0.w + 0.47690153*f0.w + 0.03290898*g0.w + 0.18591514*h0.w + 0.086933084*i0.w; + m = 0.024091808*a1.x + 0.21152216*b1.x + 0.10427507*c1.x + 0.12340303*d1.x + 0.30569288*e1.x + -0.10540736*f1.x + 0.21034092*g1.x + 0.0078070415*h1.x + -0.15554547*i1.x; + n = -0.30977434*a1.y + -0.12402293*b1.y + 0.06854388*c1.y + -0.059533276*d1.y + 0.29335344*e1.y + 0.06032923*f1.y + 0.10502131*g1.y + 0.0025917962*h1.y + 0.011287433*i1.y; + o = 0.21300381*a1.z + 0.13182314*b1.z + -0.1794802*c1.z + 0.041218325*d1.z + -0.084293015*e1.z + -0.07785635*f1.z + 0.005804347*g1.z + -0.090246014*h1.z + -0.07069001*i1.z; + p = -0.0090839965*a1.w + 0.13686492*b1.w + 0.1999011*c1.w + -0.18534096*d1.w + -0.03643351*e1.w + 0.3022044*f1.w + 0.020653404*g1.w + -0.053792052*h1.w + 0.08029478*i1.w; + q = 0.09313165*na0.x + -0.20987953*nb0.x + -0.13642266*nc0.x + 0.01774858*nd0.x + -0.32583392*ne0.x + -0.10607029*nf0.x + 0.062344737*ng0.x + 0.22812237*nh0.x + 0.018149327*ni0.x; + r = -0.4551336*na0.y + -0.18321747*nb0.y + -0.10392498*nc0.y + -0.11381515*nd0.y + -0.27942544*ne0.y + 0.107884325*nf0.y + -0.083248846*ng0.y + 0.014200544*nh0.y + -0.08907091*ni0.y; + s = 0.120486066*na0.z + 0.16473046*nb0.z + -0.028575819*nc0.z + 0.17433837*nd0.z + -0.4197916*ne0.z + -0.24925393*nf0.z + 0.013189131*ng0.z + 0.039529253*nh0.z + 0.2124912*ni0.z; + t = -0.042864945*na0.w + 0.514165*nb0.w + -0.16705744*nc0.w + 0.26858032*nd0.w + 0.025890924*ne0.w + -0.12886028*nf0.w + -0.0093325935*ng0.w + 0.036776513*nh0.w + -0.06780495*ni0.w; + u = -0.09991671*na1.x + -0.24013445*nb1.x + -0.043176726*nc1.x + -0.06255361*nd1.x + -0.43966636*ne1.x + 0.03481608*nf1.x + -0.1976385*ng1.x + 0.025012735*nh1.x + 0.12251629*ni1.x; + v = 0.03532957*na1.y + -0.12534937*nb1.y + -0.111054376*nc1.y + -0.32459697*nd1.y + -0.036310744*ne1.y + 0.10149172*nf1.y + 0.04345607*ng1.y + -0.1690419*nh1.y + 0.15201193*ni1.y; + w = 0.0020700989*na1.z + 0.018126104*nb1.z + 0.1968919*nc1.z + -0.033329114*nd1.z + 0.20545799*ne1.z + 0.025382748*nf1.z + 0.11418677*ng1.z + 0.13705094*nh1.z + 0.012681161*ni1.z; + x = -0.14087495*na1.w + -0.072729364*nb1.w + -0.24772419*nc1.w + 0.17076711*nd1.w + -0.021828393*ne1.w + -0.10543231*nf1.w + 0.014692333*ng1.w + 0.031828444*nh1.w + -0.14082411*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.10608039; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN00 +//!BIND LUMAN01 +//!SAVE LUMAN11 + +#define L0_tex LUMAN00_tex +#define L1_tex LUMAN01_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.08251482*a0.x + 0.29106933*b0.x + 0.059387296*c0.x + 0.37380347*d0.x + -0.21551596*e0.x + -0.050368074*f0.x + 0.06634412*g0.x + -0.3150945*h0.x + -0.14561915*i0.x; + float j = 0.1698925*a0.y + -0.059246074*b0.y + 0.08630799*c0.y + 0.02389207*d0.y + 0.03793831*e0.y + -0.0582392*f0.y + -0.03397385*g0.y + -0.24723254*h0.y + 0.21064827*i0.y; + float k = -0.21669565*a0.z + -0.19199888*b0.z + -0.24721447*c0.z + -0.7302215*d0.z + -0.4305342*e0.z + -0.1251449*f0.z + -0.07891673*g0.z + 0.36592582*h0.z + 0.25768483*i0.z; + float l = 0.4126826*a0.w + 0.20862694*b0.w + 0.5041565*c0.w + -0.24220178*d0.w + -0.32580248*e0.w + 0.0035771998*f0.w + 0.19374675*g0.w + 0.050378945*h0.w + -0.12696394*i0.w; + float m = -0.140747*a1.x + -0.097618654*b1.x + -0.42250344*c1.x + 0.1810929*d1.x + -0.114540584*e1.x + -0.06470164*f1.x + 0.025054755*g1.x + 0.1210664*h1.x + -0.06487856*i1.x; + float n = 0.044984564*a1.y + -0.09150712*b1.y + 0.03883413*c1.y + 0.2700107*d1.y + -0.1924873*e1.y + -0.016006626*f1.y + 0.1937291*g1.y + -0.14800532*h1.y + -0.06977464*i1.y; + float o = 0.028001428*a1.z + 0.38993812*b1.z + -0.24332824*c1.z + 0.03010299*d1.z + 0.55186975*e1.z + 0.04203979*f1.z + -0.06724078*g1.z + -0.30162588*h1.z + -0.18771334*i1.z; + float p = -0.17779396*a1.w + 0.14025119*b1.w + 0.39543924*c1.w + -0.11448653*d1.w + 0.3944919*e1.w + 0.5594662*f1.w + 0.22536032*g1.w + 0.09355939*h1.w + -0.05477075*i1.w; + float q = -0.05063325*na0.x + -0.19487661*nb0.x + -0.0486381*nc0.x + -0.4099135*nd0.x + 0.15758072*ne0.x + -0.14006934*nf0.x + 0.016247243*ng0.x + 0.21706717*nh0.x + 0.1730037*ni0.x; + float r = -0.18323535*na0.y + 0.116462864*nb0.y + -0.08039124*nc0.y + -0.06274208*nd0.y + 0.053934556*ne0.y + 0.0833979*nf0.y + 0.060505584*ng0.y + 0.20092015*nh0.y + -0.20753656*ni0.y; + float s = 0.10038492*na0.z + -0.097845115*nb0.z + -0.20988423*nc0.z + 0.56715375*nd0.z + 0.344541*ne0.z + -0.35184717*nf0.z + 0.056586858*ng0.z + 0.15026435*nh0.z + -0.061636005*ni0.z; + float t = -0.106188744*na0.w + 0.07888199*nb0.w + -0.2636212*nc0.w + 0.066121526*nd0.w + 0.24769889*ne0.w + 0.068046436*nf0.w + -0.10188476*ng0.w + -0.010680762*nh0.w + 0.08574669*ni0.w; + float u = 0.1835542*na1.x + 0.008937482*nb1.x + 0.5390035*nc1.x + -0.29016507*nd1.x + 0.15828976*ne1.x + 0.13055886*nf1.x + -0.032077167*ng1.x + -0.09232864*nh1.x + 0.026800178*ni1.x; + float v = -0.16373107*na1.y + 0.12240949*nb1.y + -0.1514469*nc1.y + -0.066187665*nd1.y + 0.480507*ne1.y + 0.239324*nf1.y + -0.117546804*ng1.y + 0.10907446*nh1.y + 0.18901855*ni1.y; + float w = 0.16920653*na1.z + -0.116989106*nb1.z + 0.15383393*nc1.z + -0.15339498*nd1.z + -0.43599066*ne1.z + -0.08481946*nf1.z + 0.09341884*ng1.z + 0.29806188*nh1.z + 0.1415666*ni1.z; + float x = 0.19586475*na1.w + -0.074446365*nb1.w + -0.40643847*nc1.w + 0.11850669*nd1.w + -0.44227952*ne1.w + -0.3928542*nf1.w + -0.32883126*ng1.w + -0.12546194*nh1.w + -0.012666243*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.11223799; + i = 0.26876807*a0.x + 0.0695523*b0.x + -0.344691*c0.x + 0.015203748*d0.x + -0.06949707*e0.x + 0.1781559*f0.x + -0.37520844*g0.x + -0.063073136*h0.x + 0.30087665*i0.x; + j = -0.55691296*a0.y + -0.50857925*b0.y + -0.056020547*c0.y + -0.35320345*d0.y + 0.031270754*e0.y + 0.2983404*f0.y + -0.076483674*g0.y + 0.26416323*h0.y + 0.023565156*i0.y; + k = 0.69414824*a0.z + 0.40440598*b0.z + 0.27192193*c0.z + 0.6970185*d0.z + 0.3389849*e0.z + -0.70087254*f0.z + 0.19736615*g0.z + -0.31259185*h0.z + -0.25468588*i0.z; + l = 0.2020039*a0.w + 0.72199726*b0.w + 0.0022852335*c0.w + 0.298485*d0.w + -0.20830868*e0.w + 0.19032896*f0.w + 0.3657984*g0.w + -0.17007291*h0.w + 0.36441973*i0.w; + m = -0.2508085*a1.x + -0.3401645*b1.x + -0.850176*c1.x + 0.06386162*d1.x + -0.003681138*e1.x + 0.6275042*f1.x + 0.11110598*g1.x + 0.47562084*h1.x + 0.13381582*i1.x; + n = 0.020444876*a1.y + 0.2532999*b1.y + 0.2269895*c1.y + -0.017598275*d1.y + -0.45708385*e1.y + 0.1524704*f1.y + -0.34254953*g1.y + 0.04740127*h1.y + 0.017197018*i1.y; + o = -0.002111269*a1.z + -0.22728685*b1.z + -0.23939796*c1.z + -0.10468774*d1.z + -0.29414457*e1.z + -0.24367806*f1.z + 0.17014527*g1.z + 0.27090183*h1.z + 0.054622088*i1.z; + p = 0.41061872*a1.w + 0.0005123808*b1.w + -0.22415727*c1.w + -0.2519382*d1.w + 0.05781463*e1.w + 0.22721478*f1.w + -0.21616709*g1.w + -0.24962169*h1.w + 0.13280573*i1.w; + q = -0.1373898*na0.x + -0.0981469*nb0.x + 0.39089695*nc0.x + 0.0852082*nd0.x + 0.350497*ne0.x + -0.11116323*nf0.x + 0.46357557*ng0.x + 0.029840166*nh0.x + -0.42227915*ni0.x; + r = 0.5641577*na0.y + 0.51027757*nb0.y + 0.009071347*nc0.y + 0.38495895*nd0.y + -0.033866487*ne0.y + -0.27575114*nf0.y + 0.08055667*ng0.y + -0.3035854*nh0.y + -0.023016002*ni0.y; + s = -0.32272196*na0.z + 0.20313929*nb0.z + 0.26362333*nc0.z + -0.41859806*nd0.z + 0.30431905*ne0.z + 0.45895672*nf0.z + -0.22528476*ng0.z + -0.1159145*nh0.z + -0.20209464*ni0.z; + t = 0.081928305*na0.w + -0.39223*nb0.w + 0.0611548*nc0.w + -0.22477622*nd0.w + 0.522427*ne0.w + 0.08855894*nf0.w + -0.24657424*ng0.w + 0.20350339*nh0.w + -0.31071478*ni0.w; + u = 0.33967844*na1.x + 0.49198282*nb1.x + 0.7863518*nc1.x + 0.11403914*nd1.x + -0.19266184*ne1.x + -0.45698294*nf1.x + -0.08126978*ng1.x + -0.5248899*nh1.x + -0.07797818*ni1.x; + v = -0.20771638*na1.y + -0.8299212*nb1.y + -0.24834624*nc1.y + 0.45250767*nd1.y + 0.46488434*ne1.y + -0.11828078*nf1.y + 0.3505284*ng1.y + -0.50510573*nh1.y + -0.07697552*ni1.y; + w = -0.04876213*na1.z + 0.11971257*nb1.z + 0.31340784*nc1.z + 0.200377*nd1.z + 0.35152084*ne1.z + 0.21963598*nf1.z + -0.076885894*ng1.z + -0.26809564*nh1.z + -0.09561077*ni1.z; + x = -0.34259066*na1.w + 0.09505923*nb1.w + 0.14959009*nc1.w + 0.23431835*nd1.w + 0.0062933876*ne1.w + -0.1609717*nf1.w + 0.24410221*ng1.w + 0.27085063*nh1.w + -0.099992506*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.04949893; + i = 0.0045639137*a0.x + -0.05743072*b0.x + 0.10285781*c0.x + 0.26087925*d0.x + -0.20553583*e0.x + 0.061200682*f0.x + -0.006694795*g0.x + -0.3745583*h0.x + -0.3707756*i0.x; + j = -0.022965383*a0.y + -0.26371047*b0.y + 0.005787948*c0.y + -0.07437368*d0.y + 0.06782797*e0.y + -0.08120288*f0.y + -0.12914035*g0.y + -0.077741124*h0.y + 0.2501241*i0.y; + k = 0.20610172*a0.z + 0.1284978*b0.z + -0.11886638*c0.z + 0.28653103*d0.z + -0.063644625*e0.z + -0.5884758*f0.z + 0.11728779*g0.z + 0.029905675*h0.z + 0.07379022*i0.z; + l = 0.1538378*a0.w + 0.4065925*b0.w + 0.2281266*c0.w + 0.18172836*d0.w + -0.23893136*e0.w + -0.23435418*f0.w + 0.22755076*g0.w + 0.285046*h0.w + 0.14650422*i0.w; + m = 0.11291303*a1.x + -0.08260544*b1.x + -0.3453159*c1.x + -0.080172844*d1.x + 0.2454293*e1.x + 0.08065602*f1.x + -0.161478*g1.x + 0.2600093*h1.x + 0.0272943*i1.x; + n = -0.20061754*a1.y + -0.0686889*b1.y + 0.34669587*c1.y + 0.06513748*d1.y + -0.473736*e1.y + 0.27777022*f1.y + -0.024264947*g1.y + 0.02778163*h1.y + 0.21098697*i1.y; + o = 0.05395608*a1.z + 0.02719116*b1.z + -0.32412598*c1.z + -0.27905193*d1.z + -0.06789973*e1.z + -0.062129535*f1.z + -0.08168251*g1.z + -0.41552538*h1.z + -0.3497803*i1.z; + p = 0.25839904*a1.w + -0.22404832*b1.w + -0.05384204*c1.w + -0.2161867*d1.w + -0.0121894805*e1.w + 0.022278681*f1.w + -0.17689417*g1.w + -0.34242043*h1.w + -0.070397146*i1.w; + q = 0.063034*na0.x + 0.05760969*nb0.x + -0.18728243*nc0.x + -0.22536343*nd0.x + 0.56690377*ne0.x + 0.03879585*nf0.x + 0.07536423*ng0.x + 0.3205974*nh0.x + 0.27575305*ni0.x; + r = 0.1031107*na0.y + 0.272687*nb0.y + 0.006762844*nc0.y + 0.16900925*nd0.y + -0.072919*ne0.y + 0.14026049*nf0.y + 0.15526237*ng0.y + 0.18150571*nh0.y + -0.22151531*ni0.y; + s = -0.24863394*na0.z + -0.09707596*nb0.z + 0.09795663*nc0.z + -0.22762008*nd0.z + -0.21057858*ne0.z + -0.24106069*nf0.z + -0.022255352*ng0.z + -0.1313767*nh0.z + -0.43121204*ni0.z; + t = 0.066694*na0.w + -0.10496735*nb0.w + -0.025571965*nc0.w + -0.018413628*nd0.w + 0.11439308*ne0.w + -0.10751523*nf0.w + -0.07761101*ng0.w + -0.12299807*nh0.w + -0.0853496*ni0.w; + u = -0.097931445*na1.x + -0.017077666*nb1.x + 0.39443842*nc1.x + 0.11578743*nd1.x + -0.12134833*ne1.x + -0.13418046*nf1.x + 0.1631315*ng1.x + -0.17905197*nh1.x + 0.1269253*ni1.x; + v = 0.14395997*na1.y + -0.18397519*nb1.y + -0.2788941*nc1.y + 0.26155776*nd1.y + 0.43425953*ne1.y + -0.29808456*nf1.y + 0.44714943*ng1.y + -0.15123212*nh1.y + -0.16428284*ni1.y; + w = 0.11957922*na1.z + -0.07498902*nb1.z + 0.5115902*nc1.z + 0.4331171*nd1.z + 0.051374156*ne1.z + 0.08533449*nf1.z + 0.09597762*ng1.z + 0.31204012*nh1.z + 0.31360728*ni1.z; + x = -0.21514232*na1.w + 0.26941258*nb1.w + 0.014634563*nc1.w + 0.26335603*nd1.w + 0.17885374*ne1.w + -0.10330111*nf1.w + 0.1403563*ng1.w + 0.07782978*nh1.w + 0.14008115*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.13688515; + i = -0.07804815*a0.x + 0.059407797*b0.x + 0.04977952*c0.x + 0.02773134*d0.x + 0.05410472*e0.x + -0.062854886*f0.x + 0.026472766*g0.x + -0.27023906*h0.x + -0.19210388*i0.x; + j = -0.093932435*a0.y + 0.28328913*b0.y + -0.2901787*c0.y + 0.2604209*d0.y + 0.1867309*e0.y + -0.087907895*f0.y + -0.17325231*g0.y + -0.20677052*h0.y + 0.05084516*i0.y; + k = 0.18059264*a0.z + 0.12659116*b0.z + 0.321166*c0.z + -0.095247015*d0.z + -0.057249375*e0.z + -0.083215155*f0.z + -0.084061414*g0.z + 0.016379947*h0.z + 0.27847067*i0.z; + l = 0.0052076564*a0.w + 0.088261835*b0.w + 0.023966275*c0.w + 0.1916891*d0.w + -0.18803315*e0.w + 0.30314574*f0.w + -0.0049388534*g0.w + 0.06131603*h0.w + -0.1739463*i0.w; + m = 0.053730816*a1.x + 0.044391237*b1.x + -0.23457325*c1.x + 0.16524185*d1.x + -0.06232111*e1.x + -0.009041229*f1.x + -0.14986548*g1.x + 0.2529295*h1.x + -0.06479601*i1.x; + n = -0.0712835*a1.y + 0.08422339*b1.y + 0.06049955*c1.y + 0.19688065*d1.y + -0.2506823*e1.y + 0.028088713*f1.y + 0.5348856*g1.y + 0.30103734*h1.y + -0.19360717*i1.y; + o = -0.24208106*a1.z + -0.122532606*b1.z + 0.20045316*c1.z + 0.05312705*d1.z + 0.5049963*e1.z + -0.14606343*f1.z + 0.049328245*g1.z + -0.078365676*h1.z + 0.03955016*i1.z; + p = -0.2099684*a1.w + 0.040386654*b1.w + -0.013257981*c1.w + 0.0356436*d1.w + -0.325366*e1.w + 0.16636635*f1.w + -0.22065227*g1.w + -0.16084203*h1.w + 0.11005756*i1.w; + q = 0.15815249*na0.x + -0.015369833*nb0.x + -0.12336756*nc0.x + -0.054385934*nd0.x + 0.074591964*ne0.x + -0.086368226*nf0.x + -0.14882945*ng0.x + 0.28417754*nh0.x + 0.21760134*ni0.x; + r = 0.14566842*na0.y + -0.32228568*nb0.y + 0.3217725*nc0.y + -0.3236746*nd0.y + -0.24484256*ne0.y + 0.10371231*nf0.y + 0.16460484*ng0.y + 0.23163281*nh0.y + -0.012341124*ni0.y; + s = -0.005058286*na0.z + -0.03453109*nb0.z + -0.23984626*nc0.z + 0.25166908*nd0.z + 0.27825156*ne0.z + 0.024285031*nf0.z + 0.10690525*ng0.z + -0.026662704*nh0.z + -0.10733832*ni0.z; + t = -0.057425056*na0.w + -0.044107772*nb0.w + 0.14013149*nc0.w + -0.2928656*nd0.w + -0.027609475*ne0.w + -0.2120587*nf0.w + -0.048152808*ng0.w + -0.09314774*nh0.w + 0.17581387*ni0.w; + u = -0.045317907*na1.x + -0.002658384*nb1.x + 0.26392183*nc1.x + -0.102072954*nd1.x + 0.15045899*ne1.x + 0.0026884302*nf1.x + 0.22182642*ng1.x + -0.16366667*nh1.x + 0.17252661*ni1.x; + v = 0.037068292*na1.y + -0.035697266*nb1.y + -0.12798944*nc1.y + -0.104217514*nd1.y + 0.55114526*ne1.y + -0.08683132*nf1.y + -0.3960688*ng1.y + -0.058004502*nh1.y + 0.20123851*ni1.y; + w = 0.061975777*na1.z + -0.007016737*nb1.z + -0.24395092*nc1.z + -0.18182912*nd1.z + -0.4203786*ne1.z + -0.0793229*nf1.z + -0.0062738233*ng1.z + 0.07010734*nh1.z + -0.07754023*ni1.z; + x = 0.23575118*na1.w + 0.010342719*nb1.w + 0.053801455*nc1.w + -0.04112547*nd1.w + 0.22638881*ne1.w + -0.17857444*nf1.w + 0.32300612*ng1.w + 0.16535853*nh1.w + -0.032169778*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.09900063; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN10 +//!BIND LUMAN11 +//!SAVE LUMAN20 + +#define L0_tex LUMAN10_tex +#define L1_tex LUMAN11_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.013527977*a0.x + -0.021985358*b0.x + 0.05397565*c0.x + -0.0034767855*d0.x + -0.11890677*e0.x + 0.29082134*f0.x + -0.039291047*g0.x + 0.07665195*h0.x + 0.08196425*i0.x; + float j = -0.094228186*a0.y + 0.07538697*b0.y + -0.060956057*c0.y + 0.059484713*d0.y + -0.17759728*e0.y + 0.09614218*f0.y + 0.03537611*g0.y + -0.037086073*h0.y + -0.008596415*i0.y; + float k = 0.032117758*a0.z + 0.022979202*b0.z + -0.07695347*c0.z + 0.012811646*d0.z + -0.023976473*e0.z + 0.059492603*f0.z + 0.008878449*g0.z + -0.059855916*h0.z + -0.07344373*i0.z; + float l = -0.021900775*a0.w + 0.031232128*b0.w + -0.06696601*c0.w + -0.009441922*d0.w + 0.1089948*e0.w + -0.06588389*f0.w + 0.012479958*g0.w + -0.08053917*h0.w + -0.04149462*i0.w; + float m = -0.008463991*a1.x + -0.06539698*b1.x + 0.017473739*c1.x + -0.10556125*d1.x + -0.14444841*e1.x + 0.07904334*f1.x + -0.04443588*g1.x + -0.03508132*h1.x + -0.17745219*i1.x; + float n = 0.020496715*a1.y + -0.08638652*b1.y + 0.05855077*c1.y + 0.00017441693*d1.y + 0.018543327*e1.y + -0.1013226*f1.y + -0.066230886*g1.y + 0.08413542*h1.y + 0.050962817*i1.y; + float o = -0.017161256*a1.z + 0.13858159*b1.z + -0.041749604*c1.z + 0.03419109*d1.z + -0.056592952*e1.z + 0.18458726*f1.z + 0.043434385*g1.z + -0.061071083*h1.z + 0.012921071*i1.z; + float p = 0.014755255*a1.w + -0.05182161*b1.w + -0.06731411*c1.w + 0.011102007*d1.w + -0.318703*e1.w + 0.075716965*f1.w + 0.101763345*g1.w + 0.15413295*h1.w + 0.024591988*i1.w; + float q = -0.075562514*na0.x + -0.010590976*nb0.x + -0.11738534*nc0.x + -0.041761354*nd0.x + 0.11932829*ne0.x + -0.45476782*nf0.x + -0.0075228284*ng0.x + -0.086420506*nh0.x + 0.007089712*ni0.x; + float r = 0.03096373*na0.y + 0.034649566*nb0.y + -0.031928774*nc0.y + -0.043111343*nd0.y + 0.31612563*ne0.y + -0.20350803*nf0.y + -0.026558274*ng0.y + 0.02289182*nh0.y + -0.020726833*ni0.y; + float s = -0.0016090226*na0.z + -0.06752645*nb0.z + 0.099091955*nc0.z + -0.0024325743*nd0.z + 0.1011554*ne0.z + -0.04262747*nf0.z + -0.05447163*ng0.z + -0.050558403*nh0.z + 0.0081778*ni0.z; + float t = -0.0049708895*na0.w + 0.0016392999*nb0.w + 0.057654087*nc0.w + 0.059012435*nd0.w + -0.057368375*ne0.w + 0.03879934*nf0.w + -0.10427082*ng0.w + 0.20068298*nh0.w + -0.01986618*ni0.w; + float u = 0.038776297*na1.x + 0.09107378*nb1.x + -0.012062791*nc1.x + -0.039930277*nd1.x + 0.4725951*ne1.x + -0.08188476*nf1.x + 0.032464903*ng1.x + 0.022594651*nh1.x + 0.13316265*ni1.x; + float v = 0.013261636*na1.y + 0.016820675*nb1.y + -0.072160594*nc1.y + -0.04779156*nd1.y + -0.111475825*ne1.y + -0.059117347*nf1.y + -0.0058553545*ng1.y + -0.08119034*nh1.y + -0.09739646*ni1.y; + float w = -0.012684074*na1.z + -0.07658207*nb1.z + 0.08316156*nc1.z + 0.056792818*nd1.z + 0.19558784*ne1.z + -0.20766291*nf1.z + -0.020052088*ng1.z + -0.0004862114*nh1.z + -0.011227089*ni1.z; + float x = 0.0073004025*na1.w + -0.13704851*nb1.w + 0.08306585*nc1.w + 0.07773706*nd1.w + 0.17363897*ne1.w + -0.1441048*nf1.w + -0.19439775*ng1.w + 0.107276335*nh1.w + -0.051084824*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.022949655; + i = -0.04087157*a0.x + -0.02260197*b0.x + 0.117542826*c0.x + -0.012369363*d0.x + 0.08074506*e0.x + 0.061692882*f0.x + 0.022351578*g0.x + 0.10602042*h0.x + -0.06767196*i0.x; + j = -0.064718924*a0.y + -0.22255176*b0.y + 0.05848093*c0.y + -0.14342205*d0.y + 0.119860075*e0.y + 0.06878551*f0.y + -0.013513069*g0.y + 0.046533465*h0.y + 0.040732548*i0.y; + k = -0.06045028*a0.z + -0.01591852*b0.z + 0.06610767*c0.z + -0.1823601*d0.z + 0.20849596*e0.z + 0.07347752*f0.z + 0.04155757*g0.z + 0.00895664*h0.z + -0.07944645*i0.z; + l = -0.016871834*a0.w + 0.045388754*b0.w + 0.011370655*c0.w + -0.14510797*d0.w + -0.15147415*e0.w + -0.1170348*f0.w + 0.017186902*g0.w + 0.09248375*h0.w + 0.007475839*i0.w; + m = -0.16198191*a1.x + 0.031186389*b1.x + -0.015577391*c1.x + -0.22482629*d1.x + 0.24596654*e1.x + -0.050533623*f1.x + -0.25108784*g1.x + 0.04284556*h1.x + 0.08108874*i1.x; + n = 0.027043452*a1.y + 0.16801552*b1.y + -0.003745599*c1.y + 0.070402175*d1.y + 0.053155128*e1.y + -0.14744243*f1.y + -0.051701613*g1.y + -0.11427176*h1.y + 0.037253726*i1.y; + o = 0.014052072*a1.z + -0.21043895*b1.z + -0.04493953*c1.z + -0.13491723*d1.z + 0.045351543*e1.z + -0.017205605*f1.z + 0.044354085*g1.z + 0.17428237*h1.z + -0.027252568*i1.z; + p = -0.05443855*a1.w + -0.19976734*b1.w + 0.08696741*c1.w + -0.058124144*d1.w + 0.17074996*e1.w + 0.016584387*f1.w + 0.061787624*g1.w + -0.095216915*h1.w + -0.09135518*i1.w; + q = 0.068849*na0.x + -0.006419118*nb0.x + 0.019441683*nc0.x + -0.060357757*nd0.x + 0.039131112*ne0.x + -0.08853136*nf0.x + 0.01760069*ng0.x + 0.09266912*nh0.x + 0.008327355*ni0.x; + r = 0.22129181*na0.y + 0.06373042*nb0.y + -0.10548629*nc0.y + 0.10325513*nd0.y + -0.30775833*ne0.y + 0.00220113*nf0.y + -0.028867336*ng0.y + -0.09189019*nh0.y + -0.022799294*ni0.y; + s = 0.060209315*na0.z + 0.031388324*nb0.z + -0.022957543*nc0.z + 0.27422178*nd0.z + 0.06937636*ne0.z + 0.035298806*nf0.z + 0.11368389*ng0.z + 0.12730958*nh0.z + 0.028364537*ni0.z; + t = 0.014704841*na0.w + -0.20102401*nb0.w + -0.026068306*nc0.w + 0.17699486*nd0.w + 0.0879294*ne0.w + 0.1698334*nf0.w + -0.02981899*ng0.w + -0.033061545*nh0.w + -0.003263149*ni0.w; + u = 0.10228793*na1.x + -0.12621002*nb1.x + 0.04712082*nc1.x + 0.17671345*nd1.x + -0.011435259*ne1.x + -0.017273735*nf1.x + 0.04336435*ng1.x + 0.041016195*nh1.x + -0.07070804*ni1.x; + v = -0.0230543*na1.y + -0.07177169*nb1.y + -0.016929608*nc1.y + 0.09176562*nd1.y + 0.007423476*ne1.y + 0.14347216*nf1.y + 0.19021674*ng1.y + 0.24664913*nh1.y + -0.0044546993*ni1.y; + w = 0.07525268*na1.z + 0.10215633*nb1.z + -0.034674216*nc1.z + 0.11917874*nd1.z + -0.07633382*ne1.z + 0.009491858*nf1.z + -0.019258348*ng1.z + -0.056110546*nh1.z + 0.05242466*ni1.z; + x = 0.14390227*na1.w + 0.005486874*nb1.w + -0.047775052*nc1.w + 0.083086684*nd1.w + -0.1540571*ne1.w + 0.03332832*nf1.w + -0.039857596*ng1.w + 0.06294105*nh1.w + 0.059931733*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.015004233; + i = 0.06450652*a0.x + 0.10512942*b0.x + -0.03380897*c0.x + 0.02381926*d0.x + -0.029680518*e0.x + 0.19790445*f0.x + 0.020805994*g0.x + 0.12226736*h0.x + 0.29196885*i0.x; + j = 0.058254506*a0.y + 0.37349033*b0.y + 0.17782345*c0.y + 0.13237436*d0.y + -0.16366753*e0.y + 0.15040247*f0.y + -0.009766406*g0.y + 0.09334094*h0.y + -0.04319163*i0.y; + k = 0.032573055*a0.z + 0.0520147*b0.z + -0.109417446*c0.z + -0.083108656*d0.z + -0.03640593*e0.z + -0.035311375*f0.z + -0.059460822*g0.z + -0.23666914*h0.z + -0.08944803*i0.z; + l = 0.0038108414*a0.w + -0.093942806*b0.w + -0.0002687137*c0.w + 0.050867274*d0.w + 0.19859661*e0.w + -0.022116859*f0.w + 0.06944154*g0.w + -0.1566366*h0.w + -0.030445358*i0.w; + m = 0.00823481*a1.x + -0.01037292*b1.x + -0.10918299*c1.x + 0.27718702*d1.x + -0.14857076*e1.x + -0.04826351*f1.x + 0.2341413*g1.x + 0.2599253*h1.x + 0.17341693*i1.x; + n = 0.048965324*a1.y + -0.12670444*b1.y + -0.089070916*c1.y + 0.02564883*d1.y + -0.24245334*e1.y + 0.032899123*f1.y + -0.014363491*g1.y + 0.11135662*h1.y + 0.15778056*i1.y; + o = -0.16426727*a1.z + 0.11129983*b1.z + 0.06887022*c1.z + 0.007059456*d1.z + -0.17225806*e1.z + -0.19889604*f1.z + -0.12744522*g1.z + -0.12379852*h1.z + -0.16819909*i1.z; + p = -0.116869636*a1.w + 0.15554382*b1.w + 0.029180527*c1.w + -0.06872862*d1.w + 0.09564698*e1.w + 0.24025366*f1.w + 0.03126127*g1.w + -0.1176598*h1.w + -0.06161121*i1.w; + q = 0.037802104*na0.x + 0.09350397*nb0.x + -0.0769349*nc0.x + 0.03645998*nd0.x + 0.0069438526*ne0.x + -0.06361921*nf0.x + 0.18469255*ng0.x + 0.24764213*nh0.x + 0.07766792*ni0.x; + r = 0.18289608*na0.y + -0.12239327*nb0.y + -0.13007359*nc0.y + 0.09451128*nd0.y + 0.1741278*ne0.y + 0.13919578*nf0.y + 0.0027461709*ng0.y + -0.042409852*nh0.y + 0.08961877*ni0.y; + s = -0.061266363*na0.z + -0.054321136*nb0.z + 0.036159202*nc0.z + 0.030102096*nd0.z + -0.044607766*ne0.z + -0.060411066*nf0.z + -0.13489954*ng0.z + -0.04080531*nh0.z + -0.083873264*ni0.z; + t = -0.084672436*na0.w + 0.1504545*nb0.w + 0.024027625*nc0.w + -0.13306853*nd0.w + -0.09016413*ne0.w + 0.17414762*nf0.w + -0.06464937*ng0.w + 0.13652956*nh0.w + -0.021525873*ni0.w; + u = -0.02642025*na1.x + 0.044494845*nb1.x + 0.06366142*nc1.x + 0.1505755*nd1.x + 0.07108563*ne1.x + 0.04716515*nf1.x + 0.08969759*ng1.x + 0.15725368*nh1.x + -0.083613135*ni1.x; + v = -0.013183983*na1.y + 0.11957996*nb1.y + 0.06981307*nc1.y + 0.0049996213*nd1.y + 0.045766216*ne1.y + -0.2006878*nf1.y + -0.061555803*ng1.y + -0.23608068*nh1.y + -0.20878883*ni1.y; + w = 0.08936703*na1.z + -0.08374226*nb1.z + -0.22422598*nc1.z + -0.1499266*nd1.z + -0.02415584*ne1.z + -0.03532918*nf1.z + -0.0064545805*ng1.z + 0.11103835*nh1.z + 0.14617345*ni1.z; + x = -0.059598316*na1.w + 0.0572515*nb1.w + -0.07959839*nc1.w + -0.11761448*nd1.w + 0.04539192*ne1.w + -0.013689615*nf1.w + 0.117332384*ng1.w + 0.06432839*nh1.w + 0.17445782*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.009116664; + i = 0.029937284*a0.x + 0.012592633*b0.x + 0.0035193404*c0.x + 0.048239913*d0.x + -0.02579887*e0.x + -0.32347405*f0.x + 0.19797476*g0.x + 0.34045488*h0.x + -0.053127605*i0.x; + j = -0.08552001*a0.y + -0.5091193*b0.y + -0.3674879*c0.y + 0.066710964*d0.y + -0.19032574*e0.y + -0.23930229*f0.y + 0.12251539*g0.y + -0.10437046*h0.y + 0.029123023*i0.y; + k = -0.01817984*a0.z + -0.035262328*b0.z + 0.05684564*c0.z + -0.05650155*d0.z + 0.10149242*e0.z + 0.16924061*f0.z + -0.06286115*g0.z + -0.07370519*h0.z + -0.0031225765*i0.z; + l = 0.01222035*a0.w + -0.034015853*b0.w + 0.054374967*c0.w + 0.13628155*d0.w + 0.12960319*e0.w + 0.14776659*f0.w + 0.06023756*g0.w + -0.042914346*h0.w + 0.20594329*i0.w; + m = -0.0934276*a1.x + -0.07084719*b1.x + 0.05861112*c1.x + 0.043431886*d1.x + 0.39818907*e1.x + -0.13945232*f1.x + 0.09557018*g1.x + 0.24552365*h1.x + -0.12016207*i1.x; + n = 0.044831783*a1.y + 0.06390137*b1.y + 0.24364634*c1.y + 0.07372187*d1.y + -0.14626445*e1.y + 0.099190116*f1.y + -0.07039345*g1.y + 0.073163874*h1.y + -0.06192338*i1.y; + o = -0.109891295*a1.z + -0.13347644*b1.z + -0.12954961*c1.z + -0.019614372*d1.z + -0.0029413272*e1.z + -0.031745158*f1.z + -0.1051075*g1.z + -0.03837312*h1.z + 0.0076298364*i1.z; + p = -0.15461138*a1.w + -0.07552362*b1.w + -0.049930304*c1.w + -0.107533015*d1.w + 0.02491214*e1.w + 0.12966767*f1.w + 0.16751781*g1.w + -0.14322354*h1.w + 0.012731172*i1.w; + q = 0.0073949546*na0.x + 0.18222675*nb0.x + -0.07683412*nc0.x + 0.083668694*nd0.x + 0.24188446*ne0.x + 0.22409667*nf0.x + 0.111766525*ng0.x + 0.17273599*nh0.x + 0.013803989*ni0.x; + r = 0.0055611595*na0.y + 0.27571908*nb0.y + 0.2450441*nc0.y + -0.010127715*nd0.y + 0.065464124*ne0.y + 0.13358384*nf0.y + -0.1146484*ng0.y + 0.11939751*nh0.y + 0.05964501*ni0.y; + s = 0.029037701*na0.z + 0.012928207*nb0.z + 0.002133859*nc0.z + 0.050441336*nd0.z + -0.031983275*ne0.z + -0.13312417*nf0.z + -0.1503905*ng0.z + 0.018946528*nh0.z + 0.037298534*ni0.z; + t = 0.03960253*na0.w + 0.028732052*nb0.w + -0.06156018*nc0.w + 0.033002503*nd0.w + -0.12726215*ne0.w + -0.16633202*nf0.w + 0.097211786*ng0.w + 0.12051725*nh0.w + -0.09554128*ni0.w; + u = -0.13823731*na1.x + -0.07852736*nb1.x + -0.09889797*nc1.x + -0.14248206*nd1.x + -0.2923521*ne1.x + 0.11362127*nf1.x + -0.05540227*ng1.x + -0.007822408*nh1.x + 0.031163149*ni1.x; + v = 0.10624509*na1.y + -0.034037188*nb1.y + -0.15328835*nc1.y + -0.039549757*nd1.y + -0.009303268*ne1.y + -0.020719174*nf1.y + -0.1074841*ng1.y + 0.016232569*nh1.y + 0.11941272*ni1.y; + w = 0.030069001*na1.z + 0.033361748*nb1.z + 0.07155489*nc1.z + 0.06789422*nd1.z + -0.09628887*ne1.z + -0.0050422805*nf1.z + 0.077183045*ng1.z + -0.052701566*nh1.z + -0.013990619*ni1.z; + x = 0.06616862*na1.w + 0.23819432*nb1.w + -0.0078013805*nc1.w + 0.34299204*nd1.w + -0.11941012*ne1.w + -0.014988168*nf1.w + -0.049478944*ng1.w + 0.20497164*nh1.w + 0.086817674*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.012121121; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN10 +//!BIND LUMAN11 +//!SAVE LUMAN21 + +#define L0_tex LUMAN10_tex +#define L1_tex LUMAN11_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.032210905*a0.x + -0.22100762*b0.x + -0.0032703374*c0.x + 0.015506358*d0.x + -0.09312688*e0.x + -0.018092621*f0.x + -0.21721269*g0.x + -0.3773176*h0.x + -0.19184077*i0.x; + float j = -0.11561234*a0.y + 0.100562856*b0.y + -0.16967262*c0.y + -0.13489078*d0.y + -0.021638734*e0.y + -0.3574349*f0.y + -0.15207161*g0.y + -0.1547973*h0.y + -0.16668291*i0.y; + float k = 0.02231361*a0.z + 0.13332497*b0.z + 0.035786014*c0.z + -0.0664228*d0.z + 0.16041073*e0.z + -0.084772356*f0.z + 0.07331499*g0.z + -0.028057933*h0.z + 0.03400777*i0.z; + float l = -0.033291023*a0.w + 0.13411658*b0.w + -0.10777399*c0.w + -0.08803081*d0.w + 0.243463*e0.w + 0.23971614*f0.w + 0.03130143*g0.w + 0.21753372*h0.w + 0.23764528*i0.w; + float m = 0.02479805*a1.x + 0.024198437*b1.x + 0.067342184*c1.x + -0.09406164*d1.x + -0.061180808*e1.x + 0.017575948*f1.x + -0.06901198*g1.x + -0.6332455*h1.x + -0.26331425*i1.x; + float n = 0.03550918*a1.y + -0.026056346*b1.y + -0.026818415*c1.y + -0.062047157*d1.y + 0.1374933*e1.y + 0.014597348*f1.y + 0.032155614*g1.y + 0.082036875*h1.y + 0.09928472*i1.y; + float o = 0.0076694456*a1.z + 0.10039608*b1.z + -0.05555473*c1.z + 0.15538448*d1.z + 0.5122444*e1.z + 0.056242995*f1.z + 0.1033249*g1.z + 0.017088782*h1.z + 0.11182181*i1.z; + float p = 0.05504122*a1.w + 0.240218*b1.w + 0.09733398*c1.w + 0.013779217*d1.w + 0.24832357*e1.w + -0.111736566*f1.w + -0.12404431*g1.w + 0.22960596*h1.w + 0.011862629*i1.w; + float q = -0.024519132*na0.x + 0.011293519*nb0.x + -0.10689248*nc0.x + -0.1520136*nd0.x + -0.09288146*ne0.x + -0.07725742*nf0.x + -0.008527781*ng0.x + -0.07596324*nh0.x + 0.24663517*ni0.x; + float r = 0.111326605*na0.y + 0.06520367*nb0.y + -0.0292947*nc0.y + 0.15157138*nd0.y + -0.002686112*ne0.y + 0.089814834*nf0.y + 0.12950978*ng0.y + 0.098146915*nh0.y + -0.006845888*ni0.y; + float s = 0.026319193*na0.z + -0.054523807*nb0.z + -0.032969248*nc0.z + 0.06366228*nd0.z + -0.08584336*ne0.z + 0.07897411*nf0.z + -0.0064960774*ng0.z + 0.037283525*nh0.z + -0.04514447*ni0.z; + float t = 0.032626558*na0.w + -0.10095923*nb0.w + 0.030091932*nc0.w + 0.056223158*nd0.w + -0.13954762*ne0.w + -0.27249533*nf0.w + -0.1874185*ng0.w + -0.06394691*nh0.w + -0.37358424*ni0.w; + float u = 0.11503907*na1.x + 0.09006182*nb1.x + -0.1666951*nc1.x + -0.004016884*nd1.x + 0.04133192*ne1.x + -0.032742172*nf1.x + 0.07530546*ng1.x + 0.1318198*nh1.x + 0.1558315*ni1.x; + float v = -0.015699673*na1.y + -0.065667406*nb1.y + 0.13333066*nc1.y + 0.10314816*nd1.y + -0.10498296*ne1.y + 0.035132464*nf1.y + -0.06944383*ng1.y + -0.15983945*nh1.y + -0.10815093*ni1.y; + float w = -0.023418352*na1.z + 0.1092882*nb1.z + 0.20895064*nc1.z + -0.13675413*nd1.z + 0.051802553*ne1.z + -0.06339106*nf1.z + -0.04526454*ng1.z + 0.02850313*nh1.z + -0.07127658*ni1.z; + float x = -0.09134431*na1.w + 0.12640393*nb1.w + -0.123052575*nc1.w + 0.009571935*nd1.w + -0.121652395*ne1.w + -0.0987715*nf1.w + -0.08485803*ng1.w + -0.044140875*nh1.w + 0.0198955*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.07467768; + i = 0.09189898*a0.x + 0.09660522*b0.x + -0.15929192*c0.x + 0.0873315*d0.x + 0.1004297*e0.x + 0.2897138*f0.x + 0.03302687*g0.x + 0.13837586*h0.x + 0.14187333*i0.x; + j = -0.16785112*a0.y + 0.17407325*b0.y + 0.05927486*c0.y + -0.16061561*d0.y + -0.32080442*e0.y + -0.09874194*f0.y + 0.035980478*g0.y + -0.06288709*h0.y + 0.007237446*i0.y; + k = -0.028712947*a0.z + 0.034094844*b0.z + -0.075238466*c0.z + 0.029756788*d0.z + -0.08453252*e0.z + 0.01931708*f0.z + -0.021127494*g0.z + 0.037089977*h0.z + 0.05374554*i0.z; + l = 0.038226794*a0.w + 0.11277784*b0.w + 0.12790442*c0.w + 0.0022405738*d0.w + 0.16055769*e0.w + 0.1097169*f0.w + 0.11203196*g0.w + 0.11603345*h0.w + -0.01059266*i0.w; + m = 0.04989864*a1.x + -0.03570367*b1.x + -0.07650978*c1.x + 0.114822045*d1.x + -0.043346252*e1.x + -0.054947898*f1.x + -0.010293628*g1.x + -0.11049507*h1.x + -0.12112137*i1.x; + n = 0.011686617*a1.y + -0.01398271*b1.y + -0.0936927*c1.y + -0.014205747*d1.y + -0.10156042*e1.y + 0.16797067*f1.y + -0.16036573*g1.y + -0.06259835*h1.y + 0.084900655*i1.y; + o = -0.084346674*a1.z + 0.14484023*b1.z + -0.04795535*c1.z + 0.08690034*d1.z + -0.05300985*e1.z + -0.045254134*f1.z + -0.079851165*g1.z + 0.08901589*h1.z + 0.08979397*i1.z; + p = -0.08652713*a1.w + -0.0014084558*b1.w + 0.07818926*c1.w + 0.104910046*d1.w + -0.035973582*e1.w + -0.04440243*f1.w + -0.029182553*g1.w + 0.082148395*h1.w + -0.015747363*i1.w; + q = 0.012732959*na0.x + 0.09247432*nb0.x + 0.060586743*nc0.x + -0.049785435*nd0.x + 0.015232796*ne0.x + 0.12521784*nf0.x + 0.08811162*ng0.x + -0.02245172*nh0.x + -0.077839985*ni0.x; + r = 0.14234546*na0.y + -0.26840374*nb0.y + -0.030217612*nc0.y + 0.088527516*nd0.y + 0.049622834*ne0.y + 0.05244139*nf0.y + 0.02926647*ng0.y + 0.1130343*nh0.y + -0.022328159*ni0.y; + s = -0.020194955*na0.z + -0.08410325*nb0.z + 0.068881*nc0.z + -0.052475553*nd0.z + 0.01784649*ne0.z + -0.06723487*nf0.z + -0.055720944*ng0.z + -0.04582561*nh0.z + -0.029673988*ni0.z; + t = 0.04355432*na0.w + 0.06491023*nb0.w + 0.037113376*nc0.w + 0.12672496*nd0.w + -0.18339087*ne0.w + -0.04234449*nf0.w + 0.09054666*ng0.w + -0.11273007*nh0.w + 0.03041045*ni0.w; + u = -0.10813339*na1.x + -0.118357934*nb1.x + 0.00058659946*nc1.x + -0.22123726*nd1.x + 0.12603706*ne1.x + 0.0067170076*nf1.x + 0.012743413*ng1.x + 0.02224982*nh1.x + 0.06633709*ni1.x; + v = 0.09978588*na1.y + 0.007898778*nb1.y + 0.021774517*nc1.y + -0.027918719*nd1.y + 0.24878718*ne1.y + -0.30599263*nf1.y + -0.044740938*ng1.y + 0.16604176*nh1.y + -0.036250304*ni1.y; + w = -0.058091346*na1.z + -0.2510759*nb1.z + -0.04973879*nc1.z + -0.19907628*nd1.z + -0.09391249*ne1.z + 0.06562282*nf1.z + -0.045825444*ng1.z + -0.20437409*nh1.z + -0.07064104*ni1.z; + x = -0.26264083*na1.w + 0.015380487*nb1.w + -0.07525977*nc1.w + 0.03977851*nd1.w + 0.04027396*ne1.w + 0.014741459*nf1.w + 0.19858573*ng1.w + 0.010961905*nh1.w + 0.06481673*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.008888977; + i = -0.02131571*a0.x + -0.053264357*b0.x + 0.17938791*c0.x + 0.08466054*d0.x + 0.08505312*e0.x + -0.08036078*f0.x + 0.17558508*g0.x + 0.17073892*h0.x + -0.07125404*i0.x; + j = -0.011896931*a0.y + 0.075010955*b0.y + -0.0983643*c0.y + 0.026305754*d0.y + 0.019260254*e0.y + -0.14121646*f0.y + 0.02804857*g0.y + 0.0048786188*h0.y + 0.019504687*i0.y; + k = -0.019065183*a0.z + -0.013254299*b0.z + 0.07514181*c0.z + 0.11055625*d0.z + -0.044775892*e0.z + 0.11779965*f0.z + -0.0053781765*g0.z + 0.0074138422*h0.z + -0.078374766*i0.z; + l = 0.11444183*a0.w + 0.115259014*b0.w + 0.031562362*c0.w + 0.012267636*d0.w + 0.10228788*e0.w + -0.06968799*f0.w + 0.072820656*g0.w + -0.036611427*h0.w + 0.13929163*i0.w; + m = -0.07504076*a1.x + -0.12394642*b1.x + -0.11331061*c1.x + -0.047768917*d1.x + -0.13104713*e1.x + -0.08379716*f1.x + -0.021516422*g1.x + -0.08238858*h1.x + -0.08267121*i1.x; + n = 0.033980474*a1.y + 0.02657052*b1.y + 0.1067697*c1.y + 0.02900943*d1.y + -0.34566507*e1.y + 0.07115065*f1.y + -0.007658494*g1.y + 0.10935048*h1.y + -0.010512701*i1.y; + o = 0.004971154*a1.z + 0.092844255*b1.z + -0.05771552*c1.z + -0.11182353*d1.z + -0.110540286*e1.z + -0.023962786*f1.z + 0.03412059*g1.z + -0.08923254*h1.z + 0.018304097*i1.z; + p = -0.12247698*a1.w + -0.049930353*b1.w + 0.21932095*c1.w + 0.26519108*d1.w + -0.40082026*e1.w + 0.20915353*f1.w + 0.028248992*g1.w + 0.13964863*h1.w + -0.1554689*i1.w; + q = 0.12723987*na0.x + 0.03822221*nb0.x + -0.047092102*nc0.x + -0.18272042*nd0.x + 0.3959418*ne0.x + 0.107742086*nf0.x + -0.014026635*ng0.x + 0.059987117*nh0.x + 0.16084902*ni0.x; + r = 0.028825426*na0.y + -0.29448676*nb0.y + -0.13274668*nc0.y + -0.09478098*nd0.y + 0.10420857*ne0.y + -0.10411197*nf0.y + -0.18224506*ng0.y + -0.056122147*nh0.y + -0.01594652*ni0.y; + s = 0.046311874*na0.z + 0.083920695*nb0.z + -0.011149687*nc0.z + 0.053852662*nd0.z + 0.28573832*ne0.z + -0.101435356*nf0.z + 0.09642878*ng0.z + 0.049260557*nh0.z + 0.09929059*ni0.z; + t = -0.0035928742*na0.w + -0.09334861*nb0.w + -0.0063303886*nc0.w + 0.14681813*nd0.w + 0.017606229*ne0.w + 0.12432797*nf0.w + 0.089195*ng0.w + 0.2064234*nh0.w + -0.009656533*ni0.w; + u = -0.07209475*na1.x + 0.09496789*nb1.x + -0.07145837*nc1.x + 0.016493566*nd1.x + 0.22177024*ne1.x + -0.02882561*nf1.x + -0.13864525*ng1.x + -0.050776858*nh1.x + -0.006592587*ni1.x; + v = 0.08312736*na1.y + -0.031556617*nb1.y + 0.03721191*nc1.y + 0.19816718*nd1.y + 0.2112128*ne1.y + 0.18289135*nf1.y + 0.17975038*ng1.y + 0.022604292*nh1.y + 0.05615719*ni1.y; + w = 0.02089934*na1.z + -0.11338398*nb1.z + 0.103426956*nc1.z + 0.039416797*nd1.z + 0.015742797*ne1.z + -0.011910452*nf1.z + -0.04195718*ng1.z + 0.028388608*nh1.z + 0.020044504*ni1.z; + x = -0.01979613*na1.w + 0.18986*nb1.w + -0.14206813*nc1.w + -0.051590487*nd1.w + 0.07681823*ne1.w + -0.051485833*nf1.w + 0.0863466*ng1.w + -0.059099887*nh1.w + 0.20621549*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.02618249; + i = -0.075821996*a0.x + -0.010909995*b0.x + -0.043415338*c0.x + -0.07588877*d0.x + -0.4095415*e0.x + -0.04469391*f0.x + -0.09701737*g0.x + -0.072898634*h0.x + 0.06407679*i0.x; + j = -0.023938905*a0.y + 0.19077158*b0.y + 0.04024954*c0.y + 0.24741809*d0.y + 0.112353556*e0.y + 0.0041395114*f0.y + -0.028641861*g0.y + -0.027194615*h0.y + -0.09061678*i0.y; + k = -0.072798036*a0.z + 0.090112865*b0.z + -0.05632968*c0.z + 0.20347923*d0.z + 0.07701144*e0.z + 0.045918144*f0.z + -0.07585065*g0.z + -0.07914966*h0.z + 0.019974526*i0.z; + l = -0.16652842*a0.w + 0.034469336*b0.w + 0.12903087*c0.w + -0.076710865*d0.w + -0.37440994*e0.w + -0.025993038*f0.w + -0.004262664*g0.w + 0.001584407*h0.w + 0.033034854*i0.w; + m = 0.0041383496*a1.x + 0.03408745*b1.x + -0.026236003*c1.x + 0.04234019*d1.x + -0.12546021*e1.x + -0.014587259*f1.x + -0.03398031*g1.x + -0.141356*h1.x + -0.11886382*i1.x; + n = 0.09139738*a1.y + -0.09554944*b1.y + 0.10334826*c1.y + 0.03734294*d1.y + 0.012692735*e1.y + 0.061069824*f1.y + 0.11895*g1.y + 0.2818085*h1.y + 0.08344411*i1.y; + o = -0.10986263*a1.z + 0.010196268*b1.z + -0.072981186*c1.z + -0.022945326*d1.z + 0.32752264*e1.z + -0.04935327*f1.z + -0.042955153*g1.z + 0.029840723*h1.z + -0.049479816*i1.z; + p = -0.118424095*a1.w + -0.15453647*b1.w + -0.08703251*c1.w + -0.1623114*d1.w + 0.08050361*e1.w + 0.084552966*f1.w + 0.045329593*g1.w + 0.101881795*h1.w + -0.005239424*i1.w; + q = -0.037558466*na0.x + 0.06352173*nb0.x + -0.03436178*nc0.x + -0.06149859*nd0.x + 0.031554375*ne0.x + 0.017566927*nf0.x + 0.047931995*ng0.x + -0.028771691*nh0.x + 0.09664059*ni0.x; + r = -0.066075586*na0.y + 0.25566104*nb0.y + -0.0008369278*nc0.y + -0.10307065*nd0.y + -0.4120819*ne0.y + -0.13958299*nf0.y + -0.058115225*ng0.y + -0.030533452*nh0.y + 0.019909525*ni0.y; + s = 0.21524096*na0.z + -0.034712624*nb0.z + 0.026146675*nc0.z + 0.03823109*nd0.z + 0.027243178*ne0.z + -0.06874973*nf0.z + 0.047253083*ng0.z + -0.06430874*nh0.z + 0.040901497*ni0.z; + t = 0.07901911*na0.w + 0.15762629*nb0.w + 0.011304432*nc0.w + 0.050626148*nd0.w + 0.34474713*ne0.w + 0.07935911*nf0.w + 0.13129725*ng0.w + -0.070588715*nh0.w + 0.049329277*ni0.w; + u = 0.1404405*na1.x + -0.05290101*nb1.x + -0.18832147*nc1.x + 0.017660763*nd1.x + -0.44914606*ne1.x + -0.093574174*nf1.x + -0.074316286*ng1.x + -0.09848133*nh1.x + 0.10140716*ni1.x; + v = -0.039871864*na1.y + 0.060526196*nb1.y + 0.06688931*nc1.y + 0.18316075*nd1.y + 0.004202756*ne1.y + 0.32342157*nf1.y + 0.20690823*ng1.y + -0.3151704*nh1.y + 0.21967977*ni1.y; + w = 0.24020113*na1.z + 0.37890625*nb1.z + 0.20994367*nc1.z + 0.13750695*nd1.z + -0.2828177*ne1.z + -0.18408743*nf1.z + -0.09146642*ng1.z + -0.04093093*nh1.z + -0.01256826*ni1.z; + x = -0.023923807*na1.w + 0.11991365*nb1.w + 0.04768579*nc1.w + -0.37403065*nd1.w + -0.1640075*ne1.w + -0.095789246*nf1.w + 0.07672462*ng1.w + -0.04442829*nh1.w + -0.050591458*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0054605072; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN20 +//!BIND LUMAN21 +//!SAVE LUMAN30 + +#define L0_tex LUMAN20_tex +#define L1_tex LUMAN21_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.10495947*a0.x + -0.03537041*b0.x + -0.10991186*c0.x + 0.25251657*d0.x + 0.013626215*e0.x + -0.058395956*f0.x + -0.0008518597*g0.x + -0.014936195*h0.x + 0.019276572*i0.x; + float j = -0.02682906*a0.y + -0.21245436*b0.y + -0.0033354003*c0.y + 0.006015402*d0.y + -0.16739099*e0.y + -0.15625198*f0.y + 0.0150447*g0.y + -0.015820103*h0.y + 0.012379691*i0.y; + float k = -0.0013036287*a0.z + 0.008318171*b0.z + 0.030156238*c0.z + -0.04434512*d0.z + -0.07113499*e0.z + 0.08979989*f0.z + 0.07051442*g0.z + 0.17790104*h0.z + 0.06543697*i0.z; + float l = 0.05744523*a0.w + 0.046723574*b0.w + -0.05827923*c0.w + 0.053087477*d0.w + 0.13964976*e0.w + 0.03684414*f0.w + -0.06794282*g0.w + -0.016245833*h0.w + -0.059672065*i0.w; + float m = 0.038995396*a1.x + -0.038216475*b1.x + -0.022593262*c1.x + 0.043936342*d1.x + -0.21404716*e1.x + 0.025221398*f1.x + -0.023893652*g1.x + -0.01713915*h1.x + 0.017736023*i1.x; + float n = -0.13781334*a1.y + -0.20996156*b1.y + -0.0855945*c1.y + -0.059780546*d1.y + -0.109258644*e1.y + -0.23170298*f1.y + -0.019512651*g1.y + -0.063233405*h1.y + -0.11784715*i1.y; + float o = -0.049934313*a1.z + 0.110902704*b1.z + 0.01558279*c1.z + -0.049464624*d1.z + -0.071157925*e1.z + -0.01660195*f1.z + 0.03621618*g1.z + -0.17185134*h1.z + -0.03749148*i1.z; + float p = -0.044992216*a1.w + -0.029741274*b1.w + -0.09576101*c1.w + 0.009392959*d1.w + 0.00061923254*e1.w + -0.049683083*f1.w + 0.09854748*g1.w + 0.11209177*h1.w + 0.015629178*i1.w; + float q = -0.023147024*na0.x + 0.028076923*nb0.x + -0.05377833*nc0.x + 0.41326755*nd0.x + 0.5016342*ne0.x + 0.102404684*nf0.x + 0.30781993*ng0.x + 0.04892017*nh0.x + -0.095621556*ni0.x; + float r = -0.02866961*na0.y + 0.13125686*nb0.y + 0.009609672*nc0.y + -0.048800323*nd0.y + -0.24172029*ne0.y + 0.07588628*nf0.y + -0.058860697*ng0.y + -0.20078272*nh0.y + -0.005210194*ni0.y; + float s = -0.061130345*na0.z + 0.06554706*nb0.z + 0.026878184*nc0.z + 0.09191935*nd0.z + -0.18614642*ne0.z + -0.1272964*nf0.z + -0.051245384*ng0.z + -0.06212816*nh0.z + 0.020784322*ni0.z; + float t = 0.0021429516*na0.w + -0.0141859185*nb0.w + -0.010014355*nc0.w + 0.0075964513*nd0.w + -0.16495723*ne0.w + -0.12892577*nf0.w + 0.035710387*ng0.w + -0.055349573*nh0.w + 0.018455528*ni0.w; + float u = -0.1827063*na1.x + -0.087003306*nb1.x + -0.013586943*nc1.x + -0.10099142*nd1.x + -0.04407746*ne1.x + -0.14055519*nf1.x + -0.055341262*ng1.x + -0.22188987*nh1.x + -0.00424361*ni1.x; + float v = 0.16635212*na1.y + 0.10692179*nb1.y + 0.089410685*nc1.y + 0.038306225*nd1.y + 0.011428505*ne1.y + 0.06011443*nf1.y + -0.16809247*ng1.y + 0.22273114*nh1.y + 0.04767407*ni1.y; + float w = 0.08062917*na1.z + 0.0023691454*nb1.z + 0.04098239*nc1.z + 0.36116946*nd1.z + 0.010449896*ne1.z + -0.047237948*nf1.z + -0.25944754*ng1.z + 0.2506446*nh1.z + 0.06529679*ni1.z; + float x = 0.053499896*na1.w + 0.010498035*nb1.w + 0.091785476*nc1.w + 0.04551249*nd1.w + -0.10188583*ne1.w + 0.09607795*nf1.w + 0.063433304*ng1.w + -0.12168427*nh1.w + -0.024411602*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0082672285; + i = 0.04420035*a0.x + 0.018893836*b0.x + -0.013619452*c0.x + -0.24012345*d0.x + -0.27375877*e0.x + -0.038554166*f0.x + 0.09097225*g0.x + 0.07965527*h0.x + -0.048234686*i0.x; + j = -0.07595159*a0.y + 0.054129757*b0.y + 0.043301415*c0.y + 0.056345753*d0.y + -0.14225017*e0.y + -0.067605354*f0.y + 0.06621613*g0.y + 0.09139841*h0.y + -0.062457714*i0.y; + k = -0.016594049*a0.z + -0.030780058*b0.z + -0.098458335*c0.z + -0.24517989*d0.z + 0.04580243*e0.z + -0.03836348*f0.z + -0.02720263*g0.z + -0.010154304*h0.z + -0.06432893*i0.z; + l = 0.039587986*a0.w + 0.11270057*b0.w + -0.050399054*c0.w + 0.15591136*d0.w + -0.108235896*e0.w + 0.014952577*f0.w + 0.22324464*g0.w + -0.040208988*h0.w + -0.07127248*i0.w; + m = 0.0336196*a1.x + -0.02421821*b1.x + -0.045471463*c1.x + -0.07179168*d1.x + 0.030665457*e1.x + -0.033806127*f1.x + 0.00729746*g1.x + -0.045769934*h1.x + 0.017483594*i1.x; + n = -0.033376135*a1.y + 0.08135445*b1.y + 0.018873708*c1.y + 0.11349483*d1.y + -0.027417801*e1.y + -0.09590671*f1.y + -0.17795533*g1.y + 0.17250298*h1.y + -0.14320396*i1.y; + o = -0.035711*a1.z + 0.029188631*b1.z + 0.0815523*c1.z + -0.16461325*d1.z + 0.18918027*e1.z + 0.0033511773*f1.z + 0.109288804*g1.z + 0.08115647*h1.z + 0.093553044*i1.z; + p = -0.07392052*a1.w + 0.05746653*b1.w + 0.037391104*c1.w + -0.0058278493*d1.w + 0.10739208*e1.w + -0.009279468*f1.w + -0.07919596*g1.w + 0.012846508*h1.w + -0.006493424*i1.w; + q = 0.14004427*na0.x + 0.04834755*nb0.x + 0.03813113*nc0.x + 0.18179546*nd0.x + 0.12059466*ne0.x + 0.1562862*nf0.x + 0.117933735*ng0.x + -0.041356713*nh0.x + 0.004850639*ni0.x; + r = 0.0897286*na0.y + 0.028496258*nb0.y + 0.013498651*nc0.y + -0.12374841*nd0.y + 0.41279215*ne0.y + 0.22727947*nf0.y + 0.061800964*ng0.y + -0.16176465*nh0.y + 0.077431016*ni0.y; + s = -0.17179112*na0.z + 0.10911651*nb0.z + -0.009969072*nc0.z + 0.06344676*nd0.z + -0.03751725*ne0.z + 0.13070048*nf0.z + -0.1389857*ng0.z + 0.047986243*nh0.z + 0.013180362*ni0.z; + t = -0.010965876*na0.w + -0.041684385*nb0.w + 0.008301607*nc0.w + -0.167301*nd0.w + 0.08283813*ne0.w + -0.0071550948*nf0.w + -0.06452635*ng0.w + 0.1032137*nh0.w + 0.031217664*ni0.w; + u = -0.11137781*na1.x + 0.03437329*nb1.x + -0.009390753*nc1.x + -0.10965495*nd1.x + -0.021066867*ne1.x + 0.065845564*nf1.x + -0.03633728*ng1.x + -0.012213326*nh1.x + -0.0014274631*ni1.x; + v = 0.065072246*na1.y + 0.023515902*nb1.y + 0.040873718*nc1.y + -0.2224784*nd1.y + 0.04724838*ne1.y + 0.07304937*nf1.y + 0.05813173*ng1.y + 0.028858649*nh1.y + 0.12516193*ni1.y; + w = 0.1324343*na1.z + -0.23523535*nb1.z + -0.038939327*nc1.z + 0.07158796*nd1.z + -0.1191352*ne1.z + -0.018787293*nf1.z + 0.12615351*ng1.z + 0.04812125*nh1.z + -0.13245015*ni1.z; + x = 0.060072*na1.w + -0.11062477*nb1.w + 0.031622723*nc1.w + -0.029927421*nd1.w + 0.17728531*ne1.w + 0.08034003*nf1.w + 0.007750797*ng1.w + -0.19105726*nh1.w + 0.08233319*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.004496528; + i = 0.07302485*a0.x + 0.3255973*b0.x + 0.15016317*c0.x + 0.118632555*d0.x + -0.17213899*e0.x + 0.1582742*f0.x + -0.06146779*g0.x + 0.16038014*h0.x + 0.03446602*i0.x; + j = 0.010767944*a0.y + -0.17074314*b0.y + -0.051532004*c0.y + -0.007004298*d0.y + 0.17263626*e0.y + 0.17654046*f0.y + -0.00854635*g0.y + 0.020359043*h0.y + 0.059243754*i0.y; + k = 0.012429514*a0.z + 0.137492*b0.z + 0.04819812*c0.z + 0.035178814*d0.z + -0.18009062*e0.z + -0.026474113*f0.z + 0.06052671*g0.z + -0.09139187*h0.z + 0.016754301*i0.z; + l = -0.020336514*a0.w + 0.12835233*b0.w + 0.05292645*c0.w + 0.027170286*d0.w + 0.21714908*e0.w + 0.20537919*f0.w + 0.06016602*g0.w + 0.08009548*h0.w + 0.054547563*i0.w; + m = 0.026176583*a1.x + 0.011795747*b1.x + -0.0414424*c1.x + -0.049600832*d1.x + -0.0832306*e1.x + -0.0549573*f1.x + 0.03924075*g1.x + -0.14165045*h1.x + -0.03587528*i1.x; + n = -0.0942382*a1.y + -0.0554067*b1.y + 0.026133277*c1.y + 0.061629396*d1.y + -0.07488993*e1.y + 0.32595944*f1.y + 0.00076820946*g1.y + 0.12769783*h1.y + 0.09029101*i1.y; + o = 0.06983503*a1.z + -0.032106537*b1.z + 0.099255025*c1.z + -0.06080937*d1.z + -0.14384937*e1.z + -0.22940788*f1.z + 0.04732333*g1.z + -0.06451785*h1.z + -0.03758684*i1.z; + p = 0.052208744*a1.w + -0.08988008*b1.w + 0.058199216*c1.w + -0.0020835826*d1.w + 0.06585372*e1.w + 0.053097535*f1.w + -0.058973607*g1.w + 0.03506455*h1.w + -0.04801262*i1.w; + q = -0.014868468*na0.x + 0.22615212*nb0.x + 0.073948465*nc0.x + -0.06781611*nd0.x + -0.10032018*ne0.x + -0.20862079*nf0.x + 0.06294624*ng0.x + -0.2255593*nh0.x + -0.07084244*ni0.x; + r = 0.057524882*na0.y + 0.30524227*nb0.y + 0.35815537*nc0.y + -0.0009502602*nd0.y + -0.089151636*ne0.y + -0.14037384*nf0.y + -0.034081057*ng0.y + 0.11372325*nh0.y + 0.10721567*ni0.y; + s = 0.057963226*na0.z + -0.10614639*nb0.z + 0.04840352*nc0.z + 0.015917875*nd0.z + 0.11659738*ne0.z + 0.11277482*nf0.z + -0.028128905*ng0.z + 0.12908414*nh0.z + -0.105552666*ni0.z; + t = 0.019451434*na0.w + -0.13708478*nb0.w + -0.049833942*nc0.w + -0.06012834*nd0.w + -0.112836376*ne0.w + -0.24934123*nf0.w + -0.045174573*ng0.w + 0.11306015*nh0.w + -0.05403323*ni0.w; + u = 0.0472547*na1.x + -0.023629531*nb1.x + 0.08101014*nc1.x + 0.0936124*nd1.x + -0.019263176*ne1.x + -0.018776532*nf1.x + -0.06877347*ng1.x + 0.13923196*nh1.x + 0.03186953*ni1.x; + v = -0.010185454*na1.y + 0.09941806*nb1.y + 0.0894505*nc1.y + -0.0026836023*nd1.y + 0.12091999*ne1.y + -0.00040105637*nf1.y + -0.012306723*ng1.y + -0.01695834*nh1.y + -0.060723636*ni1.y; + w = -0.11100347*na1.z + -0.061128043*nb1.z + -0.1416516*nc1.z + 0.07061777*nd1.z + 0.0318233*ne1.z + 0.14762254*nf1.z + 0.011475027*ng1.z + 0.10708941*nh1.z + 0.073588334*ni1.z; + x = -0.0032446082*na1.w + 0.018291878*nb1.w + -0.09359892*nc1.w + -0.017735833*nd1.w + -0.3877458*ne1.w + -0.27740228*nf1.w + 0.07144769*ng1.w + -0.1594686*nh1.w + -0.042618934*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.016106425; + i = 0.035688583*a0.x + 0.032622155*b0.x + -0.07878022*c0.x + -0.22056721*d0.x + 0.36388257*e0.x + 0.09935813*f0.x + -0.077380866*g0.x + -0.016323987*h0.x + 0.025766185*i0.x; + j = 0.032614443*a0.y + 0.0075333*b0.y + -0.08914437*c0.y + -0.11388316*d0.y + -0.32016122*e0.y + -0.049377266*f0.y + 0.051589742*g0.y + 0.053202707*h0.y + -0.028994467*i0.y; + k = 0.07181132*a0.z + 0.123275116*b0.z + -0.015218611*c0.z + -0.021832455*d0.z + 0.20298561*e0.z + -0.18469056*f0.z + 0.010181586*g0.z + 0.026014574*h0.z + 0.022069149*i0.z; + l = 0.11116511*a0.w + 0.19239828*b0.w + 0.00020110002*c0.w + 0.3092214*d0.w + 0.25210956*e0.w + 0.029646616*f0.w + 0.13460134*g0.w + 0.22553803*h0.w + 0.2627162*i0.w; + m = 0.20240203*a1.x + 0.04904199*b1.x + 0.087184764*c1.x + 0.2124653*d1.x + -0.31427193*e1.x + -0.104574054*f1.x + 0.044442028*g1.x + 0.07160614*h1.x + 0.0069251317*i1.x; + n = -0.15117155*a1.y + -0.24588604*b1.y + -0.16807069*c1.y + -0.11873434*d1.y + -0.6071346*e1.y + 0.11526665*f1.y + -0.30017737*g1.y + 0.061571214*h1.y + 0.0368654*i1.y; + o = -0.022352027*a1.z + -0.030253926*b1.z + 0.106674075*c1.z + -0.031035127*d1.z + 0.23091488*e1.z + 0.08884981*f1.z + 0.09103071*g1.z + -0.08590288*h1.z + -0.060364954*i1.z; + p = -0.054246917*a1.w + -0.03801203*b1.w + -0.062851064*c1.w + -0.073276244*d1.w + -0.05854327*e1.w + -0.095565595*f1.w + -0.11843872*g1.w + -0.06481578*h1.w + -0.07193746*i1.w; + q = 0.07197522*na0.x + 0.18386847*nb0.x + 0.23272155*nc0.x + 0.16188829*nd0.x + -0.025466003*ne0.x + -0.04826338*nf0.x + 0.016412303*ng0.x + 0.072044484*nh0.x + 0.009424055*ni0.x; + r = -0.014057901*na0.y + -0.0678097*nb0.y + 0.065728344*nc0.y + 0.082456514*nd0.y + 0.24829388*ne0.y + -0.31393299*nf0.y + -0.023987576*ng0.y + -0.08345598*nh0.y + -0.0010536936*ni0.y; + s = -0.027450949*na0.z + -0.035480395*nb0.z + -0.068690196*nc0.z + 0.02964989*nd0.z + -0.27646825*ne0.z + -0.22154613*nf0.z + 0.028639298*ng0.z + -0.14063624*nh0.z + 0.08924814*ni0.z; + t = 0.018802406*na0.w + 0.011309935*nb0.w + -0.052953072*nc0.w + -0.07039529*nd0.w + 0.04814527*ne0.w + -0.007535829*nf0.w + 0.064747065*ng0.w + -0.14107801*nh0.w + -0.10131967*ni0.w; + u = -0.07231724*na1.x + 0.015407522*nb1.x + -0.052383028*nc1.x + -0.17859146*nd1.x + 0.28211778*ne1.x + -0.009197533*nf1.x + -0.045684036*ng1.x + -0.06056637*nh1.x + -0.0035418952*ni1.x; + v = 0.10038491*na1.y + 0.17251195*nb1.y + 0.09409685*nc1.y + 0.07996458*nd1.y + 0.13919151*ne1.y + 0.110783696*nf1.y + 0.009992888*ng1.y + 0.012707362*nh1.y + 0.1887242*ni1.y; + w = -0.004788721*na1.z + 0.028190559*nb1.z + -0.08321803*nc1.z + 0.29351994*nd1.z + -0.24649957*ne1.z + -0.25687915*nf1.z + -0.07823761*ng1.z + 0.18122914*nh1.z + 0.016037595*ni1.z; + x = -0.008824334*na1.w + -0.11209885*nb1.w + -0.032978315*nc1.w + -0.069099665*nd1.w + -0.061004076*ne1.w + -0.2446395*nf1.w + 0.09238701*ng1.w + -0.11517327*nh1.w + -0.07248953*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.01728668; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN20 +//!BIND LUMAN21 +//!SAVE LUMAN31 + +#define L0_tex LUMAN20_tex +#define L1_tex LUMAN21_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.07941704*a0.x + -0.050842553*b0.x + 0.01092942*c0.x + -0.07148679*d0.x + -0.06512474*e0.x + -0.22956467*f0.x + -0.024606694*g0.x + -0.09724198*h0.x + -0.09039128*i0.x; + float j = 0.027611736*a0.y + 0.060809463*b0.y + 0.0667335*c0.y + 0.037682217*d0.y + 0.06852659*e0.y + 0.5153305*f0.y + 0.016338438*g0.y + 0.002601195*h0.y + 0.11281981*i0.y; + float k = -0.060290866*a0.z + -0.011722135*b0.z + 0.085060075*c0.z + -0.08798*d0.z + -0.021146037*e0.z + 0.17453888*f0.z + 0.0018846161*g0.z + -0.024184274*h0.z + 0.037061296*i0.z; + float l = 0.023022855*a0.w + -0.06370005*b0.w + 0.043632*c0.w + -0.0031560452*d0.w + -0.4032132*e0.w + -0.08846532*f0.w + 0.10578794*g0.w + 0.065337054*h0.w + -0.09185561*i0.w; + float m = -0.07253925*a1.x + -0.08851836*b1.x + 0.062056795*c1.x + 0.032718055*d1.x + -0.4019351*e1.x + 0.009619835*f1.x + 0.0015480773*g1.x + -0.06635443*h1.x + -0.114055015*i1.x; + float n = -0.010111321*a1.y + 0.16795866*b1.y + 0.07786296*c1.y + 0.020181928*d1.y + 0.26352328*e1.y + 0.004966047*f1.y + -0.08452743*g1.y + -0.11825899*h1.y + 0.054564703*i1.y; + float o = 0.02549486*a1.z + 0.05948747*b1.z + -0.04825873*c1.z + -0.007742992*d1.z + 0.07948027*e1.z + -0.10099402*f1.z + -0.12409299*g1.z + 0.08199375*h1.z + -0.07701278*i1.z; + float p = -0.0010457158*a1.w + 0.14753313*b1.w + -0.036453757*c1.w + 0.014154197*d1.w + -0.13650024*e1.w + 0.2692273*f1.w + 0.0583396*g1.w + 0.034443617*h1.w + 0.051470105*i1.w; + float q = -0.01434574*na0.x + -0.07308625*nb0.x + -0.100208566*nc0.x + -0.07297119*nd0.x + -0.62616676*ne0.x + -0.011523209*nf0.x + -0.014466557*ng0.x + -0.085850835*nh0.x + -0.17460416*ni0.x; + float r = 0.00066524564*na0.y + 0.0482624*nb0.y + 0.1272653*nc0.y + -0.073000126*nd0.y + -0.10093872*ne0.y + -0.090638004*nf0.y + 0.09337763*ng0.y + -0.0027805113*nh0.y + 0.032939613*ni0.y; + float s = -0.058239613*na0.z + 0.0038146402*nb0.z + 0.17032205*nc0.z + 0.08319828*nd0.z + -0.41412708*ne0.z + 0.47307482*nf0.z + 0.010387847*ng0.z + 0.0633208*nh0.z + -0.0105386665*ni0.z; + float t = -0.13282509*na0.w + 0.017102268*nb0.w + -0.006839047*nc0.w + -0.043928336*nd0.w + 0.2989465*ne0.w + 0.013503525*nf0.w + -0.011740496*ng0.w + -0.009853105*nh0.w + 0.13738577*ni0.w; + float u = -0.027205449*na1.x + 0.03722104*nb1.x + -0.065805*nc1.x + -0.0850838*nd1.x + 0.015198619*ne1.x + -0.024742754*nf1.x + -0.061739046*ng1.x + -0.07436123*nh1.x + 0.15313913*ni1.x; + float v = -0.00018431511*na1.y + -0.03285911*nb1.y + 0.08875587*nc1.y + 0.027293593*nd1.y + -0.21097568*ne1.y + -0.043539245*nf1.y + -0.0657312*ng1.y + 0.13540883*nh1.y + 0.011748581*ni1.y; + float w = -0.012003101*na1.z + -0.10176224*nb1.z + -0.060972966*nc1.z + 0.047351442*nd1.z + -0.056035142*ne1.z + 0.3156803*nf1.z + 0.17128298*ng1.z + 0.08773884*nh1.z + 0.31448507*ni1.z; + float x = -0.08746548*na1.w + 0.058036875*nb1.w + 0.07244209*nc1.w + 0.05094744*nd1.w + 0.19715828*ne1.w + 0.052874785*nf1.w + -0.0031921165*ng1.w + -0.09948083*nh1.w + -0.099991955*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.00768615; + i = -0.2584226*a0.x + 0.049625244*b0.x + 0.085008234*c0.x + -0.25260374*d0.x + -0.20725876*e0.x + -0.052256707*f0.x + -0.24630953*g0.x + 0.020792667*h0.x + -0.12987958*i0.x; + j = 0.11674078*a0.y + -0.05069138*b0.y + -0.054932218*c0.y + -0.002327029*d0.y + -0.3744174*e0.y + -0.06068667*f0.y + 0.0052237557*g0.y + -0.081293285*h0.y + -0.25822634*i0.y; + k = 0.22486423*a0.z + 0.13474905*b0.z + 0.17571972*c0.z + 0.23275833*d0.z + -0.14145213*e0.z + 0.17688423*f0.z + 0.09584457*g0.z + 0.13348572*h0.z + -0.037102394*i0.z; + l = 0.02187451*a0.w + 0.11284924*b0.w + 0.030247845*c0.w + 0.29230177*d0.w + 0.24179323*e0.w + 0.15396708*f0.w + 0.18624204*g0.w + 0.36116585*h0.w + 0.15303242*i0.w; + m = 0.23878942*a1.x + 0.1077676*b1.x + -0.08214348*c1.x + 0.13583168*d1.x + 0.11975287*e1.x + -0.050753787*f1.x + -0.08751185*g1.x + 0.108354725*h1.x + 0.09259918*i1.x; + n = -0.16052248*a1.y + 0.043467432*b1.y + 0.11113435*c1.y + -0.23582667*d1.y + 0.31877246*e1.y + 0.04129961*f1.y + -0.09102526*g1.y + 0.060114477*h1.y + 0.07789096*i1.y; + o = -0.025753384*a1.z + -0.0535386*b1.z + -0.024348794*c1.z + -0.2092495*d1.z + 0.11210719*e1.z + 0.21575865*f1.z + -0.06333121*g1.z + 0.004394454*h1.z + -0.03849619*i1.z; + p = -0.0936154*a1.w + 0.073645994*b1.w + -0.070233256*c1.w + -0.11690011*d1.w + -0.12087031*e1.w + -0.035496015*f1.w + -0.054435793*g1.w + -0.18953127*h1.w + -0.12531057*i1.w; + q = 0.18474342*na0.x + 0.049027357*nb0.x + -0.026551004*nc0.x + 0.34006017*nd0.x + -0.06909763*ne0.x + 0.016170332*nf0.x + 0.05132557*ng0.x + 0.04963594*nh0.x + -0.06614966*ni0.x; + r = 0.015981808*na0.y + 0.11978708*nb0.y + 0.0003225886*nc0.y + 0.13874708*nd0.y + 0.24115108*ne0.y + -0.09863037*nf0.y + 0.17281389*ng0.y + -0.0050876113*nh0.y + -0.013940462*ni0.y; + s = -0.065658085*na0.z + 0.09520752*nb0.z + 0.059236676*nc0.z + -0.10476223*nd0.z + -0.21604007*ne0.z + 0.16991691*nf0.z + 0.020778336*ng0.z + -0.06487427*nh0.z + 0.04760285*ni0.z; + t = 0.03405014*na0.w + -0.008665183*nb0.w + -0.08413498*nc0.w + -0.1115953*nd0.w + 0.067205414*ne0.w + -0.1394608*nf0.w + -0.07059417*ng0.w + 0.09220727*nh0.w + -0.05677373*ni0.w; + u = 0.10527668*na1.x + 0.23578717*nb1.x + 0.13868308*nc1.x + 0.0013714005*nd1.x + -0.17564678*ne1.x + 0.17813891*nf1.x + -0.0557956*ng1.x + -0.088410884*nh1.x + -0.038198613*ni1.x; + v = 0.07981938*na1.y + -0.14220296*nb1.y + 0.08475657*nc1.y + 0.06395585*nd1.y + -0.03096132*ne1.y + 0.17134686*nf1.y + 0.121079914*ng1.y + 0.002460959*nh1.y + -0.20324089*ni1.y; + w = 0.036307156*na1.z + -0.018204955*nb1.z + -0.03135114*nc1.z + 0.15029632*nd1.z + 0.04616049*ne1.z + -0.2557983*nf1.z + 0.045661557*ng1.z + -0.07640636*nh1.z + 0.04804881*ni1.z; + x = 0.07813257*na1.w + -0.023829287*nb1.w + -0.13715439*nc1.w + 0.087288216*nd1.w + -0.17041437*ne1.w + 0.10756241*nf1.w + 0.0173771*ng1.w + -0.113619484*nh1.w + 0.016020184*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.003316083; + i = -0.028736124*a0.x + -0.08003967*b0.x + 0.09763381*c0.x + -0.00846156*d0.x + -0.18583794*e0.x + -0.049422342*f0.x + -0.07666734*g0.x + -0.02733043*h0.x + 0.040038377*i0.x; + j = 0.018239625*a0.y + 0.19185518*b0.y + 0.13775997*c0.y + -0.0896574*d0.y + -0.32224402*e0.y + -0.005808667*f0.y + -0.042873193*g0.y + 0.102946535*h0.y + 0.16040611*i0.y; + k = 0.07604001*a0.z + 0.06753936*b0.z + -0.0062585506*c0.z + -0.077893704*d0.z + 0.021712523*e0.z + -0.0944168*f0.z + 0.0049426183*g0.z + -0.057945896*h0.z + 0.0832966*i0.z; + l = 0.20802133*a0.w + -0.23534459*b0.w + 0.027663095*c0.w + 0.10619838*d0.w + -0.2881961*e0.w + 0.03611936*f0.w + 0.12809974*g0.w + 0.025251053*h0.w + -0.018410701*i0.w; + m = -0.026915021*a1.x + 0.11605544*b1.x + 0.0969195*c1.x + -0.05159316*d1.x + -0.29639572*e1.x + 0.060887333*f1.x + -0.077562116*g1.x + -0.023696246*h1.x + -0.07765453*i1.x; + n = -0.04823381*a1.y + -0.3185404*b1.y + -0.24473429*c1.y + -0.4789328*d1.y + -0.35767055*e1.y + 0.4142013*f1.y + -0.20269759*g1.y + 0.3929618*h1.y + -0.018045327*i1.y; + o = -0.13663228*a1.z + 0.025303073*b1.z + -0.06823502*c1.z + -0.08741995*d1.z + 0.3769405*e1.z + -0.19950937*f1.z + -0.021235209*g1.z + 0.16786906*h1.z + 0.11909075*i1.z; + p = -0.13527294*a1.w + -0.06680806*b1.w + -0.15427993*c1.w + 0.036378223*d1.w + -0.3359488*e1.w + -0.059891827*f1.w + 0.017971888*g1.w + -0.053049818*h1.w + -0.072594084*i1.w; + q = 0.051277246*na0.x + 0.16183147*nb0.x + 0.16584247*nc0.x + -0.09765534*nd0.x + -0.20131728*ne0.x + -0.032204267*nf0.x + -0.20159227*ng0.x + -0.07981351*nh0.x + 0.09944889*ni0.x; + r = -0.13917594*na0.y + 0.06652356*nb0.y + -0.0883734*nc0.y + -0.024413928*nd0.y + -0.19586924*ne0.y + 0.17564073*nf0.y + 0.027439114*ng0.y + -0.03333901*nh0.y + 0.07641967*ni0.y; + s = -0.07586603*na0.z + -0.049416613*nb0.z + 0.24173866*nc0.z + 0.1326689*nd0.z + -0.4864198*ne0.z + 0.06878775*nf0.z + 0.04480557*ng0.z + -0.1025121*nh0.z + -0.27702534*ni0.z; + t = -0.027331017*na0.w + 0.12820075*nb0.w + 0.040788233*nc0.w + 0.061936054*nd0.w + -0.09631744*ne0.w + -0.025646532*nf0.w + 0.19220605*ng0.w + -0.11971887*nh0.w + 0.055378202*ni0.w; + u = 0.08820415*na1.x + 0.026093876*nb1.x + -0.04180729*nc1.x + -0.19694711*nd1.x + -0.108901724*ne1.x + 0.06905329*nf1.x + -0.103396684*ng1.x + -0.11677139*nh1.x + -0.10525223*ni1.x; + v = 0.10541181*na1.y + 0.102778554*nb1.y + 0.15439296*nc1.y + 0.051345453*nd1.y + -0.20767345*ne1.y + 0.1831073*nf1.y + -0.041579783*ng1.y + 0.04888303*nh1.y + -0.0063026203*ni1.y; + w = 0.42541298*na1.z + 0.18639457*nb1.z + -0.18841113*nc1.z + 0.10537636*nd1.z + -0.033187203*ne1.z + 0.1277658*nf1.z + 0.40115508*ng1.z + 0.12769128*nh1.z + 0.106948815*ni1.z; + x = -0.11754907*na1.w + 0.13961302*nb1.w + 0.043125894*nc1.w + 0.13606437*nd1.w + 0.29668897*ne1.w + -0.15002356*nf1.w + -0.0049111377*ng1.w + 0.09318963*nh1.w + 0.15725283*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0035607726; + i = -0.0007657082*a0.x + 0.18896873*b0.x + 0.11515918*c0.x + -0.08670543*d0.x + -0.17096084*e0.x + 0.038672194*f0.x + -0.006407333*g0.x + -0.12406157*h0.x + 0.074486144*i0.x; + j = -0.018961241*a0.y + -0.0661694*b0.y + 0.12120849*c0.y + 0.0499541*d0.y + -0.025950044*e0.y + 0.13302167*f0.y + -0.0045417123*g0.y + 0.091498435*h0.y + 0.25304177*i0.y; + k = 0.02082855*a0.z + 0.122300126*b0.z + -0.0017944642*c0.z + 0.06828385*d0.z + 0.17769805*e0.z + 0.005459296*f0.z + 3.786597e-05*g0.z + 0.1927736*h0.z + 0.15574773*i0.z; + l = 0.07262613*a0.w + -0.051484853*b0.w + 0.11589907*c0.w + 0.03128076*d0.w + -0.066505186*e0.w + 0.0819007*f0.w + -0.14619994*g0.w + 0.108773485*h0.w + -0.029004829*i0.w; + m = -0.0140467575*a1.x + 0.12702075*b1.x + 0.018607724*c1.x + -0.021833913*d1.x + -0.21427749*e1.x + -0.05479105*f1.x + -0.074576564*g1.x + -0.029219097*h1.x + 0.004721507*i1.x; + n = -0.017141543*a1.y + -0.1510377*b1.y + -0.010902904*c1.y + -0.15604293*d1.y + 0.1410916*e1.y + 0.35071704*f1.y + 0.14407732*g1.y + 0.11913299*h1.y + 0.15659198*i1.y; + o = -0.031506337*a1.z + 0.0034794312*b1.z + -0.010843625*c1.z + -0.068582706*d1.z + 0.2035301*e1.z + -0.2578952*f1.z + -0.0045797243*g1.z + 0.0510916*h1.z + -0.04096347*i1.z; + p = 0.0132341655*a1.w + -0.09561104*b1.w + 0.03996762*c1.w + 0.07062096*d1.w + 0.064072214*e1.w + -0.030976873*f1.w + 3.0964125e-05*g1.w + 0.09990824*h1.w + 0.057406235*i1.w; + q = 0.029551128*na0.x + 0.14557356*nb0.x + 0.08588128*nc0.x + 0.22651055*nd0.x + -0.35015303*ne0.x + -0.014872635*nf0.x + 0.019119492*ng0.x + -0.13659622*nh0.x + -0.029656924*ni0.x; + r = 0.03831925*na0.y + 0.19166094*nb0.y + -0.14751142*nc0.y + 0.10880705*nd0.y + -0.058297906*ne0.y + -0.33643624*nf0.y + -0.10262261*ng0.y + 0.024292309*nh0.y + -0.061532244*ni0.y; + s = 0.028195743*na0.z + -0.08969857*nb0.z + 0.020221138*nc0.z + -0.038737748*nd0.z + -0.036892556*ne0.z + -0.12940665*nf0.z + -0.06352916*ng0.z + -0.014914517*nh0.z + -0.13324068*ni0.z; + t = -0.023716316*na0.w + 0.015531115*nb0.w + -0.08457603*nc0.w + 0.009459709*nd0.w + 0.16085471*ne0.w + -0.061606925*nf0.w + -0.032667276*ng0.w + -0.05158212*nh0.w + -0.03426355*ni0.w; + u = 0.024232633*na1.x + -0.070986755*nb1.x + -0.0058888225*nc1.x + 0.07083461*nd1.x + 0.13945094*ne1.x + -0.11468432*nf1.x + -0.023783585*ng1.x + -0.08165796*nh1.x + -0.12259042*ni1.x; + v = 0.0030000864*na1.y + 0.0041845613*nb1.y + 0.00797792*nc1.y + -0.010358695*nd1.y + 0.039620068*ne1.y + 0.003697568*nf1.y + -0.034909796*ng1.y + 0.046191987*nh1.y + 0.043660384*ni1.y; + w = 0.03257494*na1.z + 0.058587745*nb1.z + -0.04471518*nc1.z + -0.10175396*nd1.z + 0.029540528*ne1.z + 0.12884614*nf1.z + -0.19663431*ng1.z + -0.009101876*nh1.z + 0.14205857*ni1.z; + x = -0.0063677295*na1.w + 0.064730145*nb1.w + -0.11158172*nc1.w + -0.008992963*nd1.w + 0.06534912*ne1.w + -0.14108323*nf1.w + 0.0464611*ng1.w + 0.02179613*nh1.w + -0.003715472*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.012906831; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN30 +//!BIND LUMAN31 +//!SAVE LUMAN40 + +#define L0_tex LUMAN30_tex +#define L1_tex LUMAN31_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.08656171*a0.x + 0.21290569*b0.x + -0.004001642*c0.x + 0.03927889*d0.x + -0.079883896*e0.x + 0.096595794*f0.x + -0.03477963*g0.x + 0.04326191*h0.x + 0.07472603*i0.x; + float j = -0.026371144*a0.y + -0.10890013*b0.y + -0.074713044*c0.y + -0.03986311*d0.y + -0.06510753*e0.y + -0.046004105*f0.y + -0.0076048975*g0.y + -0.063950986*h0.y + -0.018643167*i0.y; + float k = 0.03444205*a0.z + -0.052693386*b0.z + 0.0024046462*c0.z + -0.06357705*d0.z + -0.100524455*e0.z + 0.034741692*f0.z + 0.0119595*g0.z + -0.02717993*h0.z + 0.050470024*i0.z; + float l = -0.022481086*a0.w + -0.074111626*b0.w + -0.06492289*c0.w + 0.0215112*d0.w + -0.2213038*e0.w + 0.0204108*f0.w + -0.0067506693*g0.w + -0.062500216*h0.w + -0.062180262*i0.w; + float m = 0.03696488*a1.x + 0.04108178*b1.x + -0.011093009*c1.x + 0.2494327*d1.x + -0.031587277*e1.x + 0.02254383*f1.x + 0.04281861*g1.x + 0.019687284*h1.x + -0.063386016*i1.x; + float n = -0.01412882*a1.y + -0.034890138*b1.y + 0.0143132545*c1.y + 0.049496226*d1.y + -0.10116899*e1.y + -0.03730606*f1.y + -0.007983867*g1.y + -0.05111721*h1.y + 0.012292823*i1.y; + float o = 0.10091559*a1.z + 0.1054921*b1.z + -0.07666608*c1.z + 0.010558074*d1.z + -0.016222922*e1.z + -0.030339802*f1.z + -0.024651198*g1.z + 0.11539425*h1.z + -0.008982327*i1.z; + float p = 0.08782505*a1.w + -0.0039771134*b1.w + 0.106606014*c1.w + 0.07876641*d1.w + -0.07574561*e1.w + -0.03822405*f1.w + 0.09565453*g1.w + 0.057285316*h1.w + 0.07650349*i1.w; + float q = -0.005750001*na0.x + -0.031764384*nb0.x + 0.030848796*nc0.x + 0.032382507*nd0.x + -0.084400214*ne0.x + -0.16719313*nf0.x + -0.003563804*ng0.x + -0.08467185*nh0.x + -0.013666626*ni0.x; + float r = 0.012016638*na0.y + 0.14458697*nb0.y + 0.006680341*nc0.y + -0.025037276*nd0.y + 0.17308724*ne0.y + -0.018338397*nf0.y + 8.713182e-06*ng0.y + 0.08174603*nh0.y + -0.053476475*ni0.y; + float s = -0.014294115*na0.z + 0.025022032*nb0.z + -0.018170934*nc0.z + 0.037305776*nd0.z + -0.1749532*ne0.z + -0.0077695046*nf0.z + 0.026932228*ng0.z + -0.08316069*nh0.z + 0.053805698*ni0.z; + float t = -0.012198974*na0.w + 0.14582784*nb0.w + 0.07482499*nc0.w + -0.051537655*nd0.w + 0.08446009*ne0.w + -0.0373948*nf0.w + -0.023523446*ng0.w + -0.026085692*nh0.w + 0.011028385*ni0.w; + float u = 0.087766856*na1.x + 0.034175277*nb1.x + 0.03152634*nc1.x + -0.101653695*nd1.x + 0.03928409*ne1.x + -0.06981694*nf1.x + 0.03964823*ng1.x + 0.006642139*nh1.x + 0.017051173*ni1.x; + float v = 0.08698132*na1.y + 0.0438875*nb1.y + 0.0451187*nc1.y + -0.10329641*nd1.y + 0.02733591*ne1.y + 0.006656351*nf1.y + -0.011088956*ng1.y + -0.0047664074*nh1.y + 0.11088423*ni1.y; + float w = -0.03557234*na1.z + -0.040018145*nb1.z + 0.031464696*nc1.z + -0.0041148905*nd1.z + -0.07126713*ne1.z + 0.057261378*nf1.z + -0.003973193*ng1.z + -0.016189586*nh1.z + 0.009429872*ni1.z; + float x = 0.08568026*na1.w + -0.0058499873*nb1.w + -0.044522725*nc1.w + 0.055148397*nd1.w + 0.015802909*ne1.w + 0.04047864*nf1.w + 0.13689119*ng1.w + 0.11317675*nh1.w + -0.045768175*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0064203455; + i = -0.032505844*a0.x + -0.06661497*b0.x + 0.023512855*c0.x + 0.0038409652*d0.x + -0.23903687*e0.x + -0.16547106*f0.x + 0.07911498*g0.x + 0.03786903*h0.x + 0.17299125*i0.x; + j = 0.040522475*a0.y + -0.03672423*b0.y + -0.08684519*c0.y + -4.828527e-06*d0.y + -0.0288446*e0.y + -0.11859806*f0.y + 0.022469537*g0.y + -0.10261296*h0.y + -0.081498824*i0.y; + k = 0.09966686*a0.z + -0.028391572*b0.z + -0.06806597*c0.z + 0.12051737*d0.z + -0.08948898*e0.z + 0.0077337893*f0.z + 0.04264053*g0.z + 0.24295592*h0.z + 0.07553067*i0.z; + l = -0.014257156*a0.w + -0.08241062*b0.w + 0.044526782*c0.w + -0.013082403*d0.w + 0.13204414*e0.w + -0.27255267*f0.w + -0.11447851*g0.w + -0.097617336*h0.w + 0.011688421*i0.w; + m = -0.14570348*a1.x + -0.06814128*b1.x + 0.05697731*c1.x + -0.05217858*d1.x + 0.1640323*e1.x + -0.09593827*f1.x + -0.12755282*g1.x + -0.086524084*h1.x + 0.008667198*i1.x; + n = -0.068069056*a1.y + -0.081919774*b1.y + 0.04359047*c1.y + -0.09954159*d1.y + -0.019505976*e1.y + -0.027422508*f1.y + 0.03656061*g1.y + 0.11309899*h1.y + 0.06715181*i1.y; + o = -0.11340588*a1.z + -0.051423706*b1.z + -0.19613335*c1.z + -0.13584042*d1.z + -0.023867423*e1.z + -0.2166873*f1.z + -0.12436677*g1.z + -0.3056145*h1.z + -0.07004896*i1.z; + p = 0.07956318*a1.w + 0.07576396*b1.w + 0.17090248*c1.w + 0.1677179*d1.w + 0.20357732*e1.w + 0.14348814*f1.w + 0.03334289*g1.w + 0.09176273*h1.w + -0.017910657*i1.w; + q = 0.026086422*na0.x + 0.097765036*nb0.x + 0.10587866*nc0.x + 0.01978553*nd0.x + 0.09502771*ne0.x + -0.012682824*nf0.x + -0.040875986*ng0.x + -0.0034920182*nh0.x + -0.19141385*ni0.x; + r = 0.04607431*na0.y + -0.009378766*nb0.y + 0.0012423345*nc0.y + -0.13031623*nd0.y + 0.040903624*ne0.y + 0.12283624*nf0.y + -0.09508061*ng0.y + -0.13311584*nh0.y + -0.16675362*ni0.y; + s = -0.063626915*na0.z + -0.10388871*nb0.z + -0.011007665*nc0.z + -0.027193287*nd0.z + 0.11276182*ne0.z + 0.076111704*nf0.z + -0.08517991*ng0.z + -0.21885648*nh0.z + 0.18072192*ni0.z; + t = -0.07872067*na0.w + 0.103839375*nb0.w + -0.08590919*nc0.w + 0.12628321*nd0.w + -0.17647605*ne0.w + -0.010150693*nf0.w + 0.1574605*ng0.w + 0.018935064*nh0.w + 0.046108305*ni0.w; + u = 0.11362486*na1.x + -0.020307075*nb1.x + -0.08245713*nc1.x + 0.091107495*nd1.x + 0.050005887*ne1.x + 0.042820398*nf1.x + 0.1548857*ng1.x + 0.009557177*nh1.x + -0.05151787*ni1.x; + v = -0.0028884336*na1.y + 0.15852699*nb1.y + -0.061137117*nc1.y + -0.023769902*nd1.y + -0.08125711*ne1.y + -0.14575318*nf1.y + -0.04427445*ng1.y + -0.03595139*nh1.y + -0.09431575*ni1.y; + w = -0.09712683*na1.z + -0.08819136*nb1.z + 0.08729634*nc1.z + -0.09290895*nd1.z + -0.010472437*ne1.z + 0.04311587*nf1.z + -0.049348596*ng1.z + 0.12841254*nh1.z + -0.013184504*ni1.z; + x = 0.2775273*na1.w + -0.07508342*nb1.w + -0.13421123*nc1.w + 0.048939656*nd1.w + -0.17091548*ne1.w + -0.097308844*nf1.w + -0.19330767*ng1.w + 0.072174154*nh1.w + 0.119323336*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.010473969; + i = -0.04255606*a0.x + 0.19455163*b0.x + -0.083725154*c0.x + 0.025356045*d0.x + -0.09469336*e0.x + 0.011819241*f0.x + 0.11374274*g0.x + -0.0053759404*h0.x + 0.21639374*i0.x; + j = 0.029581068*a0.y + -0.02986516*b0.y + 0.021204757*c0.y + -0.006031846*d0.y + -0.13951546*e0.y + -0.10485541*f0.y + -0.055438254*g0.y + -0.12904681*h0.y + -0.06661593*i0.y; + k = 0.042120147*a0.z + 0.076120056*b0.z + 0.058799937*c0.z + -0.0085356785*d0.z + -0.37842253*e0.z + 0.15116076*f0.z + -0.072133794*g0.z + 0.25175855*h0.z + 0.07849843*i0.z; + l = 0.07480219*a0.w + 0.026436467*b0.w + -0.05192802*c0.w + -0.20132145*d0.w + 0.046653923*e0.w + -0.057974514*f0.w + -0.18881139*g0.w + 0.03869617*h0.w + -0.05359312*i0.w; + m = 0.18609796*a1.x + -0.025107978*b1.x + -0.05485416*c1.x + -0.12506877*d1.x + 0.16311458*e1.x + 0.14975427*f1.x + 0.06121656*g1.x + 0.111572266*h1.x + -0.06902193*i1.x; + n = -0.09675723*a1.y + 0.03395821*b1.y + -0.10529792*c1.y + 0.08510861*d1.y + 0.001478931*e1.y + -0.019302577*f1.y + 0.11827853*g1.y + 0.01141932*h1.y + 0.058337122*i1.y; + o = 0.028637297*a1.z + 0.116889395*b1.z + -0.051687524*c1.z + 0.25920773*d1.z + -0.09955058*e1.z + -0.111958966*f1.z + -0.01542771*g1.z + 0.14032897*h1.z + 0.11228361*i1.z; + p = -0.102572076*a1.w + -0.10000578*b1.w + 0.010802064*c1.w + -0.17006679*d1.w + 0.28425327*e1.w + 0.09406719*f1.w + 0.12390108*g1.w + 0.01619186*h1.w + 0.030436736*i1.w; + q = -0.05434198*na0.x + -0.044370797*nb0.x + -0.07496158*nc0.x + 0.003799395*nd0.x + -0.01952927*ne0.x + -0.104056075*nf0.x + 0.02114818*ng0.x + 0.08832213*nh0.x + -0.073473066*ni0.x; + r = 0.117009945*na0.y + 0.053020813*nb0.y + -0.020469973*nc0.y + -0.0071595195*nd0.y + 0.11518942*ne0.y + 0.06417461*nf0.y + -0.10637551*ng0.y + 0.029846275*nh0.y + 0.017103193*ni0.y; + s = 0.026859421*na0.z + 0.033828203*nb0.z + -0.09990076*nc0.z + -0.18400614*nd0.z + 0.045542575*ne0.z + 0.007697366*nf0.z + -0.14255059*ng0.z + -0.17000173*nh0.z + 0.02396432*ni0.z; + t = 0.06297595*na0.w + -0.14622249*nb0.w + 0.019562326*nc0.w + -0.026149035*nd0.w + -0.20541689*ne0.w + -0.09325157*nf0.w + -0.015335166*ng0.w + -0.004904096*nh0.w + -0.023256762*ni0.w; + u = -0.19524229*na1.x + 0.14019871*nb1.x + 0.043756094*nc1.x + 0.05927864*nd1.x + -0.10984285*ne1.x + -0.07402525*nf1.x + 0.0091582425*ng1.x + 0.12954497*nh1.x + 0.035891227*ni1.x; + v = 0.16249649*na1.y + -0.11102605*nb1.y + 0.09617183*nc1.y + -0.1347269*nd1.y + 0.0038432048*ne1.y + 0.04074855*nf1.y + -0.084884845*ng1.y + -0.032651823*nh1.y + 0.023996437*ni1.y; + w = 0.09400437*na1.z + 0.05132347*nb1.z + -0.02254565*nc1.z + -0.052191116*nd1.z + -0.006187364*ne1.z + 0.12594841*nf1.z + 0.017266754*ng1.z + -0.05394334*nh1.z + 0.05234719*ni1.z; + x = -0.07382347*na1.w + 0.2015254*nb1.w + -0.021788929*nc1.w + -0.11237425*nd1.w + -0.06845667*ne1.w + -0.08814462*nf1.w + 0.21006493*ng1.w + -0.030658796*nh1.w + 0.020792674*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.013023297; + i = -0.035656873*a0.x + 0.29043454*b0.x + -0.093485475*c0.x + -0.088546365*d0.x + -0.18280011*e0.x + -0.08531151*f0.x + -0.08396969*g0.x + -0.12895977*h0.x + -0.13381611*i0.x; + j = 0.08109509*a0.y + 0.061622415*b0.y + 0.09512347*c0.y + 0.09760661*d0.y + 0.23493265*e0.y + -0.15241936*f0.y + 0.08086118*g0.y + 0.0482658*h0.y + 0.005154483*i0.y; + k = 0.08385953*a0.z + 0.23023549*b0.z + 0.10558045*c0.z + 0.12571234*d0.z + -0.12436785*e0.z + 0.11162487*f0.z + 0.25766334*g0.z + -0.04955883*h0.z + -0.038839206*i0.z; + l = -0.031077331*a0.w + 0.037581697*b0.w + 0.03739792*c0.w + -0.023134084*d0.w + 0.108166225*e0.w + -0.27240586*f0.w + 0.11235108*g0.w + 0.055221915*h0.w + -0.04974431*i0.w; + m = 0.050685987*a1.x + -0.0855947*b1.x + 0.114472255*c1.x + 0.21767192*d1.x + 0.06479547*e1.x + -0.111951314*f1.x + -0.20780368*g1.x + -0.24934538*h1.x + -0.018018583*i1.x; + n = -0.0223691*a1.y + -0.031400625*b1.y + -0.14545901*c1.y + -0.08056975*d1.y + 0.06659198*e1.y + -0.14099553*f1.y + -0.1574511*g1.y + -0.068153*h1.y + 0.03834908*i1.y; + o = -0.1388241*a1.z + 0.033197176*b1.z + -0.08693326*c1.z + -0.095407344*d1.z + -0.024903448*e1.z + -0.00516698*f1.z + 0.0051005622*g1.z + -0.20142871*h1.z + -0.17023231*i1.z; + p = -0.0391193*a1.w + -0.19792503*b1.w + -0.09035685*c1.w + -0.079474576*d1.w + 0.23703781*e1.w + 0.02854966*f1.w + 0.0572757*g1.w + -0.15615135*h1.w + 0.09795711*i1.w; + q = -0.07639385*na0.x + -0.13368028*nb0.x + 0.12966728*nc0.x + 0.0006021519*nd0.x + 0.35783088*ne0.x + 0.036377307*nf0.x + -0.13852029*ng0.x + -0.1278901*nh0.x + 0.07102291*ni0.x; + r = 0.12950456*na0.y + 0.13638775*nb0.y + 0.089563526*nc0.y + 0.0046526827*nd0.y + 0.22827531*ne0.y + 0.26544076*nf0.y + -0.053933237*ng0.y + -0.05662332*nh0.y + 0.13788679*ni0.y; + s = 0.05483395*na0.z + -0.10790315*nb0.z + -0.03360025*nc0.z + -0.010222414*nd0.z + -0.029511753*ne0.z + -0.24544497*nf0.z + 0.13202304*ng0.z + -0.33339366*nh0.z + 0.0014636389*ni0.z; + t = 0.051150147*na0.w + -0.06408108*nb0.w + -0.13684914*nc0.w + 0.17577235*nd0.w + -0.1577332*ne0.w + -0.1533534*nf0.w + -0.104082346*ng0.w + 0.102217875*nh0.w + 0.04462048*ni0.w; + u = -0.057499893*na1.x + 0.03404051*nb1.x + -0.09530944*nc1.x + -0.0014036942*nd1.x + 0.10787034*ne1.x + 0.12311618*nf1.x + 0.122414425*ng1.x + 0.105717205*nh1.x + 0.05405656*ni1.x; + v = 0.06136542*na1.y + 0.14106013*nb1.y + 0.15290134*nc1.y + 0.01512413*nd1.y + -0.12528025*ne1.y + -0.011202091*nf1.y + -0.06423187*ng1.y + 0.11118383*nh1.y + -0.09679467*ni1.y; + w = -0.011665277*na1.z + -0.07377728*nb1.z + 0.066744976*nc1.z + -0.054813497*nd1.z + -0.010954526*ne1.z + -0.01603292*nf1.z + -0.024203874*ng1.z + 0.12063812*nh1.z + -0.07406548*ni1.z; + x = -0.040362768*na1.w + 0.28191712*nb1.w + 0.1577795*nc1.w + 0.050058506*nd1.w + -0.29588038*ne1.w + 0.09272126*nf1.w + -0.32352138*ng1.w + -0.004645486*nh1.w + 0.10912149*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.005315338; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN30 +//!BIND LUMAN31 +//!SAVE LUMAN41 + +#define L0_tex LUMAN30_tex +#define L1_tex LUMAN31_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.05897486*a0.x + 0.27586955*b0.x + -0.056688223*c0.x + 0.07561018*d0.x + -0.10525086*e0.x + -0.24340199*f0.x + 0.06659864*g0.x + 0.06901837*h0.x + -0.013376588*i0.x; + float j = 0.014839147*a0.y + 0.10390609*b0.y + 0.1116336*c0.y + -0.014721822*d0.y + 0.07653417*e0.y + -0.1429016*f0.y + 0.064306565*g0.y + 0.052361738*h0.y + 0.0657451*i0.y; + float k = -0.07460744*a0.z + -0.085255824*b0.z + 0.041533597*c0.z + -0.008417165*d0.z + -0.18311697*e0.z + 0.04132524*f0.z + -0.12762608*g0.z + -0.0490694*h0.z + 0.021340536*i0.z; + float l = -0.1186136*a0.w + -0.22919929*b0.w + -0.013643524*c0.w + -0.20086412*d0.w + 0.013207006*e0.w + 0.11305753*f0.w + -0.12692404*g0.w + -0.0072910134*h0.w + -0.11241811*i0.w; + float m = -0.21522538*a1.x + -0.14833283*b1.x + -0.022969369*c1.x + -0.27716902*d1.x + 0.03638555*e1.x + -0.057161108*f1.x + -0.15450016*g1.x + -0.050380804*h1.x + 0.003395265*i1.x; + float n = 0.024632271*a1.y + 0.0382964*b1.y + 0.035003234*c1.y + 0.13437985*d1.y + -0.06140864*e1.y + -0.049475253*f1.y + 0.036768384*g1.y + -0.081538476*h1.y + -0.073716685*i1.y; + float o = 0.016729493*a1.z + -0.08793989*b1.z + -0.054102853*c1.z + 0.08820071*d1.z + -0.1565456*e1.z + -0.0405766*f1.z + -0.03476591*g1.z + 0.095920935*h1.z + -0.037696473*i1.z; + float p = 0.09913229*a1.w + 0.04506712*b1.w + 0.12394397*c1.w + -0.049859747*d1.w + 0.42513847*e1.w + -0.10907899*f1.w + 0.18546146*g1.w + -0.019482087*h1.w + -0.022588788*i1.w; + float q = 0.05428734*na0.x + -0.09825094*nb0.x + 0.07060548*nc0.x + -0.13419129*nd0.x + -0.28279778*ne0.x + 0.13844308*nf0.x + -0.043456554*ng0.x + -0.1443664*nh0.x + 0.06768429*ni0.x; + float r = 0.0012980829*na0.y + 0.03715222*nb0.y + -0.16464917*nc0.y + 0.1668546*nd0.y + -0.3276691*ne0.y + -0.07289079*nf0.y + 0.022440374*ng0.y + 0.1451005*nh0.y + -0.023447124*ni0.y; + float s = 0.064184375*na0.z + -0.06619485*nb0.z + -0.021960482*nc0.z + 0.021397583*nd0.z + 0.0736206*ne0.z + -0.090951815*nf0.z + 0.111692496*ng0.z + 0.00050554925*nh0.z + 0.08926067*ni0.z; + float t = 0.012369069*na0.w + 0.1951646*nb0.w + -0.020873873*nc0.w + 0.116908714*nd0.w + -0.48967528*ne0.w + -0.07455504*nf0.w + 0.15106396*ng0.w + -0.048980996*nh0.w + 0.030512914*ni0.w; + float u = 0.16899328*na1.x + 0.10447588*nb1.x + -0.009505267*nc1.x + 0.41911155*nd1.x + -0.009806482*ne1.x + -0.0030871788*nf1.x + 0.16966148*ng1.x + 0.037004367*nh1.x + 0.032864075*ni1.x; + float v = 0.09795996*na1.y + 0.002576914*nb1.y + -0.02554661*nc1.y + -0.15558101*nd1.y + -0.19964558*ne1.y + 0.022412546*nf1.y + -0.094990425*ng1.y + 0.08371083*nh1.y + 0.121753626*ni1.y; + float w = -0.010198556*na1.z + -0.027575629*nb1.z + 0.048614904*nc1.z + -0.050866783*nd1.z + 0.06520363*ne1.z + 0.07152051*nf1.z + -0.039514203*ng1.z + 0.00061794004*nh1.z + -0.04162527*ni1.z; + float x = 0.021820385*na1.w + -0.12759149*nb1.w + -0.050192278*nc1.w + 0.3388716*nd1.w + -0.35848868*ne1.w + 0.118803196*nf1.w + 0.007576073*ng1.w + 0.13519461*nh1.w + 0.012417935*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.005134705; + i = -0.012094228*a0.x + -0.037648804*b0.x + 0.018825721*c0.x + -0.056415178*d0.x + -0.1693265*e0.x + -0.3329496*f0.x + 0.04385037*g0.x + 0.24782597*h0.x + 0.024003597*i0.x; + j = 0.017770931*a0.y + 0.061245997*b0.y + 0.12247424*c0.y + 0.030261982*d0.y + -0.120891064*e0.y + 0.19610105*f0.y + -0.021305876*g0.y + 0.007743256*h0.y + -0.029186502*i0.y; + k = 0.011247433*a0.z + 0.26010805*b0.z + 0.005410956*c0.z + 0.1756328*d0.z + 0.52665186*e0.z + 0.019311607*f0.z + -0.22865027*g0.z + 0.018537138*h0.z + 0.28844747*i0.z; + l = 0.04707084*a0.w + -0.019024597*b0.w + 0.010127482*c0.w + 0.07881962*d0.w + -0.21882728*e0.w + -0.4462807*f0.w + -0.11017183*g0.w + 0.0014828485*h0.w + -0.055836964*i0.w; + m = -0.15131445*a1.x + -0.03349337*b1.x + 0.056926448*c1.x + 0.123288214*d1.x + -0.30359584*e1.x + -0.13110815*f1.x + -0.02858217*g1.x + -0.04218747*h1.x + -0.007281833*i1.x; + n = -0.000634909*a1.y + -0.09829987*b1.y + -0.12674282*c1.y + -0.18262619*d1.y + -0.20625703*e1.y + 0.027821977*f1.y + 0.04650851*g1.y + 0.036779493*h1.y + 0.044706035*i1.y; + o = -0.05769353*a1.z + -0.32191262*b1.z + -0.09332154*c1.z + -0.034158923*d1.z + -0.3178729*e1.z + -0.18241036*f1.z + -0.14834101*g1.z + -0.08815691*h1.z + -0.18666048*i1.z; + p = -0.034857456*a1.w + 0.13235937*b1.w + -0.00871079*c1.w + 0.09402437*d1.w + 0.22523633*e1.w + 0.18679704*f1.w + 0.14387223*g1.w + -0.061898142*h1.w + -0.017365128*i1.w; + q = -0.20398696*na0.x + 0.18950963*nb0.x + 0.045875635*nc0.x + -0.05545748*nd0.x + -0.47266406*ne0.x + -0.0478476*nf0.x + -0.0812568*ng0.x + -0.060154606*nh0.x + -0.06312032*ni0.x; + r = 0.19471812*na0.y + 0.34276626*nb0.y + -0.002011672*nc0.y + 0.08900145*nd0.y + 0.2595511*ne0.y + -0.24681035*nf0.y + -0.024882982*ng0.y + 0.02331316*nh0.y + -0.32200062*ni0.y; + s = 0.114582*na0.z + -0.19037218*nb0.z + -0.1417176*nc0.z + -0.10363403*nd0.z + -0.11044682*ne0.z + -0.059798382*nf0.z + 0.08371505*ng0.z + 0.44800338*nh0.z + 0.09965122*ni0.z; + t = -0.01947535*na0.w + -0.17559212*nb0.w + -0.033264827*nc0.w + 0.14829087*nd0.w + -0.19467528*ne0.w + 0.116288066*nf0.w + 0.1205474*ng0.w + 0.044752423*nh0.w + -0.031209234*ni0.w; + u = -0.004728546*na1.x + -0.13519558*nb1.x + -0.02461425*nc1.x + -0.073864736*nd1.x + 0.48404813*ne1.x + 0.088028006*nf1.x + 0.050297916*ng1.x + -0.008906264*nh1.x + -0.019913306*ni1.x; + v = 0.10467789*na1.y + 0.11910779*nb1.y + 0.15660498*nc1.y + -0.07719423*nd1.y + -0.1274165*ne1.y + -0.022373257*nf1.y + -0.059113465*ng1.y + 0.045096442*nh1.y + -0.027823227*ni1.y; + w = 0.06638856*na1.z + -0.032282606*nb1.z + -0.011439734*nc1.z + -0.07844197*nd1.z + 0.053250894*ne1.z + 0.07105429*nf1.z + -0.03597942*ng1.z + 0.101988435*nh1.z + 0.11831101*ni1.z; + x = 0.25001556*na1.w + -0.046163235*nb1.w + 0.064991914*nc1.w + 0.08997446*nd1.w + 0.022799926*ne1.w + -0.23605661*nf1.w + -0.09163479*ng1.w + -0.0658797*nh1.w + 0.22340213*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.028153285; + i = -0.05723475*a0.x + -0.25381944*b0.x + 0.17901848*c0.x + -0.014471504*d0.x + 0.35167104*e0.x + 0.08602924*f0.x + -0.11910211*g0.x + -0.17563531*h0.x + 0.04424879*i0.x; + j = -0.022332152*a0.y + -0.14992887*b0.y + 0.067525476*c0.y + 0.14036782*d0.y + -0.091856144*e0.y + 0.0013875823*f0.y + -0.016366925*g0.y + -0.20222068*h0.y + 0.13036513*i0.y; + k = 0.04965131*a0.z + 0.03841196*b0.z + 0.10992083*c0.z + 0.3528956*d0.z + 0.24185915*e0.z + -0.23682235*f0.z + 0.25822678*g0.z + 0.26567867*h0.z + 0.040070523*i0.z; + l = 0.005208211*a0.w + -0.088146344*b0.w + 0.011741281*c0.w + 0.18548676*d0.w + 0.20249239*e0.w + -0.10297989*f0.w + 0.043873258*g0.w + 0.010360001*h0.w + 0.080844186*i0.w; + m = 0.11925185*a1.x + -0.002130104*b1.x + -0.0017537178*c1.x + -0.119089566*d1.x + 0.09701926*e1.x + 0.02401391*f1.x + -0.21442156*g1.x + 0.030856185*h1.x + -0.024846844*i1.x; + n = 0.033464372*a1.y + -0.0017296523*b1.y + -0.17002295*c1.y + 0.1224641*d1.y + 0.2461822*e1.y + 0.26922768*f1.y + -0.032281265*g1.y + -0.08174399*h1.y + -0.024631953*i1.y; + o = -0.010928469*a1.z + 0.040003847*b1.z + -0.009050721*c1.z + -0.18532535*d1.z + 0.117428556*e1.z + -0.054807805*f1.z + 0.3688676*g1.z + -0.20925143*h1.z + -0.12101665*i1.z; + p = -0.050080348*a1.w + -0.023793569*b1.w + -0.046359524*c1.w + -0.46156624*d1.w + -0.084235124*e1.w + 0.170481*f1.w + -0.34520224*g1.w + 0.08081779*h1.w + 0.046790455*i1.w; + q = -0.013522426*na0.x + 0.08664619*nb0.x + 0.040773723*nc0.x + -0.29594067*nd0.x + -0.43927056*ne0.x + -0.23970877*nf0.x + -0.071083836*ng0.x + 0.022856604*nh0.x + -0.083344005*ni0.x; + r = -0.06762164*na0.y + 0.48516664*nb0.y + 0.2361623*nc0.y + -0.2992352*nd0.y + -0.42049935*ne0.y + -0.08378619*nf0.y + -0.18655877*ng0.y + -0.2691026*nh0.y + -0.15376762*ni0.y; + s = -0.116502166*na0.z + 0.10032056*nb0.z + -0.09566259*nc0.z + -0.18851502*nd0.z + 0.30246553*ne0.z + 0.0009529123*nf0.z + -0.09874099*ng0.z + -0.2364732*nh0.z + 0.11826255*ni0.z; + t = -0.03493555*na0.w + -0.035773568*nb0.w + -0.12659708*nc0.w + -0.16138509*nd0.w + -0.07105405*ne0.w + 0.09101966*nf0.w + 0.24660683*ng0.w + -0.0061035194*nh0.w + -0.040358752*ni0.w; + u = 0.057612475*na1.x + -0.015996441*nb1.x + 0.004548848*nc1.x + -0.108426526*nd1.x + -0.10091294*ne1.x + -0.012472666*nf1.x + -0.021699939*ng1.x + 0.07560604*nh1.x + -0.024083558*ni1.x; + v = -0.14357498*na1.y + 0.15821618*nb1.y + 0.21333988*nc1.y + -0.041154474*nd1.y + -0.07063476*ne1.y + -0.20110704*nf1.y + 0.10822521*ng1.y + 0.11874143*nh1.y + -0.011279268*ni1.y; + w = -0.018583542*na1.z + -0.11350155*nb1.z + 0.01832477*nc1.z + 0.21990615*nd1.z + 0.022556763*ne1.z + 0.11403346*nf1.z + -0.20918418*ng1.z + 0.12558801*nh1.z + 0.037197538*ni1.z; + x = 0.06027407*na1.w + 0.15575232*nb1.w + 0.15703124*nc1.w + -0.102149114*nd1.w + 0.3785688*ne1.w + -0.2512173*nf1.w + -0.047505885*ng1.w + 0.11199537*nh1.w + -0.033578023*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.024645254; + i = -0.11315129*a0.x + -0.13970152*b0.x + -0.0106838625*c0.x + -0.16662036*d0.x + 0.0351158*e0.x + -0.3236344*f0.x + -0.10745606*g0.x + 0.10335738*h0.x + 0.060342573*i0.x; + j = 0.05034862*a0.y + -0.03773915*b0.y + -0.11317716*c0.y + -0.1319167*d0.y + -0.2557561*e0.y + -0.37108675*f0.y + -0.121097684*g0.y + -0.017232087*h0.y + -0.29864594*i0.y; + k = -0.17640741*a0.z + -0.05367414*b0.z + -0.1096958*c0.z + -0.15220755*d0.z + -0.39255792*e0.z + -0.042989623*f0.z + -0.08857472*g0.z + -0.07308339*h0.z + 0.12683356*i0.z; + l = 0.04818234*a0.w + 0.011259093*b0.w + -0.13971567*c0.w + 0.20727336*d0.w + 0.300634*e0.w + 0.15203673*f0.w + 0.045851354*g0.w + -0.021859625*h0.w + 0.14271338*i0.w; + m = -0.05115792*a1.x + -0.030130638*b1.x + 0.012354536*c1.x + -0.20207289*d1.x + 0.24113736*e1.x + 0.07546829*f1.x + 0.054056752*g1.x + 0.22468947*h1.x + 0.18395297*i1.x; + n = -0.016631735*a1.y + 0.14029092*b1.y + 0.1094122*c1.y + -0.21489155*d1.y + 0.030756673*e1.y + 0.08403406*f1.y + 0.029142294*g1.y + -0.15179269*h1.y + 0.06422021*i1.y; + o = 0.060144097*a1.z + -0.05253342*b1.z + -0.08916168*c1.z + 0.11863635*d1.z + -0.13244452*e1.z + -0.20428996*f1.z + -0.02991306*g1.z + -0.11285724*h1.z + 0.23592609*i1.z; + p = -0.022924347*a1.w + 0.08029266*b1.w + 0.1295117*c1.w + 0.27471703*d1.w + 0.21181649*e1.w + 0.26830688*f1.w + -0.011267695*g1.w + 0.13833974*h1.w + -0.22575748*i1.w; + q = 0.06332978*na0.x + 0.19778712*nb0.x + -0.14630173*nc0.x + 0.2022106*nd0.x + -0.043443214*ne0.x + 0.013244423*nf0.x + -0.029920608*ng0.x + 0.15498282*nh0.x + -0.008860152*ni0.x; + r = -0.071186095*na0.y + -0.0046415976*nb0.y + 0.09588473*nc0.y + -0.054782644*nd0.y + -0.30131996*ne0.y + 0.09571458*nf0.y + -0.11756927*ng0.y + -0.25668737*nh0.y + 0.029054785*ni0.y; + s = 0.010182304*na0.z + -0.17348135*nb0.z + 0.046391185*nc0.z + -0.15667062*nd0.z + -0.16666505*ne0.z + 0.16067432*nf0.z + -0.1326823*ng0.z + 0.21085083*nh0.z + 0.1455272*ni0.z; + t = 0.058360394*na0.w + 0.053739175*nb0.w + 0.08894498*nc0.w + -0.281138*nd0.w + -0.1887361*ne0.w + 0.12640464*nf0.w + -0.04298481*ng0.w + -0.24676816*nh0.w + 0.05571448*ni0.w; + u = 0.16053072*na1.x + 0.32601315*nb1.x + 0.095457345*nc1.x + 0.19869359*nd1.x + 0.0041162316*ne1.x + -0.0006917916*nf1.x + 0.28368276*ng1.x + -0.091511145*nh1.x + -0.03113108*ni1.x; + v = -0.04926926*na1.y + -0.13931896*nb1.y + -0.21816307*nc1.y + 0.112340935*nd1.y + -0.14673282*ne1.y + -0.059623435*nf1.y + 0.070587724*ng1.y + 0.008949842*nh1.y + -0.027426368*ni1.y; + w = 0.109189294*na1.z + -0.009112803*nb1.z + -0.017429749*nc1.z + -0.06363286*nd1.z + -0.19273286*ne1.z + 0.043292988*nf1.z + -0.034082536*ng1.z + 0.20947897*nh1.z + 0.055061273*ni1.z; + x = -0.08175211*na1.w + -0.019585626*nb1.w + -0.051631507*nc1.w + -0.39735416*nd1.w + 0.1588689*ne1.w + -0.073861524*nf1.w + 0.18975042*ng1.w + -0.1963924*nh1.w + 0.035963826*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0140123125; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN40 +//!BIND LUMAN41 +//!SAVE LUMAN50 + +#define L0_tex LUMAN40_tex +#define L1_tex LUMAN41_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.035612535*a0.x + 0.04017731*b0.x + 0.20536023*c0.x + 0.06875523*d0.x + -0.031420883*e0.x + 0.42573005*f0.x + 0.061643112*g0.x + 0.18023333*h0.x + 0.5605257*i0.x; + float j = 0.01814264*a0.y + 0.016944267*b0.y + 0.1220235*c0.y + 0.16802199*d0.y + 0.10004153*e0.y + -0.012133044*f0.y + 0.07105161*g0.y + 0.12237441*h0.y + 0.004510387*i0.y; + float k = 0.004186747*a0.z + -0.12970294*b0.z + 0.0044008605*c0.z + 0.03908641*d0.z + -0.18611148*e0.z + 0.00087365374*f0.z + 0.11857353*g0.z + 0.027568813*h0.z + 0.05604513*i0.z; + float l = -0.028001549*a0.w + 0.11514266*b0.w + -0.07945613*c0.w + -0.15281484*d0.w + 0.13567261*e0.w + -0.014678198*f0.w + 0.059029147*g0.w + 0.0054495637*h0.w + -0.025024548*i0.w; + float m = -0.011409999*a1.x + -0.015341942*b1.x + 0.114741184*c1.x + 0.012083291*d1.x + 0.08023752*e1.x + 0.34920374*f1.x + -0.047863945*g1.x + 0.2432634*h1.x + -0.090446465*i1.x; + float n = -0.08555583*a1.y + -0.0007628947*b1.y + 0.07811802*c1.y + -0.10136344*d1.y + -0.03125326*e1.y + -0.0033468457*f1.y + -0.08859198*g1.y + -0.021236353*h1.y + 0.044894487*i1.y; + float o = -0.022154905*a1.z + 0.0154149085*b1.z + 0.02057002*c1.z + 0.069081895*d1.z + 0.08480116*e1.z + 0.013921394*f1.z + -0.02094114*g1.z + 0.00068823615*h1.z + -0.12001934*i1.z; + float p = -0.028961627*a1.w + 0.051715665*b1.w + -0.03176729*c1.w + -0.1386012*d1.w + 0.106838785*e1.w + -0.10906675*f1.w + 0.027086709*g1.w + -0.12217284*h1.w + -0.040965617*i1.w; + float q = 0.059872124*na0.x + 0.14022045*nb0.x + 0.02607862*nc0.x + -0.21362531*nd0.x + -0.08310274*ne0.x + 0.11169541*nf0.x + -0.12575342*ng0.x + -0.3680999*nh0.x + -0.070986785*ni0.x; + float r = 0.048685316*na0.y + 0.007329649*nb0.y + -0.16210833*nc0.y + -0.2781075*nd0.y + -0.3511886*ne0.y + -0.029574253*nf0.y + -0.12877542*ng0.y + -0.075404786*nh0.y + -0.0987583*ni0.y; + float s = -0.018988824*na0.z + 0.2942867*nb0.z + 0.042009376*nc0.z + -0.22772476*nd0.z + 0.0050454373*ne0.z + -0.068424255*nf0.z + -0.04001246*ng0.z + -0.022675836*nh0.z + 0.034189373*ni0.z; + float t = -0.045849156*na0.w + -0.068379305*nb0.w + 0.16441053*nc0.w + -0.0360953*nd0.w + -0.018031951*ne0.w + 0.089194946*nf0.w + -0.05944052*ng0.w + 0.039005104*nh0.w + 0.0449217*ni0.w; + float u = -0.08554041*na1.x + -0.10273593*nb1.x + -0.05450196*nc1.x + -0.0049457126*nd1.x + -0.24735165*ne1.x + -0.033856906*nf1.x + -0.04789079*ng1.x + -0.124637336*nh1.x + 0.028094016*ni1.x; + float v = 0.010685325*na1.y + 0.075002894*nb1.y + -0.07482232*nc1.y + 0.08389421*nd1.y + -0.031178487*ne1.y + -0.000977765*nf1.y + 0.12105572*ng1.y + 0.16234533*nh1.y + 0.109915555*ni1.y; + float w = 0.009669741*na1.z + -0.01547055*nb1.z + -0.15011303*nc1.z + -0.100489765*nd1.z + -0.12212056*ne1.z + 0.023505995*nf1.z + 0.045761496*ng1.z + 0.0017781933*nh1.z + 0.015155669*ni1.z; + float x = -0.001148341*na1.w + -0.21386683*nb1.w + -0.013807217*nc1.w + 0.120531775*nd1.w + -0.07378633*ne1.w + 0.10549616*nf1.w + -0.028720537*ng1.w + 0.04982669*nh1.w + -0.09549333*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.013112524; + i = -0.008850011*a0.x + -0.053074952*b0.x + 0.2744104*c0.x + 0.02612702*d0.x + -0.15895297*e0.x + 0.09991879*f0.x + 0.20669703*g0.x + 0.15539402*h0.x + -0.05046773*i0.x; + j = -0.046442796*a0.y + -0.07005078*b0.y + -0.042570863*c0.y + 0.08206181*d0.y + 0.3786237*e0.y + -0.019612692*f0.y + 0.08563863*g0.y + 0.13863519*h0.y + 0.20874031*i0.y; + k = 0.039513156*a0.z + -0.21471843*b0.z + 0.03774025*c0.z + -0.07815786*d0.z + 0.008676453*e0.z + -0.017183626*f0.z + -0.09989854*g0.z + -0.12806281*h0.z + 0.03840211*i0.z; + l = 0.029019121*a0.w + -0.1129284*b0.w + 0.01011583*c0.w + -0.12016837*d0.w + 0.007712074*e0.w + 0.016819015*f0.w + 0.07030448*g0.w + -0.033610865*h0.w + -0.0459375*i0.w; + m = -0.04275781*a1.x + -0.018200489*b1.x + -0.10315262*c1.x + 0.06556069*d1.x + 0.14088795*e1.x + -0.23484154*f1.x + -0.12515117*g1.x + -0.06998259*h1.x + 0.07224344*i1.x; + n = 0.017037492*a1.y + 0.06304942*b1.y + -0.016848698*c1.y + -0.06799698*d1.y + -0.3415319*e1.y + 0.02610139*f1.y + -0.1217599*g1.y + -0.053102333*h1.y + 0.011076662*i1.y; + o = -0.02913676*a1.z + -0.012321229*b1.z + -0.017936712*c1.z + -0.09636114*d1.z + -0.13355324*e1.z + 0.09698391*f1.z + -0.06536401*g1.z + -0.045358505*h1.z + -0.04125653*i1.z; + p = -0.031567413*a1.w + -0.12853059*b1.w + -0.03921569*c1.w + 0.074788004*d1.w + 0.14571433*e1.w + -0.00066722726*f1.w + -0.016363356*g1.w + -0.01901327*h1.w + -0.1046701*i1.w; + q = -0.0009567858*na0.x + -0.041390944*nb0.x + 0.010207388*nc0.x + 0.11404937*nd0.x + -0.23463163*ne0.x + -0.023602346*nf0.x + -0.15303922*ng0.x + -0.009046193*nh0.x + 0.08103048*ni0.x; + r = 0.017589236*na0.y + 0.15609305*nb0.y + 0.045721974*nc0.y + -0.13058934*nd0.y + -0.2679451*ne0.y + 0.011950594*nf0.y + -0.22449987*ng0.y + -0.1917914*nh0.y + -0.11365412*ni0.y; + s = 0.19348381*na0.z + 0.24570563*nb0.z + 0.019962208*nc0.z + 0.0014589598*nd0.z + 0.07886757*ne0.z + 0.14932665*nf0.z + 0.16708276*ng0.z + 0.18550636*nh0.z + -0.0067473818*ni0.z; + t = -0.0065101734*na0.w + -0.040736493*nb0.w + -0.041270405*nc0.w + 0.07618738*nd0.w + 0.0218949*ne0.w + -0.04766936*nf0.w + 0.09532495*ng0.w + 0.10562779*nh0.w + 0.07444872*ni0.w; + u = -0.051368568*na1.x + -0.15848117*nb1.x + -0.18546471*nc1.x + -0.12092587*nd1.x + -0.05082287*ne1.x + -0.08485216*nf1.x + 0.03221051*ng1.x + -0.05053332*nh1.x + -0.09860819*ni1.x; + v = 0.029384093*na1.y + -0.06750876*nb1.y + 0.018348627*nc1.y + 0.08856726*nd1.y + 0.4350653*ne1.y + 0.06356879*nf1.y + 0.08271615*ng1.y + 0.008104969*nh1.y + -0.018670512*ni1.y; + w = -0.011343069*na1.z + -0.11651827*nb1.z + -0.08994046*nc1.z + -0.06221274*nd1.z + -0.037247933*ne1.z + -0.14539322*nf1.z + 0.021901105*ng1.z + 0.005052073*nh1.z + 0.10261775*ni1.z; + x = 0.002017023*na1.w + 0.07701929*nb1.w + -0.06421878*nc1.w + -0.11461471*nd1.w + 0.09813192*ne1.w + -0.09010211*nf1.w + -0.14889443*ng1.w + 0.049384467*nh1.w + 0.12307971*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.042553633; + i = 0.09314597*a0.x + 0.13171728*b0.x + 0.19819239*c0.x + -0.12970911*d0.x + 0.29927254*e0.x + 0.21767391*f0.x + 0.17249553*g0.x + 0.25350404*h0.x + 0.4911293*i0.x; + j = 0.118306145*a0.y + -0.0047325366*b0.y + 0.06604017*c0.y + -0.07435545*d0.y + -0.21104847*e0.y + 0.120903485*f0.y + 0.007448092*g0.y + 0.02675702*h0.y + -0.018381957*i0.y; + k = 0.11446292*a0.z + 0.045590237*b0.z + 0.18081953*c0.z + -0.17427047*d0.z + -0.35203543*e0.z + 0.02689046*f0.z + 0.009454167*g0.z + 0.12534736*h0.z + 0.035864905*i0.z; + l = -0.13871336*a0.w + 0.000110143475*b0.w + 0.016679386*c0.w + -0.008853473*d0.w + 0.03879449*e0.w + -0.039120965*f0.w + -0.09930874*g0.w + -0.1000116*h0.w + 0.09242047*i0.w; + m = -0.044360902*a1.x + 0.08391946*b1.x + 0.11027122*c1.x + 0.0073652584*d1.x + 0.09692701*e1.x + 0.2119457*f1.x + 0.036328424*g1.x + -0.019593457*h1.x + -0.107490614*i1.x; + n = -0.0125782965*a1.y + 0.20825994*b1.y + 0.23127447*c1.y + 0.0072191535*d1.y + 0.1447853*e1.y + 0.15627444*f1.y + -0.07684372*g1.y + 0.19135267*h1.y + -0.06037572*i1.y; + o = -0.029698756*a1.z + 0.053750448*b1.z + 0.06339778*c1.z + -0.030724516*d1.z + 0.043275952*e1.z + 0.18226287*f1.z + -0.006794373*g1.z + 0.072466105*h1.z + -0.024686977*i1.z; + p = -0.056785114*a1.w + -0.103406094*b1.w + -0.20727181*c1.w + -0.039523434*d1.w + -0.17240427*e1.w + -0.19204095*f1.w + -0.10694597*g1.w + -0.2649955*h1.w + -0.06132428*i1.w; + q = 0.0039332574*na0.x + 0.05026292*nb0.x + 0.046305656*nc0.x + 0.18708026*nd0.x + -0.28327677*ne0.x + 0.070439406*nf0.x + -0.18838173*ng0.x + -0.09740024*nh0.x + 0.13081598*ni0.x; + r = 0.09294847*na0.y + 0.35245818*nb0.y + 0.061874304*nc0.y + -0.13571835*nd0.y + 0.09223242*ne0.y + 0.004823584*nf0.y + -0.048575934*ng0.y + -0.08550897*nh0.y + -0.18647256*ni0.y; + s = 0.0587695*na0.z + 0.19384533*nb0.z + -0.09999857*nc0.z + 0.050346695*nd0.z + -0.07080002*ne0.z + -0.020419646*nf0.z + -0.08622975*ng0.z + -0.22737212*nh0.z + -0.012951568*ni0.z; + t = 0.24028173*na0.w + 0.057572372*nb0.w + 0.12549803*nc0.w + 0.010931657*nd0.w + 0.3212349*ne0.w + 0.20082182*nf0.w + 0.054529183*ng0.w + 0.12963445*nh0.w + 0.12043251*ni0.w; + u = -0.105689935*na1.x + -0.107305124*nb1.x + -0.15378787*nc1.x + 0.04664972*nd1.x + 0.08102327*ne1.x + -0.20562561*nf1.x + -0.041195456*ng1.x + 0.018099809*nh1.x + -0.040376134*ni1.x; + v = -0.01487915*na1.y + -0.09081166*nb1.y + -0.13099758*nc1.y + -0.12701605*nd1.y + -0.2193587*ne1.y + -0.016810827*nf1.y + 0.055257153*ng1.y + -0.024633544*nh1.y + 0.09994283*ni1.y; + w = 0.20626432*na1.z + 0.12838879*nb1.z + -0.14225093*nc1.z + -0.028794078*nd1.z + 0.19917117*ne1.z + 0.044698376*nf1.z + 0.082005724*ng1.z + 0.15631491*nh1.z + 0.12103039*ni1.z; + x = -0.059040707*na1.w + -0.14747858*nb1.w + -0.037346754*nc1.w + -0.11842503*nd1.w + -0.16885588*ne1.w + 0.06594487*nf1.w + 0.089308925*ng1.w + 0.052808817*nh1.w + -0.08821508*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.029102776; + i = -0.11209577*a0.x + 0.14418902*b0.x + 0.07912491*c0.x + -0.02995134*d0.x + 0.07840223*e0.x + 0.120897666*f0.x + -0.1381869*g0.x + -0.15199783*h0.x + -0.0057939785*i0.x; + j = 0.038522664*a0.y + -0.04430634*b0.y + 0.014930398*c0.y + -0.078924544*d0.y + 0.032821495*e0.y + -0.15034387*f0.y + 0.09948224*g0.y + 0.046257578*h0.y + 0.03698673*i0.y; + k = 0.021408146*a0.z + 0.17502472*b0.z + 0.022271572*c0.z + -0.00613615*d0.z + 0.08999399*e0.z + 0.010229765*f0.z + 0.11082286*g0.z + 0.14384252*h0.z + -0.009855277*i0.z; + l = 0.06253465*a0.w + 0.073090926*b0.w + 0.07494987*c0.w + 0.037831865*d0.w + 0.3061816*e0.w + 0.17264585*f0.w + -0.0014333117*g0.w + 0.07528909*h0.w + -0.071264625*i0.w; + m = -0.05418183*a1.x + -0.11523262*b1.x + -0.06851412*c1.x + 0.01028219*d1.x + -0.4530031*e1.x + 0.12992333*f1.x + -0.14678968*g1.x + -0.065828115*h1.x + 0.06610601*i1.x; + n = 0.007039626*a1.y + -0.04067319*b1.y + 0.039445095*c1.y + -0.043049503*d1.y + 0.098197125*e1.y + -0.16465133*f1.y + -0.03092959*g1.y + 0.0021357106*h1.y + 0.062050033*i1.y; + o = 0.06942289*a1.z + 0.1167464*b1.z + -0.016325492*c1.z + 0.0014870387*d1.z + 0.08062883*e1.z + -0.03982079*f1.z + -0.04291324*g1.z + -0.0065602884*h1.z + -0.10709311*i1.z; + p = 0.033238105*a1.w + -0.03832345*b1.w + 0.07635184*c1.w + -0.0098485*d1.w + -0.0005796845*e1.w + 0.021684904*f1.w + -0.09704172*g1.w + -0.054971114*h1.w + -0.01928706*i1.w; + q = -0.12458046*na0.x + 0.06652665*nb0.x + 0.060793605*nc0.x + -0.20750596*nd0.x + -0.07342202*ne0.x + 0.20712708*nf0.x + 0.0987297*ng0.x + -0.11710979*nh0.x + 0.017415684*ni0.x; + r = 0.055106472*na0.y + 0.27876937*nb0.y + 0.016087595*nc0.y + -0.0055158874*nd0.y + -0.021120023*ne0.y + 0.032101106*nf0.y + 0.094017655*ng0.y + 0.022162251*nh0.y + -0.04368556*ni0.y; + s = -0.13121118*na0.z + -0.047029372*nb0.z + -0.06184597*nc0.z + -0.09755456*nd0.z + -0.28179955*ne0.z + 0.003410392*nf0.z + -0.10697052*ng0.z + -0.11528157*nh0.z + 0.013775394*ni0.z; + t = -0.083358206*na0.w + 0.03872297*nb0.w + -0.041483015*nc0.w + -0.13377745*nd0.w + -0.22119187*ne0.w + -0.09595053*nf0.w + -0.006479464*ng0.w + -0.05508277*nh0.w + 0.08092169*ni0.w; + u = -0.0037866305*na1.x + -0.066144735*nb1.x + 0.1064194*nc1.x + 0.07637622*nd1.x + 0.31042975*ne1.x + 0.29661596*nf1.x + 0.045302957*ng1.x + 0.0042874413*nh1.x + -0.07085192*ni1.x; + v = -0.04648092*na1.y + 0.035114635*nb1.y + -0.02674536*nc1.y + 0.039049216*nd1.y + -0.14902431*ne1.y + 0.11379347*nf1.y + -0.07022612*ng1.y + 0.11715015*nh1.y + 0.04028414*ni1.y; + w = -0.015916107*na1.z + 0.051527347*nb1.z + -0.011901495*nc1.z + -0.006465481*nd1.z + 0.06552145*ne1.z + 0.04144042*nf1.z + -0.006796157*ng1.z + 0.025898159*nh1.z + -0.0007850506*ni1.z; + x = 0.011756395*na1.w + -0.07946773*nb1.w + -0.045221303*nc1.w + 0.0052964273*nd1.w + -0.22804372*ne1.w + -0.1162836*nf1.w + -0.012282788*ng1.w + -0.06438151*nh1.w + -0.057280466*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0026127724; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN40 +//!BIND LUMAN41 +//!SAVE LUMAN51 + +#define L0_tex LUMAN40_tex +#define L1_tex LUMAN41_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.058341313*a0.x + -0.21506369*b0.x + 0.01969202*c0.x + -0.0054663033*d0.x + -0.40020138*e0.x + 0.1285723*f0.x + 0.027146779*g0.x + -0.29534942*h0.x + -0.065372*i0.x; + float j = 0.026859052*a0.y + -0.07099255*b0.y + -0.0399993*c0.y + 0.11942047*d0.y + 0.34605628*e0.y + 0.05976046*f0.y + 0.055970136*g0.y + -0.004091986*h0.y + -0.16493514*i0.y; + float k = -0.07908727*a0.z + 0.04415421*b0.z + -0.15355754*c0.z + 0.1129772*d0.z + 0.33453822*e0.z + -0.14832681*f0.z + 0.082989015*g0.z + 0.071731575*h0.z + 0.18906988*i0.z; + float l = -0.09066858*a0.w + -0.11348159*b0.w + -0.0021799193*c0.w + 0.0013052556*d0.w + 0.06459756*e0.w + -0.03326646*f0.w + 0.035330385*g0.w + -0.14535238*h0.w + 0.12517998*i0.w; + float m = -0.009239749*a1.x + -0.045440555*b1.x + 0.07250618*c1.x + 0.023130517*d1.x + 0.10688969*e1.x + 0.10387453*f1.x + -0.09824478*g1.x + 0.016347708*h1.x + -0.057189398*i1.x; + float n = -0.055576593*a1.y + 0.054272186*b1.y + 0.004727247*c1.y + -0.06652871*d1.y + -0.16520706*e1.y + -0.16452906*f1.y + -0.09373078*g1.y + 0.11094564*h1.y + 0.049136963*i1.y; + float o = -0.025956787*a1.z + -0.096835725*b1.z + 0.037478585*c1.z + -0.05188841*d1.z + -0.106625505*e1.z + -0.11583477*f1.z + -0.020436885*g1.z + -0.031691026*h1.z + -0.07146676*i1.z; + float p = 0.07959005*a1.w + 0.029714286*b1.w + 0.08986918*c1.w + 0.1256378*d1.w + 0.25168374*e1.w + 0.09286637*f1.w + 0.075563334*g1.w + -0.030476464*h1.w + 0.0834733*i1.w; + float q = 0.08110389*na0.x + -0.0055321003*nb0.x + -0.011466603*nc0.x + -0.076089986*nd0.x + 0.24084151*ne0.x + -0.09002664*nf0.x + -0.07916691*ng0.x + -0.057236582*nh0.x + 0.015564612*ni0.x; + float r = -0.08872573*na0.y + -0.05498289*nb0.y + 0.031930678*nc0.y + -0.17136955*nd0.y + -0.35136038*ne0.y + -0.2618554*nf0.y + 0.018345961*ng0.y + 0.022003971*nh0.y + 0.042457905*ni0.y; + float s = 0.028178586*na0.z + 0.060931925*nb0.z + 0.06884443*nc0.z + 0.03218537*nd0.z + -0.258666*ne0.z + 0.1666093*nf0.z + -0.011844073*ng0.z + 0.015975356*nh0.z + -0.087677285*ni0.z; + float t = 0.08933054*na0.w + 0.16106002*nb0.w + -0.06288805*nc0.w + -0.054834746*nd0.w + -0.18805434*ne0.w + -0.047614172*nf0.w + -0.12941436*ng0.w + 0.03589237*nh0.w + -0.18264498*ni0.w; + float u = 0.0130687915*na1.x + 0.0151407365*nb1.x + 0.07099842*nc1.x + 0.024692902*nd1.x + -0.15270196*ne1.x + 0.11206766*nf1.x + 0.12255809*ng1.x + 0.060980264*nh1.x + 0.035168886*ni1.x; + float v = 0.08796369*na1.y + -0.05019335*nb1.y + -0.00079465396*nc1.y + 0.23707964*nd1.y + 0.056615967*ne1.y + 0.13510074*nf1.y + 0.06192575*ng1.y + 0.0559245*nh1.y + -0.02031479*ni1.y; + float w = -0.07471332*na1.z + 0.061358225*nb1.z + -0.034596812*nc1.z + -0.032788627*nd1.z + -0.08333219*ne1.z + -0.10440432*nf1.z + -0.03931595*ng1.z + -0.049613044*nh1.z + -0.053474206*ni1.z; + float x = -0.022343067*na1.w + -0.13285586*nb1.w + 0.024529492*nc1.w + -0.17635131*nd1.w + -0.2814951*ne1.w + -0.041839745*nf1.w + -0.036626995*ng1.w + 0.076569855*nh1.w + 0.040817678*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.009945548; + i = 0.0736856*a0.x + -0.0032100477*b0.x + 0.1492096*c0.x + 0.077228*d0.x + 0.26272488*e0.x + 0.057036564*f0.x + -0.05616672*g0.x + 0.17332815*h0.x + 0.035774574*i0.x; + j = -0.05845697*a0.y + 0.1549392*b0.y + 0.023617486*c0.y + 0.04493254*d0.y + -0.15356177*e0.y + 0.004977352*f0.y + -0.108943984*g0.y + 0.17687424*h0.y + -0.054177612*i0.y; + k = 0.0759221*a0.z + 0.15608083*b0.z + 0.12887464*c0.z + -0.018616863*d0.z + -0.23259711*e0.z + 0.06419663*f0.z + -0.005241023*g0.z + -0.051844392*h0.z + 0.10750178*i0.z; + l = 0.0036690442*a0.w + 0.05987606*b0.w + 0.07125578*c0.w + -0.13141707*d0.w + 0.02256273*e0.w + -0.020214377*f0.w + 0.007948303*g0.w + -0.079753816*h0.w + 0.07354992*i0.w; + m = 0.051859725*a1.x + -0.034709375*b1.x + -0.029387208*c1.x + -0.026496835*d1.x + -0.07617418*e1.x + 0.1247166*f1.x + -0.022847766*g1.x + -0.022378957*h1.x + 0.0007826007*i1.x; + n = -0.01812967*a1.y + 0.030523093*b1.y + 0.0023419647*c1.y + 0.15735936*d1.y + 0.0825415*e1.y + 0.07909621*f1.y + 0.13551788*g1.y + 0.010991528*h1.y + 0.029551538*i1.y; + o = 0.03864655*a1.z + 0.07395166*b1.z + 0.06528245*c1.z + 0.04649426*d1.z + 0.15720278*e1.z + 0.06673369*f1.z + 0.012719491*g1.z + 0.0075968713*h1.z + -0.033163235*i1.z; + p = -0.06660658*a1.w + -0.09621747*b1.w + -0.053015623*c1.w + -0.10868584*d1.w + -0.03617085*e1.w + -0.11382697*f1.w + -0.025376456*g1.w + -0.1425686*h1.w + -0.08685108*i1.w; + q = -0.026217438*na0.x + 0.15754505*nb0.x + -0.0091019645*nc0.x + -0.014831991*nd0.x + 0.16862741*ne0.x + 0.051979672*nf0.x + 0.12961973*ng0.x + 0.08616495*nh0.x + 0.08113077*ni0.x; + r = 0.089784846*na0.y + -0.059764784*nb0.y + 0.0643469*nc0.y + 0.07526015*nd0.y + 0.06560973*ne0.y + 0.031762443*nf0.y + 0.0008978316*ng0.y + -0.07231055*nh0.y + -0.01281584*ni0.y; + s = -0.08091763*na0.z + -0.054681346*nb0.z + -0.05769879*nc0.z + -0.06746802*nd0.z + 0.10993811*ne0.z + -0.072969966*nf0.z + -0.01040533*ng0.z + -0.03965281*nh0.z + -0.11912891*ni0.z; + t = 0.014088187*na0.w + -0.019559423*nb0.w + 0.038119223*nc0.w + 0.1502782*nd0.w + 0.16802892*ne0.w + 0.08819164*nf0.w + 0.04723983*ng0.w + 0.06890399*nh0.w + 0.034448624*ni0.w; + u = -0.0858311*na1.x + -0.058720604*nb1.x + -0.035645936*nc1.x + 0.019476032*nd1.x + 0.05014742*ne1.x + -0.07904676*nf1.x + -0.068997994*ng1.x + -0.026701262*nh1.x + -0.0018194377*ni1.x; + v = -0.023095097*na1.y + 0.023309603*nb1.y + 0.008035192*nc1.y + -0.14357762*nd1.y + -0.07056337*ne1.y + -0.04978034*nf1.y + -0.011420839*ng1.y + -0.10852049*nh1.y + 0.0003215605*ni1.y; + w = 0.04865363*na1.z + 0.054601*nb1.z + -0.04116284*nc1.z + 0.027501578*nd1.z + -0.055441584*ne1.z + -0.03507437*nf1.z + 0.001497289*ng1.z + 0.06957507*nh1.z + 0.10106299*ni1.z; + x = 0.06623774*na1.w + -0.0014704927*nb1.w + -0.013376718*nc1.w + 0.1173909*nd1.w + -0.153007*ne1.w + 0.038331937*nf1.w + 0.0053380616*ng1.w + 0.23239858*nh1.w + -0.035740767*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.026452431; + i = -0.019092122*a0.x + -0.09086277*b0.x + 0.23840043*c0.x + -0.0072265393*d0.x + 0.028365666*e0.x + 0.04606777*f0.x + 0.28634426*g0.x + 0.13639422*h0.x + 0.15366435*i0.x; + j = 0.01497688*a0.y + 0.051576726*b0.y + 0.012609459*c0.y + -0.003204774*d0.y + 0.07865389*e0.y + -0.043380044*f0.y + -0.022966493*g0.y + 0.060422853*h0.y + -0.13592103*i0.y; + k = -0.019054832*a0.z + -0.12396902*b0.z + 0.06679998*c0.z + 0.015159906*d0.z + -0.17882915*e0.z + -0.013451344*f0.z + -0.037844297*g0.z + 0.044634007*h0.z + 0.09841763*i0.z; + l = 0.1242496*a0.w + 0.14570023*b0.w + -0.0536087*c0.w + 0.0058937743*d0.w + -0.18741275*e0.w + -0.05405417*f0.w + 0.11184961*g0.w + -0.06134286*h0.w + 0.09723279*i0.w; + m = -0.039362982*a1.x + -0.079569794*b1.x + 0.09229459*c1.x + 0.12174467*d1.x + -0.26060775*e1.x + 0.045963716*f1.x + -0.048531428*g1.x + -0.009784208*h1.x + -0.08540155*i1.x; + n = -0.042776912*a1.y + 0.05803079*b1.y + 0.0009079167*c1.y + -0.10837513*d1.y + 0.03783227*e1.y + 0.03751572*f1.y + -0.11406614*g1.y + 0.059730146*h1.y + 0.07586286*i1.y; + o = -0.037720762*a1.z + -0.0010612243*b1.z + 0.10598368*c1.z + -0.054114938*d1.z + -0.31531176*e1.z + 0.008115098*f1.z + 0.014513204*g1.z + -0.020305524*h1.z + -0.0532531*i1.z; + p = -0.0015348935*a1.w + -0.0136528*b1.w + -0.049160857*c1.w + -0.01870342*d1.w + 0.04801573*e1.w + -0.003977191*f1.w + 0.015746452*g1.w + -0.12886392*h1.w + 0.024754394*i1.w; + q = 0.007092857*na0.x + -0.08710648*nb0.x + 0.015883893*nc0.x + 0.15110812*nd0.x + -0.5903739*ne0.x + 0.117669456*nf0.x + -0.18934238*ng0.x + -0.21404389*nh0.x + 0.11136142*ni0.x; + r = -0.25414848*na0.y + -0.17851315*nb0.y + 0.052724008*nc0.y + -0.29529995*nd0.y + -0.0861469*ne0.y + -0.0726801*nf0.y + -0.056918535*ng0.y + -0.09571194*nh0.y + -0.008321754*ni0.y; + s = -0.054942016*na0.z + 0.056283783*nb0.z + -0.10146946*nc0.z + -0.20149462*nd0.z + 0.2615956*ne0.z + -0.060734283*nf0.z + 0.072493576*ng0.z + 0.013873488*nh0.z + -0.05927832*ni0.z; + t = -0.02162006*na0.w + -0.13530779*nb0.w + 0.015482059*nc0.w + -0.0032522178*nd0.w + 0.21423261*ne0.w + 0.0285138*nf0.w + -0.13833298*ng0.w + 0.11485339*nh0.w + -0.070087075*ni0.w; + u = 0.0038275998*na1.x + 0.13350129*nb1.x + -0.112879656*nc1.x + 0.01186888*nd1.x + 0.6276104*ne1.x + -0.12892282*nf1.x + 0.013344215*ng1.x + 0.10528361*nh1.x + 0.13124417*ni1.x; + v = 0.055806052*na1.y + -0.06348023*nb1.y + 0.02085426*nc1.y + 0.08150835*nd1.y + -0.1556977*ne1.y + 0.029980408*nf1.y + 0.052578572*ng1.y + -0.022157064*nh1.y + -0.002322045*ni1.y; + w = 0.012891871*na1.z + -0.022318032*nb1.z + -0.13572417*nc1.z + -0.06485001*nd1.z + 0.16181162*ne1.z + -0.06267603*nf1.z + 0.0011934403*ng1.z + 0.070938624*nh1.z + 0.01252789*ni1.z; + x = 0.026072396*na1.w + -0.010732958*nb1.w + 0.046689223*nc1.w + -0.13713975*nd1.w + 0.1539983*ne1.w + -0.054844245*nf1.w + -0.08702756*ng1.w + 0.05541185*nh1.w + -0.030015115*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.001493891; + i = -0.2029684*a0.x + -0.5433984*b0.x + -0.3404616*c0.x + 0.052867394*d0.x + -0.3473272*e0.x + -0.15649731*f0.x + -0.23871002*g0.x + -0.1109204*h0.x + -0.22829787*i0.x; + j = 0.044766348*a0.y + 0.0075613745*b0.y + -0.24642573*c0.y + 0.06352247*d0.y + -0.08041809*e0.y + -0.03975498*f0.y + -0.075066246*g0.y + -0.071659416*h0.y + -0.15419307*i0.y; + k = 0.13883616*a0.z + 0.38315442*b0.z + -0.07305248*c0.z + 0.11842109*d0.z + -0.12933512*e0.z + -0.06339081*f0.z + -0.061098322*g0.z + -0.011412765*h0.z + 0.021311197*i0.z; + l = -0.107254796*a0.w + 0.1133037*b0.w + 0.09230633*c0.w + 0.15860972*d0.w + 0.048703972*e0.w + -0.04537395*f0.w + 0.111755155*g0.w + 0.18001053*h0.w + -0.04715647*i0.w; + m = -0.030681103*a1.x + -0.01730047*b1.x + -0.00261708*c1.x + -0.08639173*d1.x + -0.23224998*e1.x + 0.04507707*f1.x + -0.08558757*g1.x + -0.06275244*h1.x + 0.036656402*i1.x; + n = -0.037630294*a1.y + -0.14100103*b1.y + -0.20430483*c1.y + 0.033603456*d1.y + 0.16065453*e1.y + -0.0001391955*f1.y + 0.18134886*g1.y + -0.14686634*h1.y + 0.041554898*i1.y; + o = -0.10045714*a1.z + -0.192881*b1.z + -0.05901973*c1.z + -0.20419008*d1.z + -0.050205123*e1.z + -0.17184749*f1.z + 0.06792742*g1.z + 0.00396447*h1.z + -0.010734883*i1.z; + p = 0.06347656*a1.w + 0.055015985*b1.w + 0.1896647*c1.w + 0.1223147*d1.w + 0.391878*e1.w + 0.15969121*f1.w + 0.09271096*g1.w + 0.1580006*h1.w + 0.024834886*i1.w; + q = 0.18948026*na0.x + -0.0008232371*nb0.x + 0.14355972*nc0.x + 0.420433*nd0.x + -0.30479485*ne0.x + 0.11691138*nf0.x + 0.22751662*ng0.x + -0.06334774*nh0.x + -0.10960608*ni0.x; + r = -0.10958855*na0.y + -0.104264155*nb0.y + 0.030050436*nc0.y + 0.15551548*nd0.y + -0.103276476*ne0.y + -0.09604516*nf0.y + 0.0502458*ng0.y + 0.18014862*nh0.y + 0.08645385*ni0.y; + s = 0.004778244*na0.z + -0.15352857*nb0.z + 0.076735005*nc0.z + -0.030288707*nd0.z + 0.32527444*ne0.z + -0.021542786*nf0.z + 0.056891233*ng0.z + 0.029728781*nh0.z + 0.073643975*ni0.z; + t = -0.10808804*na0.w + -0.020803692*nb0.w + -0.080507904*nc0.w + -0.024862716*nd0.w + -0.4074744*ne0.w + -0.0013651325*nf0.w + -0.038106095*ng0.w + -0.33806917*nh0.w + -0.121994264*ni0.w; + u = 0.09291953*na1.x + 0.08922977*nb1.x + 0.13398977*nc1.x + 0.1743847*nd1.x + 0.36668244*ne1.x + 0.16027638*nf1.x + 0.10165976*ng1.x + 0.16359653*nh1.x + 0.15654418*ni1.x; + v = 0.15836778*na1.y + 0.07225184*nb1.y + 0.14402899*nc1.y + -0.058226164*nd1.y + -0.08563047*ne1.y + -0.13314581*nf1.y + -0.23650183*ng1.y + -0.13838924*nh1.y + -0.02972749*ni1.y; + w = -0.11585181*na1.z + -0.036293514*nb1.z + 0.16113761*nc1.z + 0.1201051*nd1.z + -0.15653205*ne1.z + 0.014206818*nf1.z + -0.035099678*ng1.z + -0.09631885*nh1.z + -0.083426096*ni1.z; + x = -0.002398999*na1.w + 0.04186464*nb1.w + 0.03738504*nc1.w + -0.1793729*nd1.w + 0.022120971*ne1.w + 0.021679237*nf1.w + -0.036145337*ng1.w + -0.0013587712*nh1.w + -0.04066518*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.013275004; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN50 +//!BIND LUMAN51 +//!SAVE LUMAN60 + +#define L0_tex LUMAN50_tex +#define L1_tex LUMAN51_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.0023328534*a0.x + 0.064793706*b0.x + 0.13137315*c0.x + -0.08144926*d0.x + 0.10695711*e0.x + -0.0755808*f0.x + 0.03415385*g0.x + -0.08380857*h0.x + 0.07275955*i0.x; + float j = -0.100906454*a0.y + -0.016975228*b0.y + 0.08030283*c0.y + 0.07125107*d0.y + 0.209759*e0.y + 0.1479306*f0.y + 0.06908754*g0.y + -0.076900385*h0.y + 0.03856468*i0.y; + float k = -0.046562966*a0.z + 0.09214668*b0.z + 0.035977118*c0.z + 0.109999955*d0.z + 0.11875673*e0.z + -0.020831538*f0.z + 0.13520765*g0.z + 0.08756613*h0.z + 0.014693053*i0.z; + float l = -0.065421455*a0.w + -0.107463524*b0.w + 0.016045967*c0.w + 0.018637523*d0.w + 0.052398868*e0.w + 0.2073138*f0.w + 0.076807156*g0.w + 0.2412724*h0.w + 0.054381493*i0.w; + float m = -0.021103308*a1.x + 0.024509076*b1.x + -0.042548016*c1.x + -0.13146673*d1.x + -0.022827815*e1.x + -0.066952296*f1.x + 0.10200906*g1.x + -0.091980994*h1.x + -0.06296656*i1.x; + float n = 0.2139278*a1.y + 0.22893451*b1.y + 0.09091571*c1.y + 0.04707812*d1.y + 0.33085123*e1.y + 0.25524098*f1.y + 0.18050957*g1.y + 0.11280443*h1.y + 0.013663248*i1.y; + float o = 0.04662038*a1.z + 0.020816704*b1.z + -0.060241304*c1.z + 0.030631166*d1.z + 0.13896711*e1.z + -0.08040418*f1.z + -0.12400517*g1.z + -0.012480961*h1.z + -0.025484385*i1.z; + float p = -0.099704094*a1.w + -0.06509334*b1.w + -0.018391868*c1.w + 0.0033737472*d1.w + 0.019923119*e1.w + -0.04522104*f1.w + -0.004225413*g1.w + -0.123058476*h1.w + -0.10244464*i1.w; + float q = -0.007825052*na0.x + -0.027427772*nb0.x + -0.015301882*nc0.x + 0.1567665*nd0.x + -0.06912613*ne0.x + 0.015112322*nf0.x + 0.12380591*ng0.x + 0.041814685*nh0.x + -0.026952421*ni0.x; + float r = 0.057297777*na0.y + -0.07565621*nb0.y + -0.0783251*nc0.y + -0.08975966*nd0.y + -0.06767529*ne0.y + -0.14912416*nf0.y + -0.1419718*ng0.y + -0.024593588*nh0.y + -0.057069726*ni0.y; + float s = 0.16402707*na0.z + 0.123968214*nb0.z + 0.055898797*nc0.z + 0.0049678953*nd0.z + 0.116354525*ne0.z + 0.1302255*nf0.z + -0.13494058*ng0.z + 0.22029555*nh0.z + 0.07076266*ni0.z; + float t = 0.14263879*na0.w + 0.16390547*nb0.w + 0.13133223*nc0.w + -0.025501277*nd0.w + 0.022351695*ne0.w + -0.0669175*nf0.w + -0.011532269*ng0.w + -0.18873638*nh0.w + -0.087589785*ni0.w; + float u = -0.07297858*na1.x + -0.15550973*nb1.x + 0.0047679497*nc1.x + -0.035416875*nd1.x + -0.08521186*ne1.x + -0.041888446*nf1.x + -0.0717547*ng1.x + -0.04631239*nh1.x + 0.010076916*ni1.x; + float v = 0.05423491*na1.y + -0.21764006*nb1.y + -0.107588634*nc1.y + -0.12051383*nd1.y + -0.06299794*ne1.y + -0.05008003*nf1.y + -0.0055367723*ng1.y + 0.016887318*nh1.y + 0.13362682*ni1.y; + float w = -0.1068631*na1.z + 0.034638334*nb1.z + -0.009606332*nc1.z + -0.09290256*nd1.z + -0.16951458*ne1.z + 0.11512481*nf1.z + 0.058622256*ng1.z + -0.093306124*nh1.z + -0.091385804*ni1.z; + float x = 0.09943962*na1.w + 0.046493366*nb1.w + -0.010393254*nc1.w + 0.021576924*nd1.w + 0.046211373*ne1.w + -0.023459839*nf1.w + -0.029110817*ng1.w + -0.0026221299*nh1.w + 0.045499146*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0044076787; + i = 0.046037015*a0.x + -0.20014718*b0.x + -0.050648395*c0.x + 0.14622693*d0.x + 0.04686424*e0.x + 0.115389556*f0.x + -0.09658768*g0.x + 0.113019705*h0.x + -0.08457916*i0.x; + j = 0.04837194*a0.y + 0.017981997*b0.y + -0.057005353*c0.y + 0.11208802*d0.y + -0.27299806*e0.y + 0.253538*f0.y + 0.1579276*g0.y + 0.18482813*h0.y + -0.0030665721*i0.y; + k = 0.025618808*a0.z + -0.014753779*b0.z + 0.11424065*c0.z + -0.039130658*d0.z + -0.077596694*e0.z + -0.06189349*f0.z + -0.00055544026*g0.z + -0.0030258696*h0.z + -0.03805638*i0.z; + l = 0.0396419*a0.w + -0.08394604*b0.w + -0.0958592*c0.w + -0.052551508*d0.w + -0.14271393*e0.w + -0.21775384*f0.w + 0.064173386*g0.w + -0.2541221*h0.w + 0.12580013*i0.w; + m = -0.062242437*a1.x + -0.05984731*b1.x + 0.07177733*c1.x + -0.0010727174*d1.x + -0.2148164*e1.x + 0.17201327*f1.x + -0.08118757*g1.x + -0.02247559*h1.x + 0.10099783*i1.x; + n = -0.027749883*a1.y + -0.10161952*b1.y + -0.122889414*c1.y + -0.064740315*d1.y + 0.23500724*e1.y + -0.043876413*f1.y + -0.1109669*g1.y + 0.06332242*h1.y + -0.046353713*i1.y; + o = -0.0050889878*a1.z + 0.028743066*b1.z + 0.14333661*c1.z + -0.0038749718*d1.z + 0.04225466*e1.z + 0.08372675*f1.z + -0.026901118*g1.z + -0.057206213*h1.z + -0.11625423*i1.z; + p = 0.06871033*a1.w + -0.036982935*b1.w + 0.008396837*c1.w + 0.049070083*d1.w + 0.16440327*e1.w + 0.028823575*f1.w + 0.015017149*g1.w + 0.047464818*h1.w + 0.15167558*i1.w; + q = 0.058808442*na0.x + 0.07618759*nb0.x + -0.07531338*nc0.x + -0.21605514*nd0.x + -0.23420495*ne0.x + -0.31268212*nf0.x + -0.051698856*ng0.x + -0.11017567*nh0.x + 0.11262677*ni0.x; + r = -0.03518726*na0.y + 0.06715704*nb0.y + 0.049414575*nc0.y + -0.03147147*nd0.y + 0.10408503*ne0.y + 0.015476035*nf0.y + -0.09080876*ng0.y + -0.1327499*nh0.y + 0.037832085*ni0.y; + s = -0.0049664024*na0.z + 0.01783228*nb0.z + -0.09306831*nc0.z + 0.02966074*nd0.z + -0.13659412*ne0.z + 0.103386335*nf0.z + 0.0039585214*ng0.z + -0.10475919*nh0.z + -0.07868313*ni0.z; + t = -0.027448364*na0.w + 0.049910434*nb0.w + 0.04629656*nc0.w + 0.04606205*nd0.w + -0.08058761*ne0.w + 0.19123064*nf0.w + -0.03994525*ng0.w + 0.07180471*nh0.w + -0.11458842*ni0.w; + u = 0.08074149*na1.x + 0.16658387*nb1.x + 0.08585271*nc1.x + 0.06220538*nd1.x + 0.025161874*ne1.x + 0.002386364*nf1.x + 0.07634237*ng1.x + 0.014812471*nh1.x + -0.03701967*ni1.x; + v = -0.0418336*na1.y + -0.056149974*nb1.y + -0.091469795*nc1.y + 0.1307059*nd1.y + -0.37983438*ne1.y + -0.5405711*nf1.y + 0.024360469*ng1.y + 0.21794999*nh1.y + -0.20875533*ni1.y; + w = -0.02660547*na1.z + -0.13768345*nb1.z + -0.0033622494*nc1.z + -0.022334186*nd1.z + -0.03950232*ne1.z + 0.021272644*nf1.z + 0.028884187*ng1.z + 0.13566218*nh1.z + 0.017871113*ni1.z; + x = -0.07330508*na1.w + 0.026229024*nb1.w + -0.011504151*nc1.w + -0.019414637*nd1.w + -0.14128768*ne1.w + 0.16297776*nf1.w + 0.069985695*ng1.w + 0.061362997*nh1.w + 0.084847815*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0041278936; + i = -0.05720563*a0.x + 0.057983294*b0.x + 0.0339593*c0.x + 0.064571634*d0.x + -0.20921943*e0.x + -0.013970842*f0.x + 0.026166726*g0.x + -0.041072275*h0.x + 0.01610475*i0.x; + j = -0.11969899*a0.y + -0.024872895*b0.y + 0.098103285*c0.y + 0.07863271*d0.y + 0.031222403*e0.y + -0.114472054*f0.y + 0.08776073*g0.y + 0.1264496*h0.y + 0.0402211*i0.y; + k = -0.030170271*a0.z + 0.0018764718*b0.z + -0.027332861*c0.z + 0.062330324*d0.z + 0.10290415*e0.z + 0.14791936*f0.z + 0.045651324*g0.z + 0.117724515*h0.z + 0.21746355*i0.z; + l = -0.048120335*a0.w + 0.037827358*b0.w + 0.015677916*c0.w + 0.039548885*d0.w + 0.038568195*e0.w + -0.023876693*f0.w + -0.0026781922*g0.w + -0.12731688*h0.w + -0.089386*i0.w; + m = -0.050546445*a1.x + 0.04402385*b1.x + -0.01841782*c1.x + -0.17501399*d1.x + -0.1780696*e1.x + -0.1347531*f1.x + -0.013775902*g1.x + 0.15184507*h1.x + 0.067993574*i1.x; + n = 0.06067288*a1.y + 0.020058522*b1.y + 0.0064884624*c1.y + -0.23260388*d1.y + -0.28992143*e1.y + -0.07061862*f1.y + -0.034785822*g1.y + -0.0793457*h1.y + -0.23899145*i1.y; + o = 0.022000503*a1.z + -0.071197905*b1.z + -0.049395315*c1.z + -0.0069849472*d1.z + 0.28265312*e1.z + 0.0645686*f1.z + -0.075388685*g1.z + -0.3408368*h1.z + -0.046410777*i1.z; + p = -0.0073897485*a1.w + -0.0030118083*b1.w + -0.055616233*c1.w + 0.075406134*d1.w + 0.023296187*e1.w + 0.22175246*f1.w + -0.039796658*g1.w + 0.08415068*h1.w + 0.11574001*i1.w; + q = -0.0464031*na0.x + -0.09764388*nb0.x + -0.08282094*nc0.x + -0.117494546*nd0.x + 0.18278615*ne0.x + 0.060395755*nf0.x + 0.016666938*ng0.x + 0.065874204*nh0.x + -0.05239314*ni0.x; + r = 0.055310417*na0.y + -0.037919335*nb0.y + 0.005939001*nc0.y + -0.034767736*nd0.y + 0.31564963*ne0.y + -0.072183535*nf0.y + -0.17022869*ng0.y + -0.33137664*nh0.y + -0.124336995*ni0.y; + s = 0.023502233*na0.z + 0.07160557*nb0.z + 0.096604556*nc0.z + -0.024247825*nd0.z + -0.24521804*ne0.z + -0.14877447*nf0.z + -0.050775077*ng0.z + -0.2936305*nh0.z + -0.15759036*ni0.z; + t = 0.048754975*na0.w + -0.023362307*nb0.w + -0.009928164*nc0.w + -0.026300179*nd0.w + -0.09734495*ne0.w + -0.06623416*nf0.w + -0.07600827*ng0.w + 0.08001888*nh0.w + 0.05388996*ni0.w; + u = -0.040832303*na1.x + 0.008556898*nb1.x + 0.0011466276*nc1.x + 0.1837227*nd1.x + 0.2568269*ne1.x + 0.050614744*nf1.x + 0.033623144*ng1.x + -0.08975142*nh1.x + -0.072304465*ni1.x; + v = -0.031529695*na1.y + -0.08658768*nb1.y + -0.062140666*nc1.y + 0.19025032*nd1.y + 0.21660827*ne1.y + 0.050144237*nf1.y + 0.07365049*ng1.y + 0.26017582*nh1.y + 0.2243008*ni1.y; + w = 0.03566439*na1.z + 0.1348235*nb1.z + 0.019010197*nc1.z + -0.018993806*nd1.z + -0.28596598*ne1.z + 0.0075408868*nf1.z + 0.09171176*ng1.z + 0.2642931*nh1.z + 0.071677156*ni1.z; + x = 0.019524738*na1.w + -0.025530815*nb1.w + 0.009337825*nc1.w + -0.077851355*nd1.w + -0.06228772*ne1.w + -0.056282073*nf1.w + 0.09834586*ng1.w + 0.022084989*nh1.w + -0.09770484*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.008795879; + i = 0.011957833*a0.x + 0.24993116*b0.x + -0.002682511*c0.x + 0.09202492*d0.x + -0.058194473*e0.x + 0.20236294*f0.x + -0.045782674*g0.x + 0.18085079*h0.x + -0.0007733444*i0.x; + j = 0.06615865*a0.y + 0.06730262*b0.y + -0.15511134*c0.y + -0.056761254*d0.y + 0.16833608*e0.y + 0.29652697*f0.y + 0.07208219*g0.y + 0.12632033*h0.y + 0.08936451*i0.y; + k = -0.035943326*a0.z + -0.010642242*b0.z + 0.086488046*c0.z + 0.012203811*d0.z + 0.31983772*e0.z + -0.024014914*f0.z + 0.018321209*g0.z + 0.100251*h0.z + 0.13954958*i0.z; + l = -0.0104503175*a0.w + -0.20468268*b0.w + -0.12733395*c0.w + -0.014340496*d0.w + -0.0012792454*e0.w + -0.105142586*f0.w + -0.03303492*g0.w + -0.012410842*h0.w + 0.01961328*i0.w; + m = 0.00015735891*a1.x + -0.26152962*b1.x + -0.003443904*c1.x + -0.09770607*d1.x + 0.044304006*e1.x + 0.023186417*f1.x + 0.0044261245*g1.x + -0.07075799*h1.x + -0.056546647*i1.x; + n = -0.026539521*a1.y + 0.29586637*b1.y + 0.31409112*c1.y + -0.14105357*d1.y + 0.18564008*e1.y + 0.21619162*f1.y + 0.19983022*g1.y + 0.01797262*h1.y + -0.028071435*i1.y; + o = 0.037473988*a1.z + -0.04496412*b1.z + -0.11825187*c1.z + -0.10086509*d1.z + 0.15808839*e1.z + -0.44962603*f1.z + -0.01843067*g1.z + -0.16569562*h1.z + -0.11665053*i1.z; + p = -0.036413506*a1.w + 0.10740355*b1.w + -0.06874833*c1.w + -0.04672398*d1.w + 0.16801305*e1.w + -0.04901428*f1.w + -0.025827173*g1.w + -0.04907921*h1.w + 0.11648403*i1.w; + q = 0.014651736*na0.x + 0.09767451*nb0.x + 0.0364797*nc0.x + 0.031390887*nd0.x + 0.2291563*ne0.x + -0.20164289*nf0.x + 0.06956926*ng0.x + -0.027178623*nh0.x + 0.06383271*ni0.x; + r = 0.002828036*na0.y + -0.09226963*nb0.y + -0.12876321*nc0.y + -0.109815165*nd0.y + 0.033563435*ne0.y + -0.17216623*nf0.y + -0.06648531*ng0.y + -0.18780257*nh0.y + -0.032364648*ni0.y; + s = -0.006287264*na0.z + 0.00123886*nb0.z + -0.015670354*nc0.z + 0.019913454*nd0.z + -0.06438532*ne0.z + 0.17462069*nf0.z + 0.004444823*ng0.z + -0.061344486*nh0.z + -0.1289914*ni0.z; + t = -0.032365125*na0.w + 0.13831198*nb0.w + 0.1960693*nc0.w + -0.12155524*nd0.w + 0.0853176*ne0.w + 0.075043015*nf0.w + -0.0654051*ng0.w + 0.05241946*nh0.w + -0.095316775*ni0.w; + u = -0.023895213*na1.x + 0.053995147*nb1.x + -0.16778684*nc1.x + 0.14444508*nd1.x + 0.5284899*ne1.x + -0.09535227*nf1.x + 0.07941243*ng1.x + -0.04506495*nh1.x + -0.05838371*ni1.x; + v = -0.116331026*na1.y + 0.25320458*nb1.y + 0.04314606*nc1.y + -0.055427276*nd1.y + 0.41488975*ne1.y + -0.21635123*nf1.y + -0.09031083*ng1.y + -0.012773467*nh1.y + 0.14210652*ni1.y; + w = -0.073841624*na1.z + -0.025932856*nb1.z + -0.085170485*nc1.z + -0.04061003*nd1.z + -0.5516947*ne1.z + -0.18175714*nf1.z + -0.091636725*ng1.z + 0.06229114*nh1.z + -0.0422904*ni1.z; + x = 0.048132446*na1.w + -0.13811083*nb1.w + 0.11206705*nc1.w + 0.03338064*nd1.w + -0.30970797*ne1.w + 0.06381431*nf1.w + -0.0042102467*ng1.w + 0.00956657*nh1.w + 0.011325626*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.03872577; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN50 +//!BIND LUMAN51 +//!SAVE LUMAN61 + +#define L0_tex LUMAN50_tex +#define L1_tex LUMAN51_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.033646833*a0.x + 0.10032702*b0.x + 0.07672664*c0.x + -0.15228283*d0.x + 0.14604108*e0.x + -0.009682619*f0.x + -0.017508494*g0.x + -0.20209043*h0.x + -0.0009521017*i0.x; + float j = -0.010476165*a0.y + 0.033324443*b0.y + 0.14461902*c0.y + 0.06183721*d0.y + 0.15421857*e0.y + -0.12802331*f0.y + 0.027586345*g0.y + 0.0124696875*h0.y + 0.0016373133*i0.y; + float k = -0.08886994*a0.z + -0.073300235*b0.z + -0.005404674*c0.z + -0.05893552*d0.z + -0.014138546*e0.z + -0.061251454*f0.z + -0.036440812*g0.z + 0.08436395*h0.z + 0.13597581*i0.z; + float l = 0.03857152*a0.w + 0.011185113*b0.w + 0.0418685*c0.w + -0.12713286*d0.w + -0.12497824*e0.w + 0.12187931*f0.w + 0.01143971*g0.w + 0.1531618*h0.w + -0.005094794*i0.w; + float m = 0.16493323*a1.x + -0.16790906*b1.x + -0.007424873*c1.x + -0.019737665*d1.x + 0.32541034*e1.x + -0.10551009*f1.x + 0.06748345*g1.x + -0.07619556*h1.x + -0.0016914528*i1.x; + float n = -0.05048458*a1.y + -0.04336667*b1.y + 0.102540255*c1.y + -0.019675344*d1.y + -0.2230414*e1.y + 0.19778657*f1.y + -0.0056847017*g1.y + -0.1403332*h1.y + -0.021340592*i1.y; + float o = 0.040324245*a1.z + 0.03067326*b1.z + -0.06488181*c1.z + 0.13678902*d1.z + -0.15534002*e1.z + -0.23447587*f1.z + -0.014251697*g1.z + -0.14344667*h1.z + 0.058199186*i1.z; + float p = -0.07156001*a1.w + 0.03541768*b1.w + -0.08873371*c1.w + -0.15883322*d1.w + -0.22011177*e1.w + -0.06520788*f1.w + -0.054262646*g1.w + -0.050970685*h1.w + -0.031258497*i1.w; + float q = 0.04146114*na0.x + 0.080761746*nb0.x + 0.019592429*nc0.x + 0.28116655*nd0.x + 0.096100524*ne0.x + 0.10228331*nf0.x + 0.0628159*ng0.x + 0.14551347*nh0.x + 0.082707345*ni0.x; + float r = 0.047835153*na0.y + -0.04882955*nb0.y + -0.01197105*nc0.y + 0.06759022*nd0.y + -0.122022025*ne0.y + -0.046007633*nf0.y + -0.09565734*ng0.y + -0.036093384*nh0.y + 0.015027891*ni0.y; + float s = 0.069905534*na0.z + -0.009022554*nb0.z + 0.058666833*nc0.z + 0.024865663*nd0.z + -0.029687501*ne0.z + 0.05235234*nf0.z + 0.05337345*ng0.z + 0.032454923*nh0.z + -0.097156495*ni0.z; + float t = 0.023648677*na0.w + -0.11085765*nb0.w + 0.12138889*nc0.w + 0.06495529*nd0.w + 0.24705039*ne0.w + 0.0144702485*nf0.w + -0.037593596*ng0.w + -0.07377362*nh0.w + 0.037110664*ni0.w; + float u = -0.17177041*na1.x + 0.010452884*nb1.x + -0.005489181*nc1.x + 0.036922168*nd1.x + -0.106774*ne1.x + -0.024845233*nf1.x + 0.050368562*ng1.x + -0.0774007*nh1.x + -0.0862494*ni1.x; + float v = 0.1375543*na1.y + 0.1324469*nb1.y + 0.085171565*nc1.y + -0.16165945*nd1.y + 0.37410375*ne1.y + 0.13893189*nf1.y + 0.01579091*ng1.y + -0.12340413*nh1.y + 0.2030766*ni1.y; + float w = 0.0025532034*na1.z + 0.108326204*nb1.z + 0.02649299*nc1.z + -0.06487767*nd1.z + 0.2726464*ne1.z + 0.006244928*nf1.z + 0.014532157*ng1.z + 0.04829693*nh1.z + -0.053479*ni1.z; + float x = 0.108156756*na1.w + 0.019954557*nb1.w + 0.018787293*nc1.w + 0.17868373*nd1.w + 0.12412388*ne1.w + -0.064045176*nf1.w + -0.01769105*ng1.w + -0.040720694*nh1.w + -0.07799191*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.000862047; + i = -0.039971568*a0.x + -0.13860865*b0.x + 0.059578743*c0.x + 0.054580357*d0.x + 0.07117097*e0.x + 0.0058385846*f0.x + -0.03902884*g0.x + -0.11318809*h0.x + -0.111597575*i0.x; + j = -0.086450055*a0.y + -0.124518275*b0.y + 0.020062126*c0.y + -0.20558353*d0.y + -0.45414314*e0.y + -0.082487576*f0.y + -0.1515172*g0.y + 0.12671556*h0.y + 0.016241614*i0.y; + k = -0.016725514*a0.z + -0.08818584*b0.z + 0.022113374*c0.z + -0.117363*d0.z + -0.20525245*e0.z + -0.14181912*f0.z + -0.07290995*g0.z + 0.11147163*h0.z + -0.07578759*i0.z; + l = -0.03750765*a0.w + 0.052155647*b0.w + -0.021804612*c0.w + 0.09988333*d0.w + -0.27572292*e0.w + -0.09019871*f0.w + -0.07586278*g0.w + 0.019196762*h0.w + 0.010203965*i0.w; + m = 0.013703555*a1.x + -0.020751877*b1.x + 0.0775093*c1.x + -0.09004651*d1.x + -0.5128223*e1.x + -0.06329901*f1.x + 0.10937858*g1.x + -0.10808922*h1.x + 0.015974486*i1.x; + n = -0.09324005*a1.y + -0.16807376*b1.y + -0.10526527*c1.y + -0.010830986*d1.y + -0.010137756*e1.y + 0.10139828*f1.y + -0.10427358*g1.y + -0.116689995*h1.y + 0.15831418*i1.y; + o = 0.02102471*a1.z + 0.036273964*b1.z + 0.074956045*c1.z + -0.091770366*d1.z + 0.08726741*e1.z + -0.035816178*f1.z + 0.16262427*g1.z + 0.14923644*h1.z + 0.09859584*i1.z; + p = 0.002302369*a1.w + -0.012979977*b1.w + 0.11320999*c1.w + 0.07696163*d1.w + -0.15911424*e1.w + -0.1044688*f1.w + 0.048823304*g1.w + 0.09324655*h1.w + -0.0752723*i1.w; + q = -0.017380103*na0.x + -0.025678936*nb0.x + 0.037316386*nc0.x + -0.15647902*nd0.x + -0.23790553*ne0.x + 0.07412572*nf0.x + 0.009013182*ng0.x + -0.084161185*nh0.x + 0.042249765*ni0.x; + r = 0.086646855*na0.y + 0.18134682*nb0.y + 0.022913635*nc0.y + 0.05691889*nd0.y + 0.22342443*ne0.y + 0.14537199*nf0.y + 0.2649698*ng0.y + 0.17448571*nh0.y + 0.11451624*ni0.y; + s = -0.1269585*na0.z + -0.03242593*nb0.z + -0.12652342*nc0.z + 0.109687544*nd0.z + 0.037887223*ne0.z + 0.07123706*nf0.z + -0.0202993*ng0.z + -0.17222753*nh0.z + 0.014016666*ni0.z; + t = -0.069507696*na0.w + -0.15265661*nb0.w + -0.012847912*nc0.w + 0.058244247*nd0.w + 0.14982316*ne0.w + 0.17648475*nf0.w + 0.03054064*ng0.w + 0.04018764*nh0.w + -0.007209293*ni0.w; + u = 0.058386125*na1.x + 0.11898639*nb1.x + -0.031605452*nc1.x + 0.038302805*nd1.x + 0.08826856*ne1.x + 0.15199856*nf1.x + -0.19690076*ng1.x + -0.0035709224*nh1.x + 0.033497263*ni1.x; + v = -0.023674052*na1.y + 0.025953926*nb1.y + -0.17001212*nc1.y + 0.16752574*nd1.y + -0.4473576*ne1.y + -0.109902255*nf1.y + 0.06646598*ng1.y + 0.10382671*nh1.y + 0.045195088*ni1.y; + w = 0.054174628*na1.z + -0.004505771*nb1.z + 0.06162703*nc1.z + 0.18366614*nd1.z + 0.16723797*ne1.z + 0.25134555*nf1.z + -0.07620315*ng1.z + -0.11094397*nh1.z + 0.042937014*ni1.z; + x = 0.027990157*na1.w + 0.017603736*nb1.w + -0.06902197*nc1.w + -0.06853595*nd1.w + 0.107995*ne1.w + -0.043075144*nf1.w + -0.09761985*ng1.w + -0.14420354*nh1.w + -0.04139432*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.026252449; + i = 0.0787005*a0.x + -0.28859293*b0.x + -0.0067881406*c0.x + 0.29178682*d0.x + -0.100476004*e0.x + -0.08093355*f0.x + -0.031010041*g0.x + 0.14658515*h0.x + -0.090041496*i0.x; + j = 0.0686159*a0.y + 0.21001844*b0.y + 0.044678725*c0.y + 0.050581932*d0.y + 0.33996314*e0.y + 0.14433432*f0.y + 0.08620218*g0.y + -0.05678144*h0.y + -0.15260054*i0.y; + k = -0.0137613*a0.z + -0.15726678*b0.z + 0.20399995*c0.z + 0.09453541*d0.z + -0.09012798*e0.z + 0.06390615*f0.z + 0.15053074*g0.z + -0.027891546*h0.z + -0.049362328*i0.z; + l = 0.05412328*a0.w + 0.20529822*b0.w + -0.15385857*c0.w + -0.11023235*d0.w + -0.07649383*e0.w + -0.09297993*f0.w + 0.03461381*g0.w + -0.025468629*h0.w + 0.0017152915*i0.w; + m = -0.048222102*a1.x + -0.20325871*b1.x + 0.06318963*c1.x + 0.32389513*d1.x + -0.13079883*e1.x + 0.062312752*f1.x + 0.19552991*g1.x + -0.05771893*h1.x + 0.0034655593*i1.x; + n = 0.22603649*a1.y + -0.22186667*b1.y + -0.1956643*c1.y + 0.16219154*d1.y + -0.16832736*e1.y + -0.007042763*f1.y + 0.048959658*g1.y + 0.07105372*h1.y + -0.06522516*i1.y; + o = -0.038349096*a1.z + 0.0027485983*b1.z + 0.10738825*c1.z + 0.082396306*d1.z + -0.083042175*e1.z + 0.30802855*f1.z + -0.05532289*g1.z + 0.12641166*h1.z + 0.05846329*i1.z; + p = -0.02619867*a1.w + -0.16696903*b1.w + -0.023464037*c1.w + -0.06669631*d1.w + -0.2338882*e1.w + -0.32071564*f1.w + 0.078225054*g1.w + -0.024752416*h1.w + -0.21565229*i1.w; + q = -0.14719062*na0.x + 0.036166605*nb0.x + 0.03586071*nc0.x + -0.09496501*nd0.x + -0.2571935*ne0.x + -0.059871353*nf0.x + 0.1246005*ng0.x + -0.09816562*nh0.x + -0.094756044*ni0.x; + r = -0.06635919*na0.y + -0.057532493*nb0.y + 0.096980825*nc0.y + 0.036802392*nd0.y + -0.02427639*ne0.y + 0.1140418*nf0.y + 0.022975886*ng0.y + 0.004847066*nh0.y + 0.15799266*ni0.y; + s = 0.13028878*na0.z + 0.3263747*nb0.z + -0.23045464*nc0.z + 0.07008324*nd0.z + 0.16577603*ne0.z + 0.024477255*nf0.z + -0.15753885*ng0.z + 0.19609994*nh0.z + 0.10705109*ni0.z; + t = -0.13850264*na0.w + -0.3382914*nb0.w + 0.046004727*nc0.w + 0.12867244*nd0.w + -0.049569026*ne0.w + -0.008928906*nf0.w + -0.11440658*ng0.w + -0.147463*nh0.w + -0.08606203*ni0.w; + u = 0.11820253*na1.x + 0.20000514*nb1.x + 0.026139745*nc1.x + -0.19260569*nd1.x + -0.14018841*ne1.x + 0.07235604*nf1.x + -0.03838637*ng1.x + -0.09385468*nh1.x + 0.04758941*ni1.x; + v = 0.0834724*na1.y + 0.14571273*nb1.y + 0.26493275*nc1.y + -0.18859173*nd1.y + 0.21985587*ne1.y + 0.28283784*nf1.y + -0.056772046*ng1.y + 0.013765349*nh1.y + 0.054531686*ni1.y; + w = 0.084727615*na1.z + -0.24276324*nb1.z + 0.019877689*nc1.z + -0.1053572*nd1.z + 0.16096932*ne1.z + -0.038733255*nf1.z + -0.04136899*ng1.z + -0.024152098*nh1.z + -0.09792013*ni1.z; + x = 0.003288853*na1.w + 0.092284575*nb1.w + -0.07442276*nc1.w + 0.025056144*nd1.w + 0.12108035*ne1.w + 0.16446428*nf1.w + -0.036851145*ng1.w + 0.044216324*nh1.w + 0.10186219*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0015176617; + i = -0.015699264*a0.x + 0.030596672*b0.x + -0.09533272*c0.x + 0.0062539126*d0.x + 0.008770248*e0.x + 0.12371962*f0.x + -0.033431813*g0.x + -0.03436698*h0.x + 0.024540674*i0.x; + j = 0.17142779*a0.y + -0.011952496*b0.y + -0.07112966*c0.y + 0.23306139*d0.y + 0.09441627*e0.y + -0.11017719*f0.y + 0.12642872*g0.y + 0.063718885*h0.y + 0.1107114*i0.y; + k = 0.020745154*a0.z + 0.1870523*b0.z + 0.0014909132*c0.z + -0.23451832*d0.z + 0.037374016*e0.z + -0.045705926*f0.z + -0.112359606*g0.z + 0.12749946*h0.z + -0.046014808*i0.z; + l = 0.08880867*a0.w + 0.0741326*b0.w + -0.1163462*c0.w + -0.1405951*d0.w + 0.122966714*e0.w + -0.15578188*f0.w + -0.035492282*g0.w + -0.060440145*h0.w + 0.037309416*i0.w; + m = -0.09053849*a1.x + -0.055760566*b1.x + -0.029782353*c1.x + 0.039467704*d1.x + 0.07329281*e1.x + 0.03234974*f1.x + -0.09491558*g1.x + 0.034413684*h1.x + 0.07376969*i1.x; + n = -0.16104591*a1.y + 0.058542773*b1.y + 0.07579228*c1.y + 0.19043031*d1.y + -0.03681334*e1.y + 0.18739979*f1.y + -0.04505818*g1.y + -0.15832698*h1.y + -0.00827814*i1.y; + o = -0.023094185*a1.z + -0.025111288*b1.z + -0.02562611*c1.z + -0.041231755*d1.z + -0.04910127*e1.z + -0.1219653*f1.z + -0.006997529*g1.z + -0.15396258*h1.z + 0.102461934*i1.z; + p = 0.082111925*a1.w + 0.19593202*b1.w + 0.029542198*c1.w + -0.06586002*d1.w + 0.1615917*e1.w + 0.10513043*f1.w + -0.055543568*g1.w + 0.1296069*h1.w + 0.031309575*i1.w; + q = 0.17381243*na0.x + 0.16467948*nb0.x + -0.02460769*nc0.x + 0.011226765*nd0.x + 0.33458105*ne0.x + 0.014456158*nf0.x + -0.022459537*ng0.x + 0.11703303*nh0.x + 0.041535605*ni0.x; + r = -0.073164664*na0.y + -0.13298072*nb0.y + 0.053352155*nc0.y + -0.15241776*nd0.y + -0.07620294*ne0.y + 0.023966217*nf0.y + -0.022878652*ng0.y + -0.016190618*nh0.y + 0.034986023*ni0.y; + s = -0.07340512*na0.z + -0.32154587*nb0.z + -0.029413546*nc0.z + 0.13657314*nd0.z + -0.18318935*ne0.z + -0.010307318*nf0.z + 0.10293112*ng0.z + -0.20230167*nh0.z + 0.024070712*ni0.z; + t = -0.055169705*na0.w + 0.038908716*nb0.w + 0.06615996*nc0.w + -0.0834325*nd0.w + 0.008771006*ne0.w + 0.18993776*nf0.w + -0.061884392*ng0.w + 0.113585375*nh0.w + 0.07253641*ni0.w; + u = 0.057251845*na1.x + 0.06289371*nb1.x + -0.030567387*nc1.x + -0.026693162*nd1.x + 0.4123315*ne1.x + -0.055483878*nf1.x + 0.06410658*ng1.x + -0.044549458*nh1.x + -0.09532669*ni1.x; + v = -0.02968765*na1.y + 0.16411597*nb1.y + 0.0063104588*nc1.y + -0.061117187*nd1.y + -0.18275106*ne1.y + 0.085616715*nf1.y + 0.06604734*ng1.y + -0.111928746*nh1.y + -0.063621275*ni1.y; + w = 0.022099806*na1.z + -0.06566655*nb1.z + -0.016550316*nc1.z + 0.061879884*nd1.z + -0.3047371*ne1.z + -0.22423275*nf1.z + -0.038111757*ng1.z + -0.02573729*nh1.z + -0.14429528*ni1.z; + x = -0.056604154*na1.w + -0.1831198*nb1.w + -0.029289784*nc1.w + 0.040536884*nd1.w + -0.08382906*ne1.w + -0.06134529*nf1.w + 0.12357722*ng1.w + -0.041197773*nh1.w + -0.05369438*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.011146248; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN60 +//!BIND LUMAN61 +//!SAVE LUMAN70 + +#define L0_tex LUMAN60_tex +#define L1_tex LUMAN61_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.16707185*a0.x + 0.01459159*b0.x + 0.09597878*c0.x + 0.07452457*d0.x + -0.16609426*e0.x + 0.22984987*f0.x + 0.01604279*g0.x + 0.12176588*h0.x + 0.12710643*i0.x; + float j = 0.075276494*a0.y + -0.14305738*b0.y + -0.10306315*c0.y + 0.0041424287*d0.y + -0.18993132*e0.y + 0.07858037*f0.y + 0.14938961*g0.y + 0.15913264*h0.y + 0.048541065*i0.y; + float k = 0.07726489*a0.z + 0.061804272*b0.z + -0.016685195*c0.z + 0.024503086*d0.z + 0.010571629*e0.z + 0.14796981*f0.z + -0.014458555*g0.z + -0.066766694*h0.z + 0.087022305*i0.z; + float l = -0.0741828*a0.w + -0.06127295*b0.w + -0.0831812*c0.w + 0.0020672872*d0.w + -0.11349545*e0.w + -0.06560703*f0.w + -0.031534463*g0.w + 0.064463146*h0.w + -0.070401974*i0.w; + float m = 0.059070893*a1.x + -0.08030707*b1.x + -0.031248493*c1.x + 0.021566726*d1.x + 0.11074087*e1.x + 0.12531136*f1.x + 0.04273478*g1.x + -0.035572812*h1.x + -0.04251175*i1.x; + float n = 0.1207556*a1.y + -0.03475322*b1.y + -0.100367405*c1.y + 0.07478472*d1.y + -0.054013055*e1.y + 0.046478465*f1.y + -0.054475054*g1.y + 0.028075173*h1.y + 0.07847578*i1.y; + float o = -0.127887*a1.z + 0.009045883*b1.z + -0.0413301*c1.z + -0.15486814*d1.z + -0.033196386*e1.z + 0.07920617*f1.z + -0.027982794*g1.z + -0.23330143*h1.z + -0.05289495*i1.z; + float p = 0.07627091*a1.w + 0.092626214*b1.w + 0.03739464*c1.w + 0.011463141*d1.w + -0.10432715*e1.w + 0.05058091*f1.w + 0.0012654449*g1.w + 0.14053737*h1.w + -0.030011084*i1.w; + float q = -0.093068324*na0.x + 0.021927057*nb0.x + -0.119940996*nc0.x + -0.12498851*nd0.x + -0.062243253*ne0.x + -0.0657077*nf0.x + -0.07868397*ng0.x + -0.14934455*nh0.x + -0.11498485*ni0.x; + float r = 0.037383396*na0.y + 0.03412481*nb0.y + 0.080802746*nc0.y + -0.034590624*nd0.y + 0.102682725*ne0.y + -0.06089318*nf0.y + -0.07508375*ng0.y + -0.06557913*nh0.y + 0.025577186*ni0.y; + float s = 0.011167806*na0.z + -0.08456959*nb0.z + 0.03695445*nc0.z + 0.11569212*nd0.z + 0.023378948*ne0.z + -0.1296879*nf0.z + 0.041656822*ng0.z + 0.043207034*nh0.z + -0.037079945*ni0.z; + float t = 0.07834874*na0.w + 0.009891263*nb0.w + 0.099839434*nc0.w + -0.13000928*nd0.w + -0.0045935875*ne0.w + 0.019903835*nf0.w + -0.041363545*ng0.w + -0.03854393*nh0.w + 0.053775348*ni0.w; + float u = 0.042012587*na1.x + 0.14145845*nb1.x + 0.06018162*nc1.x + 0.037801825*nd1.x + -0.23456845*ne1.x + -0.16834131*nf1.x + -0.04549333*ng1.x + -0.07055851*nh1.x + 0.095839985*ni1.x; + float v = 0.0062642097*na1.y + 0.04875694*nb1.y + 0.04445962*nc1.y + 0.041629676*nd1.y + -0.04451888*ne1.y + 0.036208697*nf1.y + -0.018410044*ng1.y + -0.00222759*nh1.y + 0.019979788*ni1.y; + float w = 0.05050757*na1.z + -0.059576757*nb1.z + 0.07722044*nc1.z + 0.09021037*nd1.z + 0.0279692*ne1.z + -0.17721412*nf1.z + 0.11889603*ng1.z + 0.17959587*nh1.z + -0.009883711*ni1.z; + float x = -0.17722*na1.w + -0.1294848*nb1.w + -0.05886288*nc1.w + 0.17996617*nd1.w + -0.37909824*ne1.w + -0.10436786*nf1.w + 0.0857953*ng1.w + 0.035984337*nh1.w + -0.15937395*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.020803524; + i = 0.18760012*a0.x + -0.05672948*b0.x + -0.04035751*c0.x + 0.051190294*d0.x + -0.4160101*e0.x + -0.015525946*f0.x + 0.06301994*g0.x + 0.1546013*h0.x + 0.03517859*i0.x; + j = 0.034246188*a0.y + 0.03255839*b0.y + 0.17857063*c0.y + 0.28546038*d0.y + 0.019054411*e0.y + -0.0869243*f0.y + 0.008228919*g0.y + 0.0562388*h0.y + -0.13069227*i0.y; + k = -0.024451675*a0.z + -0.13683404*b0.z + -0.1010116*c0.z + -0.052205075*d0.z + -0.16257866*e0.z + 0.1305172*f0.z + 0.027445339*g0.z + -0.0118933255*h0.z + 0.098764986*i0.z; + l = -0.066036776*a0.w + 0.022648929*b0.w + 0.07048763*c0.w + -0.0063484786*d0.w + -0.243269*e0.w + 0.030944303*f0.w + -0.13571839*g0.w + -0.01094549*h0.w + -0.010621858*i0.w; + m = 0.03762773*a1.x + -0.08693226*b1.x + 0.07314137*c1.x + -0.013404316*d1.x + 0.14760663*e1.x + -0.32283306*f1.x + -0.056603152*g1.x + -0.06067009*h1.x + -0.17135729*i1.x; + n = 0.19832304*a1.y + -0.069314696*b1.y + 0.06315924*c1.y + -0.1030127*d1.y + -0.43251115*e1.y + -0.06101974*f1.y + -0.11535977*g1.y + -0.013645112*h1.y + -0.002090781*i1.y; + o = -0.075515576*a1.z + 0.032988884*b1.z + 0.08949724*c1.z + -0.15579495*d1.z + -0.10749708*e1.z + -0.011412682*f1.z + -0.022672031*g1.z + 0.14450091*h1.z + 0.0580288*i1.z; + p = 0.052963868*a1.w + 0.065941304*b1.w + -0.08848499*c1.w + -0.045445524*d1.w + 0.013262591*e1.w + 0.27520946*f1.w + 0.106307745*g1.w + 0.11091647*h1.w + -0.044759583*i1.w; + q = -0.13402347*na0.x + -0.06257855*nb0.x + 0.0752903*nc0.x + 0.01813476*nd0.x + 0.15062326*ne0.x + -0.24121898*nf0.x + -0.033599045*ng0.x + -0.22295438*nh0.x + 0.07236984*ni0.x; + r = -0.03748897*na0.y + -0.14177923*nb0.y + -0.037401408*nc0.y + -0.12516059*nd0.y + -0.01755814*ne0.y + 0.07203849*nf0.y + 0.036626935*ng0.y + -0.05567603*nh0.y + 0.04024097*ni0.y; + s = 0.057622183*na0.z + -0.006183752*nb0.z + 0.10726049*nc0.z + 0.19952112*nd0.z + 0.18812835*ne0.z + 0.051843926*nf0.z + -0.0002990376*ng0.z + 0.05477127*nh0.z + -0.12951618*ni0.z; + t = 0.033499256*na0.w + -0.11512289*nb0.w + -0.06745114*nc0.w + -0.12442632*nd0.w + 0.0403085*ne0.w + -0.06879559*nf0.w + 0.1063965*ng0.w + 0.020015359*nh0.w + 0.012631638*ni0.w; + u = -0.061987985*na1.x + 0.1644526*nb1.x + 0.11696878*nc1.x + 0.046437148*nd1.x + -0.1264651*ne1.x + 0.3210138*nf1.x + 0.17217772*ng1.x + 0.13374034*nh1.x + -0.05727805*ni1.x; + v = -0.056843136*na1.y + 0.047753133*nb1.y + -0.09544034*nc1.y + 0.04304065*nd1.y + 0.40721974*ne1.y + 0.100129314*nf1.y + 0.07010598*ng1.y + -0.05048358*nh1.y + -0.0026080816*ni1.y; + w = 0.08819051*na1.z + 0.037071127*nb1.z + -0.070650496*nc1.z + 0.062920175*nd1.z + 0.07917255*ne1.z + 0.12788*nf1.z + -0.017485328*ng1.z + -0.05174912*nh1.z + -0.035436332*ni1.z; + x = -0.045394093*na1.w + 0.017271686*nb1.w + 0.035120815*nc1.w + 0.25334322*nd1.w + -0.122095615*ne1.w + -0.028557297*nf1.w + -0.06654046*ng1.w + -0.14862229*nh1.w + 0.12124861*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.011939273; + i = 0.007988823*a0.x + 0.043300614*b0.x + 0.06301894*c0.x + 0.023971288*d0.x + 0.25549185*e0.x + 0.04421958*f0.x + 0.0022470562*g0.x + -0.10538949*h0.x + 0.05210963*i0.x; + j = -0.16987213*a0.y + -0.31616268*b0.y + -0.058348488*c0.y + 0.047011923*d0.y + -0.24267124*e0.y + -0.029344559*f0.y + -0.12871924*g0.y + -0.14803977*h0.y + 0.16648817*i0.y; + k = 0.032171052*a0.z + -0.099306546*b0.z + 0.17139974*c0.z + 0.05083007*d0.z + -0.0838175*e0.z + 0.06591208*f0.z + 0.037488688*g0.z + -0.14690341*h0.z + -0.08771937*i0.z; + l = -0.031773616*a0.w + -0.15480563*b0.w + -0.114856966*c0.w + 0.059143398*d0.w + 0.22674477*e0.w + -0.024911936*f0.w + -0.026028406*g0.w + -0.02581128*h0.w + -0.07086282*i0.w; + m = -0.010544171*a1.x + -0.121315874*b1.x + -0.021153478*c1.x + 0.09653259*d1.x + 0.23078552*e1.x + 0.09536591*f1.x + 0.097515665*g1.x + 0.27507824*h1.x + 0.30895805*i1.x; + n = 0.0064135334*a1.y + -0.15648791*b1.y + -0.06604209*c1.y + 0.05537567*d1.y + 0.1712115*e1.y + 0.16483422*f1.y + 0.031414956*g1.y + 0.07765021*h1.y + 0.11804431*i1.y; + o = 0.040441096*a1.z + 0.029267445*b1.z + -0.0014274184*c1.z + 0.13492791*d1.z + 0.21282202*e1.z + -0.023156036*f1.z + 0.11033489*g1.z + -0.019858988*h1.z + 0.0101667745*i1.z; + p = -0.05952965*a1.w + 0.12360287*b1.w + 0.15023205*c1.w + 0.13136087*d1.w + 0.09425458*e1.w + -0.15051837*f1.w + 0.11030205*g1.w + 0.055964366*h1.w + -0.04351984*i1.w; + q = 0.0800978*na0.x + 0.14231174*nb0.x + -0.122729294*nc0.x + -0.2446972*nd0.x + -0.058770172*ne0.x + -0.04128968*nf0.x + -0.16805433*ng0.x + 0.2870106*nh0.x + 0.11663096*ni0.x; + r = 0.19433951*na0.y + 0.22241181*nb0.y + 0.021812731*nc0.y + -0.07812733*nd0.y + -0.18069054*ne0.y + 0.031146582*nf0.y + -0.058601037*ng0.y + 0.052038964*nh0.y + 0.012479496*ni0.y; + s = -0.19189489*na0.z + -0.013886786*nb0.z + -0.15179993*nc0.z + -0.1548249*nd0.z + -0.5476674*ne0.z + -0.48016936*nf0.z + -0.089323506*ng0.z + 0.09407296*nh0.z + 0.03633839*ni0.z; + t = -0.014738748*na0.w + 0.12443845*nb0.w + 0.06398434*nc0.w + 0.031160723*nd0.w + -0.15837196*ne0.w + -0.0151074985*nf0.w + 0.082899936*ng0.w + 0.11998946*nh0.w + 0.11566883*ni0.w; + u = 0.025826976*na1.x + -0.0010483622*nb1.x + -0.10387264*nc1.x + -0.03628439*nd1.x + -0.15113765*ne1.x + -0.25192127*nf1.x + -0.06575387*ng1.x + -0.18649472*nh1.x + -0.10462416*ni1.x; + v = -0.01315456*na1.y + 0.10511144*nb1.y + -0.0059079076*nc1.y + -0.15953188*nd1.y + -0.099411644*ne1.y + 0.0130890235*nf1.y + -0.09630611*ng1.y + 0.01270137*nh1.y + -0.06623264*ni1.y; + w = -0.009895875*na1.z + -0.06556251*nb1.z + 0.020807983*nc1.z + 0.110983044*nd1.z + -0.06224234*ne1.z + -0.0017107179*nf1.z + -0.025325751*ng1.z + -0.08919119*nh1.z + 0.040737003*ni1.z; + x = 0.038011968*na1.w + -0.16423859*nb1.w + -0.04267014*nc1.w + -0.060422074*nd1.w + -0.02386611*ne1.w + 0.10199278*nf1.w + -0.08109655*ng1.w + 0.05310966*nh1.w + 0.0705772*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.016101146; + i = 0.08186986*a0.x + -0.27966294*b0.x + 0.07349518*c0.x + -0.02525529*d0.x + 0.08804907*e0.x + -0.23396638*f0.x + -0.095341004*g0.x + 0.12230629*h0.x + -0.088450216*i0.x; + j = 0.17311937*a0.y + -0.011713199*b0.y + -0.023302078*c0.y + -0.28680474*d0.y + 0.25046813*e0.y + 0.13166201*f0.y + 0.22162731*g0.y + 0.2569277*h0.y + -0.16860108*i0.y; + k = -0.13823773*a0.z + -0.32229167*b0.z + -0.09600752*c0.z + 0.01688759*d0.z + -0.015036404*e0.z + -0.006144277*f0.z + -0.049893063*g0.z + 0.0070240092*h0.z + -0.012577821*i0.z; + l = 0.027596693*a0.w + 0.07686742*b0.w + 0.059847716*c0.w + 0.064874366*d0.w + 0.37457395*e0.w + -0.08730197*f0.w + -0.06216056*g0.w + 0.15892714*h0.w + 0.10220284*i0.w; + m = 0.04762231*a1.x + -0.05717154*b1.x + -0.011567126*c1.x + -0.025255503*d1.x + 0.012369087*e1.x + 0.07555715*f1.x + 0.008033872*g1.x + -0.21224308*h1.x + -0.21989736*i1.x; + n = 0.06412487*a1.y + 0.04054021*b1.y + 0.06108249*c1.y + -0.008536781*d1.y + 0.102750435*e1.y + -0.00041976082*f1.y + -0.08412207*g1.y + 0.122296356*h1.y + -0.009252118*i1.y; + o = -0.022489117*a1.z + 0.027151579*b1.z + -0.052604277*c1.z + 0.0904872*d1.z + -0.118856296*e1.z + 0.016594423*f1.z + -0.07095765*g1.z + -0.1356925*h1.z + 0.04555555*i1.z; + p = -0.0027514708*a1.w + -0.18162079*b1.w + -0.025238771*c1.w + 0.12815496*d1.w + 0.2966293*e1.w + 0.07295546*f1.w + -0.001974208*g1.w + -0.079097986*h1.w + -0.061876595*i1.w; + q = -0.017452657*na0.x + 0.27534506*nb0.x + -0.059656087*nc0.x + -0.08268512*nd0.x + -0.13075675*ne0.x + 0.143268*nf0.x + -0.037696302*ng0.x + -0.152455*nh0.x + 0.17365775*ni0.x; + r = -0.13629195*na0.y + -0.09065064*nb0.y + 0.023805516*nc0.y + -0.116249606*nd0.y + -0.10501295*ne0.y + -0.04866309*nf0.y + 0.100499496*ng0.y + -0.15090236*nh0.y + 0.1763309*ni0.y; + s = 0.07023327*na0.z + -0.023078058*nb0.z + 0.023277761*nc0.z + -0.07977383*nd0.z + -0.109831356*ne0.z + 0.046003412*nf0.z + -0.011881196*ng0.z + -0.10053063*nh0.z + -0.086142026*ni0.z; + t = -0.011805513*na0.w + -0.07882051*nb0.w + 0.01810326*nc0.w + -0.18755534*nd0.w + -0.105580114*ne0.w + 0.06887994*nf0.w + 0.049635768*ng0.w + -0.07681415*nh0.w + -0.10049961*ni0.w; + u = -0.07036247*na1.x + 0.049210124*nb1.x + 0.0056824684*nc1.x + -0.00047676652*nd1.x + 0.037586123*ne1.x + -0.019774916*nf1.x + 0.15204369*ng1.x + 0.026581515*nh1.x + -0.009564476*ni1.x; + v = 0.040534947*na1.y + -0.07229616*nb1.y + -0.04097948*nc1.y + -0.009419609*nd1.y + -0.002633858*ne1.y + -0.0031189565*nf1.y + 0.008676045*ng1.y + -0.2262739*nh1.y + 0.12348922*ni1.y; + w = 0.048678316*na1.z + -0.078876495*nb1.z + -0.030548131*nc1.z + -0.08987738*nd1.z + 0.04284424*ne1.z + 0.01576385*nf1.z + 0.16307567*ng1.z + 0.21366584*nh1.z + -0.06277811*ni1.z; + x = 0.015810061*na1.w + 0.1067863*nb1.w + 0.04990775*nc1.w + 0.024920044*nd1.w + -0.42603993*ne1.w + -0.03960076*nf1.w + 0.057762917*ng1.w + -0.03203102*nh1.w + 0.15136312*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.028439088; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN60 +//!BIND LUMAN61 +//!SAVE LUMAN71 + +#define L0_tex LUMAN60_tex +#define L1_tex LUMAN61_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.020427955*a0.x + -0.12299448*b0.x + 0.0382103*c0.x + -0.2065043*d0.x + 0.18101963*e0.x + -0.10143672*f0.x + 0.069389276*g0.x + 0.11816535*h0.x + 0.06997783*i0.x; + float j = 0.21215856*a0.y + -0.04804419*b0.y + 0.008095651*c0.y + -0.293839*d0.y + 0.33101708*e0.y + 0.33218643*f0.y + 0.053283837*g0.y + 0.17308329*h0.y + -0.03772887*i0.y; + float k = -0.34456056*a0.z + -0.16793236*b0.z + 0.03739383*c0.z + -0.080821194*d0.z + -0.22808352*e0.z + -0.113590464*f0.z + -0.037161198*g0.z + 0.023857055*h0.z + -0.09459421*i0.z; + float l = -0.08646293*a0.w + 0.107415445*b0.w + 0.044336937*c0.w + 0.069187395*d0.w + -0.062774606*e0.w + -0.108927466*f0.w + -0.04602913*g0.w + -0.07301894*h0.w + 0.10343813*i0.w; + float m = -0.059688944*a1.x + -0.24532959*b1.x + 0.01622201*c1.x + 0.121369496*d1.x + 0.4220545*e1.x + 0.05799676*f1.x + -0.010943618*g1.x + -0.04879672*h1.x + -0.18129556*i1.x; + float n = 0.08937881*a1.y + -0.076180376*b1.y + -0.011001821*c1.y + 0.02046611*d1.y + 0.08171395*e1.y + 0.1594122*f1.y + -0.0132004395*g1.y + -0.07992791*h1.y + -0.067408495*i1.y; + float o = -0.06548962*a1.z + -0.16845347*b1.z + -0.027801726*c1.z + 0.31846458*d1.z + 0.16317068*e1.z + -0.038398925*f1.z + 0.12266141*g1.z + 0.026239803*h1.z + 0.06616569*i1.z; + float p = -0.09446756*a1.w + -0.28087494*b1.w + -0.07972108*c1.w + 0.24629132*d1.w + 0.119287975*e1.w + 0.24699649*f1.w + 0.13661574*g1.w + -0.07906541*h1.w + -0.0056392225*i1.w; + float q = 0.03538764*na0.x + 0.2790401*nb0.x + 0.08151654*nc0.x + -0.22784868*nd0.x + -0.36319312*ne0.x + -0.113029726*nf0.x + -0.10720264*ng0.x + 0.043048188*nh0.x + 0.12067008*ni0.x; + float r = 0.24458425*na0.y + -0.017716056*nb0.y + -0.07277476*nc0.y + -0.34660316*nd0.y + -0.326197*ne0.y + -0.17121781*nf0.y + 0.18105748*ng0.y + 0.054370437*nh0.y + 0.07291747*ni0.y; + float s = 0.1444308*na0.z + 0.037046615*nb0.z + -0.074410655*nc0.z + -0.0331052*nd0.z + 0.2983961*ne0.z + 0.10592076*nf0.z + -0.04357041*ng0.z + -0.08175989*nh0.z + -0.019775998*ni0.z; + float t = 0.0012991523*na0.w + -0.041375145*nb0.w + -0.061631728*nc0.w + 0.03254315*nd0.w + 0.18613961*ne0.w + 0.105121955*nf0.w + 0.111895464*ng0.w + 0.047140393*nh0.w + -0.10446484*ni0.w; + float u = 0.0008599757*na1.x + 0.025347594*nb1.x + -0.08645557*nc1.x + -0.13086848*nd1.x + 0.04430699*ne1.x + -0.04425249*nf1.x + 0.12734428*ng1.x + -0.06775437*nh1.x + -0.02977556*ni1.x; + float v = 0.042987797*na1.y + 0.22243887*nb1.y + 0.009829554*nc1.y + -0.05559989*nd1.y + 0.22480097*ne1.y + -0.12777573*nf1.y + -0.021276096*ng1.y + -0.073389776*nh1.y + 0.05349569*ni1.y; + float w = 0.22859068*na1.z + 0.071143694*nb1.z + -0.08075097*nc1.z + -0.086894736*nd1.z + -0.01395731*ne1.z + 0.13063684*nf1.z + 0.03464629*ng1.z + 0.059344422*nh1.z + 0.04601359*ni1.z; + float x = 0.15328191*na1.w + 0.18964882*nb1.w + 0.09343201*nc1.w + -0.086833306*nd1.w + -0.3459332*ne1.w + -0.23979221*nf1.w + -0.0323085*ng1.w + -0.025463346*nh1.w + 0.29438457*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.00774723; + i = 0.02540264*a0.x + 0.057967946*b0.x + 0.0756193*c0.x + 0.07650531*d0.x + -0.033239055*e0.x + 0.008858051*f0.x + -0.0009940318*g0.x + -0.037703067*h0.x + 0.26205966*i0.x; + j = -0.11909197*a0.y + 0.07580306*b0.y + 0.05527881*c0.y + 0.12937492*d0.y + -0.006751253*e0.y + -0.04913538*f0.y + -0.055807915*g0.y + 0.15184923*h0.y + 0.010444979*i0.y; + k = -9.871652e-05*a0.z + 0.040530793*b0.z + 0.1569917*c0.z + 0.012185376*d0.z + -0.5438175*e0.z + 0.055470947*f0.z + -0.049259298*g0.z + -0.0059514428*h0.z + 0.054824114*i0.z; + l = -0.08456306*a0.w + -0.019126693*b0.w + -0.021060875*c0.w + -0.03132117*d0.w + -0.033833887*e0.w + 0.012529336*f0.w + -0.00084578665*g0.w + 0.021030087*h0.w + -0.03891261*i0.w; + m = -0.056309015*a1.x + -0.10297292*b1.x + 0.11251738*c1.x + 0.08159942*d1.x + -0.122514226*e1.x + -0.079847425*f1.x + 0.11716084*g1.x + 0.049454574*h1.x + -0.050938994*i1.x; + n = 0.04500759*a1.y + -0.02995276*b1.y + -0.0060616354*c1.y + -0.027787723*d1.y + 0.08043579*e1.y + 0.17243683*f1.y + 0.04944646*g1.y + 0.01185244*h1.y + 0.025549565*i1.y; + o = 0.017759923*a1.z + 0.023875631*b1.z + -0.0016878811*c1.z + 0.085072495*d1.z + -0.04422165*e1.z + 0.025165051*f1.z + -0.044808466*g1.z + -0.2277521*h1.z + -0.046955653*i1.z; + p = 0.06976003*a1.w + 0.100424804*b1.w + -0.01778747*c1.w + 0.09177266*d1.w + -0.10005814*e1.w + 0.045143608*f1.w + -0.085984215*g1.w + -0.09975948*h1.w + -0.014967957*i1.w; + q = -0.02396588*na0.x + -0.012424523*nb0.x + -0.026491754*nc0.x + -0.124398455*nd0.x + 0.10213312*ne0.x + -0.1272105*nf0.x + -0.043681663*ng0.x + -0.11994408*nh0.x + -0.1130879*ni0.x; + r = -0.031082416*na0.y + 0.057595864*nb0.y + -0.0448145*nc0.y + 0.05464614*nd0.y + 0.1381928*ne0.y + 0.06410599*nf0.y + 0.057261996*ng0.y + 0.041460402*nh0.y + 0.052953117*ni0.y; + s = -0.12601034*na0.z + 0.071309365*nb0.z + -0.16443217*nc0.z + -0.18393376*nd0.z + 0.039121736*ne0.z + -0.25262094*nf0.z + -0.04935926*ng0.z + -0.031141888*nh0.z + -0.10622221*ni0.z; + t = 0.0707843*na0.w + 0.0298844*nb0.w + 0.013997341*nc0.w + 0.0987847*nd0.w + 0.053505234*ne0.w + 0.016743721*nf0.w + -0.021958148*ng0.w + -0.0065752435*nh0.w + 0.037387595*ni0.w; + u = 0.010219839*na1.x + 0.013594147*nb1.x + -0.097386606*nc1.x + 0.053305168*nd1.x + 0.10351772*ne1.x + 0.14909032*nf1.x + 0.009329111*ng1.x + 0.00042785183*nh1.x + 0.03540518*ni1.x; + v = 0.011846549*na1.y + 0.061299648*nb1.y + -0.009049967*nc1.y + 0.051321067*nd1.y + 0.07379161*ne1.y + -0.034670807*nf1.y + -0.037010025*ng1.y + 0.003963174*nh1.y + 0.027588818*ni1.y; + w = 0.03077586*na1.z + -0.029026378*nb1.z + -0.08913523*nc1.z + 0.07136059*nd1.z + 0.07291538*ne1.z + -0.004745367*nf1.z + 0.03465485*ng1.z + 0.22157489*nh1.z + 0.17830387*ni1.z; + x = -0.10886378*na1.w + -0.06592867*nb1.w + -0.037860826*nc1.w + 0.00437296*nd1.w + 0.17816012*ne1.w + -0.07993008*nf1.w + 0.1061081*ng1.w + 0.09556956*nh1.w + 0.07920885*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.017806575; + i = -0.027967636*a0.x + -0.3974226*b0.x + -0.104621045*c0.x + -0.15640318*d0.x + -0.24313703*e0.x + 0.10833983*f0.x + 0.034498516*g0.x + -0.111212805*h0.x + -0.0066484264*i0.x; + j = 0.34898776*a0.y + 0.08453386*b0.y + -0.14493187*c0.y + -0.062394954*d0.y + 0.017768497*e0.y + 0.016403986*f0.y + 0.008856344*g0.y + -0.049575865*h0.y + 0.07749693*i0.y; + k = -0.07570748*a0.z + -0.33858824*b0.z + -0.19494228*c0.z + -0.13904461*d0.z + -0.28649932*e0.z + -0.07591364*f0.z + 0.083951026*g0.z + 0.0083411895*h0.z + -0.0806109*i0.z; + l = 0.084906526*a0.w + 0.043091387*b0.w + 0.06524473*c0.w + 0.11896168*d0.w + 0.4036274*e0.w + -0.099725835*f0.w + -0.09322391*g0.w + 0.06554854*h0.w + -0.07920316*i0.w; + m = 0.103149265*a1.x + 0.09379966*b1.x + -0.11465655*c1.x + 0.05819121*d1.x + 0.44112626*e1.x + -0.008220044*f1.x + -0.052106164*g1.x + -0.05718799*h1.x + 0.055597268*i1.x; + n = 0.03208524*a1.y + 0.047358923*b1.y + 0.079363085*c1.y + -0.08852368*d1.y + 0.013399863*e1.y + -0.076518625*f1.y + -0.053747185*g1.y + 0.034843802*h1.y + -0.04375299*i1.y; + o = 0.0872293*a1.z + -0.109462485*b1.z + -0.070991404*c1.z + -0.0003856647*d1.z + -0.15613072*e1.z + 0.069763996*f1.z + 0.07777321*g1.z + -0.09938978*h1.z + 0.022947747*i1.z; + p = -0.15075473*a1.w + -0.40277463*b1.w + -0.09087062*c1.w + -0.095137954*d1.w + 0.013284446*e1.w + -0.07939426*f1.w + 0.07534805*g1.w + -0.21933137*h1.w + 0.07597216*i1.w; + q = 0.05529762*na0.x + 0.5643769*nb0.x + 0.1525933*nc0.x + 0.15038446*nd0.x + 0.23356788*ne0.x + -0.08914753*nf0.x + 0.021691134*ng0.x + 0.3045392*nh0.x + 0.0035494857*ni0.x; + r = -0.14748119*na0.y + 0.15565526*nb0.y + 0.14430578*nc0.y + -0.26224518*nd0.y + 0.20457776*ne0.y + 0.15587778*nf0.y + 0.113763526*ng0.y + -0.0038962625*nh0.y + 0.0028991853*ni0.y; + s = 0.095023744*na0.z + -0.20927958*nb0.z + 0.03397999*nc0.z + 0.13496824*nd0.z + 0.26218286*ne0.z + 0.06425366*nf0.z + -0.044739686*ng0.z + -0.07387857*nh0.z + 0.09531976*ni0.z; + t = -0.08336938*na0.w + -0.058455873*nb0.w + 0.027722135*nc0.w + -0.06443187*nd0.w + -0.119230665*ne0.w + 0.056134336*nf0.w + 0.16522501*ng0.w + -0.016409501*nh0.w + 0.03460061*ni0.w; + u = -0.19015406*na1.x + -0.13403434*nb1.x + 0.0062869973*nc1.x + -0.10456645*nd1.x + -0.15624808*ne1.x + 0.036319517*nf1.x + 0.13136101*ng1.x + -0.08900796*nh1.x + -0.056879304*ni1.x; + v = -0.08094239*na1.y + 0.07242798*nb1.y + 0.0057236864*nc1.y + -0.04243141*nd1.y + 0.24958204*ne1.y + 0.13537963*nf1.y + 0.023295095*ng1.y + -0.00995568*nh1.y + 0.1266285*ni1.y; + w = -0.048188806*na1.z + 0.03503379*nb1.z + 0.043767393*nc1.z + -0.090857185*nd1.z + 0.037315335*ne1.z + 0.13315836*nf1.z + -0.17816217*ng1.z + 0.05826157*nh1.z + -0.03337344*ni1.z; + x = 0.12771568*na1.w + 0.27837166*nb1.w + 0.034090616*nc1.w + -0.09378682*nd1.w + 0.16186482*ne1.w + -0.27224994*nf1.w + -0.20890142*ng1.w + 0.079806164*nh1.w + -0.053670608*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.014841039; + i = 0.009409041*a0.x + -0.07351588*b0.x + -0.053960185*c0.x + -0.00039128572*d0.x + -0.20716943*e0.x + -0.055470668*f0.x + 0.1470315*g0.x + -0.0069380105*h0.x + 0.11312721*i0.x; + j = 0.061510608*a0.y + -0.15638562*b0.y + 0.10619936*c0.y + 0.536396*d0.y + 0.39904788*e0.y + -0.016805295*f0.y + -0.18737078*g0.y + 0.081641555*h0.y + 0.13490897*i0.y; + k = 0.048978038*a0.z + 0.38890696*b0.z + 0.07112136*c0.z + -0.025988413*d0.z + 0.2416053*e0.z + -0.059832115*f0.z + 0.1512881*g0.z + -0.06985439*h0.z + -0.002822441*i0.z; + l = -0.15069428*a0.w + -0.029694725*b0.w + -0.034548882*c0.w + 0.17521743*d0.w + -0.14802086*e0.w + 0.03244504*f0.w + -0.028429842*g0.w + -0.072642036*h0.w + -0.1377792*i0.w; + m = 0.008575682*a1.x + 0.033175733*b1.x + 0.23012964*c1.x + 0.06180262*d1.x + 0.0999609*e1.x + -0.02964116*f1.x + -0.071621336*g1.x + 0.08913871*h1.x + 0.012078745*i1.x; + n = 0.10756925*a1.y + -0.12054749*b1.y + -0.11993612*c1.y + -0.05570062*d1.y + 0.26974162*e1.y + -0.019340996*f1.y + -0.04401674*g1.y + -0.072913505*h1.y + 0.0020360341*i1.y; + o = -0.11235567*a1.z + 0.10706251*b1.z + -0.05232752*c1.z + 0.024162654*d1.z + -0.016020348*e1.z + 0.14959016*f1.z + -0.07076375*g1.z + -0.12533532*h1.z + -0.011636851*i1.z; + p = -0.01996831*a1.w + 0.1160153*b1.w + -0.13922714*c1.w + -0.029968955*d1.w + -0.23581982*e1.w + 0.11195416*f1.w + 0.047328863*g1.w + 0.27882084*h1.w + 0.12671103*i1.w; + q = -0.009971324*na0.x + -0.10869965*nb0.x + 0.035636835*nc0.x + -0.02722658*nd0.x + -0.25910825*ne0.x + 0.03161085*nf0.x + 0.11639807*ng0.x + -0.010749773*nh0.x + -0.24573305*ni0.x; + r = 0.050995197*na0.y + -0.10302342*nb0.y + -0.1673679*nc0.y + -0.20349346*nd0.y + -0.55413437*ne0.y + -0.029592037*nf0.y + -0.036228*ng0.y + 0.069125436*nh0.y + -0.18871574*ni0.y; + s = 0.038417455*na0.z + -0.21142405*nb0.z + -0.034855157*nc0.z + -0.054826926*nd0.z + -0.24405639*ne0.z + 0.11743097*nf0.z + -0.0859903*ng0.z + 0.21720038*nh0.z + 0.08788087*ni0.z; + t = 0.048770655*na0.w + 0.12233943*nb0.w + -0.03950986*nc0.w + -0.009187269*nd0.w + -0.12946133*ne0.w + -0.07174181*nf0.w + 0.021697959*ng0.w + 0.075961806*nh0.w + 0.061868332*ni0.w; + u = -0.06566027*na1.x + 0.00080207275*nb1.x + 0.020833474*nc1.x + 0.013340379*nd1.x + -0.2165162*ne1.x + 0.0868738*nf1.x + 0.043138873*ng1.x + 0.22945437*nh1.x + 0.0138047775*ni1.x; + v = 0.017050784*na1.y + 0.2494357*nb1.y + 0.011488906*nc1.y + -0.068815716*nd1.y + -0.5650941*ne1.y + 0.030278916*nf1.y + 0.055531804*ng1.y + 0.14427291*nh1.y + 0.0024433972*ni1.y; + w = 0.14314358*na1.z + 0.0028497116*nb1.z + -0.0023248373*nc1.z + -0.06904705*nd1.z + -0.11152599*ne1.z + -0.21558757*nf1.z + -0.05603373*ng1.z + 0.0005346824*nh1.z + 0.13354091*ni1.z; + x = -0.049296606*na1.w + -0.07173451*nb1.w + 0.2581109*nc1.w + -0.01809698*nd1.w + 0.007841395*ne1.w + -0.22031958*nf1.w + -0.0476805*ng1.w + -0.11961736*nh1.w + -0.08217695*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.009083936; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN70 +//!BIND LUMAN71 +//!SAVE LUMAN80 + +#define L0_tex LUMAN70_tex +#define L1_tex LUMAN71_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.035619374*a0.x + 0.11422981*b0.x + 0.08590356*c0.x + -0.12612246*d0.x + 0.043873888*e0.x + 0.05914766*f0.x + -0.100714274*g0.x + 0.048455495*h0.x + -0.06725533*i0.x; + float j = -0.0013158132*a0.y + -0.0027882596*b0.y + -0.10217369*c0.y + 0.31677207*d0.y + 0.036820866*e0.y + -0.05431359*f0.y + 0.14844827*g0.y + -0.10730725*h0.y + -0.063290775*i0.y; + float k = 0.087911345*a0.z + 0.26342505*b0.z + 0.013027925*c0.z + 0.06752866*d0.z + -0.19719961*e0.z + -0.04780573*f0.z + 0.026932135*g0.z + -0.05800601*h0.z + -0.040505923*i0.z; + float l = 0.04630579*a0.w + -0.11939466*b0.w + -0.010408778*c0.w + 0.04669857*d0.w + -0.13335805*e0.w + -0.020812513*f0.w + -0.06745056*g0.w + 0.05681251*h0.w + 0.06444111*i0.w; + float m = 0.053154137*a1.x + 0.060493603*b1.x + 0.08252165*c1.x + 0.020070437*d1.x + -0.08261315*e1.x + 0.018669957*f1.x + -0.041988045*g1.x + -0.036143973*h1.x + -0.08385737*i1.x; + float n = -0.20525856*a1.y + -0.2934399*b1.y + -0.10462723*c1.y + 0.13134363*d1.y + -0.06662953*e1.y + 0.06028899*f1.y + 0.15253557*g1.y + -0.11593999*h1.y + 0.15354787*i1.y; + float o = -0.016207945*a1.z + -0.011455923*b1.z + 0.024988474*c1.z + 0.061092008*d1.z + 0.10414427*e1.z + -0.04360575*f1.z + 0.090637736*g1.z + 0.15851928*h1.z + 0.06644112*i1.z; + float p = -0.0030416374*a1.w + 0.34662476*b1.w + -0.042266436*c1.w + 0.31826603*d1.w + -0.02068287*e1.w + -0.07076953*f1.w + -0.048260685*g1.w + 0.13000193*h1.w + -0.0017414218*i1.w; + float q = 0.14909811*na0.x + -0.10734144*nb0.x + -0.10109777*nc0.x + 0.111862935*nd0.x + -0.107315935*ne0.x + -0.04478417*nf0.x + -0.0054377364*ng0.x + 0.0148478085*nh0.x + 0.06869275*ni0.x; + float r = -0.045117185*na0.y + -0.056990396*nb0.y + -0.003557616*nc0.y + -0.24177164*nd0.y + -0.2250938*ne0.y + 0.0349928*nf0.y + -0.07328847*ng0.y + 0.055793595*nh0.y + 0.08246393*ni0.y; + float s = 0.08810404*na0.z + 0.08207737*nb0.z + -0.03529103*nc0.z + -0.07186509*nd0.z + 0.11098997*ne0.z + -0.0061407485*nf0.z + -0.01619299*ng0.z + 0.016094537*nh0.z + 0.024314752*ni0.z; + float t = -0.049262095*na0.w + -0.015455753*nb0.w + 0.08398538*nc0.w + -0.06844428*nd0.w + 0.06602493*ne0.w + 0.0039364174*nf0.w + 0.024258781*ng0.w + -0.031155214*nh0.w + -0.02522881*ni0.w; + float u = -0.09289411*na1.x + -0.014842693*nb1.x + 0.07513892*nc1.x + -0.01653032*nd1.x + 0.01198521*ne1.x + 0.02763562*nf1.x + -0.05833778*ng1.x + 0.18610096*nh1.x + 0.24278776*ni1.x; + float v = -0.030026099*na1.y + 0.23567812*nb1.y + -0.013640245*nc1.y + -0.21221665*nd1.y + 0.12864627*ne1.y + -0.03775464*nf1.y + -0.06271767*ng1.y + 0.1398742*nh1.y + -0.10901197*ni1.y; + float w = -0.020543138*na1.z + 0.06967397*nb1.z + 0.046968646*nc1.z + -0.033888735*nd1.z + -0.034942474*ne1.z + 0.040396962*nf1.z + -0.018973283*ng1.z + -0.13343549*nh1.z + -0.040663805*ni1.z; + float x = -0.033192288*na1.w + 0.044186935*nb1.w + 0.027151039*nc1.w + 0.11160459*nd1.w + -0.10746703*ne1.w + -0.0275698*nf1.w + 0.00025248327*ng1.w + -0.09284146*nh1.w + -4.7326103e-07*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0014252196; + i = 0.06571178*a0.x + 0.08752779*b0.x + -0.091107346*c0.x + -0.19443138*d0.x + 0.17203617*e0.x + 0.05960761*f0.x + -0.1393299*g0.x + -0.0799575*h0.x + 0.08354188*i0.x; + j = 0.038831577*a0.y + 0.071457274*b0.y + 0.060086038*c0.y + 0.07407433*d0.y + 0.37381777*e0.y + 0.32434905*f0.y + -0.04149505*g0.y + -0.06551896*h0.y + -0.013210035*i0.y; + k = -0.109215535*a0.z + 0.21024004*b0.z + -0.019975739*c0.z + -0.13754839*d0.z + -0.061911196*e0.z + -0.032958355*f0.z + -0.0379819*g0.z + 0.10028795*h0.z + 0.06666433*i0.z; + l = 0.016613448*a0.w + 0.012890488*b0.w + 0.053424753*c0.w + -0.026453787*d0.w + -0.023092046*e0.w + -0.06779156*f0.w + 0.0387629*g0.w + 0.0689873*h0.w + -0.020838996*i0.w; + m = 0.009282248*a1.x + 0.023164941*b1.x + -0.056021832*c1.x + 0.10002012*d1.x + 0.07492648*e1.x + -0.019302674*f1.x + 0.04560832*g1.x + 0.05301786*h1.x + 0.052765965*i1.x; + n = 0.12870239*a1.y + 0.029347612*b1.y + 0.08708535*c1.y + -0.05709532*d1.y + 0.045824323*e1.y + 0.17394269*f1.y + -0.008406947*g1.y + 0.010693501*h1.y + 0.06908317*i1.y; + o = -0.019160919*a1.z + -0.023981726*b1.z + 0.022585778*c1.z + -0.07323051*d1.z + 0.36100793*e1.z + 0.16888963*f1.z + 0.10322411*g1.z + 0.09305132*h1.z + 0.042125456*i1.z; + p = 0.0046699475*a1.w + 0.040598672*b1.w + -0.039084535*c1.w + -0.105519764*d1.w + -0.014312278*e1.w + 0.39844912*f1.w + 0.17213784*g1.w + 0.26695442*h1.w + 0.05388345*i1.w; + q = -0.10016962*na0.x + -0.12659925*nb0.x + -0.03206459*nc0.x + 0.054242257*nd0.x + 0.02684625*ne0.x + 0.004823341*nf0.x + -0.017493445*ng0.x + 0.017013837*nh0.x + 0.08707511*ni0.x; + r = -0.044897594*na0.y + -0.036943387*nb0.y + 0.06422842*nc0.y + -0.14496045*nd0.y + -0.37491864*ne0.y + -0.13676596*nf0.y + 0.002421831*ng0.y + 0.026525924*nh0.y + -0.014468307*ni0.y; + s = 0.03307358*na0.z + -0.06645562*nb0.z + -0.10887851*nc0.z + 0.060231242*nd0.z + 0.094336696*ne0.z + 0.075766265*nf0.z + 0.0372266*ng0.z + -0.08996786*nh0.z + 0.04349408*ni0.z; + t = 0.027824618*na0.w + 0.02099561*nb0.w + -0.20901664*nc0.w + 0.008137844*nd0.w + 0.1632197*ne0.w + 0.11545344*nf0.w + -0.02712516*ng0.w + -0.1053238*nh0.w + 0.030839035*ni0.w; + u = -0.15002786*na1.x + -0.060460884*nb1.x + -0.052398346*nc1.x + -0.21840262*nd1.x + -0.28199655*ne1.x + -0.3273765*nf1.x + 0.0019613882*ng1.x + 0.011343327*nh1.x + -0.025745407*ni1.x; + v = 0.089596294*na1.y + 0.09888554*nb1.y + -0.08620766*nc1.y + 0.09190667*nd1.y + 0.2761042*ne1.y + 0.06215537*nf1.y + -0.12014056*ng1.y + -0.13912943*nh1.y + -0.01775009*ni1.y; + w = -0.0119106565*na1.z + 0.14187837*nb1.z + 0.01875191*nc1.z + 0.028395357*nd1.z + -0.23534073*ne1.z + -0.062408306*nf1.z + -0.037198827*ng1.z + -0.09503546*nh1.z + -0.012481542*ni1.z; + x = 0.041350663*na1.w + 0.08808989*nb1.w + -0.039139986*nc1.w + 0.042839583*nd1.w + -0.14522356*ne1.w + -0.11225413*nf1.w + -0.013681964*ng1.w + -0.14814405*nh1.w + -0.08169235*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0063231788; + i = 0.199979*a0.x + 0.23061875*b0.x + -0.10920823*c0.x + 0.2127411*d0.x + 0.4562264*e0.x + 0.36791566*f0.x + 0.0061307796*g0.x + -0.03753298*h0.x + 0.20458831*i0.x; + j = -0.018984666*a0.y + 0.027848508*b0.y + 0.21057007*c0.y + -0.093486205*d0.y + 0.18769784*e0.y + 0.09004035*f0.y + -0.009871945*g0.y + 0.017700918*h0.y + -0.031650737*i0.y; + k = 0.15855373*a0.z + -0.1765117*b0.z + 0.24707586*c0.z + -0.11049361*d0.z + 0.120230295*e0.z + -0.120945446*f0.z + -0.0063170996*g0.z + -0.09350059*h0.z + 0.02323171*i0.z; + l = 0.08899516*a0.w + 0.19440293*b0.w + 0.013561043*c0.w + 0.1332691*d0.w + 0.9103674*e0.w + 0.07233763*f0.w + -0.047864635*g0.w + -0.010924825*h0.w + -0.054715794*i0.w; + m = -0.07388303*a1.x + 0.21895209*b1.x + 0.010642248*c1.x + -0.1206663*d1.x + -0.0017110996*e1.x + 0.24471904*f1.x + -0.090800084*g1.x + 0.16108827*h1.x + 0.23052362*i1.x; + n = -0.09725227*a1.y + 0.23545225*b1.y + -0.1309613*c1.y + -0.12544434*d1.y + 0.23154052*e1.y + -0.18917055*f1.y + 0.13009694*g1.y + -0.11781752*h1.y + 0.0010935594*i1.y; + o = 0.0049910066*a1.z + 0.015982643*b1.z + -0.0061242487*c1.z + 0.11340745*d1.z + 0.37257516*e1.z + 0.043045927*f1.z + 0.06434129*g1.z + 0.21555494*h1.z + -0.0042368937*i1.z; + p = 0.082077265*a1.w + 0.05672133*b1.w + -0.06472555*c1.w + -0.055614956*d1.w + -0.08767573*e1.w + -0.28633016*f1.w + -0.17009583*g1.w + 0.27785555*h1.w + 0.056071628*i1.w; + q = 0.08759647*na0.x + -0.20314527*nb0.x + 0.15229012*nc0.x + 0.041185692*nd0.x + -0.23530194*ne0.x + -0.14208466*nf0.x + 0.11049026*ng0.x + 0.12073572*nh0.x + -0.0577295*ni0.x; + r = 0.019904044*na0.y + 0.018032687*nb0.y + -0.13282707*nc0.y + -0.12976085*nd0.y + -0.0851056*ne0.y + -0.24886972*nf0.y + -0.17227782*ng0.y + 0.02357173*nh0.y + 0.082668714*ni0.y; + s = 0.22471142*na0.z + -0.18081205*nb0.z + -0.08472062*nc0.z + 0.051625133*nd0.z + -0.3786994*ne0.z + 0.19139658*nf0.z + 0.0458613*ng0.z + -0.0066961776*nh0.z + -0.046551377*ni0.z; + t = -0.1452213*na0.w + 0.09566916*nb0.w + -0.08075796*nc0.w + -0.20701256*nd0.w + -0.38712594*ne0.w + 0.066817015*nf0.w + -0.013330645*ng0.w + 0.004587282*nh0.w + 0.0044981963*ni0.w; + u = -0.15362954*na1.x + 0.14077385*nb1.x + -0.023733815*nc1.x + 0.32859254*nd1.x + -0.26526156*ne1.x + -0.3064315*nf1.x + 0.03460431*ng1.x + -0.061959833*nh1.x + -0.25696978*ni1.x; + v = 0.1043488*na1.y + 0.19938381*nb1.y + 0.35066408*nc1.y + 0.052177925*nd1.y + 0.25914505*ne1.y + 0.18082118*nf1.y + -0.13857333*ng1.y + 0.08814344*nh1.y + 0.08745096*ni1.y; + w = -0.020234669*na1.z + 0.037020292*nb1.z + 0.16186818*nc1.z + -0.031144649*nd1.z + -0.30665946*ne1.z + 0.105531685*nf1.z + -0.04954673*ng1.z + 0.08786373*nh1.z + -0.123731464*ni1.z; + x = -0.0112807825*na1.w + 0.017921103*nb1.w + 0.07448235*nc1.w + -0.08664955*nd1.w + 0.05499397*ne1.w + 0.014387606*nf1.w + 0.07323461*ng1.w + -0.114632644*nh1.w + -0.11618331*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.013133188; + i = 0.0597138*a0.x + -0.08610238*b0.x + -0.028665632*c0.x + -0.22173823*d0.x + -0.3086256*e0.x + -0.04300896*f0.x + -0.05005118*g0.x + -0.067843765*h0.x + -0.01712894*i0.x; + j = -0.07549083*a0.y + -0.34679034*b0.y + 0.001367597*c0.y + -0.041651245*d0.y + -0.3563761*e0.y + 0.1272373*f0.y + -0.19311947*g0.y + 0.0062134555*h0.y + -0.03911722*i0.y; + k = -0.10124364*a0.z + -0.1392256*b0.z + -0.025747765*c0.z + -0.17028576*d0.z + -0.04966502*e0.z + -0.068353444*f0.z + -0.06490578*g0.z + 0.19330779*h0.z + -0.15174128*i0.z; + l = -0.045293238*a0.w + 0.28092697*b0.w + 0.15129393*c0.w + -0.0899719*d0.w + 0.22142841*e0.w + -0.012547027*f0.w + 0.14377733*g0.w + 0.022239886*h0.w + 0.0706811*i0.w; + m = 0.004948647*a1.x + -0.07952092*b1.x + -0.005588038*c1.x + 0.080402285*d1.x + -0.1299574*e1.x + 0.102539904*f1.x + -0.00044476325*g1.x + -0.032420598*h1.x + -0.09282016*i1.x; + n = 0.11100442*a1.y + 0.12993109*b1.y + 0.12758453*c1.y + 0.18054684*d1.y + 0.1392812*e1.y + -0.07014241*f1.y + -0.03861955*g1.y + 0.10125592*h1.y + 0.0038314038*i1.y; + o = 0.06520557*a1.z + 0.006842835*b1.z + 0.01872246*c1.z + -0.21221244*d1.z + -0.04671243*e1.z + 0.101514*f1.z + -0.024837673*g1.z + 0.19408646*h1.z + 0.062211882*i1.z; + p = 0.10764124*a1.w + 0.07714488*b1.w + -0.009523819*c1.w + -0.22998925*d1.w + -0.28999612*e1.w + 0.05397179*f1.w + 0.03093759*g1.w + -0.021440584*h1.w + 0.037218977*i1.w; + q = -0.20570432*na0.x + 0.012709159*nb0.x + 0.09455498*nc0.x + -0.16358799*nd0.x + 0.3280718*ne0.x + 0.002596912*nf0.x + -0.0315085*ng0.x + -0.08436351*nh0.x + -0.00079569634*ni0.x; + r = 0.09261593*na0.y + 0.19364753*nb0.y + -0.05850349*nc0.y + 0.11032683*nd0.y + 0.31128845*ne0.y + -0.11763885*nf0.y + 0.19743448*ng0.y + -0.01946789*nh0.y + 0.05673635*ni0.y; + s = 0.033889174*na0.z + 0.107985765*nb0.z + 0.14049667*nc0.z + -0.00057227246*nd0.z + 0.16228116*ne0.z + 0.06535901*nf0.z + 0.08563815*ng0.z + -0.09778197*nh0.z + 0.060218997*ni0.z; + t = 0.1382207*na0.w + -0.34366918*nb0.w + -0.07159504*nc0.w + 0.20757206*nd0.w + -0.15257928*ne0.w + 0.23665349*nf0.w + -0.0079668155*ng0.w + -0.03774751*nh0.w + 0.025174439*ni0.w; + u = 0.05979023*na1.x + 0.21410039*nb1.x + 0.0277462*nc1.x + -0.14315857*nd1.x + -0.08927151*ne1.x + -0.023229988*nf1.x + -0.04333517*ng1.x + 0.0071403272*nh1.x + 0.120679095*ni1.x; + v = 0.01266553*na1.y + -0.24217825*nb1.y + -0.06692956*nc1.y + 0.21709256*nd1.y + -0.2097772*ne1.y + 0.26281872*nf1.y + -0.029375581*ng1.y + -0.085459515*nh1.y + -0.008495006*ni1.y; + w = -0.06465596*na1.z + 0.07665564*nb1.z + -0.019982971*nc1.z + 0.17086358*nd1.z + 0.023132043*ne1.z + -0.10599891*nf1.z + 0.07691751*ng1.z + -0.23248987*nh1.z + -0.13741273*ni1.z; + x = -0.0106970705*na1.w + -0.11882599*nb1.w + -0.05005593*nc1.w + 0.028415836*nd1.w + -0.25891018*ne1.w + -0.04042173*nf1.w + -0.103319325*ng1.w + -0.05437728*nh1.w + -0.06257452*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.037121743; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN70 +//!BIND LUMAN71 +//!SAVE LUMAN81 + +#define L0_tex LUMAN70_tex +#define L1_tex LUMAN71_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.0035594627*a0.x + 0.12038972*b0.x + 0.020664928*c0.x + -0.09564937*d0.x + -0.24571119*e0.x + 0.3238691*f0.x + 0.17325595*g0.x + 0.2563469*h0.x + 0.15742101*i0.x; + float j = 0.047737293*a0.y + 0.12174407*b0.y + -0.0037528512*c0.y + 0.12503311*d0.y + -0.28859985*e0.y + 0.17565013*f0.y + -0.11089875*g0.y + 0.031075783*h0.y + -0.02618067*i0.y; + float k = -0.19977969*a0.z + 0.14283116*b0.z + 0.13913913*c0.z + 0.041978117*d0.z + 0.41509438*e0.z + 0.1267442*f0.z + -0.040185302*g0.z + -0.022216653*h0.z + -0.022823509*i0.z; + float l = -0.060234714*a0.w + -0.14831258*b0.w + 0.019350914*c0.w + 0.003702241*d0.w + 0.39907286*e0.w + 0.022984667*f0.w + 0.05545299*g0.w + -0.0787563*h0.w + -0.12892959*i0.w; + float m = 0.08037066*a1.x + -0.18128945*b1.x + -0.03249607*c1.x + 0.068933845*d1.x + -0.30093843*e1.x + 0.2657856*f1.x + -0.059506405*g1.x + 0.08838455*h1.x + 0.17838779*i1.x; + float n = 0.20739813*a1.y + -0.047565427*b1.y + -0.13744627*c1.y + 0.06407209*d1.y + -0.41378132*e1.y + 0.009229263*f1.y + -0.0034402746*g1.y + -0.08209963*h1.y + -0.02662598*i1.y; + float o = -0.028428562*a1.z + -0.06263071*b1.z + -0.09687462*c1.z + -0.05370017*d1.z + -0.08132385*e1.z + 0.025406176*f1.z + 0.13680756*g1.z + -0.20903514*h1.z + -0.087057374*i1.z; + float p = -0.059544336*a1.w + 0.17221068*b1.w + 0.019948697*c1.w + -0.021689683*d1.w + 0.35838723*e1.w + -0.02246449*f1.w + 0.009842488*g1.w + -0.08404416*h1.w + -0.14539391*i1.w; + float q = 0.031368583*na0.x + -0.07873013*nb0.x + -0.048282783*nc0.x + 0.15330768*nd0.x + 0.13624837*ne0.x + 0.003489596*nf0.x + -0.06954451*ng0.x + -0.17785366*nh0.x + -0.21068935*ni0.x; + float r = -0.10955879*na0.y + -0.07031983*nb0.y + 0.027158145*nc0.y + -0.10907232*nd0.y + -0.18709134*ne0.y + -0.044923406*nf0.y + 0.1491744*ng0.y + 0.22531477*nh0.y + 0.067887*ni0.y; + float s = 0.007157718*na0.z + 0.047460496*nb0.z + -0.05114494*nc0.z + 0.17035486*nd0.z + -0.19792128*ne0.z + 0.0046278005*nf0.z + 0.000758805*ng0.z + -0.015741793*nh0.z + -0.00054501754*ni0.z; + float t = 0.040760834*na0.w + 0.005885292*nb0.w + -0.063230574*nc0.w + -0.12301143*nd0.w + -0.36083934*ne0.w + -0.055142406*nf0.w + -0.009169166*ng0.w + 0.03937573*nh0.w + 0.06946885*ni0.w; + float u = 0.013201956*na1.x + 0.08828739*nb1.x + -0.11232451*nc1.x + -0.19637825*nd1.x + 0.32704473*ne1.x + -0.13675223*nf1.x + 0.16928957*ng1.x + 0.05799959*nh1.x + -0.20515703*ni1.x; + float v = -0.08137275*na1.y + 0.09916626*nb1.y + -0.03344903*nc1.y + -0.3554004*nd1.y + 0.1933217*ne1.y + -0.08688003*nf1.y + -0.037157822*ng1.y + 0.035184443*nh1.y + 0.04655514*ni1.y; + float w = -0.010426424*na1.z + 0.06698642*nb1.z + -0.0063963337*nc1.z + -0.011602357*nd1.z + 0.0026813527*ne1.z + 0.16570611*nf1.z + -0.069919996*ng1.z + 0.09920697*nh1.z + 0.06005996*ni1.z; + float x = 0.12693816*na1.w + 0.06537599*nb1.w + 0.0038803034*nc1.w + 0.101019114*nd1.w + -0.30651957*ne1.w + 0.07803141*nf1.w + -0.0045747124*ng1.w + 0.08764645*nh1.w + 0.046619754*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.021460632; + i = 0.18408899*a0.x + -0.16826582*b0.x + 0.029110307*c0.x + 0.018517664*d0.x + -0.45409498*e0.x + -0.25322545*f0.x + -0.08358312*g0.x + -1.5571204e-05*h0.x + -0.030115725*i0.x; + j = -0.095829435*a0.y + 0.0956517*b0.y + 0.030972734*c0.y + 0.07102308*d0.y + 0.2045019*e0.y + -0.025642421*f0.y + 0.023203015*g0.y + -0.054684825*h0.y + -0.07058941*i0.y; + k = 0.15398344*a0.z + -0.058395036*b0.z + -0.014716754*c0.z + -0.010085025*d0.z + 0.0076141944*e0.z + 0.07213757*f0.z + 0.04619976*g0.z + -0.07169352*h0.z + 0.109850734*i0.z; + l = -0.10673365*a0.w + -0.19558638*b0.w + -0.13687268*c0.w + 0.06683206*d0.w + 0.18710184*e0.w + -0.038076635*f0.w + 0.021108862*g0.w + 0.055217225*h0.w + 0.045482595*i0.w; + m = -0.103124246*a1.x + 0.04979288*b1.x + -0.14140393*c1.x + 0.091398045*d1.x + 0.14379893*e1.x + -0.1343946*f1.x + 0.06328437*g1.x + 0.095048964*h1.x + 0.0053989524*i1.x; + n = -0.28951663*a1.y + 0.04082115*b1.y + -0.041639026*c1.y + -0.08741475*d1.y + -0.4094756*e1.y + -0.046889693*f1.y + -0.048665598*g1.y + -0.016912755*h1.y + -0.065184765*i1.y; + o = 0.041484993*a1.z + 0.062167954*b1.z + 0.13701159*c1.z + -0.0037448267*d1.z + -0.4012658*e1.z + 0.09107117*f1.z + 0.032375693*g1.z + 0.046596777*h1.z + -0.021694195*i1.z; + p = -0.0657728*a1.w + -0.15465443*b1.w + 0.28652954*c1.w + 0.276086*d1.w + 0.82882595*e1.w + 0.40777725*f1.w + 0.21335135*g1.w + 0.12063082*h1.w + -0.067809604*i1.w; + q = -0.07317296*na0.x + 0.12092801*nb0.x + -0.122033745*nc0.x + 0.1218021*nd0.x + 0.3748805*ne0.x + 0.02080968*nf0.x + -0.08659379*ng0.x + 0.06500288*nh0.x + 0.108286195*ni0.x; + r = 0.18367934*na0.y + 0.0010851121*nb0.y + -0.0587228*nc0.y + -0.25490445*nd0.y + -0.14447315*ne0.y + 0.03789025*nf0.y + 0.04973444*ng0.y + 0.05696792*nh0.y + -0.15240029*ni0.y; + s = -0.024720518*na0.z + 0.4245658*nb0.z + 0.12234191*nc0.z + 0.30536148*nd0.z + 0.2554897*ne0.z + 0.014799129*nf0.z + -0.015152688*ng0.z + -0.11416671*nh0.z + 0.04041433*ni0.z; + t = -0.017217876*na0.w + -0.10715295*nb0.w + 0.005794767*nc0.w + -0.052738365*nd0.w + -0.152631*ne0.w + -0.013479686*nf0.w + -0.034019798*ng0.w + -0.05703783*nh0.w + -0.010331549*ni0.w; + u = 0.098668344*na1.x + -0.25669348*nb1.x + -0.019031374*nc1.x + 0.017597904*nd1.x + 0.39555046*ne1.x + 0.21499567*nf1.x + -0.07296321*ng1.x + -0.26197156*nh1.x + -0.012222828*ni1.x; + v = -0.039902315*na1.y + -0.41862145*nb1.y + 0.058357593*nc1.y + 0.1586242*nd1.y + 0.18992789*ne1.y + -0.051665388*nf1.y + -0.09742037*ng1.y + 0.06964658*nh1.y + 0.06772205*ni1.y; + w = -0.06602748*na1.z + -0.097169474*nb1.z + -0.057414*nc1.z + -0.12144658*nd1.z + 0.54734033*ne1.z + -0.028030278*nf1.z + -0.018566564*ng1.z + -0.18564*nh1.z + 0.0925991*ni1.z; + x = -0.15178564*na1.w + 0.0011031028*nb1.w + -0.015275681*nc1.w + -0.009574547*nd1.w + 0.10352668*ne1.w + 0.017580548*nf1.w + 0.024625003*ng1.w + -0.07591098*nh1.w + 0.014088646*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0060250857; + i = 0.019011308*a0.x + 0.033444997*b0.x + -0.03581608*c0.x + -0.039397176*d0.x + -0.3690848*e0.x + 0.021864276*f0.x + -0.07867141*g0.x + 0.08434385*h0.x + -0.009090522*i0.x; + j = 0.020657526*a0.y + 0.006953353*b0.y + -0.022416698*c0.y + 0.035708115*d0.y + 0.05767355*e0.y + -0.013203197*f0.y + 0.14224495*g0.y + 0.030157957*h0.y + -0.03581798*i0.y; + k = 0.07780682*a0.z + -0.0585135*b0.z + -0.051630992*c0.z + -0.055939876*d0.z + 0.18262525*e0.z + -0.090132564*f0.z + 0.12991647*g0.z + -0.12535602*h0.z + 0.042218972*i0.z; + l = 0.010307127*a0.w + 0.010460575*b0.w + 0.028567461*c0.w + 0.058343817*d0.w + 0.58971435*e0.w + 0.0068708695*f0.w + -0.00786947*g0.w + -0.09592207*h0.w + 0.029101066*i0.w; + m = -0.04291295*a1.x + 0.066946365*b1.x + 0.008595295*c1.x + -0.019690137*d1.x + -0.1677645*e1.x + -0.034328867*f1.x + -0.048139174*g1.x + -0.059789807*h1.x + -0.066321395*i1.x; + n = 0.03389471*a1.y + 0.26502246*b1.y + 0.18302165*c1.y + 0.09491692*d1.y + 0.021241223*e1.y + 0.17256165*f1.y + 0.0404323*g1.y + 0.0579923*h1.y + 0.005492218*i1.y; + o = 0.0076889577*a1.z + 0.11564411*b1.z + 0.026385188*c1.z + 0.018606775*d1.z + -0.19530635*e1.z + -0.022276096*f1.z + 0.02216031*g1.z + 0.24999204*h1.z + -0.007822727*i1.z; + p = -0.039314333*a1.w + 0.057142776*b1.w + 0.037845295*c1.w + 0.12005467*d1.w + 0.16426453*e1.w + 0.015574408*f1.w + -0.061150614*g1.w + -0.13893083*h1.w + 0.16615587*i1.w; + q = -0.014885288*na0.x + -0.040328924*nb0.x + -0.05977982*nc0.x + 0.09812612*nd0.x + 0.19854964*ne0.x + -0.11895066*nf0.x + 0.010794935*ng0.x + -0.006710417*nh0.x + 0.068268105*ni0.x; + r = 0.024664057*na0.y + 0.027309645*nb0.y + -0.00091027824*nc0.y + -0.08709317*nd0.y + -0.0052896333*ne0.y + 0.014205412*nf0.y + -0.14190152*ng0.y + -0.25411522*nh0.y + -0.0023517665*ni0.y; + s = 0.02154945*na0.z + 0.12541628*nb0.z + -0.055260804*nc0.z + 0.03945718*nd0.z + -0.32898843*ne0.z + -0.011599959*nf0.z + -0.092199944*ng0.z + 0.15010926*nh0.z + 0.008878597*ni0.z; + t = -0.049145244*na0.w + 0.08057064*nb0.w + -0.051043004*nc0.w + -0.046488475*nd0.w + -0.42943993*ne0.w + -0.05612305*nf0.w + -0.011810398*ng0.w + 0.086631544*nh0.w + -0.061234765*ni0.w; + u = -0.19244489*na1.x + -0.11959134*nb1.x + 0.123622924*nc1.x + -0.052711625*nd1.x + -0.15718763*ne1.x + -0.22365978*nf1.x + -0.021615187*ng1.x + -0.08971221*nh1.x + 0.079056434*ni1.x; + v = 0.04648465*na1.y + -0.2027671*nb1.y + -0.06965296*nc1.y + -0.12387141*nd1.y + 0.22138685*ne1.y + 0.021332582*nf1.y + 0.026996912*ng1.y + -0.103880666*nh1.y + -0.008200975*ni1.y; + w = 0.03508963*na1.z + -0.08834725*nb1.z + 0.03435375*nc1.z + 0.03863173*nd1.z + 0.08056959*ne1.z + -0.0834241*nf1.z + -0.0147202825*ng1.z + -0.06330953*nh1.z + 0.012078014*ni1.z; + x = -0.02340783*na1.w + 0.010710042*nb1.w + 0.02718297*nc1.w + -0.019940894*nd1.w + 0.00040069708*ne1.w + -0.10751297*nf1.w + 0.014186145*ng1.w + 0.039040815*nh1.w + -0.049185835*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.008812009; + i = 0.07841893*a0.x + 0.30597758*b0.x + 0.039592993*c0.x + -0.1392278*d0.x + -0.18927181*e0.x + -0.25712314*f0.x + 0.16298722*g0.x + 0.0978296*h0.x + 0.014630055*i0.x; + j = 0.017117297*a0.y + -0.17809464*b0.y + -0.18548822*c0.y + 0.2618222*d0.y + 0.1903122*e0.y + -0.10584681*f0.y + 0.12803845*g0.y + 0.12465525*h0.y + 0.0057999417*i0.y; + k = -0.1265387*a0.z + -0.26912108*b0.z + -0.2629887*c0.z + 0.03371654*d0.z + -0.02986012*e0.z + -0.1738381*f0.z + 0.08100522*g0.z + -0.16834205*h0.z + 0.058091134*i0.z; + l = -0.008767114*a0.w + 0.14262395*b0.w + 0.099189475*c0.w + -0.20450254*d0.w + 0.4196956*e0.w + 0.008576616*f0.w + -0.097148575*g0.w + -0.015517277*h0.w + -0.06573792*i0.w; + m = 0.009081048*a1.x + -0.17330879*b1.x + 0.038787026*c1.x + -0.09260983*d1.x + -0.29981878*e1.x + -0.07358133*f1.x + -0.038811002*g1.x + -0.21674985*h1.x + 0.06779695*i1.x; + n = 0.24578477*a1.y + 0.43307883*b1.y + 0.29414627*c1.y + 0.46770245*d1.y + 0.11255661*e1.y + 0.45453352*f1.y + 0.13660336*g1.y + 0.16075915*h1.y + 0.07823638*i1.y; + o = 0.010055099*a1.z + 0.1257483*b1.z + 0.020316884*c1.z + -0.073165305*d1.z + -0.05080413*e1.z + -0.00898285*f1.z + 0.027939187*g1.z + 0.34161064*h1.z + 0.11474434*i1.z; + p = 0.10480826*a1.w + 0.058347534*b1.w + -0.03916004*c1.w + -0.19853686*d1.w + -0.07113309*e1.w + 0.023121873*f1.w + -0.13254455*g1.w + -0.030065117*h1.w + 0.39155975*i1.w; + q = -0.024030669*na0.x + -0.2835391*nb0.x + -0.2563511*nc0.x + 0.2444749*nd0.x + -0.08338291*ne0.x + -0.02303733*nf0.x + -0.048666645*ng0.x + -0.16980661*nh0.x + 0.14233974*ni0.x; + r = 0.030986484*na0.y + 0.18971221*nb0.y + 0.019609256*nc0.y + -0.20937881*nd0.y + -0.07083975*ne0.y + 0.20925662*nf0.y + 0.021047208*ng0.y + -0.26694658*nh0.y + 0.021631766*ni0.y; + s = -0.05092649*na0.z + 0.1003873*nb0.z + 0.0010154173*nc0.z + -0.30542678*nd0.z + -0.050651006*ne0.z + -0.08529883*nf0.z + -0.14873579*ng0.z + 0.28444654*nh0.z + -0.0868977*ni0.z; + t = -0.07518888*na0.w + -0.08290228*nb0.w + -0.17608197*nc0.w + 0.023637211*nd0.w + -0.29993716*ne0.w + -0.038453452*nf0.w + 0.023888037*ng0.w + 0.060559735*nh0.w + 0.024841927*ni0.w; + u = 0.036475975*na1.x + 0.26582122*nb1.x + 0.10916547*nc1.x + -0.09054858*nd1.x + 0.009491323*ne1.x + -0.067552604*nf1.x + 0.12836859*ng1.x + 0.002995043*nh1.x + -0.1530478*ni1.x; + v = 0.11352374*na1.y + -0.039592106*nb1.y + -0.27043325*nc1.y + -0.4161087*nd1.y + -0.121836096*ne1.y + -0.11972322*nf1.y + 0.055229824*ng1.y + -0.16489632*nh1.y + 0.04047813*ni1.y; + w = -0.039167922*na1.z + -0.06771886*nb1.z + 0.015467069*nc1.z + 0.034550667*nd1.z + 0.05691168*ne1.z + -0.09975041*nf1.z + -0.110027954*ng1.z + -0.22872053*nh1.z + 0.05507539*ni1.z; + x = 0.007246742*na1.w + -0.09148137*nb1.w + 0.028967854*nc1.w + 0.0964552*nd1.w + -0.29469356*ne1.w + -0.14045818*nf1.w + 0.015332315*ng1.w + -0.04409656*nh1.w + -0.08756743*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0046669585; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN80 +//!BIND LUMAN81 +//!SAVE LUMAN90 + +#define L0_tex LUMAN80_tex +#define L1_tex LUMAN81_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.014250411*a0.x + -0.04238529*b0.x + -0.021654928*c0.x + -0.061056126*d0.x + 0.12432481*e0.x + -0.11172919*f0.x + 0.025456348*g0.x + 0.17375225*h0.x + -0.05928882*i0.x; + float j = -0.0069310674*a0.y + -0.17002995*b0.y + 0.014071309*c0.y + -0.08017034*d0.y + -0.15927497*e0.y + -0.13709296*f0.y + 0.03015211*g0.y + -0.10931449*h0.y + -0.07531325*i0.y; + float k = 0.085528105*a0.z + 0.07321134*b0.z + 0.04415391*c0.z + -0.060957205*d0.z + 0.20358115*e0.z + -0.0310266*f0.z + -0.06125441*g0.z + -0.01778268*h0.z + 0.058718406*i0.z; + float l = 0.020323409*a0.w + 0.12131576*b0.w + 0.034877058*c0.w + 0.026528962*d0.w + 0.29414418*e0.w + -0.048116814*f0.w + 0.03937826*g0.w + 0.027733173*h0.w + 0.10065619*i0.w; + float m = 0.084621675*a1.x + 0.08532275*b1.x + 0.015778627*c1.x + 0.097194195*d1.x + 0.4112123*e1.x + 0.27921355*f1.x + 0.10588195*g1.x + 0.053417943*h1.x + 0.09885509*i1.x; + float n = 0.07387635*a1.y + -0.055011578*b1.y + 0.039572112*c1.y + -0.076339245*d1.y + 0.31344843*e1.y + -0.05918905*f1.y + -0.074291565*g1.y + 0.04840767*h1.y + 0.06758669*i1.y; + float o = -0.10437262*a1.z + 0.06825754*b1.z + 0.056765143*c1.z + 0.021697484*d1.z + 0.45190138*e1.z + 0.2427271*f1.z + 0.062085584*g1.z + 0.28484273*h1.z + -0.094032384*i1.z; + float p = 0.04813119*a1.w + 0.007050882*b1.w + -0.052815583*c1.w + -0.09500402*d1.w + 0.14369574*e1.w + 0.019362302*f1.w + -0.13984235*g1.w + 0.02537242*h1.w + 0.05735736*i1.w; + float q = 0.03274758*na0.x + 0.029267251*nb0.x + 0.053376034*nc0.x + 0.08079781*nd0.x + 0.025893819*ne0.x + 0.26118472*nf0.x + -0.008455075*ng0.x + -0.10138187*nh0.x + 0.13818091*ni0.x; + float r = 0.012862027*na0.y + 0.0727372*nb0.y + 0.051430516*nc0.y + 0.023545163*nd0.y + 0.15226619*ne0.y + 0.08326266*nf0.y + -0.03657906*ng0.y + 0.098245256*nh0.y + 0.1295563*ni0.y; + float s = -0.072070636*na0.z + -0.04813981*nb0.z + -0.016097464*nc0.z + -0.08242316*nd0.z + -0.3567517*ne0.z + -0.05599013*nf0.z + -0.028758992*ng0.z + -0.02239777*nh0.z + -0.11760277*ni0.z; + float t = -0.016802538*na0.w + -0.0019249133*nb0.w + -0.038664613*nc0.w + 0.052025173*nd0.w + -0.35645428*ne0.w + 0.15000045*nf0.w + 0.039396226*ng0.w + -0.036765695*nh0.w + -0.05118801*ni0.w; + float u = -0.036604054*na1.x + -0.023219982*nb1.x + 0.007530918*nc1.x + 0.04736719*nd1.x + -0.42611703*ne1.x + -0.06174241*nf1.x + -0.03890206*ng1.x + 0.01575828*nh1.x + -0.0248451*ni1.x; + float v = -0.08923639*na1.y + -0.0043441607*nb1.y + -0.12167136*nc1.y + 0.027899772*nd1.y + -0.40207592*ne1.y + -0.056410473*nf1.y + 0.044626288*ng1.y + -0.12881693*nh1.y + -0.07811622*ni1.y; + float w = 0.14602704*na1.z + -0.028811814*nb1.z + -0.01618901*nc1.z + -0.012422737*nd1.z + -0.3331145*ne1.z + -0.1610778*nf1.z + -0.08348008*ng1.z + -0.059223644*nh1.z + 0.036051374*ni1.z; + float x = -0.012505048*na1.w + 0.059638865*nb1.w + -0.015351817*nc1.w + 0.10810725*nd1.w + -0.15226439*ne1.w + 0.006934493*nf1.w + 0.07647251*ng1.w + -0.00703516*nh1.w + -0.04167374*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.021942647; + i = 0.20880799*a0.x + -0.18952975*b0.x + 0.0410574*c0.x + -0.20322348*d0.x + -0.1942575*e0.x + -0.36810294*f0.x + -0.030349163*g0.x + -0.0241354*h0.x + -0.23881352*i0.x; + j = -0.15908454*a0.y + 0.023425695*b0.y + -0.05800883*c0.y + -0.22789474*d0.y + 0.13597105*e0.y + 0.12843077*f0.y + -0.2070944*g0.y + -0.09183324*h0.y + 0.1198077*i0.y; + k = 0.063545085*a0.z + -0.07194285*b0.z + 0.03841072*c0.z + -0.06573369*d0.z + -0.3593671*e0.z + -0.033107173*f0.z + 0.048501916*g0.z + 0.12236352*h0.z + -0.08455477*i0.z; + l = 0.10424859*a0.w + 0.14661445*b0.w + 0.111417264*c0.w + 0.23561446*d0.w + -0.16151448*e0.w + -0.059149202*f0.w + 0.09560583*g0.w + 0.14111574*h0.w + -0.0135328695*i0.w; + m = 0.0135551775*a1.x + -0.23273508*b1.x + 0.06987079*c1.x + -0.17985173*d1.x + -0.2573105*e1.x + 0.05890961*f1.x + 0.07531258*g1.x + -0.34863085*h1.x + -0.028425023*i1.x; + n = 0.13816424*a1.y + -0.16184004*b1.y + 0.0059585655*c1.y + 0.3248018*d1.y + -0.055002954*e1.y + 0.05005296*f1.y + 0.11523584*g1.y + -0.07849374*h1.y + -0.028928319*i1.y; + o = 0.07822528*a1.z + 0.18937865*b1.z + 0.08215902*c1.z + 0.1685611*d1.z + 0.027695673*e1.z + 0.073200606*f1.z + 0.023770861*g1.z + -0.016103616*h1.z + -0.0063722*i1.z; + p = -0.09772434*a1.w + -0.27336553*b1.w + -0.09073844*c1.w + 0.1401914*d1.w + -0.115432434*e1.w + -0.03692059*f1.w + -0.13910747*g1.w + -0.105095066*h1.w + -0.07490761*i1.w; + q = 0.039422616*na0.x + 0.19641484*nb0.x + -0.12821025*nc0.x + 0.24219863*nd0.x + -0.17712165*ne0.x + -0.026652308*nf0.x + -0.0058854646*ng0.x + 0.16638958*nh0.x + 0.17476979*ni0.x; + r = -0.19964898*na0.y + 0.14522126*nb0.y + 0.017497417*nc0.y + 0.11976333*nd0.y + -0.2522856*ne0.y + -0.1015291*nf0.y + 0.119959936*ng0.y + 0.13133897*nh0.y + -0.070109226*ni0.y; + s = 0.09179825*na0.z + 0.14095272*nb0.z + -0.040753435*nc0.z + 0.105170004*nd0.z + 0.4636101*ne0.z + -0.017486215*nf0.z + -0.1678732*ng0.z + 0.05558729*nh0.z + 0.064954616*ni0.z; + t = -0.10586936*na0.w + -0.109147035*nb0.w + -0.08276189*nc0.w + 0.19918762*nd0.w + 0.035725277*ne0.w + 0.007809945*nf0.w + -0.07378703*ng0.w + -0.13827443*nh0.w + 0.023840806*ni0.w; + u = -0.09291025*na1.x + 0.061407644*nb1.x + -0.0075824033*nc1.x + 0.11242122*nd1.x + 0.22942492*ne1.x + -0.04565064*nf1.x + -0.10208078*ng1.x + 0.2990975*nh1.x + 0.055351995*ni1.x; + v = -0.08343257*na1.y + 0.076851636*nb1.y + -0.014935781*nc1.y + -0.288692*nd1.y + 0.22209394*ne1.y + 0.022718837*nf1.y + -0.14564*ng1.y + -0.114482984*nh1.y + 0.1302801*ni1.y; + w = -0.06583774*na1.z + -0.18053466*nb1.z + -0.04791139*nc1.z + -0.17584006*nd1.z + -0.026865056*ne1.z + -0.10923432*nf1.z + 0.018325653*ng1.z + -0.14700639*nh1.z + -0.109260954*ni1.z; + x = 0.1805816*na1.w + 0.12407404*nb1.w + -0.010269265*nc1.w + -0.27490416*nd1.w + 0.2293687*ne1.w + 0.08178526*nf1.w + -0.099873096*ng1.w + 0.11110855*nh1.w + 0.093538925*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.03860623; + i = 0.048178677*a0.x + 0.13495404*b0.x + 0.027020844*c0.x + 0.017530996*d0.x + -0.26472944*e0.x + -0.32675788*f0.x + -0.0057494543*g0.x + -0.18215506*h0.x + 0.1866843*i0.x; + j = -0.04042012*a0.y + -0.12528907*b0.y + -0.13585721*c0.y + -0.09324433*d0.y + -0.16377172*e0.y + -0.19642009*f0.y + 0.015814828*g0.y + -0.13511328*h0.y + 0.061218485*i0.y; + k = 0.017718524*a0.z + 0.102305256*b0.z + 0.051078156*c0.z + 0.096709035*d0.z + 0.035923813*e0.z + -0.05596279*f0.z + 0.007461312*g0.z + -0.04832589*h0.z + -0.019453974*i0.z; + l = 0.06610844*a0.w + -0.08446715*b0.w + -0.13854147*c0.w + -0.018506333*d0.w + 0.32768026*e0.w + 0.21792646*f0.w + -0.021454493*g0.w + 0.0113977585*h0.w + -0.0026054222*i0.w; + m = 0.036436006*a1.x + 0.21372306*b1.x + 0.035791337*c1.x + -0.0029260095*d1.x + 0.21363598*e1.x + 0.11290417*f1.x + 0.06586176*g1.x + 0.1271434*h1.x + -0.059509236*i1.x; + n = -0.027422298*a1.y + 0.086997196*b1.y + 0.07657817*c1.y + 0.06558545*d1.y + 0.17395905*e1.y + -0.0073790425*f1.y + 0.01611407*g1.y + 0.06993937*h1.y + -0.0010416611*i1.y; + o = 0.0566174*a1.z + 0.035436492*b1.z + 0.042210266*c1.z + -0.04705494*d1.z + 0.41050985*e1.z + 0.1575727*f1.z + 0.06430424*g1.z + 0.09085263*h1.z + 0.045363627*i1.z; + p = 0.02746632*a1.w + 0.06629101*b1.w + 0.15184079*c1.w + -0.010816606*d1.w + -0.19920473*e1.w + -0.0012358276*f1.w + 0.11645233*g1.w + 0.15866442*h1.w + 0.041020997*i1.w; + q = -0.038356394*na0.x + 0.0496738*nb0.x + 0.089799084*nc0.x + -0.078450546*nd0.x + 0.19574346*ne0.x + 0.14296131*nf0.x + 0.02093717*ng0.x + 0.29675344*nh0.x + 0.007171671*ni0.x; + r = 0.06651706*na0.y + 0.04813143*nb0.y + 0.10353286*nc0.y + 0.21231888*nd0.y + 0.07545394*ne0.y + 0.20412438*nf0.y + 0.0012885222*ng0.y + 0.15668026*nh0.y + 0.029278977*ni0.y; + s = 0.047485173*na0.z + -0.050391153*nb0.z + -0.011836611*nc0.z + -0.10038617*nd0.z + -0.05150043*ne0.z + 0.10383776*nf0.z + -0.04044264*ng0.z + 0.056759108*nh0.z + 0.01960355*ni0.z; + t = -0.057880625*na0.w + 0.062443256*nb0.w + 0.1461875*nc0.w + -0.048376605*nd0.w + -0.5428768*ne0.w + -0.22234322*nf0.w + 0.029686691*ng0.w + 0.006077662*nh0.w + -0.016965399*ni0.w; + u = -0.061339878*na1.x + -0.22763349*nb1.x + -0.023490407*nc1.x + -0.008404945*nd1.x + -0.25364682*ne1.x + -0.059010275*nf1.x + -0.0016836784*ng1.x + -0.14596754*nh1.x + -0.07762156*ni1.x; + v = 0.038167924*na1.y + 0.03796828*nb1.y + 0.01749249*nc1.y + -0.02317157*nd1.y + -0.17835931*ne1.y + 0.114591315*nf1.y + 0.027806472*ng1.y + -0.12774202*nh1.y + -0.043270994*ni1.y; + w = 0.009977157*na1.z + 0.046160668*nb1.z + 0.075068384*nc1.z + 0.18530163*nd1.z + -0.42971575*ne1.z + -0.10997692*nf1.z + 0.01309119*ng1.z + 0.103382744*nh1.z + -0.051152173*ni1.z; + x = 0.008308241*na1.w + 0.112016656*nb1.w + -0.03204292*nc1.w + -0.03667412*nd1.w + 0.05480717*ne1.w + -0.021357488*nf1.w + -0.0192476*ng1.w + -0.041222185*nh1.w + -0.03899985*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.05658022; + i = 0.030151002*a0.x + 0.1860666*b0.x + -0.0022055737*c0.x + -0.13249823*d0.x + -0.07754814*e0.x + 0.11103858*f0.x + -0.25461784*g0.x + -0.23121211*h0.x + 0.13869268*i0.x; + j = 0.02170408*a0.y + -0.0014520105*b0.y + -0.0075796046*c0.y + 0.007614655*d0.y + -0.24949898*e0.y + 0.008160589*f0.y + -0.07433261*g0.y + 0.12531595*h0.y + -0.025806854*i0.y; + k = -0.1143635*a0.z + 0.07558083*b0.z + 0.06544773*c0.z + 0.009476022*d0.z + -0.11959558*e0.z + 0.046458866*f0.z + -0.070280805*g0.z + 0.061093763*h0.z + 0.063683785*i0.z; + l = -0.022641785*a0.w + -0.29642823*b0.w + -0.18833381*c0.w + -0.14111918*d0.w + 0.10596381*e0.w + -0.018907588*f0.w + -0.054916237*g0.w + -0.18433844*h0.w + 0.017380793*i0.w; + m = 0.10092058*a1.x + 0.12342665*b1.x + -0.14488818*c1.x + -0.094983876*d1.x + -0.13887641*e1.x + -0.31285325*f1.x + -0.30513728*g1.x + 0.008164597*h1.x + -0.02678668*i1.x; + n = -0.10522648*a1.y + 0.083025984*b1.y + 0.058566112*c1.y + 0.100287765*d1.y + -0.18487187*e1.y + 0.061653536*f1.y + -0.004182874*g1.y + 0.21625677*h1.y + 0.043687273*i1.y; + o = 0.1626286*a1.z + -0.0571527*b1.z + -0.13826865*c1.z + 0.057854813*d1.z + -0.08257844*e1.z + 0.0632713*f1.z + -0.052715078*g1.z + -0.2670316*h1.z + -0.12404669*i1.z; + p = 0.022306629*a1.w + -0.2257537*b1.w + -0.12413365*c1.w + 0.010597138*d1.w + -0.15639839*e1.w + 0.043527965*f1.w + 0.045449335*g1.w + 0.059061706*h1.w + 0.101682454*i1.w; + q = 0.061564334*na0.x + -0.14031292*nb0.x + -0.014025187*nc0.x + 0.17911491*nd0.x + 0.33740097*ne0.x + 0.20792083*nf0.x + 0.24080946*ng0.x + 0.3538365*nh0.x + 0.05306646*ni0.x; + r = -0.14772856*na0.y + 0.018438019*nb0.y + -0.036556922*nc0.y + -0.13800567*nd0.y + 0.02649721*ne0.y + -0.022540266*nf0.y + 0.052261878*ng0.y + -0.027467266*nh0.y + 0.03414223*ni0.y; + s = 0.031204998*na0.z + 0.041114077*nb0.z + 0.007792205*nc0.z + 0.08775103*nd0.z + 0.064216435*ne0.z + 0.068528414*nf0.z + 0.09969219*ng0.z + 0.12135939*nh0.z + -0.094426885*ni0.z; + t = 0.10184967*na0.w + 0.123821415*nb0.w + 0.13014457*nc0.w + -0.027768346*nd0.w + -0.23585244*ne0.w + -0.05916951*nf0.w + 0.08106088*ng0.w + 0.1933105*nh0.w + 0.049981385*ni0.w; + u = -0.11509542*na1.x + -0.21260747*nb1.x + 0.10034503*nc1.x + -0.05343281*nd1.x + -0.16148616*ne1.x + 0.06921768*nf1.x + 0.1018865*ng1.x + -0.18180113*nh1.x + -0.0019478599*ni1.x; + v = 0.12437264*na1.y + 0.08438361*nb1.y + 0.029054416*nc1.y + -0.078915*nd1.y + 0.43418276*ne1.y + 0.088424504*nf1.y + 0.11200839*ng1.y + 0.04359535*nh1.y + -0.060695816*ni1.y; + w = -0.14184491*na1.z + 0.009048718*nb1.z + -0.0015884426*nc1.z + -0.051001117*nd1.z + 0.12083191*ne1.z + 0.08521108*nf1.z + -0.15348539*ng1.z + 0.2449776*nh1.z + 0.10972097*ni1.z; + x = 0.022142269*na1.w + 0.064288594*nb1.w + 0.10567636*nc1.w + 0.029814683*nd1.w + 0.3069626*ne1.w + -0.112773694*nf1.w + 0.0067777424*ng1.w + -0.049251463*nh1.w + -0.1269242*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.02718557; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN80 +//!BIND LUMAN81 +//!SAVE LUMAN91 + +#define L0_tex LUMAN80_tex +#define L1_tex LUMAN81_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.064591184*a0.x + -0.086834244*b0.x + 0.012061734*c0.x + 0.0076904036*d0.x + -0.006779139*e0.x + -0.11930803*f0.x + 0.064743415*g0.x + 0.061578117*h0.x + 0.07282739*i0.x; + float j = -0.038720116*a0.y + 0.2914675*b0.y + -0.08511401*c0.y + -0.27763*d0.y + -0.2341029*e0.y + -0.14690943*f0.y + 0.11503797*g0.y + 0.11770579*h0.y + -0.0988632*i0.y; + float k = -0.054292727*a0.z + 0.13346374*b0.z + 0.006554269*c0.z + 0.085298486*d0.z + 0.09256209*e0.z + 0.086568855*f0.z + -0.056956228*g0.z + 0.048038904*h0.z + -0.04360846*i0.z; + float l = 0.014501069*a0.w + -0.06803215*b0.w + 0.0285929*c0.w + 0.057434857*d0.w + 0.06706903*e0.w + 0.03170341*f0.w + -0.07010804*g0.w + -0.013323503*h0.w + 0.05878082*i0.w; + float m = -0.117725275*a1.x + -0.115913525*b1.x + 0.030663729*c1.x + 0.014097233*d1.x + -0.0011461431*e1.x + 0.04074681*f1.x + -0.04886523*g1.x + 0.014650436*h1.x + -0.017686432*i1.x; + float n = -0.034699902*a1.y + 0.04545689*b1.y + -0.0077859196*c1.y + 0.026581103*d1.y + 0.13295728*e1.y + 0.061012458*f1.y + -0.031488042*g1.y + 0.01683447*h1.y + -0.07727207*i1.y; + float o = 0.1326936*a1.z + -0.19639158*b1.z + 0.0724299*c1.z + -0.16482691*d1.z + 0.02623066*e1.z + -0.18723568*f1.z + -0.07948423*g1.z + -0.08207342*h1.z + -0.014039538*i1.z; + float p = -0.11302887*a1.w + -0.120441064*b1.w + 0.014967283*c1.w + -0.054630496*d1.w + 0.01606148*e1.w + 0.12035976*f1.w + -0.012942233*g1.w + -0.08405828*h1.w + -0.05511723*i1.w; + float q = 0.10044998*na0.x + 0.07703357*nb0.x + 0.027168838*nc0.x + -0.0712459*nd0.x + -0.12783852*ne0.x + -0.0038406162*nf0.x + 0.00017533907*ng0.x + -0.17575473*nh0.x + -0.104728825*ni0.x; + float r = -0.09326989*na0.y + -0.035516493*nb0.y + 0.044787653*nc0.y + 0.07938428*nd0.y + 0.10040959*ne0.y + 0.06931848*nf0.y + -0.12684844*ng0.y + 0.068755575*nh0.y + 0.08830972*ni0.y; + float s = 0.09743182*na0.z + -0.08618764*nb0.z + -0.09308724*nc0.z + -0.21439748*nd0.z + 0.17929722*ne0.z + -0.13537686*nf0.z + 0.030094212*ng0.z + -0.008233488*nh0.z + 0.026675478*ni0.z; + float t = -0.05652852*na0.w + 0.023983918*nb0.w + -0.023069844*nc0.w + -0.0070350813*nd0.w + -0.07495373*ne0.w + 0.0109437145*nf0.w + 0.05085677*ng0.w + 0.0018807751*nh0.w + -0.08273237*ni0.w; + float u = 0.13703896*na1.x + -0.028061252*nb1.x + 0.00063145265*nc1.x + 0.009538742*nd1.x + -0.043253537*ne1.x + 0.008935095*nf1.x + -0.011389033*ng1.x + -0.06325763*nh1.x + 0.059068896*ni1.x; + float v = 0.007938014*na1.y + -0.13704681*nb1.y + 0.0051192725*nc1.y + -0.06970636*nd1.y + -0.16930172*ne1.y + -0.15330653*nf1.y + 0.016541267*ng1.y + -0.03627275*nh1.y + 0.06254857*ni1.y; + float w = -0.10841602*na1.z + 0.4269225*nb1.z + -0.060182836*nc1.z + 0.1342713*nd1.z + 0.2973204*ne1.z + 0.22778602*nf1.z + -0.034208667*ng1.z + 0.12098727*nh1.z + 0.109278105*ni1.z; + float x = 0.1323955*na1.w + 0.041602165*nb1.w + 0.0026513515*nc1.w + 0.064577274*nd1.w + -0.027596513*ne1.w + -0.12952392*nf1.w + -0.044943932*ng1.w + -0.115508705*nh1.w + 0.015716452*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.001778901; + i = -0.18303195*a0.x + 0.1389399*b0.x + 0.05330645*c0.x + -0.024218678*d0.x + 0.1059723*e0.x + 0.1203514*f0.x + -0.02386567*g0.x + 0.23077035*h0.x + 0.1551605*i0.x; + j = 0.069662265*a0.y + 0.085549094*b0.y + -0.12123253*c0.y + -0.28440872*d0.y + -0.06886727*e0.y + -0.091464095*f0.y + 0.09047435*g0.y + 0.04713467*h0.y + -0.12803286*i0.y; + k = 0.090718895*a0.z + 0.16950507*b0.z + -0.17583397*c0.z + 0.06353087*d0.z + 0.19189116*e0.z + -0.177356*f0.z + -0.048778914*g0.z + -0.027957806*h0.z + 0.06524524*i0.z; + l = -0.15416801*a0.w + 0.2759223*b0.w + 0.1523193*c0.w + 0.144094*d0.w + 0.10375921*e0.w + 0.15397213*f0.w + 0.054405753*g0.w + 0.14805214*h0.w + 0.10322183*i0.w; + m = -0.0021164522*a1.x + -0.16641104*b1.x + 0.12112933*c1.x + 0.05051385*d1.x + 0.15445024*e1.x + -0.05820697*f1.x + -0.26677763*g1.x + 0.051000446*h1.x + 0.106548235*i1.x; + n = 0.09640368*a1.y + 0.14900348*b1.y + -0.1645799*c1.y + -0.12446157*d1.y + -0.12338426*e1.y + -0.16234943*f1.y + -0.08553169*g1.y + -0.032980308*h1.y + 0.1385679*i1.y; + o = -0.27444258*a1.z + -0.20495611*b1.z + 0.087560005*c1.z + -0.17420256*d1.z + 0.4487924*e1.z + 0.16391318*f1.z + -0.21524991*g1.z + 0.08579062*h1.z + 0.11324684*i1.z; + p = -0.006945982*a1.w + 0.34025064*b1.w + 0.22788335*c1.w + -0.011148917*d1.w + -0.018800734*e1.w + -0.15528628*f1.w + 0.07209469*g1.w + -0.12760407*h1.w + 0.037804488*i1.w; + q = 0.08400994*na0.x + -0.17910519*nb0.x + 0.109973855*nc0.x + 0.0025310386*nd0.x + 0.056285445*ne0.x + -0.20070016*nf0.x + -0.11361203*ng0.x + -0.31314817*nh0.x + -0.13633983*ni0.x; + r = 0.16386716*na0.y + -0.14517657*nb0.y + 0.11007822*nc0.y + 0.24017836*nd0.y + 0.35474586*ne0.y + 0.32407668*nf0.y + 0.037026286*ng0.y + -0.14789234*nh0.y + 0.07844272*ni0.y; + s = -0.16014752*na0.z + -0.2903345*nb0.z + 0.1348327*nc0.z + -0.049009476*nd0.z + 0.025261475*ne0.z + 0.20215334*nf0.z + -0.050232634*ng0.z + -0.13409953*nh0.z + -0.04761971*ni0.z; + t = 0.057999365*na0.w + -0.31749207*nb0.w + -0.031203046*nc0.w + -0.32174772*nd0.w + 0.081764035*ne0.w + -0.15557414*nf0.w + 0.040715005*ng0.w + -0.11489052*nh0.w + 0.009872706*ni0.w; + u = 0.073866144*na1.x + 0.08986749*nb1.x + -0.11700794*nc1.x + -0.13253777*nd1.x + -0.06588698*ne1.x + -0.063383356*nf1.x + 0.15730932*ng1.x + -0.07174025*nh1.x + -0.13080357*ni1.x; + v = -0.15654103*na1.y + -0.061252818*nb1.y + 0.32725814*nc1.y + 0.15096447*nd1.y + 0.40280807*ne1.y + 0.24929035*nf1.y + 0.15287307*ng1.y + 0.13057452*nh1.y + -0.18048123*ni1.y; + w = 0.33798084*na1.z + 0.02931741*nb1.z + -0.07852497*nc1.z + 0.38193208*nd1.z + -0.06619199*ne1.z + -0.21040082*nf1.z + 0.068854*ng1.z + -0.2469383*nh1.z + -0.08334495*ni1.z; + x = -0.02454442*na1.w + -0.3080107*nb1.w + -0.03530862*nc1.w + 0.041308373*nd1.w + 0.14073959*ne1.w + 0.20617355*nf1.w + -0.043657694*ng1.w + 0.13304688*nh1.w + 0.03679344*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.015583766; + i = 0.031398952*a0.x + 0.04189893*b0.x + 0.19730887*c0.x + 0.08555677*d0.x + -0.18717846*e0.x + 0.22618406*f0.x + -0.052923724*g0.x + 0.09675072*h0.x + -0.076768704*i0.x; + j = 0.11788979*a0.y + -0.15309438*b0.y + -0.04075275*c0.y + -0.110383265*d0.y + -0.48619998*e0.y + 0.07023799*f0.y + 0.10708083*g0.y + 0.26446325*h0.y + -0.048599552*i0.y; + k = 0.052632306*a0.z + 0.020550659*b0.z + -0.019962313*c0.z + 0.056734044*d0.z + 0.20157674*e0.z + 0.13263007*f0.z + -0.046961598*g0.z + -0.09691325*h0.z + 0.0531848*i0.z; + l = 0.101675026*a0.w + 0.27784944*b0.w + 0.12324177*c0.w + -0.07068762*d0.w + 0.0818228*e0.w + -0.09321215*f0.w + -0.11643468*g0.w + -0.102201894*h0.w + -0.072663896*i0.w; + m = -0.071761504*a1.x + 0.029838279*b1.x + -0.11154797*c1.x + 0.07294159*d1.x + 0.4818034*e1.x + -0.5087342*f1.x + -0.112223916*g1.x + -0.28908643*h1.x + -0.08666744*i1.x; + n = 0.014254376*a1.y + -0.06831736*b1.y + -0.02225946*c1.y + -0.061442286*d1.y + -0.21341231*e1.y + 0.07420914*f1.y + -0.020930115*g1.y + -0.23098978*h1.y + 0.047968682*i1.y; + o = -0.12318773*a1.z + 0.16779573*b1.z + 0.060841598*c1.z + -0.13125354*d1.z + 0.5366516*e1.z + 0.13552463*f1.z + -0.16648643*g1.z + -0.5225955*h1.z + 0.20588054*i1.z; + p = 0.021681841*a1.w + 0.0147839105*b1.w + -0.07116525*c1.w + -0.11239224*d1.w + -0.28134072*e1.w + -0.20774683*f1.w + -0.056640606*g1.w + -0.20807342*h1.w + -0.14187394*i1.w; + q = -0.10805369*na0.x + -0.17083731*nb0.x + -0.122314125*nc0.x + -0.17160355*nd0.x + -0.03651102*ne0.x + -0.3779597*nf0.x + 0.14284317*ng0.x + 0.07732665*nh0.x + -0.05547113*ni0.x; + r = 0.0049363286*na0.y + 0.063314065*nb0.y + 0.12015747*nc0.y + 0.027678438*nd0.y + 0.40603974*ne0.y + 0.15798166*nf0.y + -0.12128637*ng0.y + -0.34773082*nh0.y + -0.15439473*ni0.y; + s = -0.104180954*na0.z + -0.06222233*nb0.z + 0.03805832*nc0.z + 0.0090491325*nd0.z + -0.23674521*ne0.z + 0.073091164*nf0.z + 0.092849016*ng0.z + -0.101051524*nh0.z + 0.09585388*ni0.z; + t = -0.08372517*na0.w + -0.23765321*nb0.w + -0.11047642*nc0.w + -0.09844205*nd0.w + -0.001197135*ne0.w + 0.05874671*nf0.w + 0.04448913*ng0.w + 0.17621781*nh0.w + 0.15660878*ni0.w; + u = -0.06192374*na1.x + -0.23233692*nb1.x + 0.028859159*nc1.x + -0.21800128*nd1.x + -0.44495392*ne1.x + 0.16226628*nf1.x + 0.059766024*ng1.x + 0.040463783*nh1.x + -0.012325476*ni1.x; + v = -0.046759803*na1.y + 0.14202406*nb1.y + 0.17334686*nc1.y + 0.095378935*nd1.y + 0.4668013*ne1.y + 0.03654941*nf1.y + 0.049729843*ng1.y + 0.3160583*nh1.y + -0.037990443*ni1.y; + w = 0.054236986*na1.z + -0.24953325*nb1.z + -0.19295105*nc1.z + 0.110123426*nd1.z + -0.24358514*ne1.z + -0.094099194*nf1.z + -0.0844554*ng1.z + -0.25239566*nh1.z + -0.17206073*ni1.z; + x = -0.025024686*na1.w + 0.02190405*nb1.w + 0.04221924*nc1.w + 0.058701836*nd1.w + 0.6308858*ne1.w + 0.08038904*nf1.w + 0.009703351*ng1.w + 0.026796142*nh1.w + 0.19788514*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.025371183; + i = -0.058024336*a0.x + 0.10532148*b0.x + 0.100440994*c0.x + 0.14120099*d0.x + -0.44670558*e0.x + 0.35560834*f0.x + -0.016374707*g0.x + -0.110824086*h0.x + -0.08113989*i0.x; + j = 0.16398832*a0.y + -0.13447765*b0.y + 0.09828142*c0.y + -0.22374575*d0.y + -0.18894796*e0.y + -0.019239465*f0.y + 0.058094535*g0.y + 0.019594995*h0.y + -0.022476602*i0.y; + k = -0.04586844*a0.z + -0.041416757*b0.z + 0.007783088*c0.z + 0.159755*d0.z + 0.05849857*e0.z + 0.07732498*f0.z + 0.0147085795*g0.z + -0.055099167*h0.z + 0.002787397*i0.z; + l = 0.02477698*a0.w + 0.20407157*b0.w + 0.02392268*c0.w + -0.019186161*d0.w + -0.10105682*e0.w + -0.017388765*f0.w + -0.043925446*g0.w + -0.19729522*h0.w + -0.039546635*i0.w; + m = -0.12748602*a1.x + 0.007744777*b1.x + -0.11417597*c1.x + -0.06718526*d1.x + -0.18276522*e1.x + -0.22255349*f1.x + -0.081417985*g1.x + -0.32245603*h1.x + -0.061777283*i1.x; + n = -0.022619156*a1.y + -0.07581258*b1.y + 0.015761778*c1.y + 0.08068204*d1.y + -0.121548444*e1.y + -0.00881804*f1.y + 0.079423025*g1.y + -0.18817104*h1.y + 0.03789271*i1.y; + o = -0.076126486*a1.z + 0.12285975*b1.z + -0.051165633*c1.z + -0.2726493*d1.z + 0.03755115*e1.z + 0.21114524*f1.z + -0.13811706*g1.z + 0.0827258*h1.z + 0.023614317*i1.z; + p = 0.091591224*a1.w + -0.060717527*b1.w + -0.11393609*c1.w + -0.04921939*d1.w + -0.47288194*e1.w + -0.15777309*f1.w + 0.16799176*g1.w + -0.022680234*h1.w + -0.016104206*i1.w; + q = -0.037887465*na0.x + -0.15142171*nb0.x + -0.057591256*nc0.x + -0.19010404*nd0.x + -0.043804526*ne0.x + -0.43700722*nf0.x + -0.02484513*ng0.x + 0.36064592*nh0.x + 0.21845186*ni0.x; + r = -0.059631128*na0.y + -0.16758823*nb0.y + 0.064641714*nc0.y + 0.08638126*nd0.y + 0.22690679*ne0.y + 0.043664902*nf0.y + -0.13494207*ng0.y + 0.05925926*nh0.y + 0.042411618*ni0.y; + s = 0.12977123*na0.z + 0.029090298*nb0.z + 0.08898829*nc0.z + -0.1127789*nd0.z + -0.17318541*ne0.z + 0.031613287*nf0.z + -0.044531874*ng0.z + 0.08955115*nh0.z + -0.0037841343*ni0.z; + t = -0.03975416*na0.w + -0.14064074*nb0.w + -0.07762262*nc0.w + -0.3259637*nd0.w + 0.14367038*ne0.w + 0.08904514*nf0.w + 0.039760273*ng0.w + 0.21290119*nh0.w + 0.10287399*ni0.w; + u = 0.1206366*na1.x + -0.111801684*nb1.x + 0.028606556*nc1.x + -0.100312516*nd1.x + 0.06404543*ne1.x + 0.21569107*nf1.x + 0.0471198*ng1.x + 0.1317695*nh1.x + -0.008076078*ni1.x; + v = -0.043892793*na1.y + 0.050969392*nb1.y + 0.05223572*nc1.y + -0.015787575*nd1.y + 0.23640944*ne1.y + 0.030180406*nf1.y + 0.052976888*ng1.y + 0.24454458*nh1.y + 0.009542104*ni1.y; + w = 0.060694832*na1.z + -0.1225385*nb1.z + -0.060287304*nc1.z + 0.27989724*nd1.z + -0.13930206*ne1.z + -0.18856433*nf1.z + 0.12858151*ng1.z + -0.06630377*nh1.z + 0.032981817*ni1.z; + x = -0.12053484*na1.w + 0.11501946*nb1.w + -0.04619954*nc1.w + 0.04656391*nd1.w + 0.55226207*ne1.w + 0.14339776*nf1.w + -0.07201873*ng1.w + -0.005340205*nh1.w + 0.04245002*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.015942387; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN90 +//!BIND LUMAN91 +//!SAVE LUMAN100 + +#define L0_tex LUMAN90_tex +#define L1_tex LUMAN91_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.072347514*a0.x + 0.01950207*b0.x + -0.1554631*c0.x + 0.07643896*d0.x + 0.19518887*e0.x + -0.05865835*f0.x + -0.06931961*g0.x + -0.22170015*h0.x + -0.060511827*i0.x; + float j = -0.014025003*a0.y + -0.104386844*b0.y + -0.08156085*c0.y + -0.095033586*d0.y + -0.013332267*e0.y + -0.20685793*f0.y + -0.012088011*g0.y + 0.10598454*h0.y + -0.19078864*i0.y; + float k = -0.03994867*a0.z + -0.09009791*b0.z + 0.07993808*c0.z + -0.074835144*d0.z + 0.31472498*e0.z + 0.03673388*f0.z + 0.067335665*g0.z + -0.03211525*h0.z + -0.035896238*i0.z; + float l = 0.062431067*a0.w + 0.08663771*b0.w + 0.0069865235*c0.w + 0.07760846*d0.w + -0.25497046*e0.w + -0.2194801*f0.w + -0.14292969*g0.w + -0.030415112*h0.w + -0.02306825*i0.w; + float m = 0.101905294*a1.x + -0.10230241*b1.x + -0.09905037*c1.x + 0.012886894*d1.x + -0.21476957*e1.x + 0.036221605*f1.x + -0.07952149*g1.x + -0.0008413512*h1.x + 0.08244255*i1.x; + float n = -0.030719101*a1.y + -0.021777108*b1.y + -0.029602678*c1.y + -0.039401323*d1.y + -0.29197764*e1.y + -0.009044627*f1.y + -0.009216671*g1.y + 0.12832381*h1.y + -0.025247786*i1.y; + float o = 0.05362967*a1.z + -0.08874077*b1.z + 0.034315668*c1.z + 0.05820452*d1.z + 0.42243248*e1.z + 0.11247401*f1.z + -0.04098587*g1.z + -0.003260546*h1.z + 0.028615315*i1.z; + float p = 0.071061894*a1.w + 0.07652106*b1.w + -0.033353116*c1.w + 0.024202999*d1.w + 0.14031556*e1.w + -0.05963695*f1.w + 0.0347537*g1.w + -0.108266346*h1.w + 0.07211353*i1.w; + float q = -0.05338283*na0.x + -0.09228174*nb0.x + 0.013092857*nc0.x + -0.17125084*nd0.x + 0.6550206*ne0.x + -0.09533192*nf0.x + -0.09689084*ng0.x + -0.0041894587*nh0.x + 0.21914695*ni0.x; + float r = -0.026422335*na0.y + 0.036880214*nb0.y + 0.041254893*nc0.y + 0.0008156015*nd0.y + 0.13534403*ne0.y + 0.047952086*nf0.y + -0.032348964*ng0.y + 0.014010682*nh0.y + 0.0435421*ni0.y; + float s = -0.082521975*na0.z + 0.037913103*nb0.z + -0.10370344*nc0.z + -0.00462962*nd0.z + 0.45346752*ne0.z + -0.16892655*nf0.z + 0.025737757*ng0.z + -0.111673385*nh0.z + -0.08034411*ni0.z; + float t = -0.015661575*na0.w + -0.073354624*nb0.w + 0.11910762*nc0.w + -0.043032695*nd0.w + 0.21332191*ne0.w + 0.19106698*nf0.w + 0.032210633*ng0.w + 0.08627176*nh0.w + -0.04056943*ni0.w; + float u = -0.11458479*na1.x + 0.008572165*nb1.x + 0.08625398*nc1.x + 0.048368633*nd1.x + 0.3868506*ne1.x + -0.19619699*nf1.x + 0.12097667*ng1.x + -0.20041737*nh1.x + -0.1732846*ni1.x; + float v = -0.055646222*na1.y + 0.1451881*nb1.y + -0.025238834*nc1.y + 0.082327254*nd1.y + -0.4478959*ne1.y + 0.1096028*nf1.y + -0.12073877*ng1.y + -0.008622235*nh1.y + -0.07914616*ni1.y; + float w = -0.046383664*na1.z + 0.014370623*nb1.z + -0.021135237*nc1.z + -0.06458644*nd1.z + -0.7450077*ne1.z + -0.012579624*nf1.z + 0.02945094*ng1.z + 0.029546322*nh1.z + -0.012804222*ni1.z; + float x = -0.12739643*na1.w + -0.036583748*nb1.w + -0.046106555*nc1.w + 0.05811886*nd1.w + -0.25411293*ne1.w + 0.018013328*nf1.w + -0.05903975*ng1.w + 0.07108783*nh1.w + 0.019811854*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.053409602; + i = -0.10668289*a0.x + -0.22589163*b0.x + -0.13987538*c0.x + 0.05335291*d0.x + 0.48375422*e0.x + 0.15344132*f0.x + -0.11009505*g0.x + 0.016672708*h0.x + -0.10074288*i0.x; + j = 0.0015947276*a0.y + 0.07250249*b0.y + -0.0191254*c0.y + 0.028646745*d0.y + 0.15963951*e0.y + 0.03491725*f0.y + -0.03486035*g0.y + -0.027305596*h0.y + 0.06868714*i0.y; + k = 0.043614652*a0.z + -0.049251266*b0.z + 0.111902446*c0.z + -0.115563944*d0.z + 0.16635779*e0.z + 0.07196166*f0.z + 0.085996434*g0.z + 0.054356594*h0.z + 0.054694902*i0.z; + l = 0.063457504*a0.w + -0.16555345*b0.w + -0.1977629*c0.w + -0.06448137*d0.w + -0.06259094*e0.w + 0.06365486*f0.w + -0.06359395*g0.w + -0.1920657*h0.w + 0.12513515*i0.w; + m = 0.09495681*a1.x + 0.2365361*b1.x + 0.055532113*c1.x + -0.15307817*d1.x + -0.33488598*e1.x + -0.1148399*f1.x + 0.06822197*g1.x + -0.0937158*h1.x + 0.086206466*i1.x; + n = 0.0045078564*a1.y + -0.06391341*b1.y + -0.08308173*c1.y + -0.19018562*d1.y + 0.30169633*e1.y + -0.054772913*f1.y + -0.13738966*g1.y + 0.062181123*h1.y + 0.054774147*i1.y; + o = 0.060118355*a1.z + -0.008127762*b1.z + -0.034156173*c1.z + 0.0500277*d1.z + -0.08534194*e1.z + 0.010345815*f1.z + 0.12302839*g1.z + -0.04158649*h1.z + -0.03973762*i1.z; + p = -0.080815166*a1.w + 0.08477702*b1.w + 0.13679668*c1.w + 0.04734655*d1.w + -0.0024687275*e1.w + -0.06741254*f1.w + 0.0020256601*g1.w + -0.009172918*h1.w + -0.037641473*i1.w; + q = 0.06965178*na0.x + 0.29032642*nb0.x + 0.17806295*nc0.x + -0.11129186*nd0.x + -0.41759446*ne0.x + 0.0050110994*nf0.x + 0.17578389*ng0.x + -0.11543253*nh0.x + -0.001885809*ni0.x; + r = 0.005317532*na0.y + 0.095645644*nb0.y + -0.021098567*nc0.y + 0.06591392*nd0.y + -0.116197005*ne0.y + -0.043358993*nf0.y + -0.013009809*ng0.y + -0.15138024*nh0.y + -0.033799697*ni0.y; + s = -0.057522736*na0.z + -0.082728855*nb0.z + -0.031226154*nc0.z + 0.18959501*nd0.z + -0.20877957*ne0.z + -0.07964734*nf0.z + -0.04476616*ng0.z + 0.009902144*nh0.z + 0.07217108*ni0.z; + t = -0.024333658*na0.w + 0.047745872*nb0.w + 0.16592872*nc0.w + -0.12421168*nd0.w + -0.11843008*ne0.w + -0.11738284*nf0.w + 0.21761538*ng0.w + 0.049520187*nh0.w + -0.1659902*ni0.w; + u = 0.14783847*na1.x + 0.17537417*nb1.x + 0.049885694*nc1.x + 0.17277068*nd1.x + 0.2821199*ne1.x + 0.09878132*nf1.x + -0.11981736*ng1.x + 0.118238404*nh1.x + -0.01825559*ni1.x; + v = 0.06738571*na1.y + -0.1575328*nb1.y + 0.036821637*nc1.y + 0.0392651*nd1.y + 0.20996699*ne1.y + 0.010065104*nf1.y + 0.16928582*ng1.y + -0.18545963*nh1.y + -0.061286196*ni1.y; + w = -0.018393407*na1.z + -0.13900594*nb1.z + 0.005088923*nc1.z + -0.044956826*nd1.z + 0.29364726*ne1.z + -0.07444642*nf1.z + -0.10428068*ng1.z + 0.014451067*nh1.z + 0.04694493*ni1.z; + x = 0.16300602*na1.w + 0.18626012*nb1.w + -0.06521978*nc1.w + -0.012457507*nd1.w + 0.36782196*ne1.w + 0.11866779*nf1.w + 0.10910508*ng1.w + 0.032809496*nh1.w + -0.07063725*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.012890339; + i = -0.09139671*a0.x + 0.35795408*b0.x + 0.038557854*c0.x + -0.52320266*d0.x + 0.26043087*e0.x + -0.0070253634*f0.x + -0.034186177*g0.x + -0.3889957*h0.x + 0.006295736*i0.x; + j = -0.026434768*a0.y + 0.11207987*b0.y + -0.08482518*c0.y + -0.08554998*d0.y + 0.41271183*e0.y + -0.095349595*f0.y + 0.019489529*g0.y + -0.04493386*h0.y + -0.095000364*i0.y; + k = -0.07414244*a0.z + -0.030943856*b0.z + -0.25061974*c0.z + -0.15343326*d0.z + 0.05414551*e0.z + 0.32426453*f0.z + 0.16768244*g0.z + -0.014362068*h0.z + 0.060472*i0.z; + l = -0.083828114*a0.w + 0.13204199*b0.w + -0.04703435*c0.w + -0.035870466*d0.w + -0.44054565*e0.w + -0.09806949*f0.w + -0.1409398*g0.w + 0.0019250079*h0.w + 0.019642184*i0.w; + m = -0.0012715708*a1.x + 0.049831104*b1.x + -0.063315846*c1.x + -0.067038305*d1.x + -0.0893526*e1.x + 0.0021741989*f1.x + 0.24290745*g1.x + 0.023283675*h1.x + -0.17132534*i1.x; + n = 0.048266195*a1.y + -0.0011830739*b1.y + 0.18100028*c1.y + -0.25165966*d1.y + 0.2969748*e1.y + -0.3689166*f1.y + -0.060033243*g1.y + -0.004085616*h1.y + 0.08210132*i1.y; + o = 0.03524951*a1.z + 0.4448059*b1.z + -0.3404398*c1.z + 0.12155771*d1.z + -0.023394607*e1.z + 0.24049339*f1.z + 0.21649478*g1.z + -0.04342076*h1.z + -0.0025506937*i1.z; + p = -0.06775117*a1.w + -0.2165721*b1.w + 0.2823466*c1.w + -0.15691832*d1.w + 0.08486866*e1.w + -0.18946524*f1.w + -0.14904466*g1.w + 0.035512596*h1.w + -0.013078167*i1.w; + q = 0.059031803*na0.x + -0.5058904*nb0.x + -0.0038910978*nc0.x + 0.23189625*nd0.x + 0.18667111*ne0.x + 0.03620043*nf0.x + 0.08591163*ng0.x + 0.34300846*nh0.x + 0.037738785*ni0.x; + r = 0.06437921*na0.y + -0.018446406*nb0.y + -0.053650368*nc0.y + 0.010188758*nd0.y + -0.28385177*ne0.y + 0.27842358*nf0.y + 0.010817179*ng0.y + 0.00707268*nh0.y + 0.022868687*ni0.y; + s = 0.10183586*na0.z + -0.085717954*nb0.z + 0.2063317*nc0.z + 0.11843876*nd0.z + 0.26863*ne0.z + -0.3623546*nf0.z + -0.13238493*ng0.z + -0.095737286*nh0.z + -0.07417025*ni0.z; + t = -0.16863932*na0.w + -0.23825082*nb0.w + -0.15660179*nc0.w + 0.04931752*nd0.w + 0.6820201*ne0.w + -0.032462034*nf0.w + 0.078525215*ng0.w + -0.21108823*nh0.w + 0.16687338*ni0.w; + u = 0.004978578*na1.x + -0.24199933*nb1.x + -0.24022794*nc1.x + 0.13019069*nd1.x + 0.2714972*ne1.x + 0.29668224*nf1.x + -0.08448439*ng1.x + 0.41858274*nh1.x + 0.20609297*ni1.x; + v = -0.045478754*na1.y + 0.1254586*nb1.y + 0.26045057*nc1.y + 0.36398405*nd1.y + -0.31560805*ne1.y + 0.15722503*nf1.y + 0.17487678*ng1.y + 0.173974*nh1.y + 0.05119602*ni1.y; + w = 0.03245682*na1.z + -0.10725469*nb1.z + 0.16054815*nc1.z + -0.29050833*nd1.z + -0.046494015*ne1.z + -0.25890747*nf1.z + -0.17802468*ng1.z + 0.04463261*nh1.z + 0.025746295*ni1.z; + x = -0.005190955*na1.w + 0.5844454*nb1.w + -0.1295932*nc1.w + 0.085063726*nd1.w + 0.5402516*ne1.w + -0.09760206*nf1.w + 0.17631175*ng1.w + -0.029834324*nh1.w + 0.12012502*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.024680963; + i = 0.22015639*a0.x + -0.17407666*b0.x + -0.017574009*c0.x + 0.021068307*d0.x + -0.03861795*e0.x + -0.053769782*f0.x + 0.0598006*g0.x + 0.13844252*h0.x + -0.071340755*i0.x; + j = 0.050717417*a0.y + 0.025524106*b0.y + -0.08404415*c0.y + 0.08333174*d0.y + 0.017013293*e0.y + -0.11637262*f0.y + -0.037559748*g0.y + -0.0068465522*h0.y + 0.13893107*i0.y; + k = 0.043148153*a0.z + 0.3295378*b0.z + 0.0087906*c0.z + 0.11311087*d0.z + 0.04312488*e0.z + 0.04736787*f0.z + -0.22878742*g0.z + 0.09858411*h0.z + 0.0005592605*i0.z; + l = 0.04284654*a0.w + 0.07436968*b0.w + 0.10052526*c0.w + -0.065019675*d0.w + 0.3465609*e0.w + 0.0008741843*f0.w + 0.2270247*g0.w + -0.03964889*h0.w + 0.071887866*i0.w; + m = -0.14235982*a1.x + -0.07072083*b1.x + -0.084995635*c1.x + -0.100894645*d1.x + -0.44581255*e1.x + 0.015933136*f1.x + -0.019286517*g1.x + -0.1235309*h1.x + -0.03368268*i1.x; + n = -0.03326311*a1.y + -0.10073692*b1.y + -0.09853149*c1.y + -0.07900594*d1.y + -0.1953579*e1.y + 0.042089753*f1.y + -0.07855328*g1.y + -0.23200025*h1.y + -0.006610747*i1.y; + o = -0.08007896*a1.z + -0.2461607*b1.z + 0.14353238*c1.z + -0.04846219*d1.z + -0.1721878*e1.z + -0.09197814*f1.z + -0.06070735*g1.z + 0.18315983*h1.z + -0.034425892*i1.z; + p = 0.05459684*a1.w + 0.31108928*b1.w + -0.10467039*c1.w + 0.010673246*d1.w + 0.0047224355*e1.w + -0.0058969916*f1.w + 0.056659333*g1.w + -0.106476724*h1.w + 0.104168944*i1.w; + q = -0.12763675*na0.x + 0.25710836*nb0.x + 0.0072693126*nc0.x + 0.03039457*nd0.x + -0.0044554067*ne0.x + -0.022940034*nf0.x + -0.09403209*ng0.x + 0.015883204*nh0.x + 0.13509955*ni0.x; + r = -0.0994595*na0.y + -0.13763939*nb0.y + 0.1409501*nc0.y + -0.0032936442*nd0.y + -0.20076504*ne0.y + -0.0654214*nf0.y + 0.06498927*ng0.y + -0.00031625124*nh0.y + -0.22941948*ni0.y; + s = -0.009283021*na0.z + -0.16832107*nb0.z + -0.13831505*nc0.z + 0.08391695*nd0.z + -0.13806774*ne0.z + 0.03952671*nf0.z + 0.18881537*ng0.z + -0.06885674*nh0.z + -0.0108183455*ni0.z; + t = -0.054374512*na0.w + -0.012385924*nb0.w + -0.02725351*nc0.w + 0.024616664*nd0.w + -0.2775687*ne0.w + 0.25559253*nf0.w + -0.11180425*ng0.w + 0.019967819*nh0.w + 0.02086255*ni0.w; + u = 0.057943374*na1.x + 0.1063353*nb1.x + 0.09240854*nc1.x + 0.16697767*nd1.x + 0.1308629*ne1.x + 0.05557683*nf1.x + 0.09398093*ng1.x + -0.1522693*nh1.x + 0.027451862*ni1.x; + v = 0.14591761*na1.y + -0.040234886*nb1.y + 0.06888115*nc1.y + 0.07083606*nd1.y + 0.13988727*ne1.y + -0.039818123*nf1.y + 0.04681032*ng1.y + 0.17090715*nh1.y + 0.103332356*ni1.y; + w = -0.008291727*na1.z + 0.18223919*nb1.z + -0.10855884*nc1.z + 0.23896803*nd1.z + 0.044032115*ne1.z + 0.14236271*nf1.z + -0.0023151839*ng1.z + -0.1667703*nh1.z + 0.045290492*ni1.z; + x = -0.111752234*na1.w + -0.4377266*nb1.w + 0.14324181*nc1.w + -0.076248966*nd1.w + -0.28233582*ne1.w + -0.061120443*nf1.w + -0.17006911*ng1.w + -0.016051235*nh1.w + -0.08499419*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.008792649; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN90 +//!BIND LUMAN91 +//!SAVE LUMAN101 + +#define L0_tex LUMAN90_tex +#define L1_tex LUMAN91_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.04138916*a0.x + 0.30197543*b0.x + -0.1704045*c0.x + 0.17965184*d0.x + 0.29003835*e0.x + 0.08370005*f0.x + 0.03190118*g0.x + -0.17518468*h0.x + 0.012955842*i0.x; + float j = -0.07109726*a0.y + 0.1823734*b0.y + -0.04605392*c0.y + 0.059269615*d0.y + -0.15138285*e0.y + 0.03608101*f0.y + 0.08242375*g0.y + 0.009028954*h0.y + 0.072812274*i0.y; + float k = -0.12356149*a0.z + -0.086611435*b0.z + -0.04118464*c0.z + -0.31934968*d0.z + 0.101652585*e0.z + 0.26276174*f0.z + 0.021968804*g0.z + 0.017631736*h0.z + 0.10742102*i0.z; + float l = -0.09023773*a0.w + 0.2707063*b0.w + -0.037710827*c0.w + 0.061088122*d0.w + -0.35330138*e0.w + 0.09019705*f0.w + 0.16161165*g0.w + 0.025295937*h0.w + 0.06373963*i0.w; + float m = -0.0034698183*a1.x + 0.22036514*b1.x + -0.1092582*c1.x + 0.09482756*d1.x + -0.109374434*e1.x + -0.3238208*f1.x + 0.17918727*g1.x + 0.39547127*h1.x + -0.4623379*i1.x; + float n = 0.050948843*a1.y + 0.01738471*b1.y + -0.105602264*c1.y + -0.2204674*d1.y + -0.45561066*e1.y + -0.12051163*f1.y + -0.16263375*g1.y + -0.25530714*h1.y + -0.09285533*i1.y; + float o = 0.07403561*a1.z + 0.1990857*b1.z + -0.11977993*c1.z + 0.13144638*d1.z + 0.2341229*e1.z + -0.00042121703*f1.z + 0.1583226*g1.z + 0.12840292*h1.z + 0.1433887*i1.z; + float p = -0.1851604*a1.w + 0.17602521*b1.w + 0.1221305*c1.w + -0.03615599*d1.w + -0.07932866*e1.w + -0.2525634*f1.w + 0.002964321*g1.w + 0.11298226*h1.w + -0.13519266*i1.w; + float q = -0.08234646*na0.x + -0.1414366*nb0.x + 0.15008587*nc0.x + -0.29907978*nd0.x + 0.11506433*ne0.x + -0.22332646*nf0.x + 0.05805965*ng0.x + 0.27810848*nh0.x + 0.070169106*ni0.x; + float r = 0.03592974*na0.y + -0.16536513*nb0.y + 0.11441198*nc0.y + 0.08435175*nd0.y + 0.08932274*ne0.y + -0.027787168*nf0.y + 0.029256653*ng0.y + -0.040782016*nh0.y + -0.20330355*ni0.y; + float s = 0.18085478*na0.z + -0.020390073*nb0.z + 0.05839085*nc0.z + 0.22958046*nd0.z + 0.37471008*ne0.z + -0.18636653*nf0.z + -0.11146145*ng0.z + -0.22841236*nh0.z + -0.07214006*ni0.z; + float t = -0.05589969*na0.w + -0.33850622*nb0.w + -0.13061482*nc0.w + 0.13003778*nd0.w + 0.10737323*ne0.w + 0.10882713*nf0.w + -0.042201*ng0.w + 0.08923628*nh0.w + 0.09584097*ni0.w; + float u = 0.25411305*na1.x + -0.094354436*nb1.x + 0.10621806*nc1.x + 0.21951157*nd1.x + 0.4614293*ne1.x + 0.31408313*nf1.x + 0.17083499*ng1.x + 0.35976404*nh1.x + 0.59438545*ni1.x; + float v = 0.19550157*na1.y + 0.069357626*nb1.y + 0.11229597*nc1.y + 0.3491916*nd1.y + 0.014997532*ne1.y + 0.30050907*nf1.y + 0.5238676*ng1.y + 0.49579856*nh1.y + 0.24422513*ni1.y; + float w = -0.050069377*na1.z + -0.20981462*nb1.z + 0.03546458*nc1.z + -0.11718573*nd1.z + -0.65724605*ne1.z + -0.15975557*nf1.z + -0.23317842*ng1.z + -0.19055666*nh1.z + -0.12475086*ni1.z; + float x = 0.24616854*na1.w + 0.22712433*nb1.w + 0.003031617*nc1.w + 0.048955284*nd1.w + 0.1591972*ne1.w + 0.28133035*nf1.w + 0.016519194*ng1.w + -0.16729145*nh1.w + 0.18185227*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.047343764; + i = 0.005074274*a0.x + -0.10939917*b0.x + 0.09337425*c0.x + 0.12879685*d0.x + -0.2513652*e0.x + 0.024987087*f0.x + -0.034622103*g0.x + -0.25332397*h0.x + -0.12031207*i0.x; + j = -0.06383014*a0.y + -0.13306095*b0.y + 0.05165878*c0.y + -0.06310904*d0.y + -0.37605837*e0.y + 0.0046695503*f0.y + -0.042384528*g0.y + -0.17892925*h0.y + 0.11072541*i0.y; + k = 0.0863989*a0.z + -0.063399985*b0.z + 0.06119446*c0.z + 0.16250986*d0.z + -0.1728184*e0.z + 0.008604359*f0.z + 0.16334063*g0.z + -0.113537095*h0.z + 0.1009804*i0.z; + l = 0.047524717*a0.w + -0.16800861*b0.w + -0.10891596*c0.w + 0.03267108*d0.w + 0.06986079*e0.w + -0.008223582*f0.w + 0.060645815*g0.w + -0.02414828*h0.w + -0.122083426*i0.w; + m = 0.078140706*a1.x + -0.018814396*b1.x + -0.15132849*c1.x + 0.118835375*d1.x + -0.1442321*e1.x + -0.017920561*f1.x + 0.06573718*g1.x + 0.082351625*h1.x + -0.06982771*i1.x; + n = 0.033628177*a1.y + -0.09716254*b1.y + 0.02115325*c1.y + -0.048093375*d1.y + 0.31762937*e1.y + -0.11595583*f1.y + -0.008387223*g1.y + -0.083197124*h1.y + -0.040556666*i1.y; + o = 0.14306657*a1.z + -0.022273308*b1.z + -0.077878624*c1.z + 0.22185993*d1.z + -0.31860897*e1.z + 0.053827673*f1.z + 0.1621465*g1.z + -0.03989667*h1.z + 0.05673126*i1.z; + p = -0.11362184*a1.w + 0.17365338*b1.w + 0.08072115*c1.w + 0.0016683352*d1.w + 0.05453119*e1.w + 0.10592867*f1.w + -0.054010063*g1.w + 0.023749562*h1.w + -0.024204558*i1.w; + q = 0.002665413*na0.x + -0.003804767*nb0.x + -0.05944676*nc0.x + -0.24341638*nd0.x + 0.41303757*ne0.x + 0.009786497*nf0.x + -0.06763682*ng0.x + 0.05546292*nh0.x + 0.05898785*ni0.x; + r = 0.1532655*na0.y + 0.046516657*nb0.y + 0.031247063*nc0.y + 0.051957767*nd0.y + 0.14366964*ne0.y + 0.3183212*nf0.y + 0.0112762125*ng0.y + 0.12396964*nh0.y + 0.051013164*ni0.y; + s = -0.07427598*na0.z + 0.17220956*nb0.z + -0.079463005*nc0.z + -0.07945764*nd0.z + 0.31239212*ne0.z + -0.16328163*nf0.z + -0.19595952*ng0.z + 0.025388455*nh0.z + -0.08269749*ni0.z; + t = -0.02824691*na0.w + 0.118230626*nb0.w + 0.039104287*nc0.w + 0.054503523*nd0.w + 0.07351955*ne0.w + 0.07331395*nf0.w + -0.029851029*ng0.w + 0.03505141*nh0.w + 0.1424937*ni0.w; + u = -0.07982493*na1.x + -0.090192325*nb1.x + 0.07434182*nc1.x + -0.23530023*nd1.x + 0.12131227*ne1.x + 0.13164005*nf1.x + -0.052253626*ng1.x + -0.046372693*nh1.x + 0.057849534*ni1.x; + v = -0.008675165*na1.y + 0.051392596*nb1.y + 0.007813682*nc1.y + 0.13168667*nd1.y + 0.041282393*ne1.y + 0.11799713*nf1.y + 0.0034918478*ng1.y + -0.11258261*nh1.y + 0.028657598*ni1.y; + w = -0.07173511*na1.z + 0.113963515*nb1.z + 0.06922608*nc1.z + -0.1977448*nd1.z + 0.3254376*ne1.z + -0.03963667*nf1.z + -0.046891466*ng1.z + 0.052214094*nh1.z + -0.035925962*ni1.z; + x = 0.09945125*na1.w + -0.31153867*nb1.w + -0.0972693*nc1.w + 0.2058437*nd1.w + -0.04664287*ne1.w + -0.15176259*nf1.w + 0.12657925*ng1.w + -0.043328263*nh1.w + 0.014189671*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.014974224; + i = 0.11425061*a0.x + -0.12480644*b0.x + 0.037956957*c0.x + 0.08022729*d0.x + 0.5309364*e0.x + -0.22583173*f0.x + 0.12067425*g0.x + 0.08682246*h0.x + -0.11000624*i0.x; + j = 0.0022261222*a0.y + 0.037563387*b0.y + 0.02174831*c0.y + 0.020510169*d0.y + 0.059123535*e0.y + -0.16094902*f0.y + 0.047558483*g0.y + 0.0036549352*h0.y + -0.12194797*i0.y; + k = -0.058252987*a0.z + 0.39569992*b0.z + -0.085530244*c0.z + -0.40521297*d0.z + 0.42622545*e0.z + -0.04544852*f0.z + 0.05778261*g0.z + -0.0010521769*h0.z + 0.06868768*i0.z; + l = 0.0702999*a0.w + 0.097584985*b0.w + 0.10488675*c0.w + 0.0103232665*d0.w + 0.39629054*e0.w + -0.048901178*f0.w + -0.07040098*g0.w + 0.25743884*h0.w + -0.001018649*i0.w; + m = -0.11881993*a1.x + 0.0039667734*b1.x + -0.13178195*c1.x + -0.12039257*d1.x + 0.27637544*e1.x + -0.04874474*f1.x + -0.013058322*g1.x + 0.02230431*h1.x + -0.114142925*i1.x; + n = 0.058873195*a1.y + 0.035543237*b1.y + 0.02650194*c1.y + -0.072002105*d1.y + 0.035974164*e1.y + -0.13310984*f1.y + 0.035894036*g1.y + -0.22386155*h1.y + -0.014024901*i1.y; + o = -0.2248448*a1.z + 0.07560031*b1.z + 0.0047171847*c1.z + -0.2494523*d1.z + 0.17671472*e1.z + -0.010878757*f1.z + 0.052058302*g1.z + 0.023165079*h1.z + -0.0075516924*i1.z; + p = 0.1220613*a1.w + 0.016521322*b1.w + -0.16713895*c1.w + 0.16955481*d1.w + -0.18306993*e1.w + 0.09826972*f1.w + -0.035299685*g1.w + -0.1761684*h1.w + 0.08700361*i1.w; + q = -0.05393835*na0.x + 0.08020018*nb0.x + -0.09193613*nc0.x + -0.1166321*nd0.x + -0.17528594*ne0.x + 0.09008182*nf0.x + -0.031376988*ng0.x + 0.0130782025*nh0.x + 0.18729372*ni0.x; + r = 0.0016751966*na0.y + 0.062827334*nb0.y + 0.09153917*nc0.y + 0.0055522337*nd0.y + 0.0056728674*ne0.y + 0.21756102*nf0.y + -0.021842608*ng0.y + 0.1688886*nh0.y + 0.011675954*ni0.y; + s = 0.022171449*na0.z + -0.21762362*nb0.z + -0.03511273*nc0.z + 0.25843334*nd0.z + -0.07825473*ne0.z + -0.058452897*nf0.z + -0.08572572*ng0.z + -0.05009758*nh0.z + -0.1203646*ni0.z; + t = 0.02420277*na0.w + -0.047528002*nb0.w + -0.0756805*nc0.w + 0.04303529*nd0.w + -0.1522967*ne0.w + 0.20764968*nf0.w + 0.04693355*ng0.w + -0.18873805*nh0.w + 0.12394661*ni0.w; + u = 0.20615208*na1.x + -0.23040159*nb1.x + 0.08070546*nc1.x + 0.12708692*nd1.x + -0.55477667*ne1.x + 0.059609883*nf1.x + -0.036457956*ng1.x + -0.14565654*nh1.x + -0.072122045*ni1.x; + v = 0.07742679*na1.y + -0.08422293*nb1.y + 0.050255436*nc1.y + 0.09550706*nd1.y + 0.09218959*ne1.y + 0.29053694*nf1.y + 0.12561111*ng1.y + 0.21103214*nh1.y + 0.094996154*ni1.y; + w = 0.07604026*na1.z + 0.10383877*nb1.z + -0.017639672*nc1.z + 0.090248294*nd1.z + -0.36661062*ne1.z + 0.048648287*nf1.z + 0.004087378*ng1.z + -0.07443208*nh1.z + 0.008644338*ni1.z; + x = -0.10678218*na1.w + -0.08522191*nb1.w + 0.030547328*nc1.w + -0.37972483*nd1.w + 0.22218885*ne1.w + -0.18519177*nf1.w + 0.004827946*ng1.w + 0.010769795*nh1.w + -0.01801208*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0010293183; + i = -0.014593506*a0.x + 0.023265488*b0.x + 0.061627004*c0.x + 0.09548386*d0.x + -0.30135506*e0.x + 0.011962504*f0.x + -0.13203998*g0.x + 0.21614662*h0.x + 0.05958174*i0.x; + j = -0.09878384*a0.y + -0.03683659*b0.y + 0.048794214*c0.y + 0.1408684*d0.y + 0.03628337*e0.y + 0.03144382*f0.y + -0.021739298*g0.y + -0.04188862*h0.y + -0.0006002639*i0.y; + k = 0.03112728*a0.z + -0.06630562*b0.z + -0.02561439*c0.z + 0.05311198*d0.z + -0.27829593*e0.z + -0.022640232*f0.z + 0.03705506*g0.z + -0.24030457*h0.z + 0.03965588*i0.z; + l = 0.017258069*a0.w + -0.00722733*b0.w + -0.06503884*c0.w + -0.25225252*d0.w + -0.13763164*e0.w + 0.07982453*f0.w + 0.0026299297*g0.w + 0.07207517*h0.w + 0.06790191*i0.w; + m = -0.019212238*a1.x + 0.12592626*b1.x + -0.021851178*c1.x + 0.15686631*d1.x + 0.22012937*e1.x + -0.20557871*f1.x + 0.09099229*g1.x + -0.10211517*h1.x + -0.034204774*i1.x; + n = -0.012529692*a1.y + 0.09362853*b1.y + 0.039997622*c1.y + -0.05150152*d1.y + -0.14264928*e1.y + -0.033544317*f1.y + 0.040011894*g1.y + -0.12768707*h1.y + -0.078043096*i1.y; + o = 0.0074936035*a1.z + 0.22932594*b1.z + -0.057378706*c1.z + 0.28699687*d1.z + -0.21756352*e1.z + -0.062053844*f1.z + -0.00024668174*g1.z + -0.05100476*h1.z + 0.06928418*i1.z; + p = -0.14546607*a1.w + -0.16651693*b1.w + 0.12857576*c1.w + -0.047539867*d1.w + 0.26343384*e1.w + -0.017469188*f1.w + -0.005115385*g1.w + 0.0012459696*h1.w + -0.09503593*i1.w; + q = -0.087925985*na0.x + 0.0023024757*nb0.x + -0.095000125*nc0.x + 0.07433898*nd0.x + 0.0041658483*ne0.x + 0.123552985*nf0.x + 0.120837346*ng0.x + -0.1636861*nh0.x + -0.011546859*ni0.x; + r = 0.038042698*na0.y + 0.13991997*nb0.y + -0.066846035*nc0.y + 0.010655437*nd0.y + -0.068989895*ne0.y + -0.05154676*nf0.y + -0.06894559*ng0.y + 0.038047343*nh0.y + -0.00232077*ni0.y; + s = -0.0019521024*na0.z + -0.022583103*nb0.z + 0.054494895*nc0.z + -0.08943432*nd0.z + 0.08132613*ne0.z + -0.016627267*nf0.z + -0.024312189*ng0.z + 0.26041818*nh0.z + -0.079761654*ni0.z; + t = -0.08269844*na0.w + -0.09737923*nb0.w + 0.030635225*nc0.w + 0.15013275*nd0.w + -0.107235596*ne0.w + -0.134351*nf0.w + 0.14893004*ng0.w + -0.040401027*nh0.w + -0.034354553*ni0.w; + u = 0.035184126*na1.x + -0.2824874*nb1.x + -0.016726991*nc1.x + -0.14177802*nd1.x + -0.06586472*ne1.x + -0.013826119*nf1.x + -0.1320728*ng1.x + 0.035011787*nh1.x + 0.055118065*ni1.x; + v = -0.024546877*na1.y + 0.12185577*nb1.y + 0.09696174*nc1.y + -0.08592494*nd1.y + 0.27429417*ne1.y + 0.28399673*nf1.y + 0.121077314*ng1.y + 0.012329405*nh1.y + 0.020637203*ni1.y; + w = -0.031275805*na1.z + -0.15169707*nb1.z + 0.07485881*nc1.z + -0.0634399*nd1.z + 0.4907602*ne1.z + -0.001096378*nf1.z + 0.0051537943*ng1.z + -0.037228644*nh1.z + -0.024804804*ni1.z; + x = 0.21940029*na1.w + 0.46201172*nb1.w + -0.1741037*nc1.w + 0.11073968*nd1.w + -0.07999448*ne1.w + 0.12612918*nf1.w + 0.041276265*ng1.w + 0.039091896*nh1.w + -0.023500916*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.00620655; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN100 +//!BIND LUMAN101 +//!SAVE LUMAN110 + +#define L0_tex LUMAN100_tex +#define L1_tex LUMAN101_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.035900798*a0.x + -0.0032731516*b0.x + 0.08142251*c0.x + -0.03735964*d0.x + -0.5860401*e0.x + 0.18885492*f0.x + -0.052124757*g0.x + 0.0039482615*h0.x + -0.0067603188*i0.x; + float j = 0.03218352*a0.y + 0.010617722*b0.y + 0.22913666*c0.y + -0.005692161*d0.y + -0.2878274*e0.y + 0.26934555*f0.y + -0.14689828*g0.y + -0.14777917*h0.y + -0.146745*i0.y; + float k = -0.12349442*a0.z + -0.09644591*b0.z + 0.015029442*c0.z + -0.11548111*d0.z + -0.40823653*e0.z + -0.18077675*f0.z + 0.03544688*g0.z + 0.011662489*h0.z + 0.07574941*i0.z; + float l = -0.124623254*a0.w + 0.16140111*b0.w + -0.046893556*c0.w + -0.056092393*d0.w + -0.17846477*e0.w + -0.07701739*f0.w + -0.09542691*g0.w + -0.23367326*h0.w + -0.06812856*i0.w; + float m = -0.06034172*a1.x + -0.13329592*b1.x + -0.045309793*c1.x + 0.17750835*d1.x + -0.0076088295*e1.x + -0.03329555*f1.x + 0.0049533285*g1.x + -0.045710914*h1.x + -0.017280852*i1.x; + float n = 0.06250742*a1.y + -0.019177811*b1.y + -0.04794798*c1.y + -0.06185518*d1.y + -0.3015897*e1.y + -0.04110791*f1.y + -0.04484891*g1.y + 0.062133104*h1.y + 0.029863592*i1.y; + float o = 0.1407756*a1.z + 0.03246707*b1.z + 0.055456042*c1.z + 0.08737635*d1.z + 0.29290113*e1.z + 0.22447072*f1.z + -0.0070300275*g1.z + -0.09647503*h1.z + -0.112883285*i1.z; + float p = 0.11920284*a1.w + 0.22888571*b1.w + -0.03729867*c1.w + -0.04619108*d1.w + 0.265903*e1.w + -0.18725681*f1.w + -0.052515823*g1.w + 0.27257964*h1.w + -0.004936924*i1.w; + float q = -0.046696868*na0.x + -0.17244326*nb0.x + -0.0006326694*nc0.x + 0.022097602*nd0.x + 0.36674306*ne0.x + -0.17773466*nf0.x + 0.027276874*ng0.x + 0.057075586*nh0.x + 0.08366408*ni0.x; + float r = -0.0496522*na0.y + -0.05937534*nb0.y + -0.20281217*nc0.y + 0.01603125*nd0.y + 0.3475573*ne0.y + -0.3014151*nf0.y + 0.05755629*ng0.y + 0.19609028*nh0.y + 0.08452658*ni0.y; + float s = 0.06687699*na0.z + 0.067958415*nb0.z + 0.06647321*nc0.z + 0.1284585*nd0.z + 0.7849594*ne0.z + 0.29734918*nf0.z + 0.027528172*ng0.z + -0.024441805*nh0.z + -0.11729039*ni0.z; + float t = 0.08647725*na0.w + -0.056248702*nb0.w + 0.07359946*nc0.w + 0.11756446*nd0.w + 0.2627642*ne0.w + -0.018952051*nf0.w + -0.0065718633*ng0.w + 0.039699655*nh0.w + 0.061234728*ni0.w; + float u = 0.06364634*na1.x + 0.0327214*nb1.x + 0.029039195*nc1.x + -0.0952279*nd1.x + 0.059711777*ne1.x + 0.038400296*nf1.x + -0.07332336*ng1.x + 0.017307714*nh1.x + 0.04607215*ni1.x; + float v = -0.047831755*na1.y + -0.040664297*nb1.y + 0.06826742*nc1.y + 0.0526502*nd1.y + 0.4831352*ne1.y + 0.11276925*nf1.y + 0.078867294*ng1.y + -0.17317057*nh1.y + -0.09310757*ni1.y; + float w = -0.07256914*na1.z + -0.065705195*nb1.z + -0.040407173*nc1.z + -0.15516779*nd1.z + -0.43270877*ne1.z + -0.19089858*nf1.z + 0.0144505445*ng1.z + 0.26007774*nh1.z + 0.13456038*ni1.z; + float x = -0.17530301*na1.w + -0.48442727*nb1.w + -0.03330983*nc1.w + -0.019479422*nd1.w + 0.21953882*ne1.w + 0.1206139*nf1.w + -0.08568933*ng1.w + -0.22107208*nh1.w + -0.05904734*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.024452502; + i = 0.017014494*a0.x + -0.00054127455*b0.x + 0.007609347*c0.x + 0.11954065*d0.x + 0.0798582*e0.x + 0.017370699*f0.x + 0.11012819*g0.x + -0.11934599*h0.x + -0.12777543*i0.x; + j = -0.04406953*a0.y + -0.12507345*b0.y + 0.060362745*c0.y + 0.28017431*d0.y + 0.07832064*e0.y + -0.15825081*f0.y + 0.0524985*g0.y + 0.30791417*h0.y + -0.15982261*i0.y; + k = -0.086442724*a0.z + 0.00012259315*b0.z + 0.007140376*c0.z + -0.2824918*d0.z + -0.25533247*e0.z + 0.033553455*f0.z + 0.1419663*g0.z + -0.334144*h0.z + -0.0784347*i0.z; + l = 0.039073847*a0.w + -0.10111335*b0.w + 0.1189452*c0.w + -0.112359114*d0.w + 0.01488211*e0.w + 0.036622338*f0.w + 0.1708258*g0.w + -0.47144276*h0.w + -0.19981442*i0.w; + m = 0.16498776*a1.x + -0.044963352*b1.x + 0.06430563*c1.x + 0.07391399*d1.x + 0.123919465*e1.x + -0.0375703*f1.x + -0.004655664*g1.x + 0.17231892*h1.x + 0.13099734*i1.x; + n = 0.013878608*a1.y + -0.10779041*b1.y + -0.03252544*c1.y + -0.19509874*d1.y + 0.2426995*e1.y + 0.05905958*f1.y + -0.021916907*g1.y + -0.10760266*h1.y + 0.1330649*i1.y; + o = -0.093077786*a1.z + 0.028179191*b1.z + 0.057031747*c1.z + -0.009288688*d1.z + -0.23512715*e1.z + -0.18687668*f1.z + 0.020875294*g1.z + -0.0056162253*h1.z + 0.012207328*i1.z; + p = 0.036275603*a1.w + -0.035214525*b1.w + 0.039897*c1.w + 0.27076656*d1.w + 0.37951374*e1.w + 0.07411483*f1.w + -0.09491011*g1.w + -0.0707116*h1.w + 0.013819694*i1.w; + q = 0.106207535*na0.x + 0.003672323*nb0.x + -0.005481963*nc0.x + -0.070232905*nd0.x + -0.12546863*ne0.x + -0.012893604*nf0.x + -0.07979441*ng0.x + 0.047225464*nh0.x + 0.22636586*ni0.x; + r = 0.021130336*na0.y + 0.005865638*nb0.y + 0.0266642*nc0.y + -0.13385898*nd0.y + 0.23195273*ne0.y + 0.2500417*nf0.y + 0.015835918*ng0.y + -0.19905601*nh0.y + 0.24267204*ni0.y; + s = 0.028915072*na0.z + -0.00034564265*nb0.z + -0.023576412*nc0.z + 0.11490365*nd0.z + 0.07083828*ne0.z + -0.060439333*nf0.z + -0.09797052*ng0.z + -0.07472622*nh0.z + -0.033918925*ni0.z; + t = 0.061985716*na0.w + 0.1016432*nb0.w + 0.001047103*nc0.w + 0.07245331*nd0.w + 0.014575151*ne0.w + 0.009510986*nf0.w + -0.042668477*ng0.w + 0.46141195*nh0.w + 0.16009891*ni0.w; + u = -0.19059992*na1.x + 0.12379133*nb1.x + 0.043386538*nc1.x + -0.111131445*nd1.x + -0.25058612*ne1.x + 0.07591241*nf1.x + 0.12921755*ng1.x + -0.1014394*nh1.x + -0.08227909*ni1.x; + v = 0.1381469*na1.y + 0.30716902*nb1.y + 0.051989574*nc1.y + 0.14254308*nd1.y + -0.31925386*ne1.y + 0.12174008*nf1.y + -0.1391733*ng1.y + 0.39536408*nh1.y + -0.12007279*ni1.y; + w = 0.017454563*na1.z + -0.023681903*nb1.z + -0.034012295*nc1.z + 0.22002162*nd1.z + 0.19791967*ne1.z + 0.038374756*nf1.z + -0.12353062*ng1.z + 0.2688662*nh1.z + -0.052705806*ni1.z; + x = -0.086231895*na1.w + 0.07504937*nb1.w + 0.11191391*nc1.w + 0.06921204*nd1.w + -0.23228742*ne1.w + -0.022838876*nf1.w + -0.2323649*ng1.w + 0.44247657*nh1.w + -0.081072874*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.014501337; + i = 0.106080465*a0.x + 0.024061147*b0.x + -0.14801557*c0.x + 0.07124731*d0.x + 0.752269*e0.x + 0.03204864*f0.x + -0.08820241*g0.x + -0.1569472*h0.x + 0.020805335*i0.x; + j = -0.04939308*a0.y + -0.10871269*b0.y + -0.16962783*c0.y + -0.23772849*d0.y + -0.3210391*e0.y + 0.24698508*f0.y + -0.18247806*g0.y + 0.020352794*h0.y + 0.107976474*i0.y; + k = 0.10493802*a0.z + -0.099695146*b0.z + -0.096039765*c0.z + 0.11138637*d0.z + -0.14311491*e0.z + -0.092154056*f0.z + 0.0885071*g0.z + -0.008292385*h0.z + -0.10166108*i0.z; + l = 0.07040726*a0.w + 0.059195396*b0.w + -0.27681613*c0.w + 0.061552662*d0.w + -0.06913211*e0.w + 0.033301804*f0.w + -0.06473411*g0.w + 0.015914617*h0.w + 0.13665281*i0.w; + m = 0.012200174*a1.x + 0.06378749*b1.x + 0.17070897*c1.x + 0.06860602*d1.x + 0.28465414*e1.x + 0.005732392*f1.x + -0.005431797*g1.x + 0.06197541*h1.x + -0.0360787*i1.x; + n = -0.08437426*a1.y + -0.23992026*b1.y + 0.021542493*c1.y + -0.014475824*d1.y + 0.78059006*e1.y + -0.2787933*f1.y + 0.15499842*g1.y + -0.116365656*h1.y + -0.0011092337*i1.y; + o = -0.012601071*a1.z + -0.02089811*b1.z + 0.025689777*c1.z + -0.04252961*d1.z + -0.008140882*e1.z + 0.1501934*f1.z + -0.045148186*g1.z + 0.117176265*h1.z + 0.0904366*i1.z; + p = 0.13231343*a1.w + -0.3832506*b1.w + -0.045885302*c1.w + -0.30311546*d1.w + 0.003686093*e1.w + -0.027558096*f1.w + -0.11033935*g1.w + -0.28475946*h1.w + 0.13980927*i1.w; + q = -0.021204935*na0.x + 0.14605576*nb0.x + 0.22979948*nc0.x + 0.105198905*nd0.x + -0.3683901*ne0.x + -0.12239137*nf0.x + 0.15564677*ng0.x + 0.08345597*nh0.x + -0.06942301*ni0.x; + r = -0.0054337797*na0.y + 0.25162318*nb0.y + 0.17119436*nc0.y + 0.37783152*nd0.y + 0.17348771*ne0.y + -0.19969839*nf0.y + 0.051427353*ng0.y + 0.073170334*nh0.y + -0.0834832*ni0.y; + s = 0.052913193*na0.z + 0.0704273*nb0.z + 0.06401822*nc0.z + -0.16483103*nd0.z + 0.37591973*ne0.z + 0.17838006*nf0.z + 0.16003473*ng0.z + -0.020194532*nh0.z + 0.11856533*ni0.z; + t = -0.043170277*na0.w + -0.0056342282*nb0.w + 0.058708046*nc0.w + -0.2180414*nd0.w + -0.07601848*ne0.w + -0.0582804*nf0.w + -0.019155271*ng0.w + -0.20792755*nh0.w + 0.07733804*ni0.w; + u = 0.08359859*na1.x + -0.1261298*nb1.x + -0.18549688*nc1.x + 0.103082545*nd1.x + -0.15136153*ne1.x + 0.10837961*nf1.x + -0.106412716*ng1.x + -0.17028126*nh1.x + 0.07988672*ni1.x; + v = 0.025273234*na1.y + 0.31773803*nb1.y + 0.07038893*nc1.y + -0.06201899*nd1.y + -0.16951224*ne1.y + -0.076122746*nf1.y + -0.024976283*ng1.y + 0.0495814*nh1.y + -0.04523248*ni1.y; + w = 0.13538857*na1.z + -0.25815603*nb1.z + 0.045387045*nc1.z + -0.20980915*nd1.z + -0.021883305*ne1.z + -0.18981177*nf1.z + 0.026633987*ng1.z + -0.2266295*nh1.z + -0.01770804*ni1.z; + x = 0.09686322*na1.w + 0.20658696*nb1.w + 0.0340205*nc1.w + -0.03438729*nd1.w + 0.28400266*ne1.w + -0.043422848*nf1.w + 0.13553189*ng1.w + -0.09268944*nh1.w + 0.045445822*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.019928804; + i = 0.02026901*a0.x + 0.05516772*b0.x + -0.026024757*c0.x + -0.048418608*d0.x + -0.57685983*e0.x + 0.14805983*f0.x + -0.20059115*g0.x + 0.041156944*h0.x + 0.24868847*i0.x; + j = 0.13019085*a0.y + 0.22550349*b0.y + -0.034964323*c0.y + -0.3774061*d0.y + -0.86875886*e0.y + 0.30600658*f0.y + -0.051866774*g0.y + -0.17874694*h0.y + -0.04145627*i0.y; + k = -0.09908297*a0.z + -0.08187165*b0.z + -0.048987314*c0.z + 0.06511783*d0.z + 0.179538*e0.z + -0.03037813*f0.z + -0.055894785*g0.z + -0.05759495*h0.z + 0.16294672*i0.z; + l = -0.13788657*a0.w + 0.12234814*b0.w + -0.119818315*c0.w + -0.14877391*d0.w + -0.3761054*e0.w + 0.039558705*f0.w + -0.16355307*g0.w + 0.046041332*h0.w + 0.06886591*i0.w; + m = -0.11279483*a1.x + 0.08578038*b1.x + -0.009435322*c1.x + 0.044954628*d1.x + -0.23950733*e1.x + -0.06424558*f1.x + 0.00892558*g1.x + -0.10939133*h1.x + -0.18683302*i1.x; + n = -0.039577417*a1.y + 0.14972863*b1.y + 0.09612399*c1.y + 0.23229071*d1.y + -0.47360322*e1.y + -0.5715504*f1.y + -0.07163973*g1.y + 0.08016445*h1.y + 0.1636036*i1.y; + o = 0.14617412*a1.z + -0.039677974*b1.z + -0.08629375*c1.z + 0.030945303*d1.z + -0.07581273*e1.z + 0.3790989*f1.z + 0.08369275*g1.z + 0.14806965*h1.z + -0.12494041*i1.z; + p = -0.0248347*a1.w + 0.0024292504*b1.w + -0.13744679*c1.w + -0.13728984*d1.w + 0.13243796*e1.w + -0.10922235*f1.w + -0.08380444*g1.w + 0.23688291*h1.w + 0.05691377*i1.w; + q = -0.10243777*na0.x + -0.06303514*nb0.x + 0.014908672*nc0.x + 0.015049333*nd0.x + 0.21912244*ne0.x + -0.24765025*nf0.x + 0.10551951*ng0.x + 0.03512811*nh0.x + -0.14204796*ni0.x; + r = -0.0230487*na0.y + -0.017737433*nb0.y + 0.10482681*nc0.y + 0.32697034*nd0.y + 0.8010543*ne0.y + -0.4667189*nf0.y + -0.01745576*ng0.y + 0.17689982*nh0.y + -0.0296182*ni0.y; + s = 0.09821341*na0.z + 0.18462132*nb0.z + 0.08232512*nc0.z + -0.11346741*nd0.z + -0.1312958*ne0.z + 0.053139947*nf0.z + -0.026102895*ng0.z + 0.09144199*nh0.z + 0.017409507*ni0.z; + t = 0.045446947*na0.w + -0.06908225*nb0.w + 0.031845864*nc0.w + 0.08811338*nd0.w + 0.22084616*ne0.w + 0.21115226*nf0.w + -0.03346275*ng0.w + -0.07632658*nh0.w + -0.18860243*ni0.w; + u = 0.20821358*na1.x + -0.18966362*nb1.x + -0.20381361*nc1.x + -0.043492407*nd1.x + 0.39594468*ne1.x + 0.14178486*nf1.x + -0.12194247*ng1.x + 0.08705254*nh1.x + 0.17339234*ni1.x; + v = -0.00416578*na1.y + -0.20208167*nb1.y + -0.08947272*nc1.y + -0.11110711*nd1.y + 0.411256*ne1.y + 0.30017683*nf1.y + 0.18777676*ng1.y + -0.254137*nh1.y + -0.23275565*ni1.y; + w = 0.07342336*na1.z + 0.06368492*nb1.z + 0.15138967*nc1.z + -0.13334224*nd1.z + -0.28021207*ne1.z + 0.008063743*nf1.z + -0.034982488*ng1.z + 0.09409084*nh1.z + 0.017170021*ni1.z; + x = 0.11833364*na1.w + 0.16638613*nb1.w + -0.20996292*nc1.w + -0.36111116*nd1.w + -0.39097127*ne1.w + 0.33818159*nf1.w + 0.115348734*ng1.w + -0.2101661*nh1.w + -0.14634638*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.027489815; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN100 +//!BIND LUMAN101 +//!SAVE LUMAN111 + +#define L0_tex LUMAN100_tex +#define L1_tex LUMAN101_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.17373292*a0.x + 0.19284575*b0.x + -0.007641241*c0.x + -0.002358787*d0.x + 0.0006856558*e0.x + -0.09435261*f0.x + 0.11603466*g0.x + -0.06616243*h0.x + -0.09116425*i0.x; + float j = 0.18124478*a0.y + 0.014529217*b0.y + 0.062769316*c0.y + 0.050279245*d0.y + 0.24485901*e0.y + -0.19550173*f0.y + 0.026898274*g0.y + 0.13799283*h0.y + 0.06315003*i0.y; + float k = -0.07014451*a0.z + 0.103086434*b0.z + -0.057231173*c0.z + -0.170586*d0.z + 0.11335642*e0.z + -0.041360904*f0.z + 0.11781035*g0.z + -0.12804985*h0.z + 0.069926985*i0.z; + float l = -0.35962218*a0.w + 0.2529284*b0.w + 0.06229109*c0.w + 0.18245831*d0.w + -0.06891447*e0.w + 0.007133068*f0.w + 0.13578556*g0.w + -0.12890998*h0.w + -0.00014882648*i0.w; + float m = 0.030674135*a1.x + -0.30949405*b1.x + 0.07962323*c1.x + 0.02222668*d1.x + -0.19568637*e1.x + 0.10337853*f1.x + -0.02281463*g1.x + -0.010381191*h1.x + 0.0018512324*i1.x; + float n = 0.06213026*a1.y + 0.1910823*b1.y + 0.09133128*c1.y + -0.12947819*d1.y + 0.41381067*e1.y + -0.12905987*f1.y + 0.033483107*g1.y + -0.1069458*h1.y + -0.11556056*i1.y; + float o = -0.12961154*a1.z + -0.2538289*b1.z + -0.016196288*c1.z + -0.496165*d1.z + -0.5219219*e1.z + 0.054612707*f1.z + -0.21407002*g1.z + -0.08868649*h1.z + 0.12545374*i1.z; + float p = -0.09922678*a1.w + 0.4261237*b1.w + 0.01694553*c1.w + -0.14221108*d1.w + 0.31437156*e1.w + -0.021854276*f1.w + 0.09888452*g1.w + -0.023707569*h1.w + -0.060339298*i1.w; + float q = 0.16362682*na0.x + -0.30193806*nb0.x + -0.0650482*nc0.x + -0.11592818*nd0.x + 0.0965682*ne0.x + 0.009416448*nf0.x + -0.08027524*ng0.x + -0.11599481*nh0.x + 0.074850865*ni0.x; + float r = 0.03761324*na0.y + -0.059135627*nb0.y + -0.06904674*nc0.y + 0.07409784*nd0.y + -0.04979788*ne0.y + 0.1656966*nf0.y + -0.17979243*ng0.y + 0.07024214*nh0.y + 0.101452865*ni0.y; + float s = 0.07054836*na0.z + -0.16477472*nb0.z + 0.167071*nc0.z + 0.056192264*nd0.z + -0.39817235*ne0.z + 0.05435473*nf0.z + 0.055104688*ng0.z + -0.06418159*nh0.z + -0.07037324*ni0.z; + float t = 0.059324004*na0.w + -0.22754394*nb0.w + 0.109665334*nc0.w + 0.18387087*nd0.w + -0.27932712*ne0.w + 0.17503552*nf0.w + -0.02897829*ng0.w + -0.0827857*nh0.w + 0.08433404*ni0.w; + float u = -0.0073763453*na1.x + 0.27729753*nb1.x + -0.060492065*nc1.x + -0.10774929*nd1.x + 0.13199492*ne1.x + -0.1717545*nf1.x + 0.08395833*ng1.x + 0.05505113*nh1.x + 0.012973338*ni1.x; + float v = -0.10820169*na1.y + -0.21685033*nb1.y + -0.054595478*nc1.y + 0.39797196*nd1.y + 0.1346222*ne1.y + 0.06950724*nf1.y + 0.1052441*ng1.y + 0.031800553*nh1.y + 0.042654164*ni1.y; + float w = 0.2054293*na1.z + 0.26843888*nb1.z + 0.026876204*nc1.z + 0.499534*nd1.z + 0.12252638*ne1.z + 0.19191867*nf1.z + 0.10434292*ng1.z + -0.15850754*nh1.z + -0.12211063*ni1.z; + float x = 0.229264*na1.w + -0.3270713*nb1.w + 0.05840381*nc1.w + -0.10087737*nd1.w + -0.47804737*ne1.w + 0.14004838*nf1.w + -0.025040176*ng1.w + 0.05155569*nh1.w + 0.15117253*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.021597303; + i = -0.057124704*a0.x + -0.08187946*b0.x + -0.117976055*c0.x + 0.08626858*d0.x + -0.30131266*e0.x + -0.20291628*f0.x + -0.057278704*g0.x + 0.03727534*h0.x + -0.23938358*i0.x; + j = 0.23947622*a0.y + -0.19593138*b0.y + -0.22941902*c0.y + 0.1798668*d0.y + 0.4139132*e0.y + -0.56581444*f0.y + -0.21497047*g0.y + 0.29857048*h0.y + -0.12120347*i0.y; + k = -0.07644*a0.z + 0.02450798*b0.z + 0.006410234*c0.z + -0.28139332*d0.z + 0.20402806*e0.z + 0.03604816*f0.z + -0.057724282*g0.z + 0.06314197*h0.z + 0.043707125*i0.z; + l = 0.03345192*a0.w + -0.53812677*b0.w + 0.0031058886*c0.w + -0.13964505*d0.w + 0.14953853*e0.w + 0.01489939*f0.w + -0.12053515*g0.w + -0.5023178*h0.w + 0.011425229*i0.w; + m = 0.007068252*a1.x + -0.057471108*b1.x + 0.049550753*c1.x + 0.16893393*d1.x + -0.22552177*e1.x + 0.10349585*f1.x + 0.068044126*g1.x + -0.020883517*h1.x + 0.010095199*i1.x; + n = 0.073507585*a1.y + 0.0479716*b1.y + -0.03338529*c1.y + -0.039165337*d1.y + -0.07156169*e1.y + 0.025127547*f1.y + 0.1630653*g1.y + -0.31465036*h1.y + -0.36398607*i1.y; + o = -0.23844904*a1.z + 0.0669155*b1.z + -0.09081722*c1.z + -0.48886317*d1.z + -0.39759925*e1.z + -0.18523812*f1.z + -0.18028197*g1.z + -0.33321717*h1.z + 0.20330803*i1.z; + p = -0.05968692*a1.w + -0.07692183*b1.w + -0.23112586*c1.w + -0.060829017*d1.w + -0.7536542*e1.w + -0.2852317*f1.w + -0.0009859608*g1.w + 0.114123434*h1.w + 0.054023914*i1.w; + q = 0.040426083*na0.x + 0.11305295*nb0.x + 0.010890308*nc0.x + -0.052732646*nd0.x + 0.42032868*ne0.x + 0.1271945*nf0.x + 0.068493925*ng0.x + -0.09621038*nh0.x + 0.12837166*ni0.x; + r = -0.14453565*na0.y + -0.057656374*nb0.y + 0.23092808*nc0.y + 0.028112093*nd0.y + -0.20953117*ne0.y + 0.56117964*nf0.y + 0.058659226*ng0.y + -0.004577296*nh0.y + 0.26078725*ni0.y; + s = -0.040808428*na0.z + -0.013124161*nb0.z + 0.077842854*nc0.z + 0.36161858*nd0.z + -0.38513637*ne0.z + -0.032538336*nf0.z + 0.25315204*ng0.z + -0.28682852*nh0.z + -0.13966155*ni0.z; + t = 0.11649907*na0.w + 0.07209638*nb0.w + 0.017035281*nc0.w + 0.17239003*nd0.w + -0.48884037*ne0.w + 0.095746554*nf0.w + 0.13106976*ng0.w + 0.007163351*nh0.w + 0.20788017*ni0.w; + u = -0.053024396*na1.x + 0.03632525*nb1.x + -0.042757507*nc1.x + -0.23104651*nd1.x + 0.37475386*ne1.x + -0.15215069*nf1.x + -0.10153369*ng1.x + -0.038243458*nh1.x + 0.058561992*ni1.x; + v = 0.009218183*na1.y + -0.099357605*nb1.y + 0.02944266*nc1.y + 0.37779808*nd1.y + -0.11301168*ne1.y + 0.06155464*nf1.y + 0.07765676*ng1.y + 0.15920372*nh1.y + 0.09146244*ni1.y; + w = 0.038626663*na1.z + 0.080353044*nb1.z + 0.12698452*nc1.z + 0.17569828*nd1.z + 0.2910155*ne1.z + 0.4589925*nf1.z + 0.17338121*ng1.z + 0.13693103*nh1.z + -0.12467287*ni1.z; + x = -0.06830355*na1.w + 0.10666497*nb1.w + 0.081091985*nc1.w + 0.3429561*nd1.w + -0.06758853*ne1.w + 0.029520744*nf1.w + 0.013867191*ng1.w + -0.20614323*nh1.w + 0.2577004*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.014417592; + i = -0.13472116*a0.x + 0.1510276*b0.x + 0.12627706*c0.x + -0.15310904*d0.x + 0.41393983*e0.x + 0.09215482*f0.x + 0.0076725073*g0.x + -0.19246124*h0.x + -0.024236755*i0.x; + j = -0.08050447*a0.y + 0.12934619*b0.y + 0.14942114*c0.y + 0.014540216*d0.y + 0.64530516*e0.y + -0.23357749*f0.y + -0.033744495*g0.y + 0.13452643*h0.y + 0.0065132463*i0.y; + k = -0.07907217*a0.z + 0.0067584133*b0.z + 0.03253729*c0.z + 0.12400924*d0.z + -0.29547116*e0.z + 0.13962397*f0.z + 0.0817104*g0.z + -0.23031056*h0.z + 0.076910056*i0.z; + l = -0.17478573*a0.w + -0.09128964*b0.w + 0.2052007*c0.w + -0.045583803*d0.w + -0.46769974*e0.w + -0.036914773*f0.w + 0.020994665*g0.w + -0.5500906*h0.w + -0.055351563*i0.w; + m = 0.110594265*a1.x + -0.2092864*b1.x + -0.055939224*c1.x + -0.20377842*d1.x + -0.068504*e1.x + -0.036410812*f1.x + 0.017022053*g1.x + 0.016182205*h1.x + 0.0033735395*i1.x; + n = 0.06604512*a1.y + 0.027024498*b1.y + 0.057466883*c1.y + -0.06337822*d1.y + 0.21015161*e1.y + 0.07654835*f1.y + -0.04182454*g1.y + -0.046728626*h1.y + -0.006260675*i1.y; + o = 0.09531833*a1.z + -0.10230305*b1.z + -0.0032133479*c1.z + 0.099814266*d1.z + 0.44469547*e1.z + -0.17260297*f1.z + -0.09248535*g1.z + 0.08439349*h1.z + 0.017246507*i1.z; + p = 0.048469406*a1.w + 0.18700768*b1.w + -0.035001382*c1.w + -0.102538124*d1.w + 0.20207775*e1.w + -0.11878294*f1.w + 0.00067176076*g1.w + -0.087286696*h1.w + 0.054357033*i1.w; + q = 0.12958841*na0.x + -0.22688657*nb0.x + -0.1667106*nc0.x + 0.005056687*nd0.x + -0.4123986*ne0.x + -0.01335008*nf0.x + -0.014480265*ng0.x + 0.06307529*nh0.x + 0.08594915*ni0.x; + r = 0.10539398*na0.y + -0.10292841*nb0.y + -0.07814285*nc0.y + 0.22097129*nd0.y + -0.5559523*ne0.y + 0.17694168*nf0.y + 0.004478227*ng0.y + 0.032878358*nh0.y + 0.104629084*ni0.y; + s = -0.0051326617*na0.z + -0.022072861*nb0.z + 0.051479872*nc0.z + -0.1741023*nd0.z + 0.18857563*ne0.z + -0.124328755*nf0.z + -0.10322579*ng0.z + -0.20327476*nh0.z + -0.14588761*ni0.z; + t = 0.09643955*na0.w + 0.008044043*nb0.w + 0.036409162*nc0.w + -0.045244064*nd0.w + 0.31953487*ne0.w + -0.088307254*nf0.w + 0.07313137*ng0.w + 0.34979767*nh0.w + 0.102764584*ni0.w; + u = -0.06440282*na1.x + 0.112250455*nb1.x + 0.08934266*nc1.x + 0.24088423*nd1.x + 0.01121725*ne1.x + 0.028617168*nf1.x + 0.047377482*ng1.x + 0.0073287217*nh1.x + 0.11302375*ni1.x; + v = -0.077449806*na1.y + -0.14188565*nb1.y + 0.05671433*nc1.y + -0.11553248*nd1.y + -0.33997044*ne1.y + -0.01590329*nf1.y + 0.03729859*ng1.y + 0.120862365*nh1.y + -0.20920378*ni1.y; + w = 0.08520443*na1.z + 0.21813084*nb1.z + -0.037449516*nc1.z + -0.0026980594*nd1.z + -0.17946021*ne1.z + 0.13623233*nf1.z + -0.006548233*ng1.z + 0.11000115*nh1.z + -0.034891665*ni1.z; + x = 0.0401964*na1.w + -0.3692854*nb1.w + 0.0011840117*nc1.w + -0.22135302*nd1.w + -0.10666167*ne1.w + -0.14273971*nf1.w + -0.12129986*ng1.w + 0.44047737*nh1.w + -0.045440122*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0061564697; + i = 0.019909037*a0.x + 0.024903378*b0.x + 0.105348505*c0.x + 0.07623088*d0.x + 0.0034105815*e0.x + -0.113691464*f0.x + 0.009286652*g0.x + -0.08961034*h0.x + -0.015141795*i0.x; + j = 0.14456645*a0.y + -0.35772327*b0.y + 0.025894739*c0.y + -0.13413931*d0.y + 0.33115333*e0.y + -0.05047772*f0.y + -0.061519265*g0.y + -0.11914387*h0.y + 0.007146077*i0.y; + k = -0.066375226*a0.z + -0.11391145*b0.z + 0.010581036*c0.z + 0.108877584*d0.z + 0.112751186*e0.z + -0.08083832*f0.z + -0.031274974*g0.z + -0.23846108*h0.z + 0.06903504*i0.z; + l = 0.08046087*a0.w + -0.2478447*b0.w + -0.04181178*c0.w + 0.12691878*d0.w + -0.3055807*e0.w + 0.03303818*f0.w + 0.045794614*g0.w + -0.17669553*h0.w + 0.029193971*i0.w; + m = 0.13165465*a1.x + 0.08672863*b1.x + -0.0806005*c1.x + -0.15916064*d1.x + -0.1339171*e1.x + 0.07747311*f1.x + 0.06912866*g1.x + 0.054819133*h1.x + -0.0148107195*i1.x; + n = -0.1043977*a1.y + -0.13850538*b1.y + -0.15452385*c1.y + 0.119476296*d1.y + 0.078670695*e1.y + 0.15949106*f1.y + -0.08756167*g1.y + 0.0844884*h1.y + -0.08666089*i1.y; + o = -0.07111824*a1.z + 0.04513279*b1.z + -0.13408236*c1.z + 0.047121324*d1.z + 0.24545099*e1.z + 0.2516734*f1.z + -0.0728289*g1.z + -0.08762582*h1.z + -0.07561154*i1.z; + p = 0.02130893*a1.w + 0.10249944*b1.w + 0.11049336*c1.w + 0.15264595*d1.w + 0.31183988*e1.w + -0.13138242*f1.w + 0.06398149*g1.w + 0.08104154*h1.w + -0.11865529*i1.w; + q = 0.015509186*na0.x + 0.039872047*nb0.x + -0.092925705*nc0.x + -0.016107129*nd0.x + 0.2357669*ne0.x + 0.14164859*nf0.x + -0.023252146*ng0.x + 0.01461199*nh0.x + 0.021338074*ni0.x; + r = -0.01427818*na0.y + 0.098217905*nb0.y + 0.06523357*nc0.y + -0.123181134*nd0.y + -0.15354222*ne0.y + -0.012291639*nf0.y + 0.0817894*ng0.y + 0.11550929*nh0.y + -0.0143228425*ni0.y; + s = -0.06878877*na0.z + -0.027852716*nb0.z + -0.046084825*nc0.z + -0.0063927933*nd0.z + 0.2056926*ne0.z + 0.08226537*nf0.z + -0.038236506*ng0.z + 0.03715226*nh0.z + -0.18274981*ni0.z; + t = 0.06485456*na0.w + 0.07982155*nb0.w + 0.07997468*nc0.w + -0.14120714*nd0.w + -0.043111116*ne0.w + -0.018716503*nf0.w + 0.036192097*ng0.w + 0.16639654*nh0.w + 0.02141117*ni0.w; + u = -0.1266023*na1.x + -0.18926698*nb1.x + 0.12713344*nc1.x + 0.07326873*nd1.x + 0.24805826*ne1.x + -0.20831703*nf1.x + -0.02982*ng1.x + -0.12409885*nh1.x + 0.00971056*ni1.x; + v = 0.10946473*na1.y + 0.18352063*nb1.y + 0.23140769*nc1.y + -0.08708996*nd1.y + -0.37328652*ne1.y + -0.16821873*nf1.y + 0.05127809*ng1.y + 0.04607067*nh1.y + -0.014240281*ni1.y; + w = 0.032410678*na1.z + -0.054716043*nb1.z + 0.13916765*nc1.z + -0.24632*nd1.z + -0.3030281*ne1.z + -0.14525734*nf1.z + 0.037081942*ng1.z + 0.14404751*nh1.z + 0.07260845*ni1.z; + x = -0.020973476*na1.w + -0.33283794*nb1.w + -0.02324839*nc1.w + -0.13249202*nd1.w + -0.31107336*ne1.w + -0.044882078*nf1.w + 0.0023130344*ng1.w + 0.12264239*nh1.w + 0.06401549*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.008576719; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN110 +//!BIND LUMAN111 +//!SAVE LUMAN120 + +#define L0_tex LUMAN110_tex +#define L1_tex LUMAN111_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.03419658*a0.x + 0.04234174*b0.x + -0.004263536*c0.x + 0.085486904*d0.x + 0.1347802*e0.x + -0.019748386*f0.x + -0.117732905*g0.x + -0.10726092*h0.x + 0.008796778*i0.x; + float j = 0.145332*a0.y + -0.118838355*b0.y + -0.1386052*c0.y + -0.01958755*d0.y + 0.17036115*e0.y + 0.18370172*f0.y + 0.03361552*g0.y + 0.07884379*h0.y + 0.045483217*i0.y; + float k = -0.030767104*a0.z + 0.07757515*b0.z + -0.085805915*c0.z + -0.1185484*d0.z + -0.26337406*e0.z + 0.05961827*f0.z + 0.042409312*g0.z + -0.010232436*h0.z + -5.044214e-05*i0.z; + float l = -0.17780498*a0.w + -0.04013949*b0.w + -0.037311044*c0.w + 0.15648837*d0.w + 0.5124475*e0.w + 0.014651824*f0.w + 0.088576384*g0.w + -0.06640279*h0.w + -0.049112737*i0.w; + float m = 0.0079423245*a1.x + 0.04602091*b1.x + -0.051456727*c1.x + 0.024389006*d1.x + -0.07325696*e1.x + 0.11012193*f1.x + -0.045976166*g1.x + -0.090682596*h1.x + -0.07234718*i1.x; + float n = -0.04302659*a1.y + 0.087995455*b1.y + -0.019285012*c1.y + -0.06172422*d1.y + -0.32629314*e1.y + -0.012027535*f1.y + 0.0835997*g1.y + 0.12310212*h1.y + 0.010239601*i1.y; + float o = -0.049638838*a1.z + 0.076178625*b1.z + -0.05349241*c1.z + -0.107234344*d1.z + -0.186114*e1.z + 0.024813233*f1.z + 0.0060986993*g1.z + -0.07767666*h1.z + -0.035295106*i1.z; + float p = -0.056122378*a1.w + 0.107091725*b1.w + 0.04479051*c1.w + 0.105193965*d1.w + -0.0037533492*e1.w + -0.026995312*f1.w + 0.18978113*g1.w + 0.12996297*h1.w + 0.023616683*i1.w; + float q = -0.032792877*na0.x + -0.3012694*nb0.x + 0.009388108*nc0.x + -0.18869895*nd0.x + -0.06794785*ne0.x + 0.07865117*nf0.x + 0.16489376*ng0.x + 0.2827912*nh0.x + -0.019100828*ni0.x; + float r = 0.044741493*na0.y + -0.22722921*nb0.y + -0.031233322*nc0.y + -0.1825249*nd0.y + 0.1669076*ne0.y + -0.20256056*nf0.y + -0.005387011*ng0.y + -0.052400213*nh0.y + 0.008328497*ni0.y; + float s = -0.00326432*na0.z + -0.08053971*nb0.z + 0.06993597*nc0.z + 0.16277675*nd0.z + 0.12830172*ne0.z + -0.031723607*nf0.z + -0.056370232*ng0.z + 0.09434579*nh0.z + 0.01401013*ni0.z; + float t = -0.00080348144*na0.w + -0.0140173435*nb0.w + 0.053308867*nc0.w + 0.07490176*nd0.w + -0.011815553*ne0.w + -0.06710458*nf0.w + -0.11728107*ng0.w + -0.15691936*nh0.w + -0.013996718*ni0.w; + float u = -0.051334072*na1.x + 0.10004408*nb1.x + 0.017916761*nc1.x + 0.078460515*nd1.x + -0.24399187*ne1.x + 0.019960076*nf1.x + 0.056844246*ng1.x + 0.124312244*nh1.x + -0.0019768244*ni1.x; + float v = 0.020052563*na1.y + -0.074652724*nb1.y + 0.0058090677*nc1.y + 0.09016366*nd1.y + 0.2910772*ne1.y + 0.032006025*nf1.y + -0.08302292*ng1.y + -0.12736753*nh1.y + 0.004687992*ni1.y; + float w = -0.041612104*na1.z + -0.09929229*nb1.z + 0.026467089*nc1.z + 0.10896838*nd1.z + 0.08728067*ne1.z + -0.009002156*nf1.z + -0.0019186987*ng1.z + 0.021415843*nh1.z + 0.014931899*ni1.z; + float x = -0.016585568*na1.w + -0.019664338*nb1.w + -0.010510242*nc1.w + 0.027096234*nd1.w + -0.27564695*ne1.w + -0.0015411398*nf1.w + -0.057726476*ng1.w + -0.17033243*nh1.w + -0.023435434*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0027177525; + i = 0.064263724*a0.x + -0.039562706*b0.x + -0.002825356*c0.x + 0.27440286*d0.x + -0.20511444*e0.x + 0.0545985*f0.x + 0.09488737*g0.x + -0.20791619*h0.x + 0.051740464*i0.x; + j = 0.00017828071*a0.y + 0.08186342*b0.y + -0.084284164*c0.y + -0.02336734*d0.y + -0.09449044*e0.y + -0.004509461*f0.y + -0.030286653*g0.y + 0.017867139*h0.y + 0.004724629*i0.y; + k = 0.0030007442*a0.z + -0.10181248*b0.z + 0.00993031*c0.z + 0.074616954*d0.z + 0.16503222*e0.z + 0.2771392*f0.z + 0.06308826*g0.z + -0.09798749*h0.z + -0.0025535324*i0.z; + l = -0.08172359*a0.w + 0.12292478*b0.w + -0.16848561*c0.w + 0.07073111*d0.w + -0.73835886*e0.w + 0.19245274*f0.w + -0.1404062*g0.w + 0.24471237*h0.w + -0.12639032*i0.w; + m = -0.022862365*a1.x + 0.0023818095*b1.x + 0.05612693*c1.x + 0.03942403*d1.x + -0.16278934*e1.x + 0.15510206*f1.x + 0.14307606*g1.x + -0.0066428985*h1.x + -0.068190604*i1.x; + n = 0.119453914*a1.y + -0.30648935*b1.y + 0.12936467*c1.y + 0.026358444*d1.y + -0.6192209*e1.y + -0.061524224*f1.y + 0.09192626*g1.y + -0.13491037*h1.y + 0.04403033*i1.y; + o = 0.16812736*a1.z + 0.11960045*b1.z + 0.028085833*c1.z + 0.25032774*d1.z + 0.08565775*e1.z + 0.30494735*f1.z + -0.055606324*g1.z + 0.16188392*h1.z + -0.0043007014*i1.z; + p = 0.069242105*a1.w + -0.005010746*b1.w + -0.15581696*c1.w + 0.20451608*d1.w + 0.13370973*e1.w + 0.22138312*f1.w + -0.2966924*g1.w + 0.10758237*h1.w + 0.082805164*i1.w; + q = -0.14249119*na0.x + 0.13207927*nb0.x + 0.008215849*nc0.x + -0.12373979*nd0.x + 0.34873658*ne0.x + -0.09177493*nf0.x + -0.13032945*ng0.x + 0.062212747*nh0.x + 0.06871929*ni0.x; + r = -0.021839553*na0.y + -0.4821346*nb0.y + -0.08098096*nc0.y + -0.23721185*nd0.y + -0.36681846*ne0.y + 0.09836048*nf0.y + 0.07406981*ng0.y + -0.07001368*nh0.y + -0.33318177*ni0.y; + s = -0.030489637*na0.z + 0.1602204*nb0.z + 0.014132801*nc0.z + -0.21801928*nd0.z + -0.14850943*ne0.z + -0.121734664*nf0.z + 0.07872759*ng0.z + 0.084055774*nh0.z + 0.010060022*ni0.z; + t = -0.013205502*na0.w + 0.076589726*nb0.w + -0.08145456*nc0.w + 0.0529249*nd0.w + 0.4912117*ne0.w + -0.054977912*nf0.w + 0.11069747*ng0.w + -0.09718869*nh0.w + -0.1079657*ni0.w; + u = -0.0013224155*na1.x + -0.075267605*nb1.x + 0.047625992*nc1.x + 0.103593*nd1.x + 0.0070434245*ne1.x + -0.07256906*nf1.x + 0.020944325*ng1.x + 0.0037556116*nh1.x + -0.083298795*ni1.x; + v = -0.17848632*na1.y + 0.09253789*nb1.y + 0.028199574*nc1.y + 0.049197208*nd1.y + 0.27007762*ne1.y + 0.003407099*nf1.y + -0.007148225*ng1.y + 0.033093993*nh1.y + -0.01289992*ni1.y; + w = -0.08962241*na1.z + -0.020183992*nb1.z + -0.118681364*nc1.z + 0.004322101*nd1.z + -0.83673894*ne1.z + -0.026786922*nf1.z + 0.05512487*ng1.z + 0.054306448*nh1.z + 0.07126643*ni1.z; + x = 0.028476331*na1.w + -0.062953666*nb1.w + -0.023954807*nc1.w + 0.027786924*nd1.w + 0.103380345*ne1.w + 0.16595764*nf1.w + -0.063491225*ng1.w + 0.049585197*nh1.w + -0.0935845*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0041770632; + i = 0.026532259*a0.x + -0.043151964*b0.x + -0.023539152*c0.x + 0.124449484*d0.x + -0.19282119*e0.x + 0.013472447*f0.x + -0.115176246*g0.x + -0.10243189*h0.x + 0.06320668*i0.x; + j = -0.0059697866*a0.y + 0.043782752*b0.y + -0.09426866*c0.y + 0.050792914*d0.y + -0.09421752*e0.y + -0.017171869*f0.y + -0.09151457*g0.y + 0.07609253*h0.y + 0.13071252*i0.y; + k = -0.024361333*a0.z + 0.009874322*b0.z + 0.07454306*c0.z + -0.15447307*d0.z + 0.13888164*e0.z + -0.034940712*f0.z + -0.040980965*g0.z + -0.02682383*h0.z + -0.066917755*i0.z; + l = -0.06584927*a0.w + 0.0035738812*b0.w + 0.05411536*c0.w + 0.051882975*d0.w + 0.25177068*e0.w + 0.032372046*f0.w + 0.11359933*g0.w + 0.05095093*h0.w + -0.07030653*i0.w; + m = -0.005564911*a1.x + -0.036399335*b1.x + 0.050246976*c1.x + 0.0984369*d1.x + -0.100392096*e1.x + -0.052057363*f1.x + -0.0034145052*g1.x + -0.10695044*h1.x + 0.022204392*i1.x; + n = -0.1459085*a1.y + 0.020675056*b1.y + -0.06596223*c1.y + -0.14782459*d1.y + 0.12917906*e1.y + -0.0522965*f1.y + 0.09491187*g1.y + -0.016474292*h1.y + -0.13321705*i1.y; + o = -0.15219742*a1.z + -0.033107433*b1.z + 0.087146364*c1.z + 0.010368419*d1.z + 0.032200083*e1.z + 0.0459494*f1.z + 0.14232826*g1.z + -0.12944774*h1.z + -0.0754529*i1.z; + p = -0.15429367*a1.w + -0.02448594*b1.w + 0.043734852*c1.w + -0.15192075*d1.w + -0.087126195*e1.w + -0.165763*f1.w + 0.120236985*g1.w + 0.0045476337*h1.w + -0.1184898*i1.w; + q = -0.024490256*na0.x + -0.01748134*nb0.x + -0.00063394895*nc0.x + -0.14126152*nd0.x + 0.24202287*ne0.x + 0.059133608*nf0.x + 0.05383861*ng0.x + 0.0967077*nh0.x + -0.007970071*ni0.x; + r = -0.21873847*na0.y + -0.14622325*nb0.y + 0.047783785*nc0.y + 0.034090877*nd0.y + 0.0025731032*ne0.y + -0.14487019*nf0.y + 0.056929756*ng0.y + -0.23404305*nh0.y + 0.025685174*ni0.y; + s = 0.056901038*na0.z + -0.035735376*nb0.z + -0.023277406*nc0.z + 0.099037796*nd0.z + -0.086797796*ne0.z + 0.019788722*nf0.z + 0.10133625*ng0.z + -0.12101483*nh0.z + 0.02770466*ni0.z; + t = 0.058126416*na0.w + -0.057519764*nb0.w + -0.012282111*nc0.w + -0.008142407*nd0.w + -0.111955725*ne0.w + -0.015524334*nf0.w + 0.038397934*ng0.w + -0.15748297*nh0.w + -0.00765482*ni0.w; + u = -0.097768635*na1.x + 0.029718421*nb1.x + -0.010391541*nc1.x + -0.09858282*nd1.x + -0.02233209*ne1.x + -0.011829104*nf1.x + 0.15196133*ng1.x + -0.05273923*nh1.x + -0.036803413*ni1.x; + v = 0.075455025*na1.y + 0.04232998*nb1.y + 0.00833761*nc1.y + 0.03109816*nd1.y + -0.15964165*ne1.y + -0.02546395*nf1.y + -0.10285106*ng1.y + -0.0079596415*nh1.y + 0.012193279*ni1.y; + w = 0.11320614*na1.z + 0.056008387*nb1.z + -0.01812151*nc1.z + -0.09234208*nd1.z + 0.33674252*ne1.z + -0.009951529*nf1.z + 0.037884384*ng1.z + 0.39397368*nh1.z + 0.009155979*ni1.z; + x = 0.043282937*na1.w + -0.022083275*nb1.w + -0.039594356*nc1.w + 0.07992068*nd1.w + -0.021216467*ne1.w + -0.024652136*nf1.w + -0.034756433*ng1.w + -0.088006526*nh1.w + -0.023057858*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0036904276; + i = 0.071499825*a0.x + -0.017037481*b0.x + -0.04289817*c0.x + -0.06426044*d0.x + 0.11343753*e0.x + -0.005860346*f0.x + -0.10861172*g0.x + 0.08847832*h0.x + -0.018993571*i0.x; + j = 0.12151444*a0.y + -0.21413642*b0.y + -0.16236494*c0.y + -0.28620937*d0.y + -0.12364789*e0.y + 0.12073757*f0.y + -0.025671931*g0.y + 0.04384527*h0.y + -0.072729446*i0.y; + k = 0.013037446*a0.z + -0.031395227*b0.z + -0.050007146*c0.z + -0.21211621*d0.z + -0.5972017*e0.z + 0.15161848*f0.z + 0.022896405*g0.z + 0.10271641*h0.z + 0.024362244*i0.z; + l = -0.069410875*a0.w + -0.22706726*b0.w + -0.021730786*c0.w + 0.019326342*d0.w + -0.13826303*e0.w + -0.021515118*f0.w + -0.02573992*g0.w + -0.0237696*h0.w + 0.0123208*i0.w; + m = -0.06127183*a1.x + 0.051088296*b1.x + -0.04584946*c1.x + 0.13170096*d1.x + -0.39505032*e1.x + 0.23969938*f1.x + 0.04389141*g1.x + 0.36893818*h1.x + -0.067366585*i1.x; + n = -0.08085825*a1.y + 0.060302958*b1.y + -0.09919097*c1.y + 0.043645088*d1.y + -0.3812803*e1.y + -0.050985813*f1.y + 0.037130836*g1.y + 0.023081021*h1.y + -0.0247827*i1.y; + o = -0.004997695*a1.z + 0.13657212*b1.z + 0.056454506*c1.z + 0.07206652*d1.z + -0.33894852*e1.z + 0.009234833*f1.z + 0.018978443*g1.z + 0.021747049*h1.z + 0.061612368*i1.z; + p = -0.18404841*a1.w + 0.17344272*b1.w + 0.06089598*c1.w + 0.22305518*d1.w + -0.18228509*e1.w + 0.01824805*f1.w + -0.1392599*g1.w + 0.21900408*h1.w + 0.0381708*i1.w; + q = -0.061211154*na0.x + -0.11969039*nb0.x + 0.09869126*nc0.x + 0.061141904*nd0.x + -0.06691168*ne0.x + 0.0047452394*nf0.x + -0.038700644*ng0.x + 0.039004963*nh0.x + -0.034600914*ni0.x; + r = 0.0726151*na0.y + -0.081531286*nb0.y + 0.23779625*nc0.y + 0.21001065*nd0.y + -0.5435231*ne0.y + 0.04386579*nf0.y + 0.058399413*ng0.y + 0.045617856*nh0.y + -0.018235456*ni0.y; + s = 0.070326924*na0.z + 0.06268818*nb0.z + 0.06302981*nc0.z + 0.05526274*nd0.z + 0.46898443*ne0.z + 0.07957147*nf0.z + 0.06066431*ng0.z + 0.037095413*nh0.z + -0.10619575*ni0.z; + t = -0.051876582*na0.w + 0.0023649358*nb0.w + 0.046784155*nc0.w + 0.11398935*nd0.w + 0.1253422*ne0.w + -0.049485214*nf0.w + 0.0058373916*ng0.w + 0.016857516*nh0.w + -0.058631293*ni0.w; + u = -0.04962366*na1.x + 0.148904*nb1.x + 0.021688113*nc1.x + 0.15511441*nd1.x + -0.026461873*ne1.x + -0.07623983*nf1.x + -0.029553525*ng1.x + -0.12179555*nh1.x + -0.054989904*ni1.x; + v = -0.05631037*na1.y + -0.019439436*nb1.y + -0.04202643*nc1.y + -0.108763225*nd1.y + 0.07601197*ne1.y + 0.04292159*nf1.y + 0.059576076*ng1.y + -0.056885466*nh1.y + 0.022964494*ni1.y; + w = -0.006342543*na1.z + -0.19573995*nb1.z + -0.061908927*nc1.z + 0.089260034*nd1.z + 0.18138929*ne1.z + 0.061845507*nf1.z + -0.04185466*ng1.z + 0.022229565*nh1.z + -0.013937939*ni1.z; + x = -0.032656766*na1.w + -0.043430645*nb1.w + -0.030643908*nc1.w + 0.11670875*nd1.w + -0.20435229*ne1.w + 0.1200682*nf1.w + -0.16340503*ng1.w + 0.07442494*nh1.w + -0.107492104*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.01253215; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN110 +//!BIND LUMAN111 +//!SAVE LUMAN121 + +#define L0_tex LUMAN110_tex +#define L1_tex LUMAN111_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.01899263*a0.x + -0.077505454*b0.x + 0.011978758*c0.x + -0.18674393*d0.x + 0.1015323*e0.x + -0.050859254*f0.x + -0.023585971*g0.x + -0.08158343*h0.x + 0.06631295*i0.x; + float j = 0.10729953*a0.y + 0.041689463*b0.y + 0.022505827*c0.y + -0.060440443*d0.y + 0.40716222*e0.y + 0.04071186*f0.y + -0.09625937*g0.y + 0.116327144*h0.y + -0.10830027*i0.y; + float k = -0.091419406*a0.z + -0.11728323*b0.z + 0.12473227*c0.z + -0.11223453*d0.z + -0.7762529*e0.z + 0.2406721*f0.z + 0.058871992*g0.z + -0.3313148*h0.z + 0.008788311*i0.z; + float l = 0.05685737*a0.w + 0.033411182*b0.w + -0.020573527*c0.w + 0.27094668*d0.w + -0.27309388*e0.w + 0.20446198*f0.w + 0.10291363*g0.w + -0.067330875*h0.w + -0.052683745*i0.w; + float m = -0.10309394*a1.x + -0.08645983*b1.x + 0.06905719*c1.x + -0.14534827*d1.x + -0.17194697*e1.x + 0.30640042*f1.x + -0.03007999*g1.x + -0.11420834*h1.x + -0.13784356*i1.x; + float n = 0.035676494*a1.y + -0.092659704*b1.y + 0.10887644*c1.y + 0.40208092*d1.y + -0.011463568*e1.y + 0.16224518*f1.y + 0.060072776*g1.y + -0.06448121*h1.y + 0.0070494837*i1.y; + float o = 0.05567742*a1.z + -0.036550913*b1.z + 0.017365746*c1.z + 0.21257657*d1.z + -0.81188375*e1.z + 0.030954812*f1.z + -0.0074971644*g1.z + -0.085213356*h1.z + 0.0605237*i1.z; + float p = 0.07070759*a1.w + 0.028305933*b1.w + -0.16159725*c1.w + 0.19094543*d1.w + -0.48007774*e1.w + 0.21894419*f1.w + 0.14849436*g1.w + -0.5190051*h1.w + 0.049825452*i1.w; + float q = 0.048532236*na0.x + 0.10520654*nb0.x + -0.02212896*nc0.x + 0.36066028*nd0.x + -0.40558204*ne0.x + 0.027699763*nf0.x + -0.049928706*ng0.x + 0.07140545*nh0.x + -0.040809184*ni0.x; + float r = -0.22017251*na0.y + -0.5950039*nb0.y + 0.016011601*nc0.y + 0.1787457*nd0.y + -0.56953317*ne0.y + 0.0016789446*nf0.y + -0.0152591895*ng0.y + -0.14698845*nh0.y + -0.038240127*ni0.y; + float s = 0.012132073*na0.z + 0.20379305*nb0.z + -0.15244928*nc0.z + 0.013908276*nd0.z + 0.57205755*ne0.z + -0.08137592*nf0.z + -0.0420915*ng0.z + 0.2314901*nh0.z + -0.0030451296*ni0.z; + float t = -0.16107729*na0.w + 0.08787612*nb0.w + -0.05292994*nc0.w + -0.21465571*nd0.w + -0.124343075*ne0.w + -0.03303205*nf0.w + 0.029135289*ng0.w + -0.0094405655*nh0.w + -0.027233165*ni0.w; + float u = 0.08539263*na1.x + 0.05341449*nb1.x + 0.051422648*nc1.x + 0.22483036*nd1.x + 0.063043155*ne1.x + -0.23852657*nf1.x + 0.18041016*ng1.x + -0.16212112*nh1.x + 0.046412155*ni1.x; + float v = -0.021413365*na1.y + 0.09399336*nb1.y + -0.045479856*nc1.y + -0.36818838*nd1.y + 0.0050471546*ne1.y + -0.06243919*nf1.y + -0.035713788*ng1.y + 0.024699768*nh1.y + -0.06425166*ni1.y; + float w = -0.031438354*na1.z + -0.09332041*nb1.z + -0.14652777*nc1.z + 0.06121613*nd1.z + 0.28410488*ne1.z + 0.20931922*nf1.z + 0.17510334*ng1.z + 0.04678771*nh1.z + -0.11084662*ni1.z; + float x = -0.03878583*na1.w + 0.11566247*nb1.w + -0.028782109*nc1.w + -0.094483145*nd1.w + 0.18686369*ne1.w + -0.14853023*nf1.w + -0.13913757*ng1.w + 0.40824965*nh1.w + -0.06846965*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.014384879; + i = 0.081302285*a0.x + -0.01200884*b0.x + 0.0051810266*c0.x + 0.22885948*d0.x + 0.5016418*e0.x + -0.022700071*f0.x + -0.11625609*g0.x + 0.3755614*h0.x + 0.042606056*i0.x; + j = -0.24225157*a0.y + -0.03035787*b0.y + -0.02878385*c0.y + -0.27371392*d0.y + 0.30426234*e0.y + 0.29937968*f0.y + -0.06833015*g0.y + -0.28164467*h0.y + -0.19420598*i0.y; + k = 0.13838074*a0.z + -0.0693596*b0.z + -0.0144782495*c0.z + -0.21116641*d0.z + 0.050632227*e0.z + 0.08093468*f0.z + 0.02682863*g0.z + 0.021293785*h0.z + -0.006511923*i0.z; + l = -0.011891017*a0.w + 0.12183185*b0.w + -0.006066711*c0.w + -0.14056961*d0.w + 0.23668641*e0.w + 0.17993811*f0.w + -0.15009682*g0.w + -0.18186209*h0.w + 0.10996275*i0.w; + m = -0.114001215*a1.x + 0.08040355*b1.x + -0.050432112*c1.x + 0.056575384*d1.x + -0.19978435*e1.x + 0.06969095*f1.x + -0.03081741*g1.x + -0.029842261*h1.x + 0.004736284*i1.x; + n = -0.013636102*a1.y + -0.24603765*b1.y + -0.027649323*c1.y + 0.09448466*d1.y + 0.46935272*e1.y + 0.005321074*f1.y + -0.023053408*g1.y + -0.18916315*h1.y + -0.05621936*i1.y; + o = 0.0020085343*a1.z + -0.11732761*b1.z + -0.02356044*c1.z + 0.12710598*d1.z + 0.10050475*e1.z + -0.042752214*f1.z + -0.012645914*g1.z + -0.015005672*h1.z + -0.028899282*i1.z; + p = -0.13963965*a1.w + -0.21774001*b1.w + -0.058217425*c1.w + 0.23380725*d1.w + 0.4253219*e1.w + 0.26903352*f1.w + -0.024840405*g1.w + -0.47157192*h1.w + -0.32442856*i1.w; + q = -0.004313836*na0.x + 0.35438684*nb0.x + -0.02928308*nc0.x + 0.06393032*nd0.x + -0.4129571*ne0.x + 0.16209923*nf0.x + -0.0034282196*ng0.x + -0.51319665*nh0.x + -0.013644353*ni0.x; + r = 0.05253109*na0.y + 0.20828614*nb0.y + -0.26114675*nc0.y + 0.2565526*nd0.y + -0.03439458*ne0.y + -0.16548492*nf0.y + 0.015113385*ng0.y + 0.06683532*nh0.y + 0.270508*ni0.y; + s = 0.033214018*na0.z + 0.13922311*nb0.z + 0.026104584*nc0.z + 0.0142909745*nd0.z + -0.27592355*ne0.z + 0.05822074*nf0.z + 0.12518267*ng0.z + -0.0016699395*nh0.z + -0.03275272*ni0.z; + t = 0.09762718*na0.w + -0.15567127*nb0.w + -0.1329481*nc0.w + 0.15287872*nd0.w + -0.47752786*ne0.w + -0.22881676*nf0.w + 0.037979577*ng0.w + 0.37223414*nh0.w + 0.058603775*ni0.w; + u = -0.042465784*na1.x + -0.02099335*nb1.x + 0.09778185*nc1.x + 0.15799712*nd1.x + 0.15365987*ne1.x + -0.27508533*nf1.x + 0.039696578*ng1.x + -0.16741951*nh1.x + 0.06984442*ni1.x; + v = -0.0752755*na1.y + 0.24538422*nb1.y + 0.0077161137*nc1.y + -0.0127162*nd1.y + -0.53776336*ne1.y + 0.008082307*nf1.y + -0.0023270606*ng1.y + 0.17226219*nh1.y + 0.03457291*ni1.y; + w = -0.08648925*na1.z + 0.12630469*nb1.z + -0.13315432*nc1.z + -0.020660728*nd1.z + -0.21132655*ne1.z + 0.23985873*nf1.z + -0.10585773*ng1.z + 0.23141496*nh1.z + -0.11902503*ni1.z; + x = -0.06618379*na1.w + -0.2273994*nb1.w + 0.077781565*nc1.w + 0.046340372*nd1.w + -0.15985714*ne1.w + -0.015358807*nf1.w + -0.19775797*ng1.w + 0.12113512*nh1.w + -0.040067535*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.002771056; + i = 0.021606864*a0.x + -0.08928166*b0.x + -0.08577098*c0.x + 0.116481096*d0.x + 0.028323913*e0.x + -0.036533065*f0.x + -0.075527035*g0.x + 0.012755163*h0.x + 0.020122685*i0.x; + j = 0.0028853463*a0.y + -0.18811181*b0.y + -0.17382199*c0.y + 0.068786174*d0.y + 0.05918515*e0.y + -0.14406848*f0.y + -0.027476229*g0.y + -0.13845423*h0.y + 0.015846852*i0.y; + k = 0.06259905*a0.z + 0.040686153*b0.z + -0.09959466*c0.z + -0.044038236*d0.z + 0.32777426*e0.z + 0.032428484*f0.z + -0.11056117*g0.z + 0.17431906*h0.z + -0.02379753*i0.z; + l = -0.25824967*a0.w + -0.18743302*b0.w + 0.0044342517*c0.w + -0.1706001*d0.w + 0.19157986*e0.w + -0.13212295*f0.w + -0.042633854*g0.w + -0.11158089*h0.w + -0.021044202*i0.w; + m = 0.047586076*a1.x + -0.035441607*b1.x + -0.12803088*c1.x + 0.20249197*d1.x + 0.13793948*e1.x + 0.29371345*f1.x + 0.077109165*g1.x + 0.3541602*h1.x + -0.048006814*i1.x; + n = -0.22914135*a1.y + 0.10113166*b1.y + -0.2540913*c1.y + -0.2997133*d1.y + -0.021689592*e1.y + -0.18026315*f1.y + -0.06550943*g1.y + 0.11176253*h1.y + -0.123405196*i1.y; + o = -0.12822497*a1.z + 0.28259254*b1.z + 0.2307225*c1.z + -0.02333415*d1.z + 0.3453413*e1.z + -0.034818113*f1.z + 0.054801736*g1.z + 0.16259307*h1.z + 0.13333833*i1.z; + p = -0.39024496*a1.w + 0.021573117*b1.w + 0.08599005*c1.w + -0.42476216*d1.w + -0.7817298*e1.w + -0.2601256*f1.w + 0.021591498*g1.w + 0.309251*h1.w + -0.06791641*i1.w; + q = -0.14430566*na0.x + -0.11055743*nb0.x + 0.105672106*nc0.x + -0.25145876*nd0.x + 0.1106223*ne0.x + -0.0066601806*nf0.x + 0.008009466*ng0.x + 0.15834406*nh0.x + -0.04079572*ni0.x; + r = 0.08744367*na0.y + 0.105490685*nb0.y + 0.31114987*nc0.y + 0.07603488*nd0.y + 0.17058893*ne0.y + 0.22760919*nf0.y + 0.006074983*ng0.y + 0.08326886*nh0.y + 0.15943988*ni0.y; + s = 0.050332133*na0.z + -0.0766741*nb0.z + 0.1285683*nc0.z + 0.055331063*nd0.z + -0.60682815*ne0.z + 0.1371641*nf0.z + 0.18354717*ng0.z + 0.03286175*nh0.z + -0.07859616*ni0.z; + t = 0.10502813*na0.w + -0.027062168*nb0.w + 0.055231456*nc0.w + 0.14236453*nd0.w + 0.10616334*ne0.w + 0.09435703*nf0.w + 0.07842552*ng0.w + -0.06887093*nh0.w + -0.024590459*ni0.w; + u = -0.20450965*na1.x + 0.096837066*nb1.x + 0.03443422*nc1.x + -0.25169346*nd1.x + -0.09789607*ne1.x + -0.15015261*nf1.x + -0.015787307*ng1.x + 0.055096075*nh1.x + -0.037342865*ni1.x; + v = 0.08175798*na1.y + 0.02664857*nb1.y + -0.022075763*nc1.y + 0.12141814*nd1.y + -0.02737079*ne1.y + 0.04700818*nf1.y + 0.04346721*ng1.y + -0.07328907*nh1.y + 0.04347813*ni1.y; + w = 0.12698099*na1.z + -0.18376732*nb1.z + -0.13291064*nc1.z + -0.1144856*nd1.z + -0.09359536*ne1.z + -0.018985584*nf1.z + -0.039779156*ng1.z + 0.0033084468*nh1.z + -0.09617441*ni1.z; + x = 0.12593117*na1.w + -0.050418727*nb1.w + -0.037301436*nc1.w + 0.24911767*nd1.w + -0.35904863*ne1.w + 0.2984039*nf1.w + 0.09867465*ng1.w + -0.20010832*nh1.w + 0.05439809*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.00091614726; + i = -0.06394797*a0.x + -0.10589785*b0.x + 0.071662396*c0.x + 0.23248084*d0.x + -0.69144565*e0.x + 0.20778444*f0.x + 0.08832192*g0.x + -0.114318825*h0.x + -0.046119977*i0.x; + j = -0.018593391*a0.y + 0.25111246*b0.y + -0.2612264*c0.y + 0.0385463*d0.y + 0.6223591*e0.y + 0.026857028*f0.y + -0.014829569*g0.y + 0.1277322*h0.y + 0.0584881*i0.y; + k = 0.023849497*a0.z + -0.067284025*b0.z + 0.1418698*c0.z + -0.010982118*d0.z + 0.16797899*e0.z + -0.14820707*f0.z + -0.023809081*g0.z + -0.090138786*h0.z + 0.014505213*i0.z; + l = 0.12983774*a0.w + -0.029752735*b0.w + -0.07501964*c0.w + -0.07778343*d0.w + 0.18478629*e0.w + -0.27968863*f0.w + -0.041439153*g0.w + 0.1744004*h0.w + 0.015227504*i0.w; + m = -0.020664224*a1.x + -0.0038989927*b1.x + -0.031596243*c1.x + -0.0101110535*d1.x + -0.06884738*e1.x + -0.1365087*f1.x + 0.014945645*g1.x + -0.030193496*h1.x + 0.0163872*i1.x; + n = -0.0004287638*a1.y + 0.010622353*b1.y + 0.09724528*c1.y + 0.14886458*d1.y + 0.08720078*e1.y + -0.15509501*f1.y + 0.06435047*g1.y + 0.05138851*h1.y + 0.06877765*i1.y; + o = 0.033485916*a1.z + 0.2254674*b1.z + 0.13985848*c1.z + 0.1105003*d1.z + -0.25495616*e1.z + -0.0071104667*f1.z + 0.00394771*g1.z + -0.044202417*h1.z + -0.056555733*i1.z; + p = -0.06150365*a1.w + 0.37854615*b1.w + 0.16227704*c1.w + 0.09953428*d1.w + 0.6951193*e1.w + -0.00896644*f1.w + -0.14055361*g1.w + -0.09406019*h1.w + 0.11679244*i1.w; + q = 0.044572912*na0.x + 0.16796306*nb0.x + -0.06547087*nc0.x + -0.048156604*nd0.x + 0.5251333*ne0.x + -0.15836562*nf0.x + -0.06462838*ng0.x + 0.09596074*nh0.x + 0.037825905*ni0.x; + r = -0.23161076*na0.y + -0.65139836*nb0.y + 0.13197362*nc0.y + -0.05546677*nd0.y + -0.97165394*ne0.y + -0.30722955*nf0.y + -0.017831514*ng0.y + -0.03898181*nh0.y + -0.17043829*ni0.y; + s = 0.057691526*na0.z + 0.0524966*nb0.z + -0.03153983*nc0.z + -0.0503038*nd0.z + 0.08104926*ne0.z + 0.06692566*nf0.z + -0.013073635*ng0.z + -0.008260687*nh0.z + 0.010080927*ni0.z; + t = -0.05453099*na0.w + -0.18063734*nb0.w + 0.16694653*nc0.w + -0.028910562*nd0.w + -0.42992082*ne0.w + 0.16023055*nf0.w + 0.038325876*ng0.w + -0.14538842*nh0.w + -0.023606323*ni0.w; + u = -0.07181944*na1.x + 0.14208739*nb1.x + -0.0039082896*nc1.x + 0.00190685*nd1.x + 0.17796423*ne1.x + 0.08351044*nf1.x + -0.044966634*ng1.x + -0.06406277*nh1.x + 0.06725832*ni1.x; + v = -0.0071947016*na1.y + 0.0006096204*nb1.y + -0.13142252*nc1.y + -0.007630795*nd1.y + 0.028756304*ne1.y + 0.039658252*nf1.y + 0.009520045*ng1.y + -0.03928686*nh1.y + -0.1010825*ni1.y; + w = -0.049172632*na1.z + -0.35113806*nb1.z + 0.022209*nc1.z + -0.026630908*nd1.z + 0.23890342*ne1.z + -0.06114634*nf1.z + 0.019761385*ng1.z + 0.08615667*nh1.z + 0.0992877*ni1.z; + x = 0.0073823123*na1.w + -0.110830136*nb1.w + 0.027609926*nc1.w + 0.019419665*nd1.w + -0.24567391*ne1.w + -0.050785057*nf1.w + 0.05211453*ng1.w + -0.022167444*nh1.w + -0.09944939*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.005509867; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN120 +//!BIND LUMAN121 +//!SAVE LUMAN130 + +#define L0_tex LUMAN120_tex +#define L1_tex LUMAN121_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.07173966*a0.x + 0.05524066*b0.x + -0.21521214*c0.x + -0.12502593*d0.x + 0.30083555*e0.x + 0.5521808*f0.x + 0.27752915*g0.x + -0.27389202*h0.x + -0.13792084*i0.x; + float j = -0.018661562*a0.y + 0.12920462*b0.y + -0.050642636*c0.y + -0.05618292*d0.y + -0.2634706*e0.y + 0.08305681*f0.y + 0.07627947*g0.y + -0.03478369*h0.y + 0.008291865*i0.y; + float k = 0.3203911*a0.z + -0.10194117*b0.z + 0.5750903*c0.z + 0.027564753*d0.z + 0.20415193*e0.z + -0.32818332*f0.z + 0.0064895176*g0.z + 0.11268637*h0.z + -0.07566682*i0.z; + float l = -0.20254683*a0.w + -0.028722532*b0.w + 0.20982566*c0.w + -0.03934203*d0.w + 1.1664512*e0.w + -0.35541716*f0.w + 0.1317692*g0.w + 0.2791658*h0.w + -0.0008373487*i0.w; + float m = 0.11692941*a1.x + -0.5743238*b1.x + -0.020805841*c1.x + 0.06912012*d1.x + 0.7215903*e1.x + 0.08506985*f1.x + -0.1770724*g1.x + -0.021816388*h1.x + -0.0012947934*i1.x; + float n = -0.016384576*a1.y + 0.03555106*b1.y + 0.06288962*c1.y + 0.29152143*d1.y + -0.86737454*e1.y + 0.47646257*f1.y + 0.046224713*g1.y + 0.05431801*h1.y + -0.20437165*i1.y; + float o = -0.19650295*a1.z + 0.36212683*b1.z + -0.09464794*c1.z + 0.21289517*d1.z + -0.49227223*e1.z + 0.12496616*f1.z + 0.010253889*g1.z + -0.039342172*h1.z + -0.0389005*i1.z; + float p = 0.10064498*a1.w + 0.037331007*b1.w + -0.20260917*c1.w + -0.018359315*d1.w + -0.3830645*e1.w + 0.18125847*f1.w + -0.052647024*g1.w + 0.088890396*h1.w + -0.029746594*i1.w; + float q = -0.10467294*na0.x + 0.25880128*nb0.x + -0.041262787*nc0.x + -0.043955367*nd0.x + -0.08661329*ne0.x + 0.050330844*nf0.x + -0.02470256*ng0.x + -0.10187702*nh0.x + -0.026671588*ni0.x; + float r = -0.005288939*na0.y + 0.07448776*nb0.y + -0.1311754*nc0.y + -0.20314097*nd0.y + -0.41264915*ne0.y + -0.26195058*nf0.y + 0.015994098*ng0.y + 0.17131393*nh0.y + -0.042960033*ni0.y; + float s = -0.05252907*na0.z + 0.19381894*nb0.z + 0.031247867*nc0.z + 0.059349507*nd0.z + 0.0496565*ne0.z + -0.036475737*nf0.z + 0.061698027*ng0.z + -0.019937498*nh0.z + 0.031974547*ni0.z; + float t = 0.0596274*na0.w + -0.074480556*nb0.w + -0.04917453*nc0.w + -0.091791056*nd0.w + -0.1944997*ne0.w + -0.15632756*nf0.w + 0.1029948*ng0.w + -0.15851589*nh0.w + -0.040070053*ni0.w; + float u = -0.19576977*na1.x + 0.090122245*nb1.x + 0.028307155*nc1.x + 0.18360525*nd1.x + 0.021744814*ne1.x + -0.025507484*nf1.x + -0.10279109*ng1.x + 0.12280133*nh1.x + -0.045142133*ni1.x; + float v = -0.027888902*na1.y + 0.029968994*nb1.y + 0.0361322*nc1.y + 0.022657184*nd1.y + -0.16778767*ne1.y + -0.024502534*nf1.y + -0.022329496*ng1.y + -0.07601257*nh1.y + 0.03833047*ni1.y; + float w = 0.0653101*na1.z + -0.16791722*nb1.z + -0.0092719225*nc1.z + 0.10876519*nd1.z + 0.6509129*ne1.z + -0.09831674*nf1.z + -0.07682791*ng1.z + 0.08948414*nh1.z + -0.025521843*ni1.z; + float x = -0.12456352*na1.w + -0.09949522*nb1.w + 0.055695318*nc1.w + 0.07635483*nd1.w + 0.76795757*ne1.w + -0.16395962*nf1.w + -0.116975896*ng1.w + -0.19186862*nh1.w + 0.21049598*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.013636319; + i = 0.042530164*a0.x + 0.07018646*b0.x + -0.24715914*c0.x + 0.046272676*d0.x + 0.27483156*e0.x + 0.10328371*f0.x + -0.109125644*g0.x + 0.09677094*h0.x + 0.07537059*i0.x; + j = -0.004949831*a0.y + -0.020548534*b0.y + -0.025159743*c0.y + 0.058468964*d0.y + 0.34713256*e0.y + 0.017708272*f0.y + -0.010207437*g0.y + -0.031564705*h0.y + -0.03981632*i0.y; + k = -0.21877033*a0.z + -0.043471135*b0.z + -0.019215649*c0.z + -0.022867844*d0.z + 0.21302997*e0.z + -0.3662721*f0.z + 0.03106331*g0.z + 0.07036724*h0.z + -0.24083485*i0.z; + l = -0.08853993*a0.w + 0.0015703896*b0.w + 0.11063675*c0.w + 0.018928405*d0.w + -0.24625982*e0.w + 0.17761426*f0.w + 0.06680052*g0.w + 0.25644967*h0.w + -0.09996918*i0.w; + m = 0.045116182*a1.x + -0.4170642*b1.x + 0.24441446*c1.x + 0.2228244*d1.x + -0.7826016*e1.x + 0.053818185*f1.x + 0.23531969*g1.x + -0.5276906*h1.x + -0.017621778*i1.x; + n = -0.04748159*a1.y + 0.14208545*b1.y + -0.08716088*c1.y + 0.16001788*d1.y + -0.11126903*e1.y + 0.15226895*f1.y + -0.054882083*g1.y + 0.027261125*h1.y + -0.007631973*i1.y; + o = 0.045499023*a1.z + -0.109854676*b1.z + 0.056851212*c1.z + 0.016088946*d1.z + -0.021904342*e1.z + 0.16645917*f1.z + 0.017442156*g1.z + -0.18457061*h1.z + 0.12634978*i1.z; + p = -0.12596329*a1.w + 0.2599066*b1.w + -0.106144205*c1.w + 0.22593817*d1.w + 0.16219479*e1.w + 0.16036382*f1.w + -0.04179427*g1.w + -0.098000705*h1.w + 0.13039199*i1.w; + q = 0.10479193*na0.x + -0.17233655*nb0.x + -0.060700305*nc0.x + 0.06606078*nd0.x + -0.089419335*ne0.x + 0.20349522*nf0.x + -0.02300001*ng0.x + -0.05826102*nh0.x + 0.05089717*ni0.x; + r = -0.056828115*na0.y + 0.060302604*nb0.y + 0.024080917*nc0.y + -0.082361214*nd0.y + -0.1468351*ne0.y + -0.020615399*nf0.y + 0.022000078*ng0.y + 0.08448483*nh0.y + 0.029490553*ni0.y; + s = -0.20444779*na0.z + 0.363772*nb0.z + 0.013757455*nc0.z + -0.027767507*nd0.z + 0.086781934*ne0.z + 0.042837158*nf0.z + -0.0028691744*ng0.z + -0.048100833*nh0.z + -0.03654709*ni0.z; + t = 0.04099425*na0.w + 0.050848916*nb0.w + 0.09634782*nc0.w + 0.16893995*nd0.w + -0.10806615*ne0.w + 0.1542499*nf0.w + -0.1305786*ng0.w + -0.11792504*nh0.w + 0.030942632*ni0.w; + u = -0.00045687062*na1.x + -0.11489277*nb1.x + -0.04124386*nc1.x + 0.020468015*nd1.x + 0.5372667*ne1.x + 0.059690394*nf1.x + 0.14485446*ng1.x + 0.069309615*nh1.x + -0.02704002*ni1.x; + v = -0.0934174*na1.y + 0.04013287*nb1.y + -0.01692319*nc1.y + 0.062415145*nd1.y + 0.20963359*ne1.y + -0.10348718*nf1.y + -0.013736046*ng1.y + -0.021258404*nh1.y + -0.047034536*ni1.y; + w = 0.08916951*na1.z + -0.24287029*nb1.z + -0.056870934*nc1.z + 0.025470622*nd1.z + -0.3036939*ne1.z + -0.15004703*nf1.z + 0.037480198*ng1.z + -0.20328596*nh1.z + 0.124831766*ni1.z; + x = -0.011442481*na1.w + 0.077219054*nb1.w + -0.013083296*nc1.w + 0.14963494*nd1.w + -0.5541406*ne1.w + -0.053182814*nf1.w + 0.056806713*ng1.w + -0.43407235*nh1.w + 0.21133529*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.020445773; + i = -0.060422402*a0.x + -0.06825925*b0.x + -0.057646785*c0.x + -0.16212627*d0.x + -0.32644564*e0.x + 0.12910526*f0.x + -0.063041456*g0.x + 0.07560072*h0.x + -0.015426578*i0.x; + j = -0.006889652*a0.y + -0.17347373*b0.y + 0.016179034*c0.y + 0.058115833*d0.y + 0.31190333*e0.y + -0.078174144*f0.y + -0.07960504*g0.y + 0.12811723*h0.y + 0.0055712913*i0.y; + k = -0.24560466*a0.z + 0.16410764*b0.z + -0.22483738*c0.z + 0.07343547*d0.z + -0.057290845*e0.z + -0.3933686*f0.z + -0.050107088*g0.z + -0.13618156*h0.z + 0.24685264*i0.z; + l = 0.106292695*a0.w + -0.12385596*b0.w + 0.15031956*c0.w + -0.019425064*d0.w + 0.20487277*e0.w + -0.4166029*f0.w + 0.049125712*g0.w + -0.18145804*h0.w + 0.22562954*i0.w; + m = -0.061704915*a1.x + 0.021972679*b1.x + 0.03886212*c1.x + 0.00050829595*d1.x + -0.50772375*e1.x + 0.1848391*f1.x + -0.09643155*g1.x + 0.2006514*h1.x + -0.1370429*i1.x; + n = -0.12936626*a1.y + 0.21173458*b1.y + -0.002170517*c1.y + -0.016762713*d1.y + -0.56988305*e1.y + -0.35746378*f1.y + -0.03237757*g1.y + -0.061048053*h1.y + 0.15020193*i1.y; + o = 0.122485116*a1.z + -0.18640561*b1.z + -0.0009304099*c1.z + -0.10620465*d1.z + -0.017849369*e1.z + 0.18167005*f1.z + -0.13736731*g1.z + 0.06757091*h1.z + -0.033063065*i1.z; + p = -0.08587528*a1.w + 0.14814755*b1.w + 0.10723197*c1.w + 0.25996724*d1.w + -0.27067813*e1.w + 0.023977801*f1.w + -0.11409169*g1.w + 0.08244975*h1.w + -0.07811598*i1.w; + q = 0.09545891*na0.x + -0.26934135*nb0.x + 0.084429435*nc0.x + -0.027571537*nd0.x + 0.18728629*ne0.x + -0.034010876*nf0.x + 0.11272564*ng0.x + -0.02174526*nh0.x + 0.031401962*ni0.x; + r = -0.058911406*na0.y + 0.117469706*nb0.y + 0.07483167*nc0.y + 0.25347975*nd0.y + -0.8893511*ne0.y + 0.11577824*nf0.y + -0.019952424*ng0.y + -0.32625362*nh0.y + 0.054697443*ni0.y; + s = 0.058437176*na0.z + 0.12717098*nb0.z + -0.030477263*nc0.z + 0.025787791*nd0.z + -0.55476403*ne0.z + 0.10344902*nf0.z + -0.049927607*ng0.z + 0.0034100525*nh0.z + -0.014674564*ni0.z; + t = -0.039341412*na0.w + 0.24266788*nb0.w + -0.13092296*nc0.w + -0.078149125*nd0.w + -0.1825526*ne0.w + 0.39637613*nf0.w + -0.07388616*ng0.w + 0.07066076*nh0.w + -0.068194985*ni0.w; + u = 0.16596706*na1.x + -0.17953089*nb1.x + 0.05764661*nc1.x + -0.11200913*nd1.x + 0.4304551*ne1.x + -0.20531161*nf1.x + 0.057423525*ng1.x + -0.0616747*nh1.x + 0.09423837*ni1.x; + v = -0.0030923756*na1.y + -0.005227259*nb1.y + 0.00855408*nc1.y + 0.05933646*nd1.y + 0.1647804*ne1.y + -0.014145093*nf1.y + 0.029180478*ng1.y + 0.015440778*nh1.y + -0.0042728186*ni1.y; + w = -0.04026973*na1.z + -0.09111073*nb1.z + 0.09226495*nc1.z + 0.029515188*nd1.z + -0.2941943*ne1.z + -0.37025875*nf1.z + -0.0482752*ng1.z + 0.023515888*nh1.z + 0.13930896*ni1.z; + x = 0.05243473*na1.w + 0.021479629*nb1.w + -0.0098233*nc1.w + 0.13860157*nd1.w + -0.9362658*ne1.w + 0.13477142*nf1.w + -0.0016362248*ng1.w + 0.3428101*nh1.w + -0.06643634*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.00026336784; + i = 0.13095191*a0.x + 0.071042016*b0.x + 0.15989769*c0.x + -0.4085044*d0.x + -1.1903197*e0.x + -0.8063476*f0.x + 0.1758939*g0.x + 0.29856923*h0.x + 0.018587846*i0.x; + j = -0.0429038*a0.y + -0.046388038*b0.y + 0.050304305*c0.y + -0.012282529*d0.y + 0.50057316*e0.y + 0.102298446*f0.y + -0.047718488*g0.y + 0.011400605*h0.y + -0.040591896*i0.y; + k = -0.08647257*a0.z + 0.06590021*b0.z + -0.10776554*c0.z + 0.05844034*d0.z + 0.15784912*e0.z + -0.050049458*f0.z + -0.08851963*g0.z + -0.09389101*h0.z + -0.07156607*i0.z; + l = -0.020921769*a0.w + 0.13630044*b0.w + 0.04598389*c0.w + -0.022334518*d0.w + -0.3560804*e0.w + 0.66281724*f0.w + 0.08330941*g0.w + -0.050354507*h0.w + 0.0063697495*i0.w; + m = 0.07382021*a1.x + 0.14582287*b1.x + -0.026436277*c1.x + 0.032368336*d1.x + 0.123083666*e1.x + 0.016335508*f1.x + -0.18557611*g1.x + 0.33704454*h1.x + 0.060447156*i1.x; + n = -0.24164051*a1.y + -0.17663498*b1.y + 0.017156934*c1.y + 0.11470921*d1.y + -0.2480085*e1.y + 0.03648527*f1.y + 0.01601964*g1.y + -0.17307469*h1.y + -0.25195485*i1.y; + o = 0.044692397*a1.z + 0.045473315*b1.z + -0.07254721*c1.z + 0.11784992*d1.z + 0.22489645*e1.z + -0.12044718*f1.z + -0.22769438*g1.z + 0.10125708*h1.z + 0.061251607*i1.z; + p = -0.12371223*a1.w + 0.09359978*b1.w + 0.14695486*c1.w + 0.37523615*d1.w + -0.06767972*e1.w + -0.51172626*f1.w + -0.18365318*g1.w + -0.21067004*h1.w + 0.18633223*i1.w; + q = -0.06524313*na0.x + -0.009557331*nb0.x + 0.1807241*nc0.x + -0.04307605*nd0.x + 0.645201*ne0.x + 0.13570951*nf0.x + 0.14300692*ng0.x + 0.18481126*nh0.x + -0.148592*ni0.x; + r = -0.112279296*na0.y + 0.10971034*nb0.y + -0.053928122*nc0.y + 0.1691853*nd0.y + -0.2553969*ne0.y + -0.01336192*nf0.y + -0.010185109*ng0.y + -0.0110892*nh0.y + -0.06696365*ni0.y; + s = 0.009661347*na0.z + 0.13783365*nb0.z + -0.05469151*nc0.z + 0.060208343*nd0.z + -0.20801783*ne0.z + 0.050860364*nf0.z + 0.018983612*ng0.z + -0.058851782*nh0.z + 0.016830424*ni0.z; + t = 0.022623703*na0.w + 0.2184282*nb0.w + -0.18573825*nc0.w + -0.12993099*nd0.w + 0.007547321*ne0.w + -0.13938355*nf0.w + 0.0066179796*ng0.w + 0.2032918*nh0.w + 0.01827841*ni0.w; + u = 0.06574555*na1.x + -0.07890568*nb1.x + 0.006496277*nc1.x + -0.10739301*nd1.x + 0.13940795*ne1.x + 0.1365898*nf1.x + -0.053870827*ng1.x + -0.009612605*nh1.x + -0.018912794*ni1.x; + v = -0.08696663*na1.y + 0.012059219*nb1.y + -0.005466396*nc1.y + 0.03873791*nd1.y + 0.4502705*ne1.y + 0.080376014*nf1.y + 0.066687986*ng1.y + 0.08928875*nh1.y + 0.017182676*ni1.y; + w = -0.040589333*na1.z + -0.09646847*nb1.z + -0.018687917*nc1.z + 0.04907547*nd1.z + 0.008554357*ne1.z + 0.1492653*nf1.z + -0.096977495*ng1.z + -0.13979109*nh1.z + -0.00083513476*ni1.z; + x = -0.04625478*na1.w + 0.0035757115*nb1.w + -0.016119964*nc1.w + 0.26989165*nd1.w + 0.20737746*ne1.w + 0.0034231078*nf1.w + -0.09725438*ng1.w + 0.05070696*nh1.w + 0.17640953*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0135042025; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN120 +//!BIND LUMAN121 +//!SAVE LUMAN131 + +#define L0_tex LUMAN120_tex +#define L1_tex LUMAN121_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.0029817503*a0.x + 0.11039597*b0.x + 0.1293379*c0.x + -0.29478145*d0.x + -0.29309556*e0.x + 0.007461504*f0.x + 0.06639911*g0.x + 0.12852067*h0.x + -0.17117287*i0.x; + float j = 0.014813622*a0.y + -0.0013997258*b0.y + 0.023237767*c0.y + -0.0039130542*d0.y + -0.34994942*e0.y + 0.017671466*f0.y + 0.07529793*g0.y + 0.004599998*h0.y + 0.009330613*i0.y; + float k = 0.3698393*a0.z + -0.39694417*b0.z + 0.09804228*c0.z + -0.35729608*d0.z + 0.41000205*e0.z + -0.5800405*f0.z + 0.15204465*g0.z + -0.3597829*h0.z + 0.50068516*i0.z; + float l = -0.1146267*a0.w + 0.2583005*b0.w + -0.31435132*c0.w + 0.03573161*d0.w + -0.04650575*e0.w + 0.20616455*f0.w + 0.044980876*g0.w + -0.10150848*h0.w + 0.13188677*i0.w; + float m = 0.10420975*a1.x + -0.44770283*b1.x + -0.12038152*c1.x + 0.3392538*d1.x + -0.30249548*e1.x + 0.055619825*f1.x + -0.22301525*g1.x + -0.15613358*h1.x + -0.04950416*i1.x; + float n = -0.24326678*a1.y + 0.2301849*b1.y + -0.1467583*c1.y + 0.39412203*d1.y + -0.5131136*e1.y + 0.19376983*f1.y + -0.10284846*g1.y + 0.18020068*h1.y + -0.116572164*i1.y; + float o = -0.09376026*a1.z + -0.112495236*b1.z + 0.012500469*c1.z + 0.091132894*d1.z + -0.10716909*e1.z + -0.05887143*f1.z + -0.25869355*g1.z + 0.28358018*h1.z + 0.015895177*i1.z; + float p = -0.13750197*a1.w + -0.09933744*b1.w + 0.16747455*c1.w + 0.35556677*d1.w + -0.1980293*e1.w + -0.16308151*f1.w + -0.3437185*g1.w + 0.080174305*h1.w + 0.03273947*i1.w; + float q = -0.008803652*na0.x + -0.05780074*nb0.x + 0.002868577*nc0.x + 0.17680763*nd0.x + -0.1437393*ne0.x + -0.058113955*nf0.x + 0.1324202*ng0.x + -0.025318727*nh0.x + -0.1327205*ni0.x; + float r = 0.12045249*na0.y + -0.19771278*nb0.y + 0.0012465563*nc0.y + -0.25569203*nd0.y + 0.20063406*ne0.y + 0.071804866*nf0.y + 0.13519558*ng0.y + -0.3769389*nh0.y + 0.12577529*ni0.y; + float s = -0.18126842*na0.z + 0.06411489*nb0.z + 0.106862076*nc0.z + 0.15456331*nd0.z + -0.20641422*ne0.z + -0.015733475*nf0.z + 0.04565371*ng0.z + -0.198355*nh0.z + 0.016548535*ni0.z; + float t = 0.016731832*na0.w + 0.03456397*nb0.w + 0.11793571*nc0.w + 0.009492188*nd0.w + -0.17384322*ne0.w + 0.036433797*nf0.w + -0.011236655*ng0.w + 0.104419*nh0.w + -0.042673107*ni0.w; + float u = 0.04593755*na1.x + 0.037620712*nb1.x + -0.116470456*nc1.x + 0.010684921*nd1.x + 0.10634034*ne1.x + 0.083671*nf1.x + 0.003784596*ng1.x + -0.030200265*nh1.x + 0.029983213*ni1.x; + float v = -0.07384754*na1.y + -0.06212857*nb1.y + -0.046269182*nc1.y + 0.035937984*nd1.y + 0.1415643*ne1.y + -0.071681954*nf1.y + -0.14786382*ng1.y + -0.17628422*nh1.y + 0.12059677*ni1.y; + float w = -0.051521663*na1.z + 0.085905306*nb1.z + -0.28085628*nc1.z + -0.21416552*nd1.z + -0.5439677*ne1.z + 0.25659165*nf1.z + -0.30437124*ng1.z + -0.19582753*nh1.z + -0.094153725*ni1.z; + float x = -0.013591523*na1.w + 0.09577837*nb1.w + 0.14275217*nc1.w + 0.23535793*nd1.w + 0.62966025*ne1.w + -0.07882985*nf1.w + -0.1697662*ng1.w + 0.33211526*nh1.w + 0.057048142*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0061882124; + i = 0.1608683*a0.x + 0.12672013*b0.x + -0.13156074*c0.x + 0.20069747*d0.x + -0.57826555*e0.x + -0.1311762*f0.x + 0.05670379*g0.x + -0.13502689*h0.x + -0.017937418*i0.x; + j = -0.033564825*a0.y + 0.077663735*b0.y + -0.0017946946*c0.y + -0.028062444*d0.y + -0.5258993*e0.y + 0.019605096*f0.y + 0.032106742*g0.y + 0.015103085*h0.y + -0.04403495*i0.y; + k = -0.2539501*a0.z + 0.25463545*b0.z + 0.21425003*c0.z + 0.112265415*d0.z + 0.16083106*e0.z + 0.1895563*f0.z + -0.0016240401*g0.z + 0.14660679*h0.z + -0.46303564*i0.z; + l = -0.09206371*a0.w + 0.08054541*b0.w + 0.20218949*c0.w + 0.093106724*d0.w + -0.21643853*e0.w + 0.12654713*f0.w + -0.013795536*g0.w + 0.24343796*h0.w + -0.18503825*i0.w; + m = 0.13443115*a1.x + 0.024385871*b1.x + 0.06606949*c1.x + -0.0127489045*d1.x + 0.25821966*e1.x + 0.0070504625*f1.x + 0.19849744*g1.x + -0.25665656*h1.x + 0.119276844*i1.x; + n = 0.0041986876*a1.y + -0.13548018*b1.y + 0.0587734*c1.y + 0.14147758*d1.y + -0.21496426*e1.y + 0.14946987*f1.y + 0.06213324*g1.y + -0.07815703*h1.y + -0.121064246*i1.y; + o = -0.01119387*a1.z + 0.1281896*b1.z + -0.033581752*c1.z + 0.0795136*d1.z + -0.059567317*e1.z + 0.0051460788*f1.z + 0.2383628*g1.z + -0.30380785*h1.z + 0.051271286*i1.z; + p = -0.09753218*a1.w + 0.2362304*b1.w + -0.18155637*c1.w + 0.017945759*d1.w + 0.06215586*e1.w + -0.012593655*f1.w + 0.19601065*g1.w + -0.17636631*h1.w + 0.2375158*i1.w; + q = -0.06538386*na0.x + 0.04938395*nb0.x + 0.07520233*nc0.x + -0.09151315*nd0.x + 0.13100089*ne0.x + -0.020945365*nf0.x + -0.20073208*ng0.x + 0.059561357*nh0.x + 0.081940256*ni0.x; + r = -0.11219974*na0.y + 0.2536562*nb0.y + -0.09547038*nc0.y + -0.1292043*nd0.y + 0.9015294*ne0.y + -0.12639236*nf0.y + -0.06864811*ng0.y + 0.35557497*nh0.y + -0.14578156*ni0.y; + s = -0.048530217*na0.z + 0.19374037*nb0.z + -0.1382556*nc0.z + -0.13337164*nd0.z + 0.47139746*ne0.z + -0.0766065*nf0.z + -0.040958144*ng0.z + 0.08004464*nh0.z + -0.061836693*ni0.z; + t = 0.0035216731*na0.w + 0.0064222408*nb0.w + -0.075095765*nc0.w + 0.046879686*nd0.w + -0.14983718*ne0.w + -0.12718*nf0.w + 0.08732038*ng0.w + -0.121688694*nh0.w + -0.041010316*ni0.w; + u = -0.07124008*na1.x + -0.04196053*nb1.x + 0.047542192*nc1.x + -0.035899833*nd1.x + -0.41907385*ne1.x + 0.08893381*nf1.x + 0.003947721*ng1.x + 0.06347225*nh1.x + -0.08798214*ni1.x; + v = -0.0768094*na1.y + -0.0052326927*nb1.y + 0.028601233*nc1.y + 0.005496373*nd1.y + -0.20018737*ne1.y + 0.031576294*nf1.y + 0.018691787*ng1.y + 0.079820536*nh1.y + -0.10286643*ni1.y; + w = 0.16556709*na1.z + -0.14412585*nb1.z + 0.023056397*nc1.z + 0.23065941*nd1.z + -0.19911864*ne1.z + 0.12787361*nf1.z + 0.09215916*ng1.z + 0.018068027*nh1.z + 0.042100914*ni1.z; + x = -0.07797658*na1.w + -0.03082342*nb1.w + -0.019065307*nc1.w + 0.12527962*nd1.w + -0.20716375*ne1.w + 0.029431188*nf1.w + 0.1279543*ng1.w + -0.5208783*nh1.w + 0.032281134*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.020498782; + i = -0.084622964*a0.x + -0.16740607*b0.x + -0.029469222*c0.x + 0.16969982*d0.x + -0.18227486*e0.x + 0.25854433*f0.x + -0.19011459*g0.x + -0.17933366*h0.x + 0.074558094*i0.x; + j = 0.026003294*a0.y + -0.04915105*b0.y + -0.0013010732*c0.y + 0.04870731*d0.y + 0.28155202*e0.y + -0.06976968*f0.y + -0.0785302*g0.y + 0.025113294*h0.y + 0.05850286*i0.y; + k = -0.099263944*a0.z + 0.20479305*b0.z + 0.006517434*c0.z + 0.054624297*d0.z + 0.3202717*e0.z + -0.016792087*f0.z + -0.09389022*g0.z + 0.105496354*h0.z + -0.066047944*i0.z; + l = 0.11956328*a0.w + -0.13723543*b0.w + 0.02056757*c0.w + 0.048940748*d0.w + 0.06777377*e0.w + -0.046082053*f0.w + -0.122295715*g0.w + -0.018395558*h0.w + 0.006211377*i0.w; + m = -0.15036355*a1.x + 0.13597776*b1.x + 0.2225863*c1.x + 0.13214336*d1.x + 0.37878448*e1.x + 0.13936034*f1.x + 0.29791525*g1.x + 0.14070831*h1.x + -0.0022269697*i1.x; + n = 0.16937836*a1.y + 0.078364424*b1.y + 0.025481608*c1.y + -0.28841308*d1.y + -0.7480474*e1.y + -0.23245746*f1.y + -0.027374426*g1.y + -0.06545865*h1.y + 0.17867507*i1.y; + o = 0.09645862*a1.z + 0.09660143*b1.z + -0.10547699*c1.z + -0.15390293*d1.z + 0.18812673*e1.z + 0.055048805*f1.z + 0.021517936*g1.z + -0.03123248*h1.z + -0.06397191*i1.z; + p = 0.079715334*a1.w + 0.01418331*b1.w + -0.0774716*c1.w + -0.32642365*d1.w + -0.17485769*e1.w + 0.18184866*f1.w + 0.16945517*g1.w + -0.029771687*h1.w + -0.31664798*i1.w; + q = -0.031399272*na0.x + -0.03206811*nb0.x + -0.07516456*nc0.x + 0.0515123*nd0.x + 0.44152927*ne0.x + 0.19966014*nf0.x + -0.059791274*ng0.x + 0.09954191*nh0.x + 0.101585746*ni0.x; + r = -0.010062315*na0.y + -0.057479843*nb0.y + -0.018172972*nc0.y + 0.059699446*nd0.y + -0.10326032*ne0.y + -0.06662804*nf0.y + -0.064171165*ng0.y + -0.0761727*nh0.y + -0.038051385*ni0.y; + s = 0.12910141*na0.z + 0.01146065*nb0.z + -0.03436212*nc0.z + -0.104220964*nd0.z + -0.03813209*ne0.z + -0.0146224275*nf0.z + -0.0226614*ng0.z + 0.040486135*nh0.z + 0.03331776*ni0.z; + t = 0.00067659107*na0.w + 0.09321861*nb0.w + -0.120426044*nc0.w + -0.012587846*nd0.w + 0.20406908*ne0.w + 0.007672166*nf0.w + -0.035258528*ng0.w + 0.0016402612*nh0.w + 0.058924437*ni0.w; + u = -0.020544445*na1.x + -0.13000254*nb1.x + 0.12238778*nc1.x + 0.008118038*nd1.x + 0.08118961*ne1.x + -0.14815351*nf1.x + -0.0016237226*ng1.x + -0.034430075*nh1.x + 0.021861486*ni1.x; + v = 0.11768407*na1.y + 0.060114264*nb1.y + 0.016723705*nc1.y + -0.057645593*nd1.y + 0.27267838*ne1.y + -0.015508981*nf1.y + 0.07961894*ng1.y + 0.13694412*nh1.y + 0.009282088*ni1.y; + w = 0.0014761469*na1.z + -0.078347*nb1.z + 0.31750104*nc1.z + -0.10870471*nd1.z + -0.6838303*ne1.z + -0.31684813*nf1.z + 0.19105281*ng1.z + 0.21890667*nh1.z + 0.08495596*ni1.z; + x = 0.13082732*na1.w + 0.0022536176*nb1.w + -0.052774757*nc1.w + -0.13665682*nd1.w + 0.0970184*ne1.w + 0.19598328*nf1.w + 0.11680146*ng1.w + 0.22926913*nh1.w + -0.031428613*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.004580171; + i = -0.20878509*a0.x + -0.0049028993*b0.x + 0.008758187*c0.x + 0.42891967*d0.x + -0.12513797*e0.x + 0.078094915*f0.x + -0.715149*g0.x + -0.5880513*h0.x + -0.532971*i0.x; + j = 0.04762167*a0.y + 0.10662991*b0.y + 0.07202485*c0.y + 0.105879575*d0.y + -0.0635549*e0.y + -0.2399356*f0.y + 0.24179313*g0.y + 0.10862184*h0.y + 0.10190414*i0.y; + k = 0.095115505*a0.z + -0.47274086*b0.z + 0.62832284*c0.z + -1.0036635*d0.z + 0.374167*e0.z + -0.681788*f0.z + 0.45285058*g0.z + -0.6784815*h0.z + 0.32184234*i0.z; + l = -0.07651871*a0.w + 0.6871501*b0.w + -0.8205136*c0.w + 0.5000293*d0.w + -0.749573*e0.w + 0.5168709*f0.w + -0.28480902*g0.w + -0.009171731*h0.w + 0.06727333*i0.w; + m = 0.23145379*a1.x + -0.06032752*b1.x + 0.17392537*c1.x + 0.61549795*d1.x + 0.31530488*e1.x + 0.4550739*f1.x + 0.97063684*g1.x + -1.68332*h1.x + 0.11348427*i1.x; + n = -0.033892903*a1.y + 0.9738131*b1.y + -0.31819594*c1.y + 0.71122944*d1.y + -0.75284725*e1.y + 0.2765665*f1.y + -0.27231637*g1.y + 1.0744721*h1.y + 0.26208746*i1.y; + o = 0.05900849*a1.z + -0.5339448*b1.z + -0.12394775*c1.z + -0.40140063*d1.z + 0.04213861*e1.z + -0.16040552*f1.z + 0.25848332*g1.z + -0.08338297*h1.z + -0.026495855*i1.z; + p = -0.3593638*a1.w + -0.1250508*b1.w + 0.004110387*c1.w + -0.14758548*d1.w + -0.2519455*e1.w + 0.047708288*f1.w + 0.130796*g1.w + 0.01886842*h1.w + -0.032272115*i1.w; + q = -0.05126741*na0.x + -0.16950572*nb0.x + -0.23038149*nc0.x + 0.593978*nd0.x + -0.5536893*ne0.x + -0.32420158*nf0.x + -0.47213337*ng0.x + 0.17723289*nh0.x + 0.17365572*ni0.x; + r = 0.36904523*na0.y + -0.41965717*nb0.y + -0.14868285*nc0.y + -1.3712142*nd0.y + 0.40537167*ne0.y + -0.0018829257*nf0.y + 0.102555715*ng0.y + -0.5457678*nh0.y + 0.024573814*ni0.y; + s = -0.33692932*na0.z + -0.28599527*nb0.z + -0.19985573*nc0.z + -0.27231628*nd0.z + -0.044150677*ne0.z + -0.47341737*nf0.z + -0.0870376*ng0.z + -0.33944583*nh0.z + -0.07254269*ni0.z; + t = -0.009741176*na0.w + -0.31833467*nb0.w + 0.27552912*nc0.w + 0.2986059*nd0.w + 0.029016443*ne0.w + 0.045390986*nf0.w + 0.020379847*ng0.w + -0.12964877*nh0.w + -0.20720415*ni0.w; + u = 0.09684107*na1.x + -0.00019891714*nb1.x + -0.04728448*nc1.x + -0.12864496*nd1.x + 0.11396464*ne1.x + 0.047860865*nf1.x + 0.1741148*ng1.x + -0.03588619*nh1.x + 0.022001866*ni1.x; + v = 0.0137323765*na1.y + -0.20688717*nb1.y + -0.032837644*nc1.y + -0.07689021*nd1.y + -0.15632144*ne1.y + -0.19237685*nf1.y + -0.38659793*ng1.y + -0.19939652*nh1.y + 0.017652083*ni1.y; + w = 0.2849119*na1.z + 0.51690143*nb1.z + -0.12283366*nc1.z + -0.28805944*nd1.z + 0.1986708*ne1.z + 0.6683004*nf1.z + -0.20318586*ng1.z + 0.062077664*nh1.z + -0.10572113*ni1.z; + x = 0.015433912*na1.w + 0.4059864*nb1.w + 0.2935132*nc1.w + 0.3080238*nd1.w + -0.47443306*ne1.w + 0.5408017*nf1.w + 0.47627777*ng1.w + -0.21175745*nh1.w + -0.4425635*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.3695156; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-Reduce +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN10 +//!BIND LUMAN11 +//!BIND LUMAN20 +//!BIND LUMAN21 +//!BIND LUMAN30 +//!BIND LUMAN31 +//!BIND LUMAN40 +//!BIND LUMAN41 +//!BIND LUMAN50 +//!BIND LUMAN51 +//!BIND LUMAN60 +//!BIND LUMAN61 +//!BIND LUMAN70 +//!BIND LUMAN71 +//!SAVE LUMAN0 + +vec4 hook() { + vec4 a0 = LUMAN10_tex(HOOKED_pos); + vec4 a1 = LUMAN11_tex(HOOKED_pos); + vec4 b0 = LUMAN20_tex(HOOKED_pos); + vec4 b1 = LUMAN21_tex(HOOKED_pos); + vec4 c0 = LUMAN30_tex(HOOKED_pos); + vec4 c1 = LUMAN31_tex(HOOKED_pos); + vec4 d0 = LUMAN40_tex(HOOKED_pos); + vec4 d1 = LUMAN41_tex(HOOKED_pos); + vec4 e0 = LUMAN50_tex(HOOKED_pos); + vec4 e1 = LUMAN51_tex(HOOKED_pos); + vec4 f0 = LUMAN60_tex(HOOKED_pos); + vec4 f1 = LUMAN61_tex(HOOKED_pos); + vec4 g0 = LUMAN70_tex(HOOKED_pos); + vec4 g1 = LUMAN71_tex(HOOKED_pos); + vec4 na0 = -min(a0, 0); + vec4 na1 = -min(a1, 0); + vec4 nb0 = -min(b0, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc0 = -min(c0, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd0 = -min(d0, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne0 = -min(e0, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf0 = -min(f0, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng0 = -min(g0, 0); + vec4 ng1 = -min(g1, 0); + a0 = max(a0, 0); + a1 = max(a1, 0); + b0 = max(b0, 0); + b1 = max(b1, 0); + c0 = max(c0, 0); + c1 = max(c1, 0); + d0 = max(d0, 0); + d1 = max(d1, 0); + e0 = max(e0, 0); + e1 = max(e1, 0); + f0 = max(f0, 0); + f1 = max(f1, 0); + g0 = max(g0, 0); + g1 = max(g1, 0); + float o = -0.04728476*a0.x + -0.036520608*a0.y + 0.0019385766*a0.z + 0.0068700467*a0.w + -0.0012625896*a1.x + -0.010626795*a1.y + 0.00034366403*a1.z + 0.019933239*a1.w + 0.0030849315*na0.x + 0.0136760855*na0.y + -0.0057450915*na0.z + -0.0104574775*na0.w + -0.0032813277*na1.x + 0.029485198*na1.y + 0.005484502*na1.z + 0.005979312*na1.w + -0.008282406*b0.x + -0.032329977*b0.y + 0.007195994*b0.z + -0.02215956*b0.w + 0.0059099896*b1.x + -0.01843096*b1.y + 0.024378398*b1.z + -0.009847458*b1.w + 0.0021519165*nb0.x + 0.06338734*nb0.y + 0.013530091*nb0.z + 0.018921647*nb0.w + 0.013079997*nb1.x + -0.007416839*nb1.y + -0.03319205*nb1.z + 0.0070940736*nb1.w + 0.0083534485*c0.x + -0.0040059397*c0.y + 0.0010338705*c0.z + 0.023850251*c0.w + 0.019972563*c1.x + -0.013661981*c1.y + -0.002535298*c1.z + 0.00032178697*c1.w + -0.0050726496*nc0.x + 0.014284615*nc0.y + 0.0031937568*nc0.z + -0.012339685*nc0.w + -0.014393241*nc1.x + 0.016286138*nc1.y + 0.0053683654*nc1.z + 0.0267535*nc1.w + -0.009829492*d0.x + 0.017354073*d0.y + 0.002988491*d0.z + 0.0028444938*d0.w + 0.022341609*d1.x + -0.0038211492*d1.y + -0.00046226522*d1.z + -0.00056893734*d1.w + 0.01287184*nd0.x + -0.004260344*nd0.y + -0.011798954*nd0.z + -0.0010778373*nd0.w + -0.025230715*nd1.x + 0.0030024408*nd1.y + -0.0012105505*nd1.z + -0.004203998*nd1.w + -0.02869678*e0.x + 0.028832806*e0.y + -0.0018178951*e0.z + -0.004184944*e0.w + -0.034690376*e1.x + -0.004891646*e1.y + -0.0041404334*e1.z + -0.0053047556*e1.w + 0.01340061*ne0.x + 0.0033740127*ne0.y + -0.0064605293*ne0.z + 0.007029548*ne0.w + -0.012997147*ne1.x + 0.037987478*ne1.y + -0.008045281*ne1.z + 0.003939788*ne1.w + 0.0018597402*f0.x + 0.0020262436*f0.y + 0.00060788146*f0.z + 0.00069211586*f0.w + 0.0015645992*f1.x + 0.005501792*f1.y + 0.014841749*f1.z + 0.016227905*f1.w + -0.006870606*nf0.x + 0.0028365995*nf0.y + 0.000554307*nf0.z + 0.015418915*nf0.w + 0.026047971*nf1.x + 0.0062811137*nf1.y + -0.00049436744*nf1.z + -0.016887395*nf1.w + -0.007700884*g0.x + -0.006125995*g0.y + 0.0026072077*g0.z + 0.0050263735*g0.w + -0.0007808361*g1.x + -0.01214509*g1.y + -0.0124664875*g1.z + -0.0623571*g1.w + 0.0021798706*ng0.x + -0.00454209*ng0.y + -0.0033230642*ng0.z + -0.003633754*ng0.w + -0.028934926*ng1.x + 0.05962686*ng1.y + 0.0128101995*ng1.z + 0.0065336125*ng1.w + 0; + float p = -0.01706887*a0.x + -0.075055175*a0.y + 0.008531614*a0.z + 0.012812007*a0.w + 0.028967712*a1.x + 0.0006802233*a1.y + -0.023122001*a1.z + 0.004117588*a1.w + 0.0060033975*na0.x + 0.04573654*na0.y + -0.0014532027*na0.z + -0.01553144*na0.w + 0.00085815*na1.x + -0.0025215421*na1.y + 0.037993304*na1.z + 0.0043748533*na1.w + -0.016280308*b0.x + -0.026154146*b0.y + 0.011285019*b0.z + -0.010950448*b0.w + -0.008993951*b1.x + -0.008138363*b1.y + 0.0143283885*b1.z + 0.0032050752*b1.w + 0.019617861*nb0.x + 0.036108296*nb0.y + 0.0031697615*nb0.z + 0.013029574*nb0.w + 0.013052287*nb1.x + 0.010624071*nb1.y + -0.0058424054*nb1.z + -0.011529895*nb1.w + -0.029668175*c0.x + -0.0008865771*c0.y + -0.018089509*c0.z + 0.01629766*c0.w + 0.013346903*c1.x + -0.0066329846*c1.y + 0.00012357974*c1.z + 0.0067070923*c1.w + 0.015234514*nc0.x + 0.010311016*nc0.y + -0.0015783357*nc0.z + -0.004588889*nc0.w + -0.00804179*nc1.x + 0.0019117421*nc1.y + -0.004337227*nc1.z + 0.016801925*nc1.w + -0.029825747*d0.x + 0.0078127505*d0.y + -0.009640577*d0.z + -0.0048246942*d0.w + 0.04105915*d1.x + 0.0028164582*d1.y + 0.0062606526*d1.z + -0.0073074396*d1.w + 0.0031663615*nd0.x + -0.0033067295*nd0.y + 0.0003633346*nd0.z + 0.008120073*nd0.w + -0.013381999*nd1.x + -0.0029448275*nd1.y + 0.0016682927*nd1.z + 0.0017422357*nd1.w + -0.03133399*e0.x + -0.0026351928*e0.y + 0.009347191*e0.z + 0.009692576*e0.w + 0.028132373*e1.x + -0.034198917*e1.y + -0.009121166*e1.z + -0.0042066113*e1.w + 0.0018584005*ne0.x + 0.004562667*ne0.y + 0.0018780766*ne0.z + -0.0011617886*ne0.w + 0.014671292*ne1.x + -0.047582008*ne1.y + -0.011981096*ne1.z + 0.007301599*ne1.w + -0.009782136*f0.x + -0.009850503*f0.y + -0.01764285*f0.z + 0.0057299454*f0.w + -0.006322922*f1.x + -0.0014284349*f1.y + -0.01637028*f1.z + -0.016202927*f1.w + 0.010929147*nf0.x + 0.01483284*nf0.y + -0.005637644*nf0.z + 0.004375778*nf0.w + 0.014877084*nf1.x + -0.0085625835*nf1.y + 0.0009016836*nf1.z + 0.010949607*nf1.w + 0.019945359*g0.x + 0.012776777*g0.y + 9.388056e-05*g0.z + 0.011086543*g0.w + 0.0031442842*g1.x + -0.0007281356*g1.y + 0.014730445*g1.z + 0.023945043*g1.w + -0.010939084*ng0.x + -0.015295178*ng0.y + 0.007891041*ng0.z + 0.026746083*ng0.w + 0.032127682*ng1.x + -0.056322485*ng1.y + 0.0023893197*ng1.z + -0.0041469387*ng1.w + 0; + float q = 0.0052190213*a0.x + -0.036697973*a0.y + 0.0017909147*a0.z + 0.01471547*a0.w + -0.041808248*a1.x + -0.009302919*a1.y + -0.00012822033*a1.z + 0.02604467*a1.w + -0.0074887155*na0.x + 0.012221476*na0.y + -0.004066934*na0.z + -0.014296432*na0.w + 0.009378086*na1.x + 0.0050812257*na1.y + -0.00066634355*na1.z + -0.010221536*na1.w + 0.039825562*b0.x + -0.015009193*b0.y + -0.008390923*b0.z + -0.026432492*b0.w + -0.025902105*b1.x + 0.013141686*b1.y + 0.011074781*b1.z + -7.850445e-05*b1.w + -0.014900862*nb0.x + 0.0020929938*nb0.y + 0.004025759*nb0.z + 0.022637185*nb0.w + 0.018963696*nb1.x + 0.005365097*nb1.y + -0.021788068*nb1.z + -0.016199213*nb1.w + 0.006605639*c0.x + -0.00037750482*c0.y + -0.014114117*c0.z + 0.016580945*c0.w + 0.011849912*c1.x + -0.0010426794*c1.y + -0.009228553*c1.z + -0.0023927793*c1.w + 0.010821834*nc0.x + 0.0041750884*nc0.y + 0.042591974*nc0.z + -0.00041563442*nc0.w + -0.018251926*nc1.x + 0.004060685*nc1.y + 0.008161771*nc1.z + -0.056150824*nc1.w + -0.005963017*d0.x + -0.004477493*d0.y + 0.0053864145*d0.z + 0.015293112*d0.w + 0.018896958*d1.x + -0.01364045*d1.y + 0.006402596*d1.z + 0.005380181*d1.w + -0.005427749*nd0.x + -0.005545938*nd0.y + -0.010753802*nd0.z + -0.020330966*nd0.w + -0.020064725*nd1.x + 0.017465577*nd1.y + -0.009108494*nd1.z + -0.014758475*nd1.w + 0.008513857*e0.x + 0.0009961041*e0.y + -0.006098016*e0.z + -0.007048123*e0.w + 0.03902215*e1.x + 0.013202531*e1.y + 0.0114761675*e1.z + -0.0012895446*e1.w + 0.0055963704*ne0.x + 0.004024959*ne0.y + -0.013828568*ne0.z + -0.004390752*ne0.w + 0.0034489762*ne1.x + -0.0057895263*ne1.y + -0.0059244502*ne1.z + 0.0014182391*ne1.w + 0.0042083496*f0.x + -0.030192751*f0.y + 0.022458259*f0.z + -0.005110902*f0.w + 0.003181209*f1.x + -0.008455602*f1.y + 0.013294538*f1.z + 0.014039483*f1.w + -0.004838639*nf0.x + -0.017882824*nf0.y + 0.009125966*nf0.z + 0.00087110914*nf0.w + -0.014056271*nf1.x + -0.007067034*nf1.y + -0.0041026683*nf1.z + 0.0013140955*nf1.w + -0.012102768*g0.x + 0.009908834*g0.y + -0.00056007825*g0.z + -0.0019034665*g0.w + 0.0006154995*g1.x + 0.019641206*g1.y + -0.019597912*g1.z + -0.020133134*g1.w + 0.02620538*ng0.x + 0.0027179648*ng0.y + -0.0023573192*ng0.z + 0.015295984*ng0.w + -0.011871862*ng1.x + 0.036589906*ng1.y + -0.010942377*ng1.z + 0.013047896*ng1.w + 0; + float r = 0.0013240597*a0.x + -0.0525534*a0.y + 0.006428618*a0.z + 0.00910116*a0.w + 0.0010389212*a1.x + 0.004980833*a1.y + -0.0004343639*a1.z + 0.01391637*a1.w + 0.009297071*na0.x + 0.03547774*na0.y + -0.005122102*na0.z + -0.008212074*na0.w + -0.015846107*na1.x + 0.0007511969*na1.y + 0.028269917*na1.z + -0.0013784057*na1.w + 0.041298848*b0.x + -0.01730128*b0.y + 0.0015381973*b0.z + -0.022542015*b0.w + -0.023945393*b1.x + 0.020450871*b1.y + 0.010655135*b1.z + -0.0087027205*b1.w + -0.024145687*nb0.x + 0.0039176657*nb0.y + 0.0006878214*nb0.z + 0.01794849*nb0.w + 0.031762592*nb1.x + 0.0035054574*nb1.y + -0.01594689*nb1.z + 0.0011837251*nb1.w + 0.0010308131*c0.x + 0.008263548*c0.y + -0.0051403726*c0.z + 0.013458736*c0.w + 0.013812601*c1.x + -0.005903642*c1.y + 0.008680253*c1.z + -0.0020812678*c1.w + 0.00114809*nc0.x + 0.0038776158*nc0.y + 0.008751602*nc0.z + -0.007122077*nc0.w + -0.02483335*nc1.x + 0.009145055*nc1.y + 0.0054040407*nc1.z + -0.053735446*nc1.w + -0.005360682*d0.x + -0.011691867*d0.y + 0.01620561*d0.z + 0.012762638*d0.w + -0.011760973*d1.x + -0.004673657*d1.y + -0.0017164994*d1.z + 0.021724444*d1.w + 0.0031776167*nd0.x + -0.006484397*nd0.y + -0.00012294922*nd0.z + -0.009668074*nd0.w + 0.0004887767*nd1.x + -0.0038761701*nd1.y + 1.2165349e-05*nd1.z + 0.01420319*nd1.w + 0.046187103*e0.x + -0.010850962*e0.y + 0.012227887*e0.z + -0.0049160873*e0.w + -0.014404347*e1.x + 0.008824071*e1.y + 0.0033386408*e1.z + 0.0076736757*e1.w + -0.0011479551*ne0.x + -0.00048488253*ne0.y + -0.00629155*ne0.z + -0.0016700291*ne0.w + -0.01197633*ne1.x + 0.017074293*ne1.y + 0.0062331264*ne1.z + -0.007745917*ne1.w + -0.014362735*f0.x + 0.023914995*f0.y + -0.007672635*f0.z + 0.008481796*f0.w + -0.0016631298*f1.x + 0.0013799849*f1.y + -0.002389917*f1.z + -0.01502566*f1.w + 0.011418116*nf0.x + 0.0041276156*nf0.y + -0.01286134*nf0.z + -0.0044272356*nf0.w + -0.018952431*nf1.x + -0.012017917*nf1.y + -0.005450932*nf1.z + 0.024733933*nf1.w + 0.005573501*g0.x + 0.0032204753*g0.y + -0.0041492335*g0.z + -0.024271673*g0.w + -0.0014906545*g1.x + 0.007969394*g1.y + 0.009147742*g1.z + 0.060164053*g1.w + -0.01906351*ng0.x + 0.0139462*ng0.y + 0.01615183*ng0.z + -0.011862902*ng0.w + 0.006158882*ng1.x + -0.09076022*ng1.y + -0.0071068676*ng1.z + -0.0048810467*ng1.w + 0; + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL)-Conv-Reduce +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN80 +//!BIND LUMAN81 +//!BIND LUMAN90 +//!BIND LUMAN91 +//!BIND LUMAN100 +//!BIND LUMAN101 +//!BIND LUMAN110 +//!BIND LUMAN111 +//!BIND LUMAN120 +//!BIND LUMAN121 +//!BIND LUMAN130 +//!BIND LUMAN131 +//!BIND LUMAN0 +//!SAVE LUMAN0 + +vec4 hook() { + vec4 h0 = LUMAN80_tex(HOOKED_pos); + vec4 h1 = LUMAN81_tex(HOOKED_pos); + vec4 i0 = LUMAN90_tex(HOOKED_pos); + vec4 i1 = LUMAN91_tex(HOOKED_pos); + vec4 j0 = LUMAN100_tex(HOOKED_pos); + vec4 j1 = LUMAN101_tex(HOOKED_pos); + vec4 k0 = LUMAN110_tex(HOOKED_pos); + vec4 k1 = LUMAN111_tex(HOOKED_pos); + vec4 l0 = LUMAN120_tex(HOOKED_pos); + vec4 l1 = LUMAN121_tex(HOOKED_pos); + vec4 m0 = LUMAN130_tex(HOOKED_pos); + vec4 m1 = LUMAN131_tex(HOOKED_pos); + vec4 nh0 = -min(h0, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni0 = -min(i0, 0); + vec4 ni1 = -min(i1, 0); + vec4 nj0 = -min(j0, 0); + vec4 nj1 = -min(j1, 0); + vec4 nk0 = -min(k0, 0); + vec4 nk1 = -min(k1, 0); + vec4 nl0 = -min(l0, 0); + vec4 nl1 = -min(l1, 0); + vec4 nm0 = -min(m0, 0); + vec4 nm1 = -min(m1, 0); + h0 = max(h0, 0); + h1 = max(h1, 0); + i0 = max(i0, 0); + i1 = max(i1, 0); + j0 = max(j0, 0); + j1 = max(j1, 0); + k0 = max(k0, 0); + k1 = max(k1, 0); + l0 = max(l0, 0); + l1 = max(l1, 0); + m0 = max(m0, 0); + m1 = max(m1, 0); + float o = LUMAN0_tex(HOOKED_pos).x + 0.028154768*h0.x + 0.007275039*h0.y + -0.0011438587*h0.z + -0.01108197*h0.w + -0.012890547*h1.x + -0.005964137*h1.y + -0.033666026*h1.z + 0.0054421173*h1.w + 0.0061498084*nh0.x + -0.013902076*nh0.y + 0.0029887478*nh0.z + -0.012798732*nh0.w + 0.0060229595*nh1.x + 0.0096300915*nh1.y + 0.035797298*nh1.z + -0.017965809*nh1.w + 0.013986207*i0.x + 0.029799053*i0.y + -0.015183565*i0.z + -0.0057988837*i0.w + -0.033958167*i1.x + -0.0038495238*i1.y + 0.0013773177*i1.z + 0.005184489*i1.w + 0.004508269*ni0.x + -0.002570269*ni0.y + -0.005609264*ni0.z + -0.0038743338*ni0.w + 0.004259348*ni1.x + 0.025667783*ni1.y + 0.015699951*ni1.z + -0.0020644297*ni1.w + 0.019116893*j0.x + 0.0103256805*j0.y + -0.0028200424*j0.z + -0.017563418*j0.w + 0.00054795604*j1.x + 0.008192331*j1.y + 0.003817345*j1.z + -0.021149283*j1.w + -0.0016317961*nj0.x + -0.007806229*nj0.y + 0.0077856313*nj0.z + 0.009038461*nj0.w + 0.0020147602*nj1.x + -0.04748933*nj1.y + -0.029999552*nj1.z + 0.00014385732*nj1.w + 0.004639102*k0.x + 0.009241958*k0.y + -0.016433537*k0.z + 0.00046911353*k0.w + 0.016455498*k1.x + 0.0110299755*k1.y + -0.019485874*k1.z + 0.07030569*k1.w + -0.011915996*nk0.x + -0.023589713*nk0.y + 0.040155042*nk0.z + -0.0030840805*nk0.w + 0.010477874*nk1.x + -0.0053069443*nk1.y + 0.0077385874*nk1.z + -0.00829554*nk1.w + -0.02349797*l0.x + 0.059402034*l0.y + -0.026031276*l0.z + -0.06829119*l0.w + -0.08079901*l1.x + 0.11198863*l1.y + -0.009373267*l1.z + 0.0047806143*l1.w + -0.0113643855*nl0.x + -0.042793855*nl0.y + -0.037593715*nl0.z + 0.011087656*nl0.w + 0.044267964*nl1.x + -0.010039046*nl1.y + 0.11555328*nl1.z + -0.05401579*nl1.w + 0.014701331*m0.x + -0.010931888*m0.y + 0.0013618327*m0.z + -0.01511776*m0.w + 0.07922733*m1.x + 0.14759564*m1.y + 0.05550517*m1.z + -0.014685158*m1.w + 0.022788275*nm0.x + -0.05691751*nm0.y + -0.037949562*nm0.z + -0.042652573*nm0.w + -0.081433505*nm1.x + -0.080078565*nm1.y + 0.027400292*nm1.z + 0.016504942*nm1.w + -0.008307824; + float p = LUMAN0_tex(HOOKED_pos).y + -0.012476344*h0.x + 0.00041778514*h0.y + -0.00029403862*h0.z + -0.0077522174*h0.w + -0.0007013094*h1.x + 0.009287548*h1.y + -0.0007466532*h1.z + -0.0008275674*h1.w + -0.00413496*nh0.x + 0.008134882*nh0.y + 0.02905413*nh0.z + 0.00022237566*nh0.w + -0.00015811919*nh1.x + -0.012663603*nh1.y + -0.0025063844*nh1.z + 0.005934334*nh1.w + -0.013793359*i0.x + -0.0030275956*i0.y + 0.002632738*i0.z + 0.00050856353*i0.w + 0.0070112064*i1.x + -0.0011123072*i1.y + 0.0027596478*i1.z + -0.0071405345*i1.w + -0.020791892*ni0.x + -0.012057223*ni0.y + 0.015629247*ni0.z + -0.005353237*ni0.w + 0.025932*ni1.x + -0.017513938*ni1.y + -0.0010464039*ni1.z + -0.0048822653*ni1.w + -0.0022303013*j0.x + 0.000109548884*j0.y + -0.0013899812*j0.z + -0.04997202*j0.w + 0.0039844727*j1.x + -0.012894859*j1.y + 0.019041412*j1.z + 0.008987427*j1.w + 0.002459809*nj0.x + 0.004196275*nj0.y + -0.012779132*nj0.z + 0.017411614*nj0.w + -0.00580461*nj1.x + -0.025579158*nj1.y + -0.017933184*nj1.z + 0.0084173465*nj1.w + 0.006441807*k0.x + -0.032203905*k0.y + -0.003269837*k0.z + -0.001531181*k0.w + 0.0078064846*k1.x + 0.004411259*k1.y + -0.010174944*k1.z + -0.024659745*k1.w + 0.002657509*nk0.x + -0.018960288*nk0.y + -0.002639977*nk0.z + 0.009598693*nk0.w + -0.010886198*nk1.x + -0.0015291816*nk1.y + 0.03410781*nk1.z + 0.008700974*nk1.w + 0.06478203*l0.x + -0.06352816*l0.y + 0.04763686*l0.z + -0.04645173*l0.w + -0.052127838*l1.x + -0.09600151*l1.y + 0.030204717*l1.z + 0.014505796*l1.w + -0.031888958*nl0.x + 0.09702901*nl0.y + 0.052713342*nl0.z + 0.03720871*nl0.w + -0.05015491*nl1.x + -0.012215867*nl1.y + -0.1489265*nl1.z + 0.0023754374*nl1.w + 0.0077991346*m0.x + 0.012234416*m0.y + -0.0009354508*m0.z + 0.0405293*m0.w + -0.049991522*m1.x + -0.011354246*m1.y + -0.033561453*m1.z + 0.023130419*m1.w + -0.03268312*nm0.x + -0.089838445*nm0.y + 0.039729614*nm0.z + 0.020857763*nm0.w + 0.08058377*nm1.x + 0.06261047*nm1.y + -0.044904366*nm1.z + -0.026322749*nm1.w + 0.00936794; + float q = LUMAN0_tex(HOOKED_pos).z + 0.017680038*h0.x + -0.0034014038*h0.y + 0.01325279*h0.z + 0.0066159996*h0.w + -0.009820397*h1.x + -0.009590288*h1.y + -0.0322843*h1.z + 0.0068037184*h1.w + -0.0025545594*nh0.x + -0.013663908*nh0.y + -0.04636907*nh0.z + -0.0011485704*nh0.w + 0.0030269555*nh1.x + 0.013646466*nh1.y + 0.008233854*nh1.z + -0.011760669*nh1.w + -0.020044338*i0.x + -0.017884787*i0.y + 0.0072006527*i0.z + -0.0116206575*i0.w + -0.0336928*i1.x + 0.005347091*i1.y + -0.001439835*i1.z + 0.007912345*i1.w + -0.005165678*ni0.x + -0.008851315*ni0.y + -0.01672471*ni0.z + 0.013330815*ni0.w + -0.0051708966*ni1.x + 0.010595262*ni1.y + -0.005110261*ni1.z + 0.010210765*ni1.w + 0.011963133*j0.x + 0.0015569422*j0.y + -0.00841955*j0.z + 0.022908317*j0.w + 0.0025614926*j1.x + -0.0052343216*j1.y + -0.0028602132*j1.z + 0.027029965*j1.w + -0.004171911*nj0.x + 0.003010245*nj0.y + 0.017087264*nj0.z + 0.0077778804*nj0.w + 0.0035978484*nj1.x + 0.032972984*nj1.y + 0.03604963*nj1.z + 0.0063191843*nj1.w + 0.0007370549*k0.x + -0.0026937914*k0.y + -0.006648801*k0.z + -0.050264988*k0.w + -0.0061267707*k1.x + -0.012902248*k1.y + 0.0009312556*k1.z + 0.027272638*k1.w + 0.0013918153*nk0.x + 0.0058321236*nk0.y + -0.006040759*nk0.z + 0.008355389*nk0.w + 0.00022524416*nk1.x + 0.0027963892*nk1.y + -0.0030116662*nk1.z + -0.008229986*nk1.w + -0.0019475389*l0.x + 0.004617108*l0.y + -0.007019104*l0.z + 0.050343942*l0.w + 0.07296967*l1.x + -0.011251547*l1.y + -0.0040626405*l1.z + -0.024047323*l1.w + 0.011267885*nl0.x + -0.10441765*nl0.y + -0.0043937173*nl0.z + 0.008439476*nl0.w + 0.0025544306*nl1.x + -0.0032398677*nl1.y + -0.014886633*nl1.z + 0.043766428*nl1.w + -0.06277456*m0.x + -0.0068775853*m0.y + -0.014073247*m0.z + 0.004322255*m0.w + -0.027019642*m1.x + -0.06935587*m1.y + -0.026514858*m1.z + -0.0027431983*m1.w + 0.02159222*nm0.x + 0.073561415*nm0.y + 0.058740135*nm0.z + -0.07203826*nm0.w + 0.008394*nm1.x + 0.007160604*nm1.y + 0.08396549*nm1.z + 0.0017666898*nm1.w + -0.0024531493; + float r = LUMAN0_tex(HOOKED_pos).w + -0.0012055013*h0.x + -0.003244798*h0.y + -0.004156939*h0.z + 0.0036389115*h0.w + 0.011253503*h1.x + -0.0013670821*h1.y + 0.034176*h1.z + -0.006571377*h1.w + 0.0036972067*nh0.x + 0.0053830254*nh0.y + 0.009262475*nh0.z + 0.005158738*nh0.w + -0.008013784*nh1.x + -0.0076279696*nh1.y + 0.01711645*nh1.z + 0.019142881*nh1.w + 0.013530348*i0.x + 0.0018440787*i0.y + -0.0063714003*i0.z + 0.0054069734*i0.w + 0.021637455*i1.x + 0.009726929*i1.y + 0.0011075968*i1.z + -0.018555546*i1.w + 0.010254738*ni0.x + -0.0006528478*ni0.y + 0.009930713*ni0.z + -0.0083744675*ni0.w + -0.0050841644*ni1.x + -0.010749009*ni1.y + -0.0081318915*ni1.z + -0.0018240416*ni1.w + -0.030332126*j0.x + -0.019219792*j0.y + 0.0039786496*j0.z + 0.009644819*j0.w + 0.0021590926*j1.x + -0.006202845*j1.y + -0.0093941*j1.z + -0.014618773*j1.w + -0.008474345*nj0.x + -0.0011716061*nj0.y + 0.00015310342*nj0.z + 0.00025029443*nj0.w + -0.006576327*nj1.x + 0.014994276*nj1.y + 0.01885804*nj1.z + -0.004539383*nj1.w + -0.011680012*k0.x + -0.0060392558*k0.y + 0.015494828*k0.z + 0.030411074*k0.w + -0.010484663*k1.x + -0.009604161*k1.y + -0.006873529*k1.z + -0.04552321*k1.w + 0.0061431173*nk0.x + 0.013219503*nk0.y + -0.01225356*nk0.z + 0.004476564*nk0.w + -0.0052758437*nk1.x + 0.00041394064*nk1.y + 0.020661544*nk1.z + 0.00819726*nk1.w + -0.004361188*l0.x + 0.046293*l0.y + -0.048474595*l0.z + 0.00014330888*l0.w + 0.068526275*l1.x + 0.025298426*l1.y + 0.033734288*l1.z + 0.014304559*l1.w + 0.02355298*nl0.x + 0.010139359*nl0.y + 0.040561803*nl0.z + 0.004230508*nl0.w + 0.0065057282*nl1.x + 0.020425687*nl1.y + 0.0160124*nl1.z + 0.012846417*nl1.w + 0.03170583*m0.x + -0.02589775*m0.y + 0.042881653*m0.z + -0.046655137*m0.w + 0.01694526*m1.x + -0.0362362*m1.y + -0.0042416737*m1.z + -0.005048726*m1.w + -0.0019929754*nm0.x + 0.0995872*nm0.y + -0.087547004*nm0.z + 0.11017462*nm0.w + -0.021728791*nm1.x + -0.02597225*nm1.y + -0.061021034*nm1.z + 0.0066313753*nm1.w + -0.0059383432; + return vec4(o, p, q, r); +} + +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN0 +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!DESC Anime4K-v3.1-Upscale(x2)-CNN(UL) + +vec4 hook() { + vec2 f = fract(LUMAN0_pos * LUMAN0_size); + ivec2 i = ivec2(f * vec2(2)); + float c = LUMAN0_tex((vec2(0.5) - f) * LUMAN0_pt + LUMAN0_pos)[i.y * 2 + i.x]; + return vec4(c + HOOKED_tex(HOOKED_pos).x, HOOKED_tex(HOOKED_pos).yz, 0); +} + diff --git a/.config/mpv/shaders/Anime4K_Upscale_CNN_UL_x2_Deblur.glsl b/.config/mpv/shaders/Anime4K_Upscale_CNN_UL_x2_Deblur.glsl new file mode 100644 index 0000000..5b2513f --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_CNN_UL_x2_Deblur.glsl @@ -0,0 +1,4077 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x1 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!SAVE LUMAN00 + +vec4 hook() { + vec2 dp = HOOKED_pt; + float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x; + float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x; + float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x; + float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x; + float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x; + float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x; + float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x; + float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x; + float s = 0.4227713*a + 0.65122205*b + -0.5894138*c + 0.12043042*d + 0.0069211754*e + -0.39494568*f + -0.099531725*g + -0.19280484*h + 0.0692256*i + 0.0059006587; + float t = 0.56819385*a + -0.3877415*b + -0.55708647*c + -0.3175206*d + -0.3950954*e + 0.3758771*f + -0.5951176*g + 0.43890274*h + 0.69218725*i + -0.018986855; + float u = 0.78672326*a + -0.50350785*b + -0.07692569*c + -0.7258339*d + 0.5834824*e + -0.067126095*f + -0.07342367*g + -0.029570417*h + 0.10244534*i + -0.00014415548; + float v = -0.32709953*a + 0.05759759*b + 0.15932003*c + 0.19741072*d + 0.471859*e + -0.10562332*f + -0.39081043*g + -0.6708356*h + -0.035092503*i + -0.0720328; + return vec4(s, t, u, v); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x1 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!SAVE LUMAN01 + +vec4 hook() { + vec2 dp = HOOKED_pt; + float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x; + float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x; + float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x; + float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x; + float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x; + float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x; + float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x; + float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x; + float s = 0.14976382*a + -0.339064*b + 0.41322896*c + -0.56487453*d + -0.2509627*e + 0.19731471*f + 0.43869543*g + -0.09666573*h + -0.00792537*i + 0.06936363; + float t = 0.10662149*a + -0.30642352*b + 0.3910136*c + -0.24240156*d + 0.4359778*e + -0.036186576*f + -0.016642952*g + -0.31993437*h + 0.3249198*i + 0.010320611; + float u = 0.07377618*a + 0.5356365*b + -0.27441797*c + 0.13227409*d + -0.60764945*e + 0.28083587*f + 0.18271726*g + -0.9480309*h + 0.6223682*i + 0.015635386; + float v = -0.43209586*a + 0.6188276*b + 0.27700275*c + -0.3111068*d + -0.22504452*e + 0.3990561*f + 0.11323281*g + -0.38872832*h + -0.110977426*i + 0.09095626; + return vec4(s, t, u, v); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN00 +//!BIND LUMAN01 +//!SAVE LUMAN10 + +#define L0_tex LUMAN00_tex +#define L1_tex LUMAN01_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.16713218*a0.x + -0.22038573*b0.x + -0.13005029*c0.x + 0.35234368*d0.x + -0.24986069*e0.x + -0.03652803*f0.x + -0.0035137152*g0.x + -0.13065901*h0.x + 0.050993465*i0.x; + float j = -0.15454529*a0.y + -0.18509507*b0.y + -0.070899874*c0.y + -0.055521097*d0.y + -0.08797286*e0.y + 0.017017594*f0.y + -0.07720207*g0.y + 0.030161398*h0.y + 0.07854566*i0.y; + float k = -0.069296815*a0.z + 0.034658875*b0.z + 0.06815528*c0.z + 0.07031576*d0.z + 0.074399784*e0.z + -0.030513955*f0.z + 0.15191276*g0.z + 0.17954811*h0.z + 0.083867356*i0.z; + float l = -0.2704385*a0.w + -0.143406*b0.w + -0.1905286*c0.w + 0.2303636*d0.w + -0.18995604*e0.w + -0.22714588*f0.w + 0.001024007*g0.w + 0.074870616*h0.w + 0.023121383*i0.w; + float m = 0.0139397*a1.x + -0.22468825*b1.x + -0.19181927*c1.x + -0.18277143*d1.x + 0.14706787*e1.x + 0.19927207*f1.x + 0.13652366*g1.x + 0.06386827*h1.x + 0.00095346326*i1.x; + float n = 0.14147504*a1.y + -0.14072193*b1.y + 0.1730557*c1.y + -0.002492399*d1.y + -0.55425644*e1.y + -0.19250399*f1.y + -0.20097452*g1.y + -0.29845634*h1.y + -0.094047815*i1.y; + float o = 0.11046322*a1.z + -0.09760678*b1.z + -0.18652314*c1.z + 0.108983986*d1.z + 0.18999153*e1.z + -0.02505891*f1.z + 0.029467393*g1.z + 0.049988672*h1.z + -0.089773245*i1.z; + float p = 0.18450986*a1.w + 0.109294355*b1.w + -0.112934336*c1.w + 0.047062654*d1.w + -0.04816292*e1.w + 0.13094686*f1.w + -0.0065878364*g1.w + 0.08924863*h1.w + 0.11312074*i1.w; + float q = -0.12602906*na0.x + 0.37861553*nb0.x + 0.074422106*nc0.x + -0.3033126*nd0.x + -0.028096324*ne0.x + 0.050496474*nf0.x + 0.2239116*ng0.x + 0.1933884*nh0.x + -0.025817746*ni0.x; + float r = 0.17847398*na0.y + 0.15596001*nb0.y + 0.09058693*nc0.y + 0.088395216*nd0.y + 0.05719792*ne0.y + -0.050784174*nf0.y + 0.04196272*ng0.y + -0.020845385*nh0.y + -0.0832895*ni0.y; + float s = -0.24801292*na0.z + -0.37903556*nb0.z + -0.06962685*nc0.z + -0.194872*nd0.z + -0.13542567*ne0.z + -0.047440834*nf0.z + -0.20618482*ng0.z + 0.036017656*nh0.z + -0.083059475*ni0.z; + float t = -0.050698828*na0.w + 0.076336786*nb0.w + 0.18337938*nc0.w + 0.067153335*nd0.w + 0.2950129*ne0.w + 0.015040506*nf0.w + -0.04881478*ng0.w + -0.06797305*nh0.w + 0.06590701*ni0.w; + float u = -0.03218409*na1.x + 0.25265154*nb1.x + 0.24500562*nc1.x + 0.25738174*nd1.x + -0.21151006*ne1.x + -0.30471176*nf1.x + -0.06567392*ng1.x + -0.13929898*nh1.x + -0.05080991*ni1.x; + float v = -0.22504985*na1.y + -0.030114856*nb1.y + -0.14878646*nc1.y + 0.076497145*nd1.y + 0.8536939*ne1.y + 0.11066291*nf1.y + 0.25284055*ng1.y + 0.3632721*nh1.y + 0.18241458*ni1.y; + float w = 0.18823417*na1.z + 0.122003764*nb1.z + 0.1791294*nc1.z + 0.0069658747*nd1.z + -0.18533462*ne1.z + 0.06976361*nf1.z + -0.07724821*ng1.z + -0.02718515*nh1.z + 1.7301045e-05*ni1.z; + float x = -0.12598836*na1.w + -0.1243634*nb1.w + 0.0985588*nc1.w + -0.06536376*nd1.w + 0.08385393*ne1.w + -0.09142982*nf1.w + -0.03531486*ng1.w + -0.038505223*nh1.w + -0.13392809*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.080690674; + i = -0.01283581*a0.x + -0.018502438*b0.x + -0.02645647*c0.x + 0.42137372*d0.x + -0.31610605*e0.x + 0.1444233*f0.x + 0.0064831083*g0.x + -0.34260628*h0.x + -0.21241646*i0.x; + j = 0.08500891*a0.y + -0.02485644*b0.y + -0.097824536*c0.y + -0.15899487*d0.y + -0.005132324*e0.y + 0.07605907*f0.y + -0.119112104*g0.y + -0.05230375*h0.y + 0.15778321*i0.y; + k = -0.045043983*a0.z + 0.22099558*b0.z + 0.09173644*c0.z + -0.14121144*d0.z + -0.3364683*e0.z + 0.6992921*f0.z + 0.1879735*g0.z + 0.43442908*h0.z + 0.2507738*i0.z; + l = 0.014832014*a0.w + -0.3057155*b0.w + -0.26674822*c0.w + 0.65893346*d0.w + 0.13837902*e0.w + 0.26448116*f0.w + 0.01925406*g0.w + 0.24712183*h0.w + 0.11824173*i0.w; + m = -0.17148696*a1.x + -0.034435242*b1.x + -0.16856827*c1.x + 0.24088557*d1.x + 0.27181336*e1.x + 0.35544765*f1.x + -0.0637484*g1.x + 0.1394016*h1.x + 0.07805505*i1.x; + n = -0.036200132*a1.y + -0.32828653*b1.y + -0.12464492*c1.y + 0.07681443*d1.y + -0.31755948*e1.y + -0.16249253*f1.y + 0.1459527*g1.y + -0.055870246*h1.y + -0.2188885*i1.y; + o = -0.10257012*a1.z + 0.1738694*b1.z + 0.011674502*c1.z + 0.014357164*d1.z + 0.05336581*e1.z + -0.10754941*f1.z + 0.0053562997*g1.z + -0.20323943*h1.z + -0.044117864*i1.z; + p = -0.00781972*a1.w + 0.2752947*b1.w + 0.07748963*c1.w + 0.0701277*d1.w + -0.1437367*e1.w + 0.27562895*f1.w + -0.09910902*g1.w + 0.10083873*h1.w + -0.12653753*i1.w; + q = -0.0744636*na0.x + 0.030761313*nb0.x + 0.17157815*nc0.x + -0.27698746*nd0.x + 0.20659466*ne0.x + -0.12475179*nf0.x + 0.097487606*ng0.x + 0.47216818*nh0.x + 0.18254276*ni0.x; + r = -0.17130595*na0.y + 0.08279622*nb0.y + 0.1008618*nc0.y + 0.10624062*nd0.y + 0.09339325*ne0.y + -0.12885687*nf0.y + 0.10866262*ng0.y + 0.015784606*nh0.y + -0.156208*ni0.y; + s = 0.13901633*na0.z + -0.19871095*nb0.z + -0.1233926*nc0.z + 0.22571099*nd0.z + 0.5192358*ne0.z + -0.006695737*nf0.z + -0.23417531*ng0.z + -0.53020126*nh0.z + 0.0348989*ni0.z; + t = 0.019743124*na0.w + 0.113042444*nb0.w + 0.044767845*nc0.w + -0.12496372*nd0.w + 0.7285443*ne0.w + 0.075844646*nf0.w + 0.003659028*ng0.w + -0.081003755*nh0.w + -0.1571919*ni0.w; + u = 0.17188495*na1.x + 0.15267436*nb1.x + 0.12122173*nc1.x + -0.17361204*nd1.x + -0.35425422*ne1.x + -0.30314827*nf1.x + 0.112297654*ng1.x + -0.19984588*nh1.x + -0.17648791*ni1.x; + v = 0.064333946*na1.y + 0.2798676*nb1.y + 0.029879512*nc1.y + -0.44719884*nd1.y + 0.37984368*ne1.y + 0.24928248*nf1.y + -0.26490667*ng1.y + -0.042627275*nh1.y + 0.34140655*ni1.y; + w = 0.13693564*na1.z + -0.014451857*nb1.z + -0.13929443*nc1.z + 0.09930806*nd1.z + -0.0018792403*ne1.z + 0.14395392*nf1.z + 0.013773326*ng1.z + 0.28621295*nh1.z + 0.12418545*ni1.z; + x = -0.07243978*na1.w + -0.20915549*nb1.w + -0.1439757*nc1.w + -0.030371284*nd1.w + 0.066944584*ne1.w + -0.19054636*nf1.w + 0.11164318*ng1.w + 0.013230124*nh1.w + 0.12154718*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.13904701; + i = 0.08556065*a0.x + -0.06385027*b0.x + 0.08451666*c0.x + -0.16397515*d0.x + -0.12554236*e0.x + 0.51485914*f0.x + -0.3609132*g0.x + 0.22237258*h0.x + -0.14084372*i0.x; + j = -0.29552463*a0.y + -0.07839635*b0.y + 0.023714216*c0.y + -0.39852586*d0.y + -0.0037621707*e0.y + 0.12410286*f0.y + 0.28074482*g0.y + 0.19966023*h0.y + -0.1299575*i0.y; + k = -0.018056538*a0.z + -0.29889175*b0.z + 0.12264207*c0.z + 0.399607*d0.z + -0.08105918*e0.z + -0.006207723*f0.z + 0.19156073*g0.z + -0.4190811*h0.z + 0.41379926*i0.z; + l = 0.25313407*a0.w + 0.2056271*b0.w + 0.1281935*c0.w + -0.4088654*d0.w + -0.75592035*e0.w + 0.677332*f0.w + -0.17531727*g0.w + -0.09792362*h0.w + 0.38767898*i0.w; + m = 0.32970557*a1.x + 0.03836402*b1.x + -0.08182981*c1.x + 0.23050149*d1.x + 0.2949245*e1.x + -0.031266343*f1.x + 0.011828161*g1.x + 0.18952376*h1.x + -0.08358268*i1.x; + n = 0.03825189*a1.y + 0.34718156*b1.y + 0.27608556*c1.y + -0.11617564*d1.y + -0.66690236*e1.y + 0.36254305*f1.y + -0.5285547*g1.y + 0.108788565*h1.y + -0.23637791*i1.y; + o = 0.29810092*a1.z + -0.18387158*b1.z + -0.082416594*c1.z + -0.34253722*d1.z + 0.0759425*e1.z + -0.060609326*f1.z + -0.043806862*g1.z + 0.1224182*h1.z + 0.28538787*i1.z; + p = -0.1166321*a1.w + -0.14290577*b1.w + -0.088152096*c1.w + 0.13844585*d1.w + 0.37557498*e1.w + 0.2985052*f1.w + 0.47108272*g1.w + -0.3133265*h1.w + 0.2837646*i1.w; + q = -0.08935695*na0.x + -0.011969543*nb0.x + 0.11739229*nc0.x + 0.22418295*nd0.x + 0.51131123*ne0.x + 0.06826982*nf0.x + 0.06986366*ng0.x + -0.13083175*nh0.x + -0.0384642*ni0.x; + r = 0.32759568*na0.y + 0.058782384*nb0.y + -0.097732335*nc0.y + 0.51180387*nd0.y + -0.062388137*ne0.y + -0.036372434*nf0.y + -0.28633046*ng0.y + -0.18776499*nh0.y + 0.13661087*ni0.y; + s = -0.090851374*na0.z + 0.42352006*nb0.z + 0.39775237*nc0.z + -0.5250993*nd0.z + -0.28369164*ne0.z + 0.56977206*nf0.z + -0.32605034*ng0.z + -0.3297984*nh0.z + -0.9174496*ni0.z; + t = -0.20263617*na0.w + 0.014055401*nb0.w + -0.015539904*nc0.w + -0.0056373915*nd0.w + 0.46529755*ne0.w + 0.20198935*nf0.w + 0.10306982*ng0.w + -0.1603279*nh0.w + -0.09719618*ni0.w; + u = -0.37491882*na1.x + 0.0065687397*nb1.x + -0.075094976*nc1.x + -0.2910323*nd1.x + -0.31070456*ne1.x + -0.3181396*nf1.x + -0.2874679*ng1.x + -0.05630924*nh1.x + -0.08283336*ni1.x; + v = 0.22579186*na1.y + -0.008379712*nb1.y + -0.13981205*nc1.y + 0.4876711*nd1.y + 0.75476116*ne1.y + -0.3979911*nf1.y + 0.17194936*ng1.y + 0.063620836*nh1.y + -0.2838596*ni1.y; + w = -0.59080386*na1.z + 0.10265678*nb1.z + 0.44757754*nc1.z + 0.118315265*nd1.z + -0.17929387*ne1.z + 0.53549635*nf1.z + -0.16386764*ng1.z + -0.18721534*nh1.z + -0.07925579*ni1.z; + x = 0.12679473*na1.w + 0.09201327*nb1.w + 0.11743293*nc1.w + -0.089954264*nd1.w + 0.025260787*ne1.w + -0.29346317*nf1.w + -0.40280733*ng1.w + 0.3339367*nh1.w + -0.2733761*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.18129607; + i = -0.17462935*a0.x + 0.08743981*b0.x + 0.116527654*c0.x + -0.11788807*d0.x + 0.345168*e0.x + 0.12373737*f0.x + 0.061705504*g0.x + -0.03186453*h0.x + -0.14678453*i0.x; + j = 0.3424341*a0.y + 0.18152006*b0.y + 0.10626323*c0.y + 0.080005355*d0.y + 0.27044943*e0.y + -0.05666261*f0.y + 0.08009715*g0.y + -0.038603935*h0.y + 0.1343475*i0.y; + k = -0.076163*a0.z + -0.10620224*b0.z + 0.0471776*c0.z + -0.18697739*d0.z + 0.81948966*e0.z + 0.104977295*f0.z + -0.049898446*g0.z + 0.030969273*h0.z + -0.24446999*i0.z; + l = 0.11316597*a0.w + -0.72845197*b0.w + 0.14612307*c0.w + -0.05467936*d0.w + 0.33790386*e0.w + 0.47690153*f0.w + 0.03290898*g0.w + 0.18591514*h0.w + 0.086933084*i0.w; + m = 0.024091808*a1.x + 0.21152216*b1.x + 0.10427507*c1.x + 0.12340303*d1.x + 0.30569288*e1.x + -0.10540736*f1.x + 0.21034092*g1.x + 0.0078070415*h1.x + -0.15554547*i1.x; + n = -0.30977434*a1.y + -0.12402293*b1.y + 0.06854388*c1.y + -0.059533276*d1.y + 0.29335344*e1.y + 0.06032923*f1.y + 0.10502131*g1.y + 0.0025917962*h1.y + 0.011287433*i1.y; + o = 0.21300381*a1.z + 0.13182314*b1.z + -0.1794802*c1.z + 0.041218325*d1.z + -0.084293015*e1.z + -0.07785635*f1.z + 0.005804347*g1.z + -0.090246014*h1.z + -0.07069001*i1.z; + p = -0.0090839965*a1.w + 0.13686492*b1.w + 0.1999011*c1.w + -0.18534096*d1.w + -0.03643351*e1.w + 0.3022044*f1.w + 0.020653404*g1.w + -0.053792052*h1.w + 0.08029478*i1.w; + q = 0.09313165*na0.x + -0.20987953*nb0.x + -0.13642266*nc0.x + 0.01774858*nd0.x + -0.32583392*ne0.x + -0.10607029*nf0.x + 0.062344737*ng0.x + 0.22812237*nh0.x + 0.018149327*ni0.x; + r = -0.4551336*na0.y + -0.18321747*nb0.y + -0.10392498*nc0.y + -0.11381515*nd0.y + -0.27942544*ne0.y + 0.107884325*nf0.y + -0.083248846*ng0.y + 0.014200544*nh0.y + -0.08907091*ni0.y; + s = 0.120486066*na0.z + 0.16473046*nb0.z + -0.028575819*nc0.z + 0.17433837*nd0.z + -0.4197916*ne0.z + -0.24925393*nf0.z + 0.013189131*ng0.z + 0.039529253*nh0.z + 0.2124912*ni0.z; + t = -0.042864945*na0.w + 0.514165*nb0.w + -0.16705744*nc0.w + 0.26858032*nd0.w + 0.025890924*ne0.w + -0.12886028*nf0.w + -0.0093325935*ng0.w + 0.036776513*nh0.w + -0.06780495*ni0.w; + u = -0.09991671*na1.x + -0.24013445*nb1.x + -0.043176726*nc1.x + -0.06255361*nd1.x + -0.43966636*ne1.x + 0.03481608*nf1.x + -0.1976385*ng1.x + 0.025012735*nh1.x + 0.12251629*ni1.x; + v = 0.03532957*na1.y + -0.12534937*nb1.y + -0.111054376*nc1.y + -0.32459697*nd1.y + -0.036310744*ne1.y + 0.10149172*nf1.y + 0.04345607*ng1.y + -0.1690419*nh1.y + 0.15201193*ni1.y; + w = 0.0020700989*na1.z + 0.018126104*nb1.z + 0.1968919*nc1.z + -0.033329114*nd1.z + 0.20545799*ne1.z + 0.025382748*nf1.z + 0.11418677*ng1.z + 0.13705094*nh1.z + 0.012681161*ni1.z; + x = -0.14087495*na1.w + -0.072729364*nb1.w + -0.24772419*nc1.w + 0.17076711*nd1.w + -0.021828393*ne1.w + -0.10543231*nf1.w + 0.014692333*ng1.w + 0.031828444*nh1.w + -0.14082411*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.10608039; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN00 +//!BIND LUMAN01 +//!SAVE LUMAN11 + +#define L0_tex LUMAN00_tex +#define L1_tex LUMAN01_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.08251482*a0.x + 0.29106933*b0.x + 0.059387296*c0.x + 0.37380347*d0.x + -0.21551596*e0.x + -0.050368074*f0.x + 0.06634412*g0.x + -0.3150945*h0.x + -0.14561915*i0.x; + float j = 0.1698925*a0.y + -0.059246074*b0.y + 0.08630799*c0.y + 0.02389207*d0.y + 0.03793831*e0.y + -0.0582392*f0.y + -0.03397385*g0.y + -0.24723254*h0.y + 0.21064827*i0.y; + float k = -0.21669565*a0.z + -0.19199888*b0.z + -0.24721447*c0.z + -0.7302215*d0.z + -0.4305342*e0.z + -0.1251449*f0.z + -0.07891673*g0.z + 0.36592582*h0.z + 0.25768483*i0.z; + float l = 0.4126826*a0.w + 0.20862694*b0.w + 0.5041565*c0.w + -0.24220178*d0.w + -0.32580248*e0.w + 0.0035771998*f0.w + 0.19374675*g0.w + 0.050378945*h0.w + -0.12696394*i0.w; + float m = -0.140747*a1.x + -0.097618654*b1.x + -0.42250344*c1.x + 0.1810929*d1.x + -0.114540584*e1.x + -0.06470164*f1.x + 0.025054755*g1.x + 0.1210664*h1.x + -0.06487856*i1.x; + float n = 0.044984564*a1.y + -0.09150712*b1.y + 0.03883413*c1.y + 0.2700107*d1.y + -0.1924873*e1.y + -0.016006626*f1.y + 0.1937291*g1.y + -0.14800532*h1.y + -0.06977464*i1.y; + float o = 0.028001428*a1.z + 0.38993812*b1.z + -0.24332824*c1.z + 0.03010299*d1.z + 0.55186975*e1.z + 0.04203979*f1.z + -0.06724078*g1.z + -0.30162588*h1.z + -0.18771334*i1.z; + float p = -0.17779396*a1.w + 0.14025119*b1.w + 0.39543924*c1.w + -0.11448653*d1.w + 0.3944919*e1.w + 0.5594662*f1.w + 0.22536032*g1.w + 0.09355939*h1.w + -0.05477075*i1.w; + float q = -0.05063325*na0.x + -0.19487661*nb0.x + -0.0486381*nc0.x + -0.4099135*nd0.x + 0.15758072*ne0.x + -0.14006934*nf0.x + 0.016247243*ng0.x + 0.21706717*nh0.x + 0.1730037*ni0.x; + float r = -0.18323535*na0.y + 0.116462864*nb0.y + -0.08039124*nc0.y + -0.06274208*nd0.y + 0.053934556*ne0.y + 0.0833979*nf0.y + 0.060505584*ng0.y + 0.20092015*nh0.y + -0.20753656*ni0.y; + float s = 0.10038492*na0.z + -0.097845115*nb0.z + -0.20988423*nc0.z + 0.56715375*nd0.z + 0.344541*ne0.z + -0.35184717*nf0.z + 0.056586858*ng0.z + 0.15026435*nh0.z + -0.061636005*ni0.z; + float t = -0.106188744*na0.w + 0.07888199*nb0.w + -0.2636212*nc0.w + 0.066121526*nd0.w + 0.24769889*ne0.w + 0.068046436*nf0.w + -0.10188476*ng0.w + -0.010680762*nh0.w + 0.08574669*ni0.w; + float u = 0.1835542*na1.x + 0.008937482*nb1.x + 0.5390035*nc1.x + -0.29016507*nd1.x + 0.15828976*ne1.x + 0.13055886*nf1.x + -0.032077167*ng1.x + -0.09232864*nh1.x + 0.026800178*ni1.x; + float v = -0.16373107*na1.y + 0.12240949*nb1.y + -0.1514469*nc1.y + -0.066187665*nd1.y + 0.480507*ne1.y + 0.239324*nf1.y + -0.117546804*ng1.y + 0.10907446*nh1.y + 0.18901855*ni1.y; + float w = 0.16920653*na1.z + -0.116989106*nb1.z + 0.15383393*nc1.z + -0.15339498*nd1.z + -0.43599066*ne1.z + -0.08481946*nf1.z + 0.09341884*ng1.z + 0.29806188*nh1.z + 0.1415666*ni1.z; + float x = 0.19586475*na1.w + -0.074446365*nb1.w + -0.40643847*nc1.w + 0.11850669*nd1.w + -0.44227952*ne1.w + -0.3928542*nf1.w + -0.32883126*ng1.w + -0.12546194*nh1.w + -0.012666243*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.11223799; + i = 0.26876807*a0.x + 0.0695523*b0.x + -0.344691*c0.x + 0.015203748*d0.x + -0.06949707*e0.x + 0.1781559*f0.x + -0.37520844*g0.x + -0.063073136*h0.x + 0.30087665*i0.x; + j = -0.55691296*a0.y + -0.50857925*b0.y + -0.056020547*c0.y + -0.35320345*d0.y + 0.031270754*e0.y + 0.2983404*f0.y + -0.076483674*g0.y + 0.26416323*h0.y + 0.023565156*i0.y; + k = 0.69414824*a0.z + 0.40440598*b0.z + 0.27192193*c0.z + 0.6970185*d0.z + 0.3389849*e0.z + -0.70087254*f0.z + 0.19736615*g0.z + -0.31259185*h0.z + -0.25468588*i0.z; + l = 0.2020039*a0.w + 0.72199726*b0.w + 0.0022852335*c0.w + 0.298485*d0.w + -0.20830868*e0.w + 0.19032896*f0.w + 0.3657984*g0.w + -0.17007291*h0.w + 0.36441973*i0.w; + m = -0.2508085*a1.x + -0.3401645*b1.x + -0.850176*c1.x + 0.06386162*d1.x + -0.003681138*e1.x + 0.6275042*f1.x + 0.11110598*g1.x + 0.47562084*h1.x + 0.13381582*i1.x; + n = 0.020444876*a1.y + 0.2532999*b1.y + 0.2269895*c1.y + -0.017598275*d1.y + -0.45708385*e1.y + 0.1524704*f1.y + -0.34254953*g1.y + 0.04740127*h1.y + 0.017197018*i1.y; + o = -0.002111269*a1.z + -0.22728685*b1.z + -0.23939796*c1.z + -0.10468774*d1.z + -0.29414457*e1.z + -0.24367806*f1.z + 0.17014527*g1.z + 0.27090183*h1.z + 0.054622088*i1.z; + p = 0.41061872*a1.w + 0.0005123808*b1.w + -0.22415727*c1.w + -0.2519382*d1.w + 0.05781463*e1.w + 0.22721478*f1.w + -0.21616709*g1.w + -0.24962169*h1.w + 0.13280573*i1.w; + q = -0.1373898*na0.x + -0.0981469*nb0.x + 0.39089695*nc0.x + 0.0852082*nd0.x + 0.350497*ne0.x + -0.11116323*nf0.x + 0.46357557*ng0.x + 0.029840166*nh0.x + -0.42227915*ni0.x; + r = 0.5641577*na0.y + 0.51027757*nb0.y + 0.009071347*nc0.y + 0.38495895*nd0.y + -0.033866487*ne0.y + -0.27575114*nf0.y + 0.08055667*ng0.y + -0.3035854*nh0.y + -0.023016002*ni0.y; + s = -0.32272196*na0.z + 0.20313929*nb0.z + 0.26362333*nc0.z + -0.41859806*nd0.z + 0.30431905*ne0.z + 0.45895672*nf0.z + -0.22528476*ng0.z + -0.1159145*nh0.z + -0.20209464*ni0.z; + t = 0.081928305*na0.w + -0.39223*nb0.w + 0.0611548*nc0.w + -0.22477622*nd0.w + 0.522427*ne0.w + 0.08855894*nf0.w + -0.24657424*ng0.w + 0.20350339*nh0.w + -0.31071478*ni0.w; + u = 0.33967844*na1.x + 0.49198282*nb1.x + 0.7863518*nc1.x + 0.11403914*nd1.x + -0.19266184*ne1.x + -0.45698294*nf1.x + -0.08126978*ng1.x + -0.5248899*nh1.x + -0.07797818*ni1.x; + v = -0.20771638*na1.y + -0.8299212*nb1.y + -0.24834624*nc1.y + 0.45250767*nd1.y + 0.46488434*ne1.y + -0.11828078*nf1.y + 0.3505284*ng1.y + -0.50510573*nh1.y + -0.07697552*ni1.y; + w = -0.04876213*na1.z + 0.11971257*nb1.z + 0.31340784*nc1.z + 0.200377*nd1.z + 0.35152084*ne1.z + 0.21963598*nf1.z + -0.076885894*ng1.z + -0.26809564*nh1.z + -0.09561077*ni1.z; + x = -0.34259066*na1.w + 0.09505923*nb1.w + 0.14959009*nc1.w + 0.23431835*nd1.w + 0.0062933876*ne1.w + -0.1609717*nf1.w + 0.24410221*ng1.w + 0.27085063*nh1.w + -0.099992506*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.04949893; + i = 0.0045639137*a0.x + -0.05743072*b0.x + 0.10285781*c0.x + 0.26087925*d0.x + -0.20553583*e0.x + 0.061200682*f0.x + -0.006694795*g0.x + -0.3745583*h0.x + -0.3707756*i0.x; + j = -0.022965383*a0.y + -0.26371047*b0.y + 0.005787948*c0.y + -0.07437368*d0.y + 0.06782797*e0.y + -0.08120288*f0.y + -0.12914035*g0.y + -0.077741124*h0.y + 0.2501241*i0.y; + k = 0.20610172*a0.z + 0.1284978*b0.z + -0.11886638*c0.z + 0.28653103*d0.z + -0.063644625*e0.z + -0.5884758*f0.z + 0.11728779*g0.z + 0.029905675*h0.z + 0.07379022*i0.z; + l = 0.1538378*a0.w + 0.4065925*b0.w + 0.2281266*c0.w + 0.18172836*d0.w + -0.23893136*e0.w + -0.23435418*f0.w + 0.22755076*g0.w + 0.285046*h0.w + 0.14650422*i0.w; + m = 0.11291303*a1.x + -0.08260544*b1.x + -0.3453159*c1.x + -0.080172844*d1.x + 0.2454293*e1.x + 0.08065602*f1.x + -0.161478*g1.x + 0.2600093*h1.x + 0.0272943*i1.x; + n = -0.20061754*a1.y + -0.0686889*b1.y + 0.34669587*c1.y + 0.06513748*d1.y + -0.473736*e1.y + 0.27777022*f1.y + -0.024264947*g1.y + 0.02778163*h1.y + 0.21098697*i1.y; + o = 0.05395608*a1.z + 0.02719116*b1.z + -0.32412598*c1.z + -0.27905193*d1.z + -0.06789973*e1.z + -0.062129535*f1.z + -0.08168251*g1.z + -0.41552538*h1.z + -0.3497803*i1.z; + p = 0.25839904*a1.w + -0.22404832*b1.w + -0.05384204*c1.w + -0.2161867*d1.w + -0.0121894805*e1.w + 0.022278681*f1.w + -0.17689417*g1.w + -0.34242043*h1.w + -0.070397146*i1.w; + q = 0.063034*na0.x + 0.05760969*nb0.x + -0.18728243*nc0.x + -0.22536343*nd0.x + 0.56690377*ne0.x + 0.03879585*nf0.x + 0.07536423*ng0.x + 0.3205974*nh0.x + 0.27575305*ni0.x; + r = 0.1031107*na0.y + 0.272687*nb0.y + 0.006762844*nc0.y + 0.16900925*nd0.y + -0.072919*ne0.y + 0.14026049*nf0.y + 0.15526237*ng0.y + 0.18150571*nh0.y + -0.22151531*ni0.y; + s = -0.24863394*na0.z + -0.09707596*nb0.z + 0.09795663*nc0.z + -0.22762008*nd0.z + -0.21057858*ne0.z + -0.24106069*nf0.z + -0.022255352*ng0.z + -0.1313767*nh0.z + -0.43121204*ni0.z; + t = 0.066694*na0.w + -0.10496735*nb0.w + -0.025571965*nc0.w + -0.018413628*nd0.w + 0.11439308*ne0.w + -0.10751523*nf0.w + -0.07761101*ng0.w + -0.12299807*nh0.w + -0.0853496*ni0.w; + u = -0.097931445*na1.x + -0.017077666*nb1.x + 0.39443842*nc1.x + 0.11578743*nd1.x + -0.12134833*ne1.x + -0.13418046*nf1.x + 0.1631315*ng1.x + -0.17905197*nh1.x + 0.1269253*ni1.x; + v = 0.14395997*na1.y + -0.18397519*nb1.y + -0.2788941*nc1.y + 0.26155776*nd1.y + 0.43425953*ne1.y + -0.29808456*nf1.y + 0.44714943*ng1.y + -0.15123212*nh1.y + -0.16428284*ni1.y; + w = 0.11957922*na1.z + -0.07498902*nb1.z + 0.5115902*nc1.z + 0.4331171*nd1.z + 0.051374156*ne1.z + 0.08533449*nf1.z + 0.09597762*ng1.z + 0.31204012*nh1.z + 0.31360728*ni1.z; + x = -0.21514232*na1.w + 0.26941258*nb1.w + 0.014634563*nc1.w + 0.26335603*nd1.w + 0.17885374*ne1.w + -0.10330111*nf1.w + 0.1403563*ng1.w + 0.07782978*nh1.w + 0.14008115*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.13688515; + i = -0.07804815*a0.x + 0.059407797*b0.x + 0.04977952*c0.x + 0.02773134*d0.x + 0.05410472*e0.x + -0.062854886*f0.x + 0.026472766*g0.x + -0.27023906*h0.x + -0.19210388*i0.x; + j = -0.093932435*a0.y + 0.28328913*b0.y + -0.2901787*c0.y + 0.2604209*d0.y + 0.1867309*e0.y + -0.087907895*f0.y + -0.17325231*g0.y + -0.20677052*h0.y + 0.05084516*i0.y; + k = 0.18059264*a0.z + 0.12659116*b0.z + 0.321166*c0.z + -0.095247015*d0.z + -0.057249375*e0.z + -0.083215155*f0.z + -0.084061414*g0.z + 0.016379947*h0.z + 0.27847067*i0.z; + l = 0.0052076564*a0.w + 0.088261835*b0.w + 0.023966275*c0.w + 0.1916891*d0.w + -0.18803315*e0.w + 0.30314574*f0.w + -0.0049388534*g0.w + 0.06131603*h0.w + -0.1739463*i0.w; + m = 0.053730816*a1.x + 0.044391237*b1.x + -0.23457325*c1.x + 0.16524185*d1.x + -0.06232111*e1.x + -0.009041229*f1.x + -0.14986548*g1.x + 0.2529295*h1.x + -0.06479601*i1.x; + n = -0.0712835*a1.y + 0.08422339*b1.y + 0.06049955*c1.y + 0.19688065*d1.y + -0.2506823*e1.y + 0.028088713*f1.y + 0.5348856*g1.y + 0.30103734*h1.y + -0.19360717*i1.y; + o = -0.24208106*a1.z + -0.122532606*b1.z + 0.20045316*c1.z + 0.05312705*d1.z + 0.5049963*e1.z + -0.14606343*f1.z + 0.049328245*g1.z + -0.078365676*h1.z + 0.03955016*i1.z; + p = -0.2099684*a1.w + 0.040386654*b1.w + -0.013257981*c1.w + 0.0356436*d1.w + -0.325366*e1.w + 0.16636635*f1.w + -0.22065227*g1.w + -0.16084203*h1.w + 0.11005756*i1.w; + q = 0.15815249*na0.x + -0.015369833*nb0.x + -0.12336756*nc0.x + -0.054385934*nd0.x + 0.074591964*ne0.x + -0.086368226*nf0.x + -0.14882945*ng0.x + 0.28417754*nh0.x + 0.21760134*ni0.x; + r = 0.14566842*na0.y + -0.32228568*nb0.y + 0.3217725*nc0.y + -0.3236746*nd0.y + -0.24484256*ne0.y + 0.10371231*nf0.y + 0.16460484*ng0.y + 0.23163281*nh0.y + -0.012341124*ni0.y; + s = -0.005058286*na0.z + -0.03453109*nb0.z + -0.23984626*nc0.z + 0.25166908*nd0.z + 0.27825156*ne0.z + 0.024285031*nf0.z + 0.10690525*ng0.z + -0.026662704*nh0.z + -0.10733832*ni0.z; + t = -0.057425056*na0.w + -0.044107772*nb0.w + 0.14013149*nc0.w + -0.2928656*nd0.w + -0.027609475*ne0.w + -0.2120587*nf0.w + -0.048152808*ng0.w + -0.09314774*nh0.w + 0.17581387*ni0.w; + u = -0.045317907*na1.x + -0.002658384*nb1.x + 0.26392183*nc1.x + -0.102072954*nd1.x + 0.15045899*ne1.x + 0.0026884302*nf1.x + 0.22182642*ng1.x + -0.16366667*nh1.x + 0.17252661*ni1.x; + v = 0.037068292*na1.y + -0.035697266*nb1.y + -0.12798944*nc1.y + -0.104217514*nd1.y + 0.55114526*ne1.y + -0.08683132*nf1.y + -0.3960688*ng1.y + -0.058004502*nh1.y + 0.20123851*ni1.y; + w = 0.061975777*na1.z + -0.007016737*nb1.z + -0.24395092*nc1.z + -0.18182912*nd1.z + -0.4203786*ne1.z + -0.0793229*nf1.z + -0.0062738233*ng1.z + 0.07010734*nh1.z + -0.07754023*ni1.z; + x = 0.23575118*na1.w + 0.010342719*nb1.w + 0.053801455*nc1.w + -0.04112547*nd1.w + 0.22638881*ne1.w + -0.17857444*nf1.w + 0.32300612*ng1.w + 0.16535853*nh1.w + -0.032169778*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.09900063; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN10 +//!BIND LUMAN11 +//!SAVE LUMAN20 + +#define L0_tex LUMAN10_tex +#define L1_tex LUMAN11_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.013527977*a0.x + -0.021985358*b0.x + 0.05397565*c0.x + -0.0034767855*d0.x + -0.11890677*e0.x + 0.29082134*f0.x + -0.039291047*g0.x + 0.07665195*h0.x + 0.08196425*i0.x; + float j = -0.094228186*a0.y + 0.07538697*b0.y + -0.060956057*c0.y + 0.059484713*d0.y + -0.17759728*e0.y + 0.09614218*f0.y + 0.03537611*g0.y + -0.037086073*h0.y + -0.008596415*i0.y; + float k = 0.032117758*a0.z + 0.022979202*b0.z + -0.07695347*c0.z + 0.012811646*d0.z + -0.023976473*e0.z + 0.059492603*f0.z + 0.008878449*g0.z + -0.059855916*h0.z + -0.07344373*i0.z; + float l = -0.021900775*a0.w + 0.031232128*b0.w + -0.06696601*c0.w + -0.009441922*d0.w + 0.1089948*e0.w + -0.06588389*f0.w + 0.012479958*g0.w + -0.08053917*h0.w + -0.04149462*i0.w; + float m = -0.008463991*a1.x + -0.06539698*b1.x + 0.017473739*c1.x + -0.10556125*d1.x + -0.14444841*e1.x + 0.07904334*f1.x + -0.04443588*g1.x + -0.03508132*h1.x + -0.17745219*i1.x; + float n = 0.020496715*a1.y + -0.08638652*b1.y + 0.05855077*c1.y + 0.00017441693*d1.y + 0.018543327*e1.y + -0.1013226*f1.y + -0.066230886*g1.y + 0.08413542*h1.y + 0.050962817*i1.y; + float o = -0.017161256*a1.z + 0.13858159*b1.z + -0.041749604*c1.z + 0.03419109*d1.z + -0.056592952*e1.z + 0.18458726*f1.z + 0.043434385*g1.z + -0.061071083*h1.z + 0.012921071*i1.z; + float p = 0.014755255*a1.w + -0.05182161*b1.w + -0.06731411*c1.w + 0.011102007*d1.w + -0.318703*e1.w + 0.075716965*f1.w + 0.101763345*g1.w + 0.15413295*h1.w + 0.024591988*i1.w; + float q = -0.075562514*na0.x + -0.010590976*nb0.x + -0.11738534*nc0.x + -0.041761354*nd0.x + 0.11932829*ne0.x + -0.45476782*nf0.x + -0.0075228284*ng0.x + -0.086420506*nh0.x + 0.007089712*ni0.x; + float r = 0.03096373*na0.y + 0.034649566*nb0.y + -0.031928774*nc0.y + -0.043111343*nd0.y + 0.31612563*ne0.y + -0.20350803*nf0.y + -0.026558274*ng0.y + 0.02289182*nh0.y + -0.020726833*ni0.y; + float s = -0.0016090226*na0.z + -0.06752645*nb0.z + 0.099091955*nc0.z + -0.0024325743*nd0.z + 0.1011554*ne0.z + -0.04262747*nf0.z + -0.05447163*ng0.z + -0.050558403*nh0.z + 0.0081778*ni0.z; + float t = -0.0049708895*na0.w + 0.0016392999*nb0.w + 0.057654087*nc0.w + 0.059012435*nd0.w + -0.057368375*ne0.w + 0.03879934*nf0.w + -0.10427082*ng0.w + 0.20068298*nh0.w + -0.01986618*ni0.w; + float u = 0.038776297*na1.x + 0.09107378*nb1.x + -0.012062791*nc1.x + -0.039930277*nd1.x + 0.4725951*ne1.x + -0.08188476*nf1.x + 0.032464903*ng1.x + 0.022594651*nh1.x + 0.13316265*ni1.x; + float v = 0.013261636*na1.y + 0.016820675*nb1.y + -0.072160594*nc1.y + -0.04779156*nd1.y + -0.111475825*ne1.y + -0.059117347*nf1.y + -0.0058553545*ng1.y + -0.08119034*nh1.y + -0.09739646*ni1.y; + float w = -0.012684074*na1.z + -0.07658207*nb1.z + 0.08316156*nc1.z + 0.056792818*nd1.z + 0.19558784*ne1.z + -0.20766291*nf1.z + -0.020052088*ng1.z + -0.0004862114*nh1.z + -0.011227089*ni1.z; + float x = 0.0073004025*na1.w + -0.13704851*nb1.w + 0.08306585*nc1.w + 0.07773706*nd1.w + 0.17363897*ne1.w + -0.1441048*nf1.w + -0.19439775*ng1.w + 0.107276335*nh1.w + -0.051084824*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.022949655; + i = -0.04087157*a0.x + -0.02260197*b0.x + 0.117542826*c0.x + -0.012369363*d0.x + 0.08074506*e0.x + 0.061692882*f0.x + 0.022351578*g0.x + 0.10602042*h0.x + -0.06767196*i0.x; + j = -0.064718924*a0.y + -0.22255176*b0.y + 0.05848093*c0.y + -0.14342205*d0.y + 0.119860075*e0.y + 0.06878551*f0.y + -0.013513069*g0.y + 0.046533465*h0.y + 0.040732548*i0.y; + k = -0.06045028*a0.z + -0.01591852*b0.z + 0.06610767*c0.z + -0.1823601*d0.z + 0.20849596*e0.z + 0.07347752*f0.z + 0.04155757*g0.z + 0.00895664*h0.z + -0.07944645*i0.z; + l = -0.016871834*a0.w + 0.045388754*b0.w + 0.011370655*c0.w + -0.14510797*d0.w + -0.15147415*e0.w + -0.1170348*f0.w + 0.017186902*g0.w + 0.09248375*h0.w + 0.007475839*i0.w; + m = -0.16198191*a1.x + 0.031186389*b1.x + -0.015577391*c1.x + -0.22482629*d1.x + 0.24596654*e1.x + -0.050533623*f1.x + -0.25108784*g1.x + 0.04284556*h1.x + 0.08108874*i1.x; + n = 0.027043452*a1.y + 0.16801552*b1.y + -0.003745599*c1.y + 0.070402175*d1.y + 0.053155128*e1.y + -0.14744243*f1.y + -0.051701613*g1.y + -0.11427176*h1.y + 0.037253726*i1.y; + o = 0.014052072*a1.z + -0.21043895*b1.z + -0.04493953*c1.z + -0.13491723*d1.z + 0.045351543*e1.z + -0.017205605*f1.z + 0.044354085*g1.z + 0.17428237*h1.z + -0.027252568*i1.z; + p = -0.05443855*a1.w + -0.19976734*b1.w + 0.08696741*c1.w + -0.058124144*d1.w + 0.17074996*e1.w + 0.016584387*f1.w + 0.061787624*g1.w + -0.095216915*h1.w + -0.09135518*i1.w; + q = 0.068849*na0.x + -0.006419118*nb0.x + 0.019441683*nc0.x + -0.060357757*nd0.x + 0.039131112*ne0.x + -0.08853136*nf0.x + 0.01760069*ng0.x + 0.09266912*nh0.x + 0.008327355*ni0.x; + r = 0.22129181*na0.y + 0.06373042*nb0.y + -0.10548629*nc0.y + 0.10325513*nd0.y + -0.30775833*ne0.y + 0.00220113*nf0.y + -0.028867336*ng0.y + -0.09189019*nh0.y + -0.022799294*ni0.y; + s = 0.060209315*na0.z + 0.031388324*nb0.z + -0.022957543*nc0.z + 0.27422178*nd0.z + 0.06937636*ne0.z + 0.035298806*nf0.z + 0.11368389*ng0.z + 0.12730958*nh0.z + 0.028364537*ni0.z; + t = 0.014704841*na0.w + -0.20102401*nb0.w + -0.026068306*nc0.w + 0.17699486*nd0.w + 0.0879294*ne0.w + 0.1698334*nf0.w + -0.02981899*ng0.w + -0.033061545*nh0.w + -0.003263149*ni0.w; + u = 0.10228793*na1.x + -0.12621002*nb1.x + 0.04712082*nc1.x + 0.17671345*nd1.x + -0.011435259*ne1.x + -0.017273735*nf1.x + 0.04336435*ng1.x + 0.041016195*nh1.x + -0.07070804*ni1.x; + v = -0.0230543*na1.y + -0.07177169*nb1.y + -0.016929608*nc1.y + 0.09176562*nd1.y + 0.007423476*ne1.y + 0.14347216*nf1.y + 0.19021674*ng1.y + 0.24664913*nh1.y + -0.0044546993*ni1.y; + w = 0.07525268*na1.z + 0.10215633*nb1.z + -0.034674216*nc1.z + 0.11917874*nd1.z + -0.07633382*ne1.z + 0.009491858*nf1.z + -0.019258348*ng1.z + -0.056110546*nh1.z + 0.05242466*ni1.z; + x = 0.14390227*na1.w + 0.005486874*nb1.w + -0.047775052*nc1.w + 0.083086684*nd1.w + -0.1540571*ne1.w + 0.03332832*nf1.w + -0.039857596*ng1.w + 0.06294105*nh1.w + 0.059931733*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.015004233; + i = 0.06450652*a0.x + 0.10512942*b0.x + -0.03380897*c0.x + 0.02381926*d0.x + -0.029680518*e0.x + 0.19790445*f0.x + 0.020805994*g0.x + 0.12226736*h0.x + 0.29196885*i0.x; + j = 0.058254506*a0.y + 0.37349033*b0.y + 0.17782345*c0.y + 0.13237436*d0.y + -0.16366753*e0.y + 0.15040247*f0.y + -0.009766406*g0.y + 0.09334094*h0.y + -0.04319163*i0.y; + k = 0.032573055*a0.z + 0.0520147*b0.z + -0.109417446*c0.z + -0.083108656*d0.z + -0.03640593*e0.z + -0.035311375*f0.z + -0.059460822*g0.z + -0.23666914*h0.z + -0.08944803*i0.z; + l = 0.0038108414*a0.w + -0.093942806*b0.w + -0.0002687137*c0.w + 0.050867274*d0.w + 0.19859661*e0.w + -0.022116859*f0.w + 0.06944154*g0.w + -0.1566366*h0.w + -0.030445358*i0.w; + m = 0.00823481*a1.x + -0.01037292*b1.x + -0.10918299*c1.x + 0.27718702*d1.x + -0.14857076*e1.x + -0.04826351*f1.x + 0.2341413*g1.x + 0.2599253*h1.x + 0.17341693*i1.x; + n = 0.048965324*a1.y + -0.12670444*b1.y + -0.089070916*c1.y + 0.02564883*d1.y + -0.24245334*e1.y + 0.032899123*f1.y + -0.014363491*g1.y + 0.11135662*h1.y + 0.15778056*i1.y; + o = -0.16426727*a1.z + 0.11129983*b1.z + 0.06887022*c1.z + 0.007059456*d1.z + -0.17225806*e1.z + -0.19889604*f1.z + -0.12744522*g1.z + -0.12379852*h1.z + -0.16819909*i1.z; + p = -0.116869636*a1.w + 0.15554382*b1.w + 0.029180527*c1.w + -0.06872862*d1.w + 0.09564698*e1.w + 0.24025366*f1.w + 0.03126127*g1.w + -0.1176598*h1.w + -0.06161121*i1.w; + q = 0.037802104*na0.x + 0.09350397*nb0.x + -0.0769349*nc0.x + 0.03645998*nd0.x + 0.0069438526*ne0.x + -0.06361921*nf0.x + 0.18469255*ng0.x + 0.24764213*nh0.x + 0.07766792*ni0.x; + r = 0.18289608*na0.y + -0.12239327*nb0.y + -0.13007359*nc0.y + 0.09451128*nd0.y + 0.1741278*ne0.y + 0.13919578*nf0.y + 0.0027461709*ng0.y + -0.042409852*nh0.y + 0.08961877*ni0.y; + s = -0.061266363*na0.z + -0.054321136*nb0.z + 0.036159202*nc0.z + 0.030102096*nd0.z + -0.044607766*ne0.z + -0.060411066*nf0.z + -0.13489954*ng0.z + -0.04080531*nh0.z + -0.083873264*ni0.z; + t = -0.084672436*na0.w + 0.1504545*nb0.w + 0.024027625*nc0.w + -0.13306853*nd0.w + -0.09016413*ne0.w + 0.17414762*nf0.w + -0.06464937*ng0.w + 0.13652956*nh0.w + -0.021525873*ni0.w; + u = -0.02642025*na1.x + 0.044494845*nb1.x + 0.06366142*nc1.x + 0.1505755*nd1.x + 0.07108563*ne1.x + 0.04716515*nf1.x + 0.08969759*ng1.x + 0.15725368*nh1.x + -0.083613135*ni1.x; + v = -0.013183983*na1.y + 0.11957996*nb1.y + 0.06981307*nc1.y + 0.0049996213*nd1.y + 0.045766216*ne1.y + -0.2006878*nf1.y + -0.061555803*ng1.y + -0.23608068*nh1.y + -0.20878883*ni1.y; + w = 0.08936703*na1.z + -0.08374226*nb1.z + -0.22422598*nc1.z + -0.1499266*nd1.z + -0.02415584*ne1.z + -0.03532918*nf1.z + -0.0064545805*ng1.z + 0.11103835*nh1.z + 0.14617345*ni1.z; + x = -0.059598316*na1.w + 0.0572515*nb1.w + -0.07959839*nc1.w + -0.11761448*nd1.w + 0.04539192*ne1.w + -0.013689615*nf1.w + 0.117332384*ng1.w + 0.06432839*nh1.w + 0.17445782*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.009116664; + i = 0.029937284*a0.x + 0.012592633*b0.x + 0.0035193404*c0.x + 0.048239913*d0.x + -0.02579887*e0.x + -0.32347405*f0.x + 0.19797476*g0.x + 0.34045488*h0.x + -0.053127605*i0.x; + j = -0.08552001*a0.y + -0.5091193*b0.y + -0.3674879*c0.y + 0.066710964*d0.y + -0.19032574*e0.y + -0.23930229*f0.y + 0.12251539*g0.y + -0.10437046*h0.y + 0.029123023*i0.y; + k = -0.01817984*a0.z + -0.035262328*b0.z + 0.05684564*c0.z + -0.05650155*d0.z + 0.10149242*e0.z + 0.16924061*f0.z + -0.06286115*g0.z + -0.07370519*h0.z + -0.0031225765*i0.z; + l = 0.01222035*a0.w + -0.034015853*b0.w + 0.054374967*c0.w + 0.13628155*d0.w + 0.12960319*e0.w + 0.14776659*f0.w + 0.06023756*g0.w + -0.042914346*h0.w + 0.20594329*i0.w; + m = -0.0934276*a1.x + -0.07084719*b1.x + 0.05861112*c1.x + 0.043431886*d1.x + 0.39818907*e1.x + -0.13945232*f1.x + 0.09557018*g1.x + 0.24552365*h1.x + -0.12016207*i1.x; + n = 0.044831783*a1.y + 0.06390137*b1.y + 0.24364634*c1.y + 0.07372187*d1.y + -0.14626445*e1.y + 0.099190116*f1.y + -0.07039345*g1.y + 0.073163874*h1.y + -0.06192338*i1.y; + o = -0.109891295*a1.z + -0.13347644*b1.z + -0.12954961*c1.z + -0.019614372*d1.z + -0.0029413272*e1.z + -0.031745158*f1.z + -0.1051075*g1.z + -0.03837312*h1.z + 0.0076298364*i1.z; + p = -0.15461138*a1.w + -0.07552362*b1.w + -0.049930304*c1.w + -0.107533015*d1.w + 0.02491214*e1.w + 0.12966767*f1.w + 0.16751781*g1.w + -0.14322354*h1.w + 0.012731172*i1.w; + q = 0.0073949546*na0.x + 0.18222675*nb0.x + -0.07683412*nc0.x + 0.083668694*nd0.x + 0.24188446*ne0.x + 0.22409667*nf0.x + 0.111766525*ng0.x + 0.17273599*nh0.x + 0.013803989*ni0.x; + r = 0.0055611595*na0.y + 0.27571908*nb0.y + 0.2450441*nc0.y + -0.010127715*nd0.y + 0.065464124*ne0.y + 0.13358384*nf0.y + -0.1146484*ng0.y + 0.11939751*nh0.y + 0.05964501*ni0.y; + s = 0.029037701*na0.z + 0.012928207*nb0.z + 0.002133859*nc0.z + 0.050441336*nd0.z + -0.031983275*ne0.z + -0.13312417*nf0.z + -0.1503905*ng0.z + 0.018946528*nh0.z + 0.037298534*ni0.z; + t = 0.03960253*na0.w + 0.028732052*nb0.w + -0.06156018*nc0.w + 0.033002503*nd0.w + -0.12726215*ne0.w + -0.16633202*nf0.w + 0.097211786*ng0.w + 0.12051725*nh0.w + -0.09554128*ni0.w; + u = -0.13823731*na1.x + -0.07852736*nb1.x + -0.09889797*nc1.x + -0.14248206*nd1.x + -0.2923521*ne1.x + 0.11362127*nf1.x + -0.05540227*ng1.x + -0.007822408*nh1.x + 0.031163149*ni1.x; + v = 0.10624509*na1.y + -0.034037188*nb1.y + -0.15328835*nc1.y + -0.039549757*nd1.y + -0.009303268*ne1.y + -0.020719174*nf1.y + -0.1074841*ng1.y + 0.016232569*nh1.y + 0.11941272*ni1.y; + w = 0.030069001*na1.z + 0.033361748*nb1.z + 0.07155489*nc1.z + 0.06789422*nd1.z + -0.09628887*ne1.z + -0.0050422805*nf1.z + 0.077183045*ng1.z + -0.052701566*nh1.z + -0.013990619*ni1.z; + x = 0.06616862*na1.w + 0.23819432*nb1.w + -0.0078013805*nc1.w + 0.34299204*nd1.w + -0.11941012*ne1.w + -0.014988168*nf1.w + -0.049478944*ng1.w + 0.20497164*nh1.w + 0.086817674*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.012121121; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN10 +//!BIND LUMAN11 +//!SAVE LUMAN21 + +#define L0_tex LUMAN10_tex +#define L1_tex LUMAN11_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.032210905*a0.x + -0.22100762*b0.x + -0.0032703374*c0.x + 0.015506358*d0.x + -0.09312688*e0.x + -0.018092621*f0.x + -0.21721269*g0.x + -0.3773176*h0.x + -0.19184077*i0.x; + float j = -0.11561234*a0.y + 0.100562856*b0.y + -0.16967262*c0.y + -0.13489078*d0.y + -0.021638734*e0.y + -0.3574349*f0.y + -0.15207161*g0.y + -0.1547973*h0.y + -0.16668291*i0.y; + float k = 0.02231361*a0.z + 0.13332497*b0.z + 0.035786014*c0.z + -0.0664228*d0.z + 0.16041073*e0.z + -0.084772356*f0.z + 0.07331499*g0.z + -0.028057933*h0.z + 0.03400777*i0.z; + float l = -0.033291023*a0.w + 0.13411658*b0.w + -0.10777399*c0.w + -0.08803081*d0.w + 0.243463*e0.w + 0.23971614*f0.w + 0.03130143*g0.w + 0.21753372*h0.w + 0.23764528*i0.w; + float m = 0.02479805*a1.x + 0.024198437*b1.x + 0.067342184*c1.x + -0.09406164*d1.x + -0.061180808*e1.x + 0.017575948*f1.x + -0.06901198*g1.x + -0.6332455*h1.x + -0.26331425*i1.x; + float n = 0.03550918*a1.y + -0.026056346*b1.y + -0.026818415*c1.y + -0.062047157*d1.y + 0.1374933*e1.y + 0.014597348*f1.y + 0.032155614*g1.y + 0.082036875*h1.y + 0.09928472*i1.y; + float o = 0.0076694456*a1.z + 0.10039608*b1.z + -0.05555473*c1.z + 0.15538448*d1.z + 0.5122444*e1.z + 0.056242995*f1.z + 0.1033249*g1.z + 0.017088782*h1.z + 0.11182181*i1.z; + float p = 0.05504122*a1.w + 0.240218*b1.w + 0.09733398*c1.w + 0.013779217*d1.w + 0.24832357*e1.w + -0.111736566*f1.w + -0.12404431*g1.w + 0.22960596*h1.w + 0.011862629*i1.w; + float q = -0.024519132*na0.x + 0.011293519*nb0.x + -0.10689248*nc0.x + -0.1520136*nd0.x + -0.09288146*ne0.x + -0.07725742*nf0.x + -0.008527781*ng0.x + -0.07596324*nh0.x + 0.24663517*ni0.x; + float r = 0.111326605*na0.y + 0.06520367*nb0.y + -0.0292947*nc0.y + 0.15157138*nd0.y + -0.002686112*ne0.y + 0.089814834*nf0.y + 0.12950978*ng0.y + 0.098146915*nh0.y + -0.006845888*ni0.y; + float s = 0.026319193*na0.z + -0.054523807*nb0.z + -0.032969248*nc0.z + 0.06366228*nd0.z + -0.08584336*ne0.z + 0.07897411*nf0.z + -0.0064960774*ng0.z + 0.037283525*nh0.z + -0.04514447*ni0.z; + float t = 0.032626558*na0.w + -0.10095923*nb0.w + 0.030091932*nc0.w + 0.056223158*nd0.w + -0.13954762*ne0.w + -0.27249533*nf0.w + -0.1874185*ng0.w + -0.06394691*nh0.w + -0.37358424*ni0.w; + float u = 0.11503907*na1.x + 0.09006182*nb1.x + -0.1666951*nc1.x + -0.004016884*nd1.x + 0.04133192*ne1.x + -0.032742172*nf1.x + 0.07530546*ng1.x + 0.1318198*nh1.x + 0.1558315*ni1.x; + float v = -0.015699673*na1.y + -0.065667406*nb1.y + 0.13333066*nc1.y + 0.10314816*nd1.y + -0.10498296*ne1.y + 0.035132464*nf1.y + -0.06944383*ng1.y + -0.15983945*nh1.y + -0.10815093*ni1.y; + float w = -0.023418352*na1.z + 0.1092882*nb1.z + 0.20895064*nc1.z + -0.13675413*nd1.z + 0.051802553*ne1.z + -0.06339106*nf1.z + -0.04526454*ng1.z + 0.02850313*nh1.z + -0.07127658*ni1.z; + float x = -0.09134431*na1.w + 0.12640393*nb1.w + -0.123052575*nc1.w + 0.009571935*nd1.w + -0.121652395*ne1.w + -0.0987715*nf1.w + -0.08485803*ng1.w + -0.044140875*nh1.w + 0.0198955*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.07467768; + i = 0.09189898*a0.x + 0.09660522*b0.x + -0.15929192*c0.x + 0.0873315*d0.x + 0.1004297*e0.x + 0.2897138*f0.x + 0.03302687*g0.x + 0.13837586*h0.x + 0.14187333*i0.x; + j = -0.16785112*a0.y + 0.17407325*b0.y + 0.05927486*c0.y + -0.16061561*d0.y + -0.32080442*e0.y + -0.09874194*f0.y + 0.035980478*g0.y + -0.06288709*h0.y + 0.007237446*i0.y; + k = -0.028712947*a0.z + 0.034094844*b0.z + -0.075238466*c0.z + 0.029756788*d0.z + -0.08453252*e0.z + 0.01931708*f0.z + -0.021127494*g0.z + 0.037089977*h0.z + 0.05374554*i0.z; + l = 0.038226794*a0.w + 0.11277784*b0.w + 0.12790442*c0.w + 0.0022405738*d0.w + 0.16055769*e0.w + 0.1097169*f0.w + 0.11203196*g0.w + 0.11603345*h0.w + -0.01059266*i0.w; + m = 0.04989864*a1.x + -0.03570367*b1.x + -0.07650978*c1.x + 0.114822045*d1.x + -0.043346252*e1.x + -0.054947898*f1.x + -0.010293628*g1.x + -0.11049507*h1.x + -0.12112137*i1.x; + n = 0.011686617*a1.y + -0.01398271*b1.y + -0.0936927*c1.y + -0.014205747*d1.y + -0.10156042*e1.y + 0.16797067*f1.y + -0.16036573*g1.y + -0.06259835*h1.y + 0.084900655*i1.y; + o = -0.084346674*a1.z + 0.14484023*b1.z + -0.04795535*c1.z + 0.08690034*d1.z + -0.05300985*e1.z + -0.045254134*f1.z + -0.079851165*g1.z + 0.08901589*h1.z + 0.08979397*i1.z; + p = -0.08652713*a1.w + -0.0014084558*b1.w + 0.07818926*c1.w + 0.104910046*d1.w + -0.035973582*e1.w + -0.04440243*f1.w + -0.029182553*g1.w + 0.082148395*h1.w + -0.015747363*i1.w; + q = 0.012732959*na0.x + 0.09247432*nb0.x + 0.060586743*nc0.x + -0.049785435*nd0.x + 0.015232796*ne0.x + 0.12521784*nf0.x + 0.08811162*ng0.x + -0.02245172*nh0.x + -0.077839985*ni0.x; + r = 0.14234546*na0.y + -0.26840374*nb0.y + -0.030217612*nc0.y + 0.088527516*nd0.y + 0.049622834*ne0.y + 0.05244139*nf0.y + 0.02926647*ng0.y + 0.1130343*nh0.y + -0.022328159*ni0.y; + s = -0.020194955*na0.z + -0.08410325*nb0.z + 0.068881*nc0.z + -0.052475553*nd0.z + 0.01784649*ne0.z + -0.06723487*nf0.z + -0.055720944*ng0.z + -0.04582561*nh0.z + -0.029673988*ni0.z; + t = 0.04355432*na0.w + 0.06491023*nb0.w + 0.037113376*nc0.w + 0.12672496*nd0.w + -0.18339087*ne0.w + -0.04234449*nf0.w + 0.09054666*ng0.w + -0.11273007*nh0.w + 0.03041045*ni0.w; + u = -0.10813339*na1.x + -0.118357934*nb1.x + 0.00058659946*nc1.x + -0.22123726*nd1.x + 0.12603706*ne1.x + 0.0067170076*nf1.x + 0.012743413*ng1.x + 0.02224982*nh1.x + 0.06633709*ni1.x; + v = 0.09978588*na1.y + 0.007898778*nb1.y + 0.021774517*nc1.y + -0.027918719*nd1.y + 0.24878718*ne1.y + -0.30599263*nf1.y + -0.044740938*ng1.y + 0.16604176*nh1.y + -0.036250304*ni1.y; + w = -0.058091346*na1.z + -0.2510759*nb1.z + -0.04973879*nc1.z + -0.19907628*nd1.z + -0.09391249*ne1.z + 0.06562282*nf1.z + -0.045825444*ng1.z + -0.20437409*nh1.z + -0.07064104*ni1.z; + x = -0.26264083*na1.w + 0.015380487*nb1.w + -0.07525977*nc1.w + 0.03977851*nd1.w + 0.04027396*ne1.w + 0.014741459*nf1.w + 0.19858573*ng1.w + 0.010961905*nh1.w + 0.06481673*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.008888977; + i = -0.02131571*a0.x + -0.053264357*b0.x + 0.17938791*c0.x + 0.08466054*d0.x + 0.08505312*e0.x + -0.08036078*f0.x + 0.17558508*g0.x + 0.17073892*h0.x + -0.07125404*i0.x; + j = -0.011896931*a0.y + 0.075010955*b0.y + -0.0983643*c0.y + 0.026305754*d0.y + 0.019260254*e0.y + -0.14121646*f0.y + 0.02804857*g0.y + 0.0048786188*h0.y + 0.019504687*i0.y; + k = -0.019065183*a0.z + -0.013254299*b0.z + 0.07514181*c0.z + 0.11055625*d0.z + -0.044775892*e0.z + 0.11779965*f0.z + -0.0053781765*g0.z + 0.0074138422*h0.z + -0.078374766*i0.z; + l = 0.11444183*a0.w + 0.115259014*b0.w + 0.031562362*c0.w + 0.012267636*d0.w + 0.10228788*e0.w + -0.06968799*f0.w + 0.072820656*g0.w + -0.036611427*h0.w + 0.13929163*i0.w; + m = -0.07504076*a1.x + -0.12394642*b1.x + -0.11331061*c1.x + -0.047768917*d1.x + -0.13104713*e1.x + -0.08379716*f1.x + -0.021516422*g1.x + -0.08238858*h1.x + -0.08267121*i1.x; + n = 0.033980474*a1.y + 0.02657052*b1.y + 0.1067697*c1.y + 0.02900943*d1.y + -0.34566507*e1.y + 0.07115065*f1.y + -0.007658494*g1.y + 0.10935048*h1.y + -0.010512701*i1.y; + o = 0.004971154*a1.z + 0.092844255*b1.z + -0.05771552*c1.z + -0.11182353*d1.z + -0.110540286*e1.z + -0.023962786*f1.z + 0.03412059*g1.z + -0.08923254*h1.z + 0.018304097*i1.z; + p = -0.12247698*a1.w + -0.049930353*b1.w + 0.21932095*c1.w + 0.26519108*d1.w + -0.40082026*e1.w + 0.20915353*f1.w + 0.028248992*g1.w + 0.13964863*h1.w + -0.1554689*i1.w; + q = 0.12723987*na0.x + 0.03822221*nb0.x + -0.047092102*nc0.x + -0.18272042*nd0.x + 0.3959418*ne0.x + 0.107742086*nf0.x + -0.014026635*ng0.x + 0.059987117*nh0.x + 0.16084902*ni0.x; + r = 0.028825426*na0.y + -0.29448676*nb0.y + -0.13274668*nc0.y + -0.09478098*nd0.y + 0.10420857*ne0.y + -0.10411197*nf0.y + -0.18224506*ng0.y + -0.056122147*nh0.y + -0.01594652*ni0.y; + s = 0.046311874*na0.z + 0.083920695*nb0.z + -0.011149687*nc0.z + 0.053852662*nd0.z + 0.28573832*ne0.z + -0.101435356*nf0.z + 0.09642878*ng0.z + 0.049260557*nh0.z + 0.09929059*ni0.z; + t = -0.0035928742*na0.w + -0.09334861*nb0.w + -0.0063303886*nc0.w + 0.14681813*nd0.w + 0.017606229*ne0.w + 0.12432797*nf0.w + 0.089195*ng0.w + 0.2064234*nh0.w + -0.009656533*ni0.w; + u = -0.07209475*na1.x + 0.09496789*nb1.x + -0.07145837*nc1.x + 0.016493566*nd1.x + 0.22177024*ne1.x + -0.02882561*nf1.x + -0.13864525*ng1.x + -0.050776858*nh1.x + -0.006592587*ni1.x; + v = 0.08312736*na1.y + -0.031556617*nb1.y + 0.03721191*nc1.y + 0.19816718*nd1.y + 0.2112128*ne1.y + 0.18289135*nf1.y + 0.17975038*ng1.y + 0.022604292*nh1.y + 0.05615719*ni1.y; + w = 0.02089934*na1.z + -0.11338398*nb1.z + 0.103426956*nc1.z + 0.039416797*nd1.z + 0.015742797*ne1.z + -0.011910452*nf1.z + -0.04195718*ng1.z + 0.028388608*nh1.z + 0.020044504*ni1.z; + x = -0.01979613*na1.w + 0.18986*nb1.w + -0.14206813*nc1.w + -0.051590487*nd1.w + 0.07681823*ne1.w + -0.051485833*nf1.w + 0.0863466*ng1.w + -0.059099887*nh1.w + 0.20621549*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.02618249; + i = -0.075821996*a0.x + -0.010909995*b0.x + -0.043415338*c0.x + -0.07588877*d0.x + -0.4095415*e0.x + -0.04469391*f0.x + -0.09701737*g0.x + -0.072898634*h0.x + 0.06407679*i0.x; + j = -0.023938905*a0.y + 0.19077158*b0.y + 0.04024954*c0.y + 0.24741809*d0.y + 0.112353556*e0.y + 0.0041395114*f0.y + -0.028641861*g0.y + -0.027194615*h0.y + -0.09061678*i0.y; + k = -0.072798036*a0.z + 0.090112865*b0.z + -0.05632968*c0.z + 0.20347923*d0.z + 0.07701144*e0.z + 0.045918144*f0.z + -0.07585065*g0.z + -0.07914966*h0.z + 0.019974526*i0.z; + l = -0.16652842*a0.w + 0.034469336*b0.w + 0.12903087*c0.w + -0.076710865*d0.w + -0.37440994*e0.w + -0.025993038*f0.w + -0.004262664*g0.w + 0.001584407*h0.w + 0.033034854*i0.w; + m = 0.0041383496*a1.x + 0.03408745*b1.x + -0.026236003*c1.x + 0.04234019*d1.x + -0.12546021*e1.x + -0.014587259*f1.x + -0.03398031*g1.x + -0.141356*h1.x + -0.11886382*i1.x; + n = 0.09139738*a1.y + -0.09554944*b1.y + 0.10334826*c1.y + 0.03734294*d1.y + 0.012692735*e1.y + 0.061069824*f1.y + 0.11895*g1.y + 0.2818085*h1.y + 0.08344411*i1.y; + o = -0.10986263*a1.z + 0.010196268*b1.z + -0.072981186*c1.z + -0.022945326*d1.z + 0.32752264*e1.z + -0.04935327*f1.z + -0.042955153*g1.z + 0.029840723*h1.z + -0.049479816*i1.z; + p = -0.118424095*a1.w + -0.15453647*b1.w + -0.08703251*c1.w + -0.1623114*d1.w + 0.08050361*e1.w + 0.084552966*f1.w + 0.045329593*g1.w + 0.101881795*h1.w + -0.005239424*i1.w; + q = -0.037558466*na0.x + 0.06352173*nb0.x + -0.03436178*nc0.x + -0.06149859*nd0.x + 0.031554375*ne0.x + 0.017566927*nf0.x + 0.047931995*ng0.x + -0.028771691*nh0.x + 0.09664059*ni0.x; + r = -0.066075586*na0.y + 0.25566104*nb0.y + -0.0008369278*nc0.y + -0.10307065*nd0.y + -0.4120819*ne0.y + -0.13958299*nf0.y + -0.058115225*ng0.y + -0.030533452*nh0.y + 0.019909525*ni0.y; + s = 0.21524096*na0.z + -0.034712624*nb0.z + 0.026146675*nc0.z + 0.03823109*nd0.z + 0.027243178*ne0.z + -0.06874973*nf0.z + 0.047253083*ng0.z + -0.06430874*nh0.z + 0.040901497*ni0.z; + t = 0.07901911*na0.w + 0.15762629*nb0.w + 0.011304432*nc0.w + 0.050626148*nd0.w + 0.34474713*ne0.w + 0.07935911*nf0.w + 0.13129725*ng0.w + -0.070588715*nh0.w + 0.049329277*ni0.w; + u = 0.1404405*na1.x + -0.05290101*nb1.x + -0.18832147*nc1.x + 0.017660763*nd1.x + -0.44914606*ne1.x + -0.093574174*nf1.x + -0.074316286*ng1.x + -0.09848133*nh1.x + 0.10140716*ni1.x; + v = -0.039871864*na1.y + 0.060526196*nb1.y + 0.06688931*nc1.y + 0.18316075*nd1.y + 0.004202756*ne1.y + 0.32342157*nf1.y + 0.20690823*ng1.y + -0.3151704*nh1.y + 0.21967977*ni1.y; + w = 0.24020113*na1.z + 0.37890625*nb1.z + 0.20994367*nc1.z + 0.13750695*nd1.z + -0.2828177*ne1.z + -0.18408743*nf1.z + -0.09146642*ng1.z + -0.04093093*nh1.z + -0.01256826*ni1.z; + x = -0.023923807*na1.w + 0.11991365*nb1.w + 0.04768579*nc1.w + -0.37403065*nd1.w + -0.1640075*ne1.w + -0.095789246*nf1.w + 0.07672462*ng1.w + -0.04442829*nh1.w + -0.050591458*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0054605072; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN20 +//!BIND LUMAN21 +//!SAVE LUMAN30 + +#define L0_tex LUMAN20_tex +#define L1_tex LUMAN21_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.10495947*a0.x + -0.03537041*b0.x + -0.10991186*c0.x + 0.25251657*d0.x + 0.013626215*e0.x + -0.058395956*f0.x + -0.0008518597*g0.x + -0.014936195*h0.x + 0.019276572*i0.x; + float j = -0.02682906*a0.y + -0.21245436*b0.y + -0.0033354003*c0.y + 0.006015402*d0.y + -0.16739099*e0.y + -0.15625198*f0.y + 0.0150447*g0.y + -0.015820103*h0.y + 0.012379691*i0.y; + float k = -0.0013036287*a0.z + 0.008318171*b0.z + 0.030156238*c0.z + -0.04434512*d0.z + -0.07113499*e0.z + 0.08979989*f0.z + 0.07051442*g0.z + 0.17790104*h0.z + 0.06543697*i0.z; + float l = 0.05744523*a0.w + 0.046723574*b0.w + -0.05827923*c0.w + 0.053087477*d0.w + 0.13964976*e0.w + 0.03684414*f0.w + -0.06794282*g0.w + -0.016245833*h0.w + -0.059672065*i0.w; + float m = 0.038995396*a1.x + -0.038216475*b1.x + -0.022593262*c1.x + 0.043936342*d1.x + -0.21404716*e1.x + 0.025221398*f1.x + -0.023893652*g1.x + -0.01713915*h1.x + 0.017736023*i1.x; + float n = -0.13781334*a1.y + -0.20996156*b1.y + -0.0855945*c1.y + -0.059780546*d1.y + -0.109258644*e1.y + -0.23170298*f1.y + -0.019512651*g1.y + -0.063233405*h1.y + -0.11784715*i1.y; + float o = -0.049934313*a1.z + 0.110902704*b1.z + 0.01558279*c1.z + -0.049464624*d1.z + -0.071157925*e1.z + -0.01660195*f1.z + 0.03621618*g1.z + -0.17185134*h1.z + -0.03749148*i1.z; + float p = -0.044992216*a1.w + -0.029741274*b1.w + -0.09576101*c1.w + 0.009392959*d1.w + 0.00061923254*e1.w + -0.049683083*f1.w + 0.09854748*g1.w + 0.11209177*h1.w + 0.015629178*i1.w; + float q = -0.023147024*na0.x + 0.028076923*nb0.x + -0.05377833*nc0.x + 0.41326755*nd0.x + 0.5016342*ne0.x + 0.102404684*nf0.x + 0.30781993*ng0.x + 0.04892017*nh0.x + -0.095621556*ni0.x; + float r = -0.02866961*na0.y + 0.13125686*nb0.y + 0.009609672*nc0.y + -0.048800323*nd0.y + -0.24172029*ne0.y + 0.07588628*nf0.y + -0.058860697*ng0.y + -0.20078272*nh0.y + -0.005210194*ni0.y; + float s = -0.061130345*na0.z + 0.06554706*nb0.z + 0.026878184*nc0.z + 0.09191935*nd0.z + -0.18614642*ne0.z + -0.1272964*nf0.z + -0.051245384*ng0.z + -0.06212816*nh0.z + 0.020784322*ni0.z; + float t = 0.0021429516*na0.w + -0.0141859185*nb0.w + -0.010014355*nc0.w + 0.0075964513*nd0.w + -0.16495723*ne0.w + -0.12892577*nf0.w + 0.035710387*ng0.w + -0.055349573*nh0.w + 0.018455528*ni0.w; + float u = -0.1827063*na1.x + -0.087003306*nb1.x + -0.013586943*nc1.x + -0.10099142*nd1.x + -0.04407746*ne1.x + -0.14055519*nf1.x + -0.055341262*ng1.x + -0.22188987*nh1.x + -0.00424361*ni1.x; + float v = 0.16635212*na1.y + 0.10692179*nb1.y + 0.089410685*nc1.y + 0.038306225*nd1.y + 0.011428505*ne1.y + 0.06011443*nf1.y + -0.16809247*ng1.y + 0.22273114*nh1.y + 0.04767407*ni1.y; + float w = 0.08062917*na1.z + 0.0023691454*nb1.z + 0.04098239*nc1.z + 0.36116946*nd1.z + 0.010449896*ne1.z + -0.047237948*nf1.z + -0.25944754*ng1.z + 0.2506446*nh1.z + 0.06529679*ni1.z; + float x = 0.053499896*na1.w + 0.010498035*nb1.w + 0.091785476*nc1.w + 0.04551249*nd1.w + -0.10188583*ne1.w + 0.09607795*nf1.w + 0.063433304*ng1.w + -0.12168427*nh1.w + -0.024411602*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0082672285; + i = 0.04420035*a0.x + 0.018893836*b0.x + -0.013619452*c0.x + -0.24012345*d0.x + -0.27375877*e0.x + -0.038554166*f0.x + 0.09097225*g0.x + 0.07965527*h0.x + -0.048234686*i0.x; + j = -0.07595159*a0.y + 0.054129757*b0.y + 0.043301415*c0.y + 0.056345753*d0.y + -0.14225017*e0.y + -0.067605354*f0.y + 0.06621613*g0.y + 0.09139841*h0.y + -0.062457714*i0.y; + k = -0.016594049*a0.z + -0.030780058*b0.z + -0.098458335*c0.z + -0.24517989*d0.z + 0.04580243*e0.z + -0.03836348*f0.z + -0.02720263*g0.z + -0.010154304*h0.z + -0.06432893*i0.z; + l = 0.039587986*a0.w + 0.11270057*b0.w + -0.050399054*c0.w + 0.15591136*d0.w + -0.108235896*e0.w + 0.014952577*f0.w + 0.22324464*g0.w + -0.040208988*h0.w + -0.07127248*i0.w; + m = 0.0336196*a1.x + -0.02421821*b1.x + -0.045471463*c1.x + -0.07179168*d1.x + 0.030665457*e1.x + -0.033806127*f1.x + 0.00729746*g1.x + -0.045769934*h1.x + 0.017483594*i1.x; + n = -0.033376135*a1.y + 0.08135445*b1.y + 0.018873708*c1.y + 0.11349483*d1.y + -0.027417801*e1.y + -0.09590671*f1.y + -0.17795533*g1.y + 0.17250298*h1.y + -0.14320396*i1.y; + o = -0.035711*a1.z + 0.029188631*b1.z + 0.0815523*c1.z + -0.16461325*d1.z + 0.18918027*e1.z + 0.0033511773*f1.z + 0.109288804*g1.z + 0.08115647*h1.z + 0.093553044*i1.z; + p = -0.07392052*a1.w + 0.05746653*b1.w + 0.037391104*c1.w + -0.0058278493*d1.w + 0.10739208*e1.w + -0.009279468*f1.w + -0.07919596*g1.w + 0.012846508*h1.w + -0.006493424*i1.w; + q = 0.14004427*na0.x + 0.04834755*nb0.x + 0.03813113*nc0.x + 0.18179546*nd0.x + 0.12059466*ne0.x + 0.1562862*nf0.x + 0.117933735*ng0.x + -0.041356713*nh0.x + 0.004850639*ni0.x; + r = 0.0897286*na0.y + 0.028496258*nb0.y + 0.013498651*nc0.y + -0.12374841*nd0.y + 0.41279215*ne0.y + 0.22727947*nf0.y + 0.061800964*ng0.y + -0.16176465*nh0.y + 0.077431016*ni0.y; + s = -0.17179112*na0.z + 0.10911651*nb0.z + -0.009969072*nc0.z + 0.06344676*nd0.z + -0.03751725*ne0.z + 0.13070048*nf0.z + -0.1389857*ng0.z + 0.047986243*nh0.z + 0.013180362*ni0.z; + t = -0.010965876*na0.w + -0.041684385*nb0.w + 0.008301607*nc0.w + -0.167301*nd0.w + 0.08283813*ne0.w + -0.0071550948*nf0.w + -0.06452635*ng0.w + 0.1032137*nh0.w + 0.031217664*ni0.w; + u = -0.11137781*na1.x + 0.03437329*nb1.x + -0.009390753*nc1.x + -0.10965495*nd1.x + -0.021066867*ne1.x + 0.065845564*nf1.x + -0.03633728*ng1.x + -0.012213326*nh1.x + -0.0014274631*ni1.x; + v = 0.065072246*na1.y + 0.023515902*nb1.y + 0.040873718*nc1.y + -0.2224784*nd1.y + 0.04724838*ne1.y + 0.07304937*nf1.y + 0.05813173*ng1.y + 0.028858649*nh1.y + 0.12516193*ni1.y; + w = 0.1324343*na1.z + -0.23523535*nb1.z + -0.038939327*nc1.z + 0.07158796*nd1.z + -0.1191352*ne1.z + -0.018787293*nf1.z + 0.12615351*ng1.z + 0.04812125*nh1.z + -0.13245015*ni1.z; + x = 0.060072*na1.w + -0.11062477*nb1.w + 0.031622723*nc1.w + -0.029927421*nd1.w + 0.17728531*ne1.w + 0.08034003*nf1.w + 0.007750797*ng1.w + -0.19105726*nh1.w + 0.08233319*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.004496528; + i = 0.07302485*a0.x + 0.3255973*b0.x + 0.15016317*c0.x + 0.118632555*d0.x + -0.17213899*e0.x + 0.1582742*f0.x + -0.06146779*g0.x + 0.16038014*h0.x + 0.03446602*i0.x; + j = 0.010767944*a0.y + -0.17074314*b0.y + -0.051532004*c0.y + -0.007004298*d0.y + 0.17263626*e0.y + 0.17654046*f0.y + -0.00854635*g0.y + 0.020359043*h0.y + 0.059243754*i0.y; + k = 0.012429514*a0.z + 0.137492*b0.z + 0.04819812*c0.z + 0.035178814*d0.z + -0.18009062*e0.z + -0.026474113*f0.z + 0.06052671*g0.z + -0.09139187*h0.z + 0.016754301*i0.z; + l = -0.020336514*a0.w + 0.12835233*b0.w + 0.05292645*c0.w + 0.027170286*d0.w + 0.21714908*e0.w + 0.20537919*f0.w + 0.06016602*g0.w + 0.08009548*h0.w + 0.054547563*i0.w; + m = 0.026176583*a1.x + 0.011795747*b1.x + -0.0414424*c1.x + -0.049600832*d1.x + -0.0832306*e1.x + -0.0549573*f1.x + 0.03924075*g1.x + -0.14165045*h1.x + -0.03587528*i1.x; + n = -0.0942382*a1.y + -0.0554067*b1.y + 0.026133277*c1.y + 0.061629396*d1.y + -0.07488993*e1.y + 0.32595944*f1.y + 0.00076820946*g1.y + 0.12769783*h1.y + 0.09029101*i1.y; + o = 0.06983503*a1.z + -0.032106537*b1.z + 0.099255025*c1.z + -0.06080937*d1.z + -0.14384937*e1.z + -0.22940788*f1.z + 0.04732333*g1.z + -0.06451785*h1.z + -0.03758684*i1.z; + p = 0.052208744*a1.w + -0.08988008*b1.w + 0.058199216*c1.w + -0.0020835826*d1.w + 0.06585372*e1.w + 0.053097535*f1.w + -0.058973607*g1.w + 0.03506455*h1.w + -0.04801262*i1.w; + q = -0.014868468*na0.x + 0.22615212*nb0.x + 0.073948465*nc0.x + -0.06781611*nd0.x + -0.10032018*ne0.x + -0.20862079*nf0.x + 0.06294624*ng0.x + -0.2255593*nh0.x + -0.07084244*ni0.x; + r = 0.057524882*na0.y + 0.30524227*nb0.y + 0.35815537*nc0.y + -0.0009502602*nd0.y + -0.089151636*ne0.y + -0.14037384*nf0.y + -0.034081057*ng0.y + 0.11372325*nh0.y + 0.10721567*ni0.y; + s = 0.057963226*na0.z + -0.10614639*nb0.z + 0.04840352*nc0.z + 0.015917875*nd0.z + 0.11659738*ne0.z + 0.11277482*nf0.z + -0.028128905*ng0.z + 0.12908414*nh0.z + -0.105552666*ni0.z; + t = 0.019451434*na0.w + -0.13708478*nb0.w + -0.049833942*nc0.w + -0.06012834*nd0.w + -0.112836376*ne0.w + -0.24934123*nf0.w + -0.045174573*ng0.w + 0.11306015*nh0.w + -0.05403323*ni0.w; + u = 0.0472547*na1.x + -0.023629531*nb1.x + 0.08101014*nc1.x + 0.0936124*nd1.x + -0.019263176*ne1.x + -0.018776532*nf1.x + -0.06877347*ng1.x + 0.13923196*nh1.x + 0.03186953*ni1.x; + v = -0.010185454*na1.y + 0.09941806*nb1.y + 0.0894505*nc1.y + -0.0026836023*nd1.y + 0.12091999*ne1.y + -0.00040105637*nf1.y + -0.012306723*ng1.y + -0.01695834*nh1.y + -0.060723636*ni1.y; + w = -0.11100347*na1.z + -0.061128043*nb1.z + -0.1416516*nc1.z + 0.07061777*nd1.z + 0.0318233*ne1.z + 0.14762254*nf1.z + 0.011475027*ng1.z + 0.10708941*nh1.z + 0.073588334*ni1.z; + x = -0.0032446082*na1.w + 0.018291878*nb1.w + -0.09359892*nc1.w + -0.017735833*nd1.w + -0.3877458*ne1.w + -0.27740228*nf1.w + 0.07144769*ng1.w + -0.1594686*nh1.w + -0.042618934*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.016106425; + i = 0.035688583*a0.x + 0.032622155*b0.x + -0.07878022*c0.x + -0.22056721*d0.x + 0.36388257*e0.x + 0.09935813*f0.x + -0.077380866*g0.x + -0.016323987*h0.x + 0.025766185*i0.x; + j = 0.032614443*a0.y + 0.0075333*b0.y + -0.08914437*c0.y + -0.11388316*d0.y + -0.32016122*e0.y + -0.049377266*f0.y + 0.051589742*g0.y + 0.053202707*h0.y + -0.028994467*i0.y; + k = 0.07181132*a0.z + 0.123275116*b0.z + -0.015218611*c0.z + -0.021832455*d0.z + 0.20298561*e0.z + -0.18469056*f0.z + 0.010181586*g0.z + 0.026014574*h0.z + 0.022069149*i0.z; + l = 0.11116511*a0.w + 0.19239828*b0.w + 0.00020110002*c0.w + 0.3092214*d0.w + 0.25210956*e0.w + 0.029646616*f0.w + 0.13460134*g0.w + 0.22553803*h0.w + 0.2627162*i0.w; + m = 0.20240203*a1.x + 0.04904199*b1.x + 0.087184764*c1.x + 0.2124653*d1.x + -0.31427193*e1.x + -0.104574054*f1.x + 0.044442028*g1.x + 0.07160614*h1.x + 0.0069251317*i1.x; + n = -0.15117155*a1.y + -0.24588604*b1.y + -0.16807069*c1.y + -0.11873434*d1.y + -0.6071346*e1.y + 0.11526665*f1.y + -0.30017737*g1.y + 0.061571214*h1.y + 0.0368654*i1.y; + o = -0.022352027*a1.z + -0.030253926*b1.z + 0.106674075*c1.z + -0.031035127*d1.z + 0.23091488*e1.z + 0.08884981*f1.z + 0.09103071*g1.z + -0.08590288*h1.z + -0.060364954*i1.z; + p = -0.054246917*a1.w + -0.03801203*b1.w + -0.062851064*c1.w + -0.073276244*d1.w + -0.05854327*e1.w + -0.095565595*f1.w + -0.11843872*g1.w + -0.06481578*h1.w + -0.07193746*i1.w; + q = 0.07197522*na0.x + 0.18386847*nb0.x + 0.23272155*nc0.x + 0.16188829*nd0.x + -0.025466003*ne0.x + -0.04826338*nf0.x + 0.016412303*ng0.x + 0.072044484*nh0.x + 0.009424055*ni0.x; + r = -0.014057901*na0.y + -0.0678097*nb0.y + 0.065728344*nc0.y + 0.082456514*nd0.y + 0.24829388*ne0.y + -0.31393299*nf0.y + -0.023987576*ng0.y + -0.08345598*nh0.y + -0.0010536936*ni0.y; + s = -0.027450949*na0.z + -0.035480395*nb0.z + -0.068690196*nc0.z + 0.02964989*nd0.z + -0.27646825*ne0.z + -0.22154613*nf0.z + 0.028639298*ng0.z + -0.14063624*nh0.z + 0.08924814*ni0.z; + t = 0.018802406*na0.w + 0.011309935*nb0.w + -0.052953072*nc0.w + -0.07039529*nd0.w + 0.04814527*ne0.w + -0.007535829*nf0.w + 0.064747065*ng0.w + -0.14107801*nh0.w + -0.10131967*ni0.w; + u = -0.07231724*na1.x + 0.015407522*nb1.x + -0.052383028*nc1.x + -0.17859146*nd1.x + 0.28211778*ne1.x + -0.009197533*nf1.x + -0.045684036*ng1.x + -0.06056637*nh1.x + -0.0035418952*ni1.x; + v = 0.10038491*na1.y + 0.17251195*nb1.y + 0.09409685*nc1.y + 0.07996458*nd1.y + 0.13919151*ne1.y + 0.110783696*nf1.y + 0.009992888*ng1.y + 0.012707362*nh1.y + 0.1887242*ni1.y; + w = -0.004788721*na1.z + 0.028190559*nb1.z + -0.08321803*nc1.z + 0.29351994*nd1.z + -0.24649957*ne1.z + -0.25687915*nf1.z + -0.07823761*ng1.z + 0.18122914*nh1.z + 0.016037595*ni1.z; + x = -0.008824334*na1.w + -0.11209885*nb1.w + -0.032978315*nc1.w + -0.069099665*nd1.w + -0.061004076*ne1.w + -0.2446395*nf1.w + 0.09238701*ng1.w + -0.11517327*nh1.w + -0.07248953*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.01728668; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN20 +//!BIND LUMAN21 +//!SAVE LUMAN31 + +#define L0_tex LUMAN20_tex +#define L1_tex LUMAN21_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.07941704*a0.x + -0.050842553*b0.x + 0.01092942*c0.x + -0.07148679*d0.x + -0.06512474*e0.x + -0.22956467*f0.x + -0.024606694*g0.x + -0.09724198*h0.x + -0.09039128*i0.x; + float j = 0.027611736*a0.y + 0.060809463*b0.y + 0.0667335*c0.y + 0.037682217*d0.y + 0.06852659*e0.y + 0.5153305*f0.y + 0.016338438*g0.y + 0.002601195*h0.y + 0.11281981*i0.y; + float k = -0.060290866*a0.z + -0.011722135*b0.z + 0.085060075*c0.z + -0.08798*d0.z + -0.021146037*e0.z + 0.17453888*f0.z + 0.0018846161*g0.z + -0.024184274*h0.z + 0.037061296*i0.z; + float l = 0.023022855*a0.w + -0.06370005*b0.w + 0.043632*c0.w + -0.0031560452*d0.w + -0.4032132*e0.w + -0.08846532*f0.w + 0.10578794*g0.w + 0.065337054*h0.w + -0.09185561*i0.w; + float m = -0.07253925*a1.x + -0.08851836*b1.x + 0.062056795*c1.x + 0.032718055*d1.x + -0.4019351*e1.x + 0.009619835*f1.x + 0.0015480773*g1.x + -0.06635443*h1.x + -0.114055015*i1.x; + float n = -0.010111321*a1.y + 0.16795866*b1.y + 0.07786296*c1.y + 0.020181928*d1.y + 0.26352328*e1.y + 0.004966047*f1.y + -0.08452743*g1.y + -0.11825899*h1.y + 0.054564703*i1.y; + float o = 0.02549486*a1.z + 0.05948747*b1.z + -0.04825873*c1.z + -0.007742992*d1.z + 0.07948027*e1.z + -0.10099402*f1.z + -0.12409299*g1.z + 0.08199375*h1.z + -0.07701278*i1.z; + float p = -0.0010457158*a1.w + 0.14753313*b1.w + -0.036453757*c1.w + 0.014154197*d1.w + -0.13650024*e1.w + 0.2692273*f1.w + 0.0583396*g1.w + 0.034443617*h1.w + 0.051470105*i1.w; + float q = -0.01434574*na0.x + -0.07308625*nb0.x + -0.100208566*nc0.x + -0.07297119*nd0.x + -0.62616676*ne0.x + -0.011523209*nf0.x + -0.014466557*ng0.x + -0.085850835*nh0.x + -0.17460416*ni0.x; + float r = 0.00066524564*na0.y + 0.0482624*nb0.y + 0.1272653*nc0.y + -0.073000126*nd0.y + -0.10093872*ne0.y + -0.090638004*nf0.y + 0.09337763*ng0.y + -0.0027805113*nh0.y + 0.032939613*ni0.y; + float s = -0.058239613*na0.z + 0.0038146402*nb0.z + 0.17032205*nc0.z + 0.08319828*nd0.z + -0.41412708*ne0.z + 0.47307482*nf0.z + 0.010387847*ng0.z + 0.0633208*nh0.z + -0.0105386665*ni0.z; + float t = -0.13282509*na0.w + 0.017102268*nb0.w + -0.006839047*nc0.w + -0.043928336*nd0.w + 0.2989465*ne0.w + 0.013503525*nf0.w + -0.011740496*ng0.w + -0.009853105*nh0.w + 0.13738577*ni0.w; + float u = -0.027205449*na1.x + 0.03722104*nb1.x + -0.065805*nc1.x + -0.0850838*nd1.x + 0.015198619*ne1.x + -0.024742754*nf1.x + -0.061739046*ng1.x + -0.07436123*nh1.x + 0.15313913*ni1.x; + float v = -0.00018431511*na1.y + -0.03285911*nb1.y + 0.08875587*nc1.y + 0.027293593*nd1.y + -0.21097568*ne1.y + -0.043539245*nf1.y + -0.0657312*ng1.y + 0.13540883*nh1.y + 0.011748581*ni1.y; + float w = -0.012003101*na1.z + -0.10176224*nb1.z + -0.060972966*nc1.z + 0.047351442*nd1.z + -0.056035142*ne1.z + 0.3156803*nf1.z + 0.17128298*ng1.z + 0.08773884*nh1.z + 0.31448507*ni1.z; + float x = -0.08746548*na1.w + 0.058036875*nb1.w + 0.07244209*nc1.w + 0.05094744*nd1.w + 0.19715828*ne1.w + 0.052874785*nf1.w + -0.0031921165*ng1.w + -0.09948083*nh1.w + -0.099991955*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.00768615; + i = -0.2584226*a0.x + 0.049625244*b0.x + 0.085008234*c0.x + -0.25260374*d0.x + -0.20725876*e0.x + -0.052256707*f0.x + -0.24630953*g0.x + 0.020792667*h0.x + -0.12987958*i0.x; + j = 0.11674078*a0.y + -0.05069138*b0.y + -0.054932218*c0.y + -0.002327029*d0.y + -0.3744174*e0.y + -0.06068667*f0.y + 0.0052237557*g0.y + -0.081293285*h0.y + -0.25822634*i0.y; + k = 0.22486423*a0.z + 0.13474905*b0.z + 0.17571972*c0.z + 0.23275833*d0.z + -0.14145213*e0.z + 0.17688423*f0.z + 0.09584457*g0.z + 0.13348572*h0.z + -0.037102394*i0.z; + l = 0.02187451*a0.w + 0.11284924*b0.w + 0.030247845*c0.w + 0.29230177*d0.w + 0.24179323*e0.w + 0.15396708*f0.w + 0.18624204*g0.w + 0.36116585*h0.w + 0.15303242*i0.w; + m = 0.23878942*a1.x + 0.1077676*b1.x + -0.08214348*c1.x + 0.13583168*d1.x + 0.11975287*e1.x + -0.050753787*f1.x + -0.08751185*g1.x + 0.108354725*h1.x + 0.09259918*i1.x; + n = -0.16052248*a1.y + 0.043467432*b1.y + 0.11113435*c1.y + -0.23582667*d1.y + 0.31877246*e1.y + 0.04129961*f1.y + -0.09102526*g1.y + 0.060114477*h1.y + 0.07789096*i1.y; + o = -0.025753384*a1.z + -0.0535386*b1.z + -0.024348794*c1.z + -0.2092495*d1.z + 0.11210719*e1.z + 0.21575865*f1.z + -0.06333121*g1.z + 0.004394454*h1.z + -0.03849619*i1.z; + p = -0.0936154*a1.w + 0.073645994*b1.w + -0.070233256*c1.w + -0.11690011*d1.w + -0.12087031*e1.w + -0.035496015*f1.w + -0.054435793*g1.w + -0.18953127*h1.w + -0.12531057*i1.w; + q = 0.18474342*na0.x + 0.049027357*nb0.x + -0.026551004*nc0.x + 0.34006017*nd0.x + -0.06909763*ne0.x + 0.016170332*nf0.x + 0.05132557*ng0.x + 0.04963594*nh0.x + -0.06614966*ni0.x; + r = 0.015981808*na0.y + 0.11978708*nb0.y + 0.0003225886*nc0.y + 0.13874708*nd0.y + 0.24115108*ne0.y + -0.09863037*nf0.y + 0.17281389*ng0.y + -0.0050876113*nh0.y + -0.013940462*ni0.y; + s = -0.065658085*na0.z + 0.09520752*nb0.z + 0.059236676*nc0.z + -0.10476223*nd0.z + -0.21604007*ne0.z + 0.16991691*nf0.z + 0.020778336*ng0.z + -0.06487427*nh0.z + 0.04760285*ni0.z; + t = 0.03405014*na0.w + -0.008665183*nb0.w + -0.08413498*nc0.w + -0.1115953*nd0.w + 0.067205414*ne0.w + -0.1394608*nf0.w + -0.07059417*ng0.w + 0.09220727*nh0.w + -0.05677373*ni0.w; + u = 0.10527668*na1.x + 0.23578717*nb1.x + 0.13868308*nc1.x + 0.0013714005*nd1.x + -0.17564678*ne1.x + 0.17813891*nf1.x + -0.0557956*ng1.x + -0.088410884*nh1.x + -0.038198613*ni1.x; + v = 0.07981938*na1.y + -0.14220296*nb1.y + 0.08475657*nc1.y + 0.06395585*nd1.y + -0.03096132*ne1.y + 0.17134686*nf1.y + 0.121079914*ng1.y + 0.002460959*nh1.y + -0.20324089*ni1.y; + w = 0.036307156*na1.z + -0.018204955*nb1.z + -0.03135114*nc1.z + 0.15029632*nd1.z + 0.04616049*ne1.z + -0.2557983*nf1.z + 0.045661557*ng1.z + -0.07640636*nh1.z + 0.04804881*ni1.z; + x = 0.07813257*na1.w + -0.023829287*nb1.w + -0.13715439*nc1.w + 0.087288216*nd1.w + -0.17041437*ne1.w + 0.10756241*nf1.w + 0.0173771*ng1.w + -0.113619484*nh1.w + 0.016020184*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.003316083; + i = -0.028736124*a0.x + -0.08003967*b0.x + 0.09763381*c0.x + -0.00846156*d0.x + -0.18583794*e0.x + -0.049422342*f0.x + -0.07666734*g0.x + -0.02733043*h0.x + 0.040038377*i0.x; + j = 0.018239625*a0.y + 0.19185518*b0.y + 0.13775997*c0.y + -0.0896574*d0.y + -0.32224402*e0.y + -0.005808667*f0.y + -0.042873193*g0.y + 0.102946535*h0.y + 0.16040611*i0.y; + k = 0.07604001*a0.z + 0.06753936*b0.z + -0.0062585506*c0.z + -0.077893704*d0.z + 0.021712523*e0.z + -0.0944168*f0.z + 0.0049426183*g0.z + -0.057945896*h0.z + 0.0832966*i0.z; + l = 0.20802133*a0.w + -0.23534459*b0.w + 0.027663095*c0.w + 0.10619838*d0.w + -0.2881961*e0.w + 0.03611936*f0.w + 0.12809974*g0.w + 0.025251053*h0.w + -0.018410701*i0.w; + m = -0.026915021*a1.x + 0.11605544*b1.x + 0.0969195*c1.x + -0.05159316*d1.x + -0.29639572*e1.x + 0.060887333*f1.x + -0.077562116*g1.x + -0.023696246*h1.x + -0.07765453*i1.x; + n = -0.04823381*a1.y + -0.3185404*b1.y + -0.24473429*c1.y + -0.4789328*d1.y + -0.35767055*e1.y + 0.4142013*f1.y + -0.20269759*g1.y + 0.3929618*h1.y + -0.018045327*i1.y; + o = -0.13663228*a1.z + 0.025303073*b1.z + -0.06823502*c1.z + -0.08741995*d1.z + 0.3769405*e1.z + -0.19950937*f1.z + -0.021235209*g1.z + 0.16786906*h1.z + 0.11909075*i1.z; + p = -0.13527294*a1.w + -0.06680806*b1.w + -0.15427993*c1.w + 0.036378223*d1.w + -0.3359488*e1.w + -0.059891827*f1.w + 0.017971888*g1.w + -0.053049818*h1.w + -0.072594084*i1.w; + q = 0.051277246*na0.x + 0.16183147*nb0.x + 0.16584247*nc0.x + -0.09765534*nd0.x + -0.20131728*ne0.x + -0.032204267*nf0.x + -0.20159227*ng0.x + -0.07981351*nh0.x + 0.09944889*ni0.x; + r = -0.13917594*na0.y + 0.06652356*nb0.y + -0.0883734*nc0.y + -0.024413928*nd0.y + -0.19586924*ne0.y + 0.17564073*nf0.y + 0.027439114*ng0.y + -0.03333901*nh0.y + 0.07641967*ni0.y; + s = -0.07586603*na0.z + -0.049416613*nb0.z + 0.24173866*nc0.z + 0.1326689*nd0.z + -0.4864198*ne0.z + 0.06878775*nf0.z + 0.04480557*ng0.z + -0.1025121*nh0.z + -0.27702534*ni0.z; + t = -0.027331017*na0.w + 0.12820075*nb0.w + 0.040788233*nc0.w + 0.061936054*nd0.w + -0.09631744*ne0.w + -0.025646532*nf0.w + 0.19220605*ng0.w + -0.11971887*nh0.w + 0.055378202*ni0.w; + u = 0.08820415*na1.x + 0.026093876*nb1.x + -0.04180729*nc1.x + -0.19694711*nd1.x + -0.108901724*ne1.x + 0.06905329*nf1.x + -0.103396684*ng1.x + -0.11677139*nh1.x + -0.10525223*ni1.x; + v = 0.10541181*na1.y + 0.102778554*nb1.y + 0.15439296*nc1.y + 0.051345453*nd1.y + -0.20767345*ne1.y + 0.1831073*nf1.y + -0.041579783*ng1.y + 0.04888303*nh1.y + -0.0063026203*ni1.y; + w = 0.42541298*na1.z + 0.18639457*nb1.z + -0.18841113*nc1.z + 0.10537636*nd1.z + -0.033187203*ne1.z + 0.1277658*nf1.z + 0.40115508*ng1.z + 0.12769128*nh1.z + 0.106948815*ni1.z; + x = -0.11754907*na1.w + 0.13961302*nb1.w + 0.043125894*nc1.w + 0.13606437*nd1.w + 0.29668897*ne1.w + -0.15002356*nf1.w + -0.0049111377*ng1.w + 0.09318963*nh1.w + 0.15725283*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0035607726; + i = -0.0007657082*a0.x + 0.18896873*b0.x + 0.11515918*c0.x + -0.08670543*d0.x + -0.17096084*e0.x + 0.038672194*f0.x + -0.006407333*g0.x + -0.12406157*h0.x + 0.074486144*i0.x; + j = -0.018961241*a0.y + -0.0661694*b0.y + 0.12120849*c0.y + 0.0499541*d0.y + -0.025950044*e0.y + 0.13302167*f0.y + -0.0045417123*g0.y + 0.091498435*h0.y + 0.25304177*i0.y; + k = 0.02082855*a0.z + 0.122300126*b0.z + -0.0017944642*c0.z + 0.06828385*d0.z + 0.17769805*e0.z + 0.005459296*f0.z + 3.786597e-05*g0.z + 0.1927736*h0.z + 0.15574773*i0.z; + l = 0.07262613*a0.w + -0.051484853*b0.w + 0.11589907*c0.w + 0.03128076*d0.w + -0.066505186*e0.w + 0.0819007*f0.w + -0.14619994*g0.w + 0.108773485*h0.w + -0.029004829*i0.w; + m = -0.0140467575*a1.x + 0.12702075*b1.x + 0.018607724*c1.x + -0.021833913*d1.x + -0.21427749*e1.x + -0.05479105*f1.x + -0.074576564*g1.x + -0.029219097*h1.x + 0.004721507*i1.x; + n = -0.017141543*a1.y + -0.1510377*b1.y + -0.010902904*c1.y + -0.15604293*d1.y + 0.1410916*e1.y + 0.35071704*f1.y + 0.14407732*g1.y + 0.11913299*h1.y + 0.15659198*i1.y; + o = -0.031506337*a1.z + 0.0034794312*b1.z + -0.010843625*c1.z + -0.068582706*d1.z + 0.2035301*e1.z + -0.2578952*f1.z + -0.0045797243*g1.z + 0.0510916*h1.z + -0.04096347*i1.z; + p = 0.0132341655*a1.w + -0.09561104*b1.w + 0.03996762*c1.w + 0.07062096*d1.w + 0.064072214*e1.w + -0.030976873*f1.w + 3.0964125e-05*g1.w + 0.09990824*h1.w + 0.057406235*i1.w; + q = 0.029551128*na0.x + 0.14557356*nb0.x + 0.08588128*nc0.x + 0.22651055*nd0.x + -0.35015303*ne0.x + -0.014872635*nf0.x + 0.019119492*ng0.x + -0.13659622*nh0.x + -0.029656924*ni0.x; + r = 0.03831925*na0.y + 0.19166094*nb0.y + -0.14751142*nc0.y + 0.10880705*nd0.y + -0.058297906*ne0.y + -0.33643624*nf0.y + -0.10262261*ng0.y + 0.024292309*nh0.y + -0.061532244*ni0.y; + s = 0.028195743*na0.z + -0.08969857*nb0.z + 0.020221138*nc0.z + -0.038737748*nd0.z + -0.036892556*ne0.z + -0.12940665*nf0.z + -0.06352916*ng0.z + -0.014914517*nh0.z + -0.13324068*ni0.z; + t = -0.023716316*na0.w + 0.015531115*nb0.w + -0.08457603*nc0.w + 0.009459709*nd0.w + 0.16085471*ne0.w + -0.061606925*nf0.w + -0.032667276*ng0.w + -0.05158212*nh0.w + -0.03426355*ni0.w; + u = 0.024232633*na1.x + -0.070986755*nb1.x + -0.0058888225*nc1.x + 0.07083461*nd1.x + 0.13945094*ne1.x + -0.11468432*nf1.x + -0.023783585*ng1.x + -0.08165796*nh1.x + -0.12259042*ni1.x; + v = 0.0030000864*na1.y + 0.0041845613*nb1.y + 0.00797792*nc1.y + -0.010358695*nd1.y + 0.039620068*ne1.y + 0.003697568*nf1.y + -0.034909796*ng1.y + 0.046191987*nh1.y + 0.043660384*ni1.y; + w = 0.03257494*na1.z + 0.058587745*nb1.z + -0.04471518*nc1.z + -0.10175396*nd1.z + 0.029540528*ne1.z + 0.12884614*nf1.z + -0.19663431*ng1.z + -0.009101876*nh1.z + 0.14205857*ni1.z; + x = -0.0063677295*na1.w + 0.064730145*nb1.w + -0.11158172*nc1.w + -0.008992963*nd1.w + 0.06534912*ne1.w + -0.14108323*nf1.w + 0.0464611*ng1.w + 0.02179613*nh1.w + -0.003715472*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.012906831; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN30 +//!BIND LUMAN31 +//!SAVE LUMAN40 + +#define L0_tex LUMAN30_tex +#define L1_tex LUMAN31_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.08656171*a0.x + 0.21290569*b0.x + -0.004001642*c0.x + 0.03927889*d0.x + -0.079883896*e0.x + 0.096595794*f0.x + -0.03477963*g0.x + 0.04326191*h0.x + 0.07472603*i0.x; + float j = -0.026371144*a0.y + -0.10890013*b0.y + -0.074713044*c0.y + -0.03986311*d0.y + -0.06510753*e0.y + -0.046004105*f0.y + -0.0076048975*g0.y + -0.063950986*h0.y + -0.018643167*i0.y; + float k = 0.03444205*a0.z + -0.052693386*b0.z + 0.0024046462*c0.z + -0.06357705*d0.z + -0.100524455*e0.z + 0.034741692*f0.z + 0.0119595*g0.z + -0.02717993*h0.z + 0.050470024*i0.z; + float l = -0.022481086*a0.w + -0.074111626*b0.w + -0.06492289*c0.w + 0.0215112*d0.w + -0.2213038*e0.w + 0.0204108*f0.w + -0.0067506693*g0.w + -0.062500216*h0.w + -0.062180262*i0.w; + float m = 0.03696488*a1.x + 0.04108178*b1.x + -0.011093009*c1.x + 0.2494327*d1.x + -0.031587277*e1.x + 0.02254383*f1.x + 0.04281861*g1.x + 0.019687284*h1.x + -0.063386016*i1.x; + float n = -0.01412882*a1.y + -0.034890138*b1.y + 0.0143132545*c1.y + 0.049496226*d1.y + -0.10116899*e1.y + -0.03730606*f1.y + -0.007983867*g1.y + -0.05111721*h1.y + 0.012292823*i1.y; + float o = 0.10091559*a1.z + 0.1054921*b1.z + -0.07666608*c1.z + 0.010558074*d1.z + -0.016222922*e1.z + -0.030339802*f1.z + -0.024651198*g1.z + 0.11539425*h1.z + -0.008982327*i1.z; + float p = 0.08782505*a1.w + -0.0039771134*b1.w + 0.106606014*c1.w + 0.07876641*d1.w + -0.07574561*e1.w + -0.03822405*f1.w + 0.09565453*g1.w + 0.057285316*h1.w + 0.07650349*i1.w; + float q = -0.005750001*na0.x + -0.031764384*nb0.x + 0.030848796*nc0.x + 0.032382507*nd0.x + -0.084400214*ne0.x + -0.16719313*nf0.x + -0.003563804*ng0.x + -0.08467185*nh0.x + -0.013666626*ni0.x; + float r = 0.012016638*na0.y + 0.14458697*nb0.y + 0.006680341*nc0.y + -0.025037276*nd0.y + 0.17308724*ne0.y + -0.018338397*nf0.y + 8.713182e-06*ng0.y + 0.08174603*nh0.y + -0.053476475*ni0.y; + float s = -0.014294115*na0.z + 0.025022032*nb0.z + -0.018170934*nc0.z + 0.037305776*nd0.z + -0.1749532*ne0.z + -0.0077695046*nf0.z + 0.026932228*ng0.z + -0.08316069*nh0.z + 0.053805698*ni0.z; + float t = -0.012198974*na0.w + 0.14582784*nb0.w + 0.07482499*nc0.w + -0.051537655*nd0.w + 0.08446009*ne0.w + -0.0373948*nf0.w + -0.023523446*ng0.w + -0.026085692*nh0.w + 0.011028385*ni0.w; + float u = 0.087766856*na1.x + 0.034175277*nb1.x + 0.03152634*nc1.x + -0.101653695*nd1.x + 0.03928409*ne1.x + -0.06981694*nf1.x + 0.03964823*ng1.x + 0.006642139*nh1.x + 0.017051173*ni1.x; + float v = 0.08698132*na1.y + 0.0438875*nb1.y + 0.0451187*nc1.y + -0.10329641*nd1.y + 0.02733591*ne1.y + 0.006656351*nf1.y + -0.011088956*ng1.y + -0.0047664074*nh1.y + 0.11088423*ni1.y; + float w = -0.03557234*na1.z + -0.040018145*nb1.z + 0.031464696*nc1.z + -0.0041148905*nd1.z + -0.07126713*ne1.z + 0.057261378*nf1.z + -0.003973193*ng1.z + -0.016189586*nh1.z + 0.009429872*ni1.z; + float x = 0.08568026*na1.w + -0.0058499873*nb1.w + -0.044522725*nc1.w + 0.055148397*nd1.w + 0.015802909*ne1.w + 0.04047864*nf1.w + 0.13689119*ng1.w + 0.11317675*nh1.w + -0.045768175*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0064203455; + i = -0.032505844*a0.x + -0.06661497*b0.x + 0.023512855*c0.x + 0.0038409652*d0.x + -0.23903687*e0.x + -0.16547106*f0.x + 0.07911498*g0.x + 0.03786903*h0.x + 0.17299125*i0.x; + j = 0.040522475*a0.y + -0.03672423*b0.y + -0.08684519*c0.y + -4.828527e-06*d0.y + -0.0288446*e0.y + -0.11859806*f0.y + 0.022469537*g0.y + -0.10261296*h0.y + -0.081498824*i0.y; + k = 0.09966686*a0.z + -0.028391572*b0.z + -0.06806597*c0.z + 0.12051737*d0.z + -0.08948898*e0.z + 0.0077337893*f0.z + 0.04264053*g0.z + 0.24295592*h0.z + 0.07553067*i0.z; + l = -0.014257156*a0.w + -0.08241062*b0.w + 0.044526782*c0.w + -0.013082403*d0.w + 0.13204414*e0.w + -0.27255267*f0.w + -0.11447851*g0.w + -0.097617336*h0.w + 0.011688421*i0.w; + m = -0.14570348*a1.x + -0.06814128*b1.x + 0.05697731*c1.x + -0.05217858*d1.x + 0.1640323*e1.x + -0.09593827*f1.x + -0.12755282*g1.x + -0.086524084*h1.x + 0.008667198*i1.x; + n = -0.068069056*a1.y + -0.081919774*b1.y + 0.04359047*c1.y + -0.09954159*d1.y + -0.019505976*e1.y + -0.027422508*f1.y + 0.03656061*g1.y + 0.11309899*h1.y + 0.06715181*i1.y; + o = -0.11340588*a1.z + -0.051423706*b1.z + -0.19613335*c1.z + -0.13584042*d1.z + -0.023867423*e1.z + -0.2166873*f1.z + -0.12436677*g1.z + -0.3056145*h1.z + -0.07004896*i1.z; + p = 0.07956318*a1.w + 0.07576396*b1.w + 0.17090248*c1.w + 0.1677179*d1.w + 0.20357732*e1.w + 0.14348814*f1.w + 0.03334289*g1.w + 0.09176273*h1.w + -0.017910657*i1.w; + q = 0.026086422*na0.x + 0.097765036*nb0.x + 0.10587866*nc0.x + 0.01978553*nd0.x + 0.09502771*ne0.x + -0.012682824*nf0.x + -0.040875986*ng0.x + -0.0034920182*nh0.x + -0.19141385*ni0.x; + r = 0.04607431*na0.y + -0.009378766*nb0.y + 0.0012423345*nc0.y + -0.13031623*nd0.y + 0.040903624*ne0.y + 0.12283624*nf0.y + -0.09508061*ng0.y + -0.13311584*nh0.y + -0.16675362*ni0.y; + s = -0.063626915*na0.z + -0.10388871*nb0.z + -0.011007665*nc0.z + -0.027193287*nd0.z + 0.11276182*ne0.z + 0.076111704*nf0.z + -0.08517991*ng0.z + -0.21885648*nh0.z + 0.18072192*ni0.z; + t = -0.07872067*na0.w + 0.103839375*nb0.w + -0.08590919*nc0.w + 0.12628321*nd0.w + -0.17647605*ne0.w + -0.010150693*nf0.w + 0.1574605*ng0.w + 0.018935064*nh0.w + 0.046108305*ni0.w; + u = 0.11362486*na1.x + -0.020307075*nb1.x + -0.08245713*nc1.x + 0.091107495*nd1.x + 0.050005887*ne1.x + 0.042820398*nf1.x + 0.1548857*ng1.x + 0.009557177*nh1.x + -0.05151787*ni1.x; + v = -0.0028884336*na1.y + 0.15852699*nb1.y + -0.061137117*nc1.y + -0.023769902*nd1.y + -0.08125711*ne1.y + -0.14575318*nf1.y + -0.04427445*ng1.y + -0.03595139*nh1.y + -0.09431575*ni1.y; + w = -0.09712683*na1.z + -0.08819136*nb1.z + 0.08729634*nc1.z + -0.09290895*nd1.z + -0.010472437*ne1.z + 0.04311587*nf1.z + -0.049348596*ng1.z + 0.12841254*nh1.z + -0.013184504*ni1.z; + x = 0.2775273*na1.w + -0.07508342*nb1.w + -0.13421123*nc1.w + 0.048939656*nd1.w + -0.17091548*ne1.w + -0.097308844*nf1.w + -0.19330767*ng1.w + 0.072174154*nh1.w + 0.119323336*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.010473969; + i = -0.04255606*a0.x + 0.19455163*b0.x + -0.083725154*c0.x + 0.025356045*d0.x + -0.09469336*e0.x + 0.011819241*f0.x + 0.11374274*g0.x + -0.0053759404*h0.x + 0.21639374*i0.x; + j = 0.029581068*a0.y + -0.02986516*b0.y + 0.021204757*c0.y + -0.006031846*d0.y + -0.13951546*e0.y + -0.10485541*f0.y + -0.055438254*g0.y + -0.12904681*h0.y + -0.06661593*i0.y; + k = 0.042120147*a0.z + 0.076120056*b0.z + 0.058799937*c0.z + -0.0085356785*d0.z + -0.37842253*e0.z + 0.15116076*f0.z + -0.072133794*g0.z + 0.25175855*h0.z + 0.07849843*i0.z; + l = 0.07480219*a0.w + 0.026436467*b0.w + -0.05192802*c0.w + -0.20132145*d0.w + 0.046653923*e0.w + -0.057974514*f0.w + -0.18881139*g0.w + 0.03869617*h0.w + -0.05359312*i0.w; + m = 0.18609796*a1.x + -0.025107978*b1.x + -0.05485416*c1.x + -0.12506877*d1.x + 0.16311458*e1.x + 0.14975427*f1.x + 0.06121656*g1.x + 0.111572266*h1.x + -0.06902193*i1.x; + n = -0.09675723*a1.y + 0.03395821*b1.y + -0.10529792*c1.y + 0.08510861*d1.y + 0.001478931*e1.y + -0.019302577*f1.y + 0.11827853*g1.y + 0.01141932*h1.y + 0.058337122*i1.y; + o = 0.028637297*a1.z + 0.116889395*b1.z + -0.051687524*c1.z + 0.25920773*d1.z + -0.09955058*e1.z + -0.111958966*f1.z + -0.01542771*g1.z + 0.14032897*h1.z + 0.11228361*i1.z; + p = -0.102572076*a1.w + -0.10000578*b1.w + 0.010802064*c1.w + -0.17006679*d1.w + 0.28425327*e1.w + 0.09406719*f1.w + 0.12390108*g1.w + 0.01619186*h1.w + 0.030436736*i1.w; + q = -0.05434198*na0.x + -0.044370797*nb0.x + -0.07496158*nc0.x + 0.003799395*nd0.x + -0.01952927*ne0.x + -0.104056075*nf0.x + 0.02114818*ng0.x + 0.08832213*nh0.x + -0.073473066*ni0.x; + r = 0.117009945*na0.y + 0.053020813*nb0.y + -0.020469973*nc0.y + -0.0071595195*nd0.y + 0.11518942*ne0.y + 0.06417461*nf0.y + -0.10637551*ng0.y + 0.029846275*nh0.y + 0.017103193*ni0.y; + s = 0.026859421*na0.z + 0.033828203*nb0.z + -0.09990076*nc0.z + -0.18400614*nd0.z + 0.045542575*ne0.z + 0.007697366*nf0.z + -0.14255059*ng0.z + -0.17000173*nh0.z + 0.02396432*ni0.z; + t = 0.06297595*na0.w + -0.14622249*nb0.w + 0.019562326*nc0.w + -0.026149035*nd0.w + -0.20541689*ne0.w + -0.09325157*nf0.w + -0.015335166*ng0.w + -0.004904096*nh0.w + -0.023256762*ni0.w; + u = -0.19524229*na1.x + 0.14019871*nb1.x + 0.043756094*nc1.x + 0.05927864*nd1.x + -0.10984285*ne1.x + -0.07402525*nf1.x + 0.0091582425*ng1.x + 0.12954497*nh1.x + 0.035891227*ni1.x; + v = 0.16249649*na1.y + -0.11102605*nb1.y + 0.09617183*nc1.y + -0.1347269*nd1.y + 0.0038432048*ne1.y + 0.04074855*nf1.y + -0.084884845*ng1.y + -0.032651823*nh1.y + 0.023996437*ni1.y; + w = 0.09400437*na1.z + 0.05132347*nb1.z + -0.02254565*nc1.z + -0.052191116*nd1.z + -0.006187364*ne1.z + 0.12594841*nf1.z + 0.017266754*ng1.z + -0.05394334*nh1.z + 0.05234719*ni1.z; + x = -0.07382347*na1.w + 0.2015254*nb1.w + -0.021788929*nc1.w + -0.11237425*nd1.w + -0.06845667*ne1.w + -0.08814462*nf1.w + 0.21006493*ng1.w + -0.030658796*nh1.w + 0.020792674*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.013023297; + i = -0.035656873*a0.x + 0.29043454*b0.x + -0.093485475*c0.x + -0.088546365*d0.x + -0.18280011*e0.x + -0.08531151*f0.x + -0.08396969*g0.x + -0.12895977*h0.x + -0.13381611*i0.x; + j = 0.08109509*a0.y + 0.061622415*b0.y + 0.09512347*c0.y + 0.09760661*d0.y + 0.23493265*e0.y + -0.15241936*f0.y + 0.08086118*g0.y + 0.0482658*h0.y + 0.005154483*i0.y; + k = 0.08385953*a0.z + 0.23023549*b0.z + 0.10558045*c0.z + 0.12571234*d0.z + -0.12436785*e0.z + 0.11162487*f0.z + 0.25766334*g0.z + -0.04955883*h0.z + -0.038839206*i0.z; + l = -0.031077331*a0.w + 0.037581697*b0.w + 0.03739792*c0.w + -0.023134084*d0.w + 0.108166225*e0.w + -0.27240586*f0.w + 0.11235108*g0.w + 0.055221915*h0.w + -0.04974431*i0.w; + m = 0.050685987*a1.x + -0.0855947*b1.x + 0.114472255*c1.x + 0.21767192*d1.x + 0.06479547*e1.x + -0.111951314*f1.x + -0.20780368*g1.x + -0.24934538*h1.x + -0.018018583*i1.x; + n = -0.0223691*a1.y + -0.031400625*b1.y + -0.14545901*c1.y + -0.08056975*d1.y + 0.06659198*e1.y + -0.14099553*f1.y + -0.1574511*g1.y + -0.068153*h1.y + 0.03834908*i1.y; + o = -0.1388241*a1.z + 0.033197176*b1.z + -0.08693326*c1.z + -0.095407344*d1.z + -0.024903448*e1.z + -0.00516698*f1.z + 0.0051005622*g1.z + -0.20142871*h1.z + -0.17023231*i1.z; + p = -0.0391193*a1.w + -0.19792503*b1.w + -0.09035685*c1.w + -0.079474576*d1.w + 0.23703781*e1.w + 0.02854966*f1.w + 0.0572757*g1.w + -0.15615135*h1.w + 0.09795711*i1.w; + q = -0.07639385*na0.x + -0.13368028*nb0.x + 0.12966728*nc0.x + 0.0006021519*nd0.x + 0.35783088*ne0.x + 0.036377307*nf0.x + -0.13852029*ng0.x + -0.1278901*nh0.x + 0.07102291*ni0.x; + r = 0.12950456*na0.y + 0.13638775*nb0.y + 0.089563526*nc0.y + 0.0046526827*nd0.y + 0.22827531*ne0.y + 0.26544076*nf0.y + -0.053933237*ng0.y + -0.05662332*nh0.y + 0.13788679*ni0.y; + s = 0.05483395*na0.z + -0.10790315*nb0.z + -0.03360025*nc0.z + -0.010222414*nd0.z + -0.029511753*ne0.z + -0.24544497*nf0.z + 0.13202304*ng0.z + -0.33339366*nh0.z + 0.0014636389*ni0.z; + t = 0.051150147*na0.w + -0.06408108*nb0.w + -0.13684914*nc0.w + 0.17577235*nd0.w + -0.1577332*ne0.w + -0.1533534*nf0.w + -0.104082346*ng0.w + 0.102217875*nh0.w + 0.04462048*ni0.w; + u = -0.057499893*na1.x + 0.03404051*nb1.x + -0.09530944*nc1.x + -0.0014036942*nd1.x + 0.10787034*ne1.x + 0.12311618*nf1.x + 0.122414425*ng1.x + 0.105717205*nh1.x + 0.05405656*ni1.x; + v = 0.06136542*na1.y + 0.14106013*nb1.y + 0.15290134*nc1.y + 0.01512413*nd1.y + -0.12528025*ne1.y + -0.011202091*nf1.y + -0.06423187*ng1.y + 0.11118383*nh1.y + -0.09679467*ni1.y; + w = -0.011665277*na1.z + -0.07377728*nb1.z + 0.066744976*nc1.z + -0.054813497*nd1.z + -0.010954526*ne1.z + -0.01603292*nf1.z + -0.024203874*ng1.z + 0.12063812*nh1.z + -0.07406548*ni1.z; + x = -0.040362768*na1.w + 0.28191712*nb1.w + 0.1577795*nc1.w + 0.050058506*nd1.w + -0.29588038*ne1.w + 0.09272126*nf1.w + -0.32352138*ng1.w + -0.004645486*nh1.w + 0.10912149*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.005315338; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN30 +//!BIND LUMAN31 +//!SAVE LUMAN41 + +#define L0_tex LUMAN30_tex +#define L1_tex LUMAN31_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.05897486*a0.x + 0.27586955*b0.x + -0.056688223*c0.x + 0.07561018*d0.x + -0.10525086*e0.x + -0.24340199*f0.x + 0.06659864*g0.x + 0.06901837*h0.x + -0.013376588*i0.x; + float j = 0.014839147*a0.y + 0.10390609*b0.y + 0.1116336*c0.y + -0.014721822*d0.y + 0.07653417*e0.y + -0.1429016*f0.y + 0.064306565*g0.y + 0.052361738*h0.y + 0.0657451*i0.y; + float k = -0.07460744*a0.z + -0.085255824*b0.z + 0.041533597*c0.z + -0.008417165*d0.z + -0.18311697*e0.z + 0.04132524*f0.z + -0.12762608*g0.z + -0.0490694*h0.z + 0.021340536*i0.z; + float l = -0.1186136*a0.w + -0.22919929*b0.w + -0.013643524*c0.w + -0.20086412*d0.w + 0.013207006*e0.w + 0.11305753*f0.w + -0.12692404*g0.w + -0.0072910134*h0.w + -0.11241811*i0.w; + float m = -0.21522538*a1.x + -0.14833283*b1.x + -0.022969369*c1.x + -0.27716902*d1.x + 0.03638555*e1.x + -0.057161108*f1.x + -0.15450016*g1.x + -0.050380804*h1.x + 0.003395265*i1.x; + float n = 0.024632271*a1.y + 0.0382964*b1.y + 0.035003234*c1.y + 0.13437985*d1.y + -0.06140864*e1.y + -0.049475253*f1.y + 0.036768384*g1.y + -0.081538476*h1.y + -0.073716685*i1.y; + float o = 0.016729493*a1.z + -0.08793989*b1.z + -0.054102853*c1.z + 0.08820071*d1.z + -0.1565456*e1.z + -0.0405766*f1.z + -0.03476591*g1.z + 0.095920935*h1.z + -0.037696473*i1.z; + float p = 0.09913229*a1.w + 0.04506712*b1.w + 0.12394397*c1.w + -0.049859747*d1.w + 0.42513847*e1.w + -0.10907899*f1.w + 0.18546146*g1.w + -0.019482087*h1.w + -0.022588788*i1.w; + float q = 0.05428734*na0.x + -0.09825094*nb0.x + 0.07060548*nc0.x + -0.13419129*nd0.x + -0.28279778*ne0.x + 0.13844308*nf0.x + -0.043456554*ng0.x + -0.1443664*nh0.x + 0.06768429*ni0.x; + float r = 0.0012980829*na0.y + 0.03715222*nb0.y + -0.16464917*nc0.y + 0.1668546*nd0.y + -0.3276691*ne0.y + -0.07289079*nf0.y + 0.022440374*ng0.y + 0.1451005*nh0.y + -0.023447124*ni0.y; + float s = 0.064184375*na0.z + -0.06619485*nb0.z + -0.021960482*nc0.z + 0.021397583*nd0.z + 0.0736206*ne0.z + -0.090951815*nf0.z + 0.111692496*ng0.z + 0.00050554925*nh0.z + 0.08926067*ni0.z; + float t = 0.012369069*na0.w + 0.1951646*nb0.w + -0.020873873*nc0.w + 0.116908714*nd0.w + -0.48967528*ne0.w + -0.07455504*nf0.w + 0.15106396*ng0.w + -0.048980996*nh0.w + 0.030512914*ni0.w; + float u = 0.16899328*na1.x + 0.10447588*nb1.x + -0.009505267*nc1.x + 0.41911155*nd1.x + -0.009806482*ne1.x + -0.0030871788*nf1.x + 0.16966148*ng1.x + 0.037004367*nh1.x + 0.032864075*ni1.x; + float v = 0.09795996*na1.y + 0.002576914*nb1.y + -0.02554661*nc1.y + -0.15558101*nd1.y + -0.19964558*ne1.y + 0.022412546*nf1.y + -0.094990425*ng1.y + 0.08371083*nh1.y + 0.121753626*ni1.y; + float w = -0.010198556*na1.z + -0.027575629*nb1.z + 0.048614904*nc1.z + -0.050866783*nd1.z + 0.06520363*ne1.z + 0.07152051*nf1.z + -0.039514203*ng1.z + 0.00061794004*nh1.z + -0.04162527*ni1.z; + float x = 0.021820385*na1.w + -0.12759149*nb1.w + -0.050192278*nc1.w + 0.3388716*nd1.w + -0.35848868*ne1.w + 0.118803196*nf1.w + 0.007576073*ng1.w + 0.13519461*nh1.w + 0.012417935*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.005134705; + i = -0.012094228*a0.x + -0.037648804*b0.x + 0.018825721*c0.x + -0.056415178*d0.x + -0.1693265*e0.x + -0.3329496*f0.x + 0.04385037*g0.x + 0.24782597*h0.x + 0.024003597*i0.x; + j = 0.017770931*a0.y + 0.061245997*b0.y + 0.12247424*c0.y + 0.030261982*d0.y + -0.120891064*e0.y + 0.19610105*f0.y + -0.021305876*g0.y + 0.007743256*h0.y + -0.029186502*i0.y; + k = 0.011247433*a0.z + 0.26010805*b0.z + 0.005410956*c0.z + 0.1756328*d0.z + 0.52665186*e0.z + 0.019311607*f0.z + -0.22865027*g0.z + 0.018537138*h0.z + 0.28844747*i0.z; + l = 0.04707084*a0.w + -0.019024597*b0.w + 0.010127482*c0.w + 0.07881962*d0.w + -0.21882728*e0.w + -0.4462807*f0.w + -0.11017183*g0.w + 0.0014828485*h0.w + -0.055836964*i0.w; + m = -0.15131445*a1.x + -0.03349337*b1.x + 0.056926448*c1.x + 0.123288214*d1.x + -0.30359584*e1.x + -0.13110815*f1.x + -0.02858217*g1.x + -0.04218747*h1.x + -0.007281833*i1.x; + n = -0.000634909*a1.y + -0.09829987*b1.y + -0.12674282*c1.y + -0.18262619*d1.y + -0.20625703*e1.y + 0.027821977*f1.y + 0.04650851*g1.y + 0.036779493*h1.y + 0.044706035*i1.y; + o = -0.05769353*a1.z + -0.32191262*b1.z + -0.09332154*c1.z + -0.034158923*d1.z + -0.3178729*e1.z + -0.18241036*f1.z + -0.14834101*g1.z + -0.08815691*h1.z + -0.18666048*i1.z; + p = -0.034857456*a1.w + 0.13235937*b1.w + -0.00871079*c1.w + 0.09402437*d1.w + 0.22523633*e1.w + 0.18679704*f1.w + 0.14387223*g1.w + -0.061898142*h1.w + -0.017365128*i1.w; + q = -0.20398696*na0.x + 0.18950963*nb0.x + 0.045875635*nc0.x + -0.05545748*nd0.x + -0.47266406*ne0.x + -0.0478476*nf0.x + -0.0812568*ng0.x + -0.060154606*nh0.x + -0.06312032*ni0.x; + r = 0.19471812*na0.y + 0.34276626*nb0.y + -0.002011672*nc0.y + 0.08900145*nd0.y + 0.2595511*ne0.y + -0.24681035*nf0.y + -0.024882982*ng0.y + 0.02331316*nh0.y + -0.32200062*ni0.y; + s = 0.114582*na0.z + -0.19037218*nb0.z + -0.1417176*nc0.z + -0.10363403*nd0.z + -0.11044682*ne0.z + -0.059798382*nf0.z + 0.08371505*ng0.z + 0.44800338*nh0.z + 0.09965122*ni0.z; + t = -0.01947535*na0.w + -0.17559212*nb0.w + -0.033264827*nc0.w + 0.14829087*nd0.w + -0.19467528*ne0.w + 0.116288066*nf0.w + 0.1205474*ng0.w + 0.044752423*nh0.w + -0.031209234*ni0.w; + u = -0.004728546*na1.x + -0.13519558*nb1.x + -0.02461425*nc1.x + -0.073864736*nd1.x + 0.48404813*ne1.x + 0.088028006*nf1.x + 0.050297916*ng1.x + -0.008906264*nh1.x + -0.019913306*ni1.x; + v = 0.10467789*na1.y + 0.11910779*nb1.y + 0.15660498*nc1.y + -0.07719423*nd1.y + -0.1274165*ne1.y + -0.022373257*nf1.y + -0.059113465*ng1.y + 0.045096442*nh1.y + -0.027823227*ni1.y; + w = 0.06638856*na1.z + -0.032282606*nb1.z + -0.011439734*nc1.z + -0.07844197*nd1.z + 0.053250894*ne1.z + 0.07105429*nf1.z + -0.03597942*ng1.z + 0.101988435*nh1.z + 0.11831101*ni1.z; + x = 0.25001556*na1.w + -0.046163235*nb1.w + 0.064991914*nc1.w + 0.08997446*nd1.w + 0.022799926*ne1.w + -0.23605661*nf1.w + -0.09163479*ng1.w + -0.0658797*nh1.w + 0.22340213*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.028153285; + i = -0.05723475*a0.x + -0.25381944*b0.x + 0.17901848*c0.x + -0.014471504*d0.x + 0.35167104*e0.x + 0.08602924*f0.x + -0.11910211*g0.x + -0.17563531*h0.x + 0.04424879*i0.x; + j = -0.022332152*a0.y + -0.14992887*b0.y + 0.067525476*c0.y + 0.14036782*d0.y + -0.091856144*e0.y + 0.0013875823*f0.y + -0.016366925*g0.y + -0.20222068*h0.y + 0.13036513*i0.y; + k = 0.04965131*a0.z + 0.03841196*b0.z + 0.10992083*c0.z + 0.3528956*d0.z + 0.24185915*e0.z + -0.23682235*f0.z + 0.25822678*g0.z + 0.26567867*h0.z + 0.040070523*i0.z; + l = 0.005208211*a0.w + -0.088146344*b0.w + 0.011741281*c0.w + 0.18548676*d0.w + 0.20249239*e0.w + -0.10297989*f0.w + 0.043873258*g0.w + 0.010360001*h0.w + 0.080844186*i0.w; + m = 0.11925185*a1.x + -0.002130104*b1.x + -0.0017537178*c1.x + -0.119089566*d1.x + 0.09701926*e1.x + 0.02401391*f1.x + -0.21442156*g1.x + 0.030856185*h1.x + -0.024846844*i1.x; + n = 0.033464372*a1.y + -0.0017296523*b1.y + -0.17002295*c1.y + 0.1224641*d1.y + 0.2461822*e1.y + 0.26922768*f1.y + -0.032281265*g1.y + -0.08174399*h1.y + -0.024631953*i1.y; + o = -0.010928469*a1.z + 0.040003847*b1.z + -0.009050721*c1.z + -0.18532535*d1.z + 0.117428556*e1.z + -0.054807805*f1.z + 0.3688676*g1.z + -0.20925143*h1.z + -0.12101665*i1.z; + p = -0.050080348*a1.w + -0.023793569*b1.w + -0.046359524*c1.w + -0.46156624*d1.w + -0.084235124*e1.w + 0.170481*f1.w + -0.34520224*g1.w + 0.08081779*h1.w + 0.046790455*i1.w; + q = -0.013522426*na0.x + 0.08664619*nb0.x + 0.040773723*nc0.x + -0.29594067*nd0.x + -0.43927056*ne0.x + -0.23970877*nf0.x + -0.071083836*ng0.x + 0.022856604*nh0.x + -0.083344005*ni0.x; + r = -0.06762164*na0.y + 0.48516664*nb0.y + 0.2361623*nc0.y + -0.2992352*nd0.y + -0.42049935*ne0.y + -0.08378619*nf0.y + -0.18655877*ng0.y + -0.2691026*nh0.y + -0.15376762*ni0.y; + s = -0.116502166*na0.z + 0.10032056*nb0.z + -0.09566259*nc0.z + -0.18851502*nd0.z + 0.30246553*ne0.z + 0.0009529123*nf0.z + -0.09874099*ng0.z + -0.2364732*nh0.z + 0.11826255*ni0.z; + t = -0.03493555*na0.w + -0.035773568*nb0.w + -0.12659708*nc0.w + -0.16138509*nd0.w + -0.07105405*ne0.w + 0.09101966*nf0.w + 0.24660683*ng0.w + -0.0061035194*nh0.w + -0.040358752*ni0.w; + u = 0.057612475*na1.x + -0.015996441*nb1.x + 0.004548848*nc1.x + -0.108426526*nd1.x + -0.10091294*ne1.x + -0.012472666*nf1.x + -0.021699939*ng1.x + 0.07560604*nh1.x + -0.024083558*ni1.x; + v = -0.14357498*na1.y + 0.15821618*nb1.y + 0.21333988*nc1.y + -0.041154474*nd1.y + -0.07063476*ne1.y + -0.20110704*nf1.y + 0.10822521*ng1.y + 0.11874143*nh1.y + -0.011279268*ni1.y; + w = -0.018583542*na1.z + -0.11350155*nb1.z + 0.01832477*nc1.z + 0.21990615*nd1.z + 0.022556763*ne1.z + 0.11403346*nf1.z + -0.20918418*ng1.z + 0.12558801*nh1.z + 0.037197538*ni1.z; + x = 0.06027407*na1.w + 0.15575232*nb1.w + 0.15703124*nc1.w + -0.102149114*nd1.w + 0.3785688*ne1.w + -0.2512173*nf1.w + -0.047505885*ng1.w + 0.11199537*nh1.w + -0.033578023*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.024645254; + i = -0.11315129*a0.x + -0.13970152*b0.x + -0.0106838625*c0.x + -0.16662036*d0.x + 0.0351158*e0.x + -0.3236344*f0.x + -0.10745606*g0.x + 0.10335738*h0.x + 0.060342573*i0.x; + j = 0.05034862*a0.y + -0.03773915*b0.y + -0.11317716*c0.y + -0.1319167*d0.y + -0.2557561*e0.y + -0.37108675*f0.y + -0.121097684*g0.y + -0.017232087*h0.y + -0.29864594*i0.y; + k = -0.17640741*a0.z + -0.05367414*b0.z + -0.1096958*c0.z + -0.15220755*d0.z + -0.39255792*e0.z + -0.042989623*f0.z + -0.08857472*g0.z + -0.07308339*h0.z + 0.12683356*i0.z; + l = 0.04818234*a0.w + 0.011259093*b0.w + -0.13971567*c0.w + 0.20727336*d0.w + 0.300634*e0.w + 0.15203673*f0.w + 0.045851354*g0.w + -0.021859625*h0.w + 0.14271338*i0.w; + m = -0.05115792*a1.x + -0.030130638*b1.x + 0.012354536*c1.x + -0.20207289*d1.x + 0.24113736*e1.x + 0.07546829*f1.x + 0.054056752*g1.x + 0.22468947*h1.x + 0.18395297*i1.x; + n = -0.016631735*a1.y + 0.14029092*b1.y + 0.1094122*c1.y + -0.21489155*d1.y + 0.030756673*e1.y + 0.08403406*f1.y + 0.029142294*g1.y + -0.15179269*h1.y + 0.06422021*i1.y; + o = 0.060144097*a1.z + -0.05253342*b1.z + -0.08916168*c1.z + 0.11863635*d1.z + -0.13244452*e1.z + -0.20428996*f1.z + -0.02991306*g1.z + -0.11285724*h1.z + 0.23592609*i1.z; + p = -0.022924347*a1.w + 0.08029266*b1.w + 0.1295117*c1.w + 0.27471703*d1.w + 0.21181649*e1.w + 0.26830688*f1.w + -0.011267695*g1.w + 0.13833974*h1.w + -0.22575748*i1.w; + q = 0.06332978*na0.x + 0.19778712*nb0.x + -0.14630173*nc0.x + 0.2022106*nd0.x + -0.043443214*ne0.x + 0.013244423*nf0.x + -0.029920608*ng0.x + 0.15498282*nh0.x + -0.008860152*ni0.x; + r = -0.071186095*na0.y + -0.0046415976*nb0.y + 0.09588473*nc0.y + -0.054782644*nd0.y + -0.30131996*ne0.y + 0.09571458*nf0.y + -0.11756927*ng0.y + -0.25668737*nh0.y + 0.029054785*ni0.y; + s = 0.010182304*na0.z + -0.17348135*nb0.z + 0.046391185*nc0.z + -0.15667062*nd0.z + -0.16666505*ne0.z + 0.16067432*nf0.z + -0.1326823*ng0.z + 0.21085083*nh0.z + 0.1455272*ni0.z; + t = 0.058360394*na0.w + 0.053739175*nb0.w + 0.08894498*nc0.w + -0.281138*nd0.w + -0.1887361*ne0.w + 0.12640464*nf0.w + -0.04298481*ng0.w + -0.24676816*nh0.w + 0.05571448*ni0.w; + u = 0.16053072*na1.x + 0.32601315*nb1.x + 0.095457345*nc1.x + 0.19869359*nd1.x + 0.0041162316*ne1.x + -0.0006917916*nf1.x + 0.28368276*ng1.x + -0.091511145*nh1.x + -0.03113108*ni1.x; + v = -0.04926926*na1.y + -0.13931896*nb1.y + -0.21816307*nc1.y + 0.112340935*nd1.y + -0.14673282*ne1.y + -0.059623435*nf1.y + 0.070587724*ng1.y + 0.008949842*nh1.y + -0.027426368*ni1.y; + w = 0.109189294*na1.z + -0.009112803*nb1.z + -0.017429749*nc1.z + -0.06363286*nd1.z + -0.19273286*ne1.z + 0.043292988*nf1.z + -0.034082536*ng1.z + 0.20947897*nh1.z + 0.055061273*ni1.z; + x = -0.08175211*na1.w + -0.019585626*nb1.w + -0.051631507*nc1.w + -0.39735416*nd1.w + 0.1588689*ne1.w + -0.073861524*nf1.w + 0.18975042*ng1.w + -0.1963924*nh1.w + 0.035963826*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0140123125; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN40 +//!BIND LUMAN41 +//!SAVE LUMAN50 + +#define L0_tex LUMAN40_tex +#define L1_tex LUMAN41_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.035612535*a0.x + 0.04017731*b0.x + 0.20536023*c0.x + 0.06875523*d0.x + -0.031420883*e0.x + 0.42573005*f0.x + 0.061643112*g0.x + 0.18023333*h0.x + 0.5605257*i0.x; + float j = 0.01814264*a0.y + 0.016944267*b0.y + 0.1220235*c0.y + 0.16802199*d0.y + 0.10004153*e0.y + -0.012133044*f0.y + 0.07105161*g0.y + 0.12237441*h0.y + 0.004510387*i0.y; + float k = 0.004186747*a0.z + -0.12970294*b0.z + 0.0044008605*c0.z + 0.03908641*d0.z + -0.18611148*e0.z + 0.00087365374*f0.z + 0.11857353*g0.z + 0.027568813*h0.z + 0.05604513*i0.z; + float l = -0.028001549*a0.w + 0.11514266*b0.w + -0.07945613*c0.w + -0.15281484*d0.w + 0.13567261*e0.w + -0.014678198*f0.w + 0.059029147*g0.w + 0.0054495637*h0.w + -0.025024548*i0.w; + float m = -0.011409999*a1.x + -0.015341942*b1.x + 0.114741184*c1.x + 0.012083291*d1.x + 0.08023752*e1.x + 0.34920374*f1.x + -0.047863945*g1.x + 0.2432634*h1.x + -0.090446465*i1.x; + float n = -0.08555583*a1.y + -0.0007628947*b1.y + 0.07811802*c1.y + -0.10136344*d1.y + -0.03125326*e1.y + -0.0033468457*f1.y + -0.08859198*g1.y + -0.021236353*h1.y + 0.044894487*i1.y; + float o = -0.022154905*a1.z + 0.0154149085*b1.z + 0.02057002*c1.z + 0.069081895*d1.z + 0.08480116*e1.z + 0.013921394*f1.z + -0.02094114*g1.z + 0.00068823615*h1.z + -0.12001934*i1.z; + float p = -0.028961627*a1.w + 0.051715665*b1.w + -0.03176729*c1.w + -0.1386012*d1.w + 0.106838785*e1.w + -0.10906675*f1.w + 0.027086709*g1.w + -0.12217284*h1.w + -0.040965617*i1.w; + float q = 0.059872124*na0.x + 0.14022045*nb0.x + 0.02607862*nc0.x + -0.21362531*nd0.x + -0.08310274*ne0.x + 0.11169541*nf0.x + -0.12575342*ng0.x + -0.3680999*nh0.x + -0.070986785*ni0.x; + float r = 0.048685316*na0.y + 0.007329649*nb0.y + -0.16210833*nc0.y + -0.2781075*nd0.y + -0.3511886*ne0.y + -0.029574253*nf0.y + -0.12877542*ng0.y + -0.075404786*nh0.y + -0.0987583*ni0.y; + float s = -0.018988824*na0.z + 0.2942867*nb0.z + 0.042009376*nc0.z + -0.22772476*nd0.z + 0.0050454373*ne0.z + -0.068424255*nf0.z + -0.04001246*ng0.z + -0.022675836*nh0.z + 0.034189373*ni0.z; + float t = -0.045849156*na0.w + -0.068379305*nb0.w + 0.16441053*nc0.w + -0.0360953*nd0.w + -0.018031951*ne0.w + 0.089194946*nf0.w + -0.05944052*ng0.w + 0.039005104*nh0.w + 0.0449217*ni0.w; + float u = -0.08554041*na1.x + -0.10273593*nb1.x + -0.05450196*nc1.x + -0.0049457126*nd1.x + -0.24735165*ne1.x + -0.033856906*nf1.x + -0.04789079*ng1.x + -0.124637336*nh1.x + 0.028094016*ni1.x; + float v = 0.010685325*na1.y + 0.075002894*nb1.y + -0.07482232*nc1.y + 0.08389421*nd1.y + -0.031178487*ne1.y + -0.000977765*nf1.y + 0.12105572*ng1.y + 0.16234533*nh1.y + 0.109915555*ni1.y; + float w = 0.009669741*na1.z + -0.01547055*nb1.z + -0.15011303*nc1.z + -0.100489765*nd1.z + -0.12212056*ne1.z + 0.023505995*nf1.z + 0.045761496*ng1.z + 0.0017781933*nh1.z + 0.015155669*ni1.z; + float x = -0.001148341*na1.w + -0.21386683*nb1.w + -0.013807217*nc1.w + 0.120531775*nd1.w + -0.07378633*ne1.w + 0.10549616*nf1.w + -0.028720537*ng1.w + 0.04982669*nh1.w + -0.09549333*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.013112524; + i = -0.008850011*a0.x + -0.053074952*b0.x + 0.2744104*c0.x + 0.02612702*d0.x + -0.15895297*e0.x + 0.09991879*f0.x + 0.20669703*g0.x + 0.15539402*h0.x + -0.05046773*i0.x; + j = -0.046442796*a0.y + -0.07005078*b0.y + -0.042570863*c0.y + 0.08206181*d0.y + 0.3786237*e0.y + -0.019612692*f0.y + 0.08563863*g0.y + 0.13863519*h0.y + 0.20874031*i0.y; + k = 0.039513156*a0.z + -0.21471843*b0.z + 0.03774025*c0.z + -0.07815786*d0.z + 0.008676453*e0.z + -0.017183626*f0.z + -0.09989854*g0.z + -0.12806281*h0.z + 0.03840211*i0.z; + l = 0.029019121*a0.w + -0.1129284*b0.w + 0.01011583*c0.w + -0.12016837*d0.w + 0.007712074*e0.w + 0.016819015*f0.w + 0.07030448*g0.w + -0.033610865*h0.w + -0.0459375*i0.w; + m = -0.04275781*a1.x + -0.018200489*b1.x + -0.10315262*c1.x + 0.06556069*d1.x + 0.14088795*e1.x + -0.23484154*f1.x + -0.12515117*g1.x + -0.06998259*h1.x + 0.07224344*i1.x; + n = 0.017037492*a1.y + 0.06304942*b1.y + -0.016848698*c1.y + -0.06799698*d1.y + -0.3415319*e1.y + 0.02610139*f1.y + -0.1217599*g1.y + -0.053102333*h1.y + 0.011076662*i1.y; + o = -0.02913676*a1.z + -0.012321229*b1.z + -0.017936712*c1.z + -0.09636114*d1.z + -0.13355324*e1.z + 0.09698391*f1.z + -0.06536401*g1.z + -0.045358505*h1.z + -0.04125653*i1.z; + p = -0.031567413*a1.w + -0.12853059*b1.w + -0.03921569*c1.w + 0.074788004*d1.w + 0.14571433*e1.w + -0.00066722726*f1.w + -0.016363356*g1.w + -0.01901327*h1.w + -0.1046701*i1.w; + q = -0.0009567858*na0.x + -0.041390944*nb0.x + 0.010207388*nc0.x + 0.11404937*nd0.x + -0.23463163*ne0.x + -0.023602346*nf0.x + -0.15303922*ng0.x + -0.009046193*nh0.x + 0.08103048*ni0.x; + r = 0.017589236*na0.y + 0.15609305*nb0.y + 0.045721974*nc0.y + -0.13058934*nd0.y + -0.2679451*ne0.y + 0.011950594*nf0.y + -0.22449987*ng0.y + -0.1917914*nh0.y + -0.11365412*ni0.y; + s = 0.19348381*na0.z + 0.24570563*nb0.z + 0.019962208*nc0.z + 0.0014589598*nd0.z + 0.07886757*ne0.z + 0.14932665*nf0.z + 0.16708276*ng0.z + 0.18550636*nh0.z + -0.0067473818*ni0.z; + t = -0.0065101734*na0.w + -0.040736493*nb0.w + -0.041270405*nc0.w + 0.07618738*nd0.w + 0.0218949*ne0.w + -0.04766936*nf0.w + 0.09532495*ng0.w + 0.10562779*nh0.w + 0.07444872*ni0.w; + u = -0.051368568*na1.x + -0.15848117*nb1.x + -0.18546471*nc1.x + -0.12092587*nd1.x + -0.05082287*ne1.x + -0.08485216*nf1.x + 0.03221051*ng1.x + -0.05053332*nh1.x + -0.09860819*ni1.x; + v = 0.029384093*na1.y + -0.06750876*nb1.y + 0.018348627*nc1.y + 0.08856726*nd1.y + 0.4350653*ne1.y + 0.06356879*nf1.y + 0.08271615*ng1.y + 0.008104969*nh1.y + -0.018670512*ni1.y; + w = -0.011343069*na1.z + -0.11651827*nb1.z + -0.08994046*nc1.z + -0.06221274*nd1.z + -0.037247933*ne1.z + -0.14539322*nf1.z + 0.021901105*ng1.z + 0.005052073*nh1.z + 0.10261775*ni1.z; + x = 0.002017023*na1.w + 0.07701929*nb1.w + -0.06421878*nc1.w + -0.11461471*nd1.w + 0.09813192*ne1.w + -0.09010211*nf1.w + -0.14889443*ng1.w + 0.049384467*nh1.w + 0.12307971*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.042553633; + i = 0.09314597*a0.x + 0.13171728*b0.x + 0.19819239*c0.x + -0.12970911*d0.x + 0.29927254*e0.x + 0.21767391*f0.x + 0.17249553*g0.x + 0.25350404*h0.x + 0.4911293*i0.x; + j = 0.118306145*a0.y + -0.0047325366*b0.y + 0.06604017*c0.y + -0.07435545*d0.y + -0.21104847*e0.y + 0.120903485*f0.y + 0.007448092*g0.y + 0.02675702*h0.y + -0.018381957*i0.y; + k = 0.11446292*a0.z + 0.045590237*b0.z + 0.18081953*c0.z + -0.17427047*d0.z + -0.35203543*e0.z + 0.02689046*f0.z + 0.009454167*g0.z + 0.12534736*h0.z + 0.035864905*i0.z; + l = -0.13871336*a0.w + 0.000110143475*b0.w + 0.016679386*c0.w + -0.008853473*d0.w + 0.03879449*e0.w + -0.039120965*f0.w + -0.09930874*g0.w + -0.1000116*h0.w + 0.09242047*i0.w; + m = -0.044360902*a1.x + 0.08391946*b1.x + 0.11027122*c1.x + 0.0073652584*d1.x + 0.09692701*e1.x + 0.2119457*f1.x + 0.036328424*g1.x + -0.019593457*h1.x + -0.107490614*i1.x; + n = -0.0125782965*a1.y + 0.20825994*b1.y + 0.23127447*c1.y + 0.0072191535*d1.y + 0.1447853*e1.y + 0.15627444*f1.y + -0.07684372*g1.y + 0.19135267*h1.y + -0.06037572*i1.y; + o = -0.029698756*a1.z + 0.053750448*b1.z + 0.06339778*c1.z + -0.030724516*d1.z + 0.043275952*e1.z + 0.18226287*f1.z + -0.006794373*g1.z + 0.072466105*h1.z + -0.024686977*i1.z; + p = -0.056785114*a1.w + -0.103406094*b1.w + -0.20727181*c1.w + -0.039523434*d1.w + -0.17240427*e1.w + -0.19204095*f1.w + -0.10694597*g1.w + -0.2649955*h1.w + -0.06132428*i1.w; + q = 0.0039332574*na0.x + 0.05026292*nb0.x + 0.046305656*nc0.x + 0.18708026*nd0.x + -0.28327677*ne0.x + 0.070439406*nf0.x + -0.18838173*ng0.x + -0.09740024*nh0.x + 0.13081598*ni0.x; + r = 0.09294847*na0.y + 0.35245818*nb0.y + 0.061874304*nc0.y + -0.13571835*nd0.y + 0.09223242*ne0.y + 0.004823584*nf0.y + -0.048575934*ng0.y + -0.08550897*nh0.y + -0.18647256*ni0.y; + s = 0.0587695*na0.z + 0.19384533*nb0.z + -0.09999857*nc0.z + 0.050346695*nd0.z + -0.07080002*ne0.z + -0.020419646*nf0.z + -0.08622975*ng0.z + -0.22737212*nh0.z + -0.012951568*ni0.z; + t = 0.24028173*na0.w + 0.057572372*nb0.w + 0.12549803*nc0.w + 0.010931657*nd0.w + 0.3212349*ne0.w + 0.20082182*nf0.w + 0.054529183*ng0.w + 0.12963445*nh0.w + 0.12043251*ni0.w; + u = -0.105689935*na1.x + -0.107305124*nb1.x + -0.15378787*nc1.x + 0.04664972*nd1.x + 0.08102327*ne1.x + -0.20562561*nf1.x + -0.041195456*ng1.x + 0.018099809*nh1.x + -0.040376134*ni1.x; + v = -0.01487915*na1.y + -0.09081166*nb1.y + -0.13099758*nc1.y + -0.12701605*nd1.y + -0.2193587*ne1.y + -0.016810827*nf1.y + 0.055257153*ng1.y + -0.024633544*nh1.y + 0.09994283*ni1.y; + w = 0.20626432*na1.z + 0.12838879*nb1.z + -0.14225093*nc1.z + -0.028794078*nd1.z + 0.19917117*ne1.z + 0.044698376*nf1.z + 0.082005724*ng1.z + 0.15631491*nh1.z + 0.12103039*ni1.z; + x = -0.059040707*na1.w + -0.14747858*nb1.w + -0.037346754*nc1.w + -0.11842503*nd1.w + -0.16885588*ne1.w + 0.06594487*nf1.w + 0.089308925*ng1.w + 0.052808817*nh1.w + -0.08821508*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.029102776; + i = -0.11209577*a0.x + 0.14418902*b0.x + 0.07912491*c0.x + -0.02995134*d0.x + 0.07840223*e0.x + 0.120897666*f0.x + -0.1381869*g0.x + -0.15199783*h0.x + -0.0057939785*i0.x; + j = 0.038522664*a0.y + -0.04430634*b0.y + 0.014930398*c0.y + -0.078924544*d0.y + 0.032821495*e0.y + -0.15034387*f0.y + 0.09948224*g0.y + 0.046257578*h0.y + 0.03698673*i0.y; + k = 0.021408146*a0.z + 0.17502472*b0.z + 0.022271572*c0.z + -0.00613615*d0.z + 0.08999399*e0.z + 0.010229765*f0.z + 0.11082286*g0.z + 0.14384252*h0.z + -0.009855277*i0.z; + l = 0.06253465*a0.w + 0.073090926*b0.w + 0.07494987*c0.w + 0.037831865*d0.w + 0.3061816*e0.w + 0.17264585*f0.w + -0.0014333117*g0.w + 0.07528909*h0.w + -0.071264625*i0.w; + m = -0.05418183*a1.x + -0.11523262*b1.x + -0.06851412*c1.x + 0.01028219*d1.x + -0.4530031*e1.x + 0.12992333*f1.x + -0.14678968*g1.x + -0.065828115*h1.x + 0.06610601*i1.x; + n = 0.007039626*a1.y + -0.04067319*b1.y + 0.039445095*c1.y + -0.043049503*d1.y + 0.098197125*e1.y + -0.16465133*f1.y + -0.03092959*g1.y + 0.0021357106*h1.y + 0.062050033*i1.y; + o = 0.06942289*a1.z + 0.1167464*b1.z + -0.016325492*c1.z + 0.0014870387*d1.z + 0.08062883*e1.z + -0.03982079*f1.z + -0.04291324*g1.z + -0.0065602884*h1.z + -0.10709311*i1.z; + p = 0.033238105*a1.w + -0.03832345*b1.w + 0.07635184*c1.w + -0.0098485*d1.w + -0.0005796845*e1.w + 0.021684904*f1.w + -0.09704172*g1.w + -0.054971114*h1.w + -0.01928706*i1.w; + q = -0.12458046*na0.x + 0.06652665*nb0.x + 0.060793605*nc0.x + -0.20750596*nd0.x + -0.07342202*ne0.x + 0.20712708*nf0.x + 0.0987297*ng0.x + -0.11710979*nh0.x + 0.017415684*ni0.x; + r = 0.055106472*na0.y + 0.27876937*nb0.y + 0.016087595*nc0.y + -0.0055158874*nd0.y + -0.021120023*ne0.y + 0.032101106*nf0.y + 0.094017655*ng0.y + 0.022162251*nh0.y + -0.04368556*ni0.y; + s = -0.13121118*na0.z + -0.047029372*nb0.z + -0.06184597*nc0.z + -0.09755456*nd0.z + -0.28179955*ne0.z + 0.003410392*nf0.z + -0.10697052*ng0.z + -0.11528157*nh0.z + 0.013775394*ni0.z; + t = -0.083358206*na0.w + 0.03872297*nb0.w + -0.041483015*nc0.w + -0.13377745*nd0.w + -0.22119187*ne0.w + -0.09595053*nf0.w + -0.006479464*ng0.w + -0.05508277*nh0.w + 0.08092169*ni0.w; + u = -0.0037866305*na1.x + -0.066144735*nb1.x + 0.1064194*nc1.x + 0.07637622*nd1.x + 0.31042975*ne1.x + 0.29661596*nf1.x + 0.045302957*ng1.x + 0.0042874413*nh1.x + -0.07085192*ni1.x; + v = -0.04648092*na1.y + 0.035114635*nb1.y + -0.02674536*nc1.y + 0.039049216*nd1.y + -0.14902431*ne1.y + 0.11379347*nf1.y + -0.07022612*ng1.y + 0.11715015*nh1.y + 0.04028414*ni1.y; + w = -0.015916107*na1.z + 0.051527347*nb1.z + -0.011901495*nc1.z + -0.006465481*nd1.z + 0.06552145*ne1.z + 0.04144042*nf1.z + -0.006796157*ng1.z + 0.025898159*nh1.z + -0.0007850506*ni1.z; + x = 0.011756395*na1.w + -0.07946773*nb1.w + -0.045221303*nc1.w + 0.0052964273*nd1.w + -0.22804372*ne1.w + -0.1162836*nf1.w + -0.012282788*ng1.w + -0.06438151*nh1.w + -0.057280466*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0026127724; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN40 +//!BIND LUMAN41 +//!SAVE LUMAN51 + +#define L0_tex LUMAN40_tex +#define L1_tex LUMAN41_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.058341313*a0.x + -0.21506369*b0.x + 0.01969202*c0.x + -0.0054663033*d0.x + -0.40020138*e0.x + 0.1285723*f0.x + 0.027146779*g0.x + -0.29534942*h0.x + -0.065372*i0.x; + float j = 0.026859052*a0.y + -0.07099255*b0.y + -0.0399993*c0.y + 0.11942047*d0.y + 0.34605628*e0.y + 0.05976046*f0.y + 0.055970136*g0.y + -0.004091986*h0.y + -0.16493514*i0.y; + float k = -0.07908727*a0.z + 0.04415421*b0.z + -0.15355754*c0.z + 0.1129772*d0.z + 0.33453822*e0.z + -0.14832681*f0.z + 0.082989015*g0.z + 0.071731575*h0.z + 0.18906988*i0.z; + float l = -0.09066858*a0.w + -0.11348159*b0.w + -0.0021799193*c0.w + 0.0013052556*d0.w + 0.06459756*e0.w + -0.03326646*f0.w + 0.035330385*g0.w + -0.14535238*h0.w + 0.12517998*i0.w; + float m = -0.009239749*a1.x + -0.045440555*b1.x + 0.07250618*c1.x + 0.023130517*d1.x + 0.10688969*e1.x + 0.10387453*f1.x + -0.09824478*g1.x + 0.016347708*h1.x + -0.057189398*i1.x; + float n = -0.055576593*a1.y + 0.054272186*b1.y + 0.004727247*c1.y + -0.06652871*d1.y + -0.16520706*e1.y + -0.16452906*f1.y + -0.09373078*g1.y + 0.11094564*h1.y + 0.049136963*i1.y; + float o = -0.025956787*a1.z + -0.096835725*b1.z + 0.037478585*c1.z + -0.05188841*d1.z + -0.106625505*e1.z + -0.11583477*f1.z + -0.020436885*g1.z + -0.031691026*h1.z + -0.07146676*i1.z; + float p = 0.07959005*a1.w + 0.029714286*b1.w + 0.08986918*c1.w + 0.1256378*d1.w + 0.25168374*e1.w + 0.09286637*f1.w + 0.075563334*g1.w + -0.030476464*h1.w + 0.0834733*i1.w; + float q = 0.08110389*na0.x + -0.0055321003*nb0.x + -0.011466603*nc0.x + -0.076089986*nd0.x + 0.24084151*ne0.x + -0.09002664*nf0.x + -0.07916691*ng0.x + -0.057236582*nh0.x + 0.015564612*ni0.x; + float r = -0.08872573*na0.y + -0.05498289*nb0.y + 0.031930678*nc0.y + -0.17136955*nd0.y + -0.35136038*ne0.y + -0.2618554*nf0.y + 0.018345961*ng0.y + 0.022003971*nh0.y + 0.042457905*ni0.y; + float s = 0.028178586*na0.z + 0.060931925*nb0.z + 0.06884443*nc0.z + 0.03218537*nd0.z + -0.258666*ne0.z + 0.1666093*nf0.z + -0.011844073*ng0.z + 0.015975356*nh0.z + -0.087677285*ni0.z; + float t = 0.08933054*na0.w + 0.16106002*nb0.w + -0.06288805*nc0.w + -0.054834746*nd0.w + -0.18805434*ne0.w + -0.047614172*nf0.w + -0.12941436*ng0.w + 0.03589237*nh0.w + -0.18264498*ni0.w; + float u = 0.0130687915*na1.x + 0.0151407365*nb1.x + 0.07099842*nc1.x + 0.024692902*nd1.x + -0.15270196*ne1.x + 0.11206766*nf1.x + 0.12255809*ng1.x + 0.060980264*nh1.x + 0.035168886*ni1.x; + float v = 0.08796369*na1.y + -0.05019335*nb1.y + -0.00079465396*nc1.y + 0.23707964*nd1.y + 0.056615967*ne1.y + 0.13510074*nf1.y + 0.06192575*ng1.y + 0.0559245*nh1.y + -0.02031479*ni1.y; + float w = -0.07471332*na1.z + 0.061358225*nb1.z + -0.034596812*nc1.z + -0.032788627*nd1.z + -0.08333219*ne1.z + -0.10440432*nf1.z + -0.03931595*ng1.z + -0.049613044*nh1.z + -0.053474206*ni1.z; + float x = -0.022343067*na1.w + -0.13285586*nb1.w + 0.024529492*nc1.w + -0.17635131*nd1.w + -0.2814951*ne1.w + -0.041839745*nf1.w + -0.036626995*ng1.w + 0.076569855*nh1.w + 0.040817678*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.009945548; + i = 0.0736856*a0.x + -0.0032100477*b0.x + 0.1492096*c0.x + 0.077228*d0.x + 0.26272488*e0.x + 0.057036564*f0.x + -0.05616672*g0.x + 0.17332815*h0.x + 0.035774574*i0.x; + j = -0.05845697*a0.y + 0.1549392*b0.y + 0.023617486*c0.y + 0.04493254*d0.y + -0.15356177*e0.y + 0.004977352*f0.y + -0.108943984*g0.y + 0.17687424*h0.y + -0.054177612*i0.y; + k = 0.0759221*a0.z + 0.15608083*b0.z + 0.12887464*c0.z + -0.018616863*d0.z + -0.23259711*e0.z + 0.06419663*f0.z + -0.005241023*g0.z + -0.051844392*h0.z + 0.10750178*i0.z; + l = 0.0036690442*a0.w + 0.05987606*b0.w + 0.07125578*c0.w + -0.13141707*d0.w + 0.02256273*e0.w + -0.020214377*f0.w + 0.007948303*g0.w + -0.079753816*h0.w + 0.07354992*i0.w; + m = 0.051859725*a1.x + -0.034709375*b1.x + -0.029387208*c1.x + -0.026496835*d1.x + -0.07617418*e1.x + 0.1247166*f1.x + -0.022847766*g1.x + -0.022378957*h1.x + 0.0007826007*i1.x; + n = -0.01812967*a1.y + 0.030523093*b1.y + 0.0023419647*c1.y + 0.15735936*d1.y + 0.0825415*e1.y + 0.07909621*f1.y + 0.13551788*g1.y + 0.010991528*h1.y + 0.029551538*i1.y; + o = 0.03864655*a1.z + 0.07395166*b1.z + 0.06528245*c1.z + 0.04649426*d1.z + 0.15720278*e1.z + 0.06673369*f1.z + 0.012719491*g1.z + 0.0075968713*h1.z + -0.033163235*i1.z; + p = -0.06660658*a1.w + -0.09621747*b1.w + -0.053015623*c1.w + -0.10868584*d1.w + -0.03617085*e1.w + -0.11382697*f1.w + -0.025376456*g1.w + -0.1425686*h1.w + -0.08685108*i1.w; + q = -0.026217438*na0.x + 0.15754505*nb0.x + -0.0091019645*nc0.x + -0.014831991*nd0.x + 0.16862741*ne0.x + 0.051979672*nf0.x + 0.12961973*ng0.x + 0.08616495*nh0.x + 0.08113077*ni0.x; + r = 0.089784846*na0.y + -0.059764784*nb0.y + 0.0643469*nc0.y + 0.07526015*nd0.y + 0.06560973*ne0.y + 0.031762443*nf0.y + 0.0008978316*ng0.y + -0.07231055*nh0.y + -0.01281584*ni0.y; + s = -0.08091763*na0.z + -0.054681346*nb0.z + -0.05769879*nc0.z + -0.06746802*nd0.z + 0.10993811*ne0.z + -0.072969966*nf0.z + -0.01040533*ng0.z + -0.03965281*nh0.z + -0.11912891*ni0.z; + t = 0.014088187*na0.w + -0.019559423*nb0.w + 0.038119223*nc0.w + 0.1502782*nd0.w + 0.16802892*ne0.w + 0.08819164*nf0.w + 0.04723983*ng0.w + 0.06890399*nh0.w + 0.034448624*ni0.w; + u = -0.0858311*na1.x + -0.058720604*nb1.x + -0.035645936*nc1.x + 0.019476032*nd1.x + 0.05014742*ne1.x + -0.07904676*nf1.x + -0.068997994*ng1.x + -0.026701262*nh1.x + -0.0018194377*ni1.x; + v = -0.023095097*na1.y + 0.023309603*nb1.y + 0.008035192*nc1.y + -0.14357762*nd1.y + -0.07056337*ne1.y + -0.04978034*nf1.y + -0.011420839*ng1.y + -0.10852049*nh1.y + 0.0003215605*ni1.y; + w = 0.04865363*na1.z + 0.054601*nb1.z + -0.04116284*nc1.z + 0.027501578*nd1.z + -0.055441584*ne1.z + -0.03507437*nf1.z + 0.001497289*ng1.z + 0.06957507*nh1.z + 0.10106299*ni1.z; + x = 0.06623774*na1.w + -0.0014704927*nb1.w + -0.013376718*nc1.w + 0.1173909*nd1.w + -0.153007*ne1.w + 0.038331937*nf1.w + 0.0053380616*ng1.w + 0.23239858*nh1.w + -0.035740767*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.026452431; + i = -0.019092122*a0.x + -0.09086277*b0.x + 0.23840043*c0.x + -0.0072265393*d0.x + 0.028365666*e0.x + 0.04606777*f0.x + 0.28634426*g0.x + 0.13639422*h0.x + 0.15366435*i0.x; + j = 0.01497688*a0.y + 0.051576726*b0.y + 0.012609459*c0.y + -0.003204774*d0.y + 0.07865389*e0.y + -0.043380044*f0.y + -0.022966493*g0.y + 0.060422853*h0.y + -0.13592103*i0.y; + k = -0.019054832*a0.z + -0.12396902*b0.z + 0.06679998*c0.z + 0.015159906*d0.z + -0.17882915*e0.z + -0.013451344*f0.z + -0.037844297*g0.z + 0.044634007*h0.z + 0.09841763*i0.z; + l = 0.1242496*a0.w + 0.14570023*b0.w + -0.0536087*c0.w + 0.0058937743*d0.w + -0.18741275*e0.w + -0.05405417*f0.w + 0.11184961*g0.w + -0.06134286*h0.w + 0.09723279*i0.w; + m = -0.039362982*a1.x + -0.079569794*b1.x + 0.09229459*c1.x + 0.12174467*d1.x + -0.26060775*e1.x + 0.045963716*f1.x + -0.048531428*g1.x + -0.009784208*h1.x + -0.08540155*i1.x; + n = -0.042776912*a1.y + 0.05803079*b1.y + 0.0009079167*c1.y + -0.10837513*d1.y + 0.03783227*e1.y + 0.03751572*f1.y + -0.11406614*g1.y + 0.059730146*h1.y + 0.07586286*i1.y; + o = -0.037720762*a1.z + -0.0010612243*b1.z + 0.10598368*c1.z + -0.054114938*d1.z + -0.31531176*e1.z + 0.008115098*f1.z + 0.014513204*g1.z + -0.020305524*h1.z + -0.0532531*i1.z; + p = -0.0015348935*a1.w + -0.0136528*b1.w + -0.049160857*c1.w + -0.01870342*d1.w + 0.04801573*e1.w + -0.003977191*f1.w + 0.015746452*g1.w + -0.12886392*h1.w + 0.024754394*i1.w; + q = 0.007092857*na0.x + -0.08710648*nb0.x + 0.015883893*nc0.x + 0.15110812*nd0.x + -0.5903739*ne0.x + 0.117669456*nf0.x + -0.18934238*ng0.x + -0.21404389*nh0.x + 0.11136142*ni0.x; + r = -0.25414848*na0.y + -0.17851315*nb0.y + 0.052724008*nc0.y + -0.29529995*nd0.y + -0.0861469*ne0.y + -0.0726801*nf0.y + -0.056918535*ng0.y + -0.09571194*nh0.y + -0.008321754*ni0.y; + s = -0.054942016*na0.z + 0.056283783*nb0.z + -0.10146946*nc0.z + -0.20149462*nd0.z + 0.2615956*ne0.z + -0.060734283*nf0.z + 0.072493576*ng0.z + 0.013873488*nh0.z + -0.05927832*ni0.z; + t = -0.02162006*na0.w + -0.13530779*nb0.w + 0.015482059*nc0.w + -0.0032522178*nd0.w + 0.21423261*ne0.w + 0.0285138*nf0.w + -0.13833298*ng0.w + 0.11485339*nh0.w + -0.070087075*ni0.w; + u = 0.0038275998*na1.x + 0.13350129*nb1.x + -0.112879656*nc1.x + 0.01186888*nd1.x + 0.6276104*ne1.x + -0.12892282*nf1.x + 0.013344215*ng1.x + 0.10528361*nh1.x + 0.13124417*ni1.x; + v = 0.055806052*na1.y + -0.06348023*nb1.y + 0.02085426*nc1.y + 0.08150835*nd1.y + -0.1556977*ne1.y + 0.029980408*nf1.y + 0.052578572*ng1.y + -0.022157064*nh1.y + -0.002322045*ni1.y; + w = 0.012891871*na1.z + -0.022318032*nb1.z + -0.13572417*nc1.z + -0.06485001*nd1.z + 0.16181162*ne1.z + -0.06267603*nf1.z + 0.0011934403*ng1.z + 0.070938624*nh1.z + 0.01252789*ni1.z; + x = 0.026072396*na1.w + -0.010732958*nb1.w + 0.046689223*nc1.w + -0.13713975*nd1.w + 0.1539983*ne1.w + -0.054844245*nf1.w + -0.08702756*ng1.w + 0.05541185*nh1.w + -0.030015115*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.001493891; + i = -0.2029684*a0.x + -0.5433984*b0.x + -0.3404616*c0.x + 0.052867394*d0.x + -0.3473272*e0.x + -0.15649731*f0.x + -0.23871002*g0.x + -0.1109204*h0.x + -0.22829787*i0.x; + j = 0.044766348*a0.y + 0.0075613745*b0.y + -0.24642573*c0.y + 0.06352247*d0.y + -0.08041809*e0.y + -0.03975498*f0.y + -0.075066246*g0.y + -0.071659416*h0.y + -0.15419307*i0.y; + k = 0.13883616*a0.z + 0.38315442*b0.z + -0.07305248*c0.z + 0.11842109*d0.z + -0.12933512*e0.z + -0.06339081*f0.z + -0.061098322*g0.z + -0.011412765*h0.z + 0.021311197*i0.z; + l = -0.107254796*a0.w + 0.1133037*b0.w + 0.09230633*c0.w + 0.15860972*d0.w + 0.048703972*e0.w + -0.04537395*f0.w + 0.111755155*g0.w + 0.18001053*h0.w + -0.04715647*i0.w; + m = -0.030681103*a1.x + -0.01730047*b1.x + -0.00261708*c1.x + -0.08639173*d1.x + -0.23224998*e1.x + 0.04507707*f1.x + -0.08558757*g1.x + -0.06275244*h1.x + 0.036656402*i1.x; + n = -0.037630294*a1.y + -0.14100103*b1.y + -0.20430483*c1.y + 0.033603456*d1.y + 0.16065453*e1.y + -0.0001391955*f1.y + 0.18134886*g1.y + -0.14686634*h1.y + 0.041554898*i1.y; + o = -0.10045714*a1.z + -0.192881*b1.z + -0.05901973*c1.z + -0.20419008*d1.z + -0.050205123*e1.z + -0.17184749*f1.z + 0.06792742*g1.z + 0.00396447*h1.z + -0.010734883*i1.z; + p = 0.06347656*a1.w + 0.055015985*b1.w + 0.1896647*c1.w + 0.1223147*d1.w + 0.391878*e1.w + 0.15969121*f1.w + 0.09271096*g1.w + 0.1580006*h1.w + 0.024834886*i1.w; + q = 0.18948026*na0.x + -0.0008232371*nb0.x + 0.14355972*nc0.x + 0.420433*nd0.x + -0.30479485*ne0.x + 0.11691138*nf0.x + 0.22751662*ng0.x + -0.06334774*nh0.x + -0.10960608*ni0.x; + r = -0.10958855*na0.y + -0.104264155*nb0.y + 0.030050436*nc0.y + 0.15551548*nd0.y + -0.103276476*ne0.y + -0.09604516*nf0.y + 0.0502458*ng0.y + 0.18014862*nh0.y + 0.08645385*ni0.y; + s = 0.004778244*na0.z + -0.15352857*nb0.z + 0.076735005*nc0.z + -0.030288707*nd0.z + 0.32527444*ne0.z + -0.021542786*nf0.z + 0.056891233*ng0.z + 0.029728781*nh0.z + 0.073643975*ni0.z; + t = -0.10808804*na0.w + -0.020803692*nb0.w + -0.080507904*nc0.w + -0.024862716*nd0.w + -0.4074744*ne0.w + -0.0013651325*nf0.w + -0.038106095*ng0.w + -0.33806917*nh0.w + -0.121994264*ni0.w; + u = 0.09291953*na1.x + 0.08922977*nb1.x + 0.13398977*nc1.x + 0.1743847*nd1.x + 0.36668244*ne1.x + 0.16027638*nf1.x + 0.10165976*ng1.x + 0.16359653*nh1.x + 0.15654418*ni1.x; + v = 0.15836778*na1.y + 0.07225184*nb1.y + 0.14402899*nc1.y + -0.058226164*nd1.y + -0.08563047*ne1.y + -0.13314581*nf1.y + -0.23650183*ng1.y + -0.13838924*nh1.y + -0.02972749*ni1.y; + w = -0.11585181*na1.z + -0.036293514*nb1.z + 0.16113761*nc1.z + 0.1201051*nd1.z + -0.15653205*ne1.z + 0.014206818*nf1.z + -0.035099678*ng1.z + -0.09631885*nh1.z + -0.083426096*ni1.z; + x = -0.002398999*na1.w + 0.04186464*nb1.w + 0.03738504*nc1.w + -0.1793729*nd1.w + 0.022120971*ne1.w + 0.021679237*nf1.w + -0.036145337*ng1.w + -0.0013587712*nh1.w + -0.04066518*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.013275004; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN50 +//!BIND LUMAN51 +//!SAVE LUMAN60 + +#define L0_tex LUMAN50_tex +#define L1_tex LUMAN51_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.0023328534*a0.x + 0.064793706*b0.x + 0.13137315*c0.x + -0.08144926*d0.x + 0.10695711*e0.x + -0.0755808*f0.x + 0.03415385*g0.x + -0.08380857*h0.x + 0.07275955*i0.x; + float j = -0.100906454*a0.y + -0.016975228*b0.y + 0.08030283*c0.y + 0.07125107*d0.y + 0.209759*e0.y + 0.1479306*f0.y + 0.06908754*g0.y + -0.076900385*h0.y + 0.03856468*i0.y; + float k = -0.046562966*a0.z + 0.09214668*b0.z + 0.035977118*c0.z + 0.109999955*d0.z + 0.11875673*e0.z + -0.020831538*f0.z + 0.13520765*g0.z + 0.08756613*h0.z + 0.014693053*i0.z; + float l = -0.065421455*a0.w + -0.107463524*b0.w + 0.016045967*c0.w + 0.018637523*d0.w + 0.052398868*e0.w + 0.2073138*f0.w + 0.076807156*g0.w + 0.2412724*h0.w + 0.054381493*i0.w; + float m = -0.021103308*a1.x + 0.024509076*b1.x + -0.042548016*c1.x + -0.13146673*d1.x + -0.022827815*e1.x + -0.066952296*f1.x + 0.10200906*g1.x + -0.091980994*h1.x + -0.06296656*i1.x; + float n = 0.2139278*a1.y + 0.22893451*b1.y + 0.09091571*c1.y + 0.04707812*d1.y + 0.33085123*e1.y + 0.25524098*f1.y + 0.18050957*g1.y + 0.11280443*h1.y + 0.013663248*i1.y; + float o = 0.04662038*a1.z + 0.020816704*b1.z + -0.060241304*c1.z + 0.030631166*d1.z + 0.13896711*e1.z + -0.08040418*f1.z + -0.12400517*g1.z + -0.012480961*h1.z + -0.025484385*i1.z; + float p = -0.099704094*a1.w + -0.06509334*b1.w + -0.018391868*c1.w + 0.0033737472*d1.w + 0.019923119*e1.w + -0.04522104*f1.w + -0.004225413*g1.w + -0.123058476*h1.w + -0.10244464*i1.w; + float q = -0.007825052*na0.x + -0.027427772*nb0.x + -0.015301882*nc0.x + 0.1567665*nd0.x + -0.06912613*ne0.x + 0.015112322*nf0.x + 0.12380591*ng0.x + 0.041814685*nh0.x + -0.026952421*ni0.x; + float r = 0.057297777*na0.y + -0.07565621*nb0.y + -0.0783251*nc0.y + -0.08975966*nd0.y + -0.06767529*ne0.y + -0.14912416*nf0.y + -0.1419718*ng0.y + -0.024593588*nh0.y + -0.057069726*ni0.y; + float s = 0.16402707*na0.z + 0.123968214*nb0.z + 0.055898797*nc0.z + 0.0049678953*nd0.z + 0.116354525*ne0.z + 0.1302255*nf0.z + -0.13494058*ng0.z + 0.22029555*nh0.z + 0.07076266*ni0.z; + float t = 0.14263879*na0.w + 0.16390547*nb0.w + 0.13133223*nc0.w + -0.025501277*nd0.w + 0.022351695*ne0.w + -0.0669175*nf0.w + -0.011532269*ng0.w + -0.18873638*nh0.w + -0.087589785*ni0.w; + float u = -0.07297858*na1.x + -0.15550973*nb1.x + 0.0047679497*nc1.x + -0.035416875*nd1.x + -0.08521186*ne1.x + -0.041888446*nf1.x + -0.0717547*ng1.x + -0.04631239*nh1.x + 0.010076916*ni1.x; + float v = 0.05423491*na1.y + -0.21764006*nb1.y + -0.107588634*nc1.y + -0.12051383*nd1.y + -0.06299794*ne1.y + -0.05008003*nf1.y + -0.0055367723*ng1.y + 0.016887318*nh1.y + 0.13362682*ni1.y; + float w = -0.1068631*na1.z + 0.034638334*nb1.z + -0.009606332*nc1.z + -0.09290256*nd1.z + -0.16951458*ne1.z + 0.11512481*nf1.z + 0.058622256*ng1.z + -0.093306124*nh1.z + -0.091385804*ni1.z; + float x = 0.09943962*na1.w + 0.046493366*nb1.w + -0.010393254*nc1.w + 0.021576924*nd1.w + 0.046211373*ne1.w + -0.023459839*nf1.w + -0.029110817*ng1.w + -0.0026221299*nh1.w + 0.045499146*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0044076787; + i = 0.046037015*a0.x + -0.20014718*b0.x + -0.050648395*c0.x + 0.14622693*d0.x + 0.04686424*e0.x + 0.115389556*f0.x + -0.09658768*g0.x + 0.113019705*h0.x + -0.08457916*i0.x; + j = 0.04837194*a0.y + 0.017981997*b0.y + -0.057005353*c0.y + 0.11208802*d0.y + -0.27299806*e0.y + 0.253538*f0.y + 0.1579276*g0.y + 0.18482813*h0.y + -0.0030665721*i0.y; + k = 0.025618808*a0.z + -0.014753779*b0.z + 0.11424065*c0.z + -0.039130658*d0.z + -0.077596694*e0.z + -0.06189349*f0.z + -0.00055544026*g0.z + -0.0030258696*h0.z + -0.03805638*i0.z; + l = 0.0396419*a0.w + -0.08394604*b0.w + -0.0958592*c0.w + -0.052551508*d0.w + -0.14271393*e0.w + -0.21775384*f0.w + 0.064173386*g0.w + -0.2541221*h0.w + 0.12580013*i0.w; + m = -0.062242437*a1.x + -0.05984731*b1.x + 0.07177733*c1.x + -0.0010727174*d1.x + -0.2148164*e1.x + 0.17201327*f1.x + -0.08118757*g1.x + -0.02247559*h1.x + 0.10099783*i1.x; + n = -0.027749883*a1.y + -0.10161952*b1.y + -0.122889414*c1.y + -0.064740315*d1.y + 0.23500724*e1.y + -0.043876413*f1.y + -0.1109669*g1.y + 0.06332242*h1.y + -0.046353713*i1.y; + o = -0.0050889878*a1.z + 0.028743066*b1.z + 0.14333661*c1.z + -0.0038749718*d1.z + 0.04225466*e1.z + 0.08372675*f1.z + -0.026901118*g1.z + -0.057206213*h1.z + -0.11625423*i1.z; + p = 0.06871033*a1.w + -0.036982935*b1.w + 0.008396837*c1.w + 0.049070083*d1.w + 0.16440327*e1.w + 0.028823575*f1.w + 0.015017149*g1.w + 0.047464818*h1.w + 0.15167558*i1.w; + q = 0.058808442*na0.x + 0.07618759*nb0.x + -0.07531338*nc0.x + -0.21605514*nd0.x + -0.23420495*ne0.x + -0.31268212*nf0.x + -0.051698856*ng0.x + -0.11017567*nh0.x + 0.11262677*ni0.x; + r = -0.03518726*na0.y + 0.06715704*nb0.y + 0.049414575*nc0.y + -0.03147147*nd0.y + 0.10408503*ne0.y + 0.015476035*nf0.y + -0.09080876*ng0.y + -0.1327499*nh0.y + 0.037832085*ni0.y; + s = -0.0049664024*na0.z + 0.01783228*nb0.z + -0.09306831*nc0.z + 0.02966074*nd0.z + -0.13659412*ne0.z + 0.103386335*nf0.z + 0.0039585214*ng0.z + -0.10475919*nh0.z + -0.07868313*ni0.z; + t = -0.027448364*na0.w + 0.049910434*nb0.w + 0.04629656*nc0.w + 0.04606205*nd0.w + -0.08058761*ne0.w + 0.19123064*nf0.w + -0.03994525*ng0.w + 0.07180471*nh0.w + -0.11458842*ni0.w; + u = 0.08074149*na1.x + 0.16658387*nb1.x + 0.08585271*nc1.x + 0.06220538*nd1.x + 0.025161874*ne1.x + 0.002386364*nf1.x + 0.07634237*ng1.x + 0.014812471*nh1.x + -0.03701967*ni1.x; + v = -0.0418336*na1.y + -0.056149974*nb1.y + -0.091469795*nc1.y + 0.1307059*nd1.y + -0.37983438*ne1.y + -0.5405711*nf1.y + 0.024360469*ng1.y + 0.21794999*nh1.y + -0.20875533*ni1.y; + w = -0.02660547*na1.z + -0.13768345*nb1.z + -0.0033622494*nc1.z + -0.022334186*nd1.z + -0.03950232*ne1.z + 0.021272644*nf1.z + 0.028884187*ng1.z + 0.13566218*nh1.z + 0.017871113*ni1.z; + x = -0.07330508*na1.w + 0.026229024*nb1.w + -0.011504151*nc1.w + -0.019414637*nd1.w + -0.14128768*ne1.w + 0.16297776*nf1.w + 0.069985695*ng1.w + 0.061362997*nh1.w + 0.084847815*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0041278936; + i = -0.05720563*a0.x + 0.057983294*b0.x + 0.0339593*c0.x + 0.064571634*d0.x + -0.20921943*e0.x + -0.013970842*f0.x + 0.026166726*g0.x + -0.041072275*h0.x + 0.01610475*i0.x; + j = -0.11969899*a0.y + -0.024872895*b0.y + 0.098103285*c0.y + 0.07863271*d0.y + 0.031222403*e0.y + -0.114472054*f0.y + 0.08776073*g0.y + 0.1264496*h0.y + 0.0402211*i0.y; + k = -0.030170271*a0.z + 0.0018764718*b0.z + -0.027332861*c0.z + 0.062330324*d0.z + 0.10290415*e0.z + 0.14791936*f0.z + 0.045651324*g0.z + 0.117724515*h0.z + 0.21746355*i0.z; + l = -0.048120335*a0.w + 0.037827358*b0.w + 0.015677916*c0.w + 0.039548885*d0.w + 0.038568195*e0.w + -0.023876693*f0.w + -0.0026781922*g0.w + -0.12731688*h0.w + -0.089386*i0.w; + m = -0.050546445*a1.x + 0.04402385*b1.x + -0.01841782*c1.x + -0.17501399*d1.x + -0.1780696*e1.x + -0.1347531*f1.x + -0.013775902*g1.x + 0.15184507*h1.x + 0.067993574*i1.x; + n = 0.06067288*a1.y + 0.020058522*b1.y + 0.0064884624*c1.y + -0.23260388*d1.y + -0.28992143*e1.y + -0.07061862*f1.y + -0.034785822*g1.y + -0.0793457*h1.y + -0.23899145*i1.y; + o = 0.022000503*a1.z + -0.071197905*b1.z + -0.049395315*c1.z + -0.0069849472*d1.z + 0.28265312*e1.z + 0.0645686*f1.z + -0.075388685*g1.z + -0.3408368*h1.z + -0.046410777*i1.z; + p = -0.0073897485*a1.w + -0.0030118083*b1.w + -0.055616233*c1.w + 0.075406134*d1.w + 0.023296187*e1.w + 0.22175246*f1.w + -0.039796658*g1.w + 0.08415068*h1.w + 0.11574001*i1.w; + q = -0.0464031*na0.x + -0.09764388*nb0.x + -0.08282094*nc0.x + -0.117494546*nd0.x + 0.18278615*ne0.x + 0.060395755*nf0.x + 0.016666938*ng0.x + 0.065874204*nh0.x + -0.05239314*ni0.x; + r = 0.055310417*na0.y + -0.037919335*nb0.y + 0.005939001*nc0.y + -0.034767736*nd0.y + 0.31564963*ne0.y + -0.072183535*nf0.y + -0.17022869*ng0.y + -0.33137664*nh0.y + -0.124336995*ni0.y; + s = 0.023502233*na0.z + 0.07160557*nb0.z + 0.096604556*nc0.z + -0.024247825*nd0.z + -0.24521804*ne0.z + -0.14877447*nf0.z + -0.050775077*ng0.z + -0.2936305*nh0.z + -0.15759036*ni0.z; + t = 0.048754975*na0.w + -0.023362307*nb0.w + -0.009928164*nc0.w + -0.026300179*nd0.w + -0.09734495*ne0.w + -0.06623416*nf0.w + -0.07600827*ng0.w + 0.08001888*nh0.w + 0.05388996*ni0.w; + u = -0.040832303*na1.x + 0.008556898*nb1.x + 0.0011466276*nc1.x + 0.1837227*nd1.x + 0.2568269*ne1.x + 0.050614744*nf1.x + 0.033623144*ng1.x + -0.08975142*nh1.x + -0.072304465*ni1.x; + v = -0.031529695*na1.y + -0.08658768*nb1.y + -0.062140666*nc1.y + 0.19025032*nd1.y + 0.21660827*ne1.y + 0.050144237*nf1.y + 0.07365049*ng1.y + 0.26017582*nh1.y + 0.2243008*ni1.y; + w = 0.03566439*na1.z + 0.1348235*nb1.z + 0.019010197*nc1.z + -0.018993806*nd1.z + -0.28596598*ne1.z + 0.0075408868*nf1.z + 0.09171176*ng1.z + 0.2642931*nh1.z + 0.071677156*ni1.z; + x = 0.019524738*na1.w + -0.025530815*nb1.w + 0.009337825*nc1.w + -0.077851355*nd1.w + -0.06228772*ne1.w + -0.056282073*nf1.w + 0.09834586*ng1.w + 0.022084989*nh1.w + -0.09770484*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.008795879; + i = 0.011957833*a0.x + 0.24993116*b0.x + -0.002682511*c0.x + 0.09202492*d0.x + -0.058194473*e0.x + 0.20236294*f0.x + -0.045782674*g0.x + 0.18085079*h0.x + -0.0007733444*i0.x; + j = 0.06615865*a0.y + 0.06730262*b0.y + -0.15511134*c0.y + -0.056761254*d0.y + 0.16833608*e0.y + 0.29652697*f0.y + 0.07208219*g0.y + 0.12632033*h0.y + 0.08936451*i0.y; + k = -0.035943326*a0.z + -0.010642242*b0.z + 0.086488046*c0.z + 0.012203811*d0.z + 0.31983772*e0.z + -0.024014914*f0.z + 0.018321209*g0.z + 0.100251*h0.z + 0.13954958*i0.z; + l = -0.0104503175*a0.w + -0.20468268*b0.w + -0.12733395*c0.w + -0.014340496*d0.w + -0.0012792454*e0.w + -0.105142586*f0.w + -0.03303492*g0.w + -0.012410842*h0.w + 0.01961328*i0.w; + m = 0.00015735891*a1.x + -0.26152962*b1.x + -0.003443904*c1.x + -0.09770607*d1.x + 0.044304006*e1.x + 0.023186417*f1.x + 0.0044261245*g1.x + -0.07075799*h1.x + -0.056546647*i1.x; + n = -0.026539521*a1.y + 0.29586637*b1.y + 0.31409112*c1.y + -0.14105357*d1.y + 0.18564008*e1.y + 0.21619162*f1.y + 0.19983022*g1.y + 0.01797262*h1.y + -0.028071435*i1.y; + o = 0.037473988*a1.z + -0.04496412*b1.z + -0.11825187*c1.z + -0.10086509*d1.z + 0.15808839*e1.z + -0.44962603*f1.z + -0.01843067*g1.z + -0.16569562*h1.z + -0.11665053*i1.z; + p = -0.036413506*a1.w + 0.10740355*b1.w + -0.06874833*c1.w + -0.04672398*d1.w + 0.16801305*e1.w + -0.04901428*f1.w + -0.025827173*g1.w + -0.04907921*h1.w + 0.11648403*i1.w; + q = 0.014651736*na0.x + 0.09767451*nb0.x + 0.0364797*nc0.x + 0.031390887*nd0.x + 0.2291563*ne0.x + -0.20164289*nf0.x + 0.06956926*ng0.x + -0.027178623*nh0.x + 0.06383271*ni0.x; + r = 0.002828036*na0.y + -0.09226963*nb0.y + -0.12876321*nc0.y + -0.109815165*nd0.y + 0.033563435*ne0.y + -0.17216623*nf0.y + -0.06648531*ng0.y + -0.18780257*nh0.y + -0.032364648*ni0.y; + s = -0.006287264*na0.z + 0.00123886*nb0.z + -0.015670354*nc0.z + 0.019913454*nd0.z + -0.06438532*ne0.z + 0.17462069*nf0.z + 0.004444823*ng0.z + -0.061344486*nh0.z + -0.1289914*ni0.z; + t = -0.032365125*na0.w + 0.13831198*nb0.w + 0.1960693*nc0.w + -0.12155524*nd0.w + 0.0853176*ne0.w + 0.075043015*nf0.w + -0.0654051*ng0.w + 0.05241946*nh0.w + -0.095316775*ni0.w; + u = -0.023895213*na1.x + 0.053995147*nb1.x + -0.16778684*nc1.x + 0.14444508*nd1.x + 0.5284899*ne1.x + -0.09535227*nf1.x + 0.07941243*ng1.x + -0.04506495*nh1.x + -0.05838371*ni1.x; + v = -0.116331026*na1.y + 0.25320458*nb1.y + 0.04314606*nc1.y + -0.055427276*nd1.y + 0.41488975*ne1.y + -0.21635123*nf1.y + -0.09031083*ng1.y + -0.012773467*nh1.y + 0.14210652*ni1.y; + w = -0.073841624*na1.z + -0.025932856*nb1.z + -0.085170485*nc1.z + -0.04061003*nd1.z + -0.5516947*ne1.z + -0.18175714*nf1.z + -0.091636725*ng1.z + 0.06229114*nh1.z + -0.0422904*ni1.z; + x = 0.048132446*na1.w + -0.13811083*nb1.w + 0.11206705*nc1.w + 0.03338064*nd1.w + -0.30970797*ne1.w + 0.06381431*nf1.w + -0.0042102467*ng1.w + 0.00956657*nh1.w + 0.011325626*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.03872577; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN50 +//!BIND LUMAN51 +//!SAVE LUMAN61 + +#define L0_tex LUMAN50_tex +#define L1_tex LUMAN51_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.033646833*a0.x + 0.10032702*b0.x + 0.07672664*c0.x + -0.15228283*d0.x + 0.14604108*e0.x + -0.009682619*f0.x + -0.017508494*g0.x + -0.20209043*h0.x + -0.0009521017*i0.x; + float j = -0.010476165*a0.y + 0.033324443*b0.y + 0.14461902*c0.y + 0.06183721*d0.y + 0.15421857*e0.y + -0.12802331*f0.y + 0.027586345*g0.y + 0.0124696875*h0.y + 0.0016373133*i0.y; + float k = -0.08886994*a0.z + -0.073300235*b0.z + -0.005404674*c0.z + -0.05893552*d0.z + -0.014138546*e0.z + -0.061251454*f0.z + -0.036440812*g0.z + 0.08436395*h0.z + 0.13597581*i0.z; + float l = 0.03857152*a0.w + 0.011185113*b0.w + 0.0418685*c0.w + -0.12713286*d0.w + -0.12497824*e0.w + 0.12187931*f0.w + 0.01143971*g0.w + 0.1531618*h0.w + -0.005094794*i0.w; + float m = 0.16493323*a1.x + -0.16790906*b1.x + -0.007424873*c1.x + -0.019737665*d1.x + 0.32541034*e1.x + -0.10551009*f1.x + 0.06748345*g1.x + -0.07619556*h1.x + -0.0016914528*i1.x; + float n = -0.05048458*a1.y + -0.04336667*b1.y + 0.102540255*c1.y + -0.019675344*d1.y + -0.2230414*e1.y + 0.19778657*f1.y + -0.0056847017*g1.y + -0.1403332*h1.y + -0.021340592*i1.y; + float o = 0.040324245*a1.z + 0.03067326*b1.z + -0.06488181*c1.z + 0.13678902*d1.z + -0.15534002*e1.z + -0.23447587*f1.z + -0.014251697*g1.z + -0.14344667*h1.z + 0.058199186*i1.z; + float p = -0.07156001*a1.w + 0.03541768*b1.w + -0.08873371*c1.w + -0.15883322*d1.w + -0.22011177*e1.w + -0.06520788*f1.w + -0.054262646*g1.w + -0.050970685*h1.w + -0.031258497*i1.w; + float q = 0.04146114*na0.x + 0.080761746*nb0.x + 0.019592429*nc0.x + 0.28116655*nd0.x + 0.096100524*ne0.x + 0.10228331*nf0.x + 0.0628159*ng0.x + 0.14551347*nh0.x + 0.082707345*ni0.x; + float r = 0.047835153*na0.y + -0.04882955*nb0.y + -0.01197105*nc0.y + 0.06759022*nd0.y + -0.122022025*ne0.y + -0.046007633*nf0.y + -0.09565734*ng0.y + -0.036093384*nh0.y + 0.015027891*ni0.y; + float s = 0.069905534*na0.z + -0.009022554*nb0.z + 0.058666833*nc0.z + 0.024865663*nd0.z + -0.029687501*ne0.z + 0.05235234*nf0.z + 0.05337345*ng0.z + 0.032454923*nh0.z + -0.097156495*ni0.z; + float t = 0.023648677*na0.w + -0.11085765*nb0.w + 0.12138889*nc0.w + 0.06495529*nd0.w + 0.24705039*ne0.w + 0.0144702485*nf0.w + -0.037593596*ng0.w + -0.07377362*nh0.w + 0.037110664*ni0.w; + float u = -0.17177041*na1.x + 0.010452884*nb1.x + -0.005489181*nc1.x + 0.036922168*nd1.x + -0.106774*ne1.x + -0.024845233*nf1.x + 0.050368562*ng1.x + -0.0774007*nh1.x + -0.0862494*ni1.x; + float v = 0.1375543*na1.y + 0.1324469*nb1.y + 0.085171565*nc1.y + -0.16165945*nd1.y + 0.37410375*ne1.y + 0.13893189*nf1.y + 0.01579091*ng1.y + -0.12340413*nh1.y + 0.2030766*ni1.y; + float w = 0.0025532034*na1.z + 0.108326204*nb1.z + 0.02649299*nc1.z + -0.06487767*nd1.z + 0.2726464*ne1.z + 0.006244928*nf1.z + 0.014532157*ng1.z + 0.04829693*nh1.z + -0.053479*ni1.z; + float x = 0.108156756*na1.w + 0.019954557*nb1.w + 0.018787293*nc1.w + 0.17868373*nd1.w + 0.12412388*ne1.w + -0.064045176*nf1.w + -0.01769105*ng1.w + -0.040720694*nh1.w + -0.07799191*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.000862047; + i = -0.039971568*a0.x + -0.13860865*b0.x + 0.059578743*c0.x + 0.054580357*d0.x + 0.07117097*e0.x + 0.0058385846*f0.x + -0.03902884*g0.x + -0.11318809*h0.x + -0.111597575*i0.x; + j = -0.086450055*a0.y + -0.124518275*b0.y + 0.020062126*c0.y + -0.20558353*d0.y + -0.45414314*e0.y + -0.082487576*f0.y + -0.1515172*g0.y + 0.12671556*h0.y + 0.016241614*i0.y; + k = -0.016725514*a0.z + -0.08818584*b0.z + 0.022113374*c0.z + -0.117363*d0.z + -0.20525245*e0.z + -0.14181912*f0.z + -0.07290995*g0.z + 0.11147163*h0.z + -0.07578759*i0.z; + l = -0.03750765*a0.w + 0.052155647*b0.w + -0.021804612*c0.w + 0.09988333*d0.w + -0.27572292*e0.w + -0.09019871*f0.w + -0.07586278*g0.w + 0.019196762*h0.w + 0.010203965*i0.w; + m = 0.013703555*a1.x + -0.020751877*b1.x + 0.0775093*c1.x + -0.09004651*d1.x + -0.5128223*e1.x + -0.06329901*f1.x + 0.10937858*g1.x + -0.10808922*h1.x + 0.015974486*i1.x; + n = -0.09324005*a1.y + -0.16807376*b1.y + -0.10526527*c1.y + -0.010830986*d1.y + -0.010137756*e1.y + 0.10139828*f1.y + -0.10427358*g1.y + -0.116689995*h1.y + 0.15831418*i1.y; + o = 0.02102471*a1.z + 0.036273964*b1.z + 0.074956045*c1.z + -0.091770366*d1.z + 0.08726741*e1.z + -0.035816178*f1.z + 0.16262427*g1.z + 0.14923644*h1.z + 0.09859584*i1.z; + p = 0.002302369*a1.w + -0.012979977*b1.w + 0.11320999*c1.w + 0.07696163*d1.w + -0.15911424*e1.w + -0.1044688*f1.w + 0.048823304*g1.w + 0.09324655*h1.w + -0.0752723*i1.w; + q = -0.017380103*na0.x + -0.025678936*nb0.x + 0.037316386*nc0.x + -0.15647902*nd0.x + -0.23790553*ne0.x + 0.07412572*nf0.x + 0.009013182*ng0.x + -0.084161185*nh0.x + 0.042249765*ni0.x; + r = 0.086646855*na0.y + 0.18134682*nb0.y + 0.022913635*nc0.y + 0.05691889*nd0.y + 0.22342443*ne0.y + 0.14537199*nf0.y + 0.2649698*ng0.y + 0.17448571*nh0.y + 0.11451624*ni0.y; + s = -0.1269585*na0.z + -0.03242593*nb0.z + -0.12652342*nc0.z + 0.109687544*nd0.z + 0.037887223*ne0.z + 0.07123706*nf0.z + -0.0202993*ng0.z + -0.17222753*nh0.z + 0.014016666*ni0.z; + t = -0.069507696*na0.w + -0.15265661*nb0.w + -0.012847912*nc0.w + 0.058244247*nd0.w + 0.14982316*ne0.w + 0.17648475*nf0.w + 0.03054064*ng0.w + 0.04018764*nh0.w + -0.007209293*ni0.w; + u = 0.058386125*na1.x + 0.11898639*nb1.x + -0.031605452*nc1.x + 0.038302805*nd1.x + 0.08826856*ne1.x + 0.15199856*nf1.x + -0.19690076*ng1.x + -0.0035709224*nh1.x + 0.033497263*ni1.x; + v = -0.023674052*na1.y + 0.025953926*nb1.y + -0.17001212*nc1.y + 0.16752574*nd1.y + -0.4473576*ne1.y + -0.109902255*nf1.y + 0.06646598*ng1.y + 0.10382671*nh1.y + 0.045195088*ni1.y; + w = 0.054174628*na1.z + -0.004505771*nb1.z + 0.06162703*nc1.z + 0.18366614*nd1.z + 0.16723797*ne1.z + 0.25134555*nf1.z + -0.07620315*ng1.z + -0.11094397*nh1.z + 0.042937014*ni1.z; + x = 0.027990157*na1.w + 0.017603736*nb1.w + -0.06902197*nc1.w + -0.06853595*nd1.w + 0.107995*ne1.w + -0.043075144*nf1.w + -0.09761985*ng1.w + -0.14420354*nh1.w + -0.04139432*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.026252449; + i = 0.0787005*a0.x + -0.28859293*b0.x + -0.0067881406*c0.x + 0.29178682*d0.x + -0.100476004*e0.x + -0.08093355*f0.x + -0.031010041*g0.x + 0.14658515*h0.x + -0.090041496*i0.x; + j = 0.0686159*a0.y + 0.21001844*b0.y + 0.044678725*c0.y + 0.050581932*d0.y + 0.33996314*e0.y + 0.14433432*f0.y + 0.08620218*g0.y + -0.05678144*h0.y + -0.15260054*i0.y; + k = -0.0137613*a0.z + -0.15726678*b0.z + 0.20399995*c0.z + 0.09453541*d0.z + -0.09012798*e0.z + 0.06390615*f0.z + 0.15053074*g0.z + -0.027891546*h0.z + -0.049362328*i0.z; + l = 0.05412328*a0.w + 0.20529822*b0.w + -0.15385857*c0.w + -0.11023235*d0.w + -0.07649383*e0.w + -0.09297993*f0.w + 0.03461381*g0.w + -0.025468629*h0.w + 0.0017152915*i0.w; + m = -0.048222102*a1.x + -0.20325871*b1.x + 0.06318963*c1.x + 0.32389513*d1.x + -0.13079883*e1.x + 0.062312752*f1.x + 0.19552991*g1.x + -0.05771893*h1.x + 0.0034655593*i1.x; + n = 0.22603649*a1.y + -0.22186667*b1.y + -0.1956643*c1.y + 0.16219154*d1.y + -0.16832736*e1.y + -0.007042763*f1.y + 0.048959658*g1.y + 0.07105372*h1.y + -0.06522516*i1.y; + o = -0.038349096*a1.z + 0.0027485983*b1.z + 0.10738825*c1.z + 0.082396306*d1.z + -0.083042175*e1.z + 0.30802855*f1.z + -0.05532289*g1.z + 0.12641166*h1.z + 0.05846329*i1.z; + p = -0.02619867*a1.w + -0.16696903*b1.w + -0.023464037*c1.w + -0.06669631*d1.w + -0.2338882*e1.w + -0.32071564*f1.w + 0.078225054*g1.w + -0.024752416*h1.w + -0.21565229*i1.w; + q = -0.14719062*na0.x + 0.036166605*nb0.x + 0.03586071*nc0.x + -0.09496501*nd0.x + -0.2571935*ne0.x + -0.059871353*nf0.x + 0.1246005*ng0.x + -0.09816562*nh0.x + -0.094756044*ni0.x; + r = -0.06635919*na0.y + -0.057532493*nb0.y + 0.096980825*nc0.y + 0.036802392*nd0.y + -0.02427639*ne0.y + 0.1140418*nf0.y + 0.022975886*ng0.y + 0.004847066*nh0.y + 0.15799266*ni0.y; + s = 0.13028878*na0.z + 0.3263747*nb0.z + -0.23045464*nc0.z + 0.07008324*nd0.z + 0.16577603*ne0.z + 0.024477255*nf0.z + -0.15753885*ng0.z + 0.19609994*nh0.z + 0.10705109*ni0.z; + t = -0.13850264*na0.w + -0.3382914*nb0.w + 0.046004727*nc0.w + 0.12867244*nd0.w + -0.049569026*ne0.w + -0.008928906*nf0.w + -0.11440658*ng0.w + -0.147463*nh0.w + -0.08606203*ni0.w; + u = 0.11820253*na1.x + 0.20000514*nb1.x + 0.026139745*nc1.x + -0.19260569*nd1.x + -0.14018841*ne1.x + 0.07235604*nf1.x + -0.03838637*ng1.x + -0.09385468*nh1.x + 0.04758941*ni1.x; + v = 0.0834724*na1.y + 0.14571273*nb1.y + 0.26493275*nc1.y + -0.18859173*nd1.y + 0.21985587*ne1.y + 0.28283784*nf1.y + -0.056772046*ng1.y + 0.013765349*nh1.y + 0.054531686*ni1.y; + w = 0.084727615*na1.z + -0.24276324*nb1.z + 0.019877689*nc1.z + -0.1053572*nd1.z + 0.16096932*ne1.z + -0.038733255*nf1.z + -0.04136899*ng1.z + -0.024152098*nh1.z + -0.09792013*ni1.z; + x = 0.003288853*na1.w + 0.092284575*nb1.w + -0.07442276*nc1.w + 0.025056144*nd1.w + 0.12108035*ne1.w + 0.16446428*nf1.w + -0.036851145*ng1.w + 0.044216324*nh1.w + 0.10186219*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0015176617; + i = -0.015699264*a0.x + 0.030596672*b0.x + -0.09533272*c0.x + 0.0062539126*d0.x + 0.008770248*e0.x + 0.12371962*f0.x + -0.033431813*g0.x + -0.03436698*h0.x + 0.024540674*i0.x; + j = 0.17142779*a0.y + -0.011952496*b0.y + -0.07112966*c0.y + 0.23306139*d0.y + 0.09441627*e0.y + -0.11017719*f0.y + 0.12642872*g0.y + 0.063718885*h0.y + 0.1107114*i0.y; + k = 0.020745154*a0.z + 0.1870523*b0.z + 0.0014909132*c0.z + -0.23451832*d0.z + 0.037374016*e0.z + -0.045705926*f0.z + -0.112359606*g0.z + 0.12749946*h0.z + -0.046014808*i0.z; + l = 0.08880867*a0.w + 0.0741326*b0.w + -0.1163462*c0.w + -0.1405951*d0.w + 0.122966714*e0.w + -0.15578188*f0.w + -0.035492282*g0.w + -0.060440145*h0.w + 0.037309416*i0.w; + m = -0.09053849*a1.x + -0.055760566*b1.x + -0.029782353*c1.x + 0.039467704*d1.x + 0.07329281*e1.x + 0.03234974*f1.x + -0.09491558*g1.x + 0.034413684*h1.x + 0.07376969*i1.x; + n = -0.16104591*a1.y + 0.058542773*b1.y + 0.07579228*c1.y + 0.19043031*d1.y + -0.03681334*e1.y + 0.18739979*f1.y + -0.04505818*g1.y + -0.15832698*h1.y + -0.00827814*i1.y; + o = -0.023094185*a1.z + -0.025111288*b1.z + -0.02562611*c1.z + -0.041231755*d1.z + -0.04910127*e1.z + -0.1219653*f1.z + -0.006997529*g1.z + -0.15396258*h1.z + 0.102461934*i1.z; + p = 0.082111925*a1.w + 0.19593202*b1.w + 0.029542198*c1.w + -0.06586002*d1.w + 0.1615917*e1.w + 0.10513043*f1.w + -0.055543568*g1.w + 0.1296069*h1.w + 0.031309575*i1.w; + q = 0.17381243*na0.x + 0.16467948*nb0.x + -0.02460769*nc0.x + 0.011226765*nd0.x + 0.33458105*ne0.x + 0.014456158*nf0.x + -0.022459537*ng0.x + 0.11703303*nh0.x + 0.041535605*ni0.x; + r = -0.073164664*na0.y + -0.13298072*nb0.y + 0.053352155*nc0.y + -0.15241776*nd0.y + -0.07620294*ne0.y + 0.023966217*nf0.y + -0.022878652*ng0.y + -0.016190618*nh0.y + 0.034986023*ni0.y; + s = -0.07340512*na0.z + -0.32154587*nb0.z + -0.029413546*nc0.z + 0.13657314*nd0.z + -0.18318935*ne0.z + -0.010307318*nf0.z + 0.10293112*ng0.z + -0.20230167*nh0.z + 0.024070712*ni0.z; + t = -0.055169705*na0.w + 0.038908716*nb0.w + 0.06615996*nc0.w + -0.0834325*nd0.w + 0.008771006*ne0.w + 0.18993776*nf0.w + -0.061884392*ng0.w + 0.113585375*nh0.w + 0.07253641*ni0.w; + u = 0.057251845*na1.x + 0.06289371*nb1.x + -0.030567387*nc1.x + -0.026693162*nd1.x + 0.4123315*ne1.x + -0.055483878*nf1.x + 0.06410658*ng1.x + -0.044549458*nh1.x + -0.09532669*ni1.x; + v = -0.02968765*na1.y + 0.16411597*nb1.y + 0.0063104588*nc1.y + -0.061117187*nd1.y + -0.18275106*ne1.y + 0.085616715*nf1.y + 0.06604734*ng1.y + -0.111928746*nh1.y + -0.063621275*ni1.y; + w = 0.022099806*na1.z + -0.06566655*nb1.z + -0.016550316*nc1.z + 0.061879884*nd1.z + -0.3047371*ne1.z + -0.22423275*nf1.z + -0.038111757*ng1.z + -0.02573729*nh1.z + -0.14429528*ni1.z; + x = -0.056604154*na1.w + -0.1831198*nb1.w + -0.029289784*nc1.w + 0.040536884*nd1.w + -0.08382906*ne1.w + -0.06134529*nf1.w + 0.12357722*ng1.w + -0.041197773*nh1.w + -0.05369438*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.011146248; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN60 +//!BIND LUMAN61 +//!SAVE LUMAN70 + +#define L0_tex LUMAN60_tex +#define L1_tex LUMAN61_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.16707185*a0.x + 0.01459159*b0.x + 0.09597878*c0.x + 0.07452457*d0.x + -0.16609426*e0.x + 0.22984987*f0.x + 0.01604279*g0.x + 0.12176588*h0.x + 0.12710643*i0.x; + float j = 0.075276494*a0.y + -0.14305738*b0.y + -0.10306315*c0.y + 0.0041424287*d0.y + -0.18993132*e0.y + 0.07858037*f0.y + 0.14938961*g0.y + 0.15913264*h0.y + 0.048541065*i0.y; + float k = 0.07726489*a0.z + 0.061804272*b0.z + -0.016685195*c0.z + 0.024503086*d0.z + 0.010571629*e0.z + 0.14796981*f0.z + -0.014458555*g0.z + -0.066766694*h0.z + 0.087022305*i0.z; + float l = -0.0741828*a0.w + -0.06127295*b0.w + -0.0831812*c0.w + 0.0020672872*d0.w + -0.11349545*e0.w + -0.06560703*f0.w + -0.031534463*g0.w + 0.064463146*h0.w + -0.070401974*i0.w; + float m = 0.059070893*a1.x + -0.08030707*b1.x + -0.031248493*c1.x + 0.021566726*d1.x + 0.11074087*e1.x + 0.12531136*f1.x + 0.04273478*g1.x + -0.035572812*h1.x + -0.04251175*i1.x; + float n = 0.1207556*a1.y + -0.03475322*b1.y + -0.100367405*c1.y + 0.07478472*d1.y + -0.054013055*e1.y + 0.046478465*f1.y + -0.054475054*g1.y + 0.028075173*h1.y + 0.07847578*i1.y; + float o = -0.127887*a1.z + 0.009045883*b1.z + -0.0413301*c1.z + -0.15486814*d1.z + -0.033196386*e1.z + 0.07920617*f1.z + -0.027982794*g1.z + -0.23330143*h1.z + -0.05289495*i1.z; + float p = 0.07627091*a1.w + 0.092626214*b1.w + 0.03739464*c1.w + 0.011463141*d1.w + -0.10432715*e1.w + 0.05058091*f1.w + 0.0012654449*g1.w + 0.14053737*h1.w + -0.030011084*i1.w; + float q = -0.093068324*na0.x + 0.021927057*nb0.x + -0.119940996*nc0.x + -0.12498851*nd0.x + -0.062243253*ne0.x + -0.0657077*nf0.x + -0.07868397*ng0.x + -0.14934455*nh0.x + -0.11498485*ni0.x; + float r = 0.037383396*na0.y + 0.03412481*nb0.y + 0.080802746*nc0.y + -0.034590624*nd0.y + 0.102682725*ne0.y + -0.06089318*nf0.y + -0.07508375*ng0.y + -0.06557913*nh0.y + 0.025577186*ni0.y; + float s = 0.011167806*na0.z + -0.08456959*nb0.z + 0.03695445*nc0.z + 0.11569212*nd0.z + 0.023378948*ne0.z + -0.1296879*nf0.z + 0.041656822*ng0.z + 0.043207034*nh0.z + -0.037079945*ni0.z; + float t = 0.07834874*na0.w + 0.009891263*nb0.w + 0.099839434*nc0.w + -0.13000928*nd0.w + -0.0045935875*ne0.w + 0.019903835*nf0.w + -0.041363545*ng0.w + -0.03854393*nh0.w + 0.053775348*ni0.w; + float u = 0.042012587*na1.x + 0.14145845*nb1.x + 0.06018162*nc1.x + 0.037801825*nd1.x + -0.23456845*ne1.x + -0.16834131*nf1.x + -0.04549333*ng1.x + -0.07055851*nh1.x + 0.095839985*ni1.x; + float v = 0.0062642097*na1.y + 0.04875694*nb1.y + 0.04445962*nc1.y + 0.041629676*nd1.y + -0.04451888*ne1.y + 0.036208697*nf1.y + -0.018410044*ng1.y + -0.00222759*nh1.y + 0.019979788*ni1.y; + float w = 0.05050757*na1.z + -0.059576757*nb1.z + 0.07722044*nc1.z + 0.09021037*nd1.z + 0.0279692*ne1.z + -0.17721412*nf1.z + 0.11889603*ng1.z + 0.17959587*nh1.z + -0.009883711*ni1.z; + float x = -0.17722*na1.w + -0.1294848*nb1.w + -0.05886288*nc1.w + 0.17996617*nd1.w + -0.37909824*ne1.w + -0.10436786*nf1.w + 0.0857953*ng1.w + 0.035984337*nh1.w + -0.15937395*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.020803524; + i = 0.18760012*a0.x + -0.05672948*b0.x + -0.04035751*c0.x + 0.051190294*d0.x + -0.4160101*e0.x + -0.015525946*f0.x + 0.06301994*g0.x + 0.1546013*h0.x + 0.03517859*i0.x; + j = 0.034246188*a0.y + 0.03255839*b0.y + 0.17857063*c0.y + 0.28546038*d0.y + 0.019054411*e0.y + -0.0869243*f0.y + 0.008228919*g0.y + 0.0562388*h0.y + -0.13069227*i0.y; + k = -0.024451675*a0.z + -0.13683404*b0.z + -0.1010116*c0.z + -0.052205075*d0.z + -0.16257866*e0.z + 0.1305172*f0.z + 0.027445339*g0.z + -0.0118933255*h0.z + 0.098764986*i0.z; + l = -0.066036776*a0.w + 0.022648929*b0.w + 0.07048763*c0.w + -0.0063484786*d0.w + -0.243269*e0.w + 0.030944303*f0.w + -0.13571839*g0.w + -0.01094549*h0.w + -0.010621858*i0.w; + m = 0.03762773*a1.x + -0.08693226*b1.x + 0.07314137*c1.x + -0.013404316*d1.x + 0.14760663*e1.x + -0.32283306*f1.x + -0.056603152*g1.x + -0.06067009*h1.x + -0.17135729*i1.x; + n = 0.19832304*a1.y + -0.069314696*b1.y + 0.06315924*c1.y + -0.1030127*d1.y + -0.43251115*e1.y + -0.06101974*f1.y + -0.11535977*g1.y + -0.013645112*h1.y + -0.002090781*i1.y; + o = -0.075515576*a1.z + 0.032988884*b1.z + 0.08949724*c1.z + -0.15579495*d1.z + -0.10749708*e1.z + -0.011412682*f1.z + -0.022672031*g1.z + 0.14450091*h1.z + 0.0580288*i1.z; + p = 0.052963868*a1.w + 0.065941304*b1.w + -0.08848499*c1.w + -0.045445524*d1.w + 0.013262591*e1.w + 0.27520946*f1.w + 0.106307745*g1.w + 0.11091647*h1.w + -0.044759583*i1.w; + q = -0.13402347*na0.x + -0.06257855*nb0.x + 0.0752903*nc0.x + 0.01813476*nd0.x + 0.15062326*ne0.x + -0.24121898*nf0.x + -0.033599045*ng0.x + -0.22295438*nh0.x + 0.07236984*ni0.x; + r = -0.03748897*na0.y + -0.14177923*nb0.y + -0.037401408*nc0.y + -0.12516059*nd0.y + -0.01755814*ne0.y + 0.07203849*nf0.y + 0.036626935*ng0.y + -0.05567603*nh0.y + 0.04024097*ni0.y; + s = 0.057622183*na0.z + -0.006183752*nb0.z + 0.10726049*nc0.z + 0.19952112*nd0.z + 0.18812835*ne0.z + 0.051843926*nf0.z + -0.0002990376*ng0.z + 0.05477127*nh0.z + -0.12951618*ni0.z; + t = 0.033499256*na0.w + -0.11512289*nb0.w + -0.06745114*nc0.w + -0.12442632*nd0.w + 0.0403085*ne0.w + -0.06879559*nf0.w + 0.1063965*ng0.w + 0.020015359*nh0.w + 0.012631638*ni0.w; + u = -0.061987985*na1.x + 0.1644526*nb1.x + 0.11696878*nc1.x + 0.046437148*nd1.x + -0.1264651*ne1.x + 0.3210138*nf1.x + 0.17217772*ng1.x + 0.13374034*nh1.x + -0.05727805*ni1.x; + v = -0.056843136*na1.y + 0.047753133*nb1.y + -0.09544034*nc1.y + 0.04304065*nd1.y + 0.40721974*ne1.y + 0.100129314*nf1.y + 0.07010598*ng1.y + -0.05048358*nh1.y + -0.0026080816*ni1.y; + w = 0.08819051*na1.z + 0.037071127*nb1.z + -0.070650496*nc1.z + 0.062920175*nd1.z + 0.07917255*ne1.z + 0.12788*nf1.z + -0.017485328*ng1.z + -0.05174912*nh1.z + -0.035436332*ni1.z; + x = -0.045394093*na1.w + 0.017271686*nb1.w + 0.035120815*nc1.w + 0.25334322*nd1.w + -0.122095615*ne1.w + -0.028557297*nf1.w + -0.06654046*ng1.w + -0.14862229*nh1.w + 0.12124861*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.011939273; + i = 0.007988823*a0.x + 0.043300614*b0.x + 0.06301894*c0.x + 0.023971288*d0.x + 0.25549185*e0.x + 0.04421958*f0.x + 0.0022470562*g0.x + -0.10538949*h0.x + 0.05210963*i0.x; + j = -0.16987213*a0.y + -0.31616268*b0.y + -0.058348488*c0.y + 0.047011923*d0.y + -0.24267124*e0.y + -0.029344559*f0.y + -0.12871924*g0.y + -0.14803977*h0.y + 0.16648817*i0.y; + k = 0.032171052*a0.z + -0.099306546*b0.z + 0.17139974*c0.z + 0.05083007*d0.z + -0.0838175*e0.z + 0.06591208*f0.z + 0.037488688*g0.z + -0.14690341*h0.z + -0.08771937*i0.z; + l = -0.031773616*a0.w + -0.15480563*b0.w + -0.114856966*c0.w + 0.059143398*d0.w + 0.22674477*e0.w + -0.024911936*f0.w + -0.026028406*g0.w + -0.02581128*h0.w + -0.07086282*i0.w; + m = -0.010544171*a1.x + -0.121315874*b1.x + -0.021153478*c1.x + 0.09653259*d1.x + 0.23078552*e1.x + 0.09536591*f1.x + 0.097515665*g1.x + 0.27507824*h1.x + 0.30895805*i1.x; + n = 0.0064135334*a1.y + -0.15648791*b1.y + -0.06604209*c1.y + 0.05537567*d1.y + 0.1712115*e1.y + 0.16483422*f1.y + 0.031414956*g1.y + 0.07765021*h1.y + 0.11804431*i1.y; + o = 0.040441096*a1.z + 0.029267445*b1.z + -0.0014274184*c1.z + 0.13492791*d1.z + 0.21282202*e1.z + -0.023156036*f1.z + 0.11033489*g1.z + -0.019858988*h1.z + 0.0101667745*i1.z; + p = -0.05952965*a1.w + 0.12360287*b1.w + 0.15023205*c1.w + 0.13136087*d1.w + 0.09425458*e1.w + -0.15051837*f1.w + 0.11030205*g1.w + 0.055964366*h1.w + -0.04351984*i1.w; + q = 0.0800978*na0.x + 0.14231174*nb0.x + -0.122729294*nc0.x + -0.2446972*nd0.x + -0.058770172*ne0.x + -0.04128968*nf0.x + -0.16805433*ng0.x + 0.2870106*nh0.x + 0.11663096*ni0.x; + r = 0.19433951*na0.y + 0.22241181*nb0.y + 0.021812731*nc0.y + -0.07812733*nd0.y + -0.18069054*ne0.y + 0.031146582*nf0.y + -0.058601037*ng0.y + 0.052038964*nh0.y + 0.012479496*ni0.y; + s = -0.19189489*na0.z + -0.013886786*nb0.z + -0.15179993*nc0.z + -0.1548249*nd0.z + -0.5476674*ne0.z + -0.48016936*nf0.z + -0.089323506*ng0.z + 0.09407296*nh0.z + 0.03633839*ni0.z; + t = -0.014738748*na0.w + 0.12443845*nb0.w + 0.06398434*nc0.w + 0.031160723*nd0.w + -0.15837196*ne0.w + -0.0151074985*nf0.w + 0.082899936*ng0.w + 0.11998946*nh0.w + 0.11566883*ni0.w; + u = 0.025826976*na1.x + -0.0010483622*nb1.x + -0.10387264*nc1.x + -0.03628439*nd1.x + -0.15113765*ne1.x + -0.25192127*nf1.x + -0.06575387*ng1.x + -0.18649472*nh1.x + -0.10462416*ni1.x; + v = -0.01315456*na1.y + 0.10511144*nb1.y + -0.0059079076*nc1.y + -0.15953188*nd1.y + -0.099411644*ne1.y + 0.0130890235*nf1.y + -0.09630611*ng1.y + 0.01270137*nh1.y + -0.06623264*ni1.y; + w = -0.009895875*na1.z + -0.06556251*nb1.z + 0.020807983*nc1.z + 0.110983044*nd1.z + -0.06224234*ne1.z + -0.0017107179*nf1.z + -0.025325751*ng1.z + -0.08919119*nh1.z + 0.040737003*ni1.z; + x = 0.038011968*na1.w + -0.16423859*nb1.w + -0.04267014*nc1.w + -0.060422074*nd1.w + -0.02386611*ne1.w + 0.10199278*nf1.w + -0.08109655*ng1.w + 0.05310966*nh1.w + 0.0705772*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.016101146; + i = 0.08186986*a0.x + -0.27966294*b0.x + 0.07349518*c0.x + -0.02525529*d0.x + 0.08804907*e0.x + -0.23396638*f0.x + -0.095341004*g0.x + 0.12230629*h0.x + -0.088450216*i0.x; + j = 0.17311937*a0.y + -0.011713199*b0.y + -0.023302078*c0.y + -0.28680474*d0.y + 0.25046813*e0.y + 0.13166201*f0.y + 0.22162731*g0.y + 0.2569277*h0.y + -0.16860108*i0.y; + k = -0.13823773*a0.z + -0.32229167*b0.z + -0.09600752*c0.z + 0.01688759*d0.z + -0.015036404*e0.z + -0.006144277*f0.z + -0.049893063*g0.z + 0.0070240092*h0.z + -0.012577821*i0.z; + l = 0.027596693*a0.w + 0.07686742*b0.w + 0.059847716*c0.w + 0.064874366*d0.w + 0.37457395*e0.w + -0.08730197*f0.w + -0.06216056*g0.w + 0.15892714*h0.w + 0.10220284*i0.w; + m = 0.04762231*a1.x + -0.05717154*b1.x + -0.011567126*c1.x + -0.025255503*d1.x + 0.012369087*e1.x + 0.07555715*f1.x + 0.008033872*g1.x + -0.21224308*h1.x + -0.21989736*i1.x; + n = 0.06412487*a1.y + 0.04054021*b1.y + 0.06108249*c1.y + -0.008536781*d1.y + 0.102750435*e1.y + -0.00041976082*f1.y + -0.08412207*g1.y + 0.122296356*h1.y + -0.009252118*i1.y; + o = -0.022489117*a1.z + 0.027151579*b1.z + -0.052604277*c1.z + 0.0904872*d1.z + -0.118856296*e1.z + 0.016594423*f1.z + -0.07095765*g1.z + -0.1356925*h1.z + 0.04555555*i1.z; + p = -0.0027514708*a1.w + -0.18162079*b1.w + -0.025238771*c1.w + 0.12815496*d1.w + 0.2966293*e1.w + 0.07295546*f1.w + -0.001974208*g1.w + -0.079097986*h1.w + -0.061876595*i1.w; + q = -0.017452657*na0.x + 0.27534506*nb0.x + -0.059656087*nc0.x + -0.08268512*nd0.x + -0.13075675*ne0.x + 0.143268*nf0.x + -0.037696302*ng0.x + -0.152455*nh0.x + 0.17365775*ni0.x; + r = -0.13629195*na0.y + -0.09065064*nb0.y + 0.023805516*nc0.y + -0.116249606*nd0.y + -0.10501295*ne0.y + -0.04866309*nf0.y + 0.100499496*ng0.y + -0.15090236*nh0.y + 0.1763309*ni0.y; + s = 0.07023327*na0.z + -0.023078058*nb0.z + 0.023277761*nc0.z + -0.07977383*nd0.z + -0.109831356*ne0.z + 0.046003412*nf0.z + -0.011881196*ng0.z + -0.10053063*nh0.z + -0.086142026*ni0.z; + t = -0.011805513*na0.w + -0.07882051*nb0.w + 0.01810326*nc0.w + -0.18755534*nd0.w + -0.105580114*ne0.w + 0.06887994*nf0.w + 0.049635768*ng0.w + -0.07681415*nh0.w + -0.10049961*ni0.w; + u = -0.07036247*na1.x + 0.049210124*nb1.x + 0.0056824684*nc1.x + -0.00047676652*nd1.x + 0.037586123*ne1.x + -0.019774916*nf1.x + 0.15204369*ng1.x + 0.026581515*nh1.x + -0.009564476*ni1.x; + v = 0.040534947*na1.y + -0.07229616*nb1.y + -0.04097948*nc1.y + -0.009419609*nd1.y + -0.002633858*ne1.y + -0.0031189565*nf1.y + 0.008676045*ng1.y + -0.2262739*nh1.y + 0.12348922*ni1.y; + w = 0.048678316*na1.z + -0.078876495*nb1.z + -0.030548131*nc1.z + -0.08987738*nd1.z + 0.04284424*ne1.z + 0.01576385*nf1.z + 0.16307567*ng1.z + 0.21366584*nh1.z + -0.06277811*ni1.z; + x = 0.015810061*na1.w + 0.1067863*nb1.w + 0.04990775*nc1.w + 0.024920044*nd1.w + -0.42603993*ne1.w + -0.03960076*nf1.w + 0.057762917*ng1.w + -0.03203102*nh1.w + 0.15136312*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.028439088; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN60 +//!BIND LUMAN61 +//!SAVE LUMAN71 + +#define L0_tex LUMAN60_tex +#define L1_tex LUMAN61_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.020427955*a0.x + -0.12299448*b0.x + 0.0382103*c0.x + -0.2065043*d0.x + 0.18101963*e0.x + -0.10143672*f0.x + 0.069389276*g0.x + 0.11816535*h0.x + 0.06997783*i0.x; + float j = 0.21215856*a0.y + -0.04804419*b0.y + 0.008095651*c0.y + -0.293839*d0.y + 0.33101708*e0.y + 0.33218643*f0.y + 0.053283837*g0.y + 0.17308329*h0.y + -0.03772887*i0.y; + float k = -0.34456056*a0.z + -0.16793236*b0.z + 0.03739383*c0.z + -0.080821194*d0.z + -0.22808352*e0.z + -0.113590464*f0.z + -0.037161198*g0.z + 0.023857055*h0.z + -0.09459421*i0.z; + float l = -0.08646293*a0.w + 0.107415445*b0.w + 0.044336937*c0.w + 0.069187395*d0.w + -0.062774606*e0.w + -0.108927466*f0.w + -0.04602913*g0.w + -0.07301894*h0.w + 0.10343813*i0.w; + float m = -0.059688944*a1.x + -0.24532959*b1.x + 0.01622201*c1.x + 0.121369496*d1.x + 0.4220545*e1.x + 0.05799676*f1.x + -0.010943618*g1.x + -0.04879672*h1.x + -0.18129556*i1.x; + float n = 0.08937881*a1.y + -0.076180376*b1.y + -0.011001821*c1.y + 0.02046611*d1.y + 0.08171395*e1.y + 0.1594122*f1.y + -0.0132004395*g1.y + -0.07992791*h1.y + -0.067408495*i1.y; + float o = -0.06548962*a1.z + -0.16845347*b1.z + -0.027801726*c1.z + 0.31846458*d1.z + 0.16317068*e1.z + -0.038398925*f1.z + 0.12266141*g1.z + 0.026239803*h1.z + 0.06616569*i1.z; + float p = -0.09446756*a1.w + -0.28087494*b1.w + -0.07972108*c1.w + 0.24629132*d1.w + 0.119287975*e1.w + 0.24699649*f1.w + 0.13661574*g1.w + -0.07906541*h1.w + -0.0056392225*i1.w; + float q = 0.03538764*na0.x + 0.2790401*nb0.x + 0.08151654*nc0.x + -0.22784868*nd0.x + -0.36319312*ne0.x + -0.113029726*nf0.x + -0.10720264*ng0.x + 0.043048188*nh0.x + 0.12067008*ni0.x; + float r = 0.24458425*na0.y + -0.017716056*nb0.y + -0.07277476*nc0.y + -0.34660316*nd0.y + -0.326197*ne0.y + -0.17121781*nf0.y + 0.18105748*ng0.y + 0.054370437*nh0.y + 0.07291747*ni0.y; + float s = 0.1444308*na0.z + 0.037046615*nb0.z + -0.074410655*nc0.z + -0.0331052*nd0.z + 0.2983961*ne0.z + 0.10592076*nf0.z + -0.04357041*ng0.z + -0.08175989*nh0.z + -0.019775998*ni0.z; + float t = 0.0012991523*na0.w + -0.041375145*nb0.w + -0.061631728*nc0.w + 0.03254315*nd0.w + 0.18613961*ne0.w + 0.105121955*nf0.w + 0.111895464*ng0.w + 0.047140393*nh0.w + -0.10446484*ni0.w; + float u = 0.0008599757*na1.x + 0.025347594*nb1.x + -0.08645557*nc1.x + -0.13086848*nd1.x + 0.04430699*ne1.x + -0.04425249*nf1.x + 0.12734428*ng1.x + -0.06775437*nh1.x + -0.02977556*ni1.x; + float v = 0.042987797*na1.y + 0.22243887*nb1.y + 0.009829554*nc1.y + -0.05559989*nd1.y + 0.22480097*ne1.y + -0.12777573*nf1.y + -0.021276096*ng1.y + -0.073389776*nh1.y + 0.05349569*ni1.y; + float w = 0.22859068*na1.z + 0.071143694*nb1.z + -0.08075097*nc1.z + -0.086894736*nd1.z + -0.01395731*ne1.z + 0.13063684*nf1.z + 0.03464629*ng1.z + 0.059344422*nh1.z + 0.04601359*ni1.z; + float x = 0.15328191*na1.w + 0.18964882*nb1.w + 0.09343201*nc1.w + -0.086833306*nd1.w + -0.3459332*ne1.w + -0.23979221*nf1.w + -0.0323085*ng1.w + -0.025463346*nh1.w + 0.29438457*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.00774723; + i = 0.02540264*a0.x + 0.057967946*b0.x + 0.0756193*c0.x + 0.07650531*d0.x + -0.033239055*e0.x + 0.008858051*f0.x + -0.0009940318*g0.x + -0.037703067*h0.x + 0.26205966*i0.x; + j = -0.11909197*a0.y + 0.07580306*b0.y + 0.05527881*c0.y + 0.12937492*d0.y + -0.006751253*e0.y + -0.04913538*f0.y + -0.055807915*g0.y + 0.15184923*h0.y + 0.010444979*i0.y; + k = -9.871652e-05*a0.z + 0.040530793*b0.z + 0.1569917*c0.z + 0.012185376*d0.z + -0.5438175*e0.z + 0.055470947*f0.z + -0.049259298*g0.z + -0.0059514428*h0.z + 0.054824114*i0.z; + l = -0.08456306*a0.w + -0.019126693*b0.w + -0.021060875*c0.w + -0.03132117*d0.w + -0.033833887*e0.w + 0.012529336*f0.w + -0.00084578665*g0.w + 0.021030087*h0.w + -0.03891261*i0.w; + m = -0.056309015*a1.x + -0.10297292*b1.x + 0.11251738*c1.x + 0.08159942*d1.x + -0.122514226*e1.x + -0.079847425*f1.x + 0.11716084*g1.x + 0.049454574*h1.x + -0.050938994*i1.x; + n = 0.04500759*a1.y + -0.02995276*b1.y + -0.0060616354*c1.y + -0.027787723*d1.y + 0.08043579*e1.y + 0.17243683*f1.y + 0.04944646*g1.y + 0.01185244*h1.y + 0.025549565*i1.y; + o = 0.017759923*a1.z + 0.023875631*b1.z + -0.0016878811*c1.z + 0.085072495*d1.z + -0.04422165*e1.z + 0.025165051*f1.z + -0.044808466*g1.z + -0.2277521*h1.z + -0.046955653*i1.z; + p = 0.06976003*a1.w + 0.100424804*b1.w + -0.01778747*c1.w + 0.09177266*d1.w + -0.10005814*e1.w + 0.045143608*f1.w + -0.085984215*g1.w + -0.09975948*h1.w + -0.014967957*i1.w; + q = -0.02396588*na0.x + -0.012424523*nb0.x + -0.026491754*nc0.x + -0.124398455*nd0.x + 0.10213312*ne0.x + -0.1272105*nf0.x + -0.043681663*ng0.x + -0.11994408*nh0.x + -0.1130879*ni0.x; + r = -0.031082416*na0.y + 0.057595864*nb0.y + -0.0448145*nc0.y + 0.05464614*nd0.y + 0.1381928*ne0.y + 0.06410599*nf0.y + 0.057261996*ng0.y + 0.041460402*nh0.y + 0.052953117*ni0.y; + s = -0.12601034*na0.z + 0.071309365*nb0.z + -0.16443217*nc0.z + -0.18393376*nd0.z + 0.039121736*ne0.z + -0.25262094*nf0.z + -0.04935926*ng0.z + -0.031141888*nh0.z + -0.10622221*ni0.z; + t = 0.0707843*na0.w + 0.0298844*nb0.w + 0.013997341*nc0.w + 0.0987847*nd0.w + 0.053505234*ne0.w + 0.016743721*nf0.w + -0.021958148*ng0.w + -0.0065752435*nh0.w + 0.037387595*ni0.w; + u = 0.010219839*na1.x + 0.013594147*nb1.x + -0.097386606*nc1.x + 0.053305168*nd1.x + 0.10351772*ne1.x + 0.14909032*nf1.x + 0.009329111*ng1.x + 0.00042785183*nh1.x + 0.03540518*ni1.x; + v = 0.011846549*na1.y + 0.061299648*nb1.y + -0.009049967*nc1.y + 0.051321067*nd1.y + 0.07379161*ne1.y + -0.034670807*nf1.y + -0.037010025*ng1.y + 0.003963174*nh1.y + 0.027588818*ni1.y; + w = 0.03077586*na1.z + -0.029026378*nb1.z + -0.08913523*nc1.z + 0.07136059*nd1.z + 0.07291538*ne1.z + -0.004745367*nf1.z + 0.03465485*ng1.z + 0.22157489*nh1.z + 0.17830387*ni1.z; + x = -0.10886378*na1.w + -0.06592867*nb1.w + -0.037860826*nc1.w + 0.00437296*nd1.w + 0.17816012*ne1.w + -0.07993008*nf1.w + 0.1061081*ng1.w + 0.09556956*nh1.w + 0.07920885*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.017806575; + i = -0.027967636*a0.x + -0.3974226*b0.x + -0.104621045*c0.x + -0.15640318*d0.x + -0.24313703*e0.x + 0.10833983*f0.x + 0.034498516*g0.x + -0.111212805*h0.x + -0.0066484264*i0.x; + j = 0.34898776*a0.y + 0.08453386*b0.y + -0.14493187*c0.y + -0.062394954*d0.y + 0.017768497*e0.y + 0.016403986*f0.y + 0.008856344*g0.y + -0.049575865*h0.y + 0.07749693*i0.y; + k = -0.07570748*a0.z + -0.33858824*b0.z + -0.19494228*c0.z + -0.13904461*d0.z + -0.28649932*e0.z + -0.07591364*f0.z + 0.083951026*g0.z + 0.0083411895*h0.z + -0.0806109*i0.z; + l = 0.084906526*a0.w + 0.043091387*b0.w + 0.06524473*c0.w + 0.11896168*d0.w + 0.4036274*e0.w + -0.099725835*f0.w + -0.09322391*g0.w + 0.06554854*h0.w + -0.07920316*i0.w; + m = 0.103149265*a1.x + 0.09379966*b1.x + -0.11465655*c1.x + 0.05819121*d1.x + 0.44112626*e1.x + -0.008220044*f1.x + -0.052106164*g1.x + -0.05718799*h1.x + 0.055597268*i1.x; + n = 0.03208524*a1.y + 0.047358923*b1.y + 0.079363085*c1.y + -0.08852368*d1.y + 0.013399863*e1.y + -0.076518625*f1.y + -0.053747185*g1.y + 0.034843802*h1.y + -0.04375299*i1.y; + o = 0.0872293*a1.z + -0.109462485*b1.z + -0.070991404*c1.z + -0.0003856647*d1.z + -0.15613072*e1.z + 0.069763996*f1.z + 0.07777321*g1.z + -0.09938978*h1.z + 0.022947747*i1.z; + p = -0.15075473*a1.w + -0.40277463*b1.w + -0.09087062*c1.w + -0.095137954*d1.w + 0.013284446*e1.w + -0.07939426*f1.w + 0.07534805*g1.w + -0.21933137*h1.w + 0.07597216*i1.w; + q = 0.05529762*na0.x + 0.5643769*nb0.x + 0.1525933*nc0.x + 0.15038446*nd0.x + 0.23356788*ne0.x + -0.08914753*nf0.x + 0.021691134*ng0.x + 0.3045392*nh0.x + 0.0035494857*ni0.x; + r = -0.14748119*na0.y + 0.15565526*nb0.y + 0.14430578*nc0.y + -0.26224518*nd0.y + 0.20457776*ne0.y + 0.15587778*nf0.y + 0.113763526*ng0.y + -0.0038962625*nh0.y + 0.0028991853*ni0.y; + s = 0.095023744*na0.z + -0.20927958*nb0.z + 0.03397999*nc0.z + 0.13496824*nd0.z + 0.26218286*ne0.z + 0.06425366*nf0.z + -0.044739686*ng0.z + -0.07387857*nh0.z + 0.09531976*ni0.z; + t = -0.08336938*na0.w + -0.058455873*nb0.w + 0.027722135*nc0.w + -0.06443187*nd0.w + -0.119230665*ne0.w + 0.056134336*nf0.w + 0.16522501*ng0.w + -0.016409501*nh0.w + 0.03460061*ni0.w; + u = -0.19015406*na1.x + -0.13403434*nb1.x + 0.0062869973*nc1.x + -0.10456645*nd1.x + -0.15624808*ne1.x + 0.036319517*nf1.x + 0.13136101*ng1.x + -0.08900796*nh1.x + -0.056879304*ni1.x; + v = -0.08094239*na1.y + 0.07242798*nb1.y + 0.0057236864*nc1.y + -0.04243141*nd1.y + 0.24958204*ne1.y + 0.13537963*nf1.y + 0.023295095*ng1.y + -0.00995568*nh1.y + 0.1266285*ni1.y; + w = -0.048188806*na1.z + 0.03503379*nb1.z + 0.043767393*nc1.z + -0.090857185*nd1.z + 0.037315335*ne1.z + 0.13315836*nf1.z + -0.17816217*ng1.z + 0.05826157*nh1.z + -0.03337344*ni1.z; + x = 0.12771568*na1.w + 0.27837166*nb1.w + 0.034090616*nc1.w + -0.09378682*nd1.w + 0.16186482*ne1.w + -0.27224994*nf1.w + -0.20890142*ng1.w + 0.079806164*nh1.w + -0.053670608*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.014841039; + i = 0.009409041*a0.x + -0.07351588*b0.x + -0.053960185*c0.x + -0.00039128572*d0.x + -0.20716943*e0.x + -0.055470668*f0.x + 0.1470315*g0.x + -0.0069380105*h0.x + 0.11312721*i0.x; + j = 0.061510608*a0.y + -0.15638562*b0.y + 0.10619936*c0.y + 0.536396*d0.y + 0.39904788*e0.y + -0.016805295*f0.y + -0.18737078*g0.y + 0.081641555*h0.y + 0.13490897*i0.y; + k = 0.048978038*a0.z + 0.38890696*b0.z + 0.07112136*c0.z + -0.025988413*d0.z + 0.2416053*e0.z + -0.059832115*f0.z + 0.1512881*g0.z + -0.06985439*h0.z + -0.002822441*i0.z; + l = -0.15069428*a0.w + -0.029694725*b0.w + -0.034548882*c0.w + 0.17521743*d0.w + -0.14802086*e0.w + 0.03244504*f0.w + -0.028429842*g0.w + -0.072642036*h0.w + -0.1377792*i0.w; + m = 0.008575682*a1.x + 0.033175733*b1.x + 0.23012964*c1.x + 0.06180262*d1.x + 0.0999609*e1.x + -0.02964116*f1.x + -0.071621336*g1.x + 0.08913871*h1.x + 0.012078745*i1.x; + n = 0.10756925*a1.y + -0.12054749*b1.y + -0.11993612*c1.y + -0.05570062*d1.y + 0.26974162*e1.y + -0.019340996*f1.y + -0.04401674*g1.y + -0.072913505*h1.y + 0.0020360341*i1.y; + o = -0.11235567*a1.z + 0.10706251*b1.z + -0.05232752*c1.z + 0.024162654*d1.z + -0.016020348*e1.z + 0.14959016*f1.z + -0.07076375*g1.z + -0.12533532*h1.z + -0.011636851*i1.z; + p = -0.01996831*a1.w + 0.1160153*b1.w + -0.13922714*c1.w + -0.029968955*d1.w + -0.23581982*e1.w + 0.11195416*f1.w + 0.047328863*g1.w + 0.27882084*h1.w + 0.12671103*i1.w; + q = -0.009971324*na0.x + -0.10869965*nb0.x + 0.035636835*nc0.x + -0.02722658*nd0.x + -0.25910825*ne0.x + 0.03161085*nf0.x + 0.11639807*ng0.x + -0.010749773*nh0.x + -0.24573305*ni0.x; + r = 0.050995197*na0.y + -0.10302342*nb0.y + -0.1673679*nc0.y + -0.20349346*nd0.y + -0.55413437*ne0.y + -0.029592037*nf0.y + -0.036228*ng0.y + 0.069125436*nh0.y + -0.18871574*ni0.y; + s = 0.038417455*na0.z + -0.21142405*nb0.z + -0.034855157*nc0.z + -0.054826926*nd0.z + -0.24405639*ne0.z + 0.11743097*nf0.z + -0.0859903*ng0.z + 0.21720038*nh0.z + 0.08788087*ni0.z; + t = 0.048770655*na0.w + 0.12233943*nb0.w + -0.03950986*nc0.w + -0.009187269*nd0.w + -0.12946133*ne0.w + -0.07174181*nf0.w + 0.021697959*ng0.w + 0.075961806*nh0.w + 0.061868332*ni0.w; + u = -0.06566027*na1.x + 0.00080207275*nb1.x + 0.020833474*nc1.x + 0.013340379*nd1.x + -0.2165162*ne1.x + 0.0868738*nf1.x + 0.043138873*ng1.x + 0.22945437*nh1.x + 0.0138047775*ni1.x; + v = 0.017050784*na1.y + 0.2494357*nb1.y + 0.011488906*nc1.y + -0.068815716*nd1.y + -0.5650941*ne1.y + 0.030278916*nf1.y + 0.055531804*ng1.y + 0.14427291*nh1.y + 0.0024433972*ni1.y; + w = 0.14314358*na1.z + 0.0028497116*nb1.z + -0.0023248373*nc1.z + -0.06904705*nd1.z + -0.11152599*ne1.z + -0.21558757*nf1.z + -0.05603373*ng1.z + 0.0005346824*nh1.z + 0.13354091*ni1.z; + x = -0.049296606*na1.w + -0.07173451*nb1.w + 0.2581109*nc1.w + -0.01809698*nd1.w + 0.007841395*ne1.w + -0.22031958*nf1.w + -0.0476805*ng1.w + -0.11961736*nh1.w + -0.08217695*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.009083936; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN70 +//!BIND LUMAN71 +//!SAVE LUMAN80 + +#define L0_tex LUMAN70_tex +#define L1_tex LUMAN71_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.035619374*a0.x + 0.11422981*b0.x + 0.08590356*c0.x + -0.12612246*d0.x + 0.043873888*e0.x + 0.05914766*f0.x + -0.100714274*g0.x + 0.048455495*h0.x + -0.06725533*i0.x; + float j = -0.0013158132*a0.y + -0.0027882596*b0.y + -0.10217369*c0.y + 0.31677207*d0.y + 0.036820866*e0.y + -0.05431359*f0.y + 0.14844827*g0.y + -0.10730725*h0.y + -0.063290775*i0.y; + float k = 0.087911345*a0.z + 0.26342505*b0.z + 0.013027925*c0.z + 0.06752866*d0.z + -0.19719961*e0.z + -0.04780573*f0.z + 0.026932135*g0.z + -0.05800601*h0.z + -0.040505923*i0.z; + float l = 0.04630579*a0.w + -0.11939466*b0.w + -0.010408778*c0.w + 0.04669857*d0.w + -0.13335805*e0.w + -0.020812513*f0.w + -0.06745056*g0.w + 0.05681251*h0.w + 0.06444111*i0.w; + float m = 0.053154137*a1.x + 0.060493603*b1.x + 0.08252165*c1.x + 0.020070437*d1.x + -0.08261315*e1.x + 0.018669957*f1.x + -0.041988045*g1.x + -0.036143973*h1.x + -0.08385737*i1.x; + float n = -0.20525856*a1.y + -0.2934399*b1.y + -0.10462723*c1.y + 0.13134363*d1.y + -0.06662953*e1.y + 0.06028899*f1.y + 0.15253557*g1.y + -0.11593999*h1.y + 0.15354787*i1.y; + float o = -0.016207945*a1.z + -0.011455923*b1.z + 0.024988474*c1.z + 0.061092008*d1.z + 0.10414427*e1.z + -0.04360575*f1.z + 0.090637736*g1.z + 0.15851928*h1.z + 0.06644112*i1.z; + float p = -0.0030416374*a1.w + 0.34662476*b1.w + -0.042266436*c1.w + 0.31826603*d1.w + -0.02068287*e1.w + -0.07076953*f1.w + -0.048260685*g1.w + 0.13000193*h1.w + -0.0017414218*i1.w; + float q = 0.14909811*na0.x + -0.10734144*nb0.x + -0.10109777*nc0.x + 0.111862935*nd0.x + -0.107315935*ne0.x + -0.04478417*nf0.x + -0.0054377364*ng0.x + 0.0148478085*nh0.x + 0.06869275*ni0.x; + float r = -0.045117185*na0.y + -0.056990396*nb0.y + -0.003557616*nc0.y + -0.24177164*nd0.y + -0.2250938*ne0.y + 0.0349928*nf0.y + -0.07328847*ng0.y + 0.055793595*nh0.y + 0.08246393*ni0.y; + float s = 0.08810404*na0.z + 0.08207737*nb0.z + -0.03529103*nc0.z + -0.07186509*nd0.z + 0.11098997*ne0.z + -0.0061407485*nf0.z + -0.01619299*ng0.z + 0.016094537*nh0.z + 0.024314752*ni0.z; + float t = -0.049262095*na0.w + -0.015455753*nb0.w + 0.08398538*nc0.w + -0.06844428*nd0.w + 0.06602493*ne0.w + 0.0039364174*nf0.w + 0.024258781*ng0.w + -0.031155214*nh0.w + -0.02522881*ni0.w; + float u = -0.09289411*na1.x + -0.014842693*nb1.x + 0.07513892*nc1.x + -0.01653032*nd1.x + 0.01198521*ne1.x + 0.02763562*nf1.x + -0.05833778*ng1.x + 0.18610096*nh1.x + 0.24278776*ni1.x; + float v = -0.030026099*na1.y + 0.23567812*nb1.y + -0.013640245*nc1.y + -0.21221665*nd1.y + 0.12864627*ne1.y + -0.03775464*nf1.y + -0.06271767*ng1.y + 0.1398742*nh1.y + -0.10901197*ni1.y; + float w = -0.020543138*na1.z + 0.06967397*nb1.z + 0.046968646*nc1.z + -0.033888735*nd1.z + -0.034942474*ne1.z + 0.040396962*nf1.z + -0.018973283*ng1.z + -0.13343549*nh1.z + -0.040663805*ni1.z; + float x = -0.033192288*na1.w + 0.044186935*nb1.w + 0.027151039*nc1.w + 0.11160459*nd1.w + -0.10746703*ne1.w + -0.0275698*nf1.w + 0.00025248327*ng1.w + -0.09284146*nh1.w + -4.7326103e-07*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0014252196; + i = 0.06571178*a0.x + 0.08752779*b0.x + -0.091107346*c0.x + -0.19443138*d0.x + 0.17203617*e0.x + 0.05960761*f0.x + -0.1393299*g0.x + -0.0799575*h0.x + 0.08354188*i0.x; + j = 0.038831577*a0.y + 0.071457274*b0.y + 0.060086038*c0.y + 0.07407433*d0.y + 0.37381777*e0.y + 0.32434905*f0.y + -0.04149505*g0.y + -0.06551896*h0.y + -0.013210035*i0.y; + k = -0.109215535*a0.z + 0.21024004*b0.z + -0.019975739*c0.z + -0.13754839*d0.z + -0.061911196*e0.z + -0.032958355*f0.z + -0.0379819*g0.z + 0.10028795*h0.z + 0.06666433*i0.z; + l = 0.016613448*a0.w + 0.012890488*b0.w + 0.053424753*c0.w + -0.026453787*d0.w + -0.023092046*e0.w + -0.06779156*f0.w + 0.0387629*g0.w + 0.0689873*h0.w + -0.020838996*i0.w; + m = 0.009282248*a1.x + 0.023164941*b1.x + -0.056021832*c1.x + 0.10002012*d1.x + 0.07492648*e1.x + -0.019302674*f1.x + 0.04560832*g1.x + 0.05301786*h1.x + 0.052765965*i1.x; + n = 0.12870239*a1.y + 0.029347612*b1.y + 0.08708535*c1.y + -0.05709532*d1.y + 0.045824323*e1.y + 0.17394269*f1.y + -0.008406947*g1.y + 0.010693501*h1.y + 0.06908317*i1.y; + o = -0.019160919*a1.z + -0.023981726*b1.z + 0.022585778*c1.z + -0.07323051*d1.z + 0.36100793*e1.z + 0.16888963*f1.z + 0.10322411*g1.z + 0.09305132*h1.z + 0.042125456*i1.z; + p = 0.0046699475*a1.w + 0.040598672*b1.w + -0.039084535*c1.w + -0.105519764*d1.w + -0.014312278*e1.w + 0.39844912*f1.w + 0.17213784*g1.w + 0.26695442*h1.w + 0.05388345*i1.w; + q = -0.10016962*na0.x + -0.12659925*nb0.x + -0.03206459*nc0.x + 0.054242257*nd0.x + 0.02684625*ne0.x + 0.004823341*nf0.x + -0.017493445*ng0.x + 0.017013837*nh0.x + 0.08707511*ni0.x; + r = -0.044897594*na0.y + -0.036943387*nb0.y + 0.06422842*nc0.y + -0.14496045*nd0.y + -0.37491864*ne0.y + -0.13676596*nf0.y + 0.002421831*ng0.y + 0.026525924*nh0.y + -0.014468307*ni0.y; + s = 0.03307358*na0.z + -0.06645562*nb0.z + -0.10887851*nc0.z + 0.060231242*nd0.z + 0.094336696*ne0.z + 0.075766265*nf0.z + 0.0372266*ng0.z + -0.08996786*nh0.z + 0.04349408*ni0.z; + t = 0.027824618*na0.w + 0.02099561*nb0.w + -0.20901664*nc0.w + 0.008137844*nd0.w + 0.1632197*ne0.w + 0.11545344*nf0.w + -0.02712516*ng0.w + -0.1053238*nh0.w + 0.030839035*ni0.w; + u = -0.15002786*na1.x + -0.060460884*nb1.x + -0.052398346*nc1.x + -0.21840262*nd1.x + -0.28199655*ne1.x + -0.3273765*nf1.x + 0.0019613882*ng1.x + 0.011343327*nh1.x + -0.025745407*ni1.x; + v = 0.089596294*na1.y + 0.09888554*nb1.y + -0.08620766*nc1.y + 0.09190667*nd1.y + 0.2761042*ne1.y + 0.06215537*nf1.y + -0.12014056*ng1.y + -0.13912943*nh1.y + -0.01775009*ni1.y; + w = -0.0119106565*na1.z + 0.14187837*nb1.z + 0.01875191*nc1.z + 0.028395357*nd1.z + -0.23534073*ne1.z + -0.062408306*nf1.z + -0.037198827*ng1.z + -0.09503546*nh1.z + -0.012481542*ni1.z; + x = 0.041350663*na1.w + 0.08808989*nb1.w + -0.039139986*nc1.w + 0.042839583*nd1.w + -0.14522356*ne1.w + -0.11225413*nf1.w + -0.013681964*ng1.w + -0.14814405*nh1.w + -0.08169235*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0063231788; + i = 0.199979*a0.x + 0.23061875*b0.x + -0.10920823*c0.x + 0.2127411*d0.x + 0.4562264*e0.x + 0.36791566*f0.x + 0.0061307796*g0.x + -0.03753298*h0.x + 0.20458831*i0.x; + j = -0.018984666*a0.y + 0.027848508*b0.y + 0.21057007*c0.y + -0.093486205*d0.y + 0.18769784*e0.y + 0.09004035*f0.y + -0.009871945*g0.y + 0.017700918*h0.y + -0.031650737*i0.y; + k = 0.15855373*a0.z + -0.1765117*b0.z + 0.24707586*c0.z + -0.11049361*d0.z + 0.120230295*e0.z + -0.120945446*f0.z + -0.0063170996*g0.z + -0.09350059*h0.z + 0.02323171*i0.z; + l = 0.08899516*a0.w + 0.19440293*b0.w + 0.013561043*c0.w + 0.1332691*d0.w + 0.9103674*e0.w + 0.07233763*f0.w + -0.047864635*g0.w + -0.010924825*h0.w + -0.054715794*i0.w; + m = -0.07388303*a1.x + 0.21895209*b1.x + 0.010642248*c1.x + -0.1206663*d1.x + -0.0017110996*e1.x + 0.24471904*f1.x + -0.090800084*g1.x + 0.16108827*h1.x + 0.23052362*i1.x; + n = -0.09725227*a1.y + 0.23545225*b1.y + -0.1309613*c1.y + -0.12544434*d1.y + 0.23154052*e1.y + -0.18917055*f1.y + 0.13009694*g1.y + -0.11781752*h1.y + 0.0010935594*i1.y; + o = 0.0049910066*a1.z + 0.015982643*b1.z + -0.0061242487*c1.z + 0.11340745*d1.z + 0.37257516*e1.z + 0.043045927*f1.z + 0.06434129*g1.z + 0.21555494*h1.z + -0.0042368937*i1.z; + p = 0.082077265*a1.w + 0.05672133*b1.w + -0.06472555*c1.w + -0.055614956*d1.w + -0.08767573*e1.w + -0.28633016*f1.w + -0.17009583*g1.w + 0.27785555*h1.w + 0.056071628*i1.w; + q = 0.08759647*na0.x + -0.20314527*nb0.x + 0.15229012*nc0.x + 0.041185692*nd0.x + -0.23530194*ne0.x + -0.14208466*nf0.x + 0.11049026*ng0.x + 0.12073572*nh0.x + -0.0577295*ni0.x; + r = 0.019904044*na0.y + 0.018032687*nb0.y + -0.13282707*nc0.y + -0.12976085*nd0.y + -0.0851056*ne0.y + -0.24886972*nf0.y + -0.17227782*ng0.y + 0.02357173*nh0.y + 0.082668714*ni0.y; + s = 0.22471142*na0.z + -0.18081205*nb0.z + -0.08472062*nc0.z + 0.051625133*nd0.z + -0.3786994*ne0.z + 0.19139658*nf0.z + 0.0458613*ng0.z + -0.0066961776*nh0.z + -0.046551377*ni0.z; + t = -0.1452213*na0.w + 0.09566916*nb0.w + -0.08075796*nc0.w + -0.20701256*nd0.w + -0.38712594*ne0.w + 0.066817015*nf0.w + -0.013330645*ng0.w + 0.004587282*nh0.w + 0.0044981963*ni0.w; + u = -0.15362954*na1.x + 0.14077385*nb1.x + -0.023733815*nc1.x + 0.32859254*nd1.x + -0.26526156*ne1.x + -0.3064315*nf1.x + 0.03460431*ng1.x + -0.061959833*nh1.x + -0.25696978*ni1.x; + v = 0.1043488*na1.y + 0.19938381*nb1.y + 0.35066408*nc1.y + 0.052177925*nd1.y + 0.25914505*ne1.y + 0.18082118*nf1.y + -0.13857333*ng1.y + 0.08814344*nh1.y + 0.08745096*ni1.y; + w = -0.020234669*na1.z + 0.037020292*nb1.z + 0.16186818*nc1.z + -0.031144649*nd1.z + -0.30665946*ne1.z + 0.105531685*nf1.z + -0.04954673*ng1.z + 0.08786373*nh1.z + -0.123731464*ni1.z; + x = -0.0112807825*na1.w + 0.017921103*nb1.w + 0.07448235*nc1.w + -0.08664955*nd1.w + 0.05499397*ne1.w + 0.014387606*nf1.w + 0.07323461*ng1.w + -0.114632644*nh1.w + -0.11618331*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.013133188; + i = 0.0597138*a0.x + -0.08610238*b0.x + -0.028665632*c0.x + -0.22173823*d0.x + -0.3086256*e0.x + -0.04300896*f0.x + -0.05005118*g0.x + -0.067843765*h0.x + -0.01712894*i0.x; + j = -0.07549083*a0.y + -0.34679034*b0.y + 0.001367597*c0.y + -0.041651245*d0.y + -0.3563761*e0.y + 0.1272373*f0.y + -0.19311947*g0.y + 0.0062134555*h0.y + -0.03911722*i0.y; + k = -0.10124364*a0.z + -0.1392256*b0.z + -0.025747765*c0.z + -0.17028576*d0.z + -0.04966502*e0.z + -0.068353444*f0.z + -0.06490578*g0.z + 0.19330779*h0.z + -0.15174128*i0.z; + l = -0.045293238*a0.w + 0.28092697*b0.w + 0.15129393*c0.w + -0.0899719*d0.w + 0.22142841*e0.w + -0.012547027*f0.w + 0.14377733*g0.w + 0.022239886*h0.w + 0.0706811*i0.w; + m = 0.004948647*a1.x + -0.07952092*b1.x + -0.005588038*c1.x + 0.080402285*d1.x + -0.1299574*e1.x + 0.102539904*f1.x + -0.00044476325*g1.x + -0.032420598*h1.x + -0.09282016*i1.x; + n = 0.11100442*a1.y + 0.12993109*b1.y + 0.12758453*c1.y + 0.18054684*d1.y + 0.1392812*e1.y + -0.07014241*f1.y + -0.03861955*g1.y + 0.10125592*h1.y + 0.0038314038*i1.y; + o = 0.06520557*a1.z + 0.006842835*b1.z + 0.01872246*c1.z + -0.21221244*d1.z + -0.04671243*e1.z + 0.101514*f1.z + -0.024837673*g1.z + 0.19408646*h1.z + 0.062211882*i1.z; + p = 0.10764124*a1.w + 0.07714488*b1.w + -0.009523819*c1.w + -0.22998925*d1.w + -0.28999612*e1.w + 0.05397179*f1.w + 0.03093759*g1.w + -0.021440584*h1.w + 0.037218977*i1.w; + q = -0.20570432*na0.x + 0.012709159*nb0.x + 0.09455498*nc0.x + -0.16358799*nd0.x + 0.3280718*ne0.x + 0.002596912*nf0.x + -0.0315085*ng0.x + -0.08436351*nh0.x + -0.00079569634*ni0.x; + r = 0.09261593*na0.y + 0.19364753*nb0.y + -0.05850349*nc0.y + 0.11032683*nd0.y + 0.31128845*ne0.y + -0.11763885*nf0.y + 0.19743448*ng0.y + -0.01946789*nh0.y + 0.05673635*ni0.y; + s = 0.033889174*na0.z + 0.107985765*nb0.z + 0.14049667*nc0.z + -0.00057227246*nd0.z + 0.16228116*ne0.z + 0.06535901*nf0.z + 0.08563815*ng0.z + -0.09778197*nh0.z + 0.060218997*ni0.z; + t = 0.1382207*na0.w + -0.34366918*nb0.w + -0.07159504*nc0.w + 0.20757206*nd0.w + -0.15257928*ne0.w + 0.23665349*nf0.w + -0.0079668155*ng0.w + -0.03774751*nh0.w + 0.025174439*ni0.w; + u = 0.05979023*na1.x + 0.21410039*nb1.x + 0.0277462*nc1.x + -0.14315857*nd1.x + -0.08927151*ne1.x + -0.023229988*nf1.x + -0.04333517*ng1.x + 0.0071403272*nh1.x + 0.120679095*ni1.x; + v = 0.01266553*na1.y + -0.24217825*nb1.y + -0.06692956*nc1.y + 0.21709256*nd1.y + -0.2097772*ne1.y + 0.26281872*nf1.y + -0.029375581*ng1.y + -0.085459515*nh1.y + -0.008495006*ni1.y; + w = -0.06465596*na1.z + 0.07665564*nb1.z + -0.019982971*nc1.z + 0.17086358*nd1.z + 0.023132043*ne1.z + -0.10599891*nf1.z + 0.07691751*ng1.z + -0.23248987*nh1.z + -0.13741273*ni1.z; + x = -0.0106970705*na1.w + -0.11882599*nb1.w + -0.05005593*nc1.w + 0.028415836*nd1.w + -0.25891018*ne1.w + -0.04042173*nf1.w + -0.103319325*ng1.w + -0.05437728*nh1.w + -0.06257452*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.037121743; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN70 +//!BIND LUMAN71 +//!SAVE LUMAN81 + +#define L0_tex LUMAN70_tex +#define L1_tex LUMAN71_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.0035594627*a0.x + 0.12038972*b0.x + 0.020664928*c0.x + -0.09564937*d0.x + -0.24571119*e0.x + 0.3238691*f0.x + 0.17325595*g0.x + 0.2563469*h0.x + 0.15742101*i0.x; + float j = 0.047737293*a0.y + 0.12174407*b0.y + -0.0037528512*c0.y + 0.12503311*d0.y + -0.28859985*e0.y + 0.17565013*f0.y + -0.11089875*g0.y + 0.031075783*h0.y + -0.02618067*i0.y; + float k = -0.19977969*a0.z + 0.14283116*b0.z + 0.13913913*c0.z + 0.041978117*d0.z + 0.41509438*e0.z + 0.1267442*f0.z + -0.040185302*g0.z + -0.022216653*h0.z + -0.022823509*i0.z; + float l = -0.060234714*a0.w + -0.14831258*b0.w + 0.019350914*c0.w + 0.003702241*d0.w + 0.39907286*e0.w + 0.022984667*f0.w + 0.05545299*g0.w + -0.0787563*h0.w + -0.12892959*i0.w; + float m = 0.08037066*a1.x + -0.18128945*b1.x + -0.03249607*c1.x + 0.068933845*d1.x + -0.30093843*e1.x + 0.2657856*f1.x + -0.059506405*g1.x + 0.08838455*h1.x + 0.17838779*i1.x; + float n = 0.20739813*a1.y + -0.047565427*b1.y + -0.13744627*c1.y + 0.06407209*d1.y + -0.41378132*e1.y + 0.009229263*f1.y + -0.0034402746*g1.y + -0.08209963*h1.y + -0.02662598*i1.y; + float o = -0.028428562*a1.z + -0.06263071*b1.z + -0.09687462*c1.z + -0.05370017*d1.z + -0.08132385*e1.z + 0.025406176*f1.z + 0.13680756*g1.z + -0.20903514*h1.z + -0.087057374*i1.z; + float p = -0.059544336*a1.w + 0.17221068*b1.w + 0.019948697*c1.w + -0.021689683*d1.w + 0.35838723*e1.w + -0.02246449*f1.w + 0.009842488*g1.w + -0.08404416*h1.w + -0.14539391*i1.w; + float q = 0.031368583*na0.x + -0.07873013*nb0.x + -0.048282783*nc0.x + 0.15330768*nd0.x + 0.13624837*ne0.x + 0.003489596*nf0.x + -0.06954451*ng0.x + -0.17785366*nh0.x + -0.21068935*ni0.x; + float r = -0.10955879*na0.y + -0.07031983*nb0.y + 0.027158145*nc0.y + -0.10907232*nd0.y + -0.18709134*ne0.y + -0.044923406*nf0.y + 0.1491744*ng0.y + 0.22531477*nh0.y + 0.067887*ni0.y; + float s = 0.007157718*na0.z + 0.047460496*nb0.z + -0.05114494*nc0.z + 0.17035486*nd0.z + -0.19792128*ne0.z + 0.0046278005*nf0.z + 0.000758805*ng0.z + -0.015741793*nh0.z + -0.00054501754*ni0.z; + float t = 0.040760834*na0.w + 0.005885292*nb0.w + -0.063230574*nc0.w + -0.12301143*nd0.w + -0.36083934*ne0.w + -0.055142406*nf0.w + -0.009169166*ng0.w + 0.03937573*nh0.w + 0.06946885*ni0.w; + float u = 0.013201956*na1.x + 0.08828739*nb1.x + -0.11232451*nc1.x + -0.19637825*nd1.x + 0.32704473*ne1.x + -0.13675223*nf1.x + 0.16928957*ng1.x + 0.05799959*nh1.x + -0.20515703*ni1.x; + float v = -0.08137275*na1.y + 0.09916626*nb1.y + -0.03344903*nc1.y + -0.3554004*nd1.y + 0.1933217*ne1.y + -0.08688003*nf1.y + -0.037157822*ng1.y + 0.035184443*nh1.y + 0.04655514*ni1.y; + float w = -0.010426424*na1.z + 0.06698642*nb1.z + -0.0063963337*nc1.z + -0.011602357*nd1.z + 0.0026813527*ne1.z + 0.16570611*nf1.z + -0.069919996*ng1.z + 0.09920697*nh1.z + 0.06005996*ni1.z; + float x = 0.12693816*na1.w + 0.06537599*nb1.w + 0.0038803034*nc1.w + 0.101019114*nd1.w + -0.30651957*ne1.w + 0.07803141*nf1.w + -0.0045747124*ng1.w + 0.08764645*nh1.w + 0.046619754*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.021460632; + i = 0.18408899*a0.x + -0.16826582*b0.x + 0.029110307*c0.x + 0.018517664*d0.x + -0.45409498*e0.x + -0.25322545*f0.x + -0.08358312*g0.x + -1.5571204e-05*h0.x + -0.030115725*i0.x; + j = -0.095829435*a0.y + 0.0956517*b0.y + 0.030972734*c0.y + 0.07102308*d0.y + 0.2045019*e0.y + -0.025642421*f0.y + 0.023203015*g0.y + -0.054684825*h0.y + -0.07058941*i0.y; + k = 0.15398344*a0.z + -0.058395036*b0.z + -0.014716754*c0.z + -0.010085025*d0.z + 0.0076141944*e0.z + 0.07213757*f0.z + 0.04619976*g0.z + -0.07169352*h0.z + 0.109850734*i0.z; + l = -0.10673365*a0.w + -0.19558638*b0.w + -0.13687268*c0.w + 0.06683206*d0.w + 0.18710184*e0.w + -0.038076635*f0.w + 0.021108862*g0.w + 0.055217225*h0.w + 0.045482595*i0.w; + m = -0.103124246*a1.x + 0.04979288*b1.x + -0.14140393*c1.x + 0.091398045*d1.x + 0.14379893*e1.x + -0.1343946*f1.x + 0.06328437*g1.x + 0.095048964*h1.x + 0.0053989524*i1.x; + n = -0.28951663*a1.y + 0.04082115*b1.y + -0.041639026*c1.y + -0.08741475*d1.y + -0.4094756*e1.y + -0.046889693*f1.y + -0.048665598*g1.y + -0.016912755*h1.y + -0.065184765*i1.y; + o = 0.041484993*a1.z + 0.062167954*b1.z + 0.13701159*c1.z + -0.0037448267*d1.z + -0.4012658*e1.z + 0.09107117*f1.z + 0.032375693*g1.z + 0.046596777*h1.z + -0.021694195*i1.z; + p = -0.0657728*a1.w + -0.15465443*b1.w + 0.28652954*c1.w + 0.276086*d1.w + 0.82882595*e1.w + 0.40777725*f1.w + 0.21335135*g1.w + 0.12063082*h1.w + -0.067809604*i1.w; + q = -0.07317296*na0.x + 0.12092801*nb0.x + -0.122033745*nc0.x + 0.1218021*nd0.x + 0.3748805*ne0.x + 0.02080968*nf0.x + -0.08659379*ng0.x + 0.06500288*nh0.x + 0.108286195*ni0.x; + r = 0.18367934*na0.y + 0.0010851121*nb0.y + -0.0587228*nc0.y + -0.25490445*nd0.y + -0.14447315*ne0.y + 0.03789025*nf0.y + 0.04973444*ng0.y + 0.05696792*nh0.y + -0.15240029*ni0.y; + s = -0.024720518*na0.z + 0.4245658*nb0.z + 0.12234191*nc0.z + 0.30536148*nd0.z + 0.2554897*ne0.z + 0.014799129*nf0.z + -0.015152688*ng0.z + -0.11416671*nh0.z + 0.04041433*ni0.z; + t = -0.017217876*na0.w + -0.10715295*nb0.w + 0.005794767*nc0.w + -0.052738365*nd0.w + -0.152631*ne0.w + -0.013479686*nf0.w + -0.034019798*ng0.w + -0.05703783*nh0.w + -0.010331549*ni0.w; + u = 0.098668344*na1.x + -0.25669348*nb1.x + -0.019031374*nc1.x + 0.017597904*nd1.x + 0.39555046*ne1.x + 0.21499567*nf1.x + -0.07296321*ng1.x + -0.26197156*nh1.x + -0.012222828*ni1.x; + v = -0.039902315*na1.y + -0.41862145*nb1.y + 0.058357593*nc1.y + 0.1586242*nd1.y + 0.18992789*ne1.y + -0.051665388*nf1.y + -0.09742037*ng1.y + 0.06964658*nh1.y + 0.06772205*ni1.y; + w = -0.06602748*na1.z + -0.097169474*nb1.z + -0.057414*nc1.z + -0.12144658*nd1.z + 0.54734033*ne1.z + -0.028030278*nf1.z + -0.018566564*ng1.z + -0.18564*nh1.z + 0.0925991*ni1.z; + x = -0.15178564*na1.w + 0.0011031028*nb1.w + -0.015275681*nc1.w + -0.009574547*nd1.w + 0.10352668*ne1.w + 0.017580548*nf1.w + 0.024625003*ng1.w + -0.07591098*nh1.w + 0.014088646*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0060250857; + i = 0.019011308*a0.x + 0.033444997*b0.x + -0.03581608*c0.x + -0.039397176*d0.x + -0.3690848*e0.x + 0.021864276*f0.x + -0.07867141*g0.x + 0.08434385*h0.x + -0.009090522*i0.x; + j = 0.020657526*a0.y + 0.006953353*b0.y + -0.022416698*c0.y + 0.035708115*d0.y + 0.05767355*e0.y + -0.013203197*f0.y + 0.14224495*g0.y + 0.030157957*h0.y + -0.03581798*i0.y; + k = 0.07780682*a0.z + -0.0585135*b0.z + -0.051630992*c0.z + -0.055939876*d0.z + 0.18262525*e0.z + -0.090132564*f0.z + 0.12991647*g0.z + -0.12535602*h0.z + 0.042218972*i0.z; + l = 0.010307127*a0.w + 0.010460575*b0.w + 0.028567461*c0.w + 0.058343817*d0.w + 0.58971435*e0.w + 0.0068708695*f0.w + -0.00786947*g0.w + -0.09592207*h0.w + 0.029101066*i0.w; + m = -0.04291295*a1.x + 0.066946365*b1.x + 0.008595295*c1.x + -0.019690137*d1.x + -0.1677645*e1.x + -0.034328867*f1.x + -0.048139174*g1.x + -0.059789807*h1.x + -0.066321395*i1.x; + n = 0.03389471*a1.y + 0.26502246*b1.y + 0.18302165*c1.y + 0.09491692*d1.y + 0.021241223*e1.y + 0.17256165*f1.y + 0.0404323*g1.y + 0.0579923*h1.y + 0.005492218*i1.y; + o = 0.0076889577*a1.z + 0.11564411*b1.z + 0.026385188*c1.z + 0.018606775*d1.z + -0.19530635*e1.z + -0.022276096*f1.z + 0.02216031*g1.z + 0.24999204*h1.z + -0.007822727*i1.z; + p = -0.039314333*a1.w + 0.057142776*b1.w + 0.037845295*c1.w + 0.12005467*d1.w + 0.16426453*e1.w + 0.015574408*f1.w + -0.061150614*g1.w + -0.13893083*h1.w + 0.16615587*i1.w; + q = -0.014885288*na0.x + -0.040328924*nb0.x + -0.05977982*nc0.x + 0.09812612*nd0.x + 0.19854964*ne0.x + -0.11895066*nf0.x + 0.010794935*ng0.x + -0.006710417*nh0.x + 0.068268105*ni0.x; + r = 0.024664057*na0.y + 0.027309645*nb0.y + -0.00091027824*nc0.y + -0.08709317*nd0.y + -0.0052896333*ne0.y + 0.014205412*nf0.y + -0.14190152*ng0.y + -0.25411522*nh0.y + -0.0023517665*ni0.y; + s = 0.02154945*na0.z + 0.12541628*nb0.z + -0.055260804*nc0.z + 0.03945718*nd0.z + -0.32898843*ne0.z + -0.011599959*nf0.z + -0.092199944*ng0.z + 0.15010926*nh0.z + 0.008878597*ni0.z; + t = -0.049145244*na0.w + 0.08057064*nb0.w + -0.051043004*nc0.w + -0.046488475*nd0.w + -0.42943993*ne0.w + -0.05612305*nf0.w + -0.011810398*ng0.w + 0.086631544*nh0.w + -0.061234765*ni0.w; + u = -0.19244489*na1.x + -0.11959134*nb1.x + 0.123622924*nc1.x + -0.052711625*nd1.x + -0.15718763*ne1.x + -0.22365978*nf1.x + -0.021615187*ng1.x + -0.08971221*nh1.x + 0.079056434*ni1.x; + v = 0.04648465*na1.y + -0.2027671*nb1.y + -0.06965296*nc1.y + -0.12387141*nd1.y + 0.22138685*ne1.y + 0.021332582*nf1.y + 0.026996912*ng1.y + -0.103880666*nh1.y + -0.008200975*ni1.y; + w = 0.03508963*na1.z + -0.08834725*nb1.z + 0.03435375*nc1.z + 0.03863173*nd1.z + 0.08056959*ne1.z + -0.0834241*nf1.z + -0.0147202825*ng1.z + -0.06330953*nh1.z + 0.012078014*ni1.z; + x = -0.02340783*na1.w + 0.010710042*nb1.w + 0.02718297*nc1.w + -0.019940894*nd1.w + 0.00040069708*ne1.w + -0.10751297*nf1.w + 0.014186145*ng1.w + 0.039040815*nh1.w + -0.049185835*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.008812009; + i = 0.07841893*a0.x + 0.30597758*b0.x + 0.039592993*c0.x + -0.1392278*d0.x + -0.18927181*e0.x + -0.25712314*f0.x + 0.16298722*g0.x + 0.0978296*h0.x + 0.014630055*i0.x; + j = 0.017117297*a0.y + -0.17809464*b0.y + -0.18548822*c0.y + 0.2618222*d0.y + 0.1903122*e0.y + -0.10584681*f0.y + 0.12803845*g0.y + 0.12465525*h0.y + 0.0057999417*i0.y; + k = -0.1265387*a0.z + -0.26912108*b0.z + -0.2629887*c0.z + 0.03371654*d0.z + -0.02986012*e0.z + -0.1738381*f0.z + 0.08100522*g0.z + -0.16834205*h0.z + 0.058091134*i0.z; + l = -0.008767114*a0.w + 0.14262395*b0.w + 0.099189475*c0.w + -0.20450254*d0.w + 0.4196956*e0.w + 0.008576616*f0.w + -0.097148575*g0.w + -0.015517277*h0.w + -0.06573792*i0.w; + m = 0.009081048*a1.x + -0.17330879*b1.x + 0.038787026*c1.x + -0.09260983*d1.x + -0.29981878*e1.x + -0.07358133*f1.x + -0.038811002*g1.x + -0.21674985*h1.x + 0.06779695*i1.x; + n = 0.24578477*a1.y + 0.43307883*b1.y + 0.29414627*c1.y + 0.46770245*d1.y + 0.11255661*e1.y + 0.45453352*f1.y + 0.13660336*g1.y + 0.16075915*h1.y + 0.07823638*i1.y; + o = 0.010055099*a1.z + 0.1257483*b1.z + 0.020316884*c1.z + -0.073165305*d1.z + -0.05080413*e1.z + -0.00898285*f1.z + 0.027939187*g1.z + 0.34161064*h1.z + 0.11474434*i1.z; + p = 0.10480826*a1.w + 0.058347534*b1.w + -0.03916004*c1.w + -0.19853686*d1.w + -0.07113309*e1.w + 0.023121873*f1.w + -0.13254455*g1.w + -0.030065117*h1.w + 0.39155975*i1.w; + q = -0.024030669*na0.x + -0.2835391*nb0.x + -0.2563511*nc0.x + 0.2444749*nd0.x + -0.08338291*ne0.x + -0.02303733*nf0.x + -0.048666645*ng0.x + -0.16980661*nh0.x + 0.14233974*ni0.x; + r = 0.030986484*na0.y + 0.18971221*nb0.y + 0.019609256*nc0.y + -0.20937881*nd0.y + -0.07083975*ne0.y + 0.20925662*nf0.y + 0.021047208*ng0.y + -0.26694658*nh0.y + 0.021631766*ni0.y; + s = -0.05092649*na0.z + 0.1003873*nb0.z + 0.0010154173*nc0.z + -0.30542678*nd0.z + -0.050651006*ne0.z + -0.08529883*nf0.z + -0.14873579*ng0.z + 0.28444654*nh0.z + -0.0868977*ni0.z; + t = -0.07518888*na0.w + -0.08290228*nb0.w + -0.17608197*nc0.w + 0.023637211*nd0.w + -0.29993716*ne0.w + -0.038453452*nf0.w + 0.023888037*ng0.w + 0.060559735*nh0.w + 0.024841927*ni0.w; + u = 0.036475975*na1.x + 0.26582122*nb1.x + 0.10916547*nc1.x + -0.09054858*nd1.x + 0.009491323*ne1.x + -0.067552604*nf1.x + 0.12836859*ng1.x + 0.002995043*nh1.x + -0.1530478*ni1.x; + v = 0.11352374*na1.y + -0.039592106*nb1.y + -0.27043325*nc1.y + -0.4161087*nd1.y + -0.121836096*ne1.y + -0.11972322*nf1.y + 0.055229824*ng1.y + -0.16489632*nh1.y + 0.04047813*ni1.y; + w = -0.039167922*na1.z + -0.06771886*nb1.z + 0.015467069*nc1.z + 0.034550667*nd1.z + 0.05691168*ne1.z + -0.09975041*nf1.z + -0.110027954*ng1.z + -0.22872053*nh1.z + 0.05507539*ni1.z; + x = 0.007246742*na1.w + -0.09148137*nb1.w + 0.028967854*nc1.w + 0.0964552*nd1.w + -0.29469356*ne1.w + -0.14045818*nf1.w + 0.015332315*ng1.w + -0.04409656*nh1.w + -0.08756743*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0046669585; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN80 +//!BIND LUMAN81 +//!SAVE LUMAN90 + +#define L0_tex LUMAN80_tex +#define L1_tex LUMAN81_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.014250411*a0.x + -0.04238529*b0.x + -0.021654928*c0.x + -0.061056126*d0.x + 0.12432481*e0.x + -0.11172919*f0.x + 0.025456348*g0.x + 0.17375225*h0.x + -0.05928882*i0.x; + float j = -0.0069310674*a0.y + -0.17002995*b0.y + 0.014071309*c0.y + -0.08017034*d0.y + -0.15927497*e0.y + -0.13709296*f0.y + 0.03015211*g0.y + -0.10931449*h0.y + -0.07531325*i0.y; + float k = 0.085528105*a0.z + 0.07321134*b0.z + 0.04415391*c0.z + -0.060957205*d0.z + 0.20358115*e0.z + -0.0310266*f0.z + -0.06125441*g0.z + -0.01778268*h0.z + 0.058718406*i0.z; + float l = 0.020323409*a0.w + 0.12131576*b0.w + 0.034877058*c0.w + 0.026528962*d0.w + 0.29414418*e0.w + -0.048116814*f0.w + 0.03937826*g0.w + 0.027733173*h0.w + 0.10065619*i0.w; + float m = 0.084621675*a1.x + 0.08532275*b1.x + 0.015778627*c1.x + 0.097194195*d1.x + 0.4112123*e1.x + 0.27921355*f1.x + 0.10588195*g1.x + 0.053417943*h1.x + 0.09885509*i1.x; + float n = 0.07387635*a1.y + -0.055011578*b1.y + 0.039572112*c1.y + -0.076339245*d1.y + 0.31344843*e1.y + -0.05918905*f1.y + -0.074291565*g1.y + 0.04840767*h1.y + 0.06758669*i1.y; + float o = -0.10437262*a1.z + 0.06825754*b1.z + 0.056765143*c1.z + 0.021697484*d1.z + 0.45190138*e1.z + 0.2427271*f1.z + 0.062085584*g1.z + 0.28484273*h1.z + -0.094032384*i1.z; + float p = 0.04813119*a1.w + 0.007050882*b1.w + -0.052815583*c1.w + -0.09500402*d1.w + 0.14369574*e1.w + 0.019362302*f1.w + -0.13984235*g1.w + 0.02537242*h1.w + 0.05735736*i1.w; + float q = 0.03274758*na0.x + 0.029267251*nb0.x + 0.053376034*nc0.x + 0.08079781*nd0.x + 0.025893819*ne0.x + 0.26118472*nf0.x + -0.008455075*ng0.x + -0.10138187*nh0.x + 0.13818091*ni0.x; + float r = 0.012862027*na0.y + 0.0727372*nb0.y + 0.051430516*nc0.y + 0.023545163*nd0.y + 0.15226619*ne0.y + 0.08326266*nf0.y + -0.03657906*ng0.y + 0.098245256*nh0.y + 0.1295563*ni0.y; + float s = -0.072070636*na0.z + -0.04813981*nb0.z + -0.016097464*nc0.z + -0.08242316*nd0.z + -0.3567517*ne0.z + -0.05599013*nf0.z + -0.028758992*ng0.z + -0.02239777*nh0.z + -0.11760277*ni0.z; + float t = -0.016802538*na0.w + -0.0019249133*nb0.w + -0.038664613*nc0.w + 0.052025173*nd0.w + -0.35645428*ne0.w + 0.15000045*nf0.w + 0.039396226*ng0.w + -0.036765695*nh0.w + -0.05118801*ni0.w; + float u = -0.036604054*na1.x + -0.023219982*nb1.x + 0.007530918*nc1.x + 0.04736719*nd1.x + -0.42611703*ne1.x + -0.06174241*nf1.x + -0.03890206*ng1.x + 0.01575828*nh1.x + -0.0248451*ni1.x; + float v = -0.08923639*na1.y + -0.0043441607*nb1.y + -0.12167136*nc1.y + 0.027899772*nd1.y + -0.40207592*ne1.y + -0.056410473*nf1.y + 0.044626288*ng1.y + -0.12881693*nh1.y + -0.07811622*ni1.y; + float w = 0.14602704*na1.z + -0.028811814*nb1.z + -0.01618901*nc1.z + -0.012422737*nd1.z + -0.3331145*ne1.z + -0.1610778*nf1.z + -0.08348008*ng1.z + -0.059223644*nh1.z + 0.036051374*ni1.z; + float x = -0.012505048*na1.w + 0.059638865*nb1.w + -0.015351817*nc1.w + 0.10810725*nd1.w + -0.15226439*ne1.w + 0.006934493*nf1.w + 0.07647251*ng1.w + -0.00703516*nh1.w + -0.04167374*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.021942647; + i = 0.20880799*a0.x + -0.18952975*b0.x + 0.0410574*c0.x + -0.20322348*d0.x + -0.1942575*e0.x + -0.36810294*f0.x + -0.030349163*g0.x + -0.0241354*h0.x + -0.23881352*i0.x; + j = -0.15908454*a0.y + 0.023425695*b0.y + -0.05800883*c0.y + -0.22789474*d0.y + 0.13597105*e0.y + 0.12843077*f0.y + -0.2070944*g0.y + -0.09183324*h0.y + 0.1198077*i0.y; + k = 0.063545085*a0.z + -0.07194285*b0.z + 0.03841072*c0.z + -0.06573369*d0.z + -0.3593671*e0.z + -0.033107173*f0.z + 0.048501916*g0.z + 0.12236352*h0.z + -0.08455477*i0.z; + l = 0.10424859*a0.w + 0.14661445*b0.w + 0.111417264*c0.w + 0.23561446*d0.w + -0.16151448*e0.w + -0.059149202*f0.w + 0.09560583*g0.w + 0.14111574*h0.w + -0.0135328695*i0.w; + m = 0.0135551775*a1.x + -0.23273508*b1.x + 0.06987079*c1.x + -0.17985173*d1.x + -0.2573105*e1.x + 0.05890961*f1.x + 0.07531258*g1.x + -0.34863085*h1.x + -0.028425023*i1.x; + n = 0.13816424*a1.y + -0.16184004*b1.y + 0.0059585655*c1.y + 0.3248018*d1.y + -0.055002954*e1.y + 0.05005296*f1.y + 0.11523584*g1.y + -0.07849374*h1.y + -0.028928319*i1.y; + o = 0.07822528*a1.z + 0.18937865*b1.z + 0.08215902*c1.z + 0.1685611*d1.z + 0.027695673*e1.z + 0.073200606*f1.z + 0.023770861*g1.z + -0.016103616*h1.z + -0.0063722*i1.z; + p = -0.09772434*a1.w + -0.27336553*b1.w + -0.09073844*c1.w + 0.1401914*d1.w + -0.115432434*e1.w + -0.03692059*f1.w + -0.13910747*g1.w + -0.105095066*h1.w + -0.07490761*i1.w; + q = 0.039422616*na0.x + 0.19641484*nb0.x + -0.12821025*nc0.x + 0.24219863*nd0.x + -0.17712165*ne0.x + -0.026652308*nf0.x + -0.0058854646*ng0.x + 0.16638958*nh0.x + 0.17476979*ni0.x; + r = -0.19964898*na0.y + 0.14522126*nb0.y + 0.017497417*nc0.y + 0.11976333*nd0.y + -0.2522856*ne0.y + -0.1015291*nf0.y + 0.119959936*ng0.y + 0.13133897*nh0.y + -0.070109226*ni0.y; + s = 0.09179825*na0.z + 0.14095272*nb0.z + -0.040753435*nc0.z + 0.105170004*nd0.z + 0.4636101*ne0.z + -0.017486215*nf0.z + -0.1678732*ng0.z + 0.05558729*nh0.z + 0.064954616*ni0.z; + t = -0.10586936*na0.w + -0.109147035*nb0.w + -0.08276189*nc0.w + 0.19918762*nd0.w + 0.035725277*ne0.w + 0.007809945*nf0.w + -0.07378703*ng0.w + -0.13827443*nh0.w + 0.023840806*ni0.w; + u = -0.09291025*na1.x + 0.061407644*nb1.x + -0.0075824033*nc1.x + 0.11242122*nd1.x + 0.22942492*ne1.x + -0.04565064*nf1.x + -0.10208078*ng1.x + 0.2990975*nh1.x + 0.055351995*ni1.x; + v = -0.08343257*na1.y + 0.076851636*nb1.y + -0.014935781*nc1.y + -0.288692*nd1.y + 0.22209394*ne1.y + 0.022718837*nf1.y + -0.14564*ng1.y + -0.114482984*nh1.y + 0.1302801*ni1.y; + w = -0.06583774*na1.z + -0.18053466*nb1.z + -0.04791139*nc1.z + -0.17584006*nd1.z + -0.026865056*ne1.z + -0.10923432*nf1.z + 0.018325653*ng1.z + -0.14700639*nh1.z + -0.109260954*ni1.z; + x = 0.1805816*na1.w + 0.12407404*nb1.w + -0.010269265*nc1.w + -0.27490416*nd1.w + 0.2293687*ne1.w + 0.08178526*nf1.w + -0.099873096*ng1.w + 0.11110855*nh1.w + 0.093538925*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.03860623; + i = 0.048178677*a0.x + 0.13495404*b0.x + 0.027020844*c0.x + 0.017530996*d0.x + -0.26472944*e0.x + -0.32675788*f0.x + -0.0057494543*g0.x + -0.18215506*h0.x + 0.1866843*i0.x; + j = -0.04042012*a0.y + -0.12528907*b0.y + -0.13585721*c0.y + -0.09324433*d0.y + -0.16377172*e0.y + -0.19642009*f0.y + 0.015814828*g0.y + -0.13511328*h0.y + 0.061218485*i0.y; + k = 0.017718524*a0.z + 0.102305256*b0.z + 0.051078156*c0.z + 0.096709035*d0.z + 0.035923813*e0.z + -0.05596279*f0.z + 0.007461312*g0.z + -0.04832589*h0.z + -0.019453974*i0.z; + l = 0.06610844*a0.w + -0.08446715*b0.w + -0.13854147*c0.w + -0.018506333*d0.w + 0.32768026*e0.w + 0.21792646*f0.w + -0.021454493*g0.w + 0.0113977585*h0.w + -0.0026054222*i0.w; + m = 0.036436006*a1.x + 0.21372306*b1.x + 0.035791337*c1.x + -0.0029260095*d1.x + 0.21363598*e1.x + 0.11290417*f1.x + 0.06586176*g1.x + 0.1271434*h1.x + -0.059509236*i1.x; + n = -0.027422298*a1.y + 0.086997196*b1.y + 0.07657817*c1.y + 0.06558545*d1.y + 0.17395905*e1.y + -0.0073790425*f1.y + 0.01611407*g1.y + 0.06993937*h1.y + -0.0010416611*i1.y; + o = 0.0566174*a1.z + 0.035436492*b1.z + 0.042210266*c1.z + -0.04705494*d1.z + 0.41050985*e1.z + 0.1575727*f1.z + 0.06430424*g1.z + 0.09085263*h1.z + 0.045363627*i1.z; + p = 0.02746632*a1.w + 0.06629101*b1.w + 0.15184079*c1.w + -0.010816606*d1.w + -0.19920473*e1.w + -0.0012358276*f1.w + 0.11645233*g1.w + 0.15866442*h1.w + 0.041020997*i1.w; + q = -0.038356394*na0.x + 0.0496738*nb0.x + 0.089799084*nc0.x + -0.078450546*nd0.x + 0.19574346*ne0.x + 0.14296131*nf0.x + 0.02093717*ng0.x + 0.29675344*nh0.x + 0.007171671*ni0.x; + r = 0.06651706*na0.y + 0.04813143*nb0.y + 0.10353286*nc0.y + 0.21231888*nd0.y + 0.07545394*ne0.y + 0.20412438*nf0.y + 0.0012885222*ng0.y + 0.15668026*nh0.y + 0.029278977*ni0.y; + s = 0.047485173*na0.z + -0.050391153*nb0.z + -0.011836611*nc0.z + -0.10038617*nd0.z + -0.05150043*ne0.z + 0.10383776*nf0.z + -0.04044264*ng0.z + 0.056759108*nh0.z + 0.01960355*ni0.z; + t = -0.057880625*na0.w + 0.062443256*nb0.w + 0.1461875*nc0.w + -0.048376605*nd0.w + -0.5428768*ne0.w + -0.22234322*nf0.w + 0.029686691*ng0.w + 0.006077662*nh0.w + -0.016965399*ni0.w; + u = -0.061339878*na1.x + -0.22763349*nb1.x + -0.023490407*nc1.x + -0.008404945*nd1.x + -0.25364682*ne1.x + -0.059010275*nf1.x + -0.0016836784*ng1.x + -0.14596754*nh1.x + -0.07762156*ni1.x; + v = 0.038167924*na1.y + 0.03796828*nb1.y + 0.01749249*nc1.y + -0.02317157*nd1.y + -0.17835931*ne1.y + 0.114591315*nf1.y + 0.027806472*ng1.y + -0.12774202*nh1.y + -0.043270994*ni1.y; + w = 0.009977157*na1.z + 0.046160668*nb1.z + 0.075068384*nc1.z + 0.18530163*nd1.z + -0.42971575*ne1.z + -0.10997692*nf1.z + 0.01309119*ng1.z + 0.103382744*nh1.z + -0.051152173*ni1.z; + x = 0.008308241*na1.w + 0.112016656*nb1.w + -0.03204292*nc1.w + -0.03667412*nd1.w + 0.05480717*ne1.w + -0.021357488*nf1.w + -0.0192476*ng1.w + -0.041222185*nh1.w + -0.03899985*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.05658022; + i = 0.030151002*a0.x + 0.1860666*b0.x + -0.0022055737*c0.x + -0.13249823*d0.x + -0.07754814*e0.x + 0.11103858*f0.x + -0.25461784*g0.x + -0.23121211*h0.x + 0.13869268*i0.x; + j = 0.02170408*a0.y + -0.0014520105*b0.y + -0.0075796046*c0.y + 0.007614655*d0.y + -0.24949898*e0.y + 0.008160589*f0.y + -0.07433261*g0.y + 0.12531595*h0.y + -0.025806854*i0.y; + k = -0.1143635*a0.z + 0.07558083*b0.z + 0.06544773*c0.z + 0.009476022*d0.z + -0.11959558*e0.z + 0.046458866*f0.z + -0.070280805*g0.z + 0.061093763*h0.z + 0.063683785*i0.z; + l = -0.022641785*a0.w + -0.29642823*b0.w + -0.18833381*c0.w + -0.14111918*d0.w + 0.10596381*e0.w + -0.018907588*f0.w + -0.054916237*g0.w + -0.18433844*h0.w + 0.017380793*i0.w; + m = 0.10092058*a1.x + 0.12342665*b1.x + -0.14488818*c1.x + -0.094983876*d1.x + -0.13887641*e1.x + -0.31285325*f1.x + -0.30513728*g1.x + 0.008164597*h1.x + -0.02678668*i1.x; + n = -0.10522648*a1.y + 0.083025984*b1.y + 0.058566112*c1.y + 0.100287765*d1.y + -0.18487187*e1.y + 0.061653536*f1.y + -0.004182874*g1.y + 0.21625677*h1.y + 0.043687273*i1.y; + o = 0.1626286*a1.z + -0.0571527*b1.z + -0.13826865*c1.z + 0.057854813*d1.z + -0.08257844*e1.z + 0.0632713*f1.z + -0.052715078*g1.z + -0.2670316*h1.z + -0.12404669*i1.z; + p = 0.022306629*a1.w + -0.2257537*b1.w + -0.12413365*c1.w + 0.010597138*d1.w + -0.15639839*e1.w + 0.043527965*f1.w + 0.045449335*g1.w + 0.059061706*h1.w + 0.101682454*i1.w; + q = 0.061564334*na0.x + -0.14031292*nb0.x + -0.014025187*nc0.x + 0.17911491*nd0.x + 0.33740097*ne0.x + 0.20792083*nf0.x + 0.24080946*ng0.x + 0.3538365*nh0.x + 0.05306646*ni0.x; + r = -0.14772856*na0.y + 0.018438019*nb0.y + -0.036556922*nc0.y + -0.13800567*nd0.y + 0.02649721*ne0.y + -0.022540266*nf0.y + 0.052261878*ng0.y + -0.027467266*nh0.y + 0.03414223*ni0.y; + s = 0.031204998*na0.z + 0.041114077*nb0.z + 0.007792205*nc0.z + 0.08775103*nd0.z + 0.064216435*ne0.z + 0.068528414*nf0.z + 0.09969219*ng0.z + 0.12135939*nh0.z + -0.094426885*ni0.z; + t = 0.10184967*na0.w + 0.123821415*nb0.w + 0.13014457*nc0.w + -0.027768346*nd0.w + -0.23585244*ne0.w + -0.05916951*nf0.w + 0.08106088*ng0.w + 0.1933105*nh0.w + 0.049981385*ni0.w; + u = -0.11509542*na1.x + -0.21260747*nb1.x + 0.10034503*nc1.x + -0.05343281*nd1.x + -0.16148616*ne1.x + 0.06921768*nf1.x + 0.1018865*ng1.x + -0.18180113*nh1.x + -0.0019478599*ni1.x; + v = 0.12437264*na1.y + 0.08438361*nb1.y + 0.029054416*nc1.y + -0.078915*nd1.y + 0.43418276*ne1.y + 0.088424504*nf1.y + 0.11200839*ng1.y + 0.04359535*nh1.y + -0.060695816*ni1.y; + w = -0.14184491*na1.z + 0.009048718*nb1.z + -0.0015884426*nc1.z + -0.051001117*nd1.z + 0.12083191*ne1.z + 0.08521108*nf1.z + -0.15348539*ng1.z + 0.2449776*nh1.z + 0.10972097*ni1.z; + x = 0.022142269*na1.w + 0.064288594*nb1.w + 0.10567636*nc1.w + 0.029814683*nd1.w + 0.3069626*ne1.w + -0.112773694*nf1.w + 0.0067777424*ng1.w + -0.049251463*nh1.w + -0.1269242*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.02718557; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN80 +//!BIND LUMAN81 +//!SAVE LUMAN91 + +#define L0_tex LUMAN80_tex +#define L1_tex LUMAN81_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.064591184*a0.x + -0.086834244*b0.x + 0.012061734*c0.x + 0.0076904036*d0.x + -0.006779139*e0.x + -0.11930803*f0.x + 0.064743415*g0.x + 0.061578117*h0.x + 0.07282739*i0.x; + float j = -0.038720116*a0.y + 0.2914675*b0.y + -0.08511401*c0.y + -0.27763*d0.y + -0.2341029*e0.y + -0.14690943*f0.y + 0.11503797*g0.y + 0.11770579*h0.y + -0.0988632*i0.y; + float k = -0.054292727*a0.z + 0.13346374*b0.z + 0.006554269*c0.z + 0.085298486*d0.z + 0.09256209*e0.z + 0.086568855*f0.z + -0.056956228*g0.z + 0.048038904*h0.z + -0.04360846*i0.z; + float l = 0.014501069*a0.w + -0.06803215*b0.w + 0.0285929*c0.w + 0.057434857*d0.w + 0.06706903*e0.w + 0.03170341*f0.w + -0.07010804*g0.w + -0.013323503*h0.w + 0.05878082*i0.w; + float m = -0.117725275*a1.x + -0.115913525*b1.x + 0.030663729*c1.x + 0.014097233*d1.x + -0.0011461431*e1.x + 0.04074681*f1.x + -0.04886523*g1.x + 0.014650436*h1.x + -0.017686432*i1.x; + float n = -0.034699902*a1.y + 0.04545689*b1.y + -0.0077859196*c1.y + 0.026581103*d1.y + 0.13295728*e1.y + 0.061012458*f1.y + -0.031488042*g1.y + 0.01683447*h1.y + -0.07727207*i1.y; + float o = 0.1326936*a1.z + -0.19639158*b1.z + 0.0724299*c1.z + -0.16482691*d1.z + 0.02623066*e1.z + -0.18723568*f1.z + -0.07948423*g1.z + -0.08207342*h1.z + -0.014039538*i1.z; + float p = -0.11302887*a1.w + -0.120441064*b1.w + 0.014967283*c1.w + -0.054630496*d1.w + 0.01606148*e1.w + 0.12035976*f1.w + -0.012942233*g1.w + -0.08405828*h1.w + -0.05511723*i1.w; + float q = 0.10044998*na0.x + 0.07703357*nb0.x + 0.027168838*nc0.x + -0.0712459*nd0.x + -0.12783852*ne0.x + -0.0038406162*nf0.x + 0.00017533907*ng0.x + -0.17575473*nh0.x + -0.104728825*ni0.x; + float r = -0.09326989*na0.y + -0.035516493*nb0.y + 0.044787653*nc0.y + 0.07938428*nd0.y + 0.10040959*ne0.y + 0.06931848*nf0.y + -0.12684844*ng0.y + 0.068755575*nh0.y + 0.08830972*ni0.y; + float s = 0.09743182*na0.z + -0.08618764*nb0.z + -0.09308724*nc0.z + -0.21439748*nd0.z + 0.17929722*ne0.z + -0.13537686*nf0.z + 0.030094212*ng0.z + -0.008233488*nh0.z + 0.026675478*ni0.z; + float t = -0.05652852*na0.w + 0.023983918*nb0.w + -0.023069844*nc0.w + -0.0070350813*nd0.w + -0.07495373*ne0.w + 0.0109437145*nf0.w + 0.05085677*ng0.w + 0.0018807751*nh0.w + -0.08273237*ni0.w; + float u = 0.13703896*na1.x + -0.028061252*nb1.x + 0.00063145265*nc1.x + 0.009538742*nd1.x + -0.043253537*ne1.x + 0.008935095*nf1.x + -0.011389033*ng1.x + -0.06325763*nh1.x + 0.059068896*ni1.x; + float v = 0.007938014*na1.y + -0.13704681*nb1.y + 0.0051192725*nc1.y + -0.06970636*nd1.y + -0.16930172*ne1.y + -0.15330653*nf1.y + 0.016541267*ng1.y + -0.03627275*nh1.y + 0.06254857*ni1.y; + float w = -0.10841602*na1.z + 0.4269225*nb1.z + -0.060182836*nc1.z + 0.1342713*nd1.z + 0.2973204*ne1.z + 0.22778602*nf1.z + -0.034208667*ng1.z + 0.12098727*nh1.z + 0.109278105*ni1.z; + float x = 0.1323955*na1.w + 0.041602165*nb1.w + 0.0026513515*nc1.w + 0.064577274*nd1.w + -0.027596513*ne1.w + -0.12952392*nf1.w + -0.044943932*ng1.w + -0.115508705*nh1.w + 0.015716452*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.001778901; + i = -0.18303195*a0.x + 0.1389399*b0.x + 0.05330645*c0.x + -0.024218678*d0.x + 0.1059723*e0.x + 0.1203514*f0.x + -0.02386567*g0.x + 0.23077035*h0.x + 0.1551605*i0.x; + j = 0.069662265*a0.y + 0.085549094*b0.y + -0.12123253*c0.y + -0.28440872*d0.y + -0.06886727*e0.y + -0.091464095*f0.y + 0.09047435*g0.y + 0.04713467*h0.y + -0.12803286*i0.y; + k = 0.090718895*a0.z + 0.16950507*b0.z + -0.17583397*c0.z + 0.06353087*d0.z + 0.19189116*e0.z + -0.177356*f0.z + -0.048778914*g0.z + -0.027957806*h0.z + 0.06524524*i0.z; + l = -0.15416801*a0.w + 0.2759223*b0.w + 0.1523193*c0.w + 0.144094*d0.w + 0.10375921*e0.w + 0.15397213*f0.w + 0.054405753*g0.w + 0.14805214*h0.w + 0.10322183*i0.w; + m = -0.0021164522*a1.x + -0.16641104*b1.x + 0.12112933*c1.x + 0.05051385*d1.x + 0.15445024*e1.x + -0.05820697*f1.x + -0.26677763*g1.x + 0.051000446*h1.x + 0.106548235*i1.x; + n = 0.09640368*a1.y + 0.14900348*b1.y + -0.1645799*c1.y + -0.12446157*d1.y + -0.12338426*e1.y + -0.16234943*f1.y + -0.08553169*g1.y + -0.032980308*h1.y + 0.1385679*i1.y; + o = -0.27444258*a1.z + -0.20495611*b1.z + 0.087560005*c1.z + -0.17420256*d1.z + 0.4487924*e1.z + 0.16391318*f1.z + -0.21524991*g1.z + 0.08579062*h1.z + 0.11324684*i1.z; + p = -0.006945982*a1.w + 0.34025064*b1.w + 0.22788335*c1.w + -0.011148917*d1.w + -0.018800734*e1.w + -0.15528628*f1.w + 0.07209469*g1.w + -0.12760407*h1.w + 0.037804488*i1.w; + q = 0.08400994*na0.x + -0.17910519*nb0.x + 0.109973855*nc0.x + 0.0025310386*nd0.x + 0.056285445*ne0.x + -0.20070016*nf0.x + -0.11361203*ng0.x + -0.31314817*nh0.x + -0.13633983*ni0.x; + r = 0.16386716*na0.y + -0.14517657*nb0.y + 0.11007822*nc0.y + 0.24017836*nd0.y + 0.35474586*ne0.y + 0.32407668*nf0.y + 0.037026286*ng0.y + -0.14789234*nh0.y + 0.07844272*ni0.y; + s = -0.16014752*na0.z + -0.2903345*nb0.z + 0.1348327*nc0.z + -0.049009476*nd0.z + 0.025261475*ne0.z + 0.20215334*nf0.z + -0.050232634*ng0.z + -0.13409953*nh0.z + -0.04761971*ni0.z; + t = 0.057999365*na0.w + -0.31749207*nb0.w + -0.031203046*nc0.w + -0.32174772*nd0.w + 0.081764035*ne0.w + -0.15557414*nf0.w + 0.040715005*ng0.w + -0.11489052*nh0.w + 0.009872706*ni0.w; + u = 0.073866144*na1.x + 0.08986749*nb1.x + -0.11700794*nc1.x + -0.13253777*nd1.x + -0.06588698*ne1.x + -0.063383356*nf1.x + 0.15730932*ng1.x + -0.07174025*nh1.x + -0.13080357*ni1.x; + v = -0.15654103*na1.y + -0.061252818*nb1.y + 0.32725814*nc1.y + 0.15096447*nd1.y + 0.40280807*ne1.y + 0.24929035*nf1.y + 0.15287307*ng1.y + 0.13057452*nh1.y + -0.18048123*ni1.y; + w = 0.33798084*na1.z + 0.02931741*nb1.z + -0.07852497*nc1.z + 0.38193208*nd1.z + -0.06619199*ne1.z + -0.21040082*nf1.z + 0.068854*ng1.z + -0.2469383*nh1.z + -0.08334495*ni1.z; + x = -0.02454442*na1.w + -0.3080107*nb1.w + -0.03530862*nc1.w + 0.041308373*nd1.w + 0.14073959*ne1.w + 0.20617355*nf1.w + -0.043657694*ng1.w + 0.13304688*nh1.w + 0.03679344*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.015583766; + i = 0.031398952*a0.x + 0.04189893*b0.x + 0.19730887*c0.x + 0.08555677*d0.x + -0.18717846*e0.x + 0.22618406*f0.x + -0.052923724*g0.x + 0.09675072*h0.x + -0.076768704*i0.x; + j = 0.11788979*a0.y + -0.15309438*b0.y + -0.04075275*c0.y + -0.110383265*d0.y + -0.48619998*e0.y + 0.07023799*f0.y + 0.10708083*g0.y + 0.26446325*h0.y + -0.048599552*i0.y; + k = 0.052632306*a0.z + 0.020550659*b0.z + -0.019962313*c0.z + 0.056734044*d0.z + 0.20157674*e0.z + 0.13263007*f0.z + -0.046961598*g0.z + -0.09691325*h0.z + 0.0531848*i0.z; + l = 0.101675026*a0.w + 0.27784944*b0.w + 0.12324177*c0.w + -0.07068762*d0.w + 0.0818228*e0.w + -0.09321215*f0.w + -0.11643468*g0.w + -0.102201894*h0.w + -0.072663896*i0.w; + m = -0.071761504*a1.x + 0.029838279*b1.x + -0.11154797*c1.x + 0.07294159*d1.x + 0.4818034*e1.x + -0.5087342*f1.x + -0.112223916*g1.x + -0.28908643*h1.x + -0.08666744*i1.x; + n = 0.014254376*a1.y + -0.06831736*b1.y + -0.02225946*c1.y + -0.061442286*d1.y + -0.21341231*e1.y + 0.07420914*f1.y + -0.020930115*g1.y + -0.23098978*h1.y + 0.047968682*i1.y; + o = -0.12318773*a1.z + 0.16779573*b1.z + 0.060841598*c1.z + -0.13125354*d1.z + 0.5366516*e1.z + 0.13552463*f1.z + -0.16648643*g1.z + -0.5225955*h1.z + 0.20588054*i1.z; + p = 0.021681841*a1.w + 0.0147839105*b1.w + -0.07116525*c1.w + -0.11239224*d1.w + -0.28134072*e1.w + -0.20774683*f1.w + -0.056640606*g1.w + -0.20807342*h1.w + -0.14187394*i1.w; + q = -0.10805369*na0.x + -0.17083731*nb0.x + -0.122314125*nc0.x + -0.17160355*nd0.x + -0.03651102*ne0.x + -0.3779597*nf0.x + 0.14284317*ng0.x + 0.07732665*nh0.x + -0.05547113*ni0.x; + r = 0.0049363286*na0.y + 0.063314065*nb0.y + 0.12015747*nc0.y + 0.027678438*nd0.y + 0.40603974*ne0.y + 0.15798166*nf0.y + -0.12128637*ng0.y + -0.34773082*nh0.y + -0.15439473*ni0.y; + s = -0.104180954*na0.z + -0.06222233*nb0.z + 0.03805832*nc0.z + 0.0090491325*nd0.z + -0.23674521*ne0.z + 0.073091164*nf0.z + 0.092849016*ng0.z + -0.101051524*nh0.z + 0.09585388*ni0.z; + t = -0.08372517*na0.w + -0.23765321*nb0.w + -0.11047642*nc0.w + -0.09844205*nd0.w + -0.001197135*ne0.w + 0.05874671*nf0.w + 0.04448913*ng0.w + 0.17621781*nh0.w + 0.15660878*ni0.w; + u = -0.06192374*na1.x + -0.23233692*nb1.x + 0.028859159*nc1.x + -0.21800128*nd1.x + -0.44495392*ne1.x + 0.16226628*nf1.x + 0.059766024*ng1.x + 0.040463783*nh1.x + -0.012325476*ni1.x; + v = -0.046759803*na1.y + 0.14202406*nb1.y + 0.17334686*nc1.y + 0.095378935*nd1.y + 0.4668013*ne1.y + 0.03654941*nf1.y + 0.049729843*ng1.y + 0.3160583*nh1.y + -0.037990443*ni1.y; + w = 0.054236986*na1.z + -0.24953325*nb1.z + -0.19295105*nc1.z + 0.110123426*nd1.z + -0.24358514*ne1.z + -0.094099194*nf1.z + -0.0844554*ng1.z + -0.25239566*nh1.z + -0.17206073*ni1.z; + x = -0.025024686*na1.w + 0.02190405*nb1.w + 0.04221924*nc1.w + 0.058701836*nd1.w + 0.6308858*ne1.w + 0.08038904*nf1.w + 0.009703351*ng1.w + 0.026796142*nh1.w + 0.19788514*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.025371183; + i = -0.058024336*a0.x + 0.10532148*b0.x + 0.100440994*c0.x + 0.14120099*d0.x + -0.44670558*e0.x + 0.35560834*f0.x + -0.016374707*g0.x + -0.110824086*h0.x + -0.08113989*i0.x; + j = 0.16398832*a0.y + -0.13447765*b0.y + 0.09828142*c0.y + -0.22374575*d0.y + -0.18894796*e0.y + -0.019239465*f0.y + 0.058094535*g0.y + 0.019594995*h0.y + -0.022476602*i0.y; + k = -0.04586844*a0.z + -0.041416757*b0.z + 0.007783088*c0.z + 0.159755*d0.z + 0.05849857*e0.z + 0.07732498*f0.z + 0.0147085795*g0.z + -0.055099167*h0.z + 0.002787397*i0.z; + l = 0.02477698*a0.w + 0.20407157*b0.w + 0.02392268*c0.w + -0.019186161*d0.w + -0.10105682*e0.w + -0.017388765*f0.w + -0.043925446*g0.w + -0.19729522*h0.w + -0.039546635*i0.w; + m = -0.12748602*a1.x + 0.007744777*b1.x + -0.11417597*c1.x + -0.06718526*d1.x + -0.18276522*e1.x + -0.22255349*f1.x + -0.081417985*g1.x + -0.32245603*h1.x + -0.061777283*i1.x; + n = -0.022619156*a1.y + -0.07581258*b1.y + 0.015761778*c1.y + 0.08068204*d1.y + -0.121548444*e1.y + -0.00881804*f1.y + 0.079423025*g1.y + -0.18817104*h1.y + 0.03789271*i1.y; + o = -0.076126486*a1.z + 0.12285975*b1.z + -0.051165633*c1.z + -0.2726493*d1.z + 0.03755115*e1.z + 0.21114524*f1.z + -0.13811706*g1.z + 0.0827258*h1.z + 0.023614317*i1.z; + p = 0.091591224*a1.w + -0.060717527*b1.w + -0.11393609*c1.w + -0.04921939*d1.w + -0.47288194*e1.w + -0.15777309*f1.w + 0.16799176*g1.w + -0.022680234*h1.w + -0.016104206*i1.w; + q = -0.037887465*na0.x + -0.15142171*nb0.x + -0.057591256*nc0.x + -0.19010404*nd0.x + -0.043804526*ne0.x + -0.43700722*nf0.x + -0.02484513*ng0.x + 0.36064592*nh0.x + 0.21845186*ni0.x; + r = -0.059631128*na0.y + -0.16758823*nb0.y + 0.064641714*nc0.y + 0.08638126*nd0.y + 0.22690679*ne0.y + 0.043664902*nf0.y + -0.13494207*ng0.y + 0.05925926*nh0.y + 0.042411618*ni0.y; + s = 0.12977123*na0.z + 0.029090298*nb0.z + 0.08898829*nc0.z + -0.1127789*nd0.z + -0.17318541*ne0.z + 0.031613287*nf0.z + -0.044531874*ng0.z + 0.08955115*nh0.z + -0.0037841343*ni0.z; + t = -0.03975416*na0.w + -0.14064074*nb0.w + -0.07762262*nc0.w + -0.3259637*nd0.w + 0.14367038*ne0.w + 0.08904514*nf0.w + 0.039760273*ng0.w + 0.21290119*nh0.w + 0.10287399*ni0.w; + u = 0.1206366*na1.x + -0.111801684*nb1.x + 0.028606556*nc1.x + -0.100312516*nd1.x + 0.06404543*ne1.x + 0.21569107*nf1.x + 0.0471198*ng1.x + 0.1317695*nh1.x + -0.008076078*ni1.x; + v = -0.043892793*na1.y + 0.050969392*nb1.y + 0.05223572*nc1.y + -0.015787575*nd1.y + 0.23640944*ne1.y + 0.030180406*nf1.y + 0.052976888*ng1.y + 0.24454458*nh1.y + 0.009542104*ni1.y; + w = 0.060694832*na1.z + -0.1225385*nb1.z + -0.060287304*nc1.z + 0.27989724*nd1.z + -0.13930206*ne1.z + -0.18856433*nf1.z + 0.12858151*ng1.z + -0.06630377*nh1.z + 0.032981817*ni1.z; + x = -0.12053484*na1.w + 0.11501946*nb1.w + -0.04619954*nc1.w + 0.04656391*nd1.w + 0.55226207*ne1.w + 0.14339776*nf1.w + -0.07201873*ng1.w + -0.005340205*nh1.w + 0.04245002*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.015942387; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN90 +//!BIND LUMAN91 +//!SAVE LUMAN100 + +#define L0_tex LUMAN90_tex +#define L1_tex LUMAN91_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.072347514*a0.x + 0.01950207*b0.x + -0.1554631*c0.x + 0.07643896*d0.x + 0.19518887*e0.x + -0.05865835*f0.x + -0.06931961*g0.x + -0.22170015*h0.x + -0.060511827*i0.x; + float j = -0.014025003*a0.y + -0.104386844*b0.y + -0.08156085*c0.y + -0.095033586*d0.y + -0.013332267*e0.y + -0.20685793*f0.y + -0.012088011*g0.y + 0.10598454*h0.y + -0.19078864*i0.y; + float k = -0.03994867*a0.z + -0.09009791*b0.z + 0.07993808*c0.z + -0.074835144*d0.z + 0.31472498*e0.z + 0.03673388*f0.z + 0.067335665*g0.z + -0.03211525*h0.z + -0.035896238*i0.z; + float l = 0.062431067*a0.w + 0.08663771*b0.w + 0.0069865235*c0.w + 0.07760846*d0.w + -0.25497046*e0.w + -0.2194801*f0.w + -0.14292969*g0.w + -0.030415112*h0.w + -0.02306825*i0.w; + float m = 0.101905294*a1.x + -0.10230241*b1.x + -0.09905037*c1.x + 0.012886894*d1.x + -0.21476957*e1.x + 0.036221605*f1.x + -0.07952149*g1.x + -0.0008413512*h1.x + 0.08244255*i1.x; + float n = -0.030719101*a1.y + -0.021777108*b1.y + -0.029602678*c1.y + -0.039401323*d1.y + -0.29197764*e1.y + -0.009044627*f1.y + -0.009216671*g1.y + 0.12832381*h1.y + -0.025247786*i1.y; + float o = 0.05362967*a1.z + -0.08874077*b1.z + 0.034315668*c1.z + 0.05820452*d1.z + 0.42243248*e1.z + 0.11247401*f1.z + -0.04098587*g1.z + -0.003260546*h1.z + 0.028615315*i1.z; + float p = 0.071061894*a1.w + 0.07652106*b1.w + -0.033353116*c1.w + 0.024202999*d1.w + 0.14031556*e1.w + -0.05963695*f1.w + 0.0347537*g1.w + -0.108266346*h1.w + 0.07211353*i1.w; + float q = -0.05338283*na0.x + -0.09228174*nb0.x + 0.013092857*nc0.x + -0.17125084*nd0.x + 0.6550206*ne0.x + -0.09533192*nf0.x + -0.09689084*ng0.x + -0.0041894587*nh0.x + 0.21914695*ni0.x; + float r = -0.026422335*na0.y + 0.036880214*nb0.y + 0.041254893*nc0.y + 0.0008156015*nd0.y + 0.13534403*ne0.y + 0.047952086*nf0.y + -0.032348964*ng0.y + 0.014010682*nh0.y + 0.0435421*ni0.y; + float s = -0.082521975*na0.z + 0.037913103*nb0.z + -0.10370344*nc0.z + -0.00462962*nd0.z + 0.45346752*ne0.z + -0.16892655*nf0.z + 0.025737757*ng0.z + -0.111673385*nh0.z + -0.08034411*ni0.z; + float t = -0.015661575*na0.w + -0.073354624*nb0.w + 0.11910762*nc0.w + -0.043032695*nd0.w + 0.21332191*ne0.w + 0.19106698*nf0.w + 0.032210633*ng0.w + 0.08627176*nh0.w + -0.04056943*ni0.w; + float u = -0.11458479*na1.x + 0.008572165*nb1.x + 0.08625398*nc1.x + 0.048368633*nd1.x + 0.3868506*ne1.x + -0.19619699*nf1.x + 0.12097667*ng1.x + -0.20041737*nh1.x + -0.1732846*ni1.x; + float v = -0.055646222*na1.y + 0.1451881*nb1.y + -0.025238834*nc1.y + 0.082327254*nd1.y + -0.4478959*ne1.y + 0.1096028*nf1.y + -0.12073877*ng1.y + -0.008622235*nh1.y + -0.07914616*ni1.y; + float w = -0.046383664*na1.z + 0.014370623*nb1.z + -0.021135237*nc1.z + -0.06458644*nd1.z + -0.7450077*ne1.z + -0.012579624*nf1.z + 0.02945094*ng1.z + 0.029546322*nh1.z + -0.012804222*ni1.z; + float x = -0.12739643*na1.w + -0.036583748*nb1.w + -0.046106555*nc1.w + 0.05811886*nd1.w + -0.25411293*ne1.w + 0.018013328*nf1.w + -0.05903975*ng1.w + 0.07108783*nh1.w + 0.019811854*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.053409602; + i = -0.10668289*a0.x + -0.22589163*b0.x + -0.13987538*c0.x + 0.05335291*d0.x + 0.48375422*e0.x + 0.15344132*f0.x + -0.11009505*g0.x + 0.016672708*h0.x + -0.10074288*i0.x; + j = 0.0015947276*a0.y + 0.07250249*b0.y + -0.0191254*c0.y + 0.028646745*d0.y + 0.15963951*e0.y + 0.03491725*f0.y + -0.03486035*g0.y + -0.027305596*h0.y + 0.06868714*i0.y; + k = 0.043614652*a0.z + -0.049251266*b0.z + 0.111902446*c0.z + -0.115563944*d0.z + 0.16635779*e0.z + 0.07196166*f0.z + 0.085996434*g0.z + 0.054356594*h0.z + 0.054694902*i0.z; + l = 0.063457504*a0.w + -0.16555345*b0.w + -0.1977629*c0.w + -0.06448137*d0.w + -0.06259094*e0.w + 0.06365486*f0.w + -0.06359395*g0.w + -0.1920657*h0.w + 0.12513515*i0.w; + m = 0.09495681*a1.x + 0.2365361*b1.x + 0.055532113*c1.x + -0.15307817*d1.x + -0.33488598*e1.x + -0.1148399*f1.x + 0.06822197*g1.x + -0.0937158*h1.x + 0.086206466*i1.x; + n = 0.0045078564*a1.y + -0.06391341*b1.y + -0.08308173*c1.y + -0.19018562*d1.y + 0.30169633*e1.y + -0.054772913*f1.y + -0.13738966*g1.y + 0.062181123*h1.y + 0.054774147*i1.y; + o = 0.060118355*a1.z + -0.008127762*b1.z + -0.034156173*c1.z + 0.0500277*d1.z + -0.08534194*e1.z + 0.010345815*f1.z + 0.12302839*g1.z + -0.04158649*h1.z + -0.03973762*i1.z; + p = -0.080815166*a1.w + 0.08477702*b1.w + 0.13679668*c1.w + 0.04734655*d1.w + -0.0024687275*e1.w + -0.06741254*f1.w + 0.0020256601*g1.w + -0.009172918*h1.w + -0.037641473*i1.w; + q = 0.06965178*na0.x + 0.29032642*nb0.x + 0.17806295*nc0.x + -0.11129186*nd0.x + -0.41759446*ne0.x + 0.0050110994*nf0.x + 0.17578389*ng0.x + -0.11543253*nh0.x + -0.001885809*ni0.x; + r = 0.005317532*na0.y + 0.095645644*nb0.y + -0.021098567*nc0.y + 0.06591392*nd0.y + -0.116197005*ne0.y + -0.043358993*nf0.y + -0.013009809*ng0.y + -0.15138024*nh0.y + -0.033799697*ni0.y; + s = -0.057522736*na0.z + -0.082728855*nb0.z + -0.031226154*nc0.z + 0.18959501*nd0.z + -0.20877957*ne0.z + -0.07964734*nf0.z + -0.04476616*ng0.z + 0.009902144*nh0.z + 0.07217108*ni0.z; + t = -0.024333658*na0.w + 0.047745872*nb0.w + 0.16592872*nc0.w + -0.12421168*nd0.w + -0.11843008*ne0.w + -0.11738284*nf0.w + 0.21761538*ng0.w + 0.049520187*nh0.w + -0.1659902*ni0.w; + u = 0.14783847*na1.x + 0.17537417*nb1.x + 0.049885694*nc1.x + 0.17277068*nd1.x + 0.2821199*ne1.x + 0.09878132*nf1.x + -0.11981736*ng1.x + 0.118238404*nh1.x + -0.01825559*ni1.x; + v = 0.06738571*na1.y + -0.1575328*nb1.y + 0.036821637*nc1.y + 0.0392651*nd1.y + 0.20996699*ne1.y + 0.010065104*nf1.y + 0.16928582*ng1.y + -0.18545963*nh1.y + -0.061286196*ni1.y; + w = -0.018393407*na1.z + -0.13900594*nb1.z + 0.005088923*nc1.z + -0.044956826*nd1.z + 0.29364726*ne1.z + -0.07444642*nf1.z + -0.10428068*ng1.z + 0.014451067*nh1.z + 0.04694493*ni1.z; + x = 0.16300602*na1.w + 0.18626012*nb1.w + -0.06521978*nc1.w + -0.012457507*nd1.w + 0.36782196*ne1.w + 0.11866779*nf1.w + 0.10910508*ng1.w + 0.032809496*nh1.w + -0.07063725*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.012890339; + i = -0.09139671*a0.x + 0.35795408*b0.x + 0.038557854*c0.x + -0.52320266*d0.x + 0.26043087*e0.x + -0.0070253634*f0.x + -0.034186177*g0.x + -0.3889957*h0.x + 0.006295736*i0.x; + j = -0.026434768*a0.y + 0.11207987*b0.y + -0.08482518*c0.y + -0.08554998*d0.y + 0.41271183*e0.y + -0.095349595*f0.y + 0.019489529*g0.y + -0.04493386*h0.y + -0.095000364*i0.y; + k = -0.07414244*a0.z + -0.030943856*b0.z + -0.25061974*c0.z + -0.15343326*d0.z + 0.05414551*e0.z + 0.32426453*f0.z + 0.16768244*g0.z + -0.014362068*h0.z + 0.060472*i0.z; + l = -0.083828114*a0.w + 0.13204199*b0.w + -0.04703435*c0.w + -0.035870466*d0.w + -0.44054565*e0.w + -0.09806949*f0.w + -0.1409398*g0.w + 0.0019250079*h0.w + 0.019642184*i0.w; + m = -0.0012715708*a1.x + 0.049831104*b1.x + -0.063315846*c1.x + -0.067038305*d1.x + -0.0893526*e1.x + 0.0021741989*f1.x + 0.24290745*g1.x + 0.023283675*h1.x + -0.17132534*i1.x; + n = 0.048266195*a1.y + -0.0011830739*b1.y + 0.18100028*c1.y + -0.25165966*d1.y + 0.2969748*e1.y + -0.3689166*f1.y + -0.060033243*g1.y + -0.004085616*h1.y + 0.08210132*i1.y; + o = 0.03524951*a1.z + 0.4448059*b1.z + -0.3404398*c1.z + 0.12155771*d1.z + -0.023394607*e1.z + 0.24049339*f1.z + 0.21649478*g1.z + -0.04342076*h1.z + -0.0025506937*i1.z; + p = -0.06775117*a1.w + -0.2165721*b1.w + 0.2823466*c1.w + -0.15691832*d1.w + 0.08486866*e1.w + -0.18946524*f1.w + -0.14904466*g1.w + 0.035512596*h1.w + -0.013078167*i1.w; + q = 0.059031803*na0.x + -0.5058904*nb0.x + -0.0038910978*nc0.x + 0.23189625*nd0.x + 0.18667111*ne0.x + 0.03620043*nf0.x + 0.08591163*ng0.x + 0.34300846*nh0.x + 0.037738785*ni0.x; + r = 0.06437921*na0.y + -0.018446406*nb0.y + -0.053650368*nc0.y + 0.010188758*nd0.y + -0.28385177*ne0.y + 0.27842358*nf0.y + 0.010817179*ng0.y + 0.00707268*nh0.y + 0.022868687*ni0.y; + s = 0.10183586*na0.z + -0.085717954*nb0.z + 0.2063317*nc0.z + 0.11843876*nd0.z + 0.26863*ne0.z + -0.3623546*nf0.z + -0.13238493*ng0.z + -0.095737286*nh0.z + -0.07417025*ni0.z; + t = -0.16863932*na0.w + -0.23825082*nb0.w + -0.15660179*nc0.w + 0.04931752*nd0.w + 0.6820201*ne0.w + -0.032462034*nf0.w + 0.078525215*ng0.w + -0.21108823*nh0.w + 0.16687338*ni0.w; + u = 0.004978578*na1.x + -0.24199933*nb1.x + -0.24022794*nc1.x + 0.13019069*nd1.x + 0.2714972*ne1.x + 0.29668224*nf1.x + -0.08448439*ng1.x + 0.41858274*nh1.x + 0.20609297*ni1.x; + v = -0.045478754*na1.y + 0.1254586*nb1.y + 0.26045057*nc1.y + 0.36398405*nd1.y + -0.31560805*ne1.y + 0.15722503*nf1.y + 0.17487678*ng1.y + 0.173974*nh1.y + 0.05119602*ni1.y; + w = 0.03245682*na1.z + -0.10725469*nb1.z + 0.16054815*nc1.z + -0.29050833*nd1.z + -0.046494015*ne1.z + -0.25890747*nf1.z + -0.17802468*ng1.z + 0.04463261*nh1.z + 0.025746295*ni1.z; + x = -0.005190955*na1.w + 0.5844454*nb1.w + -0.1295932*nc1.w + 0.085063726*nd1.w + 0.5402516*ne1.w + -0.09760206*nf1.w + 0.17631175*ng1.w + -0.029834324*nh1.w + 0.12012502*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.024680963; + i = 0.22015639*a0.x + -0.17407666*b0.x + -0.017574009*c0.x + 0.021068307*d0.x + -0.03861795*e0.x + -0.053769782*f0.x + 0.0598006*g0.x + 0.13844252*h0.x + -0.071340755*i0.x; + j = 0.050717417*a0.y + 0.025524106*b0.y + -0.08404415*c0.y + 0.08333174*d0.y + 0.017013293*e0.y + -0.11637262*f0.y + -0.037559748*g0.y + -0.0068465522*h0.y + 0.13893107*i0.y; + k = 0.043148153*a0.z + 0.3295378*b0.z + 0.0087906*c0.z + 0.11311087*d0.z + 0.04312488*e0.z + 0.04736787*f0.z + -0.22878742*g0.z + 0.09858411*h0.z + 0.0005592605*i0.z; + l = 0.04284654*a0.w + 0.07436968*b0.w + 0.10052526*c0.w + -0.065019675*d0.w + 0.3465609*e0.w + 0.0008741843*f0.w + 0.2270247*g0.w + -0.03964889*h0.w + 0.071887866*i0.w; + m = -0.14235982*a1.x + -0.07072083*b1.x + -0.084995635*c1.x + -0.100894645*d1.x + -0.44581255*e1.x + 0.015933136*f1.x + -0.019286517*g1.x + -0.1235309*h1.x + -0.03368268*i1.x; + n = -0.03326311*a1.y + -0.10073692*b1.y + -0.09853149*c1.y + -0.07900594*d1.y + -0.1953579*e1.y + 0.042089753*f1.y + -0.07855328*g1.y + -0.23200025*h1.y + -0.006610747*i1.y; + o = -0.08007896*a1.z + -0.2461607*b1.z + 0.14353238*c1.z + -0.04846219*d1.z + -0.1721878*e1.z + -0.09197814*f1.z + -0.06070735*g1.z + 0.18315983*h1.z + -0.034425892*i1.z; + p = 0.05459684*a1.w + 0.31108928*b1.w + -0.10467039*c1.w + 0.010673246*d1.w + 0.0047224355*e1.w + -0.0058969916*f1.w + 0.056659333*g1.w + -0.106476724*h1.w + 0.104168944*i1.w; + q = -0.12763675*na0.x + 0.25710836*nb0.x + 0.0072693126*nc0.x + 0.03039457*nd0.x + -0.0044554067*ne0.x + -0.022940034*nf0.x + -0.09403209*ng0.x + 0.015883204*nh0.x + 0.13509955*ni0.x; + r = -0.0994595*na0.y + -0.13763939*nb0.y + 0.1409501*nc0.y + -0.0032936442*nd0.y + -0.20076504*ne0.y + -0.0654214*nf0.y + 0.06498927*ng0.y + -0.00031625124*nh0.y + -0.22941948*ni0.y; + s = -0.009283021*na0.z + -0.16832107*nb0.z + -0.13831505*nc0.z + 0.08391695*nd0.z + -0.13806774*ne0.z + 0.03952671*nf0.z + 0.18881537*ng0.z + -0.06885674*nh0.z + -0.0108183455*ni0.z; + t = -0.054374512*na0.w + -0.012385924*nb0.w + -0.02725351*nc0.w + 0.024616664*nd0.w + -0.2775687*ne0.w + 0.25559253*nf0.w + -0.11180425*ng0.w + 0.019967819*nh0.w + 0.02086255*ni0.w; + u = 0.057943374*na1.x + 0.1063353*nb1.x + 0.09240854*nc1.x + 0.16697767*nd1.x + 0.1308629*ne1.x + 0.05557683*nf1.x + 0.09398093*ng1.x + -0.1522693*nh1.x + 0.027451862*ni1.x; + v = 0.14591761*na1.y + -0.040234886*nb1.y + 0.06888115*nc1.y + 0.07083606*nd1.y + 0.13988727*ne1.y + -0.039818123*nf1.y + 0.04681032*ng1.y + 0.17090715*nh1.y + 0.103332356*ni1.y; + w = -0.008291727*na1.z + 0.18223919*nb1.z + -0.10855884*nc1.z + 0.23896803*nd1.z + 0.044032115*ne1.z + 0.14236271*nf1.z + -0.0023151839*ng1.z + -0.1667703*nh1.z + 0.045290492*ni1.z; + x = -0.111752234*na1.w + -0.4377266*nb1.w + 0.14324181*nc1.w + -0.076248966*nd1.w + -0.28233582*ne1.w + -0.061120443*nf1.w + -0.17006911*ng1.w + -0.016051235*nh1.w + -0.08499419*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.008792649; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN90 +//!BIND LUMAN91 +//!SAVE LUMAN101 + +#define L0_tex LUMAN90_tex +#define L1_tex LUMAN91_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.04138916*a0.x + 0.30197543*b0.x + -0.1704045*c0.x + 0.17965184*d0.x + 0.29003835*e0.x + 0.08370005*f0.x + 0.03190118*g0.x + -0.17518468*h0.x + 0.012955842*i0.x; + float j = -0.07109726*a0.y + 0.1823734*b0.y + -0.04605392*c0.y + 0.059269615*d0.y + -0.15138285*e0.y + 0.03608101*f0.y + 0.08242375*g0.y + 0.009028954*h0.y + 0.072812274*i0.y; + float k = -0.12356149*a0.z + -0.086611435*b0.z + -0.04118464*c0.z + -0.31934968*d0.z + 0.101652585*e0.z + 0.26276174*f0.z + 0.021968804*g0.z + 0.017631736*h0.z + 0.10742102*i0.z; + float l = -0.09023773*a0.w + 0.2707063*b0.w + -0.037710827*c0.w + 0.061088122*d0.w + -0.35330138*e0.w + 0.09019705*f0.w + 0.16161165*g0.w + 0.025295937*h0.w + 0.06373963*i0.w; + float m = -0.0034698183*a1.x + 0.22036514*b1.x + -0.1092582*c1.x + 0.09482756*d1.x + -0.109374434*e1.x + -0.3238208*f1.x + 0.17918727*g1.x + 0.39547127*h1.x + -0.4623379*i1.x; + float n = 0.050948843*a1.y + 0.01738471*b1.y + -0.105602264*c1.y + -0.2204674*d1.y + -0.45561066*e1.y + -0.12051163*f1.y + -0.16263375*g1.y + -0.25530714*h1.y + -0.09285533*i1.y; + float o = 0.07403561*a1.z + 0.1990857*b1.z + -0.11977993*c1.z + 0.13144638*d1.z + 0.2341229*e1.z + -0.00042121703*f1.z + 0.1583226*g1.z + 0.12840292*h1.z + 0.1433887*i1.z; + float p = -0.1851604*a1.w + 0.17602521*b1.w + 0.1221305*c1.w + -0.03615599*d1.w + -0.07932866*e1.w + -0.2525634*f1.w + 0.002964321*g1.w + 0.11298226*h1.w + -0.13519266*i1.w; + float q = -0.08234646*na0.x + -0.1414366*nb0.x + 0.15008587*nc0.x + -0.29907978*nd0.x + 0.11506433*ne0.x + -0.22332646*nf0.x + 0.05805965*ng0.x + 0.27810848*nh0.x + 0.070169106*ni0.x; + float r = 0.03592974*na0.y + -0.16536513*nb0.y + 0.11441198*nc0.y + 0.08435175*nd0.y + 0.08932274*ne0.y + -0.027787168*nf0.y + 0.029256653*ng0.y + -0.040782016*nh0.y + -0.20330355*ni0.y; + float s = 0.18085478*na0.z + -0.020390073*nb0.z + 0.05839085*nc0.z + 0.22958046*nd0.z + 0.37471008*ne0.z + -0.18636653*nf0.z + -0.11146145*ng0.z + -0.22841236*nh0.z + -0.07214006*ni0.z; + float t = -0.05589969*na0.w + -0.33850622*nb0.w + -0.13061482*nc0.w + 0.13003778*nd0.w + 0.10737323*ne0.w + 0.10882713*nf0.w + -0.042201*ng0.w + 0.08923628*nh0.w + 0.09584097*ni0.w; + float u = 0.25411305*na1.x + -0.094354436*nb1.x + 0.10621806*nc1.x + 0.21951157*nd1.x + 0.4614293*ne1.x + 0.31408313*nf1.x + 0.17083499*ng1.x + 0.35976404*nh1.x + 0.59438545*ni1.x; + float v = 0.19550157*na1.y + 0.069357626*nb1.y + 0.11229597*nc1.y + 0.3491916*nd1.y + 0.014997532*ne1.y + 0.30050907*nf1.y + 0.5238676*ng1.y + 0.49579856*nh1.y + 0.24422513*ni1.y; + float w = -0.050069377*na1.z + -0.20981462*nb1.z + 0.03546458*nc1.z + -0.11718573*nd1.z + -0.65724605*ne1.z + -0.15975557*nf1.z + -0.23317842*ng1.z + -0.19055666*nh1.z + -0.12475086*ni1.z; + float x = 0.24616854*na1.w + 0.22712433*nb1.w + 0.003031617*nc1.w + 0.048955284*nd1.w + 0.1591972*ne1.w + 0.28133035*nf1.w + 0.016519194*ng1.w + -0.16729145*nh1.w + 0.18185227*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.047343764; + i = 0.005074274*a0.x + -0.10939917*b0.x + 0.09337425*c0.x + 0.12879685*d0.x + -0.2513652*e0.x + 0.024987087*f0.x + -0.034622103*g0.x + -0.25332397*h0.x + -0.12031207*i0.x; + j = -0.06383014*a0.y + -0.13306095*b0.y + 0.05165878*c0.y + -0.06310904*d0.y + -0.37605837*e0.y + 0.0046695503*f0.y + -0.042384528*g0.y + -0.17892925*h0.y + 0.11072541*i0.y; + k = 0.0863989*a0.z + -0.063399985*b0.z + 0.06119446*c0.z + 0.16250986*d0.z + -0.1728184*e0.z + 0.008604359*f0.z + 0.16334063*g0.z + -0.113537095*h0.z + 0.1009804*i0.z; + l = 0.047524717*a0.w + -0.16800861*b0.w + -0.10891596*c0.w + 0.03267108*d0.w + 0.06986079*e0.w + -0.008223582*f0.w + 0.060645815*g0.w + -0.02414828*h0.w + -0.122083426*i0.w; + m = 0.078140706*a1.x + -0.018814396*b1.x + -0.15132849*c1.x + 0.118835375*d1.x + -0.1442321*e1.x + -0.017920561*f1.x + 0.06573718*g1.x + 0.082351625*h1.x + -0.06982771*i1.x; + n = 0.033628177*a1.y + -0.09716254*b1.y + 0.02115325*c1.y + -0.048093375*d1.y + 0.31762937*e1.y + -0.11595583*f1.y + -0.008387223*g1.y + -0.083197124*h1.y + -0.040556666*i1.y; + o = 0.14306657*a1.z + -0.022273308*b1.z + -0.077878624*c1.z + 0.22185993*d1.z + -0.31860897*e1.z + 0.053827673*f1.z + 0.1621465*g1.z + -0.03989667*h1.z + 0.05673126*i1.z; + p = -0.11362184*a1.w + 0.17365338*b1.w + 0.08072115*c1.w + 0.0016683352*d1.w + 0.05453119*e1.w + 0.10592867*f1.w + -0.054010063*g1.w + 0.023749562*h1.w + -0.024204558*i1.w; + q = 0.002665413*na0.x + -0.003804767*nb0.x + -0.05944676*nc0.x + -0.24341638*nd0.x + 0.41303757*ne0.x + 0.009786497*nf0.x + -0.06763682*ng0.x + 0.05546292*nh0.x + 0.05898785*ni0.x; + r = 0.1532655*na0.y + 0.046516657*nb0.y + 0.031247063*nc0.y + 0.051957767*nd0.y + 0.14366964*ne0.y + 0.3183212*nf0.y + 0.0112762125*ng0.y + 0.12396964*nh0.y + 0.051013164*ni0.y; + s = -0.07427598*na0.z + 0.17220956*nb0.z + -0.079463005*nc0.z + -0.07945764*nd0.z + 0.31239212*ne0.z + -0.16328163*nf0.z + -0.19595952*ng0.z + 0.025388455*nh0.z + -0.08269749*ni0.z; + t = -0.02824691*na0.w + 0.118230626*nb0.w + 0.039104287*nc0.w + 0.054503523*nd0.w + 0.07351955*ne0.w + 0.07331395*nf0.w + -0.029851029*ng0.w + 0.03505141*nh0.w + 0.1424937*ni0.w; + u = -0.07982493*na1.x + -0.090192325*nb1.x + 0.07434182*nc1.x + -0.23530023*nd1.x + 0.12131227*ne1.x + 0.13164005*nf1.x + -0.052253626*ng1.x + -0.046372693*nh1.x + 0.057849534*ni1.x; + v = -0.008675165*na1.y + 0.051392596*nb1.y + 0.007813682*nc1.y + 0.13168667*nd1.y + 0.041282393*ne1.y + 0.11799713*nf1.y + 0.0034918478*ng1.y + -0.11258261*nh1.y + 0.028657598*ni1.y; + w = -0.07173511*na1.z + 0.113963515*nb1.z + 0.06922608*nc1.z + -0.1977448*nd1.z + 0.3254376*ne1.z + -0.03963667*nf1.z + -0.046891466*ng1.z + 0.052214094*nh1.z + -0.035925962*ni1.z; + x = 0.09945125*na1.w + -0.31153867*nb1.w + -0.0972693*nc1.w + 0.2058437*nd1.w + -0.04664287*ne1.w + -0.15176259*nf1.w + 0.12657925*ng1.w + -0.043328263*nh1.w + 0.014189671*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.014974224; + i = 0.11425061*a0.x + -0.12480644*b0.x + 0.037956957*c0.x + 0.08022729*d0.x + 0.5309364*e0.x + -0.22583173*f0.x + 0.12067425*g0.x + 0.08682246*h0.x + -0.11000624*i0.x; + j = 0.0022261222*a0.y + 0.037563387*b0.y + 0.02174831*c0.y + 0.020510169*d0.y + 0.059123535*e0.y + -0.16094902*f0.y + 0.047558483*g0.y + 0.0036549352*h0.y + -0.12194797*i0.y; + k = -0.058252987*a0.z + 0.39569992*b0.z + -0.085530244*c0.z + -0.40521297*d0.z + 0.42622545*e0.z + -0.04544852*f0.z + 0.05778261*g0.z + -0.0010521769*h0.z + 0.06868768*i0.z; + l = 0.0702999*a0.w + 0.097584985*b0.w + 0.10488675*c0.w + 0.0103232665*d0.w + 0.39629054*e0.w + -0.048901178*f0.w + -0.07040098*g0.w + 0.25743884*h0.w + -0.001018649*i0.w; + m = -0.11881993*a1.x + 0.0039667734*b1.x + -0.13178195*c1.x + -0.12039257*d1.x + 0.27637544*e1.x + -0.04874474*f1.x + -0.013058322*g1.x + 0.02230431*h1.x + -0.114142925*i1.x; + n = 0.058873195*a1.y + 0.035543237*b1.y + 0.02650194*c1.y + -0.072002105*d1.y + 0.035974164*e1.y + -0.13310984*f1.y + 0.035894036*g1.y + -0.22386155*h1.y + -0.014024901*i1.y; + o = -0.2248448*a1.z + 0.07560031*b1.z + 0.0047171847*c1.z + -0.2494523*d1.z + 0.17671472*e1.z + -0.010878757*f1.z + 0.052058302*g1.z + 0.023165079*h1.z + -0.0075516924*i1.z; + p = 0.1220613*a1.w + 0.016521322*b1.w + -0.16713895*c1.w + 0.16955481*d1.w + -0.18306993*e1.w + 0.09826972*f1.w + -0.035299685*g1.w + -0.1761684*h1.w + 0.08700361*i1.w; + q = -0.05393835*na0.x + 0.08020018*nb0.x + -0.09193613*nc0.x + -0.1166321*nd0.x + -0.17528594*ne0.x + 0.09008182*nf0.x + -0.031376988*ng0.x + 0.0130782025*nh0.x + 0.18729372*ni0.x; + r = 0.0016751966*na0.y + 0.062827334*nb0.y + 0.09153917*nc0.y + 0.0055522337*nd0.y + 0.0056728674*ne0.y + 0.21756102*nf0.y + -0.021842608*ng0.y + 0.1688886*nh0.y + 0.011675954*ni0.y; + s = 0.022171449*na0.z + -0.21762362*nb0.z + -0.03511273*nc0.z + 0.25843334*nd0.z + -0.07825473*ne0.z + -0.058452897*nf0.z + -0.08572572*ng0.z + -0.05009758*nh0.z + -0.1203646*ni0.z; + t = 0.02420277*na0.w + -0.047528002*nb0.w + -0.0756805*nc0.w + 0.04303529*nd0.w + -0.1522967*ne0.w + 0.20764968*nf0.w + 0.04693355*ng0.w + -0.18873805*nh0.w + 0.12394661*ni0.w; + u = 0.20615208*na1.x + -0.23040159*nb1.x + 0.08070546*nc1.x + 0.12708692*nd1.x + -0.55477667*ne1.x + 0.059609883*nf1.x + -0.036457956*ng1.x + -0.14565654*nh1.x + -0.072122045*ni1.x; + v = 0.07742679*na1.y + -0.08422293*nb1.y + 0.050255436*nc1.y + 0.09550706*nd1.y + 0.09218959*ne1.y + 0.29053694*nf1.y + 0.12561111*ng1.y + 0.21103214*nh1.y + 0.094996154*ni1.y; + w = 0.07604026*na1.z + 0.10383877*nb1.z + -0.017639672*nc1.z + 0.090248294*nd1.z + -0.36661062*ne1.z + 0.048648287*nf1.z + 0.004087378*ng1.z + -0.07443208*nh1.z + 0.008644338*ni1.z; + x = -0.10678218*na1.w + -0.08522191*nb1.w + 0.030547328*nc1.w + -0.37972483*nd1.w + 0.22218885*ne1.w + -0.18519177*nf1.w + 0.004827946*ng1.w + 0.010769795*nh1.w + -0.01801208*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0010293183; + i = -0.014593506*a0.x + 0.023265488*b0.x + 0.061627004*c0.x + 0.09548386*d0.x + -0.30135506*e0.x + 0.011962504*f0.x + -0.13203998*g0.x + 0.21614662*h0.x + 0.05958174*i0.x; + j = -0.09878384*a0.y + -0.03683659*b0.y + 0.048794214*c0.y + 0.1408684*d0.y + 0.03628337*e0.y + 0.03144382*f0.y + -0.021739298*g0.y + -0.04188862*h0.y + -0.0006002639*i0.y; + k = 0.03112728*a0.z + -0.06630562*b0.z + -0.02561439*c0.z + 0.05311198*d0.z + -0.27829593*e0.z + -0.022640232*f0.z + 0.03705506*g0.z + -0.24030457*h0.z + 0.03965588*i0.z; + l = 0.017258069*a0.w + -0.00722733*b0.w + -0.06503884*c0.w + -0.25225252*d0.w + -0.13763164*e0.w + 0.07982453*f0.w + 0.0026299297*g0.w + 0.07207517*h0.w + 0.06790191*i0.w; + m = -0.019212238*a1.x + 0.12592626*b1.x + -0.021851178*c1.x + 0.15686631*d1.x + 0.22012937*e1.x + -0.20557871*f1.x + 0.09099229*g1.x + -0.10211517*h1.x + -0.034204774*i1.x; + n = -0.012529692*a1.y + 0.09362853*b1.y + 0.039997622*c1.y + -0.05150152*d1.y + -0.14264928*e1.y + -0.033544317*f1.y + 0.040011894*g1.y + -0.12768707*h1.y + -0.078043096*i1.y; + o = 0.0074936035*a1.z + 0.22932594*b1.z + -0.057378706*c1.z + 0.28699687*d1.z + -0.21756352*e1.z + -0.062053844*f1.z + -0.00024668174*g1.z + -0.05100476*h1.z + 0.06928418*i1.z; + p = -0.14546607*a1.w + -0.16651693*b1.w + 0.12857576*c1.w + -0.047539867*d1.w + 0.26343384*e1.w + -0.017469188*f1.w + -0.005115385*g1.w + 0.0012459696*h1.w + -0.09503593*i1.w; + q = -0.087925985*na0.x + 0.0023024757*nb0.x + -0.095000125*nc0.x + 0.07433898*nd0.x + 0.0041658483*ne0.x + 0.123552985*nf0.x + 0.120837346*ng0.x + -0.1636861*nh0.x + -0.011546859*ni0.x; + r = 0.038042698*na0.y + 0.13991997*nb0.y + -0.066846035*nc0.y + 0.010655437*nd0.y + -0.068989895*ne0.y + -0.05154676*nf0.y + -0.06894559*ng0.y + 0.038047343*nh0.y + -0.00232077*ni0.y; + s = -0.0019521024*na0.z + -0.022583103*nb0.z + 0.054494895*nc0.z + -0.08943432*nd0.z + 0.08132613*ne0.z + -0.016627267*nf0.z + -0.024312189*ng0.z + 0.26041818*nh0.z + -0.079761654*ni0.z; + t = -0.08269844*na0.w + -0.09737923*nb0.w + 0.030635225*nc0.w + 0.15013275*nd0.w + -0.107235596*ne0.w + -0.134351*nf0.w + 0.14893004*ng0.w + -0.040401027*nh0.w + -0.034354553*ni0.w; + u = 0.035184126*na1.x + -0.2824874*nb1.x + -0.016726991*nc1.x + -0.14177802*nd1.x + -0.06586472*ne1.x + -0.013826119*nf1.x + -0.1320728*ng1.x + 0.035011787*nh1.x + 0.055118065*ni1.x; + v = -0.024546877*na1.y + 0.12185577*nb1.y + 0.09696174*nc1.y + -0.08592494*nd1.y + 0.27429417*ne1.y + 0.28399673*nf1.y + 0.121077314*ng1.y + 0.012329405*nh1.y + 0.020637203*ni1.y; + w = -0.031275805*na1.z + -0.15169707*nb1.z + 0.07485881*nc1.z + -0.0634399*nd1.z + 0.4907602*ne1.z + -0.001096378*nf1.z + 0.0051537943*ng1.z + -0.037228644*nh1.z + -0.024804804*ni1.z; + x = 0.21940029*na1.w + 0.46201172*nb1.w + -0.1741037*nc1.w + 0.11073968*nd1.w + -0.07999448*ne1.w + 0.12612918*nf1.w + 0.041276265*ng1.w + 0.039091896*nh1.w + -0.023500916*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.00620655; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN100 +//!BIND LUMAN101 +//!SAVE LUMAN110 + +#define L0_tex LUMAN100_tex +#define L1_tex LUMAN101_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.035900798*a0.x + -0.0032731516*b0.x + 0.08142251*c0.x + -0.03735964*d0.x + -0.5860401*e0.x + 0.18885492*f0.x + -0.052124757*g0.x + 0.0039482615*h0.x + -0.0067603188*i0.x; + float j = 0.03218352*a0.y + 0.010617722*b0.y + 0.22913666*c0.y + -0.005692161*d0.y + -0.2878274*e0.y + 0.26934555*f0.y + -0.14689828*g0.y + -0.14777917*h0.y + -0.146745*i0.y; + float k = -0.12349442*a0.z + -0.09644591*b0.z + 0.015029442*c0.z + -0.11548111*d0.z + -0.40823653*e0.z + -0.18077675*f0.z + 0.03544688*g0.z + 0.011662489*h0.z + 0.07574941*i0.z; + float l = -0.124623254*a0.w + 0.16140111*b0.w + -0.046893556*c0.w + -0.056092393*d0.w + -0.17846477*e0.w + -0.07701739*f0.w + -0.09542691*g0.w + -0.23367326*h0.w + -0.06812856*i0.w; + float m = -0.06034172*a1.x + -0.13329592*b1.x + -0.045309793*c1.x + 0.17750835*d1.x + -0.0076088295*e1.x + -0.03329555*f1.x + 0.0049533285*g1.x + -0.045710914*h1.x + -0.017280852*i1.x; + float n = 0.06250742*a1.y + -0.019177811*b1.y + -0.04794798*c1.y + -0.06185518*d1.y + -0.3015897*e1.y + -0.04110791*f1.y + -0.04484891*g1.y + 0.062133104*h1.y + 0.029863592*i1.y; + float o = 0.1407756*a1.z + 0.03246707*b1.z + 0.055456042*c1.z + 0.08737635*d1.z + 0.29290113*e1.z + 0.22447072*f1.z + -0.0070300275*g1.z + -0.09647503*h1.z + -0.112883285*i1.z; + float p = 0.11920284*a1.w + 0.22888571*b1.w + -0.03729867*c1.w + -0.04619108*d1.w + 0.265903*e1.w + -0.18725681*f1.w + -0.052515823*g1.w + 0.27257964*h1.w + -0.004936924*i1.w; + float q = -0.046696868*na0.x + -0.17244326*nb0.x + -0.0006326694*nc0.x + 0.022097602*nd0.x + 0.36674306*ne0.x + -0.17773466*nf0.x + 0.027276874*ng0.x + 0.057075586*nh0.x + 0.08366408*ni0.x; + float r = -0.0496522*na0.y + -0.05937534*nb0.y + -0.20281217*nc0.y + 0.01603125*nd0.y + 0.3475573*ne0.y + -0.3014151*nf0.y + 0.05755629*ng0.y + 0.19609028*nh0.y + 0.08452658*ni0.y; + float s = 0.06687699*na0.z + 0.067958415*nb0.z + 0.06647321*nc0.z + 0.1284585*nd0.z + 0.7849594*ne0.z + 0.29734918*nf0.z + 0.027528172*ng0.z + -0.024441805*nh0.z + -0.11729039*ni0.z; + float t = 0.08647725*na0.w + -0.056248702*nb0.w + 0.07359946*nc0.w + 0.11756446*nd0.w + 0.2627642*ne0.w + -0.018952051*nf0.w + -0.0065718633*ng0.w + 0.039699655*nh0.w + 0.061234728*ni0.w; + float u = 0.06364634*na1.x + 0.0327214*nb1.x + 0.029039195*nc1.x + -0.0952279*nd1.x + 0.059711777*ne1.x + 0.038400296*nf1.x + -0.07332336*ng1.x + 0.017307714*nh1.x + 0.04607215*ni1.x; + float v = -0.047831755*na1.y + -0.040664297*nb1.y + 0.06826742*nc1.y + 0.0526502*nd1.y + 0.4831352*ne1.y + 0.11276925*nf1.y + 0.078867294*ng1.y + -0.17317057*nh1.y + -0.09310757*ni1.y; + float w = -0.07256914*na1.z + -0.065705195*nb1.z + -0.040407173*nc1.z + -0.15516779*nd1.z + -0.43270877*ne1.z + -0.19089858*nf1.z + 0.0144505445*ng1.z + 0.26007774*nh1.z + 0.13456038*ni1.z; + float x = -0.17530301*na1.w + -0.48442727*nb1.w + -0.03330983*nc1.w + -0.019479422*nd1.w + 0.21953882*ne1.w + 0.1206139*nf1.w + -0.08568933*ng1.w + -0.22107208*nh1.w + -0.05904734*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.024452502; + i = 0.017014494*a0.x + -0.00054127455*b0.x + 0.007609347*c0.x + 0.11954065*d0.x + 0.0798582*e0.x + 0.017370699*f0.x + 0.11012819*g0.x + -0.11934599*h0.x + -0.12777543*i0.x; + j = -0.04406953*a0.y + -0.12507345*b0.y + 0.060362745*c0.y + 0.28017431*d0.y + 0.07832064*e0.y + -0.15825081*f0.y + 0.0524985*g0.y + 0.30791417*h0.y + -0.15982261*i0.y; + k = -0.086442724*a0.z + 0.00012259315*b0.z + 0.007140376*c0.z + -0.2824918*d0.z + -0.25533247*e0.z + 0.033553455*f0.z + 0.1419663*g0.z + -0.334144*h0.z + -0.0784347*i0.z; + l = 0.039073847*a0.w + -0.10111335*b0.w + 0.1189452*c0.w + -0.112359114*d0.w + 0.01488211*e0.w + 0.036622338*f0.w + 0.1708258*g0.w + -0.47144276*h0.w + -0.19981442*i0.w; + m = 0.16498776*a1.x + -0.044963352*b1.x + 0.06430563*c1.x + 0.07391399*d1.x + 0.123919465*e1.x + -0.0375703*f1.x + -0.004655664*g1.x + 0.17231892*h1.x + 0.13099734*i1.x; + n = 0.013878608*a1.y + -0.10779041*b1.y + -0.03252544*c1.y + -0.19509874*d1.y + 0.2426995*e1.y + 0.05905958*f1.y + -0.021916907*g1.y + -0.10760266*h1.y + 0.1330649*i1.y; + o = -0.093077786*a1.z + 0.028179191*b1.z + 0.057031747*c1.z + -0.009288688*d1.z + -0.23512715*e1.z + -0.18687668*f1.z + 0.020875294*g1.z + -0.0056162253*h1.z + 0.012207328*i1.z; + p = 0.036275603*a1.w + -0.035214525*b1.w + 0.039897*c1.w + 0.27076656*d1.w + 0.37951374*e1.w + 0.07411483*f1.w + -0.09491011*g1.w + -0.0707116*h1.w + 0.013819694*i1.w; + q = 0.106207535*na0.x + 0.003672323*nb0.x + -0.005481963*nc0.x + -0.070232905*nd0.x + -0.12546863*ne0.x + -0.012893604*nf0.x + -0.07979441*ng0.x + 0.047225464*nh0.x + 0.22636586*ni0.x; + r = 0.021130336*na0.y + 0.005865638*nb0.y + 0.0266642*nc0.y + -0.13385898*nd0.y + 0.23195273*ne0.y + 0.2500417*nf0.y + 0.015835918*ng0.y + -0.19905601*nh0.y + 0.24267204*ni0.y; + s = 0.028915072*na0.z + -0.00034564265*nb0.z + -0.023576412*nc0.z + 0.11490365*nd0.z + 0.07083828*ne0.z + -0.060439333*nf0.z + -0.09797052*ng0.z + -0.07472622*nh0.z + -0.033918925*ni0.z; + t = 0.061985716*na0.w + 0.1016432*nb0.w + 0.001047103*nc0.w + 0.07245331*nd0.w + 0.014575151*ne0.w + 0.009510986*nf0.w + -0.042668477*ng0.w + 0.46141195*nh0.w + 0.16009891*ni0.w; + u = -0.19059992*na1.x + 0.12379133*nb1.x + 0.043386538*nc1.x + -0.111131445*nd1.x + -0.25058612*ne1.x + 0.07591241*nf1.x + 0.12921755*ng1.x + -0.1014394*nh1.x + -0.08227909*ni1.x; + v = 0.1381469*na1.y + 0.30716902*nb1.y + 0.051989574*nc1.y + 0.14254308*nd1.y + -0.31925386*ne1.y + 0.12174008*nf1.y + -0.1391733*ng1.y + 0.39536408*nh1.y + -0.12007279*ni1.y; + w = 0.017454563*na1.z + -0.023681903*nb1.z + -0.034012295*nc1.z + 0.22002162*nd1.z + 0.19791967*ne1.z + 0.038374756*nf1.z + -0.12353062*ng1.z + 0.2688662*nh1.z + -0.052705806*ni1.z; + x = -0.086231895*na1.w + 0.07504937*nb1.w + 0.11191391*nc1.w + 0.06921204*nd1.w + -0.23228742*ne1.w + -0.022838876*nf1.w + -0.2323649*ng1.w + 0.44247657*nh1.w + -0.081072874*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.014501337; + i = 0.106080465*a0.x + 0.024061147*b0.x + -0.14801557*c0.x + 0.07124731*d0.x + 0.752269*e0.x + 0.03204864*f0.x + -0.08820241*g0.x + -0.1569472*h0.x + 0.020805335*i0.x; + j = -0.04939308*a0.y + -0.10871269*b0.y + -0.16962783*c0.y + -0.23772849*d0.y + -0.3210391*e0.y + 0.24698508*f0.y + -0.18247806*g0.y + 0.020352794*h0.y + 0.107976474*i0.y; + k = 0.10493802*a0.z + -0.099695146*b0.z + -0.096039765*c0.z + 0.11138637*d0.z + -0.14311491*e0.z + -0.092154056*f0.z + 0.0885071*g0.z + -0.008292385*h0.z + -0.10166108*i0.z; + l = 0.07040726*a0.w + 0.059195396*b0.w + -0.27681613*c0.w + 0.061552662*d0.w + -0.06913211*e0.w + 0.033301804*f0.w + -0.06473411*g0.w + 0.015914617*h0.w + 0.13665281*i0.w; + m = 0.012200174*a1.x + 0.06378749*b1.x + 0.17070897*c1.x + 0.06860602*d1.x + 0.28465414*e1.x + 0.005732392*f1.x + -0.005431797*g1.x + 0.06197541*h1.x + -0.0360787*i1.x; + n = -0.08437426*a1.y + -0.23992026*b1.y + 0.021542493*c1.y + -0.014475824*d1.y + 0.78059006*e1.y + -0.2787933*f1.y + 0.15499842*g1.y + -0.116365656*h1.y + -0.0011092337*i1.y; + o = -0.012601071*a1.z + -0.02089811*b1.z + 0.025689777*c1.z + -0.04252961*d1.z + -0.008140882*e1.z + 0.1501934*f1.z + -0.045148186*g1.z + 0.117176265*h1.z + 0.0904366*i1.z; + p = 0.13231343*a1.w + -0.3832506*b1.w + -0.045885302*c1.w + -0.30311546*d1.w + 0.003686093*e1.w + -0.027558096*f1.w + -0.11033935*g1.w + -0.28475946*h1.w + 0.13980927*i1.w; + q = -0.021204935*na0.x + 0.14605576*nb0.x + 0.22979948*nc0.x + 0.105198905*nd0.x + -0.3683901*ne0.x + -0.12239137*nf0.x + 0.15564677*ng0.x + 0.08345597*nh0.x + -0.06942301*ni0.x; + r = -0.0054337797*na0.y + 0.25162318*nb0.y + 0.17119436*nc0.y + 0.37783152*nd0.y + 0.17348771*ne0.y + -0.19969839*nf0.y + 0.051427353*ng0.y + 0.073170334*nh0.y + -0.0834832*ni0.y; + s = 0.052913193*na0.z + 0.0704273*nb0.z + 0.06401822*nc0.z + -0.16483103*nd0.z + 0.37591973*ne0.z + 0.17838006*nf0.z + 0.16003473*ng0.z + -0.020194532*nh0.z + 0.11856533*ni0.z; + t = -0.043170277*na0.w + -0.0056342282*nb0.w + 0.058708046*nc0.w + -0.2180414*nd0.w + -0.07601848*ne0.w + -0.0582804*nf0.w + -0.019155271*ng0.w + -0.20792755*nh0.w + 0.07733804*ni0.w; + u = 0.08359859*na1.x + -0.1261298*nb1.x + -0.18549688*nc1.x + 0.103082545*nd1.x + -0.15136153*ne1.x + 0.10837961*nf1.x + -0.106412716*ng1.x + -0.17028126*nh1.x + 0.07988672*ni1.x; + v = 0.025273234*na1.y + 0.31773803*nb1.y + 0.07038893*nc1.y + -0.06201899*nd1.y + -0.16951224*ne1.y + -0.076122746*nf1.y + -0.024976283*ng1.y + 0.0495814*nh1.y + -0.04523248*ni1.y; + w = 0.13538857*na1.z + -0.25815603*nb1.z + 0.045387045*nc1.z + -0.20980915*nd1.z + -0.021883305*ne1.z + -0.18981177*nf1.z + 0.026633987*ng1.z + -0.2266295*nh1.z + -0.01770804*ni1.z; + x = 0.09686322*na1.w + 0.20658696*nb1.w + 0.0340205*nc1.w + -0.03438729*nd1.w + 0.28400266*ne1.w + -0.043422848*nf1.w + 0.13553189*ng1.w + -0.09268944*nh1.w + 0.045445822*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.019928804; + i = 0.02026901*a0.x + 0.05516772*b0.x + -0.026024757*c0.x + -0.048418608*d0.x + -0.57685983*e0.x + 0.14805983*f0.x + -0.20059115*g0.x + 0.041156944*h0.x + 0.24868847*i0.x; + j = 0.13019085*a0.y + 0.22550349*b0.y + -0.034964323*c0.y + -0.3774061*d0.y + -0.86875886*e0.y + 0.30600658*f0.y + -0.051866774*g0.y + -0.17874694*h0.y + -0.04145627*i0.y; + k = -0.09908297*a0.z + -0.08187165*b0.z + -0.048987314*c0.z + 0.06511783*d0.z + 0.179538*e0.z + -0.03037813*f0.z + -0.055894785*g0.z + -0.05759495*h0.z + 0.16294672*i0.z; + l = -0.13788657*a0.w + 0.12234814*b0.w + -0.119818315*c0.w + -0.14877391*d0.w + -0.3761054*e0.w + 0.039558705*f0.w + -0.16355307*g0.w + 0.046041332*h0.w + 0.06886591*i0.w; + m = -0.11279483*a1.x + 0.08578038*b1.x + -0.009435322*c1.x + 0.044954628*d1.x + -0.23950733*e1.x + -0.06424558*f1.x + 0.00892558*g1.x + -0.10939133*h1.x + -0.18683302*i1.x; + n = -0.039577417*a1.y + 0.14972863*b1.y + 0.09612399*c1.y + 0.23229071*d1.y + -0.47360322*e1.y + -0.5715504*f1.y + -0.07163973*g1.y + 0.08016445*h1.y + 0.1636036*i1.y; + o = 0.14617412*a1.z + -0.039677974*b1.z + -0.08629375*c1.z + 0.030945303*d1.z + -0.07581273*e1.z + 0.3790989*f1.z + 0.08369275*g1.z + 0.14806965*h1.z + -0.12494041*i1.z; + p = -0.0248347*a1.w + 0.0024292504*b1.w + -0.13744679*c1.w + -0.13728984*d1.w + 0.13243796*e1.w + -0.10922235*f1.w + -0.08380444*g1.w + 0.23688291*h1.w + 0.05691377*i1.w; + q = -0.10243777*na0.x + -0.06303514*nb0.x + 0.014908672*nc0.x + 0.015049333*nd0.x + 0.21912244*ne0.x + -0.24765025*nf0.x + 0.10551951*ng0.x + 0.03512811*nh0.x + -0.14204796*ni0.x; + r = -0.0230487*na0.y + -0.017737433*nb0.y + 0.10482681*nc0.y + 0.32697034*nd0.y + 0.8010543*ne0.y + -0.4667189*nf0.y + -0.01745576*ng0.y + 0.17689982*nh0.y + -0.0296182*ni0.y; + s = 0.09821341*na0.z + 0.18462132*nb0.z + 0.08232512*nc0.z + -0.11346741*nd0.z + -0.1312958*ne0.z + 0.053139947*nf0.z + -0.026102895*ng0.z + 0.09144199*nh0.z + 0.017409507*ni0.z; + t = 0.045446947*na0.w + -0.06908225*nb0.w + 0.031845864*nc0.w + 0.08811338*nd0.w + 0.22084616*ne0.w + 0.21115226*nf0.w + -0.03346275*ng0.w + -0.07632658*nh0.w + -0.18860243*ni0.w; + u = 0.20821358*na1.x + -0.18966362*nb1.x + -0.20381361*nc1.x + -0.043492407*nd1.x + 0.39594468*ne1.x + 0.14178486*nf1.x + -0.12194247*ng1.x + 0.08705254*nh1.x + 0.17339234*ni1.x; + v = -0.00416578*na1.y + -0.20208167*nb1.y + -0.08947272*nc1.y + -0.11110711*nd1.y + 0.411256*ne1.y + 0.30017683*nf1.y + 0.18777676*ng1.y + -0.254137*nh1.y + -0.23275565*ni1.y; + w = 0.07342336*na1.z + 0.06368492*nb1.z + 0.15138967*nc1.z + -0.13334224*nd1.z + -0.28021207*ne1.z + 0.008063743*nf1.z + -0.034982488*ng1.z + 0.09409084*nh1.z + 0.017170021*ni1.z; + x = 0.11833364*na1.w + 0.16638613*nb1.w + -0.20996292*nc1.w + -0.36111116*nd1.w + -0.39097127*ne1.w + 0.33818159*nf1.w + 0.115348734*ng1.w + -0.2101661*nh1.w + -0.14634638*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.027489815; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN100 +//!BIND LUMAN101 +//!SAVE LUMAN111 + +#define L0_tex LUMAN100_tex +#define L1_tex LUMAN101_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.17373292*a0.x + 0.19284575*b0.x + -0.007641241*c0.x + -0.002358787*d0.x + 0.0006856558*e0.x + -0.09435261*f0.x + 0.11603466*g0.x + -0.06616243*h0.x + -0.09116425*i0.x; + float j = 0.18124478*a0.y + 0.014529217*b0.y + 0.062769316*c0.y + 0.050279245*d0.y + 0.24485901*e0.y + -0.19550173*f0.y + 0.026898274*g0.y + 0.13799283*h0.y + 0.06315003*i0.y; + float k = -0.07014451*a0.z + 0.103086434*b0.z + -0.057231173*c0.z + -0.170586*d0.z + 0.11335642*e0.z + -0.041360904*f0.z + 0.11781035*g0.z + -0.12804985*h0.z + 0.069926985*i0.z; + float l = -0.35962218*a0.w + 0.2529284*b0.w + 0.06229109*c0.w + 0.18245831*d0.w + -0.06891447*e0.w + 0.007133068*f0.w + 0.13578556*g0.w + -0.12890998*h0.w + -0.00014882648*i0.w; + float m = 0.030674135*a1.x + -0.30949405*b1.x + 0.07962323*c1.x + 0.02222668*d1.x + -0.19568637*e1.x + 0.10337853*f1.x + -0.02281463*g1.x + -0.010381191*h1.x + 0.0018512324*i1.x; + float n = 0.06213026*a1.y + 0.1910823*b1.y + 0.09133128*c1.y + -0.12947819*d1.y + 0.41381067*e1.y + -0.12905987*f1.y + 0.033483107*g1.y + -0.1069458*h1.y + -0.11556056*i1.y; + float o = -0.12961154*a1.z + -0.2538289*b1.z + -0.016196288*c1.z + -0.496165*d1.z + -0.5219219*e1.z + 0.054612707*f1.z + -0.21407002*g1.z + -0.08868649*h1.z + 0.12545374*i1.z; + float p = -0.09922678*a1.w + 0.4261237*b1.w + 0.01694553*c1.w + -0.14221108*d1.w + 0.31437156*e1.w + -0.021854276*f1.w + 0.09888452*g1.w + -0.023707569*h1.w + -0.060339298*i1.w; + float q = 0.16362682*na0.x + -0.30193806*nb0.x + -0.0650482*nc0.x + -0.11592818*nd0.x + 0.0965682*ne0.x + 0.009416448*nf0.x + -0.08027524*ng0.x + -0.11599481*nh0.x + 0.074850865*ni0.x; + float r = 0.03761324*na0.y + -0.059135627*nb0.y + -0.06904674*nc0.y + 0.07409784*nd0.y + -0.04979788*ne0.y + 0.1656966*nf0.y + -0.17979243*ng0.y + 0.07024214*nh0.y + 0.101452865*ni0.y; + float s = 0.07054836*na0.z + -0.16477472*nb0.z + 0.167071*nc0.z + 0.056192264*nd0.z + -0.39817235*ne0.z + 0.05435473*nf0.z + 0.055104688*ng0.z + -0.06418159*nh0.z + -0.07037324*ni0.z; + float t = 0.059324004*na0.w + -0.22754394*nb0.w + 0.109665334*nc0.w + 0.18387087*nd0.w + -0.27932712*ne0.w + 0.17503552*nf0.w + -0.02897829*ng0.w + -0.0827857*nh0.w + 0.08433404*ni0.w; + float u = -0.0073763453*na1.x + 0.27729753*nb1.x + -0.060492065*nc1.x + -0.10774929*nd1.x + 0.13199492*ne1.x + -0.1717545*nf1.x + 0.08395833*ng1.x + 0.05505113*nh1.x + 0.012973338*ni1.x; + float v = -0.10820169*na1.y + -0.21685033*nb1.y + -0.054595478*nc1.y + 0.39797196*nd1.y + 0.1346222*ne1.y + 0.06950724*nf1.y + 0.1052441*ng1.y + 0.031800553*nh1.y + 0.042654164*ni1.y; + float w = 0.2054293*na1.z + 0.26843888*nb1.z + 0.026876204*nc1.z + 0.499534*nd1.z + 0.12252638*ne1.z + 0.19191867*nf1.z + 0.10434292*ng1.z + -0.15850754*nh1.z + -0.12211063*ni1.z; + float x = 0.229264*na1.w + -0.3270713*nb1.w + 0.05840381*nc1.w + -0.10087737*nd1.w + -0.47804737*ne1.w + 0.14004838*nf1.w + -0.025040176*ng1.w + 0.05155569*nh1.w + 0.15117253*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.021597303; + i = -0.057124704*a0.x + -0.08187946*b0.x + -0.117976055*c0.x + 0.08626858*d0.x + -0.30131266*e0.x + -0.20291628*f0.x + -0.057278704*g0.x + 0.03727534*h0.x + -0.23938358*i0.x; + j = 0.23947622*a0.y + -0.19593138*b0.y + -0.22941902*c0.y + 0.1798668*d0.y + 0.4139132*e0.y + -0.56581444*f0.y + -0.21497047*g0.y + 0.29857048*h0.y + -0.12120347*i0.y; + k = -0.07644*a0.z + 0.02450798*b0.z + 0.006410234*c0.z + -0.28139332*d0.z + 0.20402806*e0.z + 0.03604816*f0.z + -0.057724282*g0.z + 0.06314197*h0.z + 0.043707125*i0.z; + l = 0.03345192*a0.w + -0.53812677*b0.w + 0.0031058886*c0.w + -0.13964505*d0.w + 0.14953853*e0.w + 0.01489939*f0.w + -0.12053515*g0.w + -0.5023178*h0.w + 0.011425229*i0.w; + m = 0.007068252*a1.x + -0.057471108*b1.x + 0.049550753*c1.x + 0.16893393*d1.x + -0.22552177*e1.x + 0.10349585*f1.x + 0.068044126*g1.x + -0.020883517*h1.x + 0.010095199*i1.x; + n = 0.073507585*a1.y + 0.0479716*b1.y + -0.03338529*c1.y + -0.039165337*d1.y + -0.07156169*e1.y + 0.025127547*f1.y + 0.1630653*g1.y + -0.31465036*h1.y + -0.36398607*i1.y; + o = -0.23844904*a1.z + 0.0669155*b1.z + -0.09081722*c1.z + -0.48886317*d1.z + -0.39759925*e1.z + -0.18523812*f1.z + -0.18028197*g1.z + -0.33321717*h1.z + 0.20330803*i1.z; + p = -0.05968692*a1.w + -0.07692183*b1.w + -0.23112586*c1.w + -0.060829017*d1.w + -0.7536542*e1.w + -0.2852317*f1.w + -0.0009859608*g1.w + 0.114123434*h1.w + 0.054023914*i1.w; + q = 0.040426083*na0.x + 0.11305295*nb0.x + 0.010890308*nc0.x + -0.052732646*nd0.x + 0.42032868*ne0.x + 0.1271945*nf0.x + 0.068493925*ng0.x + -0.09621038*nh0.x + 0.12837166*ni0.x; + r = -0.14453565*na0.y + -0.057656374*nb0.y + 0.23092808*nc0.y + 0.028112093*nd0.y + -0.20953117*ne0.y + 0.56117964*nf0.y + 0.058659226*ng0.y + -0.004577296*nh0.y + 0.26078725*ni0.y; + s = -0.040808428*na0.z + -0.013124161*nb0.z + 0.077842854*nc0.z + 0.36161858*nd0.z + -0.38513637*ne0.z + -0.032538336*nf0.z + 0.25315204*ng0.z + -0.28682852*nh0.z + -0.13966155*ni0.z; + t = 0.11649907*na0.w + 0.07209638*nb0.w + 0.017035281*nc0.w + 0.17239003*nd0.w + -0.48884037*ne0.w + 0.095746554*nf0.w + 0.13106976*ng0.w + 0.007163351*nh0.w + 0.20788017*ni0.w; + u = -0.053024396*na1.x + 0.03632525*nb1.x + -0.042757507*nc1.x + -0.23104651*nd1.x + 0.37475386*ne1.x + -0.15215069*nf1.x + -0.10153369*ng1.x + -0.038243458*nh1.x + 0.058561992*ni1.x; + v = 0.009218183*na1.y + -0.099357605*nb1.y + 0.02944266*nc1.y + 0.37779808*nd1.y + -0.11301168*ne1.y + 0.06155464*nf1.y + 0.07765676*ng1.y + 0.15920372*nh1.y + 0.09146244*ni1.y; + w = 0.038626663*na1.z + 0.080353044*nb1.z + 0.12698452*nc1.z + 0.17569828*nd1.z + 0.2910155*ne1.z + 0.4589925*nf1.z + 0.17338121*ng1.z + 0.13693103*nh1.z + -0.12467287*ni1.z; + x = -0.06830355*na1.w + 0.10666497*nb1.w + 0.081091985*nc1.w + 0.3429561*nd1.w + -0.06758853*ne1.w + 0.029520744*nf1.w + 0.013867191*ng1.w + -0.20614323*nh1.w + 0.2577004*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.014417592; + i = -0.13472116*a0.x + 0.1510276*b0.x + 0.12627706*c0.x + -0.15310904*d0.x + 0.41393983*e0.x + 0.09215482*f0.x + 0.0076725073*g0.x + -0.19246124*h0.x + -0.024236755*i0.x; + j = -0.08050447*a0.y + 0.12934619*b0.y + 0.14942114*c0.y + 0.014540216*d0.y + 0.64530516*e0.y + -0.23357749*f0.y + -0.033744495*g0.y + 0.13452643*h0.y + 0.0065132463*i0.y; + k = -0.07907217*a0.z + 0.0067584133*b0.z + 0.03253729*c0.z + 0.12400924*d0.z + -0.29547116*e0.z + 0.13962397*f0.z + 0.0817104*g0.z + -0.23031056*h0.z + 0.076910056*i0.z; + l = -0.17478573*a0.w + -0.09128964*b0.w + 0.2052007*c0.w + -0.045583803*d0.w + -0.46769974*e0.w + -0.036914773*f0.w + 0.020994665*g0.w + -0.5500906*h0.w + -0.055351563*i0.w; + m = 0.110594265*a1.x + -0.2092864*b1.x + -0.055939224*c1.x + -0.20377842*d1.x + -0.068504*e1.x + -0.036410812*f1.x + 0.017022053*g1.x + 0.016182205*h1.x + 0.0033735395*i1.x; + n = 0.06604512*a1.y + 0.027024498*b1.y + 0.057466883*c1.y + -0.06337822*d1.y + 0.21015161*e1.y + 0.07654835*f1.y + -0.04182454*g1.y + -0.046728626*h1.y + -0.006260675*i1.y; + o = 0.09531833*a1.z + -0.10230305*b1.z + -0.0032133479*c1.z + 0.099814266*d1.z + 0.44469547*e1.z + -0.17260297*f1.z + -0.09248535*g1.z + 0.08439349*h1.z + 0.017246507*i1.z; + p = 0.048469406*a1.w + 0.18700768*b1.w + -0.035001382*c1.w + -0.102538124*d1.w + 0.20207775*e1.w + -0.11878294*f1.w + 0.00067176076*g1.w + -0.087286696*h1.w + 0.054357033*i1.w; + q = 0.12958841*na0.x + -0.22688657*nb0.x + -0.1667106*nc0.x + 0.005056687*nd0.x + -0.4123986*ne0.x + -0.01335008*nf0.x + -0.014480265*ng0.x + 0.06307529*nh0.x + 0.08594915*ni0.x; + r = 0.10539398*na0.y + -0.10292841*nb0.y + -0.07814285*nc0.y + 0.22097129*nd0.y + -0.5559523*ne0.y + 0.17694168*nf0.y + 0.004478227*ng0.y + 0.032878358*nh0.y + 0.104629084*ni0.y; + s = -0.0051326617*na0.z + -0.022072861*nb0.z + 0.051479872*nc0.z + -0.1741023*nd0.z + 0.18857563*ne0.z + -0.124328755*nf0.z + -0.10322579*ng0.z + -0.20327476*nh0.z + -0.14588761*ni0.z; + t = 0.09643955*na0.w + 0.008044043*nb0.w + 0.036409162*nc0.w + -0.045244064*nd0.w + 0.31953487*ne0.w + -0.088307254*nf0.w + 0.07313137*ng0.w + 0.34979767*nh0.w + 0.102764584*ni0.w; + u = -0.06440282*na1.x + 0.112250455*nb1.x + 0.08934266*nc1.x + 0.24088423*nd1.x + 0.01121725*ne1.x + 0.028617168*nf1.x + 0.047377482*ng1.x + 0.0073287217*nh1.x + 0.11302375*ni1.x; + v = -0.077449806*na1.y + -0.14188565*nb1.y + 0.05671433*nc1.y + -0.11553248*nd1.y + -0.33997044*ne1.y + -0.01590329*nf1.y + 0.03729859*ng1.y + 0.120862365*nh1.y + -0.20920378*ni1.y; + w = 0.08520443*na1.z + 0.21813084*nb1.z + -0.037449516*nc1.z + -0.0026980594*nd1.z + -0.17946021*ne1.z + 0.13623233*nf1.z + -0.006548233*ng1.z + 0.11000115*nh1.z + -0.034891665*ni1.z; + x = 0.0401964*na1.w + -0.3692854*nb1.w + 0.0011840117*nc1.w + -0.22135302*nd1.w + -0.10666167*ne1.w + -0.14273971*nf1.w + -0.12129986*ng1.w + 0.44047737*nh1.w + -0.045440122*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0061564697; + i = 0.019909037*a0.x + 0.024903378*b0.x + 0.105348505*c0.x + 0.07623088*d0.x + 0.0034105815*e0.x + -0.113691464*f0.x + 0.009286652*g0.x + -0.08961034*h0.x + -0.015141795*i0.x; + j = 0.14456645*a0.y + -0.35772327*b0.y + 0.025894739*c0.y + -0.13413931*d0.y + 0.33115333*e0.y + -0.05047772*f0.y + -0.061519265*g0.y + -0.11914387*h0.y + 0.007146077*i0.y; + k = -0.066375226*a0.z + -0.11391145*b0.z + 0.010581036*c0.z + 0.108877584*d0.z + 0.112751186*e0.z + -0.08083832*f0.z + -0.031274974*g0.z + -0.23846108*h0.z + 0.06903504*i0.z; + l = 0.08046087*a0.w + -0.2478447*b0.w + -0.04181178*c0.w + 0.12691878*d0.w + -0.3055807*e0.w + 0.03303818*f0.w + 0.045794614*g0.w + -0.17669553*h0.w + 0.029193971*i0.w; + m = 0.13165465*a1.x + 0.08672863*b1.x + -0.0806005*c1.x + -0.15916064*d1.x + -0.1339171*e1.x + 0.07747311*f1.x + 0.06912866*g1.x + 0.054819133*h1.x + -0.0148107195*i1.x; + n = -0.1043977*a1.y + -0.13850538*b1.y + -0.15452385*c1.y + 0.119476296*d1.y + 0.078670695*e1.y + 0.15949106*f1.y + -0.08756167*g1.y + 0.0844884*h1.y + -0.08666089*i1.y; + o = -0.07111824*a1.z + 0.04513279*b1.z + -0.13408236*c1.z + 0.047121324*d1.z + 0.24545099*e1.z + 0.2516734*f1.z + -0.0728289*g1.z + -0.08762582*h1.z + -0.07561154*i1.z; + p = 0.02130893*a1.w + 0.10249944*b1.w + 0.11049336*c1.w + 0.15264595*d1.w + 0.31183988*e1.w + -0.13138242*f1.w + 0.06398149*g1.w + 0.08104154*h1.w + -0.11865529*i1.w; + q = 0.015509186*na0.x + 0.039872047*nb0.x + -0.092925705*nc0.x + -0.016107129*nd0.x + 0.2357669*ne0.x + 0.14164859*nf0.x + -0.023252146*ng0.x + 0.01461199*nh0.x + 0.021338074*ni0.x; + r = -0.01427818*na0.y + 0.098217905*nb0.y + 0.06523357*nc0.y + -0.123181134*nd0.y + -0.15354222*ne0.y + -0.012291639*nf0.y + 0.0817894*ng0.y + 0.11550929*nh0.y + -0.0143228425*ni0.y; + s = -0.06878877*na0.z + -0.027852716*nb0.z + -0.046084825*nc0.z + -0.0063927933*nd0.z + 0.2056926*ne0.z + 0.08226537*nf0.z + -0.038236506*ng0.z + 0.03715226*nh0.z + -0.18274981*ni0.z; + t = 0.06485456*na0.w + 0.07982155*nb0.w + 0.07997468*nc0.w + -0.14120714*nd0.w + -0.043111116*ne0.w + -0.018716503*nf0.w + 0.036192097*ng0.w + 0.16639654*nh0.w + 0.02141117*ni0.w; + u = -0.1266023*na1.x + -0.18926698*nb1.x + 0.12713344*nc1.x + 0.07326873*nd1.x + 0.24805826*ne1.x + -0.20831703*nf1.x + -0.02982*ng1.x + -0.12409885*nh1.x + 0.00971056*ni1.x; + v = 0.10946473*na1.y + 0.18352063*nb1.y + 0.23140769*nc1.y + -0.08708996*nd1.y + -0.37328652*ne1.y + -0.16821873*nf1.y + 0.05127809*ng1.y + 0.04607067*nh1.y + -0.014240281*ni1.y; + w = 0.032410678*na1.z + -0.054716043*nb1.z + 0.13916765*nc1.z + -0.24632*nd1.z + -0.3030281*ne1.z + -0.14525734*nf1.z + 0.037081942*ng1.z + 0.14404751*nh1.z + 0.07260845*ni1.z; + x = -0.020973476*na1.w + -0.33283794*nb1.w + -0.02324839*nc1.w + -0.13249202*nd1.w + -0.31107336*ne1.w + -0.044882078*nf1.w + 0.0023130344*ng1.w + 0.12264239*nh1.w + 0.06401549*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.008576719; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN110 +//!BIND LUMAN111 +//!SAVE LUMAN120 + +#define L0_tex LUMAN110_tex +#define L1_tex LUMAN111_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.03419658*a0.x + 0.04234174*b0.x + -0.004263536*c0.x + 0.085486904*d0.x + 0.1347802*e0.x + -0.019748386*f0.x + -0.117732905*g0.x + -0.10726092*h0.x + 0.008796778*i0.x; + float j = 0.145332*a0.y + -0.118838355*b0.y + -0.1386052*c0.y + -0.01958755*d0.y + 0.17036115*e0.y + 0.18370172*f0.y + 0.03361552*g0.y + 0.07884379*h0.y + 0.045483217*i0.y; + float k = -0.030767104*a0.z + 0.07757515*b0.z + -0.085805915*c0.z + -0.1185484*d0.z + -0.26337406*e0.z + 0.05961827*f0.z + 0.042409312*g0.z + -0.010232436*h0.z + -5.044214e-05*i0.z; + float l = -0.17780498*a0.w + -0.04013949*b0.w + -0.037311044*c0.w + 0.15648837*d0.w + 0.5124475*e0.w + 0.014651824*f0.w + 0.088576384*g0.w + -0.06640279*h0.w + -0.049112737*i0.w; + float m = 0.0079423245*a1.x + 0.04602091*b1.x + -0.051456727*c1.x + 0.024389006*d1.x + -0.07325696*e1.x + 0.11012193*f1.x + -0.045976166*g1.x + -0.090682596*h1.x + -0.07234718*i1.x; + float n = -0.04302659*a1.y + 0.087995455*b1.y + -0.019285012*c1.y + -0.06172422*d1.y + -0.32629314*e1.y + -0.012027535*f1.y + 0.0835997*g1.y + 0.12310212*h1.y + 0.010239601*i1.y; + float o = -0.049638838*a1.z + 0.076178625*b1.z + -0.05349241*c1.z + -0.107234344*d1.z + -0.186114*e1.z + 0.024813233*f1.z + 0.0060986993*g1.z + -0.07767666*h1.z + -0.035295106*i1.z; + float p = -0.056122378*a1.w + 0.107091725*b1.w + 0.04479051*c1.w + 0.105193965*d1.w + -0.0037533492*e1.w + -0.026995312*f1.w + 0.18978113*g1.w + 0.12996297*h1.w + 0.023616683*i1.w; + float q = -0.032792877*na0.x + -0.3012694*nb0.x + 0.009388108*nc0.x + -0.18869895*nd0.x + -0.06794785*ne0.x + 0.07865117*nf0.x + 0.16489376*ng0.x + 0.2827912*nh0.x + -0.019100828*ni0.x; + float r = 0.044741493*na0.y + -0.22722921*nb0.y + -0.031233322*nc0.y + -0.1825249*nd0.y + 0.1669076*ne0.y + -0.20256056*nf0.y + -0.005387011*ng0.y + -0.052400213*nh0.y + 0.008328497*ni0.y; + float s = -0.00326432*na0.z + -0.08053971*nb0.z + 0.06993597*nc0.z + 0.16277675*nd0.z + 0.12830172*ne0.z + -0.031723607*nf0.z + -0.056370232*ng0.z + 0.09434579*nh0.z + 0.01401013*ni0.z; + float t = -0.00080348144*na0.w + -0.0140173435*nb0.w + 0.053308867*nc0.w + 0.07490176*nd0.w + -0.011815553*ne0.w + -0.06710458*nf0.w + -0.11728107*ng0.w + -0.15691936*nh0.w + -0.013996718*ni0.w; + float u = -0.051334072*na1.x + 0.10004408*nb1.x + 0.017916761*nc1.x + 0.078460515*nd1.x + -0.24399187*ne1.x + 0.019960076*nf1.x + 0.056844246*ng1.x + 0.124312244*nh1.x + -0.0019768244*ni1.x; + float v = 0.020052563*na1.y + -0.074652724*nb1.y + 0.0058090677*nc1.y + 0.09016366*nd1.y + 0.2910772*ne1.y + 0.032006025*nf1.y + -0.08302292*ng1.y + -0.12736753*nh1.y + 0.004687992*ni1.y; + float w = -0.041612104*na1.z + -0.09929229*nb1.z + 0.026467089*nc1.z + 0.10896838*nd1.z + 0.08728067*ne1.z + -0.009002156*nf1.z + -0.0019186987*ng1.z + 0.021415843*nh1.z + 0.014931899*ni1.z; + float x = -0.016585568*na1.w + -0.019664338*nb1.w + -0.010510242*nc1.w + 0.027096234*nd1.w + -0.27564695*ne1.w + -0.0015411398*nf1.w + -0.057726476*ng1.w + -0.17033243*nh1.w + -0.023435434*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0027177525; + i = 0.064263724*a0.x + -0.039562706*b0.x + -0.002825356*c0.x + 0.27440286*d0.x + -0.20511444*e0.x + 0.0545985*f0.x + 0.09488737*g0.x + -0.20791619*h0.x + 0.051740464*i0.x; + j = 0.00017828071*a0.y + 0.08186342*b0.y + -0.084284164*c0.y + -0.02336734*d0.y + -0.09449044*e0.y + -0.004509461*f0.y + -0.030286653*g0.y + 0.017867139*h0.y + 0.004724629*i0.y; + k = 0.0030007442*a0.z + -0.10181248*b0.z + 0.00993031*c0.z + 0.074616954*d0.z + 0.16503222*e0.z + 0.2771392*f0.z + 0.06308826*g0.z + -0.09798749*h0.z + -0.0025535324*i0.z; + l = -0.08172359*a0.w + 0.12292478*b0.w + -0.16848561*c0.w + 0.07073111*d0.w + -0.73835886*e0.w + 0.19245274*f0.w + -0.1404062*g0.w + 0.24471237*h0.w + -0.12639032*i0.w; + m = -0.022862365*a1.x + 0.0023818095*b1.x + 0.05612693*c1.x + 0.03942403*d1.x + -0.16278934*e1.x + 0.15510206*f1.x + 0.14307606*g1.x + -0.0066428985*h1.x + -0.068190604*i1.x; + n = 0.119453914*a1.y + -0.30648935*b1.y + 0.12936467*c1.y + 0.026358444*d1.y + -0.6192209*e1.y + -0.061524224*f1.y + 0.09192626*g1.y + -0.13491037*h1.y + 0.04403033*i1.y; + o = 0.16812736*a1.z + 0.11960045*b1.z + 0.028085833*c1.z + 0.25032774*d1.z + 0.08565775*e1.z + 0.30494735*f1.z + -0.055606324*g1.z + 0.16188392*h1.z + -0.0043007014*i1.z; + p = 0.069242105*a1.w + -0.005010746*b1.w + -0.15581696*c1.w + 0.20451608*d1.w + 0.13370973*e1.w + 0.22138312*f1.w + -0.2966924*g1.w + 0.10758237*h1.w + 0.082805164*i1.w; + q = -0.14249119*na0.x + 0.13207927*nb0.x + 0.008215849*nc0.x + -0.12373979*nd0.x + 0.34873658*ne0.x + -0.09177493*nf0.x + -0.13032945*ng0.x + 0.062212747*nh0.x + 0.06871929*ni0.x; + r = -0.021839553*na0.y + -0.4821346*nb0.y + -0.08098096*nc0.y + -0.23721185*nd0.y + -0.36681846*ne0.y + 0.09836048*nf0.y + 0.07406981*ng0.y + -0.07001368*nh0.y + -0.33318177*ni0.y; + s = -0.030489637*na0.z + 0.1602204*nb0.z + 0.014132801*nc0.z + -0.21801928*nd0.z + -0.14850943*ne0.z + -0.121734664*nf0.z + 0.07872759*ng0.z + 0.084055774*nh0.z + 0.010060022*ni0.z; + t = -0.013205502*na0.w + 0.076589726*nb0.w + -0.08145456*nc0.w + 0.0529249*nd0.w + 0.4912117*ne0.w + -0.054977912*nf0.w + 0.11069747*ng0.w + -0.09718869*nh0.w + -0.1079657*ni0.w; + u = -0.0013224155*na1.x + -0.075267605*nb1.x + 0.047625992*nc1.x + 0.103593*nd1.x + 0.0070434245*ne1.x + -0.07256906*nf1.x + 0.020944325*ng1.x + 0.0037556116*nh1.x + -0.083298795*ni1.x; + v = -0.17848632*na1.y + 0.09253789*nb1.y + 0.028199574*nc1.y + 0.049197208*nd1.y + 0.27007762*ne1.y + 0.003407099*nf1.y + -0.007148225*ng1.y + 0.033093993*nh1.y + -0.01289992*ni1.y; + w = -0.08962241*na1.z + -0.020183992*nb1.z + -0.118681364*nc1.z + 0.004322101*nd1.z + -0.83673894*ne1.z + -0.026786922*nf1.z + 0.05512487*ng1.z + 0.054306448*nh1.z + 0.07126643*ni1.z; + x = 0.028476331*na1.w + -0.062953666*nb1.w + -0.023954807*nc1.w + 0.027786924*nd1.w + 0.103380345*ne1.w + 0.16595764*nf1.w + -0.063491225*ng1.w + 0.049585197*nh1.w + -0.0935845*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0041770632; + i = 0.026532259*a0.x + -0.043151964*b0.x + -0.023539152*c0.x + 0.124449484*d0.x + -0.19282119*e0.x + 0.013472447*f0.x + -0.115176246*g0.x + -0.10243189*h0.x + 0.06320668*i0.x; + j = -0.0059697866*a0.y + 0.043782752*b0.y + -0.09426866*c0.y + 0.050792914*d0.y + -0.09421752*e0.y + -0.017171869*f0.y + -0.09151457*g0.y + 0.07609253*h0.y + 0.13071252*i0.y; + k = -0.024361333*a0.z + 0.009874322*b0.z + 0.07454306*c0.z + -0.15447307*d0.z + 0.13888164*e0.z + -0.034940712*f0.z + -0.040980965*g0.z + -0.02682383*h0.z + -0.066917755*i0.z; + l = -0.06584927*a0.w + 0.0035738812*b0.w + 0.05411536*c0.w + 0.051882975*d0.w + 0.25177068*e0.w + 0.032372046*f0.w + 0.11359933*g0.w + 0.05095093*h0.w + -0.07030653*i0.w; + m = -0.005564911*a1.x + -0.036399335*b1.x + 0.050246976*c1.x + 0.0984369*d1.x + -0.100392096*e1.x + -0.052057363*f1.x + -0.0034145052*g1.x + -0.10695044*h1.x + 0.022204392*i1.x; + n = -0.1459085*a1.y + 0.020675056*b1.y + -0.06596223*c1.y + -0.14782459*d1.y + 0.12917906*e1.y + -0.0522965*f1.y + 0.09491187*g1.y + -0.016474292*h1.y + -0.13321705*i1.y; + o = -0.15219742*a1.z + -0.033107433*b1.z + 0.087146364*c1.z + 0.010368419*d1.z + 0.032200083*e1.z + 0.0459494*f1.z + 0.14232826*g1.z + -0.12944774*h1.z + -0.0754529*i1.z; + p = -0.15429367*a1.w + -0.02448594*b1.w + 0.043734852*c1.w + -0.15192075*d1.w + -0.087126195*e1.w + -0.165763*f1.w + 0.120236985*g1.w + 0.0045476337*h1.w + -0.1184898*i1.w; + q = -0.024490256*na0.x + -0.01748134*nb0.x + -0.00063394895*nc0.x + -0.14126152*nd0.x + 0.24202287*ne0.x + 0.059133608*nf0.x + 0.05383861*ng0.x + 0.0967077*nh0.x + -0.007970071*ni0.x; + r = -0.21873847*na0.y + -0.14622325*nb0.y + 0.047783785*nc0.y + 0.034090877*nd0.y + 0.0025731032*ne0.y + -0.14487019*nf0.y + 0.056929756*ng0.y + -0.23404305*nh0.y + 0.025685174*ni0.y; + s = 0.056901038*na0.z + -0.035735376*nb0.z + -0.023277406*nc0.z + 0.099037796*nd0.z + -0.086797796*ne0.z + 0.019788722*nf0.z + 0.10133625*ng0.z + -0.12101483*nh0.z + 0.02770466*ni0.z; + t = 0.058126416*na0.w + -0.057519764*nb0.w + -0.012282111*nc0.w + -0.008142407*nd0.w + -0.111955725*ne0.w + -0.015524334*nf0.w + 0.038397934*ng0.w + -0.15748297*nh0.w + -0.00765482*ni0.w; + u = -0.097768635*na1.x + 0.029718421*nb1.x + -0.010391541*nc1.x + -0.09858282*nd1.x + -0.02233209*ne1.x + -0.011829104*nf1.x + 0.15196133*ng1.x + -0.05273923*nh1.x + -0.036803413*ni1.x; + v = 0.075455025*na1.y + 0.04232998*nb1.y + 0.00833761*nc1.y + 0.03109816*nd1.y + -0.15964165*ne1.y + -0.02546395*nf1.y + -0.10285106*ng1.y + -0.0079596415*nh1.y + 0.012193279*ni1.y; + w = 0.11320614*na1.z + 0.056008387*nb1.z + -0.01812151*nc1.z + -0.09234208*nd1.z + 0.33674252*ne1.z + -0.009951529*nf1.z + 0.037884384*ng1.z + 0.39397368*nh1.z + 0.009155979*ni1.z; + x = 0.043282937*na1.w + -0.022083275*nb1.w + -0.039594356*nc1.w + 0.07992068*nd1.w + -0.021216467*ne1.w + -0.024652136*nf1.w + -0.034756433*ng1.w + -0.088006526*nh1.w + -0.023057858*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0036904276; + i = 0.071499825*a0.x + -0.017037481*b0.x + -0.04289817*c0.x + -0.06426044*d0.x + 0.11343753*e0.x + -0.005860346*f0.x + -0.10861172*g0.x + 0.08847832*h0.x + -0.018993571*i0.x; + j = 0.12151444*a0.y + -0.21413642*b0.y + -0.16236494*c0.y + -0.28620937*d0.y + -0.12364789*e0.y + 0.12073757*f0.y + -0.025671931*g0.y + 0.04384527*h0.y + -0.072729446*i0.y; + k = 0.013037446*a0.z + -0.031395227*b0.z + -0.050007146*c0.z + -0.21211621*d0.z + -0.5972017*e0.z + 0.15161848*f0.z + 0.022896405*g0.z + 0.10271641*h0.z + 0.024362244*i0.z; + l = -0.069410875*a0.w + -0.22706726*b0.w + -0.021730786*c0.w + 0.019326342*d0.w + -0.13826303*e0.w + -0.021515118*f0.w + -0.02573992*g0.w + -0.0237696*h0.w + 0.0123208*i0.w; + m = -0.06127183*a1.x + 0.051088296*b1.x + -0.04584946*c1.x + 0.13170096*d1.x + -0.39505032*e1.x + 0.23969938*f1.x + 0.04389141*g1.x + 0.36893818*h1.x + -0.067366585*i1.x; + n = -0.08085825*a1.y + 0.060302958*b1.y + -0.09919097*c1.y + 0.043645088*d1.y + -0.3812803*e1.y + -0.050985813*f1.y + 0.037130836*g1.y + 0.023081021*h1.y + -0.0247827*i1.y; + o = -0.004997695*a1.z + 0.13657212*b1.z + 0.056454506*c1.z + 0.07206652*d1.z + -0.33894852*e1.z + 0.009234833*f1.z + 0.018978443*g1.z + 0.021747049*h1.z + 0.061612368*i1.z; + p = -0.18404841*a1.w + 0.17344272*b1.w + 0.06089598*c1.w + 0.22305518*d1.w + -0.18228509*e1.w + 0.01824805*f1.w + -0.1392599*g1.w + 0.21900408*h1.w + 0.0381708*i1.w; + q = -0.061211154*na0.x + -0.11969039*nb0.x + 0.09869126*nc0.x + 0.061141904*nd0.x + -0.06691168*ne0.x + 0.0047452394*nf0.x + -0.038700644*ng0.x + 0.039004963*nh0.x + -0.034600914*ni0.x; + r = 0.0726151*na0.y + -0.081531286*nb0.y + 0.23779625*nc0.y + 0.21001065*nd0.y + -0.5435231*ne0.y + 0.04386579*nf0.y + 0.058399413*ng0.y + 0.045617856*nh0.y + -0.018235456*ni0.y; + s = 0.070326924*na0.z + 0.06268818*nb0.z + 0.06302981*nc0.z + 0.05526274*nd0.z + 0.46898443*ne0.z + 0.07957147*nf0.z + 0.06066431*ng0.z + 0.037095413*nh0.z + -0.10619575*ni0.z; + t = -0.051876582*na0.w + 0.0023649358*nb0.w + 0.046784155*nc0.w + 0.11398935*nd0.w + 0.1253422*ne0.w + -0.049485214*nf0.w + 0.0058373916*ng0.w + 0.016857516*nh0.w + -0.058631293*ni0.w; + u = -0.04962366*na1.x + 0.148904*nb1.x + 0.021688113*nc1.x + 0.15511441*nd1.x + -0.026461873*ne1.x + -0.07623983*nf1.x + -0.029553525*ng1.x + -0.12179555*nh1.x + -0.054989904*ni1.x; + v = -0.05631037*na1.y + -0.019439436*nb1.y + -0.04202643*nc1.y + -0.108763225*nd1.y + 0.07601197*ne1.y + 0.04292159*nf1.y + 0.059576076*ng1.y + -0.056885466*nh1.y + 0.022964494*ni1.y; + w = -0.006342543*na1.z + -0.19573995*nb1.z + -0.061908927*nc1.z + 0.089260034*nd1.z + 0.18138929*ne1.z + 0.061845507*nf1.z + -0.04185466*ng1.z + 0.022229565*nh1.z + -0.013937939*ni1.z; + x = -0.032656766*na1.w + -0.043430645*nb1.w + -0.030643908*nc1.w + 0.11670875*nd1.w + -0.20435229*ne1.w + 0.1200682*nf1.w + -0.16340503*ng1.w + 0.07442494*nh1.w + -0.107492104*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.01253215; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN110 +//!BIND LUMAN111 +//!SAVE LUMAN121 + +#define L0_tex LUMAN110_tex +#define L1_tex LUMAN111_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.01899263*a0.x + -0.077505454*b0.x + 0.011978758*c0.x + -0.18674393*d0.x + 0.1015323*e0.x + -0.050859254*f0.x + -0.023585971*g0.x + -0.08158343*h0.x + 0.06631295*i0.x; + float j = 0.10729953*a0.y + 0.041689463*b0.y + 0.022505827*c0.y + -0.060440443*d0.y + 0.40716222*e0.y + 0.04071186*f0.y + -0.09625937*g0.y + 0.116327144*h0.y + -0.10830027*i0.y; + float k = -0.091419406*a0.z + -0.11728323*b0.z + 0.12473227*c0.z + -0.11223453*d0.z + -0.7762529*e0.z + 0.2406721*f0.z + 0.058871992*g0.z + -0.3313148*h0.z + 0.008788311*i0.z; + float l = 0.05685737*a0.w + 0.033411182*b0.w + -0.020573527*c0.w + 0.27094668*d0.w + -0.27309388*e0.w + 0.20446198*f0.w + 0.10291363*g0.w + -0.067330875*h0.w + -0.052683745*i0.w; + float m = -0.10309394*a1.x + -0.08645983*b1.x + 0.06905719*c1.x + -0.14534827*d1.x + -0.17194697*e1.x + 0.30640042*f1.x + -0.03007999*g1.x + -0.11420834*h1.x + -0.13784356*i1.x; + float n = 0.035676494*a1.y + -0.092659704*b1.y + 0.10887644*c1.y + 0.40208092*d1.y + -0.011463568*e1.y + 0.16224518*f1.y + 0.060072776*g1.y + -0.06448121*h1.y + 0.0070494837*i1.y; + float o = 0.05567742*a1.z + -0.036550913*b1.z + 0.017365746*c1.z + 0.21257657*d1.z + -0.81188375*e1.z + 0.030954812*f1.z + -0.0074971644*g1.z + -0.085213356*h1.z + 0.0605237*i1.z; + float p = 0.07070759*a1.w + 0.028305933*b1.w + -0.16159725*c1.w + 0.19094543*d1.w + -0.48007774*e1.w + 0.21894419*f1.w + 0.14849436*g1.w + -0.5190051*h1.w + 0.049825452*i1.w; + float q = 0.048532236*na0.x + 0.10520654*nb0.x + -0.02212896*nc0.x + 0.36066028*nd0.x + -0.40558204*ne0.x + 0.027699763*nf0.x + -0.049928706*ng0.x + 0.07140545*nh0.x + -0.040809184*ni0.x; + float r = -0.22017251*na0.y + -0.5950039*nb0.y + 0.016011601*nc0.y + 0.1787457*nd0.y + -0.56953317*ne0.y + 0.0016789446*nf0.y + -0.0152591895*ng0.y + -0.14698845*nh0.y + -0.038240127*ni0.y; + float s = 0.012132073*na0.z + 0.20379305*nb0.z + -0.15244928*nc0.z + 0.013908276*nd0.z + 0.57205755*ne0.z + -0.08137592*nf0.z + -0.0420915*ng0.z + 0.2314901*nh0.z + -0.0030451296*ni0.z; + float t = -0.16107729*na0.w + 0.08787612*nb0.w + -0.05292994*nc0.w + -0.21465571*nd0.w + -0.124343075*ne0.w + -0.03303205*nf0.w + 0.029135289*ng0.w + -0.0094405655*nh0.w + -0.027233165*ni0.w; + float u = 0.08539263*na1.x + 0.05341449*nb1.x + 0.051422648*nc1.x + 0.22483036*nd1.x + 0.063043155*ne1.x + -0.23852657*nf1.x + 0.18041016*ng1.x + -0.16212112*nh1.x + 0.046412155*ni1.x; + float v = -0.021413365*na1.y + 0.09399336*nb1.y + -0.045479856*nc1.y + -0.36818838*nd1.y + 0.0050471546*ne1.y + -0.06243919*nf1.y + -0.035713788*ng1.y + 0.024699768*nh1.y + -0.06425166*ni1.y; + float w = -0.031438354*na1.z + -0.09332041*nb1.z + -0.14652777*nc1.z + 0.06121613*nd1.z + 0.28410488*ne1.z + 0.20931922*nf1.z + 0.17510334*ng1.z + 0.04678771*nh1.z + -0.11084662*ni1.z; + float x = -0.03878583*na1.w + 0.11566247*nb1.w + -0.028782109*nc1.w + -0.094483145*nd1.w + 0.18686369*ne1.w + -0.14853023*nf1.w + -0.13913757*ng1.w + 0.40824965*nh1.w + -0.06846965*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.014384879; + i = 0.081302285*a0.x + -0.01200884*b0.x + 0.0051810266*c0.x + 0.22885948*d0.x + 0.5016418*e0.x + -0.022700071*f0.x + -0.11625609*g0.x + 0.3755614*h0.x + 0.042606056*i0.x; + j = -0.24225157*a0.y + -0.03035787*b0.y + -0.02878385*c0.y + -0.27371392*d0.y + 0.30426234*e0.y + 0.29937968*f0.y + -0.06833015*g0.y + -0.28164467*h0.y + -0.19420598*i0.y; + k = 0.13838074*a0.z + -0.0693596*b0.z + -0.0144782495*c0.z + -0.21116641*d0.z + 0.050632227*e0.z + 0.08093468*f0.z + 0.02682863*g0.z + 0.021293785*h0.z + -0.006511923*i0.z; + l = -0.011891017*a0.w + 0.12183185*b0.w + -0.006066711*c0.w + -0.14056961*d0.w + 0.23668641*e0.w + 0.17993811*f0.w + -0.15009682*g0.w + -0.18186209*h0.w + 0.10996275*i0.w; + m = -0.114001215*a1.x + 0.08040355*b1.x + -0.050432112*c1.x + 0.056575384*d1.x + -0.19978435*e1.x + 0.06969095*f1.x + -0.03081741*g1.x + -0.029842261*h1.x + 0.004736284*i1.x; + n = -0.013636102*a1.y + -0.24603765*b1.y + -0.027649323*c1.y + 0.09448466*d1.y + 0.46935272*e1.y + 0.005321074*f1.y + -0.023053408*g1.y + -0.18916315*h1.y + -0.05621936*i1.y; + o = 0.0020085343*a1.z + -0.11732761*b1.z + -0.02356044*c1.z + 0.12710598*d1.z + 0.10050475*e1.z + -0.042752214*f1.z + -0.012645914*g1.z + -0.015005672*h1.z + -0.028899282*i1.z; + p = -0.13963965*a1.w + -0.21774001*b1.w + -0.058217425*c1.w + 0.23380725*d1.w + 0.4253219*e1.w + 0.26903352*f1.w + -0.024840405*g1.w + -0.47157192*h1.w + -0.32442856*i1.w; + q = -0.004313836*na0.x + 0.35438684*nb0.x + -0.02928308*nc0.x + 0.06393032*nd0.x + -0.4129571*ne0.x + 0.16209923*nf0.x + -0.0034282196*ng0.x + -0.51319665*nh0.x + -0.013644353*ni0.x; + r = 0.05253109*na0.y + 0.20828614*nb0.y + -0.26114675*nc0.y + 0.2565526*nd0.y + -0.03439458*ne0.y + -0.16548492*nf0.y + 0.015113385*ng0.y + 0.06683532*nh0.y + 0.270508*ni0.y; + s = 0.033214018*na0.z + 0.13922311*nb0.z + 0.026104584*nc0.z + 0.0142909745*nd0.z + -0.27592355*ne0.z + 0.05822074*nf0.z + 0.12518267*ng0.z + -0.0016699395*nh0.z + -0.03275272*ni0.z; + t = 0.09762718*na0.w + -0.15567127*nb0.w + -0.1329481*nc0.w + 0.15287872*nd0.w + -0.47752786*ne0.w + -0.22881676*nf0.w + 0.037979577*ng0.w + 0.37223414*nh0.w + 0.058603775*ni0.w; + u = -0.042465784*na1.x + -0.02099335*nb1.x + 0.09778185*nc1.x + 0.15799712*nd1.x + 0.15365987*ne1.x + -0.27508533*nf1.x + 0.039696578*ng1.x + -0.16741951*nh1.x + 0.06984442*ni1.x; + v = -0.0752755*na1.y + 0.24538422*nb1.y + 0.0077161137*nc1.y + -0.0127162*nd1.y + -0.53776336*ne1.y + 0.008082307*nf1.y + -0.0023270606*ng1.y + 0.17226219*nh1.y + 0.03457291*ni1.y; + w = -0.08648925*na1.z + 0.12630469*nb1.z + -0.13315432*nc1.z + -0.020660728*nd1.z + -0.21132655*ne1.z + 0.23985873*nf1.z + -0.10585773*ng1.z + 0.23141496*nh1.z + -0.11902503*ni1.z; + x = -0.06618379*na1.w + -0.2273994*nb1.w + 0.077781565*nc1.w + 0.046340372*nd1.w + -0.15985714*ne1.w + -0.015358807*nf1.w + -0.19775797*ng1.w + 0.12113512*nh1.w + -0.040067535*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.002771056; + i = 0.021606864*a0.x + -0.08928166*b0.x + -0.08577098*c0.x + 0.116481096*d0.x + 0.028323913*e0.x + -0.036533065*f0.x + -0.075527035*g0.x + 0.012755163*h0.x + 0.020122685*i0.x; + j = 0.0028853463*a0.y + -0.18811181*b0.y + -0.17382199*c0.y + 0.068786174*d0.y + 0.05918515*e0.y + -0.14406848*f0.y + -0.027476229*g0.y + -0.13845423*h0.y + 0.015846852*i0.y; + k = 0.06259905*a0.z + 0.040686153*b0.z + -0.09959466*c0.z + -0.044038236*d0.z + 0.32777426*e0.z + 0.032428484*f0.z + -0.11056117*g0.z + 0.17431906*h0.z + -0.02379753*i0.z; + l = -0.25824967*a0.w + -0.18743302*b0.w + 0.0044342517*c0.w + -0.1706001*d0.w + 0.19157986*e0.w + -0.13212295*f0.w + -0.042633854*g0.w + -0.11158089*h0.w + -0.021044202*i0.w; + m = 0.047586076*a1.x + -0.035441607*b1.x + -0.12803088*c1.x + 0.20249197*d1.x + 0.13793948*e1.x + 0.29371345*f1.x + 0.077109165*g1.x + 0.3541602*h1.x + -0.048006814*i1.x; + n = -0.22914135*a1.y + 0.10113166*b1.y + -0.2540913*c1.y + -0.2997133*d1.y + -0.021689592*e1.y + -0.18026315*f1.y + -0.06550943*g1.y + 0.11176253*h1.y + -0.123405196*i1.y; + o = -0.12822497*a1.z + 0.28259254*b1.z + 0.2307225*c1.z + -0.02333415*d1.z + 0.3453413*e1.z + -0.034818113*f1.z + 0.054801736*g1.z + 0.16259307*h1.z + 0.13333833*i1.z; + p = -0.39024496*a1.w + 0.021573117*b1.w + 0.08599005*c1.w + -0.42476216*d1.w + -0.7817298*e1.w + -0.2601256*f1.w + 0.021591498*g1.w + 0.309251*h1.w + -0.06791641*i1.w; + q = -0.14430566*na0.x + -0.11055743*nb0.x + 0.105672106*nc0.x + -0.25145876*nd0.x + 0.1106223*ne0.x + -0.0066601806*nf0.x + 0.008009466*ng0.x + 0.15834406*nh0.x + -0.04079572*ni0.x; + r = 0.08744367*na0.y + 0.105490685*nb0.y + 0.31114987*nc0.y + 0.07603488*nd0.y + 0.17058893*ne0.y + 0.22760919*nf0.y + 0.006074983*ng0.y + 0.08326886*nh0.y + 0.15943988*ni0.y; + s = 0.050332133*na0.z + -0.0766741*nb0.z + 0.1285683*nc0.z + 0.055331063*nd0.z + -0.60682815*ne0.z + 0.1371641*nf0.z + 0.18354717*ng0.z + 0.03286175*nh0.z + -0.07859616*ni0.z; + t = 0.10502813*na0.w + -0.027062168*nb0.w + 0.055231456*nc0.w + 0.14236453*nd0.w + 0.10616334*ne0.w + 0.09435703*nf0.w + 0.07842552*ng0.w + -0.06887093*nh0.w + -0.024590459*ni0.w; + u = -0.20450965*na1.x + 0.096837066*nb1.x + 0.03443422*nc1.x + -0.25169346*nd1.x + -0.09789607*ne1.x + -0.15015261*nf1.x + -0.015787307*ng1.x + 0.055096075*nh1.x + -0.037342865*ni1.x; + v = 0.08175798*na1.y + 0.02664857*nb1.y + -0.022075763*nc1.y + 0.12141814*nd1.y + -0.02737079*ne1.y + 0.04700818*nf1.y + 0.04346721*ng1.y + -0.07328907*nh1.y + 0.04347813*ni1.y; + w = 0.12698099*na1.z + -0.18376732*nb1.z + -0.13291064*nc1.z + -0.1144856*nd1.z + -0.09359536*ne1.z + -0.018985584*nf1.z + -0.039779156*ng1.z + 0.0033084468*nh1.z + -0.09617441*ni1.z; + x = 0.12593117*na1.w + -0.050418727*nb1.w + -0.037301436*nc1.w + 0.24911767*nd1.w + -0.35904863*ne1.w + 0.2984039*nf1.w + 0.09867465*ng1.w + -0.20010832*nh1.w + 0.05439809*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.00091614726; + i = -0.06394797*a0.x + -0.10589785*b0.x + 0.071662396*c0.x + 0.23248084*d0.x + -0.69144565*e0.x + 0.20778444*f0.x + 0.08832192*g0.x + -0.114318825*h0.x + -0.046119977*i0.x; + j = -0.018593391*a0.y + 0.25111246*b0.y + -0.2612264*c0.y + 0.0385463*d0.y + 0.6223591*e0.y + 0.026857028*f0.y + -0.014829569*g0.y + 0.1277322*h0.y + 0.0584881*i0.y; + k = 0.023849497*a0.z + -0.067284025*b0.z + 0.1418698*c0.z + -0.010982118*d0.z + 0.16797899*e0.z + -0.14820707*f0.z + -0.023809081*g0.z + -0.090138786*h0.z + 0.014505213*i0.z; + l = 0.12983774*a0.w + -0.029752735*b0.w + -0.07501964*c0.w + -0.07778343*d0.w + 0.18478629*e0.w + -0.27968863*f0.w + -0.041439153*g0.w + 0.1744004*h0.w + 0.015227504*i0.w; + m = -0.020664224*a1.x + -0.0038989927*b1.x + -0.031596243*c1.x + -0.0101110535*d1.x + -0.06884738*e1.x + -0.1365087*f1.x + 0.014945645*g1.x + -0.030193496*h1.x + 0.0163872*i1.x; + n = -0.0004287638*a1.y + 0.010622353*b1.y + 0.09724528*c1.y + 0.14886458*d1.y + 0.08720078*e1.y + -0.15509501*f1.y + 0.06435047*g1.y + 0.05138851*h1.y + 0.06877765*i1.y; + o = 0.033485916*a1.z + 0.2254674*b1.z + 0.13985848*c1.z + 0.1105003*d1.z + -0.25495616*e1.z + -0.0071104667*f1.z + 0.00394771*g1.z + -0.044202417*h1.z + -0.056555733*i1.z; + p = -0.06150365*a1.w + 0.37854615*b1.w + 0.16227704*c1.w + 0.09953428*d1.w + 0.6951193*e1.w + -0.00896644*f1.w + -0.14055361*g1.w + -0.09406019*h1.w + 0.11679244*i1.w; + q = 0.044572912*na0.x + 0.16796306*nb0.x + -0.06547087*nc0.x + -0.048156604*nd0.x + 0.5251333*ne0.x + -0.15836562*nf0.x + -0.06462838*ng0.x + 0.09596074*nh0.x + 0.037825905*ni0.x; + r = -0.23161076*na0.y + -0.65139836*nb0.y + 0.13197362*nc0.y + -0.05546677*nd0.y + -0.97165394*ne0.y + -0.30722955*nf0.y + -0.017831514*ng0.y + -0.03898181*nh0.y + -0.17043829*ni0.y; + s = 0.057691526*na0.z + 0.0524966*nb0.z + -0.03153983*nc0.z + -0.0503038*nd0.z + 0.08104926*ne0.z + 0.06692566*nf0.z + -0.013073635*ng0.z + -0.008260687*nh0.z + 0.010080927*ni0.z; + t = -0.05453099*na0.w + -0.18063734*nb0.w + 0.16694653*nc0.w + -0.028910562*nd0.w + -0.42992082*ne0.w + 0.16023055*nf0.w + 0.038325876*ng0.w + -0.14538842*nh0.w + -0.023606323*ni0.w; + u = -0.07181944*na1.x + 0.14208739*nb1.x + -0.0039082896*nc1.x + 0.00190685*nd1.x + 0.17796423*ne1.x + 0.08351044*nf1.x + -0.044966634*ng1.x + -0.06406277*nh1.x + 0.06725832*ni1.x; + v = -0.0071947016*na1.y + 0.0006096204*nb1.y + -0.13142252*nc1.y + -0.007630795*nd1.y + 0.028756304*ne1.y + 0.039658252*nf1.y + 0.009520045*ng1.y + -0.03928686*nh1.y + -0.1010825*ni1.y; + w = -0.049172632*na1.z + -0.35113806*nb1.z + 0.022209*nc1.z + -0.026630908*nd1.z + 0.23890342*ne1.z + -0.06114634*nf1.z + 0.019761385*ng1.z + 0.08615667*nh1.z + 0.0992877*ni1.z; + x = 0.0073823123*na1.w + -0.110830136*nb1.w + 0.027609926*nc1.w + 0.019419665*nd1.w + -0.24567391*ne1.w + -0.050785057*nf1.w + 0.05211453*ng1.w + -0.022167444*nh1.w + -0.09944939*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.005509867; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN120 +//!BIND LUMAN121 +//!SAVE LUMAN130 + +#define L0_tex LUMAN120_tex +#define L1_tex LUMAN121_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.07173966*a0.x + 0.05524066*b0.x + -0.21521214*c0.x + -0.12502593*d0.x + 0.30083555*e0.x + 0.5521808*f0.x + 0.27752915*g0.x + -0.27389202*h0.x + -0.13792084*i0.x; + float j = -0.018661562*a0.y + 0.12920462*b0.y + -0.050642636*c0.y + -0.05618292*d0.y + -0.2634706*e0.y + 0.08305681*f0.y + 0.07627947*g0.y + -0.03478369*h0.y + 0.008291865*i0.y; + float k = 0.3203911*a0.z + -0.10194117*b0.z + 0.5750903*c0.z + 0.027564753*d0.z + 0.20415193*e0.z + -0.32818332*f0.z + 0.0064895176*g0.z + 0.11268637*h0.z + -0.07566682*i0.z; + float l = -0.20254683*a0.w + -0.028722532*b0.w + 0.20982566*c0.w + -0.03934203*d0.w + 1.1664512*e0.w + -0.35541716*f0.w + 0.1317692*g0.w + 0.2791658*h0.w + -0.0008373487*i0.w; + float m = 0.11692941*a1.x + -0.5743238*b1.x + -0.020805841*c1.x + 0.06912012*d1.x + 0.7215903*e1.x + 0.08506985*f1.x + -0.1770724*g1.x + -0.021816388*h1.x + -0.0012947934*i1.x; + float n = -0.016384576*a1.y + 0.03555106*b1.y + 0.06288962*c1.y + 0.29152143*d1.y + -0.86737454*e1.y + 0.47646257*f1.y + 0.046224713*g1.y + 0.05431801*h1.y + -0.20437165*i1.y; + float o = -0.19650295*a1.z + 0.36212683*b1.z + -0.09464794*c1.z + 0.21289517*d1.z + -0.49227223*e1.z + 0.12496616*f1.z + 0.010253889*g1.z + -0.039342172*h1.z + -0.0389005*i1.z; + float p = 0.10064498*a1.w + 0.037331007*b1.w + -0.20260917*c1.w + -0.018359315*d1.w + -0.3830645*e1.w + 0.18125847*f1.w + -0.052647024*g1.w + 0.088890396*h1.w + -0.029746594*i1.w; + float q = -0.10467294*na0.x + 0.25880128*nb0.x + -0.041262787*nc0.x + -0.043955367*nd0.x + -0.08661329*ne0.x + 0.050330844*nf0.x + -0.02470256*ng0.x + -0.10187702*nh0.x + -0.026671588*ni0.x; + float r = -0.005288939*na0.y + 0.07448776*nb0.y + -0.1311754*nc0.y + -0.20314097*nd0.y + -0.41264915*ne0.y + -0.26195058*nf0.y + 0.015994098*ng0.y + 0.17131393*nh0.y + -0.042960033*ni0.y; + float s = -0.05252907*na0.z + 0.19381894*nb0.z + 0.031247867*nc0.z + 0.059349507*nd0.z + 0.0496565*ne0.z + -0.036475737*nf0.z + 0.061698027*ng0.z + -0.019937498*nh0.z + 0.031974547*ni0.z; + float t = 0.0596274*na0.w + -0.074480556*nb0.w + -0.04917453*nc0.w + -0.091791056*nd0.w + -0.1944997*ne0.w + -0.15632756*nf0.w + 0.1029948*ng0.w + -0.15851589*nh0.w + -0.040070053*ni0.w; + float u = -0.19576977*na1.x + 0.090122245*nb1.x + 0.028307155*nc1.x + 0.18360525*nd1.x + 0.021744814*ne1.x + -0.025507484*nf1.x + -0.10279109*ng1.x + 0.12280133*nh1.x + -0.045142133*ni1.x; + float v = -0.027888902*na1.y + 0.029968994*nb1.y + 0.0361322*nc1.y + 0.022657184*nd1.y + -0.16778767*ne1.y + -0.024502534*nf1.y + -0.022329496*ng1.y + -0.07601257*nh1.y + 0.03833047*ni1.y; + float w = 0.0653101*na1.z + -0.16791722*nb1.z + -0.0092719225*nc1.z + 0.10876519*nd1.z + 0.6509129*ne1.z + -0.09831674*nf1.z + -0.07682791*ng1.z + 0.08948414*nh1.z + -0.025521843*ni1.z; + float x = -0.12456352*na1.w + -0.09949522*nb1.w + 0.055695318*nc1.w + 0.07635483*nd1.w + 0.76795757*ne1.w + -0.16395962*nf1.w + -0.116975896*ng1.w + -0.19186862*nh1.w + 0.21049598*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.013636319; + i = 0.042530164*a0.x + 0.07018646*b0.x + -0.24715914*c0.x + 0.046272676*d0.x + 0.27483156*e0.x + 0.10328371*f0.x + -0.109125644*g0.x + 0.09677094*h0.x + 0.07537059*i0.x; + j = -0.004949831*a0.y + -0.020548534*b0.y + -0.025159743*c0.y + 0.058468964*d0.y + 0.34713256*e0.y + 0.017708272*f0.y + -0.010207437*g0.y + -0.031564705*h0.y + -0.03981632*i0.y; + k = -0.21877033*a0.z + -0.043471135*b0.z + -0.019215649*c0.z + -0.022867844*d0.z + 0.21302997*e0.z + -0.3662721*f0.z + 0.03106331*g0.z + 0.07036724*h0.z + -0.24083485*i0.z; + l = -0.08853993*a0.w + 0.0015703896*b0.w + 0.11063675*c0.w + 0.018928405*d0.w + -0.24625982*e0.w + 0.17761426*f0.w + 0.06680052*g0.w + 0.25644967*h0.w + -0.09996918*i0.w; + m = 0.045116182*a1.x + -0.4170642*b1.x + 0.24441446*c1.x + 0.2228244*d1.x + -0.7826016*e1.x + 0.053818185*f1.x + 0.23531969*g1.x + -0.5276906*h1.x + -0.017621778*i1.x; + n = -0.04748159*a1.y + 0.14208545*b1.y + -0.08716088*c1.y + 0.16001788*d1.y + -0.11126903*e1.y + 0.15226895*f1.y + -0.054882083*g1.y + 0.027261125*h1.y + -0.007631973*i1.y; + o = 0.045499023*a1.z + -0.109854676*b1.z + 0.056851212*c1.z + 0.016088946*d1.z + -0.021904342*e1.z + 0.16645917*f1.z + 0.017442156*g1.z + -0.18457061*h1.z + 0.12634978*i1.z; + p = -0.12596329*a1.w + 0.2599066*b1.w + -0.106144205*c1.w + 0.22593817*d1.w + 0.16219479*e1.w + 0.16036382*f1.w + -0.04179427*g1.w + -0.098000705*h1.w + 0.13039199*i1.w; + q = 0.10479193*na0.x + -0.17233655*nb0.x + -0.060700305*nc0.x + 0.06606078*nd0.x + -0.089419335*ne0.x + 0.20349522*nf0.x + -0.02300001*ng0.x + -0.05826102*nh0.x + 0.05089717*ni0.x; + r = -0.056828115*na0.y + 0.060302604*nb0.y + 0.024080917*nc0.y + -0.082361214*nd0.y + -0.1468351*ne0.y + -0.020615399*nf0.y + 0.022000078*ng0.y + 0.08448483*nh0.y + 0.029490553*ni0.y; + s = -0.20444779*na0.z + 0.363772*nb0.z + 0.013757455*nc0.z + -0.027767507*nd0.z + 0.086781934*ne0.z + 0.042837158*nf0.z + -0.0028691744*ng0.z + -0.048100833*nh0.z + -0.03654709*ni0.z; + t = 0.04099425*na0.w + 0.050848916*nb0.w + 0.09634782*nc0.w + 0.16893995*nd0.w + -0.10806615*ne0.w + 0.1542499*nf0.w + -0.1305786*ng0.w + -0.11792504*nh0.w + 0.030942632*ni0.w; + u = -0.00045687062*na1.x + -0.11489277*nb1.x + -0.04124386*nc1.x + 0.020468015*nd1.x + 0.5372667*ne1.x + 0.059690394*nf1.x + 0.14485446*ng1.x + 0.069309615*nh1.x + -0.02704002*ni1.x; + v = -0.0934174*na1.y + 0.04013287*nb1.y + -0.01692319*nc1.y + 0.062415145*nd1.y + 0.20963359*ne1.y + -0.10348718*nf1.y + -0.013736046*ng1.y + -0.021258404*nh1.y + -0.047034536*ni1.y; + w = 0.08916951*na1.z + -0.24287029*nb1.z + -0.056870934*nc1.z + 0.025470622*nd1.z + -0.3036939*ne1.z + -0.15004703*nf1.z + 0.037480198*ng1.z + -0.20328596*nh1.z + 0.124831766*ni1.z; + x = -0.011442481*na1.w + 0.077219054*nb1.w + -0.013083296*nc1.w + 0.14963494*nd1.w + -0.5541406*ne1.w + -0.053182814*nf1.w + 0.056806713*ng1.w + -0.43407235*nh1.w + 0.21133529*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.020445773; + i = -0.060422402*a0.x + -0.06825925*b0.x + -0.057646785*c0.x + -0.16212627*d0.x + -0.32644564*e0.x + 0.12910526*f0.x + -0.063041456*g0.x + 0.07560072*h0.x + -0.015426578*i0.x; + j = -0.006889652*a0.y + -0.17347373*b0.y + 0.016179034*c0.y + 0.058115833*d0.y + 0.31190333*e0.y + -0.078174144*f0.y + -0.07960504*g0.y + 0.12811723*h0.y + 0.0055712913*i0.y; + k = -0.24560466*a0.z + 0.16410764*b0.z + -0.22483738*c0.z + 0.07343547*d0.z + -0.057290845*e0.z + -0.3933686*f0.z + -0.050107088*g0.z + -0.13618156*h0.z + 0.24685264*i0.z; + l = 0.106292695*a0.w + -0.12385596*b0.w + 0.15031956*c0.w + -0.019425064*d0.w + 0.20487277*e0.w + -0.4166029*f0.w + 0.049125712*g0.w + -0.18145804*h0.w + 0.22562954*i0.w; + m = -0.061704915*a1.x + 0.021972679*b1.x + 0.03886212*c1.x + 0.00050829595*d1.x + -0.50772375*e1.x + 0.1848391*f1.x + -0.09643155*g1.x + 0.2006514*h1.x + -0.1370429*i1.x; + n = -0.12936626*a1.y + 0.21173458*b1.y + -0.002170517*c1.y + -0.016762713*d1.y + -0.56988305*e1.y + -0.35746378*f1.y + -0.03237757*g1.y + -0.061048053*h1.y + 0.15020193*i1.y; + o = 0.122485116*a1.z + -0.18640561*b1.z + -0.0009304099*c1.z + -0.10620465*d1.z + -0.017849369*e1.z + 0.18167005*f1.z + -0.13736731*g1.z + 0.06757091*h1.z + -0.033063065*i1.z; + p = -0.08587528*a1.w + 0.14814755*b1.w + 0.10723197*c1.w + 0.25996724*d1.w + -0.27067813*e1.w + 0.023977801*f1.w + -0.11409169*g1.w + 0.08244975*h1.w + -0.07811598*i1.w; + q = 0.09545891*na0.x + -0.26934135*nb0.x + 0.084429435*nc0.x + -0.027571537*nd0.x + 0.18728629*ne0.x + -0.034010876*nf0.x + 0.11272564*ng0.x + -0.02174526*nh0.x + 0.031401962*ni0.x; + r = -0.058911406*na0.y + 0.117469706*nb0.y + 0.07483167*nc0.y + 0.25347975*nd0.y + -0.8893511*ne0.y + 0.11577824*nf0.y + -0.019952424*ng0.y + -0.32625362*nh0.y + 0.054697443*ni0.y; + s = 0.058437176*na0.z + 0.12717098*nb0.z + -0.030477263*nc0.z + 0.025787791*nd0.z + -0.55476403*ne0.z + 0.10344902*nf0.z + -0.049927607*ng0.z + 0.0034100525*nh0.z + -0.014674564*ni0.z; + t = -0.039341412*na0.w + 0.24266788*nb0.w + -0.13092296*nc0.w + -0.078149125*nd0.w + -0.1825526*ne0.w + 0.39637613*nf0.w + -0.07388616*ng0.w + 0.07066076*nh0.w + -0.068194985*ni0.w; + u = 0.16596706*na1.x + -0.17953089*nb1.x + 0.05764661*nc1.x + -0.11200913*nd1.x + 0.4304551*ne1.x + -0.20531161*nf1.x + 0.057423525*ng1.x + -0.0616747*nh1.x + 0.09423837*ni1.x; + v = -0.0030923756*na1.y + -0.005227259*nb1.y + 0.00855408*nc1.y + 0.05933646*nd1.y + 0.1647804*ne1.y + -0.014145093*nf1.y + 0.029180478*ng1.y + 0.015440778*nh1.y + -0.0042728186*ni1.y; + w = -0.04026973*na1.z + -0.09111073*nb1.z + 0.09226495*nc1.z + 0.029515188*nd1.z + -0.2941943*ne1.z + -0.37025875*nf1.z + -0.0482752*ng1.z + 0.023515888*nh1.z + 0.13930896*ni1.z; + x = 0.05243473*na1.w + 0.021479629*nb1.w + -0.0098233*nc1.w + 0.13860157*nd1.w + -0.9362658*ne1.w + 0.13477142*nf1.w + -0.0016362248*ng1.w + 0.3428101*nh1.w + -0.06643634*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.00026336784; + i = 0.13095191*a0.x + 0.071042016*b0.x + 0.15989769*c0.x + -0.4085044*d0.x + -1.1903197*e0.x + -0.8063476*f0.x + 0.1758939*g0.x + 0.29856923*h0.x + 0.018587846*i0.x; + j = -0.0429038*a0.y + -0.046388038*b0.y + 0.050304305*c0.y + -0.012282529*d0.y + 0.50057316*e0.y + 0.102298446*f0.y + -0.047718488*g0.y + 0.011400605*h0.y + -0.040591896*i0.y; + k = -0.08647257*a0.z + 0.06590021*b0.z + -0.10776554*c0.z + 0.05844034*d0.z + 0.15784912*e0.z + -0.050049458*f0.z + -0.08851963*g0.z + -0.09389101*h0.z + -0.07156607*i0.z; + l = -0.020921769*a0.w + 0.13630044*b0.w + 0.04598389*c0.w + -0.022334518*d0.w + -0.3560804*e0.w + 0.66281724*f0.w + 0.08330941*g0.w + -0.050354507*h0.w + 0.0063697495*i0.w; + m = 0.07382021*a1.x + 0.14582287*b1.x + -0.026436277*c1.x + 0.032368336*d1.x + 0.123083666*e1.x + 0.016335508*f1.x + -0.18557611*g1.x + 0.33704454*h1.x + 0.060447156*i1.x; + n = -0.24164051*a1.y + -0.17663498*b1.y + 0.017156934*c1.y + 0.11470921*d1.y + -0.2480085*e1.y + 0.03648527*f1.y + 0.01601964*g1.y + -0.17307469*h1.y + -0.25195485*i1.y; + o = 0.044692397*a1.z + 0.045473315*b1.z + -0.07254721*c1.z + 0.11784992*d1.z + 0.22489645*e1.z + -0.12044718*f1.z + -0.22769438*g1.z + 0.10125708*h1.z + 0.061251607*i1.z; + p = -0.12371223*a1.w + 0.09359978*b1.w + 0.14695486*c1.w + 0.37523615*d1.w + -0.06767972*e1.w + -0.51172626*f1.w + -0.18365318*g1.w + -0.21067004*h1.w + 0.18633223*i1.w; + q = -0.06524313*na0.x + -0.009557331*nb0.x + 0.1807241*nc0.x + -0.04307605*nd0.x + 0.645201*ne0.x + 0.13570951*nf0.x + 0.14300692*ng0.x + 0.18481126*nh0.x + -0.148592*ni0.x; + r = -0.112279296*na0.y + 0.10971034*nb0.y + -0.053928122*nc0.y + 0.1691853*nd0.y + -0.2553969*ne0.y + -0.01336192*nf0.y + -0.010185109*ng0.y + -0.0110892*nh0.y + -0.06696365*ni0.y; + s = 0.009661347*na0.z + 0.13783365*nb0.z + -0.05469151*nc0.z + 0.060208343*nd0.z + -0.20801783*ne0.z + 0.050860364*nf0.z + 0.018983612*ng0.z + -0.058851782*nh0.z + 0.016830424*ni0.z; + t = 0.022623703*na0.w + 0.2184282*nb0.w + -0.18573825*nc0.w + -0.12993099*nd0.w + 0.007547321*ne0.w + -0.13938355*nf0.w + 0.0066179796*ng0.w + 0.2032918*nh0.w + 0.01827841*ni0.w; + u = 0.06574555*na1.x + -0.07890568*nb1.x + 0.006496277*nc1.x + -0.10739301*nd1.x + 0.13940795*ne1.x + 0.1365898*nf1.x + -0.053870827*ng1.x + -0.009612605*nh1.x + -0.018912794*ni1.x; + v = -0.08696663*na1.y + 0.012059219*nb1.y + -0.005466396*nc1.y + 0.03873791*nd1.y + 0.4502705*ne1.y + 0.080376014*nf1.y + 0.066687986*ng1.y + 0.08928875*nh1.y + 0.017182676*ni1.y; + w = -0.040589333*na1.z + -0.09646847*nb1.z + -0.018687917*nc1.z + 0.04907547*nd1.z + 0.008554357*ne1.z + 0.1492653*nf1.z + -0.096977495*ng1.z + -0.13979109*nh1.z + -0.00083513476*ni1.z; + x = -0.04625478*na1.w + 0.0035757115*nb1.w + -0.016119964*nc1.w + 0.26989165*nd1.w + 0.20737746*ne1.w + 0.0034231078*nf1.w + -0.09725438*ng1.w + 0.05070696*nh1.w + 0.17640953*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0135042025; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN120 +//!BIND LUMAN121 +//!SAVE LUMAN131 + +#define L0_tex LUMAN120_tex +#define L1_tex LUMAN121_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.0029817503*a0.x + 0.11039597*b0.x + 0.1293379*c0.x + -0.29478145*d0.x + -0.29309556*e0.x + 0.007461504*f0.x + 0.06639911*g0.x + 0.12852067*h0.x + -0.17117287*i0.x; + float j = 0.014813622*a0.y + -0.0013997258*b0.y + 0.023237767*c0.y + -0.0039130542*d0.y + -0.34994942*e0.y + 0.017671466*f0.y + 0.07529793*g0.y + 0.004599998*h0.y + 0.009330613*i0.y; + float k = 0.3698393*a0.z + -0.39694417*b0.z + 0.09804228*c0.z + -0.35729608*d0.z + 0.41000205*e0.z + -0.5800405*f0.z + 0.15204465*g0.z + -0.3597829*h0.z + 0.50068516*i0.z; + float l = -0.1146267*a0.w + 0.2583005*b0.w + -0.31435132*c0.w + 0.03573161*d0.w + -0.04650575*e0.w + 0.20616455*f0.w + 0.044980876*g0.w + -0.10150848*h0.w + 0.13188677*i0.w; + float m = 0.10420975*a1.x + -0.44770283*b1.x + -0.12038152*c1.x + 0.3392538*d1.x + -0.30249548*e1.x + 0.055619825*f1.x + -0.22301525*g1.x + -0.15613358*h1.x + -0.04950416*i1.x; + float n = -0.24326678*a1.y + 0.2301849*b1.y + -0.1467583*c1.y + 0.39412203*d1.y + -0.5131136*e1.y + 0.19376983*f1.y + -0.10284846*g1.y + 0.18020068*h1.y + -0.116572164*i1.y; + float o = -0.09376026*a1.z + -0.112495236*b1.z + 0.012500469*c1.z + 0.091132894*d1.z + -0.10716909*e1.z + -0.05887143*f1.z + -0.25869355*g1.z + 0.28358018*h1.z + 0.015895177*i1.z; + float p = -0.13750197*a1.w + -0.09933744*b1.w + 0.16747455*c1.w + 0.35556677*d1.w + -0.1980293*e1.w + -0.16308151*f1.w + -0.3437185*g1.w + 0.080174305*h1.w + 0.03273947*i1.w; + float q = -0.008803652*na0.x + -0.05780074*nb0.x + 0.002868577*nc0.x + 0.17680763*nd0.x + -0.1437393*ne0.x + -0.058113955*nf0.x + 0.1324202*ng0.x + -0.025318727*nh0.x + -0.1327205*ni0.x; + float r = 0.12045249*na0.y + -0.19771278*nb0.y + 0.0012465563*nc0.y + -0.25569203*nd0.y + 0.20063406*ne0.y + 0.071804866*nf0.y + 0.13519558*ng0.y + -0.3769389*nh0.y + 0.12577529*ni0.y; + float s = -0.18126842*na0.z + 0.06411489*nb0.z + 0.106862076*nc0.z + 0.15456331*nd0.z + -0.20641422*ne0.z + -0.015733475*nf0.z + 0.04565371*ng0.z + -0.198355*nh0.z + 0.016548535*ni0.z; + float t = 0.016731832*na0.w + 0.03456397*nb0.w + 0.11793571*nc0.w + 0.009492188*nd0.w + -0.17384322*ne0.w + 0.036433797*nf0.w + -0.011236655*ng0.w + 0.104419*nh0.w + -0.042673107*ni0.w; + float u = 0.04593755*na1.x + 0.037620712*nb1.x + -0.116470456*nc1.x + 0.010684921*nd1.x + 0.10634034*ne1.x + 0.083671*nf1.x + 0.003784596*ng1.x + -0.030200265*nh1.x + 0.029983213*ni1.x; + float v = -0.07384754*na1.y + -0.06212857*nb1.y + -0.046269182*nc1.y + 0.035937984*nd1.y + 0.1415643*ne1.y + -0.071681954*nf1.y + -0.14786382*ng1.y + -0.17628422*nh1.y + 0.12059677*ni1.y; + float w = -0.051521663*na1.z + 0.085905306*nb1.z + -0.28085628*nc1.z + -0.21416552*nd1.z + -0.5439677*ne1.z + 0.25659165*nf1.z + -0.30437124*ng1.z + -0.19582753*nh1.z + -0.094153725*ni1.z; + float x = -0.013591523*na1.w + 0.09577837*nb1.w + 0.14275217*nc1.w + 0.23535793*nd1.w + 0.62966025*ne1.w + -0.07882985*nf1.w + -0.1697662*ng1.w + 0.33211526*nh1.w + 0.057048142*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0061882124; + i = 0.1608683*a0.x + 0.12672013*b0.x + -0.13156074*c0.x + 0.20069747*d0.x + -0.57826555*e0.x + -0.1311762*f0.x + 0.05670379*g0.x + -0.13502689*h0.x + -0.017937418*i0.x; + j = -0.033564825*a0.y + 0.077663735*b0.y + -0.0017946946*c0.y + -0.028062444*d0.y + -0.5258993*e0.y + 0.019605096*f0.y + 0.032106742*g0.y + 0.015103085*h0.y + -0.04403495*i0.y; + k = -0.2539501*a0.z + 0.25463545*b0.z + 0.21425003*c0.z + 0.112265415*d0.z + 0.16083106*e0.z + 0.1895563*f0.z + -0.0016240401*g0.z + 0.14660679*h0.z + -0.46303564*i0.z; + l = -0.09206371*a0.w + 0.08054541*b0.w + 0.20218949*c0.w + 0.093106724*d0.w + -0.21643853*e0.w + 0.12654713*f0.w + -0.013795536*g0.w + 0.24343796*h0.w + -0.18503825*i0.w; + m = 0.13443115*a1.x + 0.024385871*b1.x + 0.06606949*c1.x + -0.0127489045*d1.x + 0.25821966*e1.x + 0.0070504625*f1.x + 0.19849744*g1.x + -0.25665656*h1.x + 0.119276844*i1.x; + n = 0.0041986876*a1.y + -0.13548018*b1.y + 0.0587734*c1.y + 0.14147758*d1.y + -0.21496426*e1.y + 0.14946987*f1.y + 0.06213324*g1.y + -0.07815703*h1.y + -0.121064246*i1.y; + o = -0.01119387*a1.z + 0.1281896*b1.z + -0.033581752*c1.z + 0.0795136*d1.z + -0.059567317*e1.z + 0.0051460788*f1.z + 0.2383628*g1.z + -0.30380785*h1.z + 0.051271286*i1.z; + p = -0.09753218*a1.w + 0.2362304*b1.w + -0.18155637*c1.w + 0.017945759*d1.w + 0.06215586*e1.w + -0.012593655*f1.w + 0.19601065*g1.w + -0.17636631*h1.w + 0.2375158*i1.w; + q = -0.06538386*na0.x + 0.04938395*nb0.x + 0.07520233*nc0.x + -0.09151315*nd0.x + 0.13100089*ne0.x + -0.020945365*nf0.x + -0.20073208*ng0.x + 0.059561357*nh0.x + 0.081940256*ni0.x; + r = -0.11219974*na0.y + 0.2536562*nb0.y + -0.09547038*nc0.y + -0.1292043*nd0.y + 0.9015294*ne0.y + -0.12639236*nf0.y + -0.06864811*ng0.y + 0.35557497*nh0.y + -0.14578156*ni0.y; + s = -0.048530217*na0.z + 0.19374037*nb0.z + -0.1382556*nc0.z + -0.13337164*nd0.z + 0.47139746*ne0.z + -0.0766065*nf0.z + -0.040958144*ng0.z + 0.08004464*nh0.z + -0.061836693*ni0.z; + t = 0.0035216731*na0.w + 0.0064222408*nb0.w + -0.075095765*nc0.w + 0.046879686*nd0.w + -0.14983718*ne0.w + -0.12718*nf0.w + 0.08732038*ng0.w + -0.121688694*nh0.w + -0.041010316*ni0.w; + u = -0.07124008*na1.x + -0.04196053*nb1.x + 0.047542192*nc1.x + -0.035899833*nd1.x + -0.41907385*ne1.x + 0.08893381*nf1.x + 0.003947721*ng1.x + 0.06347225*nh1.x + -0.08798214*ni1.x; + v = -0.0768094*na1.y + -0.0052326927*nb1.y + 0.028601233*nc1.y + 0.005496373*nd1.y + -0.20018737*ne1.y + 0.031576294*nf1.y + 0.018691787*ng1.y + 0.079820536*nh1.y + -0.10286643*ni1.y; + w = 0.16556709*na1.z + -0.14412585*nb1.z + 0.023056397*nc1.z + 0.23065941*nd1.z + -0.19911864*ne1.z + 0.12787361*nf1.z + 0.09215916*ng1.z + 0.018068027*nh1.z + 0.042100914*ni1.z; + x = -0.07797658*na1.w + -0.03082342*nb1.w + -0.019065307*nc1.w + 0.12527962*nd1.w + -0.20716375*ne1.w + 0.029431188*nf1.w + 0.1279543*ng1.w + -0.5208783*nh1.w + 0.032281134*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.020498782; + i = -0.084622964*a0.x + -0.16740607*b0.x + -0.029469222*c0.x + 0.16969982*d0.x + -0.18227486*e0.x + 0.25854433*f0.x + -0.19011459*g0.x + -0.17933366*h0.x + 0.074558094*i0.x; + j = 0.026003294*a0.y + -0.04915105*b0.y + -0.0013010732*c0.y + 0.04870731*d0.y + 0.28155202*e0.y + -0.06976968*f0.y + -0.0785302*g0.y + 0.025113294*h0.y + 0.05850286*i0.y; + k = -0.099263944*a0.z + 0.20479305*b0.z + 0.006517434*c0.z + 0.054624297*d0.z + 0.3202717*e0.z + -0.016792087*f0.z + -0.09389022*g0.z + 0.105496354*h0.z + -0.066047944*i0.z; + l = 0.11956328*a0.w + -0.13723543*b0.w + 0.02056757*c0.w + 0.048940748*d0.w + 0.06777377*e0.w + -0.046082053*f0.w + -0.122295715*g0.w + -0.018395558*h0.w + 0.006211377*i0.w; + m = -0.15036355*a1.x + 0.13597776*b1.x + 0.2225863*c1.x + 0.13214336*d1.x + 0.37878448*e1.x + 0.13936034*f1.x + 0.29791525*g1.x + 0.14070831*h1.x + -0.0022269697*i1.x; + n = 0.16937836*a1.y + 0.078364424*b1.y + 0.025481608*c1.y + -0.28841308*d1.y + -0.7480474*e1.y + -0.23245746*f1.y + -0.027374426*g1.y + -0.06545865*h1.y + 0.17867507*i1.y; + o = 0.09645862*a1.z + 0.09660143*b1.z + -0.10547699*c1.z + -0.15390293*d1.z + 0.18812673*e1.z + 0.055048805*f1.z + 0.021517936*g1.z + -0.03123248*h1.z + -0.06397191*i1.z; + p = 0.079715334*a1.w + 0.01418331*b1.w + -0.0774716*c1.w + -0.32642365*d1.w + -0.17485769*e1.w + 0.18184866*f1.w + 0.16945517*g1.w + -0.029771687*h1.w + -0.31664798*i1.w; + q = -0.031399272*na0.x + -0.03206811*nb0.x + -0.07516456*nc0.x + 0.0515123*nd0.x + 0.44152927*ne0.x + 0.19966014*nf0.x + -0.059791274*ng0.x + 0.09954191*nh0.x + 0.101585746*ni0.x; + r = -0.010062315*na0.y + -0.057479843*nb0.y + -0.018172972*nc0.y + 0.059699446*nd0.y + -0.10326032*ne0.y + -0.06662804*nf0.y + -0.064171165*ng0.y + -0.0761727*nh0.y + -0.038051385*ni0.y; + s = 0.12910141*na0.z + 0.01146065*nb0.z + -0.03436212*nc0.z + -0.104220964*nd0.z + -0.03813209*ne0.z + -0.0146224275*nf0.z + -0.0226614*ng0.z + 0.040486135*nh0.z + 0.03331776*ni0.z; + t = 0.00067659107*na0.w + 0.09321861*nb0.w + -0.120426044*nc0.w + -0.012587846*nd0.w + 0.20406908*ne0.w + 0.007672166*nf0.w + -0.035258528*ng0.w + 0.0016402612*nh0.w + 0.058924437*ni0.w; + u = -0.020544445*na1.x + -0.13000254*nb1.x + 0.12238778*nc1.x + 0.008118038*nd1.x + 0.08118961*ne1.x + -0.14815351*nf1.x + -0.0016237226*ng1.x + -0.034430075*nh1.x + 0.021861486*ni1.x; + v = 0.11768407*na1.y + 0.060114264*nb1.y + 0.016723705*nc1.y + -0.057645593*nd1.y + 0.27267838*ne1.y + -0.015508981*nf1.y + 0.07961894*ng1.y + 0.13694412*nh1.y + 0.009282088*ni1.y; + w = 0.0014761469*na1.z + -0.078347*nb1.z + 0.31750104*nc1.z + -0.10870471*nd1.z + -0.6838303*ne1.z + -0.31684813*nf1.z + 0.19105281*ng1.z + 0.21890667*nh1.z + 0.08495596*ni1.z; + x = 0.13082732*na1.w + 0.0022536176*nb1.w + -0.052774757*nc1.w + -0.13665682*nd1.w + 0.0970184*ne1.w + 0.19598328*nf1.w + 0.11680146*ng1.w + 0.22926913*nh1.w + -0.031428613*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.004580171; + i = -0.20878509*a0.x + -0.0049028993*b0.x + 0.008758187*c0.x + 0.42891967*d0.x + -0.12513797*e0.x + 0.078094915*f0.x + -0.715149*g0.x + -0.5880513*h0.x + -0.532971*i0.x; + j = 0.04762167*a0.y + 0.10662991*b0.y + 0.07202485*c0.y + 0.105879575*d0.y + -0.0635549*e0.y + -0.2399356*f0.y + 0.24179313*g0.y + 0.10862184*h0.y + 0.10190414*i0.y; + k = 0.095115505*a0.z + -0.47274086*b0.z + 0.62832284*c0.z + -1.0036635*d0.z + 0.374167*e0.z + -0.681788*f0.z + 0.45285058*g0.z + -0.6784815*h0.z + 0.32184234*i0.z; + l = -0.07651871*a0.w + 0.6871501*b0.w + -0.8205136*c0.w + 0.5000293*d0.w + -0.749573*e0.w + 0.5168709*f0.w + -0.28480902*g0.w + -0.009171731*h0.w + 0.06727333*i0.w; + m = 0.23145379*a1.x + -0.06032752*b1.x + 0.17392537*c1.x + 0.61549795*d1.x + 0.31530488*e1.x + 0.4550739*f1.x + 0.97063684*g1.x + -1.68332*h1.x + 0.11348427*i1.x; + n = -0.033892903*a1.y + 0.9738131*b1.y + -0.31819594*c1.y + 0.71122944*d1.y + -0.75284725*e1.y + 0.2765665*f1.y + -0.27231637*g1.y + 1.0744721*h1.y + 0.26208746*i1.y; + o = 0.05900849*a1.z + -0.5339448*b1.z + -0.12394775*c1.z + -0.40140063*d1.z + 0.04213861*e1.z + -0.16040552*f1.z + 0.25848332*g1.z + -0.08338297*h1.z + -0.026495855*i1.z; + p = -0.3593638*a1.w + -0.1250508*b1.w + 0.004110387*c1.w + -0.14758548*d1.w + -0.2519455*e1.w + 0.047708288*f1.w + 0.130796*g1.w + 0.01886842*h1.w + -0.032272115*i1.w; + q = -0.05126741*na0.x + -0.16950572*nb0.x + -0.23038149*nc0.x + 0.593978*nd0.x + -0.5536893*ne0.x + -0.32420158*nf0.x + -0.47213337*ng0.x + 0.17723289*nh0.x + 0.17365572*ni0.x; + r = 0.36904523*na0.y + -0.41965717*nb0.y + -0.14868285*nc0.y + -1.3712142*nd0.y + 0.40537167*ne0.y + -0.0018829257*nf0.y + 0.102555715*ng0.y + -0.5457678*nh0.y + 0.024573814*ni0.y; + s = -0.33692932*na0.z + -0.28599527*nb0.z + -0.19985573*nc0.z + -0.27231628*nd0.z + -0.044150677*ne0.z + -0.47341737*nf0.z + -0.0870376*ng0.z + -0.33944583*nh0.z + -0.07254269*ni0.z; + t = -0.009741176*na0.w + -0.31833467*nb0.w + 0.27552912*nc0.w + 0.2986059*nd0.w + 0.029016443*ne0.w + 0.045390986*nf0.w + 0.020379847*ng0.w + -0.12964877*nh0.w + -0.20720415*ni0.w; + u = 0.09684107*na1.x + -0.00019891714*nb1.x + -0.04728448*nc1.x + -0.12864496*nd1.x + 0.11396464*ne1.x + 0.047860865*nf1.x + 0.1741148*ng1.x + -0.03588619*nh1.x + 0.022001866*ni1.x; + v = 0.0137323765*na1.y + -0.20688717*nb1.y + -0.032837644*nc1.y + -0.07689021*nd1.y + -0.15632144*ne1.y + -0.19237685*nf1.y + -0.38659793*ng1.y + -0.19939652*nh1.y + 0.017652083*ni1.y; + w = 0.2849119*na1.z + 0.51690143*nb1.z + -0.12283366*nc1.z + -0.28805944*nd1.z + 0.1986708*ne1.z + 0.6683004*nf1.z + -0.20318586*ng1.z + 0.062077664*nh1.z + -0.10572113*ni1.z; + x = 0.015433912*na1.w + 0.4059864*nb1.w + 0.2935132*nc1.w + 0.3080238*nd1.w + -0.47443306*ne1.w + 0.5408017*nf1.w + 0.47627777*ng1.w + -0.21175745*nh1.w + -0.4425635*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.3695156; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-Reduce +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN10 +//!BIND LUMAN11 +//!BIND LUMAN20 +//!BIND LUMAN21 +//!BIND LUMAN30 +//!BIND LUMAN31 +//!BIND LUMAN40 +//!BIND LUMAN41 +//!BIND LUMAN50 +//!BIND LUMAN51 +//!BIND LUMAN60 +//!BIND LUMAN61 +//!BIND LUMAN70 +//!BIND LUMAN71 +//!SAVE LUMAN0 + +vec4 hook() { + vec4 a0 = LUMAN10_tex(HOOKED_pos); + vec4 a1 = LUMAN11_tex(HOOKED_pos); + vec4 b0 = LUMAN20_tex(HOOKED_pos); + vec4 b1 = LUMAN21_tex(HOOKED_pos); + vec4 c0 = LUMAN30_tex(HOOKED_pos); + vec4 c1 = LUMAN31_tex(HOOKED_pos); + vec4 d0 = LUMAN40_tex(HOOKED_pos); + vec4 d1 = LUMAN41_tex(HOOKED_pos); + vec4 e0 = LUMAN50_tex(HOOKED_pos); + vec4 e1 = LUMAN51_tex(HOOKED_pos); + vec4 f0 = LUMAN60_tex(HOOKED_pos); + vec4 f1 = LUMAN61_tex(HOOKED_pos); + vec4 g0 = LUMAN70_tex(HOOKED_pos); + vec4 g1 = LUMAN71_tex(HOOKED_pos); + vec4 na0 = -min(a0, 0); + vec4 na1 = -min(a1, 0); + vec4 nb0 = -min(b0, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc0 = -min(c0, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd0 = -min(d0, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne0 = -min(e0, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf0 = -min(f0, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng0 = -min(g0, 0); + vec4 ng1 = -min(g1, 0); + a0 = max(a0, 0); + a1 = max(a1, 0); + b0 = max(b0, 0); + b1 = max(b1, 0); + c0 = max(c0, 0); + c1 = max(c1, 0); + d0 = max(d0, 0); + d1 = max(d1, 0); + e0 = max(e0, 0); + e1 = max(e1, 0); + f0 = max(f0, 0); + f1 = max(f1, 0); + g0 = max(g0, 0); + g1 = max(g1, 0); + float o = -0.04728476*a0.x + -0.036520608*a0.y + 0.0019385766*a0.z + 0.0068700467*a0.w + -0.0012625896*a1.x + -0.010626795*a1.y + 0.00034366403*a1.z + 0.019933239*a1.w + 0.0030849315*na0.x + 0.0136760855*na0.y + -0.0057450915*na0.z + -0.0104574775*na0.w + -0.0032813277*na1.x + 0.029485198*na1.y + 0.005484502*na1.z + 0.005979312*na1.w + -0.008282406*b0.x + -0.032329977*b0.y + 0.007195994*b0.z + -0.02215956*b0.w + 0.0059099896*b1.x + -0.01843096*b1.y + 0.024378398*b1.z + -0.009847458*b1.w + 0.0021519165*nb0.x + 0.06338734*nb0.y + 0.013530091*nb0.z + 0.018921647*nb0.w + 0.013079997*nb1.x + -0.007416839*nb1.y + -0.03319205*nb1.z + 0.0070940736*nb1.w + 0.0083534485*c0.x + -0.0040059397*c0.y + 0.0010338705*c0.z + 0.023850251*c0.w + 0.019972563*c1.x + -0.013661981*c1.y + -0.002535298*c1.z + 0.00032178697*c1.w + -0.0050726496*nc0.x + 0.014284615*nc0.y + 0.0031937568*nc0.z + -0.012339685*nc0.w + -0.014393241*nc1.x + 0.016286138*nc1.y + 0.0053683654*nc1.z + 0.0267535*nc1.w + -0.009829492*d0.x + 0.017354073*d0.y + 0.002988491*d0.z + 0.0028444938*d0.w + 0.022341609*d1.x + -0.0038211492*d1.y + -0.00046226522*d1.z + -0.00056893734*d1.w + 0.01287184*nd0.x + -0.004260344*nd0.y + -0.011798954*nd0.z + -0.0010778373*nd0.w + -0.025230715*nd1.x + 0.0030024408*nd1.y + -0.0012105505*nd1.z + -0.004203998*nd1.w + -0.02869678*e0.x + 0.028832806*e0.y + -0.0018178951*e0.z + -0.004184944*e0.w + -0.034690376*e1.x + -0.004891646*e1.y + -0.0041404334*e1.z + -0.0053047556*e1.w + 0.01340061*ne0.x + 0.0033740127*ne0.y + -0.0064605293*ne0.z + 0.007029548*ne0.w + -0.012997147*ne1.x + 0.037987478*ne1.y + -0.008045281*ne1.z + 0.003939788*ne1.w + 0.0018597402*f0.x + 0.0020262436*f0.y + 0.00060788146*f0.z + 0.00069211586*f0.w + 0.0015645992*f1.x + 0.005501792*f1.y + 0.014841749*f1.z + 0.016227905*f1.w + -0.006870606*nf0.x + 0.0028365995*nf0.y + 0.000554307*nf0.z + 0.015418915*nf0.w + 0.026047971*nf1.x + 0.0062811137*nf1.y + -0.00049436744*nf1.z + -0.016887395*nf1.w + -0.007700884*g0.x + -0.006125995*g0.y + 0.0026072077*g0.z + 0.0050263735*g0.w + -0.0007808361*g1.x + -0.01214509*g1.y + -0.0124664875*g1.z + -0.0623571*g1.w + 0.0021798706*ng0.x + -0.00454209*ng0.y + -0.0033230642*ng0.z + -0.003633754*ng0.w + -0.028934926*ng1.x + 0.05962686*ng1.y + 0.0128101995*ng1.z + 0.0065336125*ng1.w + 0; + float p = -0.01706887*a0.x + -0.075055175*a0.y + 0.008531614*a0.z + 0.012812007*a0.w + 0.028967712*a1.x + 0.0006802233*a1.y + -0.023122001*a1.z + 0.004117588*a1.w + 0.0060033975*na0.x + 0.04573654*na0.y + -0.0014532027*na0.z + -0.01553144*na0.w + 0.00085815*na1.x + -0.0025215421*na1.y + 0.037993304*na1.z + 0.0043748533*na1.w + -0.016280308*b0.x + -0.026154146*b0.y + 0.011285019*b0.z + -0.010950448*b0.w + -0.008993951*b1.x + -0.008138363*b1.y + 0.0143283885*b1.z + 0.0032050752*b1.w + 0.019617861*nb0.x + 0.036108296*nb0.y + 0.0031697615*nb0.z + 0.013029574*nb0.w + 0.013052287*nb1.x + 0.010624071*nb1.y + -0.0058424054*nb1.z + -0.011529895*nb1.w + -0.029668175*c0.x + -0.0008865771*c0.y + -0.018089509*c0.z + 0.01629766*c0.w + 0.013346903*c1.x + -0.0066329846*c1.y + 0.00012357974*c1.z + 0.0067070923*c1.w + 0.015234514*nc0.x + 0.010311016*nc0.y + -0.0015783357*nc0.z + -0.004588889*nc0.w + -0.00804179*nc1.x + 0.0019117421*nc1.y + -0.004337227*nc1.z + 0.016801925*nc1.w + -0.029825747*d0.x + 0.0078127505*d0.y + -0.009640577*d0.z + -0.0048246942*d0.w + 0.04105915*d1.x + 0.0028164582*d1.y + 0.0062606526*d1.z + -0.0073074396*d1.w + 0.0031663615*nd0.x + -0.0033067295*nd0.y + 0.0003633346*nd0.z + 0.008120073*nd0.w + -0.013381999*nd1.x + -0.0029448275*nd1.y + 0.0016682927*nd1.z + 0.0017422357*nd1.w + -0.03133399*e0.x + -0.0026351928*e0.y + 0.009347191*e0.z + 0.009692576*e0.w + 0.028132373*e1.x + -0.034198917*e1.y + -0.009121166*e1.z + -0.0042066113*e1.w + 0.0018584005*ne0.x + 0.004562667*ne0.y + 0.0018780766*ne0.z + -0.0011617886*ne0.w + 0.014671292*ne1.x + -0.047582008*ne1.y + -0.011981096*ne1.z + 0.007301599*ne1.w + -0.009782136*f0.x + -0.009850503*f0.y + -0.01764285*f0.z + 0.0057299454*f0.w + -0.006322922*f1.x + -0.0014284349*f1.y + -0.01637028*f1.z + -0.016202927*f1.w + 0.010929147*nf0.x + 0.01483284*nf0.y + -0.005637644*nf0.z + 0.004375778*nf0.w + 0.014877084*nf1.x + -0.0085625835*nf1.y + 0.0009016836*nf1.z + 0.010949607*nf1.w + 0.019945359*g0.x + 0.012776777*g0.y + 9.388056e-05*g0.z + 0.011086543*g0.w + 0.0031442842*g1.x + -0.0007281356*g1.y + 0.014730445*g1.z + 0.023945043*g1.w + -0.010939084*ng0.x + -0.015295178*ng0.y + 0.007891041*ng0.z + 0.026746083*ng0.w + 0.032127682*ng1.x + -0.056322485*ng1.y + 0.0023893197*ng1.z + -0.0041469387*ng1.w + 0; + float q = 0.0052190213*a0.x + -0.036697973*a0.y + 0.0017909147*a0.z + 0.01471547*a0.w + -0.041808248*a1.x + -0.009302919*a1.y + -0.00012822033*a1.z + 0.02604467*a1.w + -0.0074887155*na0.x + 0.012221476*na0.y + -0.004066934*na0.z + -0.014296432*na0.w + 0.009378086*na1.x + 0.0050812257*na1.y + -0.00066634355*na1.z + -0.010221536*na1.w + 0.039825562*b0.x + -0.015009193*b0.y + -0.008390923*b0.z + -0.026432492*b0.w + -0.025902105*b1.x + 0.013141686*b1.y + 0.011074781*b1.z + -7.850445e-05*b1.w + -0.014900862*nb0.x + 0.0020929938*nb0.y + 0.004025759*nb0.z + 0.022637185*nb0.w + 0.018963696*nb1.x + 0.005365097*nb1.y + -0.021788068*nb1.z + -0.016199213*nb1.w + 0.006605639*c0.x + -0.00037750482*c0.y + -0.014114117*c0.z + 0.016580945*c0.w + 0.011849912*c1.x + -0.0010426794*c1.y + -0.009228553*c1.z + -0.0023927793*c1.w + 0.010821834*nc0.x + 0.0041750884*nc0.y + 0.042591974*nc0.z + -0.00041563442*nc0.w + -0.018251926*nc1.x + 0.004060685*nc1.y + 0.008161771*nc1.z + -0.056150824*nc1.w + -0.005963017*d0.x + -0.004477493*d0.y + 0.0053864145*d0.z + 0.015293112*d0.w + 0.018896958*d1.x + -0.01364045*d1.y + 0.006402596*d1.z + 0.005380181*d1.w + -0.005427749*nd0.x + -0.005545938*nd0.y + -0.010753802*nd0.z + -0.020330966*nd0.w + -0.020064725*nd1.x + 0.017465577*nd1.y + -0.009108494*nd1.z + -0.014758475*nd1.w + 0.008513857*e0.x + 0.0009961041*e0.y + -0.006098016*e0.z + -0.007048123*e0.w + 0.03902215*e1.x + 0.013202531*e1.y + 0.0114761675*e1.z + -0.0012895446*e1.w + 0.0055963704*ne0.x + 0.004024959*ne0.y + -0.013828568*ne0.z + -0.004390752*ne0.w + 0.0034489762*ne1.x + -0.0057895263*ne1.y + -0.0059244502*ne1.z + 0.0014182391*ne1.w + 0.0042083496*f0.x + -0.030192751*f0.y + 0.022458259*f0.z + -0.005110902*f0.w + 0.003181209*f1.x + -0.008455602*f1.y + 0.013294538*f1.z + 0.014039483*f1.w + -0.004838639*nf0.x + -0.017882824*nf0.y + 0.009125966*nf0.z + 0.00087110914*nf0.w + -0.014056271*nf1.x + -0.007067034*nf1.y + -0.0041026683*nf1.z + 0.0013140955*nf1.w + -0.012102768*g0.x + 0.009908834*g0.y + -0.00056007825*g0.z + -0.0019034665*g0.w + 0.0006154995*g1.x + 0.019641206*g1.y + -0.019597912*g1.z + -0.020133134*g1.w + 0.02620538*ng0.x + 0.0027179648*ng0.y + -0.0023573192*ng0.z + 0.015295984*ng0.w + -0.011871862*ng1.x + 0.036589906*ng1.y + -0.010942377*ng1.z + 0.013047896*ng1.w + 0; + float r = 0.0013240597*a0.x + -0.0525534*a0.y + 0.006428618*a0.z + 0.00910116*a0.w + 0.0010389212*a1.x + 0.004980833*a1.y + -0.0004343639*a1.z + 0.01391637*a1.w + 0.009297071*na0.x + 0.03547774*na0.y + -0.005122102*na0.z + -0.008212074*na0.w + -0.015846107*na1.x + 0.0007511969*na1.y + 0.028269917*na1.z + -0.0013784057*na1.w + 0.041298848*b0.x + -0.01730128*b0.y + 0.0015381973*b0.z + -0.022542015*b0.w + -0.023945393*b1.x + 0.020450871*b1.y + 0.010655135*b1.z + -0.0087027205*b1.w + -0.024145687*nb0.x + 0.0039176657*nb0.y + 0.0006878214*nb0.z + 0.01794849*nb0.w + 0.031762592*nb1.x + 0.0035054574*nb1.y + -0.01594689*nb1.z + 0.0011837251*nb1.w + 0.0010308131*c0.x + 0.008263548*c0.y + -0.0051403726*c0.z + 0.013458736*c0.w + 0.013812601*c1.x + -0.005903642*c1.y + 0.008680253*c1.z + -0.0020812678*c1.w + 0.00114809*nc0.x + 0.0038776158*nc0.y + 0.008751602*nc0.z + -0.007122077*nc0.w + -0.02483335*nc1.x + 0.009145055*nc1.y + 0.0054040407*nc1.z + -0.053735446*nc1.w + -0.005360682*d0.x + -0.011691867*d0.y + 0.01620561*d0.z + 0.012762638*d0.w + -0.011760973*d1.x + -0.004673657*d1.y + -0.0017164994*d1.z + 0.021724444*d1.w + 0.0031776167*nd0.x + -0.006484397*nd0.y + -0.00012294922*nd0.z + -0.009668074*nd0.w + 0.0004887767*nd1.x + -0.0038761701*nd1.y + 1.2165349e-05*nd1.z + 0.01420319*nd1.w + 0.046187103*e0.x + -0.010850962*e0.y + 0.012227887*e0.z + -0.0049160873*e0.w + -0.014404347*e1.x + 0.008824071*e1.y + 0.0033386408*e1.z + 0.0076736757*e1.w + -0.0011479551*ne0.x + -0.00048488253*ne0.y + -0.00629155*ne0.z + -0.0016700291*ne0.w + -0.01197633*ne1.x + 0.017074293*ne1.y + 0.0062331264*ne1.z + -0.007745917*ne1.w + -0.014362735*f0.x + 0.023914995*f0.y + -0.007672635*f0.z + 0.008481796*f0.w + -0.0016631298*f1.x + 0.0013799849*f1.y + -0.002389917*f1.z + -0.01502566*f1.w + 0.011418116*nf0.x + 0.0041276156*nf0.y + -0.01286134*nf0.z + -0.0044272356*nf0.w + -0.018952431*nf1.x + -0.012017917*nf1.y + -0.005450932*nf1.z + 0.024733933*nf1.w + 0.005573501*g0.x + 0.0032204753*g0.y + -0.0041492335*g0.z + -0.024271673*g0.w + -0.0014906545*g1.x + 0.007969394*g1.y + 0.009147742*g1.z + 0.060164053*g1.w + -0.01906351*ng0.x + 0.0139462*ng0.y + 0.01615183*ng0.z + -0.011862902*ng0.w + 0.006158882*ng1.x + -0.09076022*ng1.y + -0.0071068676*ng1.z + -0.0048810467*ng1.w + 0; + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Conv-Reduce +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN80 +//!BIND LUMAN81 +//!BIND LUMAN90 +//!BIND LUMAN91 +//!BIND LUMAN100 +//!BIND LUMAN101 +//!BIND LUMAN110 +//!BIND LUMAN111 +//!BIND LUMAN120 +//!BIND LUMAN121 +//!BIND LUMAN130 +//!BIND LUMAN131 +//!BIND LUMAN0 +//!SAVE LUMAN0 + +vec4 hook() { + vec4 h0 = LUMAN80_tex(HOOKED_pos); + vec4 h1 = LUMAN81_tex(HOOKED_pos); + vec4 i0 = LUMAN90_tex(HOOKED_pos); + vec4 i1 = LUMAN91_tex(HOOKED_pos); + vec4 j0 = LUMAN100_tex(HOOKED_pos); + vec4 j1 = LUMAN101_tex(HOOKED_pos); + vec4 k0 = LUMAN110_tex(HOOKED_pos); + vec4 k1 = LUMAN111_tex(HOOKED_pos); + vec4 l0 = LUMAN120_tex(HOOKED_pos); + vec4 l1 = LUMAN121_tex(HOOKED_pos); + vec4 m0 = LUMAN130_tex(HOOKED_pos); + vec4 m1 = LUMAN131_tex(HOOKED_pos); + vec4 nh0 = -min(h0, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni0 = -min(i0, 0); + vec4 ni1 = -min(i1, 0); + vec4 nj0 = -min(j0, 0); + vec4 nj1 = -min(j1, 0); + vec4 nk0 = -min(k0, 0); + vec4 nk1 = -min(k1, 0); + vec4 nl0 = -min(l0, 0); + vec4 nl1 = -min(l1, 0); + vec4 nm0 = -min(m0, 0); + vec4 nm1 = -min(m1, 0); + h0 = max(h0, 0); + h1 = max(h1, 0); + i0 = max(i0, 0); + i1 = max(i1, 0); + j0 = max(j0, 0); + j1 = max(j1, 0); + k0 = max(k0, 0); + k1 = max(k1, 0); + l0 = max(l0, 0); + l1 = max(l1, 0); + m0 = max(m0, 0); + m1 = max(m1, 0); + float o = LUMAN0_tex(HOOKED_pos).x + 0.028154768*h0.x + 0.007275039*h0.y + -0.0011438587*h0.z + -0.01108197*h0.w + -0.012890547*h1.x + -0.005964137*h1.y + -0.033666026*h1.z + 0.0054421173*h1.w + 0.0061498084*nh0.x + -0.013902076*nh0.y + 0.0029887478*nh0.z + -0.012798732*nh0.w + 0.0060229595*nh1.x + 0.0096300915*nh1.y + 0.035797298*nh1.z + -0.017965809*nh1.w + 0.013986207*i0.x + 0.029799053*i0.y + -0.015183565*i0.z + -0.0057988837*i0.w + -0.033958167*i1.x + -0.0038495238*i1.y + 0.0013773177*i1.z + 0.005184489*i1.w + 0.004508269*ni0.x + -0.002570269*ni0.y + -0.005609264*ni0.z + -0.0038743338*ni0.w + 0.004259348*ni1.x + 0.025667783*ni1.y + 0.015699951*ni1.z + -0.0020644297*ni1.w + 0.019116893*j0.x + 0.0103256805*j0.y + -0.0028200424*j0.z + -0.017563418*j0.w + 0.00054795604*j1.x + 0.008192331*j1.y + 0.003817345*j1.z + -0.021149283*j1.w + -0.0016317961*nj0.x + -0.007806229*nj0.y + 0.0077856313*nj0.z + 0.009038461*nj0.w + 0.0020147602*nj1.x + -0.04748933*nj1.y + -0.029999552*nj1.z + 0.00014385732*nj1.w + 0.004639102*k0.x + 0.009241958*k0.y + -0.016433537*k0.z + 0.00046911353*k0.w + 0.016455498*k1.x + 0.0110299755*k1.y + -0.019485874*k1.z + 0.07030569*k1.w + -0.011915996*nk0.x + -0.023589713*nk0.y + 0.040155042*nk0.z + -0.0030840805*nk0.w + 0.010477874*nk1.x + -0.0053069443*nk1.y + 0.0077385874*nk1.z + -0.00829554*nk1.w + -0.02349797*l0.x + 0.059402034*l0.y + -0.026031276*l0.z + -0.06829119*l0.w + -0.08079901*l1.x + 0.11198863*l1.y + -0.009373267*l1.z + 0.0047806143*l1.w + -0.0113643855*nl0.x + -0.042793855*nl0.y + -0.037593715*nl0.z + 0.011087656*nl0.w + 0.044267964*nl1.x + -0.010039046*nl1.y + 0.11555328*nl1.z + -0.05401579*nl1.w + 0.014701331*m0.x + -0.010931888*m0.y + 0.0013618327*m0.z + -0.01511776*m0.w + 0.07922733*m1.x + 0.14759564*m1.y + 0.05550517*m1.z + -0.014685158*m1.w + 0.022788275*nm0.x + -0.05691751*nm0.y + -0.037949562*nm0.z + -0.042652573*nm0.w + -0.081433505*nm1.x + -0.080078565*nm1.y + 0.027400292*nm1.z + 0.016504942*nm1.w + -0.008307824; + float p = LUMAN0_tex(HOOKED_pos).y + -0.012476344*h0.x + 0.00041778514*h0.y + -0.00029403862*h0.z + -0.0077522174*h0.w + -0.0007013094*h1.x + 0.009287548*h1.y + -0.0007466532*h1.z + -0.0008275674*h1.w + -0.00413496*nh0.x + 0.008134882*nh0.y + 0.02905413*nh0.z + 0.00022237566*nh0.w + -0.00015811919*nh1.x + -0.012663603*nh1.y + -0.0025063844*nh1.z + 0.005934334*nh1.w + -0.013793359*i0.x + -0.0030275956*i0.y + 0.002632738*i0.z + 0.00050856353*i0.w + 0.0070112064*i1.x + -0.0011123072*i1.y + 0.0027596478*i1.z + -0.0071405345*i1.w + -0.020791892*ni0.x + -0.012057223*ni0.y + 0.015629247*ni0.z + -0.005353237*ni0.w + 0.025932*ni1.x + -0.017513938*ni1.y + -0.0010464039*ni1.z + -0.0048822653*ni1.w + -0.0022303013*j0.x + 0.000109548884*j0.y + -0.0013899812*j0.z + -0.04997202*j0.w + 0.0039844727*j1.x + -0.012894859*j1.y + 0.019041412*j1.z + 0.008987427*j1.w + 0.002459809*nj0.x + 0.004196275*nj0.y + -0.012779132*nj0.z + 0.017411614*nj0.w + -0.00580461*nj1.x + -0.025579158*nj1.y + -0.017933184*nj1.z + 0.0084173465*nj1.w + 0.006441807*k0.x + -0.032203905*k0.y + -0.003269837*k0.z + -0.001531181*k0.w + 0.0078064846*k1.x + 0.004411259*k1.y + -0.010174944*k1.z + -0.024659745*k1.w + 0.002657509*nk0.x + -0.018960288*nk0.y + -0.002639977*nk0.z + 0.009598693*nk0.w + -0.010886198*nk1.x + -0.0015291816*nk1.y + 0.03410781*nk1.z + 0.008700974*nk1.w + 0.06478203*l0.x + -0.06352816*l0.y + 0.04763686*l0.z + -0.04645173*l0.w + -0.052127838*l1.x + -0.09600151*l1.y + 0.030204717*l1.z + 0.014505796*l1.w + -0.031888958*nl0.x + 0.09702901*nl0.y + 0.052713342*nl0.z + 0.03720871*nl0.w + -0.05015491*nl1.x + -0.012215867*nl1.y + -0.1489265*nl1.z + 0.0023754374*nl1.w + 0.0077991346*m0.x + 0.012234416*m0.y + -0.0009354508*m0.z + 0.0405293*m0.w + -0.049991522*m1.x + -0.011354246*m1.y + -0.033561453*m1.z + 0.023130419*m1.w + -0.03268312*nm0.x + -0.089838445*nm0.y + 0.039729614*nm0.z + 0.020857763*nm0.w + 0.08058377*nm1.x + 0.06261047*nm1.y + -0.044904366*nm1.z + -0.026322749*nm1.w + 0.00936794; + float q = LUMAN0_tex(HOOKED_pos).z + 0.017680038*h0.x + -0.0034014038*h0.y + 0.01325279*h0.z + 0.0066159996*h0.w + -0.009820397*h1.x + -0.009590288*h1.y + -0.0322843*h1.z + 0.0068037184*h1.w + -0.0025545594*nh0.x + -0.013663908*nh0.y + -0.04636907*nh0.z + -0.0011485704*nh0.w + 0.0030269555*nh1.x + 0.013646466*nh1.y + 0.008233854*nh1.z + -0.011760669*nh1.w + -0.020044338*i0.x + -0.017884787*i0.y + 0.0072006527*i0.z + -0.0116206575*i0.w + -0.0336928*i1.x + 0.005347091*i1.y + -0.001439835*i1.z + 0.007912345*i1.w + -0.005165678*ni0.x + -0.008851315*ni0.y + -0.01672471*ni0.z + 0.013330815*ni0.w + -0.0051708966*ni1.x + 0.010595262*ni1.y + -0.005110261*ni1.z + 0.010210765*ni1.w + 0.011963133*j0.x + 0.0015569422*j0.y + -0.00841955*j0.z + 0.022908317*j0.w + 0.0025614926*j1.x + -0.0052343216*j1.y + -0.0028602132*j1.z + 0.027029965*j1.w + -0.004171911*nj0.x + 0.003010245*nj0.y + 0.017087264*nj0.z + 0.0077778804*nj0.w + 0.0035978484*nj1.x + 0.032972984*nj1.y + 0.03604963*nj1.z + 0.0063191843*nj1.w + 0.0007370549*k0.x + -0.0026937914*k0.y + -0.006648801*k0.z + -0.050264988*k0.w + -0.0061267707*k1.x + -0.012902248*k1.y + 0.0009312556*k1.z + 0.027272638*k1.w + 0.0013918153*nk0.x + 0.0058321236*nk0.y + -0.006040759*nk0.z + 0.008355389*nk0.w + 0.00022524416*nk1.x + 0.0027963892*nk1.y + -0.0030116662*nk1.z + -0.008229986*nk1.w + -0.0019475389*l0.x + 0.004617108*l0.y + -0.007019104*l0.z + 0.050343942*l0.w + 0.07296967*l1.x + -0.011251547*l1.y + -0.0040626405*l1.z + -0.024047323*l1.w + 0.011267885*nl0.x + -0.10441765*nl0.y + -0.0043937173*nl0.z + 0.008439476*nl0.w + 0.0025544306*nl1.x + -0.0032398677*nl1.y + -0.014886633*nl1.z + 0.043766428*nl1.w + -0.06277456*m0.x + -0.0068775853*m0.y + -0.014073247*m0.z + 0.004322255*m0.w + -0.027019642*m1.x + -0.06935587*m1.y + -0.026514858*m1.z + -0.0027431983*m1.w + 0.02159222*nm0.x + 0.073561415*nm0.y + 0.058740135*nm0.z + -0.07203826*nm0.w + 0.008394*nm1.x + 0.007160604*nm1.y + 0.08396549*nm1.z + 0.0017666898*nm1.w + -0.0024531493; + float r = LUMAN0_tex(HOOKED_pos).w + -0.0012055013*h0.x + -0.003244798*h0.y + -0.004156939*h0.z + 0.0036389115*h0.w + 0.011253503*h1.x + -0.0013670821*h1.y + 0.034176*h1.z + -0.006571377*h1.w + 0.0036972067*nh0.x + 0.0053830254*nh0.y + 0.009262475*nh0.z + 0.005158738*nh0.w + -0.008013784*nh1.x + -0.0076279696*nh1.y + 0.01711645*nh1.z + 0.019142881*nh1.w + 0.013530348*i0.x + 0.0018440787*i0.y + -0.0063714003*i0.z + 0.0054069734*i0.w + 0.021637455*i1.x + 0.009726929*i1.y + 0.0011075968*i1.z + -0.018555546*i1.w + 0.010254738*ni0.x + -0.0006528478*ni0.y + 0.009930713*ni0.z + -0.0083744675*ni0.w + -0.0050841644*ni1.x + -0.010749009*ni1.y + -0.0081318915*ni1.z + -0.0018240416*ni1.w + -0.030332126*j0.x + -0.019219792*j0.y + 0.0039786496*j0.z + 0.009644819*j0.w + 0.0021590926*j1.x + -0.006202845*j1.y + -0.0093941*j1.z + -0.014618773*j1.w + -0.008474345*nj0.x + -0.0011716061*nj0.y + 0.00015310342*nj0.z + 0.00025029443*nj0.w + -0.006576327*nj1.x + 0.014994276*nj1.y + 0.01885804*nj1.z + -0.004539383*nj1.w + -0.011680012*k0.x + -0.0060392558*k0.y + 0.015494828*k0.z + 0.030411074*k0.w + -0.010484663*k1.x + -0.009604161*k1.y + -0.006873529*k1.z + -0.04552321*k1.w + 0.0061431173*nk0.x + 0.013219503*nk0.y + -0.01225356*nk0.z + 0.004476564*nk0.w + -0.0052758437*nk1.x + 0.00041394064*nk1.y + 0.020661544*nk1.z + 0.00819726*nk1.w + -0.004361188*l0.x + 0.046293*l0.y + -0.048474595*l0.z + 0.00014330888*l0.w + 0.068526275*l1.x + 0.025298426*l1.y + 0.033734288*l1.z + 0.014304559*l1.w + 0.02355298*nl0.x + 0.010139359*nl0.y + 0.040561803*nl0.z + 0.004230508*nl0.w + 0.0065057282*nl1.x + 0.020425687*nl1.y + 0.0160124*nl1.z + 0.012846417*nl1.w + 0.03170583*m0.x + -0.02589775*m0.y + 0.042881653*m0.z + -0.046655137*m0.w + 0.01694526*m1.x + -0.0362362*m1.y + -0.0042416737*m1.z + -0.005048726*m1.w + -0.0019929754*nm0.x + 0.0995872*nm0.y + -0.087547004*nm0.z + 0.11017462*nm0.w + -0.021728791*nm1.x + -0.02597225*nm1.y + -0.061021034*nm1.z + 0.0066313753*nm1.w + -0.0059383432; + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Kernel(X) +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!SAVE MMKERNEL +//!COMPONENTS 2 + +#define L_tex HOOKED_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a = L_tex(pos - d).x; + float b = L_tex(pos).x; + float c = L_tex(pos + d).x; + + return vec2(min3v(a, b, c), max3v(a, b, c)); +} + +vec4 hook() { + return vec4(minmax3(HOOKED_pos, vec2(HOOKED_pt.x, 0)), 0, 0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL)-Kernel(Y) +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND MMKERNEL +//!SAVE MMKERNEL +//!COMPONENTS 2 + +#define L_tex MMKERNEL_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a0 = L_tex(pos - d).x; + float b0 = L_tex(pos).x; + float c0 = L_tex(pos + d).x; + + float a1 = L_tex(pos - d).y; + float b1 = L_tex(pos).y; + float c1 = L_tex(pos + d).y; + + return vec2(min3v(a0, b0, c0), max3v(a1, b1, c1)); +} + +vec4 hook() { + return vec4(minmax3(HOOKED_pos, vec2(0, HOOKED_pt.y)), 0, 0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-CNN(UL) +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND MMKERNEL +//!BIND LUMAN0 +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * + +#define STRENGTH 1 //De-blur proportional strength, higher is sharper. However, it is better to tweak BLUR_CURVE instead to avoid ringing. +#define BLUR_CURVE 0.6 //De-blur power curve, lower is sharper. Good values are between 0.3 - 1. Values greater than 1 softens the image; +#define BLUR_THRESHOLD 0.1 //Value where curve kicks in, used to not de-blur already sharp edges. Only de-blur values that fall below this threshold. +#define NOISE_THRESHOLD 0.001 //Value where curve stops, used to not sharpen noise. Only de-blur values that fall above this threshold. + +vec4 hook() { + vec2 f = fract(LUMAN0_pos * LUMAN0_size); + ivec2 i = ivec2(f * vec2(2)); + float c0 = LUMAN0_tex((vec2(0.5) - f) * LUMAN0_pt + LUMAN0_pos)[i.y * 2 + i.x]; + float c = c0 * STRENGTH; + + vec2 mm = MMKERNEL_tex((vec2(0.5) - f) * MMKERNEL_pt + MMKERNEL_pos).xy; + + float t_range = BLUR_THRESHOLD - NOISE_THRESHOLD; + + float c_t = abs(c); + if (c_t > NOISE_THRESHOLD && c_t < BLUR_THRESHOLD) { + c_t = (c_t - NOISE_THRESHOLD) / t_range; + c_t = pow(c_t, BLUR_CURVE); + c_t = c_t * t_range + NOISE_THRESHOLD; + c_t = c_t * sign(c); + return vec4(clamp(c_t + HOOKED_tex(HOOKED_pos).x, MMKERNEL_tex(HOOKED_pos).x, MMKERNEL_tex(HOOKED_pos).y), HOOKED_tex(HOOKED_pos).yz, 0); + } else { + return vec4(c + HOOKED_tex(HOOKED_pos).x, HOOKED_tex(HOOKED_pos).yz, 0); + } + +} \ No newline at end of file diff --git a/.config/mpv/shaders/Anime4K_Upscale_CNN_UL_x2_Denoise.glsl b/.config/mpv/shaders/Anime4K_Upscale_CNN_UL_x2_Denoise.glsl new file mode 100644 index 0000000..7ca6197 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_CNN_UL_x2_Denoise.glsl @@ -0,0 +1,3995 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x1 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!SAVE LUMAN00 + +vec4 hook() { + vec2 dp = HOOKED_pt; + float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x; + float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x; + float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x; + float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x; + float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x; + float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x; + float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x; + float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x; + float s = 0.4235461*a + 0.6575531*b + -0.59399563*c + 0.12646995*d + 0.0016557063*e + -0.39317647*f + -0.100805044*g + -0.18261948*h + 0.05910521*i + 0.0036176245; + float t = 0.5664837*a + -0.39679363*b + -0.55953777*c + -0.32150665*d + -0.3936088*e + 0.37721646*f + -0.60057974*g + 0.4423712*h + 0.69548297*i + -0.019462775; + float u = 0.7905936*a + -0.5065353*b + -0.084980056*c + -0.72207355*d + 0.5796332*e + -0.0633104*f + -0.07915572*g + -0.02368675*h + 0.10642056*i + -0.0021129327; + float v = -0.33403575*a + 0.06273845*b + 0.15680763*c + 0.20368172*d + 0.46718*e + -0.09569307*f + -0.39521396*g + -0.6665878*h + -0.04230685*i + -0.06889051; + return vec4(s, t, u, v); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x1 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!SAVE LUMAN01 + +vec4 hook() { + vec2 dp = HOOKED_pt; + float a = HOOKED_tex(HOOKED_pos + vec2(-dp.x, -dp.y)).x; + float b = HOOKED_tex(HOOKED_pos + vec2(-dp.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos + vec2(-dp.x, dp.y)).x; + float d = HOOKED_tex(HOOKED_pos + vec2(0, -dp.y)).x; + float e = HOOKED_tex(HOOKED_pos + vec2(0, 0)).x; + float f = HOOKED_tex(HOOKED_pos + vec2(0, dp.y)).x; + float g = HOOKED_tex(HOOKED_pos + vec2(dp.x, -dp.y)).x; + float h = HOOKED_tex(HOOKED_pos + vec2(dp.x, 0)).x; + float i = HOOKED_tex(HOOKED_pos + vec2(dp.x, dp.y)).x; + float s = 0.1510581*a + -0.33944955*b + 0.41192937*c + -0.5593376*d + -0.2621178*e + 0.20262389*f + 0.4376239*g + -0.094951846*h + -0.000841184*i + 0.0716263; + float t = 0.098491974*a + -0.2960018*b + 0.3868153*c + -0.23705281*d + 0.4334124*e + -0.024507731*f + -0.015037636*g + -0.31689927*h + 0.31873173*i + 0.01124041; + float u = 0.0766584*a + 0.5304577*b + -0.26359338*c + 0.12965855*d + -0.60080534*e + 0.27573597*f + 0.18143131*g + -0.94315463*h + 0.622251*i + 0.013815441; + float v = -0.43200308*a + 0.621546*b + 0.2821124*c + -0.3073557*d + -0.23042628*e + 0.40253773*f + 0.10696488*g + -0.38473094*h + -0.1074526*i + 0.0901962; + return vec4(s, t, u, v); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN00 +//!BIND LUMAN01 +//!SAVE LUMAN10 + +#define L0_tex LUMAN00_tex +#define L1_tex LUMAN01_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.16794677*a0.x + -0.22088864*b0.x + -0.1283413*c0.x + 0.35326216*d0.x + -0.2505379*e0.x + -0.035250086*f0.x + -0.0045629917*g0.x + -0.1302178*h0.x + 0.05232725*i0.x; + float j = -0.15471086*a0.y + -0.18507053*b0.y + -0.06861622*c0.y + -0.05748694*d0.y + -0.08527682*e0.y + 0.018715255*f0.y + -0.07595843*g0.y + 0.031272165*h0.y + 0.07775021*i0.y; + float k = -0.07023514*a0.z + 0.03369304*b0.z + 0.06894717*c0.z + 0.06823276*d0.z + 0.07589299*e0.z + -0.030963233*f0.z + 0.15168014*g0.z + 0.1776977*h0.z + 0.08588179*i0.z; + float l = -0.2703367*a0.w + -0.14327289*b0.w + -0.19046761*c0.w + 0.23068829*d0.w + -0.19009744*e0.w + -0.22730376*f0.w + 0.0012157126*g0.w + 0.07482562*h0.w + 0.02318948*i0.w; + float m = 0.012120285*a1.x + -0.22524278*b1.x + -0.190054*c1.x + -0.18266979*d1.x + 0.14826988*e1.x + 0.19927607*f1.x + 0.13757557*g1.x + 0.06252144*h1.x + 0.004383658*i1.x; + float n = 0.14290562*a1.y + -0.14010437*b1.y + 0.17256533*c1.y + -0.00489204*d1.y + -0.55112445*e1.y + -0.19324628*f1.y + -0.20041578*g1.y + -0.29953226*h1.y + -0.093128584*i1.y; + float o = 0.114136316*a1.z + -0.09969167*b1.z + -0.18182483*c1.z + 0.111348055*d1.z + 0.19055453*e1.z + -0.023537107*f1.z + 0.026970962*g1.z + 0.053700164*h1.z + -0.090746425*i1.z; + float p = 0.18388204*a1.w + 0.1076922*b1.w + -0.10952749*c1.w + 0.047915682*d1.w + -0.04908849*e1.w + 0.13134465*f1.w + -0.010922534*g1.w + 0.093240745*h1.w + 0.10995429*i1.w; + float q = -0.13068312*na0.x + 0.37798575*nb0.x + 0.07315507*nc0.x + -0.30374587*nd0.x + -0.027977318*ne0.x + 0.052229732*nf0.x + 0.22509663*ng0.x + 0.19470495*nh0.x + -0.023475593*ni0.x; + float r = 0.17921193*na0.y + 0.15262721*nb0.y + 0.09348953*nc0.y + 0.08629486*nd0.y + 0.058778033*ne0.y + -0.049769867*nf0.y + 0.04349436*ng0.y + -0.019163493*nh0.y + -0.085440144*ni0.y; + float s = -0.24993967*na0.z + -0.38155112*nb0.z + -0.06854216*nc0.z + -0.19560374*nd0.z + -0.13779017*ne0.z + -0.04520518*nf0.z + -0.2073175*ng0.z + 0.037903383*nh0.z + -0.08490066*ni0.z; + float t = -0.053389367*na0.w + 0.077983424*nb0.w + 0.1866747*nc0.w + 0.06767585*nd0.w + 0.29341182*ne0.w + 0.015612053*nf0.w + -0.048845258*ng0.w + -0.06773192*nh0.w + 0.06828569*ni0.w; + float u = -0.03143063*na1.x + 0.25195265*nb1.x + 0.2465402*nc1.x + 0.25821936*nd1.x + -0.21205051*ne1.x + -0.3031046*nf1.x + -0.064663626*ng1.x + -0.14141451*nh1.x + -0.049167875*ni1.x; + float v = -0.22485651*na1.y + -0.030627564*nb1.y + -0.14952712*nc1.y + 0.07637464*nd1.y + 0.8533537*ne1.y + 0.10979076*nf1.y + 0.25307453*ng1.y + 0.36255696*nh1.y + 0.18161052*ni1.y; + float w = 0.18741444*na1.z + 0.120343775*nb1.z + 0.17920719*nc1.z + 0.008429135*nd1.z + -0.18602121*ne1.z + 0.069860265*nf1.z + -0.07423891*ng1.z + -0.028029565*nh1.z + 0.0014492195*ni1.z; + float x = -0.12813547*na1.w + -0.1251407*nb1.w + 0.10064979*nc1.w + -0.06593215*nd1.w + 0.08266265*ne1.w + -0.09072239*nf1.w + -0.03712963*ng1.w + -0.0380577*nh1.w + -0.1358046*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.08555427; + i = -0.0106605785*a0.x + -0.02346621*b0.x + -0.025302485*c0.x + 0.42064977*d0.x + -0.3165855*e0.x + 0.1474086*f0.x + 0.002056423*g0.x + -0.3396167*h0.x + -0.20908986*i0.x; + j = 0.085144304*a0.y + -0.025604391*b0.y + -0.09882538*c0.y + -0.16107202*d0.y + -0.0032053476*e0.y + 0.07671078*f0.y + -0.121254414*g0.y + -0.05503632*h0.y + 0.16113484*i0.y; + k = -0.04301299*a0.z + 0.21927366*b0.z + 0.09128585*c0.z + -0.14557154*d0.z + -0.33144742*e0.z + 0.69390583*f0.z + 0.18670692*g0.z + 0.4288587*h0.z + 0.25589642*i0.z; + l = 0.014806381*a0.w + -0.30577102*b0.w + -0.26680395*c0.w + 0.6580376*d0.w + 0.13689107*e0.w + 0.26344156*f0.w + 0.02003577*g0.w + 0.24800275*h0.w + 0.11940925*i0.w; + m = -0.17510436*a1.x + -0.036337443*b1.x + -0.1621788*c1.x + 0.24176209*d1.x + 0.27377644*e1.x + 0.35164487*f1.x + -0.06084558*g1.x + 0.13541429*h1.x + 0.08383871*i1.x; + n = -0.032581344*a1.y + -0.33266672*b1.y + -0.1254758*c1.y + 0.070055634*d1.y + -0.31106472*e1.y + -0.16749112*f1.y + 0.14661339*g1.y + -0.061245497*h1.y + -0.2153471*i1.y; + o = -0.09507444*a1.z + 0.1633995*b1.z + 0.01893883*c1.z + 0.017567528*d1.z + 0.04895553*e1.z + -0.10323042*f1.z + -0.005264178*g1.z + -0.19580299*h1.z + -0.04270323*i1.z; + p = -0.010821707*a1.w + 0.27088144*b1.w + 0.08854837*c1.w + 0.07468544*d1.w + -0.15011162*e1.w + 0.2767248*f1.w + -0.10650934*g1.w + 0.11232344*h1.w + -0.13245808*i1.w; + q = -0.07898428*na0.x + 0.033453744*nb0.x + 0.17228787*nc0.x + -0.28074503*nd0.x + 0.2055687*ne0.x + -0.12419395*nf0.x + 0.099752426*ng0.x + 0.47015744*nh0.x + 0.18449554*ni0.x; + r = -0.17434135*na0.y + 0.07637648*nb0.y + 0.110988095*nc0.y + 0.10198229*nd0.y + 0.095133536*ne0.y + -0.12944523*nf0.y + 0.113437034*ng0.y + 0.02337726*nh0.y + -0.16349663*ni0.y; + s = 0.13760604*na0.z + -0.19821507*nb0.z + -0.11951691*nc0.z + 0.22723325*nd0.z + 0.51187444*ne0.z + -0.001953517*nf0.z + -0.23731533*ng0.z + -0.52571917*nh0.z + 0.028138466*ni0.z; + t = 0.017788691*na0.w + 0.11692077*nb0.w + 0.04552704*nc0.w + -0.11863895*nd0.w + 0.7263193*ne0.w + 0.077140756*nf0.w + 0.006894849*ng0.w + -0.08404261*nh0.w + -0.15646511*ni0.w; + u = 0.1712769*na1.x + 0.15116447*nb1.x + 0.124495275*nc1.x + -0.17404018*nd1.x + -0.35752162*ne1.x + -0.30307415*nf1.x + 0.1124137*ng1.x + -0.20265274*nh1.x + -0.17206767*ni1.x; + v = 0.06449334*na1.y + 0.2783839*nb1.y + 0.029395351*nc1.y + -0.4473567*nd1.y + 0.37940356*ne1.y + 0.24877474*nf1.y + -0.26481625*ng1.y + -0.044119053*nh1.y + 0.34096232*ni1.y; + w = 0.13477752*na1.z + -0.013630374*nb1.z + -0.13816717*nc1.z + 0.09557402*nd1.z + -0.0038175562*ne1.z + 0.14273618*nf1.z + 0.018297989*ng1.z + 0.27939084*nh1.z + 0.12599975*ni1.z; + x = -0.071283296*na1.w + -0.20715164*nb1.w + -0.13858369*nc1.w + -0.029546877*nd1.w + 0.063970774*ne1.w + -0.18851285*nf1.w + 0.10951296*ng1.w + 0.014773112*nh1.w + 0.12096485*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.13808772; + i = 0.08543486*a0.x + -0.06339528*b0.x + 0.08643516*c0.x + -0.16561024*d0.x + -0.124620974*e0.x + 0.5155396*f0.x + -0.36339906*g0.x + 0.22400329*h0.x + -0.14128657*i0.x; + j = -0.29701614*a0.y + -0.079046*b0.y + 0.025680672*c0.y + -0.40005872*d0.y + -0.0026881134*e0.y + 0.12396565*f0.y + 0.28015617*g0.y + 0.19931334*h0.y + -0.13053301*i0.y; + k = -0.018083062*a0.z + -0.2995659*b0.z + 0.12293853*c0.z + 0.39782542*d0.z + -0.08047593*e0.z + -0.00798882*f0.z + 0.19066185*g0.z + -0.4197668*h0.z + 0.41353148*i0.z; + l = 0.2531281*a0.w + 0.20558453*b0.w + 0.12816961*c0.w + -0.40887693*d0.w + -0.75598484*e0.w + 0.67733926*f0.w + -0.17545569*g0.w + -0.09809934*h0.w + 0.38785964*i0.w; + m = 0.32967457*a1.x + 0.037468296*b1.x + -0.07958115*c1.x + 0.22996488*d1.x + 0.29492065*e1.x + -0.029338673*f1.x + 0.014237537*g1.x + 0.18754248*h1.x + -0.08127657*i1.x; + n = 0.040210586*a1.y + 0.34547487*b1.y + 0.27756944*c1.y + -0.11648041*d1.y + -0.66630447*e1.y + 0.3621801*f1.y + -0.52747697*g1.y + 0.108236276*h1.y + -0.23471309*i1.y; + o = 0.30032736*a1.z + -0.18578514*b1.z + -0.0770958*c1.z + -0.34115535*d1.z + 0.07363463*e1.z + -0.058073323*f1.z + -0.045252394*g1.z + 0.12356456*h1.z + 0.28394222*i1.z; + p = -0.116601326*a1.w + -0.14359862*b1.w + -0.08438345*c1.w + 0.13927905*d1.w + 0.37232953*e1.w + 0.3016352*f1.w + 0.469494*g1.w + -0.31357527*h1.w + 0.28242698*i1.w; + q = -0.09050382*na0.x + -0.012025754*nb0.x + 0.11904028*nc0.x + 0.22277842*nd0.x + 0.511553*ne0.x + 0.0725231*nf0.x + 0.07063996*ng0.x + -0.13095577*nh0.x + -0.03559222*ni0.x; + r = 0.32554454*na0.y + 0.057850234*nb0.y + -0.09855525*nc0.y + 0.50782645*nd0.y + -0.063144326*ne0.y + -0.036865633*nf0.y + -0.28869686*ng0.y + -0.18935527*nh0.y + 0.13458657*ni0.y; + s = -0.09230108*na0.z + 0.42308152*nb0.z + 0.39727864*nc0.z + -0.5248546*nd0.z + -0.28623953*ne0.z + 0.57086474*nf0.z + -0.32816634*ng0.z + -0.330851*nh0.z + -0.91903055*ni0.z; + t = -0.20520322*na0.w + 0.012853672*nb0.w + -0.018758446*nc0.w + -0.008448064*nd0.w + 0.46334872*ne0.w + 0.19974*nf0.w + 0.10137746*ng0.w + -0.16349177*nh0.w + -0.09975543*ni0.w; + u = -0.37509602*na1.x + 0.0064346674*nb1.x + -0.07314594*nc1.x + -0.29104117*nd1.x + -0.3105957*ne1.x + -0.31734526*nf1.x + -0.28809702*ng1.x + -0.05734701*nh1.x + -0.08137321*ni1.x; + v = 0.22592704*na1.y + -0.008293352*nb1.y + -0.13925971*nc1.y + 0.48756573*nd1.y + 0.7549005*ne1.y + -0.39747772*nf1.y + 0.17185897*ng1.y + 0.06366977*nh1.y + -0.28335187*ni1.y; + w = -0.59168625*na1.z + 0.101777606*nb1.z + 0.4479166*nc1.z + 0.115051255*nd1.z + -0.1799079*ne1.z + 0.5368214*nf1.z + -0.16581482*ng1.z + -0.18885252*nh1.z + -0.07730688*ni1.z; + x = 0.12536506*na1.w + 0.093024015*nb1.w + 0.11894012*nc1.w + -0.09191671*nd1.w + 0.024672559*ne1.w + -0.293548*nf1.w + -0.40645325*ng1.w + 0.33320007*nh1.w + -0.27361652*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.18878956; + i = -0.17554133*a0.x + 0.08770128*b0.x + 0.1130292*c0.x + -0.11718522*d0.x + 0.34429708*e0.x + 0.11860599*f0.x + 0.061209697*g0.x + -0.03596431*h0.x + -0.15006644*i0.x; + j = 0.34442133*a0.y + 0.18410078*b0.y + 0.10553784*c0.y + 0.083126865*d0.y + 0.26996818*e0.y + -0.057579536*f0.y + 0.08065425*g0.y + -0.038600635*h0.y + 0.1337284*i0.y; + k = -0.07592328*a0.z + -0.10521636*b0.z + 0.047978353*c0.z + -0.18327633*d0.z + 0.8187111*e0.z + 0.1053916*f0.z + -0.051000945*g0.z + 0.032780662*h0.z + -0.24659613*i0.z; + l = 0.11310651*a0.w + -0.72847044*b0.w + 0.14607516*c0.w + -0.0545269*d0.w + 0.33854204*e0.w + 0.477869*f0.w + 0.03370307*g0.w + 0.18669982*h0.w + 0.087542474*i0.w; + m = 0.026408873*a1.x + 0.21242142*b1.x + 0.10273795*c1.x + 0.12721732*d1.x + 0.3051287*e1.x + -0.10380253*f1.x + 0.21183428*g1.x + 0.011781035*h1.x + -0.157168*i1.x; + n = -0.31023848*a1.y + -0.12418054*b1.y + 0.06871101*c1.y + -0.055353377*d1.y + 0.29283622*e1.y + 0.0629144*f1.y + 0.10536345*g1.y + 0.005131209*h1.y + 0.01050696*i1.y; + o = 0.21290451*a1.z + 0.13438411*b1.z + -0.18430226*c1.z + 0.043690648*d1.z + -0.083583824*e1.z + -0.08178097*f1.z + 0.009168952*g1.z + -0.093769684*h1.z + -0.074894816*i1.z; + p = -0.009761168*a1.w + 0.13623533*b1.w + 0.19300689*c1.w + -0.18730181*d1.w + -0.03478467*e1.w + 0.302313*f1.w + 0.024195945*g1.w + -0.056365933*h1.w + 0.083279416*i1.w; + q = 0.094621725*na0.x + -0.21166989*nb0.x + -0.13730079*nc0.x + 0.019476462*nd0.x + -0.32468584*ne0.x + -0.10870433*nf0.x + 0.06361098*ng0.x + 0.22786614*nh0.x + 0.016555896*ni0.x; + r = -0.45527184*na0.y + -0.1840554*nb0.y + -0.11216771*nc0.y + -0.11387475*nd0.y + -0.28390703*ne0.y + 0.10614178*nf0.y + -0.086305596*ng0.y + 0.01007403*nh0.y + -0.086720556*ni0.y; + s = 0.12321956*na0.z + 0.16506156*nb0.z + -0.03085585*nc0.z + 0.17304778*nd0.z + -0.41865125*ne0.z + -0.25131994*nf0.z + 0.015150618*ng0.z + 0.038200963*nh0.z + 0.21354003*ni0.z; + t = -0.03856252*na0.w + 0.5171248*nb0.w + -0.16520032*nc0.w + 0.2699771*nd0.w + 0.02709677*ne0.w + -0.1288841*nf0.w + -0.007368464*ng0.w + 0.039352447*nh0.w + -0.06819223*ni0.w; + u = -0.09914638*na1.x + -0.2402648*nb1.x + -0.044966992*nc1.x + -0.06250364*nd1.x + -0.43965408*ne1.x + 0.035948656*nf1.x + -0.19700348*ng1.x + 0.027183928*nh1.x + 0.12255059*ni1.x; + v = 0.035281736*na1.y + -0.12445711*nb1.y + -0.11005861*nc1.y + -0.3244261*nd1.y + -0.03600395*ne1.y + 0.102474555*nf1.y + 0.0433403*ng1.y + -0.16804694*nh1.y + 0.1529647*ni1.y; + w = 0.0015002415*na1.z + 0.01684284*nb1.z + 0.19736712*nc1.z + -0.033935662*nd1.z + 0.20540716*ne1.z + 0.025974788*nf1.z + 0.111514784*ng1.z + 0.13752428*nh1.z + 0.011327623*ni1.z; + x = -0.14010908*na1.w + -0.07261111*nb1.w + -0.25126088*nc1.w + 0.1697692*nd1.w + -0.020014642*ne1.w + -0.105643414*nf1.w + 0.016477138*ng1.w + 0.03148673*nh1.w + -0.13972881*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.104817756; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN00 +//!BIND LUMAN01 +//!SAVE LUMAN11 + +#define L0_tex LUMAN00_tex +#define L1_tex LUMAN01_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.08353107*a0.x + 0.28736016*b0.x + 0.06043241*c0.x + 0.3756145*d0.x + -0.21849196*e0.x + -0.049966827*f0.x + 0.06684435*g0.x + -0.31316793*h0.x + -0.14380705*i0.x; + float j = 0.17063656*a0.y + -0.062669165*b0.y + 0.08566759*c0.y + 0.02365466*d0.y + 0.04036862*e0.y + -0.05693226*f0.y + -0.03300663*g0.y + -0.24487613*h0.y + 0.21347883*i0.y; + float k = -0.21652856*a0.z + -0.19351771*b0.z + -0.2467005*c0.z + -0.73068035*d0.z + -0.42616466*e0.z + -0.12823705*f0.z + -0.075517796*g0.z + 0.3647414*h0.z + 0.26326218*i0.z; + float l = 0.4126963*a0.w + 0.2086867*b0.w + 0.5041759*c0.w + -0.243043*d0.w + -0.32740736*e0.w + 0.0022745235*f0.w + 0.19319366*g0.w + 0.049629156*h0.w + -0.12715256*i0.w; + float m = -0.14272708*a1.x + -0.099596515*b1.x + -0.4202246*c1.x + 0.18351686*d1.x + -0.11177526*e1.x + -0.06569924*f1.x + 0.031184534*g1.x + 0.121226974*h1.x + -0.05880319*i1.x; + float n = 0.04794056*a1.y + -0.095302925*b1.y + 0.039960325*c1.y + 0.26515916*d1.y + -0.18812327*e1.y + -0.018485704*f1.y + 0.19372816*g1.y + -0.15000892*h1.y + -0.0651102*i1.y; + float o = 0.03567814*a1.z + 0.38550282*b1.z + -0.23689032*c1.z + 0.03756719*d1.z + 0.5521864*e1.z + 0.045050826*f1.z + -0.07008592*g1.z + -0.29005158*h1.z + -0.18711509*i1.z; + float p = -0.1770443*a1.w + 0.13982445*b1.w + 0.40291548*c1.w + -0.10975701*d1.w + 0.3894214*e1.w + 0.56349623*f1.w + 0.22294973*g1.w + 0.102117985*h1.w + -0.05722196*i1.w; + float q = -0.053553056*na0.x + -0.19602972*nb0.x + -0.049908735*nc0.x + -0.4098372*nd0.x + 0.1553083*ne0.x + -0.13798437*nf0.x + 0.020964932*ng0.x + 0.21640925*nh0.x + 0.17697215*ni0.x; + float r = -0.17972371*na0.y + 0.11094383*nb0.y + -0.07758381*nc0.y + -0.06468317*nd0.y + 0.054030456*ne0.y + 0.08155672*nf0.y + 0.06632324*ng0.y + 0.20341587*nh0.y + -0.21935543*ni0.y; + float s = 0.10066643*na0.z + -0.09760212*nb0.z + -0.21011324*nc0.z + 0.5705846*nd0.z + 0.34045073*ne0.z + -0.34776747*nf0.z + 0.05816446*ng0.z + 0.15500267*nh0.z + -0.06549823*ni0.z; + float t = -0.113237955*na0.w + 0.07596917*nb0.w + -0.2689601*nc0.w + 0.06720722*nd0.w + 0.24187401*ne0.w + 0.06495155*nf0.w + -0.10120916*ng0.w + -0.015051687*nh0.w + 0.08580574*ni0.w; + float u = 0.18368104*na1.x + 0.0067408364*nb1.x + 0.5401991*nc1.x + -0.28887546*nd1.x + 0.15580553*ne1.x + 0.13127*nf1.x + -0.02988204*ng1.x + -0.09457715*nh1.x + 0.031352654*ni1.x; + float v = -0.16335279*na1.y + 0.121307105*nb1.y + -0.15070735*nc1.y + -0.066209905*nd1.y + 0.47985828*ne1.y + 0.23986837*nf1.y + -0.1174723*ng1.y + 0.10828484*nh1.y + 0.18975943*ni1.y; + float w = 0.16884287*na1.z + -0.120039694*nb1.z + 0.15371844*nc1.z + -0.15169354*nd1.z + -0.43843856*ne1.z + -0.08414658*nf1.z + 0.09939408*ng1.z + 0.2920639*nh1.z + 0.14563619*ni1.z; + float x = 0.19525896*na1.w + -0.07340261*nb1.w + -0.40502468*nc1.w + 0.12006268*nd1.w + -0.44480872*ne1.w + -0.39131236*nf1.w + -0.32856262*ng1.w + -0.12405321*nh1.w + -0.011340729*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.11855532; + i = 0.27427614*a0.x + 0.06942368*b0.x + -0.34394878*c0.x + 0.015660247*d0.x + -0.07202456*e0.x + 0.17674516*f0.x + -0.37723058*g0.x + -0.06464191*h0.x + 0.29758364*i0.x; + j = -0.5557797*a0.y + -0.5094059*b0.y + -0.05587837*c0.y + -0.35446486*d0.y + 0.030154578*e0.y + 0.296504*f0.y + -0.07820415*g0.y + 0.2622216*h0.y + 0.022169966*i0.y; + k = 0.69592035*a0.z + 0.40577736*b0.z + 0.27399254*c0.z + 0.69817305*d0.z + 0.34048787*e0.z + -0.7022997*f0.z + 0.19809163*g0.z + -0.31440312*h0.z + -0.2537085*i0.z; + l = 0.20212564*a0.w + 0.7220086*b0.w + 0.002391091*c0.w + 0.29846865*d0.w + -0.20860793*e0.w + 0.19008926*f0.w + 0.36558378*g0.w + -0.1705263*h0.w + 0.36423033*i0.w; + m = -0.24980646*a1.x + -0.33889583*b1.x + -0.8488761*c1.x + 0.06502713*d1.x + -0.0033379206*e1.x + 0.62711746*f1.x + 0.111587234*g1.x + 0.47429568*h1.x + 0.13620043*i1.x; + n = 0.02041788*a1.y + 0.25287375*b1.y + 0.22821611*c1.y + -0.019414136*d1.y + -0.45490053*e1.y + 0.15264598*f1.y + -0.342234*g1.y + 0.04632452*h1.y + 0.019633954*i1.y; + o = 0.00159017*a1.z + -0.2284143*b1.z + -0.23702304*c1.z + -0.10418077*d1.z + -0.29623184*e1.z + -0.24214037*f1.z + 0.1672665*g1.z + 0.27197334*h1.z + 0.053051285*i1.z; + p = 0.41270512*a1.w + 0.0030170777*b1.w + -0.2195157*c1.w + -0.25108942*d1.w + 0.05822611*e1.w + 0.22943507*f1.w + -0.21789554*g1.w + -0.24804015*h1.w + 0.1326624*i1.w; + q = -0.13518767*na0.x + -0.097464286*nb0.x + 0.3898497*nc0.x + 0.08496002*nd0.x + 0.34897512*ne0.x + -0.11182062*nf0.x + 0.46268395*ng0.x + 0.027733872*nh0.x + -0.42308947*ni0.x; + r = 0.56646675*na0.y + 0.5082163*nb0.y + 0.009196356*nc0.y + 0.38347927*nd0.y + -0.033876*ne0.y + -0.2798138*nf0.y + 0.08064149*ng0.y + -0.30561203*nh0.y + -0.028080948*ni0.y; + s = -0.3202713*na0.z + 0.20401385*nb0.z + 0.26491576*nc0.z + -0.41670644*nd0.z + 0.30387732*ne0.z + 0.46047074*nf0.z + -0.2244506*ng0.z + -0.114643514*nh0.z + -0.20456*ni0.z; + t = 0.08074196*na0.w + -0.39162296*nb0.w + 0.06135529*nc0.w + -0.22237217*nd0.w + 0.5211155*ne0.w + 0.089273445*nf0.w + -0.24561495*ng0.w + 0.20437199*nh0.w + -0.30850124*ni0.w; + u = 0.3417056*na1.x + 0.49182546*nb1.x + 0.7867592*nc1.x + 0.11405216*nd1.x + -0.195181*ne1.x + -0.45771012*nf1.x + -0.081563495*ng1.x + -0.5275772*nh1.x + -0.07899438*ni1.x; + v = -0.2075087*na1.y + -0.83008796*nb1.y + -0.24807826*nc1.y + 0.45271036*nd1.y + 0.46465632*ne1.y + -0.11798111*nf1.y + 0.35069796*ng1.y + -0.5051347*nh1.y + -0.07678797*ni1.y; + w = -0.048510555*na1.z + 0.118899114*nb1.z + 0.3113541*nc1.z + 0.20021926*nd1.z + 0.34808552*ne1.z + 0.21785673*nf1.z + -0.07644035*ng1.z + -0.27205282*nh1.z + -0.09634399*ni1.z; + x = -0.34171695*na1.w + 0.09623902*nb1.w + 0.15177064*nc1.w + 0.23439713*nd1.w + 0.005359915*ne1.w + -0.16126914*nf1.w + 0.2436929*ng1.w + 0.2693655*nh1.w + -0.10080733*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.05893463; + i = 0.004456483*a0.x + -0.061023016*b0.x + 0.102604285*c0.x + 0.25974935*d0.x + -0.20572382*e0.x + 0.061911833*f0.x + -0.006440185*g0.x + -0.37464473*h0.x + -0.3729*i0.x; + j = -0.024366496*a0.y + -0.26316297*b0.y + 0.0054109367*c0.y + -0.07425994*d0.y + 0.06885401*e0.y + -0.08147861*f0.y + -0.13024221*g0.y + -0.080083355*h0.y + 0.25079504*i0.y; + k = 0.2073608*a0.z + 0.12756912*b0.z + -0.11947837*c0.z + 0.28547776*d0.z + -0.061251625*e0.z + -0.59111315*f0.z + 0.117697865*g0.z + 0.026501577*h0.z + 0.0762802*i0.z; + l = 0.1538773*a0.w + 0.40656957*b0.w + 0.22812115*c0.w + 0.18197793*d0.w + -0.23915672*e0.w + -0.23416357*f0.w + 0.2286656*g0.w + 0.286252*h0.w + 0.14785512*i0.w; + m = 0.11419092*a1.x + -0.0821377*b1.x + -0.34094295*c1.x + -0.07735428*d1.x + 0.24763437*e1.x + 0.07993605*f1.x + -0.15961358*g1.x + 0.25929016*h1.x + 0.03193567*i1.x; + n = -0.19794407*a1.y + -0.06941228*b1.y + 0.34876403*c1.y + 0.061097983*d1.y + -0.46923164*e1.y + 0.27673528*f1.y + -0.024302537*g1.y + 0.024407104*h1.y + 0.21435632*i1.y; + o = 0.058641165*a1.z + 0.0221897*b1.z + -0.3210071*c1.z + -0.27893165*d1.z + -0.067594975*e1.z + -0.06148374*f1.z + -0.08762428*g1.z + -0.4118411*h1.z + -0.35298195*i1.z; + p = 0.25539416*a1.w + -0.22562106*b1.w + -0.04863095*c1.w + -0.21510895*d1.w + -0.015554503*e1.w + 0.021378404*f1.w + -0.18449734*g1.w + -0.33694598*h1.w + -0.07462068*i1.w; + q = 0.060614746*na0.x + 0.058145523*nb0.x + -0.1876711*nc0.x + -0.2275418*nd0.x + 0.5676264*ne0.x + 0.03986006*nf0.x + 0.078224525*ng0.x + 0.32184383*nh0.x + 0.27731317*ni0.x; + r = 0.10075902*na0.y + 0.27120215*nb0.y + 0.010115167*nc0.y + 0.17081438*nd0.y + -0.07218907*ne0.y + 0.1359228*nf0.y + 0.15724167*ng0.y + 0.18022752*nh0.y + -0.22473678*ni0.y; + s = -0.24924998*na0.z + -0.09653091*nb0.z + 0.09842852*nc0.z + -0.22506349*nd0.z + -0.21285143*ne0.z + -0.23974708*nf0.z + -0.022973223*ng0.z + -0.12828088*nh0.z + -0.43499368*ni0.z; + t = 0.068837054*na0.w + -0.10233581*nb0.w + -0.023833485*nc0.w + -0.013764958*nd0.w + 0.11303134*ne0.w + -0.10601694*nf0.w + -0.07437375*ng0.w + -0.12237613*nh0.w + -0.08480185*ni0.w; + u = -0.09819356*na1.x + -0.018653207*nb1.x + 0.3962384*nc1.x + 0.11719601*nd1.x + -0.12368154*ne1.x + -0.1337247*nf1.x + 0.16457178*ng1.x + -0.1798564*nh1.x + 0.12946187*ni1.x; + v = 0.14447375*na1.y + -0.18453734*nb1.y + -0.2785266*nc1.y + 0.261676*nd1.y + 0.43455735*ne1.y + -0.2976331*nf1.y + 0.44750854*ng1.y + -0.1517372*nh1.y + -0.16358607*ni1.y; + w = 0.11880657*na1.z + -0.07722677*nb1.z + 0.5107066*nc1.z + 0.43152595*nd1.z + 0.04887373*ne1.z + 0.08405834*nf1.z + 0.09773806*ng1.z + 0.3092558*nh1.z + 0.31471527*ni1.z; + x = -0.21641015*na1.w + 0.267585*nb1.w + 0.015544073*nc1.w + 0.26414764*nd1.w + 0.17490867*ne1.w + -0.10566998*nf1.w + 0.13985798*ng1.w + 0.08020897*nh1.w + 0.1375628*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.13600975; + i = -0.077056326*a0.x + 0.056493748*b0.x + 0.050523862*c0.x + 0.025413549*d0.x + 0.05170877*e0.x + -0.06227649*f0.x + 0.023418976*g0.x + -0.26896232*h0.x + -0.19462766*i0.x; + j = -0.092321195*a0.y + 0.28203773*b0.y + -0.28923175*c0.y + 0.26040012*d0.y + 0.18827046*e0.y + -0.08830989*f0.y + -0.1735084*g0.y + -0.20724946*h0.y + 0.050195698*i0.y; + k = 0.18182454*a0.z + 0.1262915*b0.z + 0.32059082*c0.z + -0.09649511*d0.z + -0.05475635*e0.z + -0.08667132*f0.z + -0.082669996*g0.z + 0.013742665*h0.z + 0.28168282*i0.z; + l = 0.005121575*a0.w + 0.08816379*b0.w + 0.023842517*c0.w + 0.1915638*d0.w + -0.18842512*e0.w + 0.3029226*f0.w + -0.00450142*g0.w + 0.061655905*h0.w + -0.17317536*i0.w; + m = 0.05655378*a1.x + 0.045647632*b1.x + -0.23208252*c1.x + 0.1689679*d1.x + -0.06055369*e1.x + -0.010835976*f1.x + -0.14401563*g1.x + 0.24879168*h1.x + -0.059451584*i1.x; + n = -0.06845674*a1.y + 0.083448485*b1.y + 0.06342751*c1.y + 0.19503595*d1.y + -0.24631637*e1.y + 0.024991803*f1.y + 0.5379571*g1.y + 0.2981694*h1.y + -0.18874584*i1.y; + o = -0.23313029*a1.z + -0.12869471*b1.z + 0.2058894*c1.z + 0.056324985*d1.z + 0.5014833*e1.z + -0.14272012*f1.z + 0.04597481*g1.z + -0.07321104*h1.z + 0.036346544*i1.z; + p = -0.20939653*a1.w + 0.039054863*b1.w + -0.009903461*c1.w + 0.039352827*d1.w + -0.3272497*e1.w + 0.16723883*f1.w + -0.22277309*g1.w + -0.15519314*h1.w + 0.106375985*i1.w; + q = 0.15840702*na0.x + -0.012343732*nb0.x + -0.12434003*nc0.x + -0.050945174*nd0.x + 0.075114325*ne0.x + -0.08470733*nf0.x + -0.14440396*ng0.x + 0.28335252*nh0.x + 0.22015902*ni0.x; + r = 0.1405543*na0.y + -0.32733896*nb0.y + 0.325749*nc0.y + -0.32933486*nd0.y + -0.24138382*ne0.y + 0.09864685*nf0.y + 0.16631408*ng0.y + 0.23151954*nh0.y + -0.018035514*ni0.y; + s = -0.005933659*na0.z + -0.036268864*nb0.z + -0.2393363*nc0.z + 0.25365856*nd0.z + 0.27714846*ne0.z + 0.027788207*nf0.z + 0.105633155*ng0.z + -0.023569448*nh0.z + -0.11092802*ni0.z; + t = -0.057706855*na0.w + -0.04314378*nb0.w + 0.1376379*nc0.w + -0.29201*nd0.w + -0.031740203*ne0.w + -0.21162407*nf0.w + -0.04941525*ng0.w + -0.09689754*nh0.w + 0.17491642*ni0.w; + u = -0.045997567*na1.x + -0.004313898*nb1.x + 0.26557937*nc1.x + -0.10115272*nd1.x + 0.1497043*ne1.x + 0.0030241008*nf1.x + 0.22281039*ng1.x + -0.16505872*nh1.x + 0.17553228*ni1.x; + v = 0.0372862*na1.y + -0.036076758*nb1.y + -0.1271902*nc1.y + -0.10472729*nd1.y + 0.5514008*ne1.y + -0.08602682*nf1.y + -0.39617947*ng1.y + -0.058530744*nh1.y + 0.20215146*ni1.y; + w = 0.060919374*na1.z + -0.0063310824*nb1.z + -0.24551807*nc1.z + -0.18111996*nd1.z + -0.42163506*ne1.z + -0.0802586*nf1.z + -0.004400816*ng1.z + 0.06707879*nh1.z + -0.07458748*ni1.z; + x = 0.23475559*na1.w + 0.008814685*nb1.w + 0.053149946*nc1.w + -0.039289605*nd1.w + 0.22436316*ne1.w + -0.18004929*nf1.w + 0.3210669*ng1.w + 0.16655089*nh1.w + -0.032627415*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.092078924; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN10 +//!BIND LUMAN11 +//!SAVE LUMAN20 + +#define L0_tex LUMAN10_tex +#define L1_tex LUMAN11_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.015673656*a0.x + -0.02099352*b0.x + 0.05503547*c0.x + -0.00073340687*d0.x + -0.121280506*e0.x + 0.29105297*f0.x + -0.03861604*g0.x + 0.075420655*h0.x + 0.083060674*i0.x; + float j = -0.091996595*a0.y + 0.07510911*b0.y + -0.062198374*c0.y + 0.05949073*d0.y + -0.1820295*e0.y + 0.09697475*f0.y + 0.03708951*g0.y + -0.036565762*h0.y + -0.009997776*i0.y; + float k = 0.03365902*a0.z + 0.024528746*b0.z + -0.07705728*c0.z + 0.015009792*d0.z + -0.026952326*e0.z + 0.057927553*f0.z + 0.011296611*g0.z + -0.05988774*h0.z + -0.07589114*i0.z; + float l = -0.021712398*a0.w + 0.030812785*b0.w + -0.0710952*c0.w + -0.009192136*d0.w + 0.10309372*e0.w + -0.06865543*f0.w + 0.010613057*g0.w + -0.08165008*h0.w + -0.046066593*i0.w; + float m = -0.008692918*a1.x + -0.06709967*b1.x + 0.018412719*c1.x + -0.10602186*d1.x + -0.14788082*e1.x + 0.07910418*f1.x + -0.042071406*g1.x + -0.03480511*h1.x + -0.17732185*i1.x; + float n = 0.01920865*a1.y + -0.09064567*b1.y + 0.060349815*c1.y + 0.0017988305*d1.y + 0.024946429*e1.y + -0.10279574*f1.y + -0.06084332*g1.y + 0.08148241*h1.y + 0.049391948*i1.y; + float o = -0.014042648*a1.z + 0.13778652*b1.z + -0.044523995*c1.z + 0.028905908*d1.z + -0.053008698*e1.z + 0.18101577*f1.z + 0.040709715*g1.z + -0.06592997*h1.z + 0.0137453135*i1.z; + float p = 0.0147396345*a1.w + -0.05519722*b1.w + -0.06594861*c1.w + 0.006423891*d1.w + -0.3153246*e1.w + 0.06916029*f1.w + 0.1014631*g1.w + 0.15333757*h1.w + 0.02263975*i1.w; + float q = -0.074357234*na0.x + -0.009763043*nb0.x + -0.11689638*nc0.x + -0.039435375*nd0.x + 0.119010925*ne0.x + -0.45772043*nf0.x + -0.007293864*ng0.x + -0.08986677*nh0.x + 0.00863173*ni0.x; + float r = 0.031472135*na0.y + 0.04116749*nb0.y + -0.036898814*nc0.y + -0.03728472*nd0.y + 0.30707526*ne0.y + -0.19659965*nf0.y + -0.024439543*ng0.y + 0.025200637*nh0.y + -0.022478241*ni0.y; + float s = 0.0038156274*na0.z + -0.061238572*nb0.z + 0.10164135*nc0.z + 0.0071307714*nd0.z + 0.09782806*ne0.z + -0.036823805*nf0.z + -0.051009785*ng0.z + -0.045252185*nh0.z + 0.008454376*ni0.z; + float t = -0.0040852334*na0.w + 0.004206126*nb0.w + 0.056624953*nc0.w + 0.059114635*nd0.w + -0.05446261*ne0.w + 0.039389167*nf0.w + -0.10022764*ng0.w + 0.19637282*nh0.w + -0.015569797*ni0.w; + float u = 0.040393475*na1.x + 0.09522407*nb1.x + -0.010178237*nc1.x + -0.03436084*nd1.x + 0.4680346*ne1.x + -0.07413823*nf1.x + 0.036522653*ng1.x + 0.026252978*nh1.x + 0.1363545*ni1.x; + float v = 0.010021632*na1.y + 0.017375447*nb1.y + -0.07255486*nc1.y + -0.044482302*nd1.y + -0.1145225*ne1.y + -0.057170864*nf1.y + -0.0044367113*ng1.y + -0.084041774*nh1.y + -0.10282541*ni1.y; + float w = -0.008224637*na1.z + -0.07302064*nb1.z + 0.08129463*nc1.z + 0.05966201*nd1.z + 0.19672397*ne1.z + -0.20587848*nf1.z + -0.020178175*ng1.z + -0.0015114375*nh1.z + -0.01026235*ni1.z; + float x = 0.007066653*na1.w + -0.13657302*nb1.w + 0.08176532*nc1.w + 0.07563069*nd1.w + 0.17663209*ne1.w + -0.14801173*nf1.w + -0.19493645*ng1.w + 0.10676253*nh1.w + -0.05212441*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.034949664; + i = -0.04030141*a0.x + -0.02292212*b0.x + 0.115096815*c0.x + -0.012690876*d0.x + 0.08087445*e0.x + 0.05919553*f0.x + 0.022237342*g0.x + 0.10526474*h0.x + -0.07153429*i0.x; + j = -0.06611239*a0.y + -0.22464392*b0.y + 0.055294756*c0.y + -0.14041202*d0.y + 0.12165779*e0.y + 0.06812188*f0.y + -0.009226198*g0.y + 0.045144778*h0.y + 0.037657242*i0.y; + k = -0.061883915*a0.z + -0.017648114*b0.z + 0.06447766*c0.z + -0.18309109*d0.z + 0.20868579*e0.z + 0.07306107*f0.z + 0.042334717*g0.z + 0.009320599*h0.z + -0.08148243*i0.z; + l = -0.02177497*a0.w + 0.04437367*b0.w + 0.009073194*c0.w + -0.1485765*d0.w + -0.14565298*e0.w + -0.11893995*f0.w + 0.02053271*g0.w + 0.08995071*h0.w + 0.008549951*i0.w; + m = -0.16447179*a1.x + 0.031375743*b1.x + -0.015620195*c1.x + -0.22476283*d1.x + 0.24823458*e1.x + -0.047999866*f1.x + -0.2514463*g1.x + 0.042610887*h1.x + 0.0812778*i1.x; + n = 0.032238446*a1.y + 0.17415202*b1.y + -0.0054007177*c1.y + 0.075851046*d1.y + 0.046077635*e1.y + -0.14960578*f1.y + -0.05029922*g1.y + -0.11156724*h1.y + 0.036022555*i1.y; + o = 0.015531561*a1.z + -0.212191*b1.z + -0.040764205*c1.z + -0.12781884*d1.z + 0.044870555*e1.z + -0.015441081*f1.z + 0.048236687*g1.z + 0.17973152*h1.z + -0.029533911*i1.z; + p = -0.055784054*a1.w + -0.19721657*b1.w + 0.086148694*c1.w + -0.054337233*d1.w + 0.16613255*e1.w + 0.019707054*f1.w + 0.061197594*g1.w + -0.09649971*h1.w + -0.08844818*i1.w; + q = 0.06738272*na0.x + -0.009395042*nb0.x + 0.017489811*nc0.x + -0.064345725*nd0.x + 0.03713633*ne0.x + -0.08849133*nf0.x + 0.014640531*ng0.x + 0.09498315*nh0.x + 0.0056702523*ni0.x; + r = 0.22121245*na0.y + 0.056038234*nb0.y + -0.107978776*nc0.y + 0.096367195*nd0.y + -0.30045885*ne0.y + -0.0025898942*nf0.y + -0.031757444*ng0.y + -0.09654942*nh0.y + -0.023382347*ni0.y; + s = 0.060906056*na0.z + 0.032286223*nb0.z + -0.027005702*nc0.z + 0.27080688*nd0.z + 0.076307185*ne0.z + 0.03645927*nf0.z + 0.11629662*ng0.z + 0.12386864*nh0.z + 0.028949413*ni0.z; + t = 0.0182073*na0.w + -0.2043918*nb0.w + -0.02887608*nc0.w + 0.1769455*nd0.w + 0.085888594*ne0.w + 0.1660409*nf0.w + -0.034466684*ng0.w + -0.03382163*nh0.w + -0.0092838835*ni0.w; + u = 0.099306785*na1.x + -0.1303775*nb1.x + 0.043936282*nc1.x + 0.17220032*nd1.x + -0.0056134374*ne1.x + -0.02121608*nf1.x + 0.04421245*ng1.x + 0.04001445*nh1.x + -0.07139496*ni1.x; + v = -0.023696968*na1.y + -0.0729322*nb1.y + -0.022487238*nc1.y + 0.08815881*nd1.y + 0.007617644*ne1.y + 0.13980423*nf1.y + 0.18962389*ng1.y + 0.24695751*nh1.y + -0.0015834856*ni1.y; + w = 0.077137835*na1.z + 0.09958312*nb1.z + -0.034727976*nc1.z + 0.11745516*nd1.z + -0.07195595*ne1.z + 0.008483939*nf1.z + -0.022856953*ng1.z + -0.056135558*nh1.z + 0.053542014*ni1.z; + x = 0.14396225*na1.w + 0.0034367044*nb1.w + -0.049312852*nc1.w + 0.08469975*nd1.w + -0.15791649*ne1.w + 0.031535268*nf1.w + -0.04043745*ng1.w + 0.062251687*nh1.w + 0.06067408*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.024711853; + i = 0.0664629*a0.x + 0.10692318*b0.x + -0.030991748*c0.x + 0.026725665*d0.x + -0.029399896*e0.x + 0.19930662*f0.x + 0.022686703*g0.x + 0.122738674*h0.x + 0.29318526*i0.x; + j = 0.061199848*a0.y + 0.37346324*b0.y + 0.17881247*c0.y + 0.1309697*d0.y + -0.16666664*e0.y + 0.14824271*f0.y + -0.010173596*g0.y + 0.09238088*h0.y + -0.045568574*i0.y; + k = 0.03038598*a0.z + 0.04836922*b0.z + -0.11428102*c0.z + -0.08397164*d0.z + -0.04179684*e0.z + -0.04103596*f0.z + -0.061901543*g0.z + -0.24047509*h0.z + -0.094810486*i0.z; + l = 0.0057008374*a0.w + -0.089383446*b0.w + -0.0011578492*c0.w + 0.053484034*d0.w + 0.19560213*e0.w + -0.02209287*f0.w + 0.0682118*g0.w + -0.15668254*h0.w + -0.035337582*i0.w; + m = 0.010179538*a1.x + -0.009926354*b1.x + -0.109158345*c1.x + 0.27797452*d1.x + -0.1501926*e1.x + -0.049379334*f1.x + 0.23668613*g1.x + 0.26095024*h1.x + 0.17412317*i1.x; + n = 0.048617676*a1.y + -0.13061006*b1.y + -0.08699499*c1.y + 0.02437259*d1.y + -0.23905917*e1.y + 0.028373206*f1.y + -0.012324001*g1.y + 0.10831793*h1.y + 0.15613145*i1.y; + o = -0.16202231*a1.z + 0.112338796*b1.z + 0.06859486*c1.z + 0.0040570013*d1.z + -0.17021316*e1.z + -0.20034729*f1.z + -0.12724905*g1.z + -0.12640756*h1.z + -0.16577214*i1.z; + p = -0.11785086*a1.w + 0.15373552*b1.w + 0.02865212*c1.w + -0.07240135*d1.w + 0.09834478*e1.w + 0.23596184*f1.w + 0.03104167*g1.w + -0.11922373*h1.w + -0.06501047*i1.w; + q = 0.038581338*na0.x + 0.09411416*nb0.x + -0.07578247*nc0.x + 0.039436612*nd0.x + 0.008611034*ne0.x + -0.06424503*nf0.x + 0.18458883*ng0.x + 0.24410121*nh0.x + 0.07844407*ni0.x; + r = 0.18324456*na0.y + -0.12021226*nb0.y + -0.13208836*nc0.y + 0.09850728*nd0.y + 0.1699451*ne0.y + 0.14253475*nf0.y + 0.0015629302*ng0.y + -0.040416647*nh0.y + 0.08870965*ni0.y; + s = -0.06539628*na0.z + -0.054774016*nb0.z + 0.036072135*nc0.z + 0.03065878*nd0.z + -0.048773237*ne0.z + -0.059441544*nf0.z + -0.13824742*ng0.z + -0.040871058*nh0.z + -0.0865028*ni0.z; + t = -0.08315763*na0.w + 0.15382922*nb0.w + 0.024102645*nc0.w + -0.13100009*nd0.w + -0.08944311*ne0.w + 0.17389596*nf0.w + -0.06263836*ng0.w + 0.13482958*nh0.w + -0.021643665*ni0.w; + u = -0.023210822*na1.x + 0.048466727*nb1.x + 0.063160636*nc1.x + 0.1562828*nd1.x + 0.07086501*ne1.x + 0.051311936*nf1.x + 0.0907613*ng1.x + 0.15781668*nh1.x + -0.084114805*ni1.x; + v = -0.014547862*na1.y + 0.11834738*nb1.y + 0.07009007*nc1.y + 0.0065218625*nd1.y + 0.04465036*ne1.y + -0.20078123*nf1.y + -0.062787935*ng1.y + -0.23939967*nh1.y + -0.21409222*ni1.y; + w = 0.088896476*na1.z + -0.08346275*nb1.z + -0.22665153*nc1.z + -0.1509825*nd1.z + -0.02430444*ne1.z + -0.03576661*nf1.z + -0.008432229*ng1.z + 0.10790929*nh1.z + 0.14536415*ni1.z; + x = -0.058379993*na1.w + 0.059363015*nb1.w + -0.08000655*nc1.w + -0.11767427*nd1.w + 0.04934514*ne1.w + -0.015116642*nf1.w + 0.11867853*ng1.w + 0.06474982*nh1.w + 0.17333901*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.020185012; + i = 0.030302616*a0.x + 0.012936507*b0.x + 0.0034298657*c0.x + 0.048076052*d0.x + -0.023669489*e0.x + -0.32370427*f0.x + 0.19902824*g0.x + 0.34311166*h0.x + -0.054156173*i0.x; + j = -0.08579449*a0.y + -0.5084439*b0.y + -0.36801156*c0.y + 0.06661955*d0.y + -0.19014734*e0.y + -0.2399755*f0.y + 0.12736103*g0.y + -0.10410863*h0.y + 0.030177465*i0.y; + k = -0.02324905*a0.z + -0.039416317*b0.z + 0.053991266*c0.z + -0.059502456*d0.z + 0.0958005*e0.z + 0.16579872*f0.z + -0.06434475*g0.z + -0.077372804*h0.z + -0.007644695*i0.z; + l = 0.011956397*a0.w + -0.034856573*b0.w + 0.053423986*c0.w + 0.14070635*d0.w + 0.13123417*e0.w + 0.14346647*f0.w + 0.062868804*g0.w + -0.0454593*h0.w + 0.20762633*i0.w; + m = -0.09791193*a1.x + -0.07366587*b1.x + 0.05572499*c1.x + 0.042659637*d1.x + 0.3969945*e1.x + -0.14020206*f1.x + 0.09684962*g1.x + 0.2450303*h1.x + -0.12085263*i1.x; + n = 0.047850836*a1.y + 0.07184617*b1.y + 0.24567747*c1.y + 0.07264752*d1.y + -0.15156308*e1.y + 0.096985765*f1.y + -0.0642458*g1.y + 0.07803079*h1.y + -0.059010334*i1.y; + o = -0.11122571*a1.z + -0.13089983*b1.z + -0.12985906*c1.z + -0.01955418*d1.z + -0.00661554*e1.z + -0.03197555*f1.z + -0.098977715*g1.z + -0.036374472*h1.z + 0.0061592176*i1.z; + p = -0.15445514*a1.w + -0.073438495*b1.w + -0.05213208*c1.w + -0.10382142*d1.w + 0.02313335*e1.w + 0.13147756*f1.w + 0.1708675*g1.w + -0.14348018*h1.w + 0.015913507*i1.w; + q = 0.008228371*na0.x + 0.18060881*nb0.x + -0.07841216*nc0.x + 0.082817584*nd0.x + 0.24217492*ne0.x + 0.22461349*nf0.x + 0.11344033*ng0.x + 0.17460021*nh0.x + 0.010574159*ni0.x; + r = 0.0053345948*na0.y + 0.26769656*nb0.y + 0.24543934*nc0.y + -0.008411275*nd0.y + 0.07112208*ne0.y + 0.12919407*nf0.y + -0.114602774*ng0.y + 0.12264793*nh0.y + 0.059904482*ni0.y; + s = 0.031678814*na0.z + 0.009786311*nb0.z + -0.00043090843*nc0.z + 0.051394574*nd0.z + -0.027239706*ne0.z + -0.13517226*nf0.z + -0.1504396*ng0.z + 0.017549086*nh0.z + 0.035983074*ni0.z; + t = 0.04294746*na0.w + 0.030728973*nb0.w + -0.06257568*nc0.w + 0.03680996*nd0.w + -0.12803526*ne0.w + -0.16854705*nf0.w + 0.09934979*ng0.w + 0.12420867*nh0.w + -0.09642918*ni0.w; + u = -0.13854499*na1.x + -0.08508567*nb1.x + -0.10403998*nc1.x + -0.14275831*nd1.x + -0.2893701*ne1.x + 0.10766267*nf1.x + -0.059306674*ng1.x + -0.008940202*nh1.x + 0.027810914*ni1.x; + v = 0.10816545*na1.y + -0.035457894*nb1.y + -0.15443805*nc1.y + -0.041631605*nd1.y + -0.009998618*ne1.y + -0.024312135*nf1.y + -0.108551584*ng1.y + 0.019042801*nh1.y + 0.12016941*ni1.y; + w = 0.032154717*na1.z + 0.029346332*nb1.z + 0.06843047*nc1.z + 0.07081246*nd1.z + -0.094431624*ne1.z + -0.008167981*nf1.z + 0.080870464*ng1.z + -0.047441497*nh1.z + -0.013129369*ni1.z; + x = 0.06746627*na1.w + 0.2383694*nb1.w + -0.009648939*nc1.w + 0.34424412*nd1.w + -0.12228263*ne1.w + -0.014683395*nf1.w + -0.048362486*ng1.w + 0.20429887*nh1.w + 0.086006135*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.018327164; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN10 +//!BIND LUMAN11 +//!SAVE LUMAN21 + +#define L0_tex LUMAN10_tex +#define L1_tex LUMAN11_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.031572185*a0.x + -0.21954902*b0.x + -0.0015886037*c0.x + 0.015651193*d0.x + -0.091154985*e0.x + -0.018254288*f0.x + -0.21651629*g0.x + -0.3765238*h0.x + -0.19374359*i0.x; + float j = -0.11055657*a0.y + 0.10585374*b0.y + -0.16947359*c0.y + -0.12919404*d0.y + -0.021268021*e0.y + -0.35808194*f0.y + -0.15131818*g0.y + -0.1534713*h0.y + -0.16522256*i0.y; + float k = 0.022202993*a0.z + 0.13158104*b0.z + 0.02993379*c0.z + -0.065304205*d0.z + 0.1619402*e0.z + -0.08785627*f0.z + 0.07271879*g0.z + -0.027453387*h0.z + 0.03305999*i0.z; + float l = -0.031789348*a0.w + 0.1364406*b0.w + -0.105685*c0.w + -0.0835975*d0.w + 0.24896793*e0.w + 0.23575991*f0.w + 0.034829173*g0.w + 0.2133406*h0.w + 0.23606575*i0.w; + float m = 0.026959497*a1.x + 0.025455823*b1.x + 0.06471504*c1.x + -0.0917701*d1.x + -0.06036751*e1.x + 0.01769423*f1.x + -0.070855275*g1.x + -0.6317431*h1.x + -0.26277852*i1.x; + float n = 0.04054354*a1.y + -0.018250944*b1.y + -0.029417658*c1.y + -0.058662474*d1.y + 0.13121347*e1.y + 0.014632146*f1.y + 0.032180488*g1.y + 0.08486894*h1.y + 0.10152975*i1.y; + float o = 0.011421388*a1.z + 0.10503153*b1.z + -0.053112317*c1.z + 0.16231366*d1.z + 0.510692*e1.z + 0.061217006*f1.z + 0.10842525*g1.z + 0.023373902*h1.z + 0.112074*i1.z; + float p = 0.055356618*a1.w + 0.24337149*b1.w + 0.09520685*c1.w + 0.01738178*d1.w + 0.24592605*e1.w + -0.10954584*f1.w + -0.12327179*g1.w + 0.22724484*h1.w + 0.014190379*i1.w; + float q = -0.024113731*na0.x + 0.009835982*nb0.x + -0.10777386*nc0.x + -0.15397954*nd0.x + -0.09266727*ne0.x + -0.07481691*nf0.x + -0.008523596*ng0.x + -0.07305857*nh0.x + 0.24318755*ni0.x; + float r = 0.11217226*na0.y + 0.05932721*nb0.y + -0.025799839*nc0.y + 0.14853054*nd0.y + 0.001339241*ne0.y + 0.08442375*nf0.y + 0.124774024*ng0.y + 0.097981855*nh0.y + -0.008815408*ni0.y; + float s = 0.027524095*na0.z + -0.05636311*nb0.z + -0.03188364*nc0.z + 0.06141485*nd0.z + -0.079391986*ne0.z + 0.07785756*nf0.z + -0.0071809567*ng0.z + 0.03687449*nh0.z + -0.0442086*ni0.z; + float t = 0.035764426*na0.w + -0.10056812*nb0.w + 0.02812691*nc0.w + 0.059040796*nd0.w + -0.14287305*ne0.w + -0.27596393*nf0.w + -0.1910503*ng0.w + -0.06406169*nh0.w + -0.3807643*ni0.w; + float u = 0.11490726*na1.x + 0.08433622*nb1.x + -0.17036709*nc1.x + -0.005325759*nd1.x + 0.044904377*ne1.x + -0.039056204*nf1.x + 0.07262492*ng1.x + 0.13203709*nh1.x + 0.15060328*ni1.x; + float v = -0.011916096*na1.y + -0.065864034*nb1.y + 0.13334328*nc1.y + 0.102103874*nd1.y + -0.10388749*ne1.y + 0.032959808*nf1.y + -0.06913139*ng1.y + -0.15625963*nh1.y + -0.10595022*ni1.y; + float w = -0.022166956*na1.z + 0.10815417*nb1.z + 0.21165903*nc1.z + -0.13659082*nd1.z + 0.052216068*ne1.z + -0.06214634*nf1.z + -0.04564452*ng1.z + 0.030564032*nh1.z + -0.072751716*ni1.z; + float x = -0.09017466*na1.w + 0.12638079*nb1.w + -0.12365812*nc1.w + 0.0103500765*nd1.w + -0.123947635*ne1.w + -0.09846554*nf1.w + -0.084648766*ng1.w + -0.04470046*nh1.w + 0.017418804*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.09885861; + i = 0.090828754*a0.x + 0.096411645*b0.x + -0.15743771*c0.x + 0.08865681*d0.x + 0.10327069*e0.x + 0.2907515*f0.x + 0.035096664*g0.x + 0.138947*h0.x + 0.1427179*i0.x; + j = -0.16812293*a0.y + 0.1728308*b0.y + 0.06070683*c0.y + -0.15704797*d0.y + -0.3200545*e0.y + -0.103168875*f0.y + 0.036229726*g0.y + -0.06575844*h0.y + 0.0054576118*i0.y; + k = -0.029580152*a0.z + 0.032304466*b0.z + -0.0809943*c0.z + 0.030459069*d0.z + -0.084344*e0.z + 0.015767999*f0.z + -0.02092132*g0.z + 0.03526388*h0.z + 0.053177886*i0.z; + l = 0.03594482*a0.w + 0.117228456*b0.w + 0.13116013*c0.w + 0.0047780536*d0.w + 0.1656387*e0.w + 0.10872266*f0.w + 0.118444785*g0.w + 0.115576595*h0.w + -0.015038535*i0.w; + m = 0.04955351*a1.x + -0.03695812*b1.x + -0.077832796*c1.x + 0.11647708*d1.x + -0.041836414*e1.x + -0.055132084*f1.x + -0.009689516*g1.x + -0.11150424*h1.x + -0.11962264*i1.x; + n = 0.006930824*a1.y + -0.01891034*b1.y + -0.095406644*c1.y + -0.0113957785*d1.y + -0.099846445*e1.y + 0.16559218*f1.y + -0.16096973*g1.y + -0.06362691*h1.y + 0.08387959*i1.y; + o = -0.083899364*a1.z + 0.14254184*b1.z + -0.046050787*c1.z + 0.08787931*d1.z + -0.051230885*e1.z + -0.047911417*f1.z + -0.08292005*g1.z + 0.08841273*h1.z + 0.090280995*i1.z; + p = -0.086902104*a1.w + -0.0024573256*b1.w + 0.078667*c1.w + 0.10535157*d1.w + -0.035453692*e1.w + -0.045311164*f1.w + -0.030063452*g1.w + 0.08216843*h1.w + -0.016280625*i1.w; + q = 0.010650102*na0.x + 0.09113334*nb0.x + 0.06135689*nc0.x + -0.051896483*nd0.x + 0.015457821*ne0.x + 0.12674108*nf0.x + 0.087930046*ng0.x + -0.02034448*nh0.x + -0.07680683*ni0.x; + r = 0.14385392*na0.y + -0.26780227*nb0.y + -0.031701945*nc0.y + 0.0868935*nd0.y + 0.04931676*ne0.y + 0.05209976*nf0.y + 0.029715285*ng0.y + 0.10936048*nh0.y + -0.023246985*ni0.y; + s = -0.019656094*na0.z + -0.08280237*nb0.z + 0.06794925*nc0.z + -0.052385163*nd0.z + 0.018505935*ne0.z + -0.06555773*nf0.z + -0.054259684*ng0.z + -0.045448292*nh0.z + -0.02774003*ni0.z; + t = 0.045591917*na0.w + 0.068767734*nb0.w + 0.037671242*nc0.w + 0.13044554*nd0.w + -0.18201542*ne0.w + -0.045410927*nf0.w + 0.090715006*ng0.w + -0.113842964*nh0.w + 0.02751698*ni0.w; + u = -0.1091907*na1.x + -0.1165115*nb1.x + 0.0005568998*nc1.x + -0.22252907*nd1.x + 0.12667035*ne1.x + 0.008930634*nf1.x + 0.015448396*ng1.x + 0.021914594*nh1.x + 0.06726403*ni1.x; + v = 0.100759745*na1.y + 0.008389446*nb1.y + 0.022286365*nc1.y + -0.028480763*nd1.y + 0.25048685*ne1.y + -0.30521858*nf1.y + -0.044158556*ng1.y + 0.16390778*nh1.y + -0.040408246*ni1.y; + w = -0.056419935*na1.z + -0.25055963*nb1.z + -0.049138095*nc1.z + -0.19915849*nd1.z + -0.09285168*ne1.z + 0.066150635*nf1.z + -0.048173662*ng1.z + -0.2055458*nh1.z + -0.07158348*ni1.z; + x = -0.2606289*na1.w + 0.016254561*nb1.w + -0.074577205*nc1.w + 0.04077225*nd1.w + 0.04064234*ne1.w + 0.014783259*nf1.w + 0.19851059*ng1.w + 0.011379637*nh1.w + 0.0639475*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.019597191; + i = -0.020242073*a0.x + -0.05308193*b0.x + 0.18023895*c0.x + 0.08489619*d0.x + 0.083558254*e0.x + -0.07950611*f0.x + 0.17617436*g0.x + 0.17022839*h0.x + -0.070535906*i0.x; + j = -0.008529808*a0.y + 0.07710499*b0.y + -0.09458898*c0.y + 0.025928719*d0.y + 0.02094489*e0.y + -0.13695501*f0.y + 0.031141782*g0.y + 0.0073337485*h0.y + 0.024863651*i0.y; + k = -0.016425258*a0.z + -0.0120658*b0.z + 0.08000494*c0.z + 0.11181177*d0.z + -0.045137078*e0.z + 0.118886255*f0.z + -0.0037934526*g0.z + 0.007946874*h0.z + -0.07523597*i0.z; + l = 0.1161145*a0.w + 0.11615834*b0.w + 0.03312487*c0.w + 0.010220156*d0.w + 0.10032188*e0.w + -0.06552804*f0.w + 0.07098567*g0.w + -0.031219715*h0.w + 0.14219265*i0.w; + m = -0.07355923*a1.x + -0.124543294*b1.x + -0.11123776*c1.x + -0.04914004*d1.x + -0.13508037*e1.x + -0.08538037*f1.x + -0.019250447*g1.x + -0.08325892*h1.x + -0.08339272*i1.x; + n = 0.03417587*a1.y + 0.025351161*b1.y + 0.10959054*c1.y + 0.027764061*d1.y + -0.34036496*e1.y + 0.07244361*f1.y + -0.006465673*g1.y + 0.10414523*h1.y + -0.010445836*i1.y; + o = 0.004427069*a1.z + 0.09301199*b1.z + -0.059907075*c1.z + -0.11519208*d1.z + -0.1104757*e1.z + -0.023946041*f1.z + 0.032483287*g1.z + -0.094261475*h1.z + 0.019523932*i1.z; + p = -0.12207462*a1.w + -0.05009648*b1.w + 0.22022372*c1.w + 0.26285815*d1.w + -0.39705196*e1.w + 0.2079559*f1.w + 0.029637828*g1.w + 0.14109252*h1.w + -0.15722114*i1.w; + q = 0.12842292*na0.x + 0.040316265*nb0.x + -0.046668567*nc0.x + -0.1790541*nd0.x + 0.39654964*ne0.x + 0.10837263*nf0.x + -0.014433793*ng0.x + 0.058479983*nh0.x + 0.16391735*ni0.x; + r = 0.029365534*na0.y + -0.29093117*nb0.y + -0.1335489*nc0.y + -0.09151678*nd0.y + 0.098561645*ne0.y + -0.099725164*nf0.y + -0.17893723*ng0.y + -0.052773494*nh0.y + -0.015666319*ni0.y; + s = 0.047640108*na0.z + 0.08673376*nb0.z + -0.0078012454*nc0.z + 0.0575252*nd0.z + 0.28432444*ne0.z + -0.1002306*nf0.z + 0.09963052*ng0.z + 0.054946344*nh0.z + 0.100503296*ni0.z; + t = -0.006640146*na0.w + -0.09308057*nb0.w + -0.0057282364*nc0.w + 0.14567396*nd0.w + 0.01839891*ne0.w + 0.12528877*nf0.w + 0.09085395*ng0.w + 0.2048081*nh0.w + -0.0076175393*ni0.w; + u = -0.07017045*na1.x + 0.09735179*nb1.x + -0.07009357*nc1.x + 0.02023705*nd1.x + 0.218486*ne1.x + -0.024970353*nf1.x + -0.13825807*ng1.x + -0.04828522*nh1.x + -0.0057001337*ni1.x; + v = 0.08126537*na1.y + -0.031536*nb1.y + 0.037959702*nc1.y + 0.20027067*nd1.y + 0.21129422*ne1.y + 0.1862494*nf1.y + 0.180125*ng1.y + 0.022476744*nh1.y + 0.05598345*ni1.y; + w = 0.020886317*na1.z + -0.110396385*nb1.z + 0.10073255*nc1.z + 0.040812705*nd1.z + 0.014480216*ne1.z + -0.010606202*nf1.z + -0.041063044*ng1.z + 0.029324416*nh1.z + 0.01893235*ni1.z; + x = -0.02117882*na1.w + 0.19071308*nb1.w + -0.1419392*nc1.w + -0.0527013*nd1.w + 0.07907033*ne1.w + -0.052748203*nf1.w + 0.08567526*ng1.w + -0.0592885*nh1.w + 0.20510149*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.029102495; + i = -0.075755544*a0.x + -0.011345147*b0.x + -0.043020517*c0.x + -0.076325096*d0.x + -0.4086877*e0.x + -0.04542607*f0.x + -0.09695344*g0.x + -0.07378155*h0.x + 0.062268447*i0.x; + j = -0.024231238*a0.y + 0.18943751*b0.y + 0.039547183*c0.y + 0.24655502*d0.y + 0.11322199*e0.y + 0.0040923445*f0.y + -0.030605817*g0.y + -0.029112251*h0.y + -0.092641145*i0.y; + k = -0.06868489*a0.z + 0.093663774*b0.z + -0.05326381*c0.z + 0.20458257*d0.z + 0.080837764*e0.z + 0.049542785*f0.z + -0.07633304*g0.z + -0.079116225*h0.z + 0.02151533*i0.z; + l = -0.16702063*a0.w + 0.03387102*b0.w + 0.128119*c0.w + -0.078100264*d0.w + -0.3766126*e0.w + -0.029631527*f0.w + -0.0036548837*g0.w + -0.003755168*h0.w + 0.032454517*i0.w; + m = 0.004539345*a1.x + 0.035367977*b1.x + -0.024105042*c1.x + 0.042090166*d1.x + -0.122908995*e1.x + -0.013073632*f1.x + -0.0371632*g1.x + -0.14399377*h1.x + -0.11981582*i1.x; + n = 0.094303235*a1.y + -0.089308694*b1.y + 0.10684167*c1.y + 0.04173341*d1.y + 0.013348961*e1.y + 0.0677585*f1.y + 0.1170188*g1.y + 0.28716058*h1.y + 0.08580711*i1.y; + o = -0.10841774*a1.z + 0.011063079*b1.z + -0.0699171*c1.z + -0.020767417*d1.z + 0.32828206*e1.z + -0.04855068*f1.z + -0.04515191*g1.z + 0.032077674*h1.z + -0.052970123*i1.z; + p = -0.11867851*a1.w + -0.15362826*b1.w + -0.08771901*c1.w + -0.16020527*d1.w + 0.076826505*e1.w + 0.086025305*f1.w + 0.043390036*g1.w + 0.10139997*h1.w + -0.0039536236*i1.w; + q = -0.03787442*na0.x + 0.06320837*nb0.x + -0.033287127*nc0.x + -0.061944425*nd0.x + 0.031171579*ne0.x + 0.01694876*nf0.x + 0.046434026*ng0.x + -0.028421821*nh0.x + 0.09308639*ni0.x; + r = -0.06541709*na0.y + 0.25386578*nb0.y + 0.0014157171*nc0.y + -0.10769748*nd0.y + -0.40667775*ne0.y + -0.14396338*nf0.y + -0.05874716*ng0.y + -0.03484261*nh0.y + 0.017493723*ni0.y; + s = 0.21681505*na0.z + -0.034055233*nb0.z + 0.02617582*nc0.z + 0.038299404*nd0.z + 0.031072108*ne0.z + -0.06932048*nf0.z + 0.05036968*ng0.z + -0.06750086*nh0.z + 0.04094509*ni0.z; + t = 0.08190957*na0.w + 0.15915425*nb0.w + 0.0131659405*nc0.w + 0.053403776*nd0.w + 0.34565467*ne0.w + 0.08184508*nf0.w + 0.13011171*ng0.w + -0.06749469*nh0.w + 0.046303164*ni0.w; + u = 0.14052047*na1.x + -0.053244803*nb1.x + -0.18655081*nc1.x + 0.015175705*nd1.x + -0.44549644*ne1.x + -0.09666402*nf1.x + -0.07448092*ng1.x + -0.1022428*nh1.x + 0.10026984*ni1.x; + v = -0.039204475*na1.y + 0.06170189*nb1.y + 0.06672028*nc1.y + 0.18241915*nd1.y + 0.0048539606*ne1.y + 0.31951326*nf1.y + 0.20582074*ng1.y + -0.31659672*nh1.y + 0.21938471*ni1.y; + w = 0.23948088*na1.z + 0.37910646*nb1.z + 0.21267733*nc1.z + 0.1353376*nd1.z + -0.2806238*ne1.z + -0.1860066*nf1.z + -0.09305172*ng1.z + -0.041649293*nh1.z + -0.0153132705*ni1.z; + x = -0.02297408*na1.w + 0.1199497*nb1.w + 0.04796784*nc1.w + -0.37305376*nd1.w + -0.16561341*ne1.w + -0.095281884*nf1.w + 0.07637466*ng1.w + -0.04438899*nh1.w + -0.050757162*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0019644105; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN20 +//!BIND LUMAN21 +//!SAVE LUMAN30 + +#define L0_tex LUMAN20_tex +#define L1_tex LUMAN21_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.10643633*a0.x + -0.036906414*b0.x + -0.1111053*c0.x + 0.25501183*d0.x + 0.014018466*e0.x + -0.061034296*f0.x + -0.00068537623*g0.x + -0.010772575*h0.x + 0.018131634*i0.x; + float j = -0.026088478*a0.y + -0.21230131*b0.y + -0.003618772*c0.y + 0.0064307135*d0.y + -0.16586839*e0.y + -0.15548082*f0.y + 0.013893729*g0.y + -0.014476677*h0.y + 0.009556796*i0.y; + float k = 0.0036814748*a0.z + 0.0072407345*b0.z + 0.027842285*c0.z + -0.044016458*d0.z + -0.0702261*e0.z + 0.09113725*f0.z + 0.07005032*g0.z + 0.18412821*h0.z + 0.058644623*i0.z; + float l = 0.057065602*a0.w + 0.048588675*b0.w + -0.057245746*c0.w + 0.05475095*d0.w + 0.1420745*e0.w + 0.037316687*f0.w + -0.06891968*g0.w + -0.016110359*h0.w + -0.05803794*i0.w; + float m = 0.038496323*a1.x + -0.03790667*b1.x + -0.025374807*c1.x + 0.043793097*d1.x + -0.2158214*e1.x + 0.023474434*f1.x + -0.023752023*g1.x + -0.01691174*h1.x + 0.015506258*i1.x; + float n = -0.1361195*a1.y + -0.21140288*b1.y + -0.08454087*c1.y + -0.06148918*d1.y + -0.10822299*e1.y + -0.23093574*f1.y + -0.019948276*g1.y + -0.06194488*h1.y + -0.120892406*i1.y; + float o = -0.049701612*a1.z + 0.1065619*b1.z + 0.016156977*c1.z + -0.045148958*d1.z + -0.06694894*e1.z + -0.0176919*f1.z + 0.03590984*g1.z + -0.17600913*h1.z + -0.036402546*i1.z; + float p = -0.04690928*a1.w + -0.02835606*b1.w + -0.09638407*c1.w + 0.014927076*d1.w + 0.0034195676*e1.w + -0.05188964*f1.w + 0.100567654*g1.w + 0.11274578*h1.w + 0.01773749*i1.w; + float q = -0.023610353*na0.x + 0.030650157*nb0.x + -0.05444737*nc0.x + 0.41447455*nd0.x + 0.5024452*ne0.x + 0.104963444*nf0.x + 0.30694106*ng0.x + 0.053822875*nh0.x + -0.09730409*ni0.x; + float r = -0.028364167*na0.y + 0.13048097*nb0.y + 0.011416225*nc0.y + -0.04943442*nd0.y + -0.24018818*ne0.y + 0.07666743*nf0.y + -0.059948284*ng0.y + -0.19827667*nh0.y + -0.0049656746*ni0.y; + float s = -0.05825712*na0.z + 0.066884935*nb0.z + 0.025379421*nc0.z + 0.08924984*nd0.z + -0.1867149*ne0.z + -0.1258125*nf0.z + -0.04889679*ng0.z + -0.057346914*nh0.z + 0.017777069*ni0.z; + float t = 0.0036332337*na0.w + -0.016131833*nb0.w + -0.016359037*nc0.w + 0.0092720445*nd0.w + -0.16337238*ne0.w + -0.13277072*nf0.w + 0.036498047*ng0.w + -0.052755818*nh0.w + 0.018927759*ni0.w; + float u = -0.1815154*na1.x + -0.087429486*nb1.x + -0.017911742*nc1.x + -0.10084511*nd1.x + -0.04621298*ne1.x + -0.14156355*nf1.x + -0.05798644*ng1.x + -0.22305803*nh1.x + -0.009415597*ni1.x; + float v = 0.16611154*na1.y + 0.106082186*nb1.y + 0.08782764*nc1.y + 0.03455289*nd1.y + 0.010741922*ne1.y + 0.062042207*nf1.y + -0.16904944*ng1.y + 0.22352377*nh1.y + 0.04690581*ni1.y; + float w = 0.07852161*na1.z + 0.0013620722*nb1.z + 0.038907528*nc1.z + 0.3628306*nd1.z + 0.011874221*ne1.z + -0.04687281*nf1.z + -0.26009414*ng1.z + 0.2499944*nh1.z + 0.068138845*ni1.z; + float x = 0.048991237*na1.w + 0.010137228*nb1.w + 0.09121104*nc1.w + 0.050308313*nd1.w + -0.100869745*ne1.w + 0.09473232*nf1.w + 0.062941894*ng1.w + -0.12540334*nh1.w + -0.019815128*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.028611533; + i = 0.041587368*a0.x + 0.01827282*b0.x + -0.013873069*c0.x + -0.24341245*d0.x + -0.27286956*e0.x + -0.039693765*f0.x + 0.09158187*g0.x + 0.07718322*h0.x + -0.04822146*i0.x; + j = -0.077187955*a0.y + 0.053837564*b0.y + 0.043846983*c0.y + 0.05413649*d0.y + -0.14214621*e0.y + -0.06885113*f0.y + 0.0663552*g0.y + 0.095145516*h0.y + -0.061877612*i0.y; + k = -0.019598985*a0.z + -0.036677573*b0.z + -0.09773802*c0.z + -0.25499588*d0.z + 0.04864643*e0.z + -0.04847572*f0.z + -0.026475035*g0.z + -0.01951032*h0.z + -0.06544461*i0.z; + l = 0.03859847*a0.w + 0.1137901*b0.w + -0.04948835*c0.w + 0.1557564*d0.w + -0.10947979*e0.w + 0.015548971*f0.w + 0.22057895*g0.w + -0.040277276*h0.w + -0.07086392*i0.w; + m = 0.03145267*a1.x + -0.025462307*b1.x + -0.0463051*c1.x + -0.074188426*d1.x + 0.029483223*e1.x + -0.031941865*f1.x + 0.007561021*g1.x + -0.04342986*h1.x + 0.017778557*i1.x; + n = -0.034897916*a1.y + 0.079400115*b1.y + 0.019503072*c1.y + 0.11235732*d1.y + -0.026031071*e1.y + -0.09676807*f1.y + -0.1779691*g1.y + 0.17168868*h1.y + -0.1402981*i1.y; + o = -0.03698885*a1.z + 0.027295057*b1.z + 0.08494035*c1.z + -0.16241463*d1.z + 0.18817148*e1.z + 0.0069888486*f1.z + 0.10624407*g1.z + 0.08390974*h1.z + 0.0999854*i1.z; + p = -0.079902805*a1.w + 0.054902624*b1.w + 0.03831344*c1.w + -0.01018791*d1.w + 0.105503865*e1.w + -0.0045422777*f1.w + -0.08551547*g1.w + 0.014839678*h1.w + -0.0042692786*i1.w; + q = 0.14067799*na0.x + 0.053378116*nb0.x + 0.04058857*nc0.x + 0.17887895*nd0.x + 0.12430842*ne0.x + 0.15898004*nf0.x + 0.11768944*ng0.x + -0.037185024*nh0.x + 0.009110197*ni0.x; + r = 0.086276785*na0.y + 0.027156599*nb0.y + 0.014366527*nc0.y + -0.12710768*nd0.y + 0.41335082*ne0.y + 0.22516267*nf0.y + 0.06087766*ng0.y + -0.16419986*nh0.y + 0.07734832*ni0.y; + s = -0.16815056*na0.z + 0.108973786*nb0.z + -0.008016018*nc0.z + 0.060010143*nd0.z + -0.03355337*ne0.z + 0.1301468*nf0.z + -0.1348207*ng0.z + 0.046151087*nh0.z + 0.015409749*ni0.z; + t = -0.014207295*na0.w + -0.04218836*nb0.w + 0.0067676282*nc0.w + -0.17053707*nd0.w + 0.08037372*ne0.w + -0.0058613042*nf0.w + -0.06331095*ng0.w + 0.10058814*nh0.w + 0.030210534*ni0.w; + u = -0.11319795*na1.x + 0.029488392*nb1.x + -0.010583512*nc1.x + -0.114965856*nd1.x + -0.023316355*ne1.x + 0.062252164*nf1.x + -0.03523979*ng1.x + -0.013047221*nh1.x + -0.0053103394*ni1.x; + v = 0.05976406*na1.y + 0.022942819*nb1.y + 0.04437112*nc1.y + -0.22688077*nd1.y + 0.045486756*ne1.y + 0.07254583*nf1.y + 0.06141088*ng1.y + 0.028864142*nh1.y + 0.1240949*ni1.y; + w = 0.13044041*na1.z + -0.2329393*nb1.z + -0.0382236*nc1.z + 0.07264846*nd1.z + -0.12195677*ne1.z + -0.017324021*nf1.z + 0.121612154*ng1.z + 0.047399193*nh1.z + -0.13527565*ni1.z; + x = 0.059934974*na1.w + -0.1111012*nb1.w + 0.030002043*nc1.w + -0.023710279*nd1.w + 0.17099407*ne1.w + 0.08030319*nf1.w + 0.0016157839*ng1.w + -0.18830262*nh1.w + 0.08394579*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.001321388; + i = 0.071545444*a0.x + 0.32496607*b0.x + 0.15365659*c0.x + 0.121577024*d0.x + -0.17505717*e0.x + 0.16289195*f0.x + -0.0648079*g0.x + 0.15859945*h0.x + 0.032257058*i0.x; + j = 0.011973064*a0.y + -0.16694728*b0.y + -0.056336023*c0.y + -0.0011007001*d0.y + 0.17363375*e0.y + 0.181033*f0.y + -0.008971892*g0.y + 0.019856619*h0.y + 0.059345547*i0.y; + k = 0.0052531324*a0.z + 0.14736383*b0.z + 0.048309688*c0.z + 0.041148175*d0.z + -0.19401208*e0.z + -0.020993957*f0.z + 0.062306486*g0.z + -0.08399667*h0.z + 0.016625507*i0.z; + l = -0.020745479*a0.w + 0.12733771*b0.w + 0.057055835*c0.w + 0.024295107*d0.w + 0.21874963*e0.w + 0.20513003*f0.w + 0.057991862*g0.w + 0.07877612*h0.w + 0.05527445*i0.w; + m = 0.021244286*a1.x + 0.015290164*b1.x + -0.03950085*c1.x + -0.046619404*d1.x + -0.08696681*e1.x + -0.054744504*f1.x + 0.038519688*g1.x + -0.13894098*h1.x + -0.036025655*i1.x; + n = -0.091958016*a1.y + -0.05390509*b1.y + 0.022566987*c1.y + 0.061428353*d1.y + -0.075702526*e1.y + 0.32732865*f1.y + -0.0007603688*g1.y + 0.12742408*h1.y + 0.0932513*i1.y; + o = 0.07413146*a1.z + -0.043927237*b1.z + 0.099399686*c1.z + -0.06604147*d1.z + -0.13035367*e1.z + -0.23295024*f1.z + 0.04786522*g1.z + -0.07348675*h1.z + -0.03825064*i1.z; + p = 0.052928247*a1.w + -0.09133611*b1.w + 0.061273582*c1.w + -0.0039093695*d1.w + 0.07333901*e1.w + 0.058747426*f1.w + -0.061208177*g1.w + 0.03055871*h1.w + -0.04453164*i1.w; + q = -0.019145327*na0.x + 0.23282546*nb0.x + 0.078314364*nc0.x + -0.06364767*nd0.x + -0.105903655*ne0.x + -0.20121083*nf0.x + 0.06118902*ng0.x + -0.22779615*nh0.x + -0.074413195*ni0.x; + r = 0.056243785*na0.y + 0.30475444*nb0.y + 0.35658857*nc0.y + 0.00036167758*nd0.y + -0.091504164*ne0.y + -0.13814391*nf0.y + -0.03528659*ng0.y + 0.11410796*nh0.y + 0.108269215*ni0.y; + s = 0.058173932*na0.z + -0.0920868*nb0.z + 0.047370248*nc0.z + 0.022357361*nd0.z + 0.1056848*ne0.z + 0.12012219*nf0.z + -0.030601367*ng0.z + 0.13887161*nh0.z + -0.10589772*ni0.z; + t = 0.018066294*na0.w + -0.13855995*nb0.w + -0.04259209*nc0.w + -0.061554506*nd0.w + -0.11533582*ne0.w + -0.25060752*nf0.w + -0.047970247*ng0.w + 0.113073446*nh0.w + -0.055563718*ni0.w; + u = 0.04350478*na1.x + -0.02057861*nb1.x + 0.082972564*nc1.x + 0.09450377*nd1.x + -0.020292157*ne1.x + -0.019516591*nf1.x + -0.067337714*ng1.x + 0.13866435*nh1.x + 0.03235949*ni1.x; + v = -0.009059243*na1.y + 0.10090246*nb1.y + 0.08752086*nc1.y + -0.0017559788*nd1.y + 0.115805514*ne1.y + 0.002917317*nf1.y + -0.017110765*ng1.y + -0.01419701*nh1.y + -0.0636791*ni1.y; + w = -0.11286448*na1.z + -0.067641154*nb1.z + -0.14130938*nc1.z + 0.06486227*nd1.z + 0.036358926*ne1.z + 0.14507468*nf1.z + 0.010521049*ng1.z + 0.09771575*nh1.z + 0.071096644*ni1.z; + x = -0.0063579637*na1.w + 0.0074052885*nb1.w + -0.094562985*nc1.w + -0.025548384*nd1.w + -0.3769633*ne1.w + -0.28372648*nf1.w + 0.06836641*ng1.w + -0.17378987*nh1.w + -0.04446821*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.030421099; + i = 0.03630972*a0.x + 0.03523327*b0.x + -0.08293865*c0.x + -0.21982624*d0.x + 0.36658382*e0.x + 0.09405754*f0.x + -0.0765099*g0.x + -0.017510056*h0.x + 0.024932105*i0.x; + j = 0.029382393*a0.y + 0.0074663917*b0.y + -0.08808589*c0.y + -0.122646965*d0.y + -0.31578365*e0.y + -0.05433889*f0.y + 0.05131103*g0.y + 0.05232373*h0.y + -0.02975889*i0.y; + k = 0.07101219*a0.z + 0.120809495*b0.z + -0.02234444*c0.z + -0.023502193*d0.z + 0.21097527*e0.z + -0.19294956*f0.z + 0.010837906*g0.z + 0.01842376*h0.z + 0.025430828*i0.z; + l = 0.11364191*a0.w + 0.1905141*b0.w + -0.0011817712*c0.w + 0.31210938*d0.w + 0.25006205*e0.w + 0.030226331*f0.w + 0.13784334*g0.w + 0.2281184*h0.w + 0.26303968*i0.w; + m = 0.20311864*a1.x + 0.046665657*b1.x + 0.08734007*c1.x + 0.20788254*d1.x + -0.3129463*e1.x + -0.1034487*f1.x + 0.044930696*g1.x + 0.06827188*h1.x + 0.0077128126*i1.x; + n = -0.15269807*a1.y + -0.24423297*b1.y + -0.16777211*c1.y + -0.117007636*d1.y + -0.6073*e1.y + 0.111332096*f1.y + -0.3006221*g1.y + 0.05876093*h1.y + 0.038046006*i1.y; + o = -0.0153901735*a1.z + -0.024091184*b1.z + 0.10764487*c1.z + -0.021961832*d1.z + 0.22035132*e1.z + 0.09268526*f1.z + 0.085437834*g1.z + -0.08049326*h1.z + -0.06466641*i1.z; + p = -0.05375048*a1.w + -0.03399916*b1.w + -0.058176164*c1.w + -0.07561558*d1.w + -0.061255652*e1.w + -0.097357504*f1.w + -0.11741467*g1.w + -0.061670892*h1.w + -0.07436903*i1.w; + q = 0.071051694*na0.x + 0.1814416*nb0.x + 0.22951497*nc0.x + 0.1546238*nd0.x + -0.019326491*ne0.x + -0.05573559*nf0.x + 0.016983688*ng0.x + 0.06897233*nh0.x + 0.008648969*ni0.x; + r = -0.014931178*na0.y + -0.06446547*nb0.y + 0.063605614*nc0.y + 0.08041688*nd0.y + 0.25108832*ne0.y + -0.31870738*nf0.y + -0.02379586*ng0.y + -0.08481717*nh0.y + -0.0016163252*ni0.y; + s = -0.032453634*na0.z + -0.041135035*nb0.z + -0.06835738*nc0.z + 0.025102768*nd0.z + -0.26983768*ne0.z + -0.2279373*nf0.z + 0.03183848*ng0.z + -0.15011281*nh0.z + 0.09245014*ni0.z; + t = 0.02049012*na0.w + 0.014409927*nb0.w + -0.053820163*nc0.w + -0.06857825*nd0.w + 0.049533352*ne0.w + -0.0059399894*nf0.w + 0.06423862*ng0.w + -0.1422229*nh0.w + -0.101355284*ni0.w; + u = -0.07012918*na1.x + 0.01263355*nb1.x + -0.051622722*nc1.x + -0.17590354*nd1.x + 0.28435645*ne1.x + -0.008795671*nf1.x + -0.04458566*ng1.x + -0.060899705*nh1.x + -0.0025370463*ni1.x; + v = 0.098538294*na1.y + 0.17665358*nb1.y + 0.09652097*nc1.y + 0.08301102*nd1.y + 0.14594017*ne1.y + 0.1076866*nf1.y + 0.018559845*ng1.y + 0.008664722*nh1.y + 0.19314465*ni1.y; + w = -0.0036817864*na1.z + 0.028279642*nb1.z + -0.07943624*nc1.z + 0.29500982*nd1.z + -0.25036684*ne1.z + -0.25631368*nf1.z + -0.07839792*ng1.z + 0.18605448*nh1.z + 0.01258324*ni1.z; + x = -0.00030955416*na1.w + -0.11364831*nb1.w + -0.031985335*nc1.w + -0.067054465*nd1.w + -0.07023549*ne1.w + -0.24119556*nf1.w + 0.088734835*ng1.w + -0.10806103*nh1.w + -0.08079391*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.006313841; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN20 +//!BIND LUMAN21 +//!SAVE LUMAN31 + +#define L0_tex LUMAN20_tex +#define L1_tex LUMAN21_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.082612395*a0.x + -0.049185723*b0.x + 0.007860312*c0.x + -0.07619104*d0.x + -0.061066628*e0.x + -0.234122*f0.x + -0.025663877*g0.x + -0.09894433*h0.x + -0.08856901*i0.x; + float j = 0.028992495*a0.y + 0.060103714*b0.y + 0.070344836*c0.y + 0.029064424*d0.y + 0.07586566*e0.y + 0.51010346*f0.y + 0.017292246*g0.y + 0.002633715*h0.y + 0.11349569*i0.y; + float k = -0.06872372*a0.z + -0.016517969*b0.z + 0.0826774*c0.z + -0.093704216*d0.z + -0.0106905*e0.z + 0.16762802*f0.z + -0.0033384203*g0.z + -0.032237183*h0.z + 0.043032877*i0.z; + float l = 0.024126578*a0.w + -0.06437252*b0.w + 0.04205709*c0.w + -0.0033347043*d0.w + -0.40628058*e0.w + -0.08603576*f0.w + 0.10561821*g0.w + 0.06512041*h0.w + -0.09332843*i0.w; + float m = -0.07182272*a1.x + -0.09454206*b1.x + 0.061906293*c1.x + 0.026286539*d1.x + -0.39927563*e1.x + 0.008726781*f1.x + 0.0005037006*g1.x + -0.069342464*h1.x + -0.11110182*i1.x; + float n = -0.012922981*a1.y + 0.16917652*b1.y + 0.07799769*c1.y + 0.023201788*d1.y + 0.2626289*e1.y + 0.0018231489*f1.y + -0.08402095*g1.y + -0.12002021*h1.y + 0.054342803*i1.y; + float o = 0.025521107*a1.z + 0.06767924*b1.z + -0.04768362*c1.z + 0.0024316174*d1.z + 0.06449517*e1.z + -0.095331565*f1.z + -0.1276331*g1.z + 0.08763754*h1.z + -0.082404226*i1.z; + float p = 0.003203677*a1.w + 0.14995256*b1.w + -0.03622031*c1.w + 0.00857825*d1.w + -0.14085086*e1.w + 0.26847202*f1.w + 0.05867755*g1.w + 0.036008976*h1.w + 0.051128622*i1.w; + float q = -0.013764248*na0.x + -0.07657615*nb0.x + -0.10106088*nc0.x + -0.085903384*nd0.x + -0.6161812*ne0.x + -0.021359652*nf0.x + -0.015972499*ng0.x + -0.08998824*nh0.x + -0.17376873*ni0.x; + float r = -0.0006796045*na0.y + 0.05056079*nb0.y + 0.12611836*nc0.y + -0.07547889*nd0.y + -0.0973721*ne0.y + -0.09426381*nf0.y + 0.09283747*ng0.y + -0.0036219582*nh0.y + 0.033203803*ni0.y; + float s = -0.061120506*na0.z + -0.0032669806*nb0.z + 0.17457744*nc0.z + 0.0786906*nd0.z + -0.40016562*ne0.z + 0.4663654*nf0.z + 0.012628118*ng0.z + 0.05319796*nh0.z + -0.0024167062*ni0.z; + float t = -0.1353105*na0.w + 0.019064318*nb0.w + -0.0072273333*nc0.w + -0.04670005*nd0.w + 0.29887754*ne0.w + 0.016659219*nf0.w + -0.014867551*ng0.w + -0.011917135*nh0.w + 0.13788454*ni0.w; + float u = -0.029870111*na1.x + 0.033843093*nb1.x + -0.065248415*nc1.x + -0.08469054*nd1.x + 0.017073529*ne1.x + -0.023332408*nf1.x + -0.0628914*ng1.x + -0.0745155*nh1.x + 0.15528484*ni1.x; + float v = -0.0019400625*na1.y + -0.030651335*nb1.y + 0.090773754*nc1.y + 0.0258287*nd1.y + -0.20470299*ne1.y + -0.047677934*nf1.y + -0.05859846*ng1.y + 0.1281607*nh1.y + 0.0177529*ni1.y; + float w = -0.011972396*na1.z + -0.09978911*nb1.z + -0.057061244*nc1.z + 0.047144193*nd1.z + -0.059643425*ne1.z + 0.31873918*nf1.z + 0.17199998*ng1.z + 0.0934847*nh1.z + 0.31202945*ni1.z; + float x = -0.08166581*na1.w + 0.057511628*nb1.w + 0.0742405*nc1.w + 0.052457616*nd1.w + 0.18768248*ne1.w + 0.05856997*nf1.w + -0.0054697786*ng1.w + -0.0898955*nh1.w + -0.10827548*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.009003827; + i = -0.2563088*a0.x + 0.05043541*b0.x + 0.08568264*c0.x + -0.25449166*d0.x + -0.20602058*e0.x + -0.05074106*f0.x + -0.24613608*g0.x + 0.022720609*h0.x + -0.12870306*i0.x; + j = 0.113697335*a0.y + -0.05368127*b0.y + -0.05319295*c0.y + -0.0055116396*d0.y + -0.37782472*e0.y + -0.06400323*f0.y + 0.0020659082*g0.y + -0.0830408*h0.y + -0.2580011*i0.y; + k = 0.2294053*a0.z + 0.13383579*b0.z + 0.17804933*c0.z + 0.23239657*d0.z + -0.13443974*e0.z + 0.18296231*f0.z + 0.097049445*g0.z + 0.13477755*h0.z + -0.03763717*i0.z; + l = 0.021966321*a0.w + 0.11378714*b0.w + 0.03098346*c0.w + 0.2932349*d0.w + 0.24182005*e0.w + 0.1548571*f0.w + 0.1858839*g0.w + 0.36080515*h0.w + 0.1537605*i0.w; + m = 0.24021837*a1.x + 0.10757309*b1.x + -0.08044931*c1.x + 0.13565575*d1.x + 0.11971135*e1.x + -0.049942825*f1.x + -0.087746575*g1.x + 0.107465945*h1.x + 0.094088905*i1.x; + n = -0.15980811*a1.y + 0.043343157*b1.y + 0.112694*c1.y + -0.2359384*d1.y + 0.31993595*e1.y + 0.04207265*f1.y + -0.0896765*g1.y + 0.06047066*h1.y + 0.07702838*i1.y; + o = -0.027281009*a1.z + -0.053025093*b1.z + -0.026898835*c1.z + -0.21167403*d1.z + 0.11063941*e1.z + 0.21649761*f1.z + -0.0654316*g1.z + 0.0036047318*h1.z + -0.040679716*i1.z; + p = -0.09511372*a1.w + 0.07544163*b1.w + -0.068545476*c1.w + -0.11898356*d1.w + -0.12553929*e1.w + -0.036977906*f1.w + -0.05818198*g1.w + -0.18978088*h1.w + -0.12406578*i1.w; + q = 0.18537302*na0.x + 0.0471562*nb0.x + -0.024299944*nc0.x + 0.3394632*nd0.x + -0.070106596*ne0.x + 0.017024457*nf0.x + 0.050112784*ng0.x + 0.049462743*nh0.x + -0.06373756*ni0.x; + r = 0.01591681*na0.y + 0.118769474*nb0.y + -0.00033438014*nc0.y + 0.13797139*nd0.y + 0.24115679*ne0.y + -0.10003855*nf0.y + 0.17300089*ng0.y + -0.0046724756*nh0.y + -0.015399904*ni0.y; + s = -0.06551598*na0.z + 0.09221071*nb0.z + 0.06134306*nc0.z + -0.10775717*nd0.z + -0.21501426*ne0.z + 0.16960567*nf0.z + 0.019851804*ng0.z + -0.066120826*nh0.z + 0.04763201*ni0.z; + t = 0.034631733*na0.w + -0.006004178*nb0.w + -0.08292008*nc0.w + -0.11344495*nd0.w + 0.06891366*ne0.w + -0.13559465*nf0.w + -0.071880035*ng0.w + 0.09140712*nh0.w + -0.055761162*ni0.w; + u = 0.108538955*na1.x + 0.23723991*nb1.x + 0.13979872*nc1.x + 0.0026236933*nd1.x + -0.1712317*ne1.x + 0.18337625*nf1.x + -0.05319237*ng1.x + -0.084970586*nh1.x + -0.037275948*ni1.x; + v = 0.07666163*na1.y + -0.14426368*nb1.y + 0.08600506*nc1.y + 0.059441805*nd1.y + -0.03408525*ne1.y + 0.16753855*nf1.y + 0.11846989*ng1.y + -3.7933783e-05*nh1.y + -0.20521663*ni1.y; + w = 0.036177203*na1.z + -0.016836358*nb1.z + -0.029763628*nc1.z + 0.15060756*nd1.z + 0.04416379*ne1.z + -0.25545955*nf1.z + 0.045269053*ng1.z + -0.07570143*nh1.z + 0.049832813*ni1.z; + x = 0.0784876*na1.w + -0.02017831*nb1.w + -0.13643329*nc1.w + 0.09018697*nd1.w + -0.17120928*ne1.w + 0.10865079*nf1.w + 0.018973323*ng1.w + -0.11135826*nh1.w + 0.018946206*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0066723884; + i = -0.02766134*a0.x + -0.07910128*b0.x + 0.10000432*c0.x + -0.0077935955*d0.x + -0.18509458*e0.x + -0.04612191*f0.x + -0.07807891*g0.x + -0.027197784*h0.x + 0.040843934*i0.x; + j = 0.015636139*a0.y + 0.18825547*b0.y + 0.13782531*c0.y + -0.091497056*d0.y + -0.32420376*e0.y + -0.006751257*f0.y + -0.043966822*g0.y + 0.101294726*h0.y + 0.1581135*i0.y; + k = 0.08092526*a0.z + 0.06745233*b0.z + -0.0044060666*c0.z + -0.07794502*d0.z + 0.021141954*e0.z + -0.09169699*f0.z + 0.0025336859*g0.z + -0.056924406*h0.z + 0.08214582*i0.z; + l = 0.20671146*a0.w + -0.23547839*b0.w + 0.02666375*c0.w + 0.105076894*d0.w + -0.28910094*e0.w + 0.034965467*f0.w + 0.1268616*g0.w + 0.023588797*h0.w + -0.018232921*i0.w; + m = -0.028498547*a1.x + 0.116014436*b1.x + 0.09713531*c1.x + -0.05301735*d1.x + -0.29605877*e1.x + 0.061098687*f1.x + -0.07680063*g1.x + -0.02204858*h1.x + -0.078532085*i1.x; + n = -0.048041645*a1.y + -0.32098907*b1.y + -0.2454318*c1.y + -0.48134127*d1.y + -0.35850272*e1.y + 0.41497707*f1.y + -0.20349054*g1.y + 0.3936116*h1.y + -0.018326268*i1.y; + o = -0.14116973*a1.z + 0.02285499*b1.z + -0.07057403*c1.z + -0.09118363*d1.z + 0.37333208*e1.z + -0.20065124*f1.z + -0.026436245*g1.z + 0.16267431*h1.z + 0.11812809*i1.z; + p = -0.14101206*a1.w + -0.06963015*b1.w + -0.15444969*c1.w + 0.033450324*d1.w + -0.33700934*e1.w + -0.060848374*f1.w + 0.01683083*g1.w + -0.05332889*h1.w + -0.07328846*i1.w; + q = 0.051498156*na0.x + 0.16069268*nb0.x + 0.16637984*nc0.x + -0.0972913*nd0.x + -0.2021069*ne0.x + -0.030674994*nf0.x + -0.20328711*ng0.x + -0.07884667*nh0.x + 0.100347206*ni0.x; + r = -0.13863328*na0.y + 0.06469719*nb0.y + -0.088265724*nc0.y + -0.024668645*nd0.y + -0.19632864*ne0.y + 0.17612971*nf0.y + 0.02625999*ng0.y + -0.03309975*nh0.y + 0.07569001*ni0.y; + s = -0.075251035*na0.z + -0.050738305*nb0.z + 0.24210216*nc0.z + 0.13114996*nd0.z + -0.4864818*ne0.z + 0.06905125*nf0.z + 0.045289278*ng0.z + -0.10157096*nh0.z + -0.2800613*ni0.z; + t = -0.025999604*na0.w + 0.13178527*nb0.w + 0.044900127*nc0.w + 0.0607803*nd0.w + -0.09442027*ne0.w + -0.022236204*nf0.w + 0.18774076*ng0.w + -0.12149716*nh0.w + 0.05680034*ni0.w; + u = 0.088651866*na1.x + 0.027440932*nb1.x + -0.04109482*nc1.x + -0.1949932*nd1.x + -0.10897533*ne1.x + 0.07088638*nf1.x + -0.10386488*ng1.x + -0.11656961*nh1.x + -0.10445978*ni1.x; + v = 0.10474032*na1.y + 0.10221516*nb1.y + 0.15839252*nc1.y + 0.049012497*nd1.y + -0.2063483*ne1.y + 0.1840777*nf1.y + -0.043723542*ng1.y + 0.047894552*nh1.y + -0.009499964*ni1.y; + w = 0.4258637*na1.z + 0.18832234*nb1.z + -0.18723905*nc1.z + 0.10645866*nd1.z + -0.032949854*ne1.z + 0.12812077*nf1.z + 0.4025724*ng1.z + 0.12732601*nh1.z + 0.10769062*ni1.z; + x = -0.11810964*na1.w + 0.14253752*nb1.w + 0.042235278*nc1.w + 0.13767174*nd1.w + 0.2960284*ne1.w + -0.15177676*nf1.w + -0.0055533214*ng1.w + 0.09012071*nh1.w + 0.15953456*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.00672277; + i = 0.0012310629*a0.x + 0.19084314*b0.x + 0.11294963*c0.x + -0.0886832*d0.x + -0.16454856*e0.x + 0.037493285*f0.x + -0.004760058*g0.x + -0.12350646*h0.x + 0.07630086*i0.x; + j = -0.01957707*a0.y + -0.06819614*b0.y + 0.12367452*c0.y + 0.040409215*d0.y + -0.021836663*e0.y + 0.12864098*f0.y + -0.007157583*g0.y + 0.08941197*h0.y + 0.25203055*i0.y; + k = 0.020333389*a0.z + 0.11860472*b0.z + -0.00065172574*c0.z + 0.066716105*d0.z + 0.192155*e0.z + -0.000989324*f0.z + 0.0034235346*g0.z + 0.19203706*h0.z + 0.15892717*i0.z; + l = 0.07310296*a0.w + -0.05110208*b0.w + 0.11367794*c0.w + 0.033097357*d0.w + -0.06798024*e0.w + 0.08370761*f0.w + -0.14428368*g0.w + 0.11058313*h0.w + -0.029681815*i0.w; + m = -0.009701145*a1.x + 0.12630996*b1.x + 0.017602919*c1.x + -0.023853028*d1.x + -0.20952903*e1.x + -0.056210782*f1.x + -0.0733302*g1.x + -0.03288728*h1.x + 0.0049576587*i1.x; + n = -0.022181654*a1.y + -0.14963089*b1.y + -0.0068189222*c1.y + -0.15434141*d1.y + 0.14266609*e1.y + 0.34974262*f1.y + 0.14620017*g1.y + 0.12013395*h1.y + 0.15577218*i1.y; + o = -0.041419595*a1.z + 0.0049163126*b1.z + -0.0125360815*c1.z + -0.061257165*d1.z + 0.18954872*e1.z + -0.2485608*f1.z + -0.006892711*g1.z + 0.058746573*h1.z + -0.044149607*i1.z; + p = 0.011658519*a1.w + -0.090956636*b1.w + 0.03994311*c1.w + 0.070552535*d1.w + 0.06298112*e1.w + -0.028974736*f1.w + 0.0021537086*g1.w + 0.1029031*h1.w + 0.055890955*i1.w; + q = 0.0320352*na0.x + 0.14326142*nb0.x + 0.082991965*nc0.x + 0.21549419*nd0.x + -0.3395594*ne0.x + -0.024059823*nf0.x + 0.019351935*ng0.x + -0.1382331*nh0.x + -0.0304686*ni0.x; + r = 0.03710443*na0.y + 0.1930695*nb0.y + -0.14523448*nc0.y + 0.10579029*nd0.y + -0.05521899*ne0.y + -0.33665508*nf0.y + -0.10289396*ng0.y + 0.024678295*nh0.y + -0.059992127*ni0.y; + s = 0.026773388*na0.z + -0.0975856*nb0.z + 0.02035129*nc0.z + -0.044302266*nd0.z + -0.0270736*ne0.z + -0.13728258*nf0.z + -0.061705247*ng0.z + -0.02596695*nh0.z + -0.12971757*ni0.z; + t = -0.024138713*na0.w + 0.0155523615*nb0.w + -0.091659635*nc0.w + 0.010630842*nd0.w + 0.16401519*ne0.w + -0.06192334*nf0.w + -0.03184829*ng0.w + -0.051016547*nh0.w + -0.032736193*ni0.w; + u = 0.029396972*na1.x + -0.07129105*nb1.x + -0.0025841917*nc1.x + 0.074881524*nd1.x + 0.14281105*ne1.x + -0.114080995*nf1.x + -0.021587078*ng1.x + -0.08054726*nh1.x + -0.12657729*ni1.x; + v = -0.00041675888*na1.y + 0.0053440374*nb1.y + 0.005137936*nc1.y + -0.0135748*nd1.y + 0.04248027*ne1.y + -0.0016815509*nf1.y + -0.033098955*ng1.y + 0.036555868*nh1.y + 0.049444973*ni1.y; + w = 0.03400237*na1.z + 0.06084352*nb1.z + -0.04488614*nc1.z + -0.100054935*nd1.z + 0.025200516*ne1.z + 0.13285275*nf1.z + -0.1963087*ng1.z + -0.004163397*nh1.z + 0.14134736*ni1.z; + x = -0.0012568784*na1.w + 0.06601895*nb1.w + -0.110312514*nc1.w + -0.0034374476*nd1.w + 0.055813357*ne1.w + -0.1290571*nf1.w + 0.04696615*ng1.w + 0.03428323*nh1.w + -0.004907712*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.013123342; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN30 +//!BIND LUMAN31 +//!SAVE LUMAN40 + +#define L0_tex LUMAN30_tex +#define L1_tex LUMAN31_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.08536383*a0.x + 0.22057784*b0.x + -0.0070729763*c0.x + 0.036197208*d0.x + -0.07672289*e0.x + 0.104230516*f0.x + -0.027658395*g0.x + 0.037242346*h0.x + 0.080793746*i0.x; + float j = -0.028750127*a0.y + -0.113906324*b0.y + -0.07433507*c0.y + -0.045031663*d0.y + -0.06684857*e0.y + -0.044401973*f0.y + -0.0034719035*g0.y + -0.068872675*h0.y + -0.019946523*i0.y; + float k = 0.03557092*a0.z + -0.05054397*b0.z + 0.0036708773*c0.z + -0.06777095*d0.z + -0.09847624*e0.z + 0.03362397*f0.z + 0.012949831*g0.z + -0.023764836*h0.z + 0.052689515*i0.z; + float l = -0.027142372*a0.w + -0.07203122*b0.w + -0.06388474*c0.w + 0.01628509*d0.w + -0.22445866*e0.w + 0.024412872*f0.w + -0.008128143*g0.w + -0.067040876*h0.w + -0.06806653*i0.w; + float m = 0.03498277*a1.x + 0.039069988*b1.x + -0.013376671*c1.x + 0.23731333*d1.x + -0.01699014*e1.x + 0.010777388*f1.x + 0.045220964*g1.x + 0.016791182*h1.x + -0.06050448*i1.x; + float n = -0.010797193*a1.y + -0.039635405*b1.y + 0.018689604*c1.y + 0.04257897*d1.y + -0.0948216*e1.y + -0.039236613*f1.y + -0.016331976*g1.y + -0.048512593*h1.y + 0.0064482763*i1.y; + float o = 0.09766405*a1.z + 0.104419*b1.z + -0.076465145*c1.z + 0.0079194885*d1.z + -0.015444938*e1.z + -0.03390264*f1.z + -0.023632193*g1.z + 0.11754263*h1.z + -0.012952367*i1.z; + float p = 0.088692114*a1.w + 0.0014476123*b1.w + 0.10322219*c1.w + 0.069038235*d1.w + -0.061100803*e1.w + -0.048262775*f1.w + 0.09612743*g1.w + 0.058897*h1.w + 0.074676886*i1.w; + float q = -0.0036980624*na0.x + -0.024267241*nb0.x + 0.026586728*nc0.x + 0.035541214*nd0.x + -0.085665174*ne0.x + -0.1630016*nf0.x + 0.00490034*ng0.x + -0.08901139*nh0.x + -0.018733606*ni0.x; + float r = 0.013042566*na0.y + 0.14665644*nb0.y + 0.0055058184*nc0.y + -0.021425422*nd0.y + 0.16959174*ne0.y + -0.0129146585*nf0.y + -0.00012834472*ng0.y + 0.08471551*nh0.y + -0.05428125*ni0.y; + float s = -0.012737113*na0.z + 0.027404707*nb0.z + -0.01801338*nc0.z + 0.037341356*nd0.z + -0.17581393*ne0.z + -0.006813803*nf0.z + 0.030534925*ng0.z + -0.08039794*nh0.z + 0.051014334*ni0.z; + float t = -0.0140338885*na0.w + 0.14739423*nb0.w + 0.07582113*nc0.w + -0.053938482*nd0.w + 0.08839668*ne0.w + -0.037514362*nf0.w + -0.020815395*ng0.w + -0.023945889*nh0.w + 0.008050809*ni0.w; + float u = 0.083485134*na1.x + 0.037310943*nb1.x + 0.03057954*nc1.x + -0.09993926*nd1.x + 0.039829873*ne1.x + -0.06892306*nf1.x + 0.038759235*ng1.x + 0.005647801*nh1.x + 0.019709172*ni1.x; + float v = 0.081475616*na1.y + 0.048962787*nb1.y + 0.045870036*nc1.y + -0.098586746*nd1.y + 0.020431047*ne1.y + 0.012638942*nf1.y + -0.017170994*ng1.y + 7.067469e-05*nh1.y + 0.107078105*ni1.y; + float w = -0.045930725*na1.z + -0.040031545*nb1.z + 0.029053928*nc1.z + 0.0089001665*nd1.z + -0.08677615*ne1.z + 0.06877404*nf1.z + -0.009662309*ng1.z + -0.010047991*nh1.z + 0.003443427*ni1.z; + float x = 0.08166517*na1.w + -0.0028700489*nb1.w + -0.045297828*nc1.w + 0.052762747*nd1.w + 0.01898965*ne1.w + 0.038606808*nf1.w + 0.13621548*ng1.w + 0.11403761*nh1.w + -0.044998493*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.01725295; + i = -0.03088376*a0.x + -0.06506699*b0.x + 0.028759485*c0.x + 0.0063022817*d0.x + -0.23940088*e0.x + -0.1632248*f0.x + 0.0764616*g0.x + 0.042672176*h0.x + 0.17377013*i0.x; + j = 0.035214774*a0.y + -0.03817774*b0.y + -0.08883238*c0.y + -0.00111298*d0.y + -0.029566031*e0.y + -0.118429996*f0.y + 0.016505836*g0.y + -0.104897566*h0.y + -0.08694124*i0.y; + k = 0.09665161*a0.z + -0.029328583*b0.z + -0.0685033*c0.z + 0.1252019*d0.z + -0.090078555*e0.z + 0.010249423*f0.z + 0.03936791*g0.z + 0.24433094*h0.z + 0.07952615*i0.z; + l = -0.016106704*a0.w + -0.08684218*b0.w + 0.040539164*c0.w + -0.015498147*d0.w + 0.13228345*e0.w + -0.27393204*f0.w + -0.11668647*g0.w + -0.09482715*h0.w + 0.012399258*i0.w; + m = -0.1488633*a1.x + -0.065216005*b1.x + 0.0535183*c1.x + -0.051078368*d1.x + 0.15633519*e1.x + -0.08940123*f1.x + -0.1322567*g1.x + -0.08257876*h1.x + 0.009185964*i1.x; + n = -0.07108216*a1.y + -0.07719289*b1.y + 0.04625283*c1.y + -0.09986587*d1.y + -0.021199053*e1.y + -0.028616274*f1.y + 0.04687508*g1.y + 0.11452391*h1.y + 0.07083235*i1.y; + o = -0.11037789*a1.z + -0.051027145*b1.z + -0.19961402*c1.z + -0.13499379*d1.z + -0.0248805*e1.z + -0.21664341*f1.z + -0.12658863*g1.z + -0.30715507*h1.z + -0.06774432*i1.z; + p = 0.07840328*a1.w + 0.076184236*b1.w + 0.1698377*c1.w + 0.1683458*d1.w + 0.201538*e1.w + 0.15030397*f1.w + 0.034305293*g1.w + 0.0963635*h1.w + -0.0154249985*i1.w; + q = 0.02538238*na0.x + 0.09864331*nb0.x + 0.11035262*nc0.x + 0.024396792*nd0.x + 0.09908008*ne0.x + -0.013617436*nf0.x + -0.041231457*ng0.x + -0.0014901091*nh0.x + -0.19220696*ni0.x; + r = 0.04589675*na0.y + -0.010927794*nb0.y + 0.0038104362*nc0.y + -0.13047443*nd0.y + 0.044636056*ne0.y + 0.1223258*nf0.y + -0.09432054*ng0.y + -0.13457677*nh0.y + -0.1626453*ni0.y; + s = -0.06592902*na0.z + -0.10535102*nb0.z + -0.009799053*nc0.z + -0.022730127*nd0.z + 0.11826458*ne0.z + 0.07741324*nf0.z + -0.08576461*ng0.z + -0.21813503*nh0.z + 0.18526982*ni0.z; + t = -0.08173712*na0.w + 0.10438044*nb0.w + -0.08517764*nc0.w + 0.12938815*nd0.w + -0.17576784*ne0.w + -0.0072915126*nf0.w + 0.15446301*ng0.w + 0.016681919*nh0.w + 0.051581446*ni0.w; + u = 0.115558125*na1.x + -0.022121336*nb1.x + -0.0825352*nc1.x + 0.09382652*nd1.x + 0.04846142*ne1.x + 0.041536648*nf1.x + 0.15467171*ng1.x + 0.008293472*nh1.x + -0.050614562*ni1.x; + v = -0.003924168*na1.y + 0.1541878*nb1.y + -0.059138734*nc1.y + -0.028176788*nd1.y + -0.07557443*ne1.y + -0.14664999*nf1.y + -0.04713122*ng1.y + -0.041739505*nh1.y + -0.09211264*ni1.y; + w = -0.0975832*na1.z + -0.09730037*nb1.z + 0.09086173*nc1.z + -0.10395223*nd1.z + -0.00226716*ne1.z + 0.038585648*nf1.z + -0.047330752*ng1.z + 0.12446333*nh1.z + -0.01351817*ni1.z; + x = 0.2791586*na1.w + -0.076250456*nb1.w + -0.13428825*nc1.w + 0.048622146*nd1.w + -0.17240109*ne1.w + -0.09587715*nf1.w + -0.19276465*ng1.w + 0.07107969*nh1.w + 0.12039959*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.025054017; + i = -0.043591976*a0.x + 0.19324586*b0.x + -0.07647055*c0.x + 0.02770661*d0.x + -0.09756863*e0.x + 0.012610168*f0.x + 0.10716365*g0.x + -0.003939735*h0.x + 0.21686499*i0.x; + j = 0.028424889*a0.y + -0.027860237*b0.y + 0.024531493*c0.y + -0.0048383856*d0.y + -0.13793367*e0.y + -0.10382182*f0.y + -0.060784034*g0.y + -0.1279115*h0.y + -0.06899814*i0.y; + k = 0.03997191*a0.z + 0.07490852*b0.z + 0.058225974*c0.z + -0.0019495608*d0.z + -0.37614638*e0.z + 0.15587313*f0.z + -0.076541044*g0.z + 0.24963339*h0.z + 0.081270605*i0.z; + l = 0.07424056*a0.w + 0.024657438*b0.w + -0.052919507*c0.w + -0.20227009*d0.w + 0.046584353*e0.w + -0.059170544*f0.w + -0.19375145*g0.w + 0.03974534*h0.w + -0.05024785*i0.w; + m = 0.18138728*a1.x + -0.022965115*b1.x + -0.054253504*c1.x + -0.119478576*d1.x + 0.15398093*e1.x + 0.15598615*f1.x + 0.0581195*g1.x + 0.11262932*h1.x + -0.06966203*i1.x; + n = -0.10707376*a1.y + 0.033553954*b1.y + -0.10746114*c1.y + 0.08243729*d1.y + -0.0044641383*e1.y + -0.020447541*f1.y + 0.12454565*g1.y + 0.008655268*h1.y + 0.060918845*i1.y; + o = 0.029880892*a1.z + 0.11741621*b1.z + -0.05349719*c1.z + 0.25883275*d1.z + -0.10153349*e1.z + -0.11170519*f1.z + -0.018178564*g1.z + 0.13763513*h1.z + 0.11400469*i1.z; + p = -0.10463172*a1.w + -0.10077497*b1.w + 0.009877957*c1.w + -0.16648768*d1.w + 0.27668706*e1.w + 0.099615164*f1.w + 0.12298496*g1.w + 0.017380107*h1.w + 0.032301165*i1.w; + q = -0.055131678*na0.x + -0.04987668*nb0.x + -0.071181804*nc0.x + 0.005380595*nd0.x + -0.018658975*ne0.x + -0.10966231*nf0.x + 0.015993118*ng0.x + 0.0901746*nh0.x + -0.072906815*ni0.x; + r = 0.11788679*na0.y + 0.051318392*nb0.y + -0.018426865*nc0.y + -0.009329915*nd0.y + 0.118940435*ne0.y + 0.06237265*nf0.y + -0.10727782*ng0.y + 0.02792092*nh0.y + 0.018413879*ni0.y; + s = 0.02677677*na0.z + 0.034773823*nb0.z + -0.09717205*nc0.z + -0.18123712*nd0.z + 0.05084739*ne0.z + 0.009756145*nf0.z + -0.14528298*ng0.z + -0.17318346*nh0.z + 0.02436373*ni0.z; + t = 0.061065402*na0.w + -0.14666232*nb0.w + 0.020277957*nc0.w + -0.022936646*nd0.w + -0.20519575*ne0.w + -0.09254183*nf0.w + -0.017779186*ng0.w + -0.009078557*nh0.w + -0.019824954*ni0.w; + u = -0.19521299*na1.x + 0.13830769*nb1.x + 0.043815285*nc1.x + 0.058472138*nd1.x + -0.10857395*ne1.x + -0.07171282*nf1.x + 0.00773933*ng1.x + 0.12705073*nh1.x + 0.038176555*ni1.x; + v = 0.16605817*na1.y + -0.112485126*nb1.y + 0.097068876*nc1.y + -0.1400524*nd1.y + 0.010091068*ne1.y + 0.037447132*nf1.y + -0.08650508*ng1.y + -0.037930984*nh1.y + 0.023731159*ni1.y; + w = 0.104652576*na1.z + 0.047396503*nb1.z + -0.020233953*nc1.z + -0.063091435*nd1.z + 0.008213536*ne1.z + 0.12577772*nf1.z + 0.018698437*ng1.z + -0.05598111*nh1.z + 0.053034004*ni1.z; + x = -0.072743595*na1.w + 0.20017679*nb1.w + -0.020352483*nc1.w + -0.11213662*nd1.w + -0.0695337*ne1.w + -0.0844762*nf1.w + 0.21215153*ng1.w + -0.031425636*nh1.w + 0.02297093*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.013116349; + i = -0.035587903*a0.x + 0.28998992*b0.x + -0.09151781*c0.x + -0.0885913*d0.x + -0.18430325*e0.x + -0.08728831*f0.x + -0.08809791*g0.x + -0.12908792*h0.x + -0.13577425*i0.x; + j = 0.080175355*a0.y + 0.06254113*b0.y + 0.09340586*c0.y + 0.09902964*d0.y + 0.2341167*e0.y + -0.15395014*f0.y + 0.07856779*g0.y + 0.048811354*h0.y + 0.0030428942*i0.y; + k = 0.08139451*a0.z + 0.22830209*b0.z + 0.10671315*c0.z + 0.13054849*d0.z + -0.121118866*e0.z + 0.114327714*f0.z + 0.2536303*g0.z + -0.04966182*h0.z + -0.03836721*i0.z; + l = -0.030240182*a0.w + 0.037857987*b0.w + 0.039160606*c0.w + -0.025005141*d0.w + 0.10855964*e0.w + -0.2704116*f0.w + 0.10738485*g0.w + 0.055243604*h0.w + -0.05044504*i0.w; + m = 0.0509642*a1.x + -0.084604576*b1.x + 0.116994545*c1.x + 0.21990353*d1.x + 0.06141327*e1.x + -0.10694696*f1.x + -0.2123716*g1.x + -0.24490428*h1.x + -0.02086803*i1.x; + n = -0.029533416*a1.y + -0.029786944*b1.y + -0.14562476*c1.y + -0.08382081*d1.y + 0.05943508*e1.y + -0.14098302*f1.y + -0.15943012*g1.y + -0.06873147*h1.y + 0.040483374*i1.y; + o = -0.13607192*a1.z + 0.03382944*b1.z + -0.08697416*c1.z + -0.09518328*d1.z + -0.024908481*e1.z + -0.002681208*f1.z + 0.000790745*g1.z + -0.20081358*h1.z + -0.17025524*i1.z; + p = -0.04001146*a1.w + -0.19817154*b1.w + -0.0867182*c1.w + -0.07767924*d1.w + 0.23588526*e1.w + 0.03359696*f1.w + 0.053512283*g1.w + -0.15246984*h1.w + 0.096771784*i1.w; + q = -0.07844516*na0.x + -0.13646075*nb0.x + 0.13378*nc0.x + 0.00081356516*nd0.x + 0.36044842*ne0.x + 0.03636914*nf0.x + -0.14159712*ng0.x + -0.12730932*nh0.x + 0.07580974*ni0.x; + r = 0.12939188*na0.y + 0.1376879*nb0.y + 0.09112592*nc0.y + 0.0052671693*nd0.y + 0.2309594*ne0.y + 0.26507932*nf0.y + -0.053765927*ng0.y + -0.057173535*nh0.y + 0.14044432*ni0.y; + s = 0.053574387*na0.z + -0.1098049*nb0.z + -0.03359242*nc0.z + -0.009376764*nd0.z + -0.026915615*ne0.z + -0.24570042*nf0.z + 0.12763985*ng0.z + -0.33731624*nh0.z + -0.00048419682*ni0.z; + t = 0.050085705*na0.w + -0.065321915*nb0.w + -0.13701434*nc0.w + 0.17681946*nd0.w + -0.15797354*ne0.w + -0.15324375*nf0.w + -0.106378034*ng0.w + 0.100880235*nh0.w + 0.04465426*ni0.w; + u = -0.05654472*na1.x + 0.0327931*nb1.x + -0.09484717*nc1.x + -0.0029626698*nd1.x + 0.10992431*ne1.x + 0.12324815*nf1.x + 0.12251335*ng1.x + 0.103057526*nh1.x + 0.053130142*ni1.x; + v = 0.062485415*na1.y + 0.13917658*nb1.y + 0.1527197*nc1.y + 0.012253399*nd1.y + -0.12345317*ne1.y + -0.012620613*nf1.y + -0.06488545*ng1.y + 0.10458118*nh1.y + -0.09761376*ni1.y; + w = -0.009200393*na1.z + -0.07518724*nb1.z + 0.06756176*nc1.z + -0.060130857*nd1.z + -0.0025904253*ne1.z + -0.018850297*nf1.z + -0.018455606*ng1.z + 0.11698259*nh1.z + -0.06945231*ni1.z; + x = -0.038078338*na1.w + 0.28164002*nb1.w + 0.15806901*nc1.w + 0.049810838*nd1.w + -0.29538316*ne1.w + 0.09279826*nf1.w + -0.3216003*ng1.w + -0.0039241235*nh1.w + 0.107743636*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.00022777569; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN30 +//!BIND LUMAN31 +//!SAVE LUMAN41 + +#define L0_tex LUMAN30_tex +#define L1_tex LUMAN31_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.054257732*a0.x + 0.27371246*b0.x + -0.052580442*c0.x + 0.0821893*d0.x + -0.103322186*e0.x + -0.24418627*f0.x + 0.0611493*g0.x + 0.07409564*h0.x + -0.0091123395*i0.x; + float j = 0.011560797*a0.y + 0.104165755*b0.y + 0.109339796*c0.y + -0.010434488*d0.y + 0.0779517*e0.y + -0.1448543*f0.y + 0.060612075*g0.y + 0.05546987*h0.y + 0.062975384*i0.y; + float k = -0.07776099*a0.z + -0.088368*b0.z + 0.038915366*c0.z + -0.0038091897*d0.z + -0.18550852*e0.z + 0.042044386*f0.z + -0.13174416*g0.z + -0.05231247*h0.z + 0.021248076*i0.z; + float l = -0.11482602*a0.w + -0.22810052*b0.w + -0.020931996*c0.w + -0.19848773*d0.w + 0.017370276*e0.w + 0.11224409*f0.w + -0.1283919*g0.w + -0.0064690793*h0.w + -0.108108915*i0.w; + float m = -0.21868303*a1.x + -0.1460253*b1.x + -0.02056819*c1.x + -0.2683982*d1.x + 0.02188942*e1.x + -0.044143774*f1.x + -0.1582242*g1.x + -0.04801052*h1.x + 0.002758771*i1.x; + float n = 0.02125123*a1.y + 0.046871092*b1.y + 0.034314208*c1.y + 0.14033747*d1.y + -0.06737769*e1.y + -0.05111058*f1.y + 0.045157064*g1.y + -0.087649085*h1.y + -0.07641853*i1.y; + float o = 0.020611035*a1.z + -0.08709827*b1.z + -0.058960218*c1.z + 0.09095107*d1.z + -0.15974514*e1.z + -0.03847971*f1.z + -0.034782387*g1.z + 0.09239257*h1.z + -0.033537846*i1.z; + float p = 0.10096098*a1.w + 0.045786828*b1.w + 0.12547746*c1.w + -0.036246233*d1.w + 0.41335067*e1.w + -0.097790875*f1.w + 0.18755811*g1.w + -0.019576516*h1.w + -0.021100365*i1.w; + float q = 0.053558517*na0.x + -0.103455506*nb0.x + 0.07568259*nc0.x + -0.1341594*nd0.x + -0.27883413*ne0.x + 0.12920994*nf0.x + -0.051551364*ng0.x + -0.14494799*nh0.x + 0.060187746*ni0.x; + float r = 0.0035913682*na0.y + 0.034207687*nb0.y + -0.16305931*nc0.y + 0.16384187*nd0.y + -0.3219198*ne0.y + -0.07760979*nf0.y + 0.024765978*ng0.y + 0.14511627*nh0.y + -0.02396373*ni0.y; + float s = 0.064441316*na0.z + -0.06812652*nb0.z + -0.023528796*nc0.z + 0.023931213*nd0.z + 0.07976284*ne0.z + -0.08934557*nf0.z + 0.112490386*ng0.z + -0.0018943544*nh0.z + 0.09055857*ni0.z; + float t = 0.010761819*na0.w + 0.19307621*nb0.w + -0.018758457*nc0.w + 0.117349915*nd0.w + -0.49189666*ne0.w + -0.073640645*nf0.w + 0.14908928*ng0.w + -0.05187949*nh0.w + 0.037098415*ni0.w; + float u = 0.17489052*na1.x + 0.10258782*nb1.x + -0.011808832*nc1.x + 0.41893494*nd1.x + -0.006189705*ne1.x + -0.005704103*nf1.x + 0.1725503*ng1.x + 0.037721056*nh1.x + 0.032897796*ni1.x; + float v = 0.09965535*na1.y + -0.00053941424*nb1.y + -0.020717151*nc1.y + -0.16562484*nd1.y + -0.19280563*ne1.y + 0.023265366*nf1.y + -0.09598055*ng1.y + 0.07879483*nh1.y + 0.12717162*ni1.y; + float w = -0.006158638*na1.z + -0.036102273*nb1.z + 0.046437833*nc1.z + -0.07120665*nd1.z + 0.07908869*ne1.z + 0.06220462*nf1.z + -0.03583926*ng1.z + -0.0023331905*nh1.z + -0.04308482*ni1.z; + float x = 0.025252044*na1.w + -0.13039218*nb1.w + -0.049975194*nc1.w + 0.3390306*nd1.w + -0.36262757*ne1.w + 0.121574536*nf1.w + 0.008622063*ng1.w + 0.13189486*nh1.w + 0.013918466*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0146441385; + i = -0.013898038*a0.x + -0.03979066*b0.x + 0.013716644*c0.x + -0.05803892*d0.x + -0.17036788*e0.x + -0.3342159*f0.x + 0.04831618*g0.x + 0.24438389*h0.x + 0.02146156*i0.x; + j = 0.022180267*a0.y + 0.06300591*b0.y + 0.12514699*c0.y + 0.031278454*d0.y + -0.11972857*e0.y + 0.19775085*f0.y + -0.015505284*g0.y + 0.010023316*h0.y + -0.025825808*i0.y; + k = 0.014485555*a0.z + 0.26375902*b0.z + 0.0076107443*c0.z + 0.17171423*d0.z + 0.5273228*e0.z + 0.01864456*f0.z + -0.22563499*g0.z + 0.0170489*h0.z + 0.28598356*i0.z; + l = 0.047197193*a0.w + -0.017492149*b0.w + 0.011938872*c0.w + 0.07983482*d0.w + -0.2200942*e0.w + -0.4455703*f0.w + -0.10833807*g0.w + 0.0022238574*h0.w + -0.058342494*i0.w; + m = -0.147014*a1.x + -0.034537677*b1.x + 0.055885065*c1.x + 0.12269109*d1.x + -0.29608414*e1.x + -0.13602276*f1.x + -0.024383334*g1.x + -0.041556574*h1.x + -0.0045015765*i1.x; + n = -0.003671958*a1.y + -0.10448101*b1.y + -0.12877181*c1.y + -0.18488549*d1.y + -0.20216179*e1.y + 0.027074011*f1.y + 0.03869564*g1.y + 0.035818394*h1.y + 0.04081701*i1.y; + o = -0.059633434*a1.z + -0.3231465*b1.z + -0.09229924*c1.z + -0.034015656*d1.z + -0.31763735*e1.z + -0.18460466*f1.z + -0.14652348*g1.z + -0.086540945*h1.z + -0.18895042*i1.z; + p = -0.034059793*a1.w + 0.1330705*b1.w + -0.008831851*c1.w + 0.09408874*d1.w + 0.23037615*e1.w + 0.18210898*f1.w + 0.1452968*g1.w + -0.062167976*h1.w + -0.017864835*i1.w; + q = -0.20313866*na0.x + 0.18900125*nb0.x + 0.03937197*nc0.x + -0.05634852*nd0.x + -0.4738788*ne0.x + -0.045856085*nf0.x + -0.078206174*ng0.x + -0.06023494*nh0.x + -0.06339165*ni0.x; + r = 0.19454652*na0.y + 0.34385923*nb0.y + -0.0041349703*nc0.y + 0.08996544*nd0.y + 0.2569007*ne0.y + -0.2474613*nf0.y + -0.024326248*ng0.y + 0.023791725*nh0.y + -0.32401955*ni0.y; + s = 0.116586015*na0.z + -0.18811816*nb0.z + -0.14147806*nc0.z + -0.10564098*nd0.z + -0.11500905*ne0.z + -0.061058026*nf0.z + 0.08801095*ng0.z + 0.45184898*nh0.z + 0.09909426*ni0.z; + t = -0.01624822*na0.w + -0.17384705*nb0.w + -0.034403823*nc0.w + 0.14754735*nd0.w + -0.19339335*ne0.w + 0.11690697*nf0.w + 0.124998204*ng0.w + 0.04661684*nh0.w + -0.033586837*ni0.w; + u = -0.0065229195*na1.x + -0.13284405*nb1.x + -0.023017338*nc1.x + -0.07398193*nd1.x + 0.4825102*ne1.x + 0.08925245*nf1.x + 0.05063243*ng1.x + -0.009413221*nh1.x + -0.02179575*ni1.x; + v = 0.10751584*na1.y + 0.12421872*nb1.y + 0.15576623*nc1.y + -0.07117823*nd1.y + -0.12944762*ne1.y + -0.020601777*nf1.y + -0.055569127*ng1.y + 0.0517449*nh1.y + -0.026469603*ni1.y; + w = 0.06402894*na1.z + -0.02451236*nb1.z + -0.009025469*nc1.z + -0.06993758*nd1.z + 0.046909396*ne1.z + 0.075585544*nf1.z + -0.03814493*ng1.z + 0.102764644*nh1.z + 0.118356474*ni1.z; + x = 0.24888949*na1.w + -0.044692367*nb1.w + 0.06531858*nc1.w + 0.09090876*nd1.w + 0.023833174*ne1.w + -0.23695849*nf1.w + -0.092104465*ng1.w + -0.066167325*nh1.w + 0.22259745*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.03182151; + i = -0.055676714*a0.x + -0.25448143*b0.x + 0.18013322*c0.x + -0.016296074*d0.x + 0.35178718*e0.x + 0.086339705*f0.x + -0.12396428*g0.x + -0.17678769*h0.x + 0.045469724*i0.x; + j = -0.023601016*a0.y + -0.1515943*b0.y + 0.06641525*c0.y + 0.14069307*d0.y + -0.09185563*e0.y + 0.0009995411*f0.y + -0.01795657*g0.y + -0.20260298*h0.y + 0.13007584*i0.y; + k = 0.050869405*a0.z + 0.03870583*b0.z + 0.11086443*c0.z + 0.3541734*d0.z + 0.2433259*e0.z + -0.2360573*f0.z + 0.256418*g0.z + 0.26638928*h0.z + 0.04232309*i0.z; + l = 0.006167372*a0.w + -0.08807704*b0.w + 0.010333488*c0.w + 0.1846896*d0.w + 0.20306796*e0.w + -0.1017967*f0.w + 0.04408679*g0.w + 0.009385814*h0.w + 0.0812451*i0.w; + m = 0.11955763*a1.x + -0.0019768341*b1.x + -0.0011848988*c1.x + -0.11757946*d1.x + 0.09276894*e1.x + 0.024858102*f1.x + -0.21629071*g1.x + 0.030862717*h1.x + -0.02532812*i1.x; + n = 0.03326022*a1.y + 0.00015413002*b1.y + -0.16767214*c1.y + 0.123497516*d1.y + 0.24444306*e1.y + 0.2712187*f1.y + -0.030230884*g1.y + -0.082629666*h1.y + -0.024234135*i1.y; + o = -0.009569331*a1.z + 0.03957016*b1.z + -0.009828169*c1.z + -0.18476558*d1.z + 0.11622815*e1.z + -0.054776173*f1.z + 0.36828658*g1.z + -0.21097352*h1.z + -0.1212632*i1.z; + p = -0.049165506*a1.w + -0.025031764*b1.w + -0.045519356*c1.w + -0.45892698*d1.w + -0.08665716*e1.w + 0.17259243*f1.w + -0.3446269*g1.w + 0.08124788*h1.w + 0.0474314*i1.w; + q = -0.013619317*na0.x + 0.08601415*nb0.x + 0.042602405*nc0.x + -0.29564625*nd0.x + -0.4379702*ne0.x + -0.24080415*nf0.x + -0.07202186*ng0.x + 0.023242502*nh0.x + -0.08246445*ni0.x; + r = -0.06685381*na0.y + 0.48487332*nb0.y + 0.23622492*nc0.y + -0.2997885*nd0.y + -0.41947487*ne0.y + -0.084841214*nf0.y + -0.18672894*ng0.y + -0.26829925*nh0.y + -0.1523847*ni0.y; + s = -0.11687069*na0.z + 0.10023403*nb0.z + -0.09487604*nc0.z + -0.18753096*nd0.z + 0.30460224*ne0.z + 0.0039108214*nf0.z + -0.09877181*ng0.z + -0.23594226*nh0.z + 0.12037597*ni0.z; + t = -0.034343548*na0.w + -0.036309738*nb0.w + -0.12448924*nc0.w + -0.16076897*nd0.w + -0.07157816*ne0.w + 0.09196994*nf0.w + 0.24514483*ng0.w + -0.0071206214*nh0.w + -0.038094837*ni0.w; + u = 0.0572477*na1.x + -0.016320515*nb1.x + 0.0053648325*nc1.x + -0.10834618*nd1.x + -0.099836186*ne1.x + -0.011570353*nf1.x + -0.0221365*ng1.x + 0.07518451*nh1.x + -0.022385065*ni1.x; + v = -0.14453459*na1.y + 0.1577858*nb1.y + 0.21396358*nc1.y + -0.042960834*nd1.y + -0.06931992*ne1.y + -0.20045131*nf1.y + 0.10752383*ng1.y + 0.11698326*nh1.y + -0.0103794895*ni1.y; + w = -0.01758386*na1.z + -0.111778334*nb1.z + 0.018639343*nc1.z + 0.21834186*nd1.z + 0.027805107*ne1.z + 0.1141556*nf1.z + -0.20649067*ng1.z + 0.12635934*nh1.z + 0.04264156*ni1.z; + x = 0.059818614*na1.w + 0.15443759*nb1.w + 0.15723677*nc1.w + -0.10244512*nd1.w + 0.3773032*ne1.w + -0.2509182*nf1.w + -0.04801961*ng1.w + 0.11025253*nh1.w + -0.03324385*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.029252391; + i = -0.11146781*a0.x + -0.13930416*b0.x + -0.012807164*c0.x + -0.16427898*d0.x + 0.035926312*e0.x + -0.32527724*f0.x + -0.10702975*g0.x + 0.10439494*h0.x + 0.0599904*i0.x; + j = 0.048776623*a0.y + -0.038230047*b0.y + -0.11723245*c0.y + -0.13150196*d0.y + -0.2554953*e0.y + -0.3719466*f0.y + -0.12187547*g0.y + -0.017176606*h0.y + -0.29902893*i0.y; + k = -0.17713442*a0.z + -0.05686459*b0.z + -0.10990948*c0.z + -0.14846052*d0.z + -0.3923777*e0.z + -0.046105888*f0.z + -0.09068917*g0.z + -0.07364397*h0.z + 0.12608323*i0.z; + l = 0.049529247*a0.w + 0.01276487*b0.w + -0.1421581*c0.w + 0.20870978*d0.w + 0.30118164*e0.w + 0.15338081*f0.w + 0.048369683*g0.w + -0.01961338*h0.w + 0.14480333*i0.w; + m = -0.051235564*a1.x + -0.029327184*b1.x + 0.015349697*c1.x + -0.20066127*d1.x + 0.23792872*e1.x + 0.0793269*f1.x + 0.049080133*g1.x + 0.22532736*h1.x + 0.18527938*i1.x; + n = -0.012327854*a1.y + 0.14383848*b1.y + 0.11006613*c1.y + -0.21115981*d1.y + 0.02891759*e1.y + 0.08358382*f1.y + 0.03262832*g1.y + -0.1486431*h1.y + 0.06767234*i1.y; + o = 0.061599392*a1.z + -0.050808303*b1.z + -0.08906126*c1.z + 0.11978335*d1.z + -0.13210684*e1.z + -0.20221381*f1.z + -0.032080967*g1.z + -0.1130153*h1.z + 0.23689748*i1.z; + p = -0.023339517*a1.w + 0.08052153*b1.w + 0.13133153*c1.w + 0.27531967*d1.w + 0.20974505*e1.w + 0.27152357*f1.w + -0.013597851*g1.w + 0.1377039*h1.w + -0.22347575*i1.w; + q = 0.063578114*na0.x + 0.19848521*nb0.x + -0.14250876*nc0.x + 0.20224428*nd0.x + -0.041862875*ne0.x + 0.0135630295*nf0.x + -0.032130726*ng0.x + 0.15371478*nh0.x + -0.0057651824*ni0.x; + r = -0.071654126*na0.y + -0.003993231*nb0.y + 0.09714553*nc0.y + -0.055221733*nd0.y + -0.30018488*ne0.y + 0.095710516*nf0.y + -0.11766741*ng0.y + -0.25716934*nh0.y + 0.029781904*ni0.y; + s = 0.0092608*na0.z + -0.17544937*nb0.z + 0.04323492*nc0.z + -0.15429379*nd0.z + -0.16374534*ne0.z + 0.16135879*nf0.z + -0.13333586*ng0.z + 0.21047768*nh0.z + 0.14531775*ni0.z; + t = 0.059168484*na0.w + 0.054052614*nb0.w + 0.0912373*nc0.w + -0.27993843*nd0.w + -0.18782286*ne0.w + 0.12640288*nf0.w + -0.04521121*ng0.w + -0.24763185*nh0.w + 0.056749433*ni0.w; + u = 0.16253576*na1.x + 0.32441705*nb1.x + 0.09456559*nc1.x + 0.19797282*nd1.x + 0.0057451613*ne1.x + -0.0038693126*nf1.x + 0.28363606*ng1.x + -0.09297955*nh1.x + -0.034141365*ni1.x; + v = -0.05110465*na1.y + -0.1417263*nb1.y + -0.21924758*nc1.y + 0.11003367*nd1.y + -0.1469238*ne1.y + -0.06051238*nf1.y + 0.07040412*ng1.y + 0.004858706*nh1.y + -0.029183824*ni1.y; + w = 0.11109892*na1.z + -0.010970046*nb1.z + -0.019303208*nc1.z + -0.06718125*nd1.z + -0.19049284*ne1.z + 0.037818458*nf1.z + -0.031651754*ng1.z + 0.20565633*nh1.z + 0.054614466*ni1.z; + x = -0.07991577*na1.w + -0.020427423*nb1.w + -0.051706005*nc1.w + -0.39715537*nd1.w + 0.15884823*ne1.w + -0.075157814*nf1.w + 0.1896494*ng1.w + -0.19617552*nh1.w + 0.034390915*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.021990512; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN40 +//!BIND LUMAN41 +//!SAVE LUMAN50 + +#define L0_tex LUMAN40_tex +#define L1_tex LUMAN41_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.03901763*a0.x + 0.042043958*b0.x + 0.20759591*c0.x + 0.07238248*d0.x + -0.03175368*e0.x + 0.42647663*f0.x + 0.063095406*g0.x + 0.17951673*h0.x + 0.56211257*i0.x; + float j = 0.017079493*a0.y + 0.018908331*b0.y + 0.12611814*c0.y + 0.1692957*d0.y + 0.10425174*e0.y + -0.009320183*f0.y + 0.07855408*g0.y + 0.12618572*h0.y + 0.0056016305*i0.y; + float k = 0.003895585*a0.z + -0.12828486*b0.z + 0.007352829*c0.z + 0.041258164*d0.z + -0.18446647*e0.z + 0.0014502462*f0.z + 0.122117795*g0.z + 0.028269382*h0.z + 0.05895878*i0.z; + float l = -0.034471042*a0.w + 0.11535646*b0.w + -0.08276919*c0.w + -0.1517208*d0.w + 0.13121732*e0.w + -0.014896526*f0.w + 0.059614662*g0.w + 0.007029084*h0.w + -0.026446465*i0.w; + float m = -0.014367774*a1.x + -0.01154789*b1.x + 0.116640516*c1.x + 0.012053954*d1.x + 0.08732725*e1.x + 0.3481207*f1.x + -0.043433346*g1.x + 0.24575688*h1.x + -0.08716174*i1.x; + float n = -0.083043255*a1.y + -0.0018384286*b1.y + 0.077247486*c1.y + -0.10015612*d1.y + -0.02895449*e1.y + -0.0034695133*f1.y + -0.08432179*g1.y + -0.018412631*h1.y + 0.048789904*i1.y; + float o = -0.02007061*a1.z + 0.019421883*b1.z + 0.020988448*c1.z + 0.06899935*d1.z + 0.08572854*e1.z + 0.022193762*f1.z + -0.024855195*g1.z + 0.0017533574*h1.z + -0.12034477*i1.z; + float p = -0.029753547*a1.w + 0.056169406*b1.w + -0.02607546*c1.w + -0.13830246*d1.w + 0.11301596*e1.w + -0.10754139*f1.w + 0.030982474*g1.w + -0.12194179*h1.w + -0.036577355*i1.w; + float q = 0.056209657*na0.x + 0.14330581*nb0.x + 0.025293726*nc0.x + -0.21342021*nd0.x + -0.084453605*ne0.x + 0.115266524*nf0.x + -0.12682225*ng0.x + -0.3689846*nh0.x + -0.07184923*ni0.x; + float r = 0.049175244*na0.y + 0.0051955744*nb0.y + -0.161476*nc0.y + -0.27953863*nd0.y + -0.3501893*ne0.y + -0.029806182*nf0.y + -0.13269718*ng0.y + -0.078298844*nh0.y + -0.100507766*ni0.y; + float s = -0.021728419*na0.z + 0.2949833*nb0.z + 0.04041976*nc0.z + -0.22645602*nd0.z + 0.0043244623*ne0.z + -0.07251154*nf0.z + -0.04249778*ng0.z + -0.022189863*nh0.z + 0.034809884*ni0.z; + float t = -0.04636795*na0.w + -0.070915006*nb0.w + 0.16660848*nc0.w + -0.038829613*nd0.w + -0.018555382*ne0.w + 0.090619646*nf0.w + -0.063014254*ng0.w + 0.041635923*nh0.w + 0.04670918*ni0.w; + float u = -0.08293028*na1.x + -0.10538213*nb1.x + -0.05078218*nc1.x + -0.009467721*nd1.x + -0.24456158*ne1.x + -0.042963307*nf1.x + -0.050950877*ng1.x + -0.12885745*nh1.x + 0.032130353*ni1.x; + float v = 0.008749523*na1.y + 0.075966515*nb1.y + -0.07249367*nc1.y + 0.08500086*nd1.y + -0.034895904*ne1.y + 0.0063278098*nf1.y + 0.11463324*ng1.y + 0.16510871*nh1.y + 0.11060035*ni1.y; + float w = 0.0145977605*na1.z + -0.011436806*nb1.z + -0.14411648*nc1.z + -0.09809371*nd1.z + -0.11482118*ne1.z + 0.02429512*nf1.z + 0.045754995*ng1.z + 0.0038492538*nh1.z + 0.016950041*ni1.z; + float x = -0.00016985212*na1.w + -0.21708094*nb1.w + -0.015174203*nc1.w + 0.11822005*nd1.w + -0.07034816*ne1.w + 0.09898518*nf1.w + -0.026325967*ng1.w + 0.04686595*nh1.w + -0.090023234*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.023285406; + i = -0.010824311*a0.x + -0.051164586*b0.x + 0.27670133*c0.x + 0.025654908*d0.x + -0.16047996*e0.x + 0.101701476*f0.x + 0.20869365*g0.x + 0.1551052*h0.x + -0.04961477*i0.x; + j = -0.04719406*a0.y + -0.07095295*b0.y + -0.04231228*c0.y + 0.07927513*d0.y + 0.38385487*e0.y + -0.01641401*f0.y + 0.088219166*g0.y + 0.13669278*h0.y + 0.20710975*i0.y; + k = 0.037131984*a0.z + -0.21383446*b0.z + 0.03858047*c0.z + -0.07852924*d0.z + 0.011736041*e0.z + -0.018761475*f0.z + -0.09981803*g0.z + -0.12974207*h0.z + 0.03911999*i0.z; + l = 0.02382806*a0.w + -0.10670318*b0.w + 0.011510644*c0.w + -0.1161868*d0.w + 0.0041843294*e0.w + 0.016270278*f0.w + 0.069239296*g0.w + -0.028811965*h0.w + -0.04534862*i0.w; + m = -0.044963628*a1.x + -0.01751885*b1.x + -0.10190605*c1.x + 0.059436988*d1.x + 0.14531457*e1.x + -0.23966753*f1.x + -0.1271861*g1.x + -0.07273356*h1.x + 0.07296893*i1.x; + n = 0.022063058*a1.y + 0.06588515*b1.y + -0.02025325*c1.y + -0.074304804*d1.y + -0.3432966*e1.y + 0.03045909*f1.y + -0.12180348*g1.y + -0.051952507*h1.y + 0.016071681*i1.y; + o = -0.026687931*a1.z + -0.011702836*b1.z + -0.018618263*c1.z + -0.09509828*d1.z + -0.13936874*e1.z + 0.09854914*f1.z + -0.065601945*g1.z + -0.041659098*h1.z + -0.041994475*i1.z; + p = -0.033111252*a1.w + -0.12730075*b1.w + -0.042272773*c1.w + 0.07217914*d1.w + 0.15409409*e1.w + -0.0044050133*f1.w + -0.013193102*g1.w + -0.028257802*h1.w + -0.102279514*i1.w; + q = -0.0011312288*na0.x + -0.039966878*nb0.x + 0.008169095*nc0.x + 0.1176138*nd0.x + -0.23989339*ne0.x + -0.018491985*nf0.x + -0.1523537*ng0.x + -0.010189696*nh0.x + 0.0815769*ni0.x; + r = 0.01800503*na0.y + 0.15263285*nb0.y + 0.04650022*nc0.y + -0.13463746*nd0.y + -0.27009314*ne0.y + 0.01367243*nf0.y + -0.22182891*ng0.y + -0.19270231*nh0.y + -0.11944978*ni0.y; + s = 0.18900774*na0.z + 0.2452615*nb0.z + 0.019770019*nc0.z + 0.0037184495*nd0.z + 0.07873577*ne0.z + 0.1459445*nf0.z + 0.16317609*ng0.z + 0.18358271*nh0.z + -0.005921751*ni0.z; + t = -0.001758597*na0.w + -0.04255167*nb0.w + -0.039924048*nc0.w + 0.07788507*nd0.w + 0.02266053*ne0.w + -0.048366588*nf0.w + 0.09384315*ng0.w + 0.10784829*nh0.w + 0.07399594*ni0.w; + u = -0.05568954*na1.x + -0.16227238*nb1.x + -0.18156245*nc1.x + -0.12531707*nd1.x + -0.041247047*ne1.x + -0.09639712*nf1.x + 0.033412196*ng1.x + -0.05420894*nh1.x + -0.093623616*ni1.x; + v = 0.034429446*na1.y + -0.06343978*nb1.y + 0.02254936*nc1.y + 0.0943558*nd1.y + 0.42765942*ne1.y + 0.06764561*nf1.y + 0.07859029*ng1.y + 0.01776498*nh1.y + -0.022389429*ni1.y; + w = -0.017445106*na1.z + -0.1185644*nb1.z + -0.08676281*nc1.z + -0.06505645*nd1.z + -0.034937456*ne1.z + -0.15074748*nf1.z + 0.021122504*ng1.z + 0.0059979744*nh1.z + 0.10534208*ni1.z; + x = -0.00053062243*na1.w + 0.0734179*nb1.w + -0.06674257*nc1.w + -0.121134385*nd1.w + 0.10454449*ne1.w + -0.097229205*nf1.w + -0.14843033*ng1.w + 0.039904114*nh1.w + 0.123104535*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.03842096; + i = 0.09437239*a0.x + 0.13398713*b0.x + 0.1979105*c0.x + -0.13101088*d0.x + 0.3024643*e0.x + 0.21643195*f0.x + 0.17110038*g0.x + 0.25579646*h0.x + 0.491231*i0.x; + j = 0.119239025*a0.y + -0.005078826*b0.y + 0.06520955*c0.y + -0.07381558*d0.y + -0.20958072*e0.y + 0.12261875*f0.y + 0.005449452*g0.y + 0.024978561*h0.y + -0.018444*i0.y; + k = 0.11646403*a0.z + 0.04598884*b0.z + 0.18244609*c0.z + -0.17297442*d0.z + -0.3503025*e0.z + 0.028473197*f0.z + 0.009787073*g0.z + 0.12604016*h0.z + 0.03578933*i0.z; + l = -0.13558882*a0.w + -0.0004211131*b0.w + 0.017237354*c0.w + -0.010725203*d0.w + 0.038099974*e0.w + -0.039385892*f0.w + -0.09769444*g0.w + -0.10143334*h0.w + 0.091641724*i0.w; + m = -0.04192423*a1.x + 0.08233079*b1.x + 0.11315233*c1.x + 0.009459983*d1.x + 0.094343804*e1.x + 0.21664256*f1.x + 0.037537515*g1.x + -0.018830419*h1.x + -0.10526479*i1.x; + n = -0.0118954545*a1.y + 0.20957565*b1.y + 0.23365454*c1.y + 0.008078816*d1.y + 0.14520495*e1.y + 0.15520053*f1.y + -0.076743595*g1.y + 0.19146152*h1.y + -0.059763126*i1.y; + o = -0.0321574*a1.z + 0.056251407*b1.z + 0.061999843*c1.z + -0.03410336*d1.z + 0.042447362*e1.z + 0.17759623*f1.z + -0.0075536836*g1.z + 0.07079352*h1.z + -0.023566507*i1.z; + p = -0.056103203*a1.w + -0.10488084*b1.w + -0.20350598*c1.w + -0.037546467*d1.w + -0.1716325*e1.w + -0.18705478*f1.w + -0.11137474*g1.w + -0.26239237*h1.w + -0.0650922*i1.w; + q = 0.0028324497*na0.x + 0.05103814*nb0.x + 0.044681083*nc0.x + 0.18316808*nd0.x + -0.28045008*ne0.x + 0.067069866*nf0.x + -0.19181287*ng0.x + -0.09849666*nh0.x + 0.12940155*ni0.x; + r = 0.09483203*na0.y + 0.3539591*nb0.y + 0.060038615*nc0.y + -0.13552736*nd0.y + 0.0928684*ne0.y + 0.003215415*nf0.y + -0.051365677*ng0.y + -0.086155534*nh0.y + -0.18595453*ni0.y; + s = 0.05942614*na0.z + 0.193376*nb0.z + -0.09784394*nc0.z + 0.05096658*nd0.z + -0.070978366*ne0.z + -0.019585976*nf0.z + -0.08555191*ng0.z + -0.22733821*nh0.z + -0.014307356*ni0.z; + t = 0.24031532*na0.w + 0.059133667*nb0.w + 0.12544549*nc0.w + 0.012513658*nd0.w + 0.32163772*ne0.w + 0.20125918*nf0.w + 0.053959697*ng0.w + 0.13063285*nh0.w + 0.12090184*ni0.w; + u = -0.105667464*na1.x + -0.10932421*nb1.x + -0.15408312*nc1.x + 0.04899373*nd1.x + 0.07510841*ne1.x + -0.20361173*nf1.x + -0.043369625*ng1.x + 0.01743366*nh1.x + -0.04387706*ni1.x; + v = -0.014914074*na1.y + -0.088104874*nb1.y + -0.13474074*nc1.y + -0.12898755*nd1.y + -0.2159242*ne1.y + -0.017311292*nf1.y + 0.059139296*ng1.y + -0.02463293*nh1.y + 0.102143966*ni1.y; + w = 0.20635265*na1.z + 0.12899849*nb1.z + -0.13934886*nc1.z + -0.025166152*nd1.z + 0.19824727*ne1.z + 0.0476692*nf1.z + 0.08188326*ng1.z + 0.16099016*nh1.z + 0.121255964*ni1.z; + x = -0.057871774*na1.w + -0.14890087*nb1.w + -0.036178485*nc1.w + -0.11591994*nd1.w + -0.17214559*ne1.w + 0.066402994*nf1.w + 0.088192135*ng1.w + 0.05370566*nh1.w + -0.08887657*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.018936345; + i = -0.110597*a0.x + 0.14439704*b0.x + 0.07974332*c0.x + -0.029453456*d0.x + 0.078683145*e0.x + 0.121442296*f0.x + -0.13931674*g0.x + -0.15240826*h0.x + -0.0059107463*i0.x; + j = 0.036193337*a0.y + -0.042138703*b0.y + 0.017361153*c0.y + -0.077247314*d0.y + 0.033903867*e0.y + -0.15094012*f0.y + 0.09833268*g0.y + 0.0471915*h0.y + 0.042530224*i0.y; + k = 0.022343786*a0.z + 0.1771308*b0.z + 0.023711894*c0.z + -0.004949796*d0.z + 0.091341995*e0.z + 0.0115282*f0.z + 0.111846566*g0.z + 0.1449886*h0.z + -0.007880583*i0.z; + l = 0.06515425*a0.w + 0.07250873*b0.w + 0.07384295*c0.w + 0.037702788*d0.w + 0.30957448*e0.w + 0.1728089*f0.w + -0.0011135521*g0.w + 0.073804356*h0.w + -0.07097225*i0.w; + m = -0.059413772*a1.x + -0.11423178*b1.x + -0.0700013*c1.x + 0.007900054*d1.x + -0.45595673*e1.x + 0.12823504*f1.x + -0.14837785*g1.x + -0.06934808*h1.x + 0.06862923*i1.x; + n = 0.007177377*a1.y + -0.04293527*b1.y + 0.04063131*c1.y + -0.043710213*d1.y + 0.09957697*e1.y + -0.16395952*f1.y + -0.03072646*g1.y + 0.0051787533*h1.y + 0.061441462*i1.y; + o = 0.069179684*a1.z + 0.116715014*b1.z + -0.010597147*c1.z + -0.0020988528*d1.z + 0.08299716*e1.z + -0.041164685*f1.z + -0.04620522*g1.z + -0.009105994*h1.z + -0.10926514*i1.z; + p = 0.030827038*a1.w + -0.035137884*b1.w + 0.08008966*c1.w + -0.0067170095*d1.w + -0.004441314*e1.w + 0.02607193*f1.w + -0.09919228*g1.w + -0.054578528*h1.w + -0.016953837*i1.w; + q = -0.12492103*na0.x + 0.06447065*nb0.x + 0.06314454*nc0.x + -0.21107356*nd0.x + -0.07198418*ne0.x + 0.20510519*nf0.x + 0.09715707*ng0.x + -0.117380224*nh0.x + 0.01743949*ni0.x; + r = 0.055481322*na0.y + 0.2807053*nb0.y + 0.017788293*nc0.y + -0.007054203*nd0.y + -0.021603152*ne0.y + 0.030201485*nf0.y + 0.092528746*ng0.y + 0.021230493*nh0.y + -0.044057943*ni0.y; + s = -0.12875526*na0.z + -0.04763216*nb0.z + -0.063952245*nc0.z + -0.1002236*nd0.z + -0.28400442*ne0.z + 0.004502422*nf0.z + -0.10722054*ng0.z + -0.11645166*nh0.z + 0.01232295*ni0.z; + t = -0.08266725*na0.w + 0.041546606*nb0.w + -0.040076066*nc0.w + -0.13500398*nd0.w + -0.22226901*ne0.w + -0.09316429*nf0.w + -0.0060878615*ng0.w + -0.055560965*nh0.w + 0.08122037*ni0.w; + u = -0.0042413883*na1.x + -0.061129585*nb1.x + 0.105731405*nc1.x + 0.08033816*nd1.x + 0.3060952*ne1.x + 0.30381104*nf1.x + 0.044904403*ng1.x + 0.007477402*nh1.x + -0.06733228*ni1.x; + v = -0.047427956*na1.y + 0.03387862*nb1.y + -0.024295041*nc1.y + 0.03468945*nd1.y + -0.14339851*ne1.y + 0.114759035*nf1.y + -0.06987076*ng1.y + 0.11075623*nh1.y + 0.04302722*ni1.y; + w = -0.017457472*na1.z + 0.0503154*nb1.z + -0.011205378*nc1.z + -0.0068278625*nd1.z + 0.06237739*ne1.z + 0.04317868*nf1.z + -0.007881838*ng1.z + 0.02493619*nh1.z + -0.0025645192*ni1.z; + x = 0.0121476855*na1.w + -0.076116875*nb1.w + -0.046628572*nc1.w + 0.0071924813*nd1.w + -0.23273*ne1.w + -0.116542414*nf1.w + -0.014419636*ng1.w + -0.062192116*nh1.w + -0.057106964*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.010890064; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN40 +//!BIND LUMAN41 +//!SAVE LUMAN51 + +#define L0_tex LUMAN40_tex +#define L1_tex LUMAN41_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.056090385*a0.x + -0.21354978*b0.x + 0.022244206*c0.x + -0.0038582683*d0.x + -0.4012598*e0.x + 0.12896599*f0.x + 0.028825298*g0.x + -0.29657465*h0.x + -0.06449916*i0.x; + float j = 0.026674105*a0.y + -0.073722854*b0.y + -0.041813698*c0.y + 0.11658765*d0.y + 0.3502272*e0.y + 0.06097762*f0.y + 0.05928873*g0.y + -0.005221818*h0.y + -0.16896306*i0.y; + float k = -0.08193254*a0.z + 0.041702736*b0.z + -0.15537265*c0.z + 0.11105868*d0.z + 0.3349596*e0.z + -0.1513197*f0.z + 0.08305401*g0.z + 0.07004251*h0.z + 0.18821335*i0.z; + float l = -0.095114745*a0.w + -0.11035136*b0.w + 0.00035387988*c0.w + 0.0019896766*d0.w + 0.06287483*e0.w + -0.036226697*f0.w + 0.034236606*g0.w + -0.14316571*h0.w + 0.12548448*i0.w; + float m = -0.012757697*a1.x + -0.0424596*b1.x + 0.07418381*c1.x + 0.017576486*d1.x + 0.11420773*e1.x + 0.09729983*f1.x + -0.09684233*g1.x + 0.015091571*h1.x + -0.059635445*i1.x; + float n = -0.04934384*a1.y + 0.0583751*b1.y + 0.00020525829*c1.y + -0.07054101*d1.y + -0.1676501*e1.y + -0.16150194*f1.y + -0.092985466*g1.y + 0.113083154*h1.y + 0.050833102*i1.y; + float o = -0.022584658*a1.z + -0.09515754*b1.z + 0.03568323*c1.z + -0.047969703*d1.z + -0.11314889*e1.z + -0.115591094*f1.z + -0.016234715*g1.z + -0.025610313*h1.z + -0.07118454*i1.z; + float p = 0.07897343*a1.w + 0.03182414*b1.w + 0.08555049*c1.w + 0.122302584*d1.w + 0.25546962*e1.w + 0.08809629*f1.w + 0.080174565*g1.w + -0.03668826*h1.w + 0.08251504*i1.w; + float q = 0.08174073*na0.x + -0.0051570395*nb0.x + -0.0133568*nc0.x + -0.070082866*nd0.x + 0.23727296*ne0.x + -0.086276196*nf0.x + -0.076185346*ng0.x + -0.0559138*nh0.x + 0.015404762*ni0.x; + float r = -0.08720322*na0.y + -0.05951848*nb0.y + 0.034683157*nc0.y + -0.17522079*nd0.y + -0.35350683*ne0.y + -0.25798985*nf0.y + 0.018907735*ng0.y + 0.018688858*nh0.y + 0.038296565*ni0.y; + float s = 0.02662396*na0.z + 0.06100318*nb0.z + 0.0680031*nc0.z + 0.035090797*nd0.z + -0.2585021*ne0.z + 0.16387142*nf0.z + -0.016490232*ng0.z + 0.012245514*nh0.z + -0.08640067*ni0.z; + float t = 0.09162307*na0.w + 0.16067226*nb0.w + -0.06062272*nc0.w + -0.05303003*nd0.w + -0.18600427*ne0.w + -0.045804538*nf0.w + -0.12862766*ng0.w + 0.036286026*nh0.w + -0.18143234*ni0.w; + float u = 0.012268778*na1.x + 0.012088465*nb1.x + 0.07320402*nc1.x + 0.021589423*nd1.x + -0.14693566*ne1.x + 0.10664899*nf1.x + 0.12277371*ng1.x + 0.05519008*nh1.x + 0.041153215*ni1.x; + float v = 0.09537083*na1.y + -0.045650475*nb1.y + 0.005396567*nc1.y + 0.2421518*nd1.y + 0.053676106*ne1.y + 0.13822643*nf1.y + 0.060495824*ng1.y + 0.06461739*nh1.y + -0.018778283*ni1.y; + float w = -0.07602112*na1.z + 0.061583236*nb1.z + -0.033689767*nc1.z + -0.03578945*nd1.z + -0.08015314*ne1.z + -0.1077307*nf1.z + -0.043930896*ng1.z + -0.054180264*nh1.z + -0.05338287*ni1.z; + float x = -0.023978792*na1.w + -0.13703878*nb1.w + 0.022100048*nc1.w + -0.18234284*nd1.w + -0.27772492*ne1.w + -0.046820987*nf1.w + -0.03914553*ng1.w + 0.067679755*nh1.w + 0.03914887*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0023595907; + i = 0.074523576*a0.x + -0.0057058106*b0.x + 0.1495846*c0.x + 0.07862369*d0.x + 0.2601132*e0.x + 0.055141743*f0.x + -0.055496864*g0.x + 0.17406371*h0.x + 0.03363062*i0.x; + j = -0.05768032*a0.y + 0.15153283*b0.y + 0.022397926*c0.y + 0.041255094*d0.y + -0.15575399*e0.y + 0.004296451*f0.y + -0.10716406*g0.y + 0.17955858*h0.y + -0.056085326*i0.y; + k = 0.0767875*a0.z + 0.15396415*b0.z + 0.12849167*c0.z + -0.019631831*d0.z + -0.23114394*e0.z + 0.0637445*f0.z + -0.005215477*g0.z + -0.05406419*h0.z + 0.10674206*i0.z; + l = 0.005438333*a0.w + 0.057442818*b0.w + 0.076435395*c0.w + -0.13085583*d0.w + 0.025045734*e0.w + -0.02133746*f0.w + 0.004774787*g0.w + -0.078436404*h0.w + 0.0770084*i0.w; + m = 0.049647626*a1.x + -0.03611224*b1.x + -0.02900914*c1.x + -0.0297745*d1.x + -0.07690945*e1.x + 0.126761*f1.x + -0.029992094*g1.x + -0.022881499*h1.x + 0.002003654*i1.x; + n = -0.021211253*a1.y + 0.035476483*b1.y + 0.0066271857*c1.y + 0.15816237*d1.y + 0.08037103*e1.y + 0.078838296*f1.y + 0.13713017*g1.y + 0.009883336*h1.y + 0.03251063*i1.y; + o = 0.035349734*a1.z + 0.07648513*b1.z + 0.06887409*c1.z + 0.046504598*d1.z + 0.15764192*e1.z + 0.06933311*f1.z + 0.011121327*g1.z + 0.007391677*h1.z + -0.034738954*i1.z; + p = -0.067246154*a1.w + -0.09859619*b1.w + -0.05811951*c1.w + -0.113591455*d1.w + -0.03732589*e1.w + -0.11367689*f1.w + -0.020308692*g1.w + -0.1417131*h1.w + -0.08917582*i1.w; + q = -0.027683554*na0.x + 0.15755071*nb0.x + -0.003439709*nc0.x + -0.012204899*nd0.x + 0.17021354*ne0.x + 0.052708283*nf0.x + 0.13149692*ng0.x + 0.090040006*nh0.x + 0.082834296*ni0.x; + r = 0.08598448*na0.y + -0.06366249*nb0.y + 0.06250332*nc0.y + 0.07564566*nd0.y + 0.06026603*ne0.y + 0.02985282*nf0.y + -0.0016011299*ng0.y + -0.07034113*nh0.y + -0.012777306*ni0.y; + s = -0.081845134*na0.z + -0.059878513*nb0.z + -0.059053805*nc0.z + -0.07074469*nd0.z + 0.11270868*ne0.z + -0.07313795*nf0.z + -0.009732927*ng0.z + -0.03957525*nh0.z + -0.11639261*ni0.z; + t = 0.012251858*na0.w + -0.016193997*nb0.w + 0.037083402*nc0.w + 0.15208524*nd0.w + 0.16492158*ne0.w + 0.09038345*nf0.w + 0.05002708*ng0.w + 0.06938181*nh0.w + 0.035729285*ni0.w; + u = -0.08110931*na1.x + -0.061242368*nb1.x + -0.04353678*nc1.x + 0.018317655*nd1.x + 0.04822334*ne1.x + -0.076507956*nf1.x + -0.06782663*ng1.x + -0.026877085*nh1.x + -0.0077283815*ni1.x; + v = -0.02637395*na1.y + 0.021053223*nb1.y + 0.012836627*nc1.y + -0.14172155*nd1.y + -0.067660406*ne1.y + -0.058461625*nf1.y + -0.01881357*ng1.y + -0.11821575*nh1.y + 0.0023459315*ni1.y; + w = 0.046686847*na1.z + 0.052543245*nb1.z + -0.04574683*nc1.z + 0.02516899*nd1.z + -0.061450865*ne1.z + -0.03359517*nf1.z + 0.005574621*ng1.z + 0.06778139*nh1.z + 0.10011491*ni1.z; + x = 0.06502524*na1.w + -0.0040995805*nb1.w + -0.015988229*nc1.w + 0.11461034*nd1.w + -0.15330766*ne1.w + 0.040734354*nf1.w + 0.0053051845*ng1.w + 0.23152955*nh1.w + -0.0368622*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.02745514; + i = -0.01857899*a0.x + -0.092307605*b0.x + 0.23468553*c0.x + -0.008275093*d0.x + 0.0299927*e0.x + 0.04424954*f0.x + 0.28297913*g0.x + 0.13633645*h0.x + 0.15201968*i0.x; + j = 0.016598519*a0.y + 0.054542385*b0.y + 0.01263706*c0.y + -0.00012104201*d0.y + 0.076503254*e0.y + -0.044411242*f0.y + -0.025271175*g0.y + 0.0646408*h0.y + -0.13263232*i0.y; + k = -0.01718374*a0.z + -0.12544994*b0.z + 0.06670591*c0.z + 0.015052461*d0.z + -0.18256845*e0.z + -0.011040225*f0.z + -0.03879542*g0.z + 0.046089746*h0.z + 0.09762668*i0.z; + l = 0.12880234*a0.w + 0.13655676*b0.w + -0.055386145*c0.w + 2.7221502e-05*d0.w + -0.1837622*e0.w + -0.05390036*f0.w + 0.11130797*g0.w + -0.06714729*h0.w + 0.09534897*i0.w; + m = -0.035553545*a1.x + -0.077911995*b1.x + 0.09121035*c1.x + 0.12778811*d1.x + -0.2663*e1.x + 0.053164348*f1.x + -0.046842456*g1.x + -0.007667375*h1.x + -0.08408594*i1.x; + n = -0.0474031*a1.y + 0.055257063*b1.y + 0.005891854*c1.y + -0.10317752*d1.y + 0.03853582*e1.y + 0.033959396*f1.y + -0.115612805*g1.y + 0.05966341*h1.y + 0.07382099*i1.y; + o = -0.04195247*a1.z + -0.0042094598*b1.z + 0.10695232*c1.z + -0.056741405*d1.z + -0.30472994*e1.z + 0.005160417*f1.z + 0.014849301*g1.z + -0.024300938*h1.z + -0.053432226*i1.z; + p = 0.0020989536*a1.w + -0.015926143*b1.w + -0.044968095*c1.w + -0.012733179*d1.w + 0.0393187*e1.w + 0.0011893001*f1.w + 0.011631138*g1.w + -0.11833222*h1.w + 0.020912772*i1.w; + q = 0.008642761*na0.x + -0.08873245*nb0.x + 0.01787369*nc0.x + 0.14553125*nd0.x + -0.58352995*ne0.x + 0.10984562*nf0.x + -0.1902785*ng0.x + -0.21255754*nh0.x + 0.110708214*ni0.x; + r = -0.25730217*na0.y + -0.17411886*nb0.y + 0.050862312*nc0.y + -0.29447538*nd0.y + -0.08723386*ne0.y + -0.07595737*nf0.y + -0.061803184*ng0.y + -0.09596136*nh0.y + -0.004391057*ni0.y; + s = -0.05154969*na0.z + 0.05528125*nb0.z + -0.10029961*nc0.z + -0.20609719*nd0.z + 0.25845483*ne0.z + -0.05684945*nf0.z + 0.07435376*ng0.z + 0.014821872*nh0.z + -0.061488997*ni0.z; + t = -0.023973742*na0.w + -0.13101381*nb0.w + 0.015695877*nc0.w + -0.00094274344*nd0.w + 0.21626495*ne0.w + 0.029855108*nf0.w + -0.134424*ng0.w + 0.11344095*nh0.w + -0.0688341*ni0.w; + u = 0.006327158*na1.x + 0.1400969*nb1.x + -0.115483135*nc1.x + 0.02067186*nd1.x + 0.6160511*ne1.x + -0.11206414*nf1.x + 0.012858851*ng1.x + 0.11192121*nh1.x + 0.12743135*ni1.x; + v = 0.05244468*na1.y + -0.06280365*nb1.y + 0.019899432*nc1.y + 0.07587428*nd1.y + -0.14695287*ne1.y + 0.026428325*nf1.y + 0.062318433*ng1.y + -0.031316523*nh1.y + 0.0015856139*ni1.y; + w = 0.01552606*na1.z + -0.022213168*nb1.z + -0.1368877*nc1.z + -0.061803505*nd1.z + 0.157332*ne1.z + -0.055489*nf1.z + 0.0029063963*ng1.z + 0.07240079*nh1.z + 0.010527223*ni1.z; + x = 0.024937052*na1.w + -0.0075372527*nb1.w + 0.04825707*nc1.w + -0.13231899*nd1.w + 0.1424721*ne1.w + -0.047129158*nf1.w + -0.090350956*ng1.w + 0.06530548*nh1.w + -0.03276755*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.016945923; + i = -0.20472403*a0.x + -0.5440036*b0.x + -0.3415662*c0.x + 0.05028589*d0.x + -0.34596926*e0.x + -0.1575801*f0.x + -0.24130724*g0.x + -0.111981355*h0.x + -0.22872117*i0.x; + j = 0.044235244*a0.y + 0.007408926*b0.y + -0.24718694*c0.y + 0.06598211*d0.y + -0.07944181*e0.y + -0.041312583*f0.y + -0.07749238*g0.y + -0.07008483*h0.y + -0.15196827*i0.y; + k = 0.1394436*a0.z + 0.38492495*b0.z + -0.07301584*c0.z + 0.12015508*d0.z + -0.12864132*e0.z + -0.062012754*f0.z + -0.061071713*g0.z + -0.009352104*h0.z + 0.022086248*i0.z; + l = -0.10533721*a0.w + 0.1136085*b0.w + 0.09260235*c0.w + 0.16164571*d0.w + 0.050596695*e0.w + -0.042681392*f0.w + 0.11215146*g0.w + 0.18171057*h0.w + -0.044888046*i0.w; + m = -0.02860989*a1.x + -0.016434899*b1.x + -0.0038043826*c1.x + -0.08402011*d1.x + -0.23148729*e1.x + 0.046447888*f1.x + -0.088443585*g1.x + -0.059526023*h1.x + 0.037529606*i1.x; + n = -0.038139734*a1.y + -0.14247769*b1.y + -0.2032673*c1.y + 0.032973308*d1.y + 0.16246238*e1.y + -0.00042745384*f1.y + 0.18080023*g1.y + -0.146968*h1.y + 0.042115618*i1.y; + o = -0.10349262*a1.z + -0.19341536*b1.z + -0.057436164*c1.z + -0.20337299*d1.z + -0.052316416*e1.z + -0.17337418*f1.z + 0.066893056*g1.z + 0.003318179*h1.z + -0.013517227*i1.z; + p = 0.060909916*a1.w + 0.054543044*b1.w + 0.18993464*c1.w + 0.124290615*d1.w + 0.39217323*e1.w + 0.16063812*f1.w + 0.09056663*g1.w + 0.16192786*h1.w + 0.025336025*i1.w; + q = 0.18991727*na0.x + -0.00027004647*nb0.x + 0.14546877*nc0.x + 0.41973418*nd0.x + -0.3041173*ne0.x + 0.11617702*nf0.x + 0.22507893*ng0.x + -0.06283164*nh0.x + -0.11073948*ni0.x; + r = -0.10698047*na0.y + -0.10182019*nb0.y + 0.032850496*nc0.y + 0.1551779*nd0.y + -0.1004046*ne0.y + -0.095385954*nf0.y + 0.050851043*ng0.y + 0.17835791*nh0.y + 0.087634064*ni0.y; + s = 0.0058534653*na0.z + -0.15356995*nb0.z + 0.07764963*nc0.z + -0.031784218*nd0.z + 0.3259575*ne0.z + -0.01998434*nf0.z + 0.05851326*ng0.z + 0.029404469*nh0.z + 0.07388124*ni0.z; + t = -0.10876924*na0.w + -0.020953424*nb0.w + -0.079560705*nc0.w + -0.02719251*nd0.w + -0.4081154*ne0.w + -0.0029835652*nf0.w + -0.03687583*ng0.w + -0.33821964*nh0.w + -0.12425579*ni0.w; + u = 0.09229234*na1.x + 0.090341*nb1.x + 0.13298485*nc1.x + 0.17295581*nd1.x + 0.36484036*ne1.x + 0.16058661*nf1.x + 0.102394134*ng1.x + 0.16044867*nh1.x + 0.15259685*ni1.x; + v = 0.15718122*na1.y + 0.072678976*nb1.y + 0.14487597*nc1.y + -0.05968116*nd1.y + -0.08476398*ne1.y + -0.13279647*nf1.y + -0.23609617*ng1.y + -0.14004059*nh1.y + -0.032762706*ni1.y; + w = -0.115983024*na1.z + -0.0353234*nb1.z + 0.16114388*nc1.z + 0.11989774*nd1.z + -0.15475188*ne1.z + 0.015697762*nf1.z + -0.036263574*ng1.z + -0.09506931*nh1.z + -0.08309461*ni1.z; + x = -0.0009906742*na1.w + 0.043757707*nb1.w + 0.038789403*nc1.w + -0.17851372*nd1.w + 0.021087*ne1.w + 0.02302371*nf1.w + -0.03420213*ng1.w + -0.0016994842*nh1.w + -0.039775606*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.011434225; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN50 +//!BIND LUMAN51 +//!SAVE LUMAN60 + +#define L0_tex LUMAN50_tex +#define L1_tex LUMAN51_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.007900067*a0.x + 0.06111605*b0.x + 0.13362223*c0.x + -0.08097709*d0.x + 0.103360735*e0.x + -0.07250116*f0.x + 0.031838957*g0.x + -0.08329396*h0.x + 0.07071538*i0.x; + float j = -0.100912035*a0.y + -0.014328106*b0.y + 0.080552615*c0.y + 0.072964214*d0.y + 0.20794426*e0.y + 0.1481695*f0.y + 0.070850804*g0.y + -0.076575726*h0.y + 0.041372977*i0.y; + float k = -0.03987942*a0.z + 0.08942544*b0.z + 0.037421957*c0.z + 0.106816724*d0.z + 0.1251162*e0.z + -0.020023407*f0.z + 0.13727182*g0.z + 0.0875649*h0.z + 0.016416198*i0.z; + float l = -0.0645122*a0.w + -0.10794101*b0.w + 0.019238126*c0.w + 0.018906446*d0.w + 0.053039797*e0.w + 0.20710008*f0.w + 0.07407084*g0.w + 0.24502033*h0.w + 0.053760402*i0.w; + float m = -0.019182838*a1.x + 0.024340963*b1.x + -0.04285745*c1.x + -0.1267232*d1.x + -0.027013803*e1.x + -0.06522738*f1.x + 0.099756*g1.x + -0.0895132*h1.x + -0.06274337*i1.x; + float n = 0.21720274*a1.y + 0.22679296*b1.y + 0.094728276*c1.y + 0.03987187*d1.y + 0.3363125*e1.y + 0.25583714*f1.y + 0.18515237*g1.y + 0.10880643*h1.y + 0.014202542*i1.y; + float o = 0.04833541*a1.z + 0.022809451*b1.z + -0.060894404*c1.z + 0.029224632*d1.z + 0.13964699*e1.z + -0.079538874*f1.z + -0.12321884*g1.z + -0.0109314835*h1.z + -0.028924821*i1.z; + float p = -0.099998884*a1.w + -0.06404399*b1.w + -0.013308858*c1.w + 0.0015877723*d1.w + 0.021802263*e1.w + -0.04523103*f1.w + 0.0009092714*g1.w + -0.1224042*h1.w + -0.10198278*i1.w; + float q = -0.009989799*na0.x + -0.023531131*nb0.x + -0.016424935*nc0.x + 0.1580643*nd0.x + -0.07054254*ne0.x + 0.017178383*nf0.x + 0.12825544*ng0.x + 0.04345318*nh0.x + -0.025755657*ni0.x; + float r = 0.05775632*na0.y + -0.073533855*nb0.y + -0.078828685*nc0.y + -0.09696127*nd0.y + -0.06458487*ne0.y + -0.15739019*nf0.y + -0.14344892*ng0.y + -0.023483401*nh0.y + -0.06177725*ni0.y; + float s = 0.16263905*na0.z + 0.119967565*nb0.z + 0.058884792*nc0.z + -0.0016427131*nd0.z + 0.12633163*ne0.z + 0.12480811*nf0.z + -0.13420187*ng0.z + 0.22198138*nh0.z + 0.066704325*ni0.z; + float t = 0.14367525*na0.w + 0.16780959*nb0.w + 0.13001716*nc0.w + -0.019490587*nd0.w + 0.017529594*ne0.w + -0.06288588*nf0.w + -0.008786988*ng0.w + -0.18995468*nh0.w + -0.0835717*ni0.w; + float u = -0.072073266*na1.x + -0.15306944*nb1.x + 0.00436017*nc1.x + -0.03719954*nd1.x + -0.08704513*ne1.x + -0.040555727*nf1.x + -0.06939967*ng1.x + -0.047218878*nh1.x + 0.011211359*ni1.x; + float v = 0.0530403*na1.y + -0.21789601*nb1.y + -0.110040896*nc1.y + -0.12080109*nd1.y + -0.063249566*ne1.y + -0.050723586*nf1.y + -0.00483581*ng1.y + 0.0133364545*nh1.y + 0.1337577*ni1.y; + float w = -0.11044843*na1.z + 0.035734586*nb1.z + -0.009872459*nc1.z + -0.1027228*nd1.z + -0.15830374*ne1.z + 0.10537158*nf1.z + 0.057217788*ng1.z + -0.094153106*nh1.z + -0.09629833*ni1.z; + float x = 0.10235088*na1.w + 0.048925947*nb1.w + -0.0071955076*nc1.w + 0.026082518*nd1.w + 0.047619376*ne1.w + -0.025943337*nf1.w + -0.028843133*ng1.w + -0.0053447234*nh1.w + 0.047757845*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0022438124; + i = 0.05064848*a0.x + -0.20422895*b0.x + -0.048842456*c0.x + 0.14468466*d0.x + 0.045398735*e0.x + 0.11933529*f0.x + -0.09603952*g0.x + 0.11587896*h0.x + -0.08594006*i0.x; + j = 0.051009253*a0.y + 0.020939386*b0.y + -0.056426525*c0.y + 0.111202724*d0.y + -0.27524063*e0.y + 0.25247937*f0.y + 0.15901652*g0.y + 0.18370955*h0.y + -0.0006100606*i0.y; + k = 0.026922384*a0.z + -0.019294612*b0.z + 0.118673414*c0.z + -0.043769788*d0.z + -0.070539124*e0.z + -0.06258966*f0.z + -0.0041388213*g0.z + -0.0027373051*h0.z + -0.03782834*i0.z; + l = 0.036438785*a0.w + -0.08447189*b0.w + -0.09808555*c0.w + -0.05171045*d0.w + -0.14444746*e0.w + -0.21831968*f0.w + 0.06325723*g0.w + -0.25083756*h0.w + 0.121623024*i0.w; + m = -0.05461014*a1.x + -0.060001776*b1.x + 0.07407202*c1.x + -0.0008134506*d1.x + -0.21538503*e1.x + 0.17426263*f1.x + -0.081575185*g1.x + -0.021462401*h1.x + 0.10259248*i1.x; + n = -0.028844604*a1.y + -0.1055795*b1.y + -0.12056408*c1.y + -0.06945176*d1.y + 0.24445438*e1.y + -0.04565883*f1.y + -0.10659118*g1.y + 0.060785856*h1.y + -0.041710086*i1.y; + o = -0.0035760484*a1.z + 0.033717036*b1.z + 0.14456153*c1.z + -0.003583616*d1.z + 0.0428905*e1.z + 0.08271759*f1.z + -0.026236393*g1.z + -0.05663394*h1.z + -0.11643835*i1.z; + p = 0.06603419*a1.w + -0.03694121*b1.w + 0.008290856*c1.w + 0.047380496*d1.w + 0.16152279*e1.w + 0.024927517*f1.w + 0.018398501*g1.w + 0.045266174*h1.w + 0.1532531*i1.w; + q = 0.05501013*na0.x + 0.07717635*nb0.x + -0.08030905*nc0.x + -0.21632951*nd0.x + -0.2373707*ne0.x + -0.31690797*nf0.x + -0.054487124*ng0.x + -0.11547693*nh0.x + 0.11048151*ni0.x; + r = -0.03760372*na0.y + 0.071262136*nb0.y + 0.050859585*nc0.y + -0.03484282*nd0.y + 0.10759817*ne0.y + 0.010887812*nf0.y + -0.0907616*ng0.y + -0.13002929*nh0.y + 0.039026946*ni0.y; + s = -0.005286152*na0.z + 0.011639715*nb0.z + -0.09048027*nc0.z + 0.027714854*nd0.z + -0.1285118*ne0.z + 0.093528196*nf0.z + 0.003392913*ng0.z + -0.1098825*nh0.z + -0.0821848*ni0.z; + t = -0.028145354*na0.w + 0.050427336*nb0.w + 0.043978024*nc0.w + 0.04701224*nd0.w + -0.08590698*ne0.w + 0.19342361*nf0.w + -0.043336395*ng0.w + 0.07020605*nh0.w + -0.11217858*ni0.w; + u = 0.081151985*na1.x + 0.1695107*nb1.x + 0.08539623*nc1.x + 0.062478133*nd1.x + 0.027216671*ne1.x + -0.0007516228*nf1.x + 0.07613257*ng1.x + 0.011643803*nh1.x + -0.033885993*ni1.x; + v = -0.040014226*na1.y + -0.05567425*nb1.y + -0.09321087*nc1.y + 0.13047898*nd1.y + -0.37765887*ne1.y + -0.5407485*nf1.y + 0.026491206*ng1.y + 0.215762*nh1.y + -0.20646265*ni1.y; + w = -0.028338104*na1.z + -0.13641936*nb1.z + -0.0008554815*nc1.z + -0.026358705*nd1.z + -0.027189348*ne1.z + 0.014966428*nf1.z + 0.02931294*ng1.z + 0.13201293*nh1.z + 0.021129422*ni1.z; + x = -0.0706693*na1.w + 0.027378365*nb1.w + -0.011388007*nc1.w + -0.016765244*nd1.w + -0.14355792*ne1.w + 0.16164084*nf1.w + 0.064222276*ng1.w + 0.06362779*nh1.w + 0.08947278*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0079668; + i = -0.052216068*a0.x + 0.054898728*b0.x + 0.036882155*c0.x + 0.06379019*d0.x + -0.20955375*e0.x + -0.011356595*f0.x + 0.026242755*g0.x + -0.037986107*h0.x + 0.013255572*i0.x; + j = -0.11782476*a0.y + -0.0209143*b0.y + 0.09975378*c0.y + 0.08051828*d0.y + 0.028034722*e0.y + -0.11601055*f0.y + 0.08857265*g0.y + 0.12780881*h0.y + 0.042145763*i0.y; + k = -0.024772175*a0.z + -0.0046171104*b0.z + -0.027132677*c0.z + 0.05496378*d0.z + 0.10925047*e0.z + 0.14660946*f0.z + 0.04814382*g0.z + 0.11250083*h0.z + 0.21809563*i0.z; + l = -0.048624218*a0.w + 0.036018074*b0.w + 0.018748894*c0.w + 0.04089426*d0.w + 0.03679874*e0.w + -0.024487058*f0.w + -0.006175484*g0.w + -0.12283346*h0.w + -0.09193407*i0.w; + m = -0.044582702*a1.x + 0.04411854*b1.x + -0.020496923*c1.x + -0.17571406*d1.x + -0.17814021*e1.x + -0.13249502*f1.x + -0.016790845*g1.x + 0.14915213*h1.x + 0.06783924*i1.x; + n = 0.062412664*a1.y + 0.01842933*b1.y + 0.008690827*c1.y + -0.23738204*d1.y + -0.2828378*e1.y + -0.07163012*f1.y + -0.029558232*g1.y + -0.08761727*h1.y + -0.24004433*i1.y; + o = 0.023585051*a1.z + -0.069970764*b1.z + -0.04842618*c1.z + -0.007836811*d1.z + 0.28026676*e1.z + 0.06314062*f1.z + -0.07615924*g1.z + -0.33812356*h1.z + -0.04734389*i1.z; + p = -0.0105614085*a1.w + -0.0010307096*b1.w + -0.049624432*c1.w + 0.07334713*d1.w + 0.023181029*e1.w + 0.22236523*f1.w + -0.036988813*g1.w + 0.08197461*h1.w + 0.112293564*i1.w; + q = -0.04700814*na0.x + -0.092280574*nb0.x + -0.08462992*nc0.x + -0.11683497*nd0.x + 0.17987503*ne0.x + 0.06173114*nf0.x + 0.01673716*ng0.x + 0.06325463*nh0.x + -0.05398158*ni0.x; + r = 0.056093518*na0.y + -0.029174399*nb0.y + 0.008268589*nc0.y + -0.038166087*nd0.y + 0.31754375*ne0.y + -0.076780386*nf0.y + -0.17114313*ng0.y + -0.32900494*nh0.y + -0.12613133*ni0.y; + s = 0.022803396*na0.z + 0.06633487*nb0.z + 0.09868759*nc0.z + -0.03169617*nd0.z + -0.23164985*ne0.z + -0.1550096*nf0.z + -0.05340548*ng0.z + -0.30185044*nh0.z + -0.15606295*ni0.z; + t = 0.047760352*na0.w + -0.023117915*nb0.w + -0.013897625*nc0.w + -0.022600356*nd0.w + -0.1053882*ne0.w + -0.064644404*nf0.w + -0.076259404*ng0.w + 0.08077569*nh0.w + 0.056261458*ni0.w; + u = -0.036427572*na1.x + 0.013039251*nb1.x + 0.0008705984*nc1.x + 0.18672472*nd1.x + 0.25473928*ne1.x + 0.051945034*nf1.x + 0.036714926*ng1.x + -0.091437206*nh1.x + -0.07168086*ni1.x; + v = -0.03265293*na1.y + -0.08496432*nb1.y + -0.0643857*nc1.y + 0.1900388*nd1.y + 0.21765114*ne1.y + 0.052614775*nf1.y + 0.07429901*ng1.y + 0.2578138*nh1.y + 0.22327712*ni1.y; + w = 0.029738856*na1.z + 0.13880761*nb1.z + 0.016748065*nc1.z + -0.026210256*nd1.z + -0.26959187*ne1.z + -0.0051032137*nf1.z + 0.093300216*ng1.z + 0.2578347*nh1.z + 0.0731899*ni1.z; + x = 0.023803368*na1.w + -0.022662397*nb1.w + 0.012398539*nc1.w + -0.07820376*nd1.w + -0.06055157*ne1.w + -0.061961398*nf1.w + 0.09714569*ng1.w + 0.01943341*nh1.w + -0.09513158*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0022567785; + i = 0.015182305*a0.x + 0.24893573*b0.x + -0.0022004095*c0.x + 0.09184145*d0.x + -0.05798882*e0.x + 0.20459242*f0.x + -0.045849342*g0.x + 0.18169454*h0.x + -0.0020022106*i0.x; + j = 0.06535713*a0.y + 0.067995876*b0.y + -0.15596136*c0.y + -0.0571899*d0.y + 0.16720164*e0.y + 0.29680288*f0.y + 0.07203544*g0.y + 0.12709936*h0.y + 0.08908467*i0.y; + k = -0.035225604*a0.z + -0.01637087*b0.z + 0.08659167*c0.z + 0.011060907*d0.z + 0.32298514*e0.z + -0.026474915*f0.z + 0.017311417*g0.z + 0.09786248*h0.z + 0.14111069*i0.z; + l = -0.013472993*a0.w + -0.20824556*b0.w + -0.12898146*c0.w + -0.014164601*d0.w + -0.005099344*e0.w + -0.10799987*f0.w + -0.035937253*g0.w + -0.011961274*h0.w + 0.013696468*i0.w; + m = 0.0005670277*a1.x + -0.26264974*b1.x + -0.0048576635*c1.x + -0.09822187*d1.x + 0.04494708*e1.x + 0.025521396*f1.x + 0.00015683453*g1.x + -0.07115157*h1.x + -0.05619935*i1.x; + n = -0.02532665*a1.y + 0.29243463*b1.y + 0.31513873*c1.y + -0.14378825*d1.y + 0.19135693*e1.y + 0.21406765*f1.y + 0.20193236*g1.y + 0.014083933*h1.y + -0.026462164*i1.y; + o = 0.03566653*a1.z + -0.043557085*b1.z + -0.11857579*c1.z + -0.10190321*d1.z + 0.15822466*e1.z + -0.44667184*f1.z + -0.01721309*g1.z + -0.16478701*h1.z + -0.1190363*i1.z; + p = -0.039312962*a1.w + 0.107173085*b1.w + -0.0672977*c1.w + -0.047271557*d1.w + 0.1652996*e1.w + -0.051441222*f1.w + -0.022646252*g1.w + -0.050653923*h1.w + 0.11192206*i1.w; + q = 0.0137756765*na0.x + 0.10019253*nb0.x + 0.03521767*nc0.x + 0.031304695*nd0.x + 0.22698583*ne0.x + -0.19912961*nf0.x + 0.07153089*ng0.x + -0.02893902*nh0.x + 0.06328283*ni0.x; + r = 0.0015052083*na0.y + -0.094727606*nb0.y + -0.12986736*nc0.y + -0.11083681*nd0.y + 0.03377681*ne0.y + -0.17758591*nf0.y + -0.06644192*ng0.y + -0.18634509*nh0.y + -0.0352864*ni0.y; + s = -0.008672401*na0.z + -0.001848777*nb0.z + -0.0126453405*nc0.z + 0.016603608*nd0.z + -0.05969051*ne0.z + 0.16930741*nf0.z + 0.0012650864*ng0.z + -0.06459553*nh0.z + -0.12883076*ni0.z; + t = -0.03171965*na0.w + 0.1401744*nb0.w + 0.19563067*nc0.w + -0.12079*nd0.w + 0.082978256*ne0.w + 0.079056926*nf0.w + -0.06612365*ng0.w + 0.052545033*nh0.w + -0.09354296*ni0.w; + u = -0.024908075*na1.x + 0.054468673*nb1.x + -0.1664688*nc1.x + 0.14513916*nd1.x + 0.52940583*ne1.x + -0.09289571*nf1.x + 0.0792853*ng1.x + -0.047211148*nh1.x + -0.05823414*ni1.x; + v = -0.11715029*na1.y + 0.252586*nb1.y + 0.041131303*nc1.y + -0.055155452*nd1.y + 0.41648072*ne1.y + -0.21591651*nf1.y + -0.09149343*ng1.y + -0.014857513*nh1.y + 0.1410885*ni1.y; + w = -0.07564878*na1.z + -0.02708825*nb1.z + -0.08688533*nc1.z + -0.046987806*nd1.z + -0.5431695*ne1.z + -0.18476017*nf1.z + -0.095298484*ng1.z + 0.06094703*nh1.z + -0.039970815*ni1.z; + x = 0.04833648*na1.w + -0.1409518*nb1.w + 0.11214609*nc1.w + 0.033194754*nd1.w + -0.3089111*ne1.w + 0.06044798*nf1.w + -0.0066538164*ng1.w + 0.010930421*nh1.w + 0.013376871*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.051068775; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN50 +//!BIND LUMAN51 +//!SAVE LUMAN61 + +#define L0_tex LUMAN50_tex +#define L1_tex LUMAN51_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.031546153*a0.x + 0.10181991*b0.x + 0.073859274*c0.x + -0.15246408*d0.x + 0.14763272*e0.x + -0.0125050405*f0.x + -0.017787706*g0.x + -0.20371142*h0.x + -0.00050032407*i0.x; + float j = -0.010432319*a0.y + 0.030510774*b0.y + 0.1426763*c0.y + 0.059396524*d0.y + 0.15544188*e0.y + -0.12718435*f0.y + 0.02799549*g0.y + 0.010854321*h0.y + -0.0015246007*i0.y; + float k = -0.093501434*a0.z + -0.07160352*b0.z + -0.0084140515*c0.z + -0.056851644*d0.z + -0.017626492*e0.z + -0.061777826*f0.z + -0.036883313*g0.z + 0.0859227*h0.z + 0.13611211*i0.z; + float l = 0.035202347*a0.w + 0.009860384*b0.w + 0.038405575*c0.w + -0.12947462*d0.w + -0.1261992*e0.w + 0.12101405*f0.w + 0.014062706*g0.w + 0.15318196*h0.w + -0.0024715464*i0.w; + float m = 0.16668798*a1.x + -0.16932218*b1.x + -0.009941405*c1.x + -0.022664279*d1.x + 0.32400167*e1.x + -0.105916865*f1.x + 0.067544185*g1.x + -0.07818027*h1.x + -0.0073417565*i1.x; + float n = -0.05549741*a1.y + -0.04343892*b1.y + 0.10069597*c1.y + -0.015486789*d1.y + -0.22637175*e1.y + 0.19503605*f1.y + -0.012474865*g1.y + -0.13727693*h1.y + -0.017787639*i1.y; + float o = 0.041081887*a1.z + 0.034970902*b1.z + -0.06543123*c1.z + 0.13859794*d1.z + -0.15330139*e1.z + -0.23288219*f1.z + -0.012868079*g1.z + -0.14391816*h1.z + 0.060016695*i1.z; + float p = -0.069112025*a1.w + 0.037988856*b1.w + -0.093884565*c1.w + -0.15653755*d1.w + -0.22540344*e1.w + -0.06968565*f1.w + -0.055913948*g1.w + -0.050365813*h1.w + -0.033494245*i1.w; + float q = 0.045975808*na0.x + 0.08250363*nb0.x + 0.022651628*nc0.x + 0.28382483*nd0.x + 0.097844034*ne0.x + 0.10232113*nf0.x + 0.06628655*ng0.x + 0.14861946*nh0.x + 0.08355251*ni0.x; + float r = 0.04361711*na0.y + -0.05094804*nb0.y + -0.014008724*nc0.y + 0.07368605*nd0.y + -0.1254038*ne0.y + -0.04381839*nf0.y + -0.095921315*ng0.y + -0.036264747*nh0.y + 0.018310638*ni0.y; + float s = 0.06879594*na0.z + -0.0066300803*nb0.z + 0.05720748*nc0.z + 0.029433746*nd0.z + -0.03982782*ne0.z + 0.05603243*nf0.z + 0.05490365*ng0.z + 0.03296246*nh0.z + -0.09842967*ni0.z; + float t = 0.025421478*na0.w + -0.11407852*nb0.w + 0.12202771*nc0.w + 0.060819726*nd0.w + 0.24847539*ne0.w + 0.011995541*nf0.w + -0.040386673*ng0.w + -0.07721791*nh0.w + 0.033605415*ni0.w; + float u = -0.17270409*na1.x + 0.013868905*nb1.x + -0.002881239*nc1.x + 0.039273325*nd1.x + -0.106161565*ne1.x + -0.025495555*nf1.x + 0.048340194*ng1.x + -0.07479905*nh1.x + -0.08653662*ni1.x; + float v = 0.13883483*na1.y + 0.13072231*nb1.y + 0.08571931*nc1.y + -0.1619657*nd1.y + 0.37347794*ne1.y + 0.1372329*nf1.y + 0.0140385255*ng1.y + -0.122313775*nh1.y + 0.20132363*ni1.y; + float w = 0.0040083956*na1.z + 0.10405894*nb1.z + 0.027527817*nc1.z + -0.05968225*nd1.z + 0.2647388*ne1.z + 0.016327286*nf1.z + 0.011635987*ng1.z + 0.04504511*nh1.z + -0.051735844*ni1.z; + float x = 0.10528082*na1.w + 0.0142691685*nb1.w + 0.014016689*nc1.w + 0.17657901*nd1.w + 0.121575035*ne1.w + -0.063305*nf1.w + -0.018475758*ng1.w + -0.04090849*nh1.w + -0.07978934*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0003618291; + i = -0.036286984*a0.x + -0.14125206*b0.x + 0.06066132*c0.x + 0.05547197*d0.x + 0.068194166*e0.x + 0.008525646*f0.x + -0.039609205*g0.x + -0.11230934*h0.x + -0.113056414*i0.x; + j = -0.085862525*a0.y + -0.123490535*b0.y + 0.020701244*c0.y + -0.2048334*d0.y + -0.45535797*e0.y + -0.083858036*f0.y + -0.15180224*g0.y + 0.12630956*h0.y + 0.017587205*i0.y; + k = -0.018024435*a0.z + -0.09302786*b0.z + 0.021795405*c0.z + -0.12134385*d0.z + -0.20438811*e0.z + -0.14382325*f0.z + -0.076487675*g0.z + 0.10817767*h0.z + -0.077478066*i0.z; + l = -0.038971703*a0.w + 0.048376482*b0.w + -0.023732191*c0.w + 0.09670338*d0.w + -0.2802389*e0.w + -0.09253269*f0.w + -0.080351844*g0.w + 0.017240494*h0.w + 0.006485758*i0.w; + m = 0.01397742*a1.x + -0.025987474*b1.x + 0.07466099*c1.x + -0.09267096*d1.x + -0.5153345*e1.x + -0.062083337*f1.x + 0.10469547*g1.x + -0.11062864*h1.x + 0.014658386*i1.x; + n = -0.091483*a1.y + -0.16846472*b1.y + -0.10234011*c1.y + -0.01535046*d1.y + -0.0051777046*e1.y + 0.10139349*f1.y + -0.10388479*g1.y + -0.12109544*h1.y + 0.15738633*i1.y; + o = 0.020996617*a1.z + 0.037067533*b1.z + 0.073568314*c1.z + -0.09159761*d1.z + 0.087282114*e1.z + -0.039215967*f1.z + 0.16177997*g1.z + 0.14786617*h1.z + 0.09942117*i1.z; + p = 0.0019687389*a1.w + -0.013382924*b1.w + 0.1135481*c1.w + 0.07714744*d1.w + -0.1592662*e1.w + -0.10746641*f1.w + 0.048666194*g1.w + 0.08981723*h1.w + -0.07497876*i1.w; + q = -0.015083009*na0.x + -0.019428026*nb0.x + 0.03813817*nc0.x + -0.15238467*nd0.x + -0.23520324*ne0.x + 0.07369356*nf0.x + 0.012670117*ng0.x + -0.08351004*nh0.x + 0.044962507*ni0.x; + r = 0.088389374*na0.y + 0.18492348*nb0.y + 0.025082428*nc0.y + 0.05480784*nd0.y + 0.22750247*ne0.y + 0.13846515*nf0.y + 0.2636925*ng0.y + 0.17539035*nh0.y + 0.11087739*ni0.y; + s = -0.12868524*na0.z + -0.037687402*nb0.z + -0.1252832*nc0.z + 0.10420505*nd0.z + 0.04623572*ne0.z + 0.0655443*nf0.z + -0.025120152*ng0.z + -0.17205289*nh0.z + 0.008899509*ni0.z; + t = -0.07281317*na0.w + -0.1546063*nb0.w + -0.016060047*nc0.w + 0.060486432*nd0.w + 0.1441806*ne0.w + 0.17752542*nf0.w + 0.030893242*ng0.w + 0.03714838*nh0.w + -0.0048728893*ni0.w; + u = 0.060912687*na1.x + 0.12079206*nb1.x + -0.027241277*nc1.x + 0.04047401*nd1.x + 0.09416829*ne1.x + 0.15379521*nf1.x + -0.19458131*ng1.x + -0.00538213*nh1.x + 0.037444368*ni1.x; + v = -0.023998167*na1.y + 0.025314212*nb1.y + -0.17185235*nc1.y + 0.16584304*nd1.y + -0.4452612*ne1.y + -0.110297464*nf1.y + 0.06593299*ng1.y + 0.10085941*nh1.y + 0.044712596*ni1.y; + w = 0.04893469*na1.z + -0.0019785075*nb1.z + 0.05903422*nc1.z + 0.17388752*nd1.z + 0.17576037*ne1.z + 0.24168177*nf1.z + -0.07972112*ng1.z + -0.10765523*nh1.z + 0.038109303*ni1.z; + x = 0.027872296*na1.w + 0.018650744*nb1.w + -0.07063714*nc1.w + -0.068980865*nd1.w + 0.10454622*ne1.w + -0.04499944*nf1.w + -0.100115106*ng1.w + -0.1471108*nh1.w + -0.04576075*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.030282622; + i = 0.07732889*a0.x + -0.28814515*b0.x + -0.0064604837*c0.x + 0.29301605*d0.x + -0.09963081*e0.x + -0.08197728*f0.x + -0.028975101*g0.x + 0.14664023*h0.x + -0.08978697*i0.x; + j = 0.068587825*a0.y + 0.20948891*b0.y + 0.045638446*c0.y + 0.051091406*d0.y + 0.34080246*e0.y + 0.14575565*f0.y + 0.08811473*g0.y + -0.05562346*h0.y + -0.15261091*i0.y; + k = -0.011278103*a0.z + -0.15211527*b0.z + 0.20716971*c0.z + 0.09526687*d0.z + -0.08959701*e0.z + 0.067594126*f0.z + 0.14893652*g0.z + -0.028068649*h0.z + -0.048965998*i0.z; + l = 0.055225685*a0.w + 0.20627908*b0.w + -0.15372919*c0.w + -0.11007142*d0.w + -0.075520106*e0.w + -0.09346816*f0.w + 0.034588765*g0.w + -0.026151113*h0.w + 0.0026015725*i0.w; + m = -0.048829716*a1.x + -0.20407067*b1.x + 0.06337002*c1.x + 0.32504085*d1.x + -0.12869559*e1.x + 0.06284247*f1.x + 0.20259036*g1.x + -0.054262947*h1.x + 0.0046158135*i1.x; + n = 0.22670676*a1.y + -0.21922074*b1.y + -0.19599336*c1.y + 0.16530077*d1.y + -0.16839084*e1.y + -0.0039421143*f1.y + 0.04603167*g1.y + 0.07083225*h1.y + -0.064544596*i1.y; + o = -0.037351932*a1.z + 0.0018220773*b1.z + 0.10817571*c1.z + 0.0832664*d1.z + -0.083478995*e1.z + 0.30855995*f1.z + -0.055833396*g1.z + 0.12978391*h1.z + 0.06139905*i1.z; + p = -0.028281745*a1.w + -0.16829659*b1.w + -0.026146065*c1.w + -0.06691971*d1.w + -0.23516048*e1.w + -0.31896853*f1.w + 0.07790477*g1.w + -0.021854805*h1.w + -0.21510248*i1.w; + q = -0.14794815*na0.x + 0.033303283*nb0.x + 0.03536612*nc0.x + -0.09868507*nd0.x + -0.26048434*ne0.x + -0.06149607*nf0.x + 0.117348015*ng0.x + -0.10047164*nh0.x + -0.09653776*ni0.x; + r = -0.06575016*na0.y + -0.054421987*nb0.y + 0.099354625*nc0.y + 0.039376777*nd0.y + -0.02198662*ne0.y + 0.11862724*nf0.y + 0.020930216*ng0.y + 0.0056599323*nh0.y + 0.16156995*ni0.y; + s = 0.13081959*na0.z + 0.32655948*nb0.z + -0.23558922*nc0.z + 0.072354905*nd0.z + 0.16327718*ne0.z + 0.02562823*nf0.z + -0.1573292*ng0.z + 0.19618611*nh0.z + 0.10715276*ni0.z; + t = -0.1405503*na0.w + -0.33976465*nb0.w + 0.04658757*nc0.w + 0.12673989*nd0.w + -0.04829641*ne0.w + -0.00910403*nf0.w + -0.11427059*ng0.w + -0.14695705*nh0.w + -0.08690347*ni0.w; + u = 0.11926451*na1.x + 0.19877844*nb1.x + 0.027044713*nc1.x + -0.19027933*nd1.x + -0.14013988*ne1.x + 0.07460557*nf1.x + -0.043402057*ng1.x + -0.09343368*nh1.x + 0.047437534*ni1.x; + v = 0.08416891*na1.y + 0.14631395*nb1.y + 0.26600307*nc1.y + -0.1871122*nd1.y + 0.22076473*ne1.y + 0.28523198*nf1.y + -0.055752814*ng1.y + 0.015490213*nh1.y + 0.054972388*ni1.y; + w = 0.08740491*na1.z + -0.23947707*nb1.z + 0.016575981*nc1.z + -0.10177695*nd1.z + 0.15792145*ne1.z + -0.03995825*nf1.z + -0.039797496*ng1.z + -0.025917966*nh1.z + -0.09652502*ni1.z; + x = 0.0071426067*na1.w + 0.095553674*nb1.w + -0.07099863*nc1.w + 0.024027854*nd1.w + 0.12360891*ne1.w + 0.1681869*nf1.w + -0.03580952*ng1.w + 0.044734523*nh1.w + 0.10288006*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0055503496; + i = -0.012075199*a0.x + 0.029157963*b0.x + -0.094539605*c0.x + 0.009049657*d0.x + 0.0066867545*e0.x + 0.123809524*f0.x + -0.034514107*g0.x + -0.033612035*h0.x + 0.022811875*i0.x; + j = 0.17061445*a0.y + -0.010893953*b0.y + -0.07004314*c0.y + 0.23383701*d0.y + 0.093025014*e0.y + -0.11091873*f0.y + 0.12727837*g0.y + 0.0642397*h0.y + 0.11227179*i0.y; + k = 0.019130148*a0.z + 0.1882869*b0.z + -0.0023966245*c0.z + -0.23950866*d0.z + 0.038852807*e0.z + -0.0430306*f0.z + -0.11410439*g0.z + 0.12466275*h0.z + -0.047253113*i0.z; + l = 0.09055786*a0.w + 0.07580854*b0.w + -0.11349518*c0.w + -0.13999584*d0.w + 0.12614273*e0.w + -0.15902464*f0.w + -0.038654026*g0.w + -0.058192287*h0.w + 0.035802983*i0.w; + m = -0.08979459*a1.x + -0.050968487*b1.x + -0.02907599*c1.x + 0.042554542*d1.x + 0.07000888*e1.x + 0.028022232*f1.x + -0.096248545*g1.x + 0.035345096*h1.x + 0.074281015*i1.x; + n = -0.16023806*a1.y + 0.05844222*b1.y + 0.07899191*c1.y + 0.18628545*d1.y + -0.035070125*e1.y + 0.1912711*f1.y + -0.044375904*g1.y + -0.16154447*h1.y + -0.012721664*i1.y; + o = -0.021872953*a1.z + -0.021403098*b1.z + -0.026954386*c1.z + -0.041741677*d1.z + -0.046587247*e1.z + -0.11817974*f1.z + -0.008084186*g1.z + -0.14949232*h1.z + 0.1003316*i1.z; + p = 0.08669636*a1.w + 0.19403161*b1.w + 0.031784803*c1.w + -0.06290836*d1.w + 0.16112271*e1.w + 0.10850725*f1.w + -0.051847808*g1.w + 0.1305159*h1.w + 0.026885018*i1.w; + q = 0.17550388*na0.x + 0.17034264*nb0.x + -0.021896753*nc0.x + 0.013124788*nd0.x + 0.3335409*ne0.x + 0.018226452*nf0.x + -0.018352246*ng0.x + 0.119319744*nh0.x + 0.04201911*ni0.x; + r = -0.07380144*na0.y + -0.13001768*nb0.y + 0.051442172*nc0.y + -0.15560588*nd0.y + -0.07077073*ne0.y + 0.022792563*nf0.y + -0.025004702*ng0.y + -0.014225961*nh0.y + 0.030852502*ni0.y; + s = -0.07394243*na0.z + -0.31966287*nb0.z + -0.031208597*nc0.z + 0.1298494*nd0.z + -0.17820711*ne0.z + -0.011843899*nf0.z + 0.1022889*ng0.z + -0.19961227*nh0.z + 0.021356137*ni0.z; + t = -0.057077024*na0.w + 0.038792044*nb0.w + 0.06577576*nc0.w + -0.08349324*nd0.w + 0.004292813*ne0.w + 0.19245423*nf0.w + -0.06170392*ng0.w + 0.110614605*nh0.w + 0.07479524*ni0.w; + u = 0.057603214*na1.x + 0.069764175*nb1.x + -0.031894762*nc1.x + -0.02513546*nd1.x + 0.41143113*ne1.x + -0.048580915*nf1.x + 0.06527271*ng1.x + -0.042320378*nh1.x + -0.09458812*ni1.x; + v = -0.03011336*na1.y + 0.1658467*nb1.y + 0.0071091754*nc1.y + -0.06092405*nd1.y + -0.18375023*ne1.y + 0.085011095*nf1.y + 0.065524936*ng1.y + -0.11302712*nh1.y + -0.06424482*ni1.y; + w = 0.016921792*na1.z + -0.06271212*nb1.z + -0.0177968*nc1.z + 0.046915255*nd1.z + -0.2927471*ne1.z + -0.2323749*nf1.z + -0.042442553*ng1.z + -0.023555394*nh1.z + -0.14939739*ni1.z; + x = -0.06065122*na1.w + -0.18494257*nb1.w + -0.028549945*nc1.w + 0.037122887*nd1.w + -0.0827869*ne1.w + -0.0648537*nf1.w + 0.124712236*ng1.w + -0.044237345*nh1.w + -0.052325983*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.010284809; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN60 +//!BIND LUMAN61 +//!SAVE LUMAN70 + +#define L0_tex LUMAN60_tex +#define L1_tex LUMAN61_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.16578029*a0.x + 0.013990818*b0.x + 0.09837317*c0.x + 0.07576955*d0.x + -0.16992646*e0.x + 0.23093958*f0.x + 0.017147336*g0.x + 0.1219098*h0.x + 0.12366357*i0.x; + float j = 0.07109732*a0.y + -0.1423914*b0.y + -0.1047342*c0.y + 0.009923733*d0.y + -0.19652642*e0.y + 0.07588192*f0.y + 0.14325468*g0.y + 0.15657106*h0.y + 0.05293008*i0.y; + float k = 0.078111775*a0.z + 0.064393364*b0.z + -0.016043022*c0.z + 0.024629833*d0.z + 0.006721816*e0.z + 0.14674336*f0.z + -0.015520731*g0.z + -0.06537491*h0.z + 0.086636305*i0.z; + float l = -0.0741245*a0.w + -0.06732808*b0.w + -0.079615004*c0.w + -0.008385015*d0.w + -0.10109181*e0.w + -0.07363017*f0.w + -0.035449628*g0.w + 0.06175979*h0.w + -0.07361961*i0.w; + float m = 0.063247964*a1.x + -0.075120606*b1.x + -0.028360335*c1.x + 0.030195588*d1.x + 0.10427086*e1.x + 0.13412566*f1.x + 0.042594828*g1.x + -0.03038559*h1.x + -0.042622592*i1.x; + float n = 0.11696979*a1.y + -0.027478525*b1.y + -0.099160425*c1.y + 0.08101374*d1.y + -0.06059322*e1.y + 0.04557204*f1.y + -0.057096496*g1.y + 0.0312891*h1.y + 0.078683846*i1.y; + float o = -0.12690002*a1.z + 0.0043969243*b1.z + -0.04436471*c1.z + -0.15787491*d1.z + -0.027084693*e1.z + 0.07680882*f1.z + -0.02875257*g1.z + -0.23554859*h1.z + -0.0563404*i1.z; + float p = 0.08040078*a1.w + 0.08603515*b1.w + 0.041610844*c1.w + 0.003927433*d1.w + -0.09296107*e1.w + 0.039034292*f1.w + -0.0036091765*g1.w + 0.14170401*h1.w + -0.033236314*i1.w; + float q = -0.096916005*na0.x + 0.02102143*nb0.x + -0.12104281*nc0.x + -0.12628518*nd0.x + -0.068820976*ne0.x + -0.069862284*nf0.x + -0.08238152*ng0.x + -0.15156785*nh0.x + -0.11870064*ni0.x; + float r = 0.03282288*na0.y + 0.041718647*nb0.y + 0.082437046*nc0.y + -0.029205652*nd0.y + 0.09701532*ne0.y + -0.054706994*nf0.y + -0.07382584*ng0.y + -0.06306124*nh0.y + 0.029283857*ni0.y; + float s = 0.012279362*na0.z + -0.07578884*nb0.z + 0.03965951*nc0.z + 0.11721266*nd0.z + 0.016962193*ne0.z + -0.13157724*nf0.z + 0.0441183*ng0.z + 0.04841312*nh0.z + -0.033188727*ni0.z; + float t = 0.076621324*na0.w + 0.005180186*nb0.w + 0.096331365*nc0.w + -0.14043762*nd0.w + 0.00794994*ne0.w + 0.0113677345*nf0.w + -0.038655013*ng0.w + -0.037150774*nh0.w + 0.049118478*ni0.w; + float u = 0.043390647*na1.x + 0.14366865*nb1.x + 0.059894454*nc1.x + 0.040974643*nd1.x + -0.24173065*ne1.x + -0.167277*nf1.x + -0.051057592*ng1.x + -0.06775998*nh1.x + 0.09672075*ni1.x; + float v = 0.011191803*na1.y + 0.05300878*nb1.y + 0.049616437*nc1.y + 0.053501844*nd1.y + -0.048268393*ne1.y + 0.04606292*nf1.y + -0.018835546*ng1.y + 0.003935801*nh1.y + 0.017734563*ni1.y; + float w = 0.051565535*na1.z + -0.055144522*nb1.z + 0.076759696*nc1.z + 0.09252661*nd1.z + 0.037071202*ne1.z + -0.17852075*nf1.z + 0.12125989*ng1.z + 0.18283102*nh1.z + -0.00016908294*ni1.z; + float x = -0.17815267*na1.w + -0.13834023*nb1.w + -0.05997425*nc1.w + 0.1757715*nd1.w + -0.37225088*ne1.w + -0.11723465*nf1.w + 0.08268649*ng1.w + 0.035000995*nh1.w + -0.16776145*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.028719269; + i = 0.18548845*a0.x + -0.05647053*b0.x + -0.040696014*c0.x + 0.052823003*d0.x + -0.4189399*e0.x + -0.015366636*f0.x + 0.06766774*g0.x + 0.15743747*h0.x + 0.033094455*i0.x; + j = 0.030546375*a0.y + 0.03572686*b0.y + 0.17469496*c0.y + 0.2902643*d0.y + 0.014449327*e0.y + -0.084437944*f0.y + 0.0078015416*g0.y + 0.058347438*h0.y + -0.12598446*i0.y; + k = -0.02351964*a0.z + -0.13462098*b0.z + -0.10640411*c0.z + -0.05373117*d0.z + -0.16264963*e0.z + 0.13459212*f0.z + 0.029319022*g0.z + -0.010710142*h0.z + 0.099324025*i0.z; + l = -0.06633435*a0.w + 0.021756038*b0.w + 0.06893574*c0.w + -0.008018089*d0.w + -0.23540919*e0.w + 0.02644514*f0.w + -0.13601077*g0.w + -0.008815168*h0.w + -0.011743013*i0.w; + m = 0.038345877*a1.x + -0.086153336*b1.x + 0.07479341*c1.x + -0.010996278*d1.x + 0.14060572*e1.x + -0.31776565*f1.x + -0.058094885*g1.x + -0.058991406*h1.x + -0.1718826*i1.x; + n = 0.19658592*a1.y + -0.061105892*b1.y + 0.057346955*c1.y + -0.100882664*d1.y + -0.4392003*e1.y + -0.05740425*f1.y + -0.1170415*g1.y + -0.01486477*h1.y + -0.0033719817*i1.y; + o = -0.0748515*a1.z + 0.027030269*b1.z + 0.08899301*c1.z + -0.15835983*d1.z + -0.10266469*e1.z + -0.015304557*f1.z + -0.02540133*g1.z + 0.1456681*h1.z + 0.057394672*i1.z; + p = 0.05575373*a1.w + 0.060642187*b1.w + -0.087482736*c1.w + -0.048063513*d1.w + 0.02059542*e1.w + 0.26618627*f1.w + 0.10006077*g1.w + 0.11526471*h1.w + -0.048317786*i1.w; + q = -0.13790658*na0.x + -0.063561045*nb0.x + 0.07387912*nc0.x + 0.017276092*nd0.x + 0.14578958*ne0.x + -0.24436425*nf0.x + -0.0341115*ng0.x + -0.2219738*nh0.x + 0.06889617*ni0.x; + r = -0.042442624*na0.y + -0.13584505*nb0.y + -0.039730333*nc0.y + -0.12337824*nd0.y + -0.021769421*ne0.y + 0.07597415*nf0.y + 0.0382621*ng0.y + -0.057937287*nh0.y + 0.040303767*ni0.y; + s = 0.056913987*na0.z + -0.004294972*nb0.z + 0.10427198*nc0.z + 0.20038685*nd0.z + 0.18569255*ne0.z + 0.054610845*nf0.z + -0.00021753006*ng0.z + 0.05635846*nh0.z + -0.12966545*ni0.z; + t = 0.03689294*na0.w + -0.12253988*nb0.w + -0.064768024*nc0.w + -0.12623608*nd0.w + 0.05227509*ne0.w + -0.07615756*nf0.w + 0.1060167*ng0.w + 0.022959046*nh0.w + 0.006676678*ni0.w; + u = -0.05955148*na1.x + 0.16712731*nb1.x + 0.113733746*nc1.x + 0.048157085*nd1.x + -0.13083988*ne1.x + 0.3291639*nf1.x + 0.17111477*ng1.x + 0.1411651*nh1.x + -0.058225065*ni1.x; + v = -0.053716976*na1.y + 0.051629025*nb1.y + -0.09303743*nc1.y + 0.050438844*nd1.y + 0.3974745*ne1.y + 0.109845474*nf1.y + 0.06978495*ng1.y + -0.048667617*nh1.y + -0.0008301881*ni1.y; + w = 0.08895754*na1.z + 0.04203822*nb1.z + -0.071697205*nc1.z + 0.06069184*nd1.z + 0.08287753*ne1.z + 0.12639408*nf1.z + -0.021879954*ng1.z + -0.053128574*nh1.z + -0.031865556*ni1.z; + x = -0.042749748*na1.w + 0.012698759*nb1.w + 0.041044585*nc1.w + 0.25456965*nd1.w + -0.11546677*ne1.w + -0.0329849*nf1.w + -0.07359456*ng1.w + -0.14368512*nh1.w + 0.11999542*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.011110204; + i = 0.0074592545*a0.x + 0.043397088*b0.x + 0.062201325*c0.x + 0.023201836*d0.x + 0.25556907*e0.x + 0.040537015*f0.x + 0.00130909*g0.x + -0.105612725*h0.x + 0.053336933*i0.x; + j = -0.17386965*a0.y + -0.32382426*b0.y + -0.061145358*c0.y + 0.04002571*d0.y + -0.23882376*e0.y + -0.033762064*f0.y + -0.12921101*g0.y + -0.15359834*h0.y + 0.16432834*i0.y; + k = 0.028706433*a0.z + -0.10239519*b0.z + 0.17036264*c0.z + 0.05046601*d0.z + -0.07968705*e0.z + 0.06268126*f0.z + 0.03414322*g0.z + -0.14754891*h0.z + -0.08879028*i0.z; + l = -0.036177054*a0.w + -0.14996824*b0.w + -0.12140647*c0.w + 0.062374283*d0.w + 0.21741039*e0.w + -0.012958527*f0.w + -0.02862404*g0.w + -0.014645144*h0.w + -0.07075824*i0.w; + m = -0.01300554*a1.x + -0.118286535*b1.x + -0.022690719*c1.x + 0.09580937*d1.x + 0.2351647*e1.x + 0.093059495*f1.x + 0.097405665*g1.x + 0.26961285*h1.x + 0.31288835*i1.x; + n = 0.008415521*a1.y + -0.16029839*b1.y + -0.06299726*c1.y + 0.053338848*d1.y + 0.1848575*e1.y + 0.16177703*f1.y + 0.033813134*g1.y + 0.074481755*h1.y + 0.1191071*i1.y; + o = 0.03554395*a1.z + 0.029654032*b1.z + -0.0025611767*c1.z + 0.13693488*d1.z + 0.20568362*e1.z + -0.02008338*f1.z + 0.110492304*g1.z + -0.015586609*h1.z + 0.008658279*i1.z; + p = -0.062073592*a1.w + 0.12636374*b1.w + 0.143853*c1.w + 0.13521259*d1.w + 0.086283565*e1.w + -0.1396292*f1.w + 0.11080437*g1.w + 0.06066151*h1.w + -0.047289044*i1.w; + q = 0.079622135*na0.x + 0.13997798*nb0.x + -0.12444296*nc0.x + -0.24639496*nd0.x + -0.058971554*ne0.x + -0.043049175*nf0.x + -0.16991176*ng0.x + 0.28243*nh0.x + 0.114248134*ni0.x; + r = 0.19420412*na0.y + 0.22056995*nb0.y + 0.02228691*nc0.y + -0.08229736*nd0.y + -0.17353967*ne0.y + 0.027384117*nf0.y + -0.055681773*ng0.y + 0.047341447*nh0.y + 0.011827025*ni0.y; + s = -0.19429816*na0.z + -0.019068794*nb0.z + -0.15515451*nc0.z + -0.1561127*nd0.z + -0.5365578*ne0.z + -0.47798854*nf0.z + -0.088053495*ng0.z + 0.08626954*nh0.z + 0.033513896*ni0.z; + t = -0.019487524*na0.w + 0.12894231*nb0.w + 0.057398915*nc0.w + 0.035676952*nd0.w + -0.1672153*ne0.w + -0.009412913*nf0.w + 0.08559531*ng0.w + 0.12037487*nh0.w + 0.11312014*ni0.w; + u = 0.022511158*na1.x + -0.002289268*nb1.x + -0.10513552*nc1.x + -0.03751128*nd1.x + -0.14417613*ne1.x + -0.25909096*nf1.x + -0.06497719*ng1.x + -0.19180773*nh1.x + -0.10507793*ni1.x; + v = -0.018047635*na1.y + 0.109712765*nb1.y + -0.007114467*nc1.y + -0.1626408*nd1.y + -0.09422333*ne1.y + 0.008029611*nf1.y + -0.092768595*ng1.y + 0.008543296*nh1.y + -0.06329041*ni1.y; + w = -0.004643168*na1.z + -0.06549557*nb1.z + 0.024286577*nc1.z + 0.11289367*nd1.z + -0.06594302*ne1.z + 0.0007953774*nf1.z + -0.024661655*ng1.z + -0.08614193*nh1.z + 0.04030148*ni1.z; + x = 0.036247578*na1.w + -0.15959524*nb1.w + -0.047722068*nc1.w + -0.061771885*nd1.w + -0.027329838*ne1.w + 0.10989542*nf1.w + -0.07891876*ng1.w + 0.053630132*nh1.w + 0.07017752*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.024209157; + i = 0.0803816*a0.x + -0.27919126*b0.x + 0.074065596*c0.x + -0.028041711*d0.x + 0.08890479*e0.x + -0.23712136*f0.x + -0.097136654*g0.x + 0.12058667*h0.x + -0.08708536*i0.x; + j = 0.1727559*a0.y + -0.017551957*b0.y + -0.022949927*c0.y + -0.29679775*d0.y + 0.26063496*e0.y + 0.1274615*f0.y + 0.22342013*g0.y + 0.2565278*h0.y + -0.17510408*i0.y; + k = -0.13825856*a0.z + -0.32330674*b0.z + -0.096224956*c0.z + 0.015928205*d0.z + -0.008965429*e0.z + -0.009688457*f0.z + -0.053291973*g0.z + 0.0035815418*h0.z + -0.01406214*i0.z; + l = 0.025246026*a0.w + 0.08746249*b0.w + 0.054473277*c0.w + 0.07564705*d0.w + 0.36086765*e0.w + -0.07294847*f0.w + -0.05731445*g0.w + 0.16488546*h0.w + 0.1051391*i0.w; + m = 0.043292508*a1.x + -0.05688463*b1.x + -0.015260159*c1.x + -0.034311038*d1.x + 0.022605684*e1.x + 0.067839354*f1.x + 0.0061159763*g1.x + -0.21483196*h1.x + -0.21822494*i1.x; + n = 0.07060806*a1.y + 0.036499433*b1.y + 0.06328188*c1.y + -0.01600864*d1.y + 0.12019602*e1.y + -0.005704468*f1.y + -0.08529293*g1.y + 0.11870455*h1.y + -0.010954343*i1.y; + o = -0.025742063*a1.z + 0.03137751*b1.z + -0.05091499*c1.z + 0.09746075*d1.z + -0.12615938*e1.z + 0.022217032*f1.z + -0.070888266*g1.z + -0.13394141*h1.z + 0.045135196*i1.z; + p = -0.0045820107*a1.w + -0.17361222*b1.w + -0.034899686*c1.w + 0.13965659*d1.w + 0.28254306*e1.w + 0.08674435*f1.w + 0.0043952106*g1.w + -0.08248237*h1.w + -0.060236216*i1.w; + q = -0.01671497*na0.x + 0.2706943*nb0.x + -0.059392486*nc0.x + -0.08367182*nd0.x + -0.12964763*ne0.x + 0.14313929*nf0.x + -0.0376002*ng0.x + -0.1556175*nh0.x + 0.1717994*ni0.x; + r = -0.13063015*na0.y + -0.09716623*nb0.y + 0.024953064*nc0.y + -0.12042667*nd0.y + -0.099800974*ne0.y + -0.05611497*nf0.y + 0.09859522*ng0.y + -0.15328264*nh0.y + 0.17297874*ni0.y; + s = 0.07288057*na0.z + -0.026626898*nb0.z + 0.022637181*nc0.z + -0.082871124*nd0.z + -0.099834375*ne0.z + 0.048337597*nf0.z + -0.013129719*ng0.z + -0.106599286*nh0.z + -0.09004616*ni0.z; + t = -0.016658474*na0.w + -0.07718386*nb0.w + 0.012443814*nc0.w + -0.17324288*nd0.w + -0.12695457*ne0.w + 0.079303846*nf0.w + 0.050723445*ng0.w + -0.079862684*nh0.w + -0.101098046*ni0.w; + u = -0.07239776*na1.x + 0.049419682*nb1.x + 0.0034176882*nc1.x + -0.0030864673*nd1.x + 0.050037086*ne1.x + -0.031178009*nf1.x + 0.1564304*ng1.x + 0.017682616*nh1.x + -0.011802952*ni1.x; + v = 0.034944337*na1.y + -0.07103817*nb1.y + -0.046081703*nc1.y + -0.020656273*nd1.y + 0.0087076835*ne1.y + -0.015704094*nf1.y + 0.0063806917*ng1.y + -0.23284888*nh1.y + 0.12339237*ni1.y; + w = 0.052958157*na1.z + -0.08084726*nb1.z + -0.029484414*nc1.z + -0.08496418*nd1.z + 0.03637533*ne1.z + 0.023300169*nf1.z + 0.16558544*ng1.z + 0.21808468*nh1.z + -0.06323104*ni1.z; + x = 0.0126498*na1.w + 0.11205986*nb1.w + 0.043474864*nc1.w + 0.02638971*nd1.w + -0.43571174*ne1.w + -0.029462261*nf1.w + 0.063208215*ng1.w + -0.034104012*nh1.w + 0.15246783*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.026696365; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN60 +//!BIND LUMAN61 +//!SAVE LUMAN71 + +#define L0_tex LUMAN60_tex +#define L1_tex LUMAN61_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.02122406*a0.x + -0.122874014*b0.x + 0.038901694*c0.x + -0.20805544*d0.x + 0.17793977*e0.x + -0.10250643*f0.x + 0.06715224*g0.x + 0.117481254*h0.x + 0.06661811*i0.x; + float j = 0.20923853*a0.y + -0.048322447*b0.y + 0.005236233*c0.y + -0.28995273*d0.y + 0.3262455*e0.y + 0.33262008*f0.y + 0.052094195*g0.y + 0.17168306*h0.y + -0.036342744*i0.y; + float k = -0.34261653*a0.z + -0.16838802*b0.z + 0.037084457*c0.z + -0.079159625*d0.z + -0.23170805*e0.z + -0.1125017*f0.z + -0.038093638*g0.z + 0.022413125*h0.z + -0.09555592*i0.z; + float l = -0.086659975*a0.w + 0.106437966*b0.w + 0.0443302*c0.w + 0.06381515*d0.w + -0.053781297*e0.w + -0.11590847*f0.w + -0.045483135*g0.w + -0.07360541*h0.w + 0.10073613*i0.w; + float m = -0.05701288*a1.x + -0.24610838*b1.x + 0.018135766*c1.x + 0.12883955*d1.x + 0.41501093*e1.x + 0.06160426*f1.x + -0.015019228*g1.x + -0.04798661*h1.x + -0.18290891*i1.x; + float n = 0.08840133*a1.y + -0.0723592*b1.y + -0.013035237*c1.y + 0.029143438*d1.y + 0.07747262*e1.y + 0.1619763*f1.y + -0.0152199*g1.y + -0.07636964*h1.y + -0.06660503*i1.y; + float o = -0.06300358*a1.z + -0.16973108*b1.z + -0.030542169*c1.z + 0.31630164*d1.z + 0.16739343*e1.z + -0.04173233*f1.z + 0.1247867*g1.z + 0.025531637*h1.z + 0.06582077*i1.z; + float p = -0.09305507*a1.w + -0.28399915*b1.w + -0.080629244*c1.w + 0.23983668*d1.w + 0.12860516*e1.w + 0.23577705*f1.w + 0.13577867*g1.w + -0.07724891*h1.w + -0.008147254*i1.w; + float q = 0.03351352*na0.x + 0.27948612*nb0.x + 0.08278565*nc0.x + -0.22903872*nd0.x + -0.36529925*ne0.x + -0.11294542*nf0.x + -0.10836371*ng0.x + 0.043583702*nh0.x + 0.12022892*ni0.x; + float r = 0.24315806*na0.y + -0.014898937*nb0.y + -0.072684065*nc0.y + -0.34174332*nd0.y + -0.3306895*ne0.y + -0.1688999*nf0.y + 0.1802616*ng0.y + 0.054149028*nh0.y + 0.07491759*ni0.y; + float s = 0.14524053*na0.z + 0.03985881*nb0.z + -0.07349137*nc0.z + -0.029068999*nd0.z + 0.29518262*ne0.z + 0.105075926*nf0.z + -0.044849645*ng0.z + -0.07877199*nh0.z + -0.018896762*ni0.z; + float t = 0.006239417*na0.w + -0.041456237*nb0.w + -0.0608528*nc0.w + 0.026246265*nd0.w + 0.1952428*ne0.w + 0.10006589*nf0.w + 0.1131621*ng0.w + 0.04781334*nh0.w + -0.10323906*ni0.w; + float u = 0.0026973956*na1.x + 0.024592897*nb1.x + -0.08732975*nc1.x + -0.12753011*nd1.x + 0.037744883*ne1.x + -0.04100176*nf1.x + 0.12247657*ng1.x + -0.06303277*nh1.x + -0.030839955*ni1.x; + float v = 0.04998994*na1.y + 0.2190631*nb1.y + 0.012344049*nc1.y + -0.046477366*nd1.y + 0.21627255*ne1.y + -0.12330876*nf1.y + -0.024180658*ng1.y + -0.072642304*nh1.y + 0.051594056*ni1.y; + float w = 0.22652966*na1.z + 0.073615074*nb1.z + -0.08273673*nc1.z + -0.08763388*nd1.z + -0.008043756*ne1.z + 0.12864473*nf1.z + 0.03537027*ng1.z + 0.059408348*nh1.z + 0.04823138*ni1.z; + float x = 0.1555011*na1.w + 0.18730667*nb1.w + 0.092899986*nc1.w + -0.09313055*nd1.w + -0.33994874*ne1.w + -0.24858464*nf1.w + -0.03746077*ng1.w + -0.026002746*nh1.w + 0.29153302*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.011664822; + i = 0.02352895*a0.x + 0.05641156*b0.x + 0.078280956*c0.x + 0.07717666*d0.x + -0.035463758*e0.x + 0.009567614*f0.x + 0.00025401218*g0.x + -0.03555166*h0.x + 0.2594732*i0.x; + j = -0.11683443*a0.y + 0.080092624*b0.y + 0.056203302*c0.y + 0.1363966*d0.y + -0.0110321725*e0.y + -0.045341235*f0.y + -0.059118755*g0.y + 0.15527584*h0.y + 0.01331635*i0.y; + k = -0.0041987197*a0.z + 0.0345237*b0.z + 0.15223417*c0.z + 0.012654664*d0.z + -0.5447243*e0.z + 0.05722937*f0.z + -0.049002286*g0.z + -0.004447922*h0.z + 0.04951206*i0.z; + l = -0.08451674*a0.w + -0.024253484*b0.w + -0.017119942*c0.w + -0.037239343*d0.w + -0.022879312*e0.w + 0.008458778*f0.w + -0.0017262232*g0.w + 0.015090765*h0.w + -0.040642884*i0.w; + m = -0.054323617*a1.x + -0.10455227*b1.x + 0.11347284*c1.x + 0.084072776*d1.x + -0.1276103*e1.x + -0.07317883*f1.x + 0.11719509*g1.x + 0.057568833*h1.x + -0.051696643*i1.x; + n = 0.042820938*a1.y + -0.02861234*b1.y + -0.001742703*c1.y + -0.02341394*d1.y + 0.06754185*e1.y + 0.17484309*f1.y + 0.04625852*g1.y + 0.013787463*h1.y + 0.021725819*i1.y; + o = 0.015193026*a1.z + 0.022666635*b1.z + -0.004895655*c1.z + 0.079393126*d1.z + -0.041474957*e1.z + 0.022292048*f1.z + -0.04631282*g1.z + -0.2341182*h1.z + -0.047459356*i1.z; + p = 0.069909975*a1.w + 0.09708741*b1.w + -0.015319313*c1.w + 0.08355726*d1.w + -0.089847885*e1.w + 0.036775794*f1.w + -0.08940877*g1.w + -0.10380246*h1.w + -0.01191475*i1.w; + q = -0.027098697*na0.x + -0.012161473*nb0.x + -0.026864702*nc0.x + -0.12660462*nd0.x + 0.0990314*ne0.x + -0.12914999*nf0.x + -0.046412915*ng0.x + -0.12010923*nh0.x + -0.11516924*ni0.x; + r = -0.033694383*na0.y + 0.06400211*nb0.y + -0.041638944*nc0.y + 0.058733433*nd0.y + 0.13461815*ne0.y + 0.069503896*nf0.y + 0.057904493*ng0.y + 0.04740161*nh0.y + 0.052169807*ni0.y; + s = -0.1280024*na0.z + 0.07261403*nb0.z + -0.16699356*nc0.z + -0.18404467*nd0.z + 0.03145433*ne0.z + -0.25424013*nf0.z + -0.05147552*ng0.z + -0.026482437*nh0.z + -0.10573895*ni0.z; + t = 0.067109175*na0.w + 0.031449948*nb0.w + 0.013580667*nc0.w + 0.08999468*nd0.w + 0.06441078*ne0.w + 0.011897138*nf0.w + -0.02429012*ng0.w + -0.014271303*nh0.w + 0.040478792*ni0.w; + u = 0.012266889*na1.x + 0.012559257*nb1.x + -0.09407199*nc1.x + 0.053907778*nd1.x + 0.098508924*ne1.x + 0.15341955*nf1.x + 0.006937512*ng1.x + 0.005956507*nh1.x + 0.03249789*ni1.x; + v = 0.013781064*na1.y + 0.058633123*nb1.y + -0.0028954444*nc1.y + 0.05297195*nd1.y + 0.06769266*ne1.y + -0.02680043*nf1.y + -0.04230351*ng1.y + 0.009958785*nh1.y + 0.02449031*ni1.y; + w = 0.02855934*na1.z + -0.027689163*nb1.z + -0.091561586*nc1.z + 0.07357439*nd1.z + 0.07912537*ne1.z + -0.007009628*nf1.z + 0.038752858*ng1.z + 0.22135073*nh1.z + 0.1820932*ni1.z; + x = -0.11065314*na1.w + -0.07073019*nb1.w + -0.039376423*nc1.w + 0.002637176*nd1.w + 0.18356855*ne1.w + -0.08918799*nf1.w + 0.102989495*ng1.w + 0.091820255*nh1.w + 0.081612736*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.03237309; + i = -0.029179381*a0.x + -0.399904*b0.x + -0.10546226*c0.x + -0.15321073*d0.x + -0.24549395*e0.x + 0.1059444*f0.x + 0.03506827*g0.x + -0.10771783*h0.x + -0.008853774*i0.x; + j = 0.3460747*a0.y + 0.0865475*b0.y + -0.14424714*c0.y + -0.057151236*d0.y + 0.016695386*e0.y + 0.018587252*f0.y + 0.0057751653*g0.y + -0.04921362*h0.y + 0.08053979*i0.y; + k = -0.07731715*a0.z + -0.33547333*b0.z + -0.19403888*c0.z + -0.13951413*d0.z + -0.2874189*e0.z + -0.0733894*f0.z + 0.083793215*g0.z + 0.010882907*h0.z + -0.0801371*i0.z; + l = 0.086197056*a0.w + 0.042804822*b0.w + 0.06790401*c0.w + 0.11497068*d0.w + 0.40902892*e0.w + -0.100231454*f0.w + -0.09324331*g0.w + 0.061669666*h0.w + -0.078184955*i0.w; + m = 0.1024341*a1.x + 0.09483551*b1.x + -0.11577831*c1.x + 0.061093554*d1.x + 0.4354177*e1.x + -0.003482848*f1.x + -0.054774903*g1.x + -0.052496303*h1.x + 0.055754557*i1.x; + n = 0.027582759*a1.y + 0.048956715*b1.y + 0.081751816*c1.y + -0.08518418*d1.y + 0.0071396288*e1.y + -0.07494192*f1.y + -0.05762159*g1.y + 0.03547776*h1.y + -0.04589949*i1.y; + o = 0.08761022*a1.z + -0.11256065*b1.z + -0.07362036*c1.z + -0.005784562*d1.z + -0.1518354*e1.z + 0.0707934*f1.z + 0.07585483*g1.z + -0.101856686*h1.z + 0.02290287*i1.z; + p = -0.14703225*a1.w + -0.40506554*b1.w + -0.08841411*c1.w + -0.10106204*d1.w + 0.020844888*e1.w + -0.08255499*f1.w + 0.072836034*g1.w + -0.22072136*h1.w + 0.078699805*i1.w; + q = 0.05410673*na0.x + 0.56434864*nb0.x + 0.15250632*nc0.x + 0.15072995*nd0.x + 0.23121674*ne0.x + -0.091878496*nf0.x + 0.021191215*ng0.x + 0.30648914*nh0.x + 0.0027192836*ni0.x; + r = -0.15243874*na0.y + 0.16097021*nb0.y + 0.14542924*nc0.y + -0.2594916*nd0.y + 0.2001302*ne0.y + 0.15738378*nf0.y + 0.1125107*ng0.y + -0.000828865*nh0.y + 0.0034008678*ni0.y; + s = 0.09582677*na0.z + -0.20216575*nb0.z + 0.0342159*nc0.z + 0.1348178*nd0.z + 0.25691655*ne0.z + 0.065807156*nf0.z + -0.04580014*ng0.z + -0.06942384*nh0.z + 0.094458185*ni0.z; + t = -0.08216763*na0.w + -0.06083898*nb0.w + 0.0253852*nc0.w + -0.073093645*nd0.w + -0.11038054*ne0.w + 0.052107688*nf0.w + 0.1660941*ng0.w + -0.016418027*nh0.w + 0.03343749*ni0.w; + u = -0.19165094*na1.x + -0.1334287*nb1.x + 0.0091586765*nc1.x + -0.10333341*nd1.x + -0.15913464*ne1.x + 0.0407771*nf1.x + 0.12843952*ng1.x + -0.08429767*nh1.x + -0.05745864*ni1.x; + v = -0.081046775*na1.y + 0.07381984*nb1.y + 0.009666139*nc1.y + -0.038198773*nd1.y + 0.24606997*ne1.y + 0.14351115*nf1.y + 0.019953914*ng1.y + -0.0036941094*nh1.y + 0.12769328*ni1.y; + w = -0.049717456*na1.z + 0.037626073*nb1.z + 0.04401121*nc1.z + -0.09087364*nd1.z + 0.0401449*ne1.z + 0.1321236*nf1.z + -0.17823285*ng1.z + 0.053816546*nh1.z + -0.028679416*ni1.z; + x = 0.13035227*na1.w + 0.27161187*nb1.w + 0.031947732*nc1.w + -0.0975645*nd1.w + 0.16841753*ne1.w + -0.27727732*nf1.w + -0.21447992*ng1.w + 0.078854404*nh1.w + -0.054858927*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.01894838; + i = 0.0079668425*a0.x + -0.07422627*b0.x + -0.05381097*c0.x + -0.001110633*d0.x + -0.20713502*e0.x + -0.056877725*f0.x + 0.14787298*g0.x + -0.007461876*h0.x + 0.11331837*i0.x; + j = 0.06312278*a0.y + -0.1544424*b0.y + 0.11058164*c0.y + 0.5353646*d0.y + 0.4057092*e0.y + -0.016643116*f0.y + -0.18393958*g0.y + 0.081287585*h0.y + 0.13400263*i0.y; + k = 0.050054587*a0.z + 0.390245*b0.z + 0.07146366*c0.z + -0.025271675*d0.z + 0.24546371*e0.z + -0.06178857*f0.z + 0.15098862*g0.z + -0.06981505*h0.z + -0.000883212*i0.z; + l = -0.14884777*a0.w + -0.030569784*b0.w + -0.034837935*c0.w + 0.17419794*d0.w + -0.15046959*e0.w + 0.034272935*f0.w + -0.02676834*g0.w + -0.075397864*h0.w + -0.13665098*i0.w; + m = 0.006430372*a1.x + 0.03326361*b1.x + 0.22867146*c1.x + 0.060091905*d1.x + 0.10638443*e1.x + -0.03568107*f1.x + -0.07123764*g1.x + 0.08767965*h1.x + 0.0161292*i1.x; + n = 0.10730417*a1.y + -0.123981245*b1.y + -0.12169163*c1.y + -0.060162723*d1.y + 0.2749544*e1.y + -0.022398425*f1.y + -0.04764729*g1.y + -0.07512602*h1.y + 0.0038564159*i1.y; + o = -0.11018294*a1.z + 0.110614195*b1.z + -0.051655006*c1.z + 0.026749836*d1.z + -0.018087594*e1.z + 0.15209238*f1.z + -0.07122703*g1.z + -0.124878496*h1.z + -0.012159373*i1.z; + p = -0.01836787*a1.w + 0.11678819*b1.w + -0.14215414*c1.w + -0.027997391*d1.w + -0.2400757*e1.w + 0.11681005*f1.w + 0.048901644*g1.w + 0.27619568*h1.w + 0.12937818*i1.w; + q = -0.007452019*na0.x + -0.108269095*nb0.x + 0.0377401*nc0.x + -0.025126463*nd0.x + -0.25620756*ne0.x + 0.032948766*nf0.x + 0.119483955*ng0.x + -0.009526129*nh0.x + -0.24419886*ni0.x; + r = 0.05470462*na0.y + -0.10784284*nb0.y + -0.16701409*nc0.y + -0.2059512*nd0.y + -0.5498889*ne0.y + -0.03296476*nf0.y + -0.036837514*ng0.y + 0.06995424*nh0.y + -0.18900663*ni0.y; + s = 0.03921239*na0.z + -0.21186037*nb0.z + -0.034299407*nc0.z + -0.055376794*nd0.z + -0.24106656*ne0.z + 0.11517722*nf0.z + -0.08621893*ng0.z + 0.21757211*nh0.z + 0.08821429*ni0.z; + t = 0.053762823*na0.w + 0.12375887*nb0.w + -0.040141582*nc0.w + -0.0043350835*nd0.w + -0.13625754*ne0.w + -0.066250436*nf0.w + 0.022221101*ng0.w + 0.0782264*nh0.w + 0.060842544*ni0.w; + u = -0.06924076*na1.x + 0.0055637453*nb1.x + 0.022828998*nc1.x + 0.014314398*nd1.x + -0.21101159*ne1.x + 0.08400121*nf1.x + 0.045525722*ng1.x + 0.2275885*nh1.x + 0.019211018*ni1.x; + v = 0.016533395*na1.y + 0.24990486*nb1.y + 0.008917476*nc1.y + -0.075179845*nd1.y + -0.55625296*ne1.y + 0.024725836*nf1.y + 0.055780824*ng1.y + 0.14240427*nh1.y + 0.0060216533*ni1.y; + w = 0.14341103*na1.z + -0.00055958953*nb1.z + -0.0022099577*nc1.z + -0.07100837*nd1.z + -0.11276687*ne1.z + -0.21479277*nf1.z + -0.05732173*ng1.z + -0.0015413442*nh1.z + 0.13017043*ni1.z; + x = -0.04714052*na1.w + -0.07072589*nb1.w + 0.25506595*nc1.w + -0.015962688*nd1.w + 0.0036053585*ne1.w + -0.2162668*nf1.w + -0.045118492*ng1.w + -0.120520905*nh1.w + -0.08143057*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.011888741; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN70 +//!BIND LUMAN71 +//!SAVE LUMAN80 + +#define L0_tex LUMAN70_tex +#define L1_tex LUMAN71_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.030014958*a0.x + 0.11617654*b0.x + 0.085433066*c0.x + -0.1261423*d0.x + 0.047405504*e0.x + 0.061996467*f0.x + -0.10112785*g0.x + 0.047271233*h0.x + -0.06215415*i0.x; + float j = -0.0022536367*a0.y + -0.0060937707*b0.y + -0.10756953*c0.y + 0.31538245*d0.y + 0.037766777*e0.y + -0.056547288*f0.y + 0.14819144*g0.y + -0.10782268*h0.y + -0.06100584*i0.y; + float k = 0.08497498*a0.z + 0.26157343*b0.z + 0.013502692*c0.z + 0.0699558*d0.z + -0.19328873*e0.z + -0.0475276*f0.z + 0.026507724*g0.z + -0.06282603*h0.z + -0.04068036*i0.z; + float l = 0.046383705*a0.w + -0.12183681*b0.w + -0.00920855*c0.w + 0.048471894*d0.w + -0.12586446*e0.w + -0.019446298*f0.w + -0.06742635*g0.w + 0.057105564*h0.w + 0.06584737*i0.w; + float m = 0.05995811*a1.x + 0.057865914*b1.x + 0.08130486*c1.x + 0.012107202*d1.x + -0.077897824*e1.x + 0.020051733*f1.x + -0.03836068*g1.x + -0.03387517*h1.x + -0.08656535*i1.x; + float n = -0.20272078*a1.y + -0.2898444*b1.y + -0.10181991*c1.y + 0.13289294*d1.y + -0.06898282*e1.y + 0.05879356*f1.y + 0.15247238*g1.y + -0.11598066*h1.y + 0.15448447*i1.y; + float o = -0.010809236*a1.z + -0.013210217*b1.z + 0.025830679*c1.z + 0.06216019*d1.z + 0.107064195*e1.z + -0.042192664*f1.z + 0.09274758*g1.z + 0.15812838*h1.z + 0.06922273*i1.z; + float p = -0.0037883355*a1.w + 0.34655213*b1.w + -0.045297805*c1.w + 0.31633198*d1.w + -0.025437295*e1.w + -0.0737913*f1.w + -0.050256167*g1.w + 0.13340046*h1.w + -0.000409566*i1.w; + float q = 0.1492289*na0.x + -0.108267814*nb0.x + -0.10260736*nc0.x + 0.11189305*nd0.x + -0.10544551*ne0.x + -0.04593426*nf0.x + -0.0037677416*ng0.x + 0.017464899*nh0.x + 0.06664255*ni0.x; + float r = -0.046894286*na0.y + -0.056725997*nb0.y + -0.004030325*nc0.y + -0.24687865*nd0.y + -0.22705816*ne0.y + 0.03502431*nf0.y + -0.07323742*ng0.y + 0.05469924*nh0.y + 0.081741415*ni0.y; + float s = 0.08213016*na0.z + 0.0768773*nb0.z + -0.03537941*nc0.z + -0.06633537*nd0.z + 0.114069745*ne0.z + -0.009495883*nf0.z + -0.018679574*ng0.z + 0.013978387*nh0.z + 0.026871966*ni0.z; + float t = -0.050113708*na0.w + -0.017639171*nb0.w + 0.08944528*nc0.w + -0.06568055*nd0.w + 0.06749932*ne0.w + -0.001076881*nf0.w + 0.021033864*ng0.w + -0.029971706*nh0.w + -0.024673859*ni0.w; + float u = -0.09274935*na1.x + -0.017219407*nb1.x + 0.07153254*nc1.x + -0.019134559*nd1.x + 0.010959568*ne1.x + 0.027879566*nf1.x + -0.05605097*ng1.x + 0.18517093*nh1.x + 0.24163705*ni1.x; + float v = -0.030460613*na1.y + 0.23515613*nb1.y + -0.01676363*nc1.y + -0.21486633*nd1.y + 0.12725422*ne1.y + -0.035603005*nf1.y + -0.060448986*ng1.y + 0.14119609*nh1.y + -0.10942523*ni1.y; + float w = -0.017671324*na1.z + 0.07077782*nb1.z + 0.047625095*nc1.z + -0.036915924*nd1.z + -0.034874*ne1.z + 0.04056334*nf1.z + -0.014123004*ng1.z + -0.13069338*nh1.z + -0.039977293*ni1.z; + float x = -0.034061715*na1.w + 0.044890523*nb1.w + 0.027299663*nc1.w + 0.110332996*nd1.w + -0.1110489*ne1.w + -0.024894679*nf1.w + 0.0005082329*ng1.w + -0.09139057*nh1.w + 0.0022179424*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0010033762; + i = 0.06580976*a0.x + 0.090325564*b0.x + -0.092303224*c0.x + -0.1921632*d0.x + 0.16887501*e0.x + 0.061186858*f0.x + -0.13799244*g0.x + -0.080583975*h0.x + 0.08009438*i0.x; + j = 0.038827766*a0.y + 0.07129585*b0.y + 0.06457054*c0.y + 0.073699266*d0.y + 0.3741513*e0.y + 0.32814056*f0.y + -0.04161421*g0.y + -0.06328244*h0.y + -0.014121296*i0.y; + k = -0.11162559*a0.z + 0.20382778*b0.z + -0.021276347*c0.z + -0.1364239*d0.z + -0.0548872*e0.z + -0.033816505*f0.z + -0.037953682*g0.z + 0.09243351*h0.z + 0.06231525*i0.z; + l = 0.02048114*a0.w + 0.01175961*b0.w + 0.054151285*c0.w + -0.029600991*d0.w + -0.023824004*e0.w + -0.06510234*f0.w + 0.03927156*g0.w + 0.06499078*h0.w + -0.022784628*i0.w; + m = 0.016850956*a1.x + 0.026961625*b1.x + -0.052743986*c1.x + 0.09705815*d1.x + 0.06611641*e1.x + -0.01187191*f1.x + 0.047533214*g1.x + 0.061463118*h1.x + 0.044322684*i1.x; + n = 0.12926874*a1.y + 0.03249992*b1.y + 0.09031417*c1.y + -0.057206884*d1.y + 0.046107754*e1.y + 0.1735186*f1.y + -0.0065893475*g1.y + 0.013552741*h1.y + 0.069328934*i1.y; + o = -0.016670505*a1.z + -0.021578414*b1.z + 0.02550263*c1.z + -0.07529392*d1.z + 0.3573727*e1.z + 0.17333965*f1.z + 0.10505426*g1.z + 0.09388872*h1.z + 0.040832248*i1.z; + p = 0.0022655723*a1.w + 0.0432011*b1.w + -0.037488054*c1.w + -0.10123399*d1.w + -0.013312289*e1.w + 0.39810044*f1.w + 0.1703332*g1.w + 0.267194*h1.w + 0.057249423*i1.w; + q = -0.09817141*na0.x + -0.12814802*nb0.x + -0.031350434*nc0.x + 0.05429472*nd0.x + 0.026484033*ne0.x + 0.008525635*nf0.x + -0.01994405*ng0.x + 0.018937474*nh0.x + 0.08722303*ni0.x; + r = -0.045527373*na0.y + -0.03788133*nb0.y + 0.06380586*nc0.y + -0.14537066*nd0.y + -0.37773526*ne0.y + -0.13665448*nf0.y + 0.0038751678*ng0.y + 0.023434704*nh0.y + -0.0126121305*ni0.y; + s = 0.032455314*na0.z + -0.07014963*nb0.z + -0.10840794*nc0.z + 0.056593336*nd0.z + 0.0997226*ne0.z + 0.073279805*nf0.z + 0.03609249*ng0.z + -0.09388379*nh0.z + 0.04320686*ni0.z; + t = 0.02869842*na0.w + 0.019633632*nb0.w + -0.20761648*nc0.w + 0.007862745*nd0.w + 0.17206855*ne0.w + 0.115441*nf0.w + -0.023055*ng0.w + -0.107899405*nh0.w + 0.03358721*ni0.w; + u = -0.15021364*na1.x + -0.058106124*nb1.x + -0.05313934*nc1.x + -0.21935156*nd1.x + -0.2837029*ne1.x + -0.32703993*nf1.x + 0.004271712*ng1.x + 0.011703954*nh1.x + -0.026351063*ni1.x; + v = 0.089627355*na1.y + 0.10110276*nb1.y + -0.08566261*nc1.y + 0.08988744*nd1.y + 0.2736199*ne1.y + 0.061440755*nf1.y + -0.11867137*ng1.y + -0.13680026*nh1.y + -0.016994294*ni1.y; + w = -0.012109746*na1.z + 0.14445293*nb1.z + 0.0195051*nc1.z + 0.02936328*nd1.z + -0.23767959*ne1.z + -0.062147606*nf1.z + -0.03837298*ng1.z + -0.09438165*nh1.z + -0.014003857*ni1.z; + x = 0.04015821*na1.w + 0.08921114*nb1.w + -0.03781241*nc1.w + 0.04544161*nd1.w + -0.15047587*ne1.w + -0.113894925*nf1.w + -0.016270371*ng1.w + -0.14870341*nh1.w + -0.07838714*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.005233699; + i = 0.20332266*a0.x + 0.23113528*b0.x + -0.10499726*c0.x + 0.21304177*d0.x + 0.45694575*e0.x + 0.36973694*f0.x + 0.006872644*g0.x + -0.03629579*h0.x + 0.20627238*i0.x; + j = -0.018542264*a0.y + 0.028391898*b0.y + 0.21007666*c0.y + -0.09255135*d0.y + 0.18852337*e0.y + 0.0866432*f0.y + -0.011221141*g0.y + 0.018708965*h0.y + -0.032289498*i0.y; + k = 0.15601139*a0.z + -0.17568673*b0.z + 0.24954684*c0.z + -0.110788256*d0.z + 0.11692911*e0.z + -0.12018874*f0.z + -0.00792691*g0.z + -0.09534362*h0.z + 0.02132795*i0.z; + l = 0.08638691*a0.w + 0.19674756*b0.w + 0.016465437*c0.w + 0.13435258*d0.w + 0.90902215*e0.w + 0.07517919*f0.w + -0.049425308*g0.w + -0.008632366*h0.w + -0.054769877*i0.w; + m = -0.07453417*a1.x + 0.21790457*b1.x + 0.008162849*c1.x + -0.12394449*d1.x + 0.0059843827*e1.x + 0.24361402*f1.x + -0.092146195*g1.x + 0.16333053*h1.x + 0.2316521*i1.x; + n = -0.098842025*a1.y + 0.23345315*b1.y + -0.13376193*c1.y + -0.12635028*d1.y + 0.2304464*e1.y + -0.19060019*f1.y + 0.12952028*g1.y + -0.11751126*h1.y + 0.0019323531*i1.y; + o = 0.004379882*a1.z + 0.017078549*b1.z + -0.007666424*c1.z + 0.11348806*d1.z + 0.3738288*e1.z + 0.044007506*f1.z + 0.06397631*g1.z + 0.21504378*h1.z + -0.0026930957*i1.z; + p = 0.08295408*a1.w + 0.055759627*b1.w + -0.066816345*c1.w + -0.05859507*d1.w + -0.0877545*e1.w + -0.28591236*f1.w + -0.17089866*g1.w + 0.27644*h1.w + 0.0549539*i1.w; + q = 0.08697659*na0.x + -0.20226933*nb0.x + 0.15128252*nc0.x + 0.039843*nd0.x + -0.2318923*ne0.x + -0.14413634*nf0.x + 0.109713756*ng0.x + 0.122127*nh0.x + -0.05870938*ni0.x; + r = 0.017261934*na0.y + 0.016533656*nb0.y + -0.13422614*nc0.y + -0.13052954*nd0.y + -0.082109*ne0.y + -0.24890792*nf0.y + -0.17485248*ng0.y + 0.024029763*nh0.y + 0.083183855*ni0.y; + s = 0.22126782*na0.z + -0.17896856*nb0.z + -0.08393778*nc0.z + 0.051395986*nd0.z + -0.38001397*ne0.z + 0.1924813*nf0.z + 0.04588781*ng0.z + -0.0063535552*nh0.z + -0.047122724*ni0.z; + t = -0.14722922*na0.w + 0.097014315*nb0.w + -0.080777146*nc0.w + -0.20412444*nd0.w + -0.39001748*ne0.w + 0.06972371*nf0.w + -0.015583117*ng0.w + 0.0060410476*nh0.w + 0.002779453*ni0.w; + u = -0.15266632*na1.x + 0.1406486*nb1.x + -0.023325102*nc1.x + 0.33111537*nd1.x + -0.26280713*ne1.x + -0.30597302*nf1.x + 0.03293922*ng1.x + -0.06366053*nh1.x + -0.2563068*ni1.x; + v = 0.10465601*na1.y + 0.19904912*nb1.y + 0.35142493*nc1.y + 0.0524759*nd1.y + 0.26105863*ne1.y + 0.18162589*nf1.y + -0.13980812*ng1.y + 0.08652187*nh1.y + 0.08691816*ni1.y; + w = -0.020547593*na1.z + 0.03622464*nb1.z + 0.1620944*nc1.z + -0.031112235*nd1.z + -0.3012553*ne1.z + 0.104967594*nf1.z + -0.04882421*ng1.z + 0.08929665*nh1.z + -0.12291634*ni1.z; + x = -0.014448424*na1.w + 0.01894318*nb1.w + 0.07474613*nc1.w + -0.086192556*nd1.w + 0.053702205*ne1.w + 0.015262595*nf1.w + 0.0712923*ng1.w + -0.11414189*nh1.w + -0.11893973*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.022504877; + i = 0.06429385*a0.x + -0.091512606*b0.x + -0.024693118*c0.x + -0.22510907*d0.x + -0.30308828*e0.x + -0.048171345*f0.x + -0.051559918*g0.x + -0.06886774*h0.x + -0.012772176*i0.x; + j = -0.073987395*a0.y + -0.3457657*b0.y + -0.0025134888*c0.y + -0.04905519*d0.y + -0.3512132*e0.y + 0.123302355*f0.y + -0.19281262*g0.y + 0.0027089259*h0.y + -0.034404445*i0.y; + k = -0.10127784*a0.z + -0.13300103*b0.z + -0.02991685*c0.z + -0.1664028*d0.z + -0.05791024*e0.z + -0.066117615*f0.z + -0.065625034*g0.z + 0.19767064*h0.z + -0.14864634*i0.z; + l = -0.050169848*a0.w + 0.28215423*b0.w + 0.15401876*c0.w + -0.08515883*d0.w + 0.21773921*e0.w + -0.010577921*f0.w + 0.14295639*g0.w + 0.023680558*h0.w + 0.07321661*i0.w; + m = -0.0017102464*a1.x + -0.08169556*b1.x + -0.0077006533*c1.x + 0.072557054*d1.x + -0.11251691*e1.x + 0.08526943*f1.x + -0.00020871482*g1.x + -0.044559553*h1.x + -0.08441698*i1.x; + n = 0.11166287*a1.y + 0.13018124*b1.y + 0.12614363*c1.y + 0.17918706*d1.y + 0.138985*e1.y + -0.07021701*f1.y + -0.038741305*g1.y + 0.09958653*h1.y + 0.001882147*i1.y; + o = 0.06696661*a1.z + 0.0031226731*b1.z + 0.018931026*c1.z + -0.2124317*d1.z + -0.039044634*e1.z + 0.09647277*f1.z + -0.023537027*g1.z + 0.1913286*h1.z + 0.06601882*i1.z; + p = 0.11267788*a1.w + 0.07517228*b1.w + -0.011346144*c1.w + -0.23570742*d1.w + -0.29205522*e1.w + 0.054553967*f1.w + 0.03259228*g1.w + -0.019599134*h1.w + 0.033477396*i1.w; + q = -0.20862566*na0.x + 0.013916686*nb0.x + 0.094481535*nc0.x + -0.16677813*nd0.x + 0.331288*ne0.x + -0.00072936434*nf0.x + -0.029819883*ng0.x + -0.08621884*nh0.x + 0.0015680068*ni0.x; + r = 0.09338383*na0.y + 0.19255875*nb0.y + -0.05818667*nc0.y + 0.11013603*nd0.y + 0.31287682*ne0.y + -0.119134955*nf0.y + 0.19530609*ng0.y + -0.019883394*nh0.y + 0.057758797*ni0.y; + s = 0.036111437*na0.z + 0.11467648*nb0.z + 0.14144741*nc0.z + 0.0014821922*nd0.z + 0.15492304*ne0.z + 0.07086891*nf0.z + 0.08650872*ng0.z + -0.09055274*nh0.z + 0.06259116*ni0.z; + t = 0.13245824*na0.w + -0.33671287*nb0.w + -0.06967657*nc0.w + 0.21634886*nd0.w + -0.17046133*ne0.w + 0.24341889*nf0.w + -0.013452368*ng0.w + -0.027392244*nh0.w + 0.01873684*ni0.w; + u = 0.060082868*na1.x + 0.2109921*nb1.x + 0.030791614*nc1.x + -0.1392062*nd1.x + -0.088582*ne1.x + -0.023536798*nf1.x + -0.046534453*ng1.x + 0.008117058*nh1.x + 0.12310186*ni1.x; + v = 0.011159707*na1.y + -0.24601986*nb1.y + -0.06805425*nc1.y + 0.21778165*nd1.y + -0.20652544*ne1.y + 0.26376507*nf1.y + -0.030255495*ng1.y + -0.08734944*nh1.y + -0.0077105393*ni1.y; + w = -0.062475488*na1.z + 0.072401844*nb1.z + -0.019962879*nc1.z + 0.16892117*nd1.z + 0.025962003*ne1.z + -0.110477984*nf1.z + 0.07653261*ng1.z + -0.2317498*nh1.z + -0.13628756*ni1.z; + x = -0.0056055044*na1.w + -0.12222951*nb1.w + -0.05291652*nc1.w + 0.02045731*nd1.w + -0.25283408*ne1.w + -0.038071007*nf1.w + -0.09783437*ng1.w + -0.054983437*nh1.w + -0.0651251*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.04249854; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN70 +//!BIND LUMAN71 +//!SAVE LUMAN81 + +#define L0_tex LUMAN70_tex +#define L1_tex LUMAN71_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.0066694217*a0.x + 0.11847723*b0.x + 0.027041575*c0.x + -0.096739955*d0.x + -0.2433321*e0.x + 0.32472065*f0.x + 0.17193161*g0.x + 0.25872856*h0.x + 0.16033795*i0.x; + float j = 0.046591174*a0.y + 0.124460176*b0.y + -0.008698186*c0.y + 0.124230005*d0.y + -0.28624266*e0.y + 0.16834712*f0.y + -0.11461091*g0.y + 0.030672451*h0.y + -0.02390204*i0.y; + float k = -0.1980102*a0.z + 0.14983565*b0.z + 0.13953343*c0.z + 0.040665563*d0.z + 0.4056147*e0.z + 0.12841807*f0.z + -0.039405465*g0.z + -0.016812282*h0.z + -0.018724015*i0.z; + float l = -0.063325174*a0.w + -0.14346766*b0.w + 0.023345768*c0.w + 0.006257241*d0.w + 0.39503187*e0.w + 0.027097229*f0.w + 0.052904844*g0.w + -0.07785531*h0.w + -0.126849*i0.w; + float m = 0.06949972*a1.x + -0.17687106*b1.x + -0.034545206*c1.x + 0.06276032*d1.x + -0.28677166*e1.x + 0.25227562*f1.x + -0.0658834*g1.x + 0.0790822*h1.x + 0.18264319*i1.x; + float n = 0.20627318*a1.y + -0.04966547*b1.y + -0.14028211*c1.y + 0.06429192*d1.y + -0.41474065*e1.y + 0.009008643*f1.y + -0.004014575*g1.y + -0.08488616*h1.y + -0.027536016*i1.y; + float o = -0.033429027*a1.z + -0.061252594*b1.z + -0.09639897*c1.z + -0.0541709*d1.z + -0.080302484*e1.z + 0.021496745*f1.z + 0.13290937*g1.z + -0.2129115*h1.z + -0.08675345*i1.z; + float p = -0.05321618*a1.w + 0.16918896*b1.w + 0.017845973*c1.w + -0.0268489*d1.w + 0.35835636*e1.w + -0.019922512*f1.w + 0.010317201*g1.w + -0.08562699*h1.w + -0.15053023*i1.w; + float q = 0.029751813*na0.x + -0.07666209*nb0.x + -0.051187597*nc0.x + 0.1488955*nd0.x + 0.14131892*ne0.x + -0.0017594409*nf0.x + -0.06904229*ng0.x + -0.18003106*nh0.x + -0.2109423*ni0.x; + float r = -0.10874734*na0.y + -0.07052802*nb0.y + 0.028145788*nc0.y + -0.11203796*nd0.y + -0.18286729*ne0.y + -0.044190012*nf0.y + 0.14456281*ng0.y + 0.22468443*nh0.y + 0.06806424*ni0.y; + float s = 0.0056482283*na0.z + 0.05038214*nb0.z + -0.054723658*nc0.z + 0.17140733*nd0.z + -0.20605274*ne0.z + 0.008235773*nf0.z + 0.00076351484*ng0.z + -0.014465802*nh0.z + -0.0011295063*ni0.z; + float t = 0.03727619*na0.w + 0.009911164*nb0.w + -0.06400696*nc0.w + -0.118588045*nd0.w + -0.3762935*ne0.w + -0.049205016*nf0.w + -0.011016333*ng0.w + 0.045067854*nh0.w + 0.062944*ni0.w; + float u = 0.0128412265*na1.x + 0.08549091*nb1.x + -0.11035337*nc1.x + -0.19317722*nd1.x + 0.32658654*ne1.x + -0.13700837*nf1.x + 0.16626875*ng1.x + 0.057037096*nh1.x + -0.20406239*ni1.x; + float v = -0.0826136*na1.y + 0.09659021*nb1.y + -0.033466462*nc1.y + -0.35497645*nd1.y + 0.19551568*ne1.y + -0.08828759*nf1.y + -0.03977853*ng1.y + 0.031591333*nh1.y + 0.045049287*ni1.y; + float w = -0.009541883*na1.z + 0.0649394*nb1.z + -0.005798986*nc1.z + -0.010381588*nd1.z + 0.008219264*ne1.z + 0.16208616*nf1.z + -0.06818159*ng1.z + 0.100467354*nh1.z + 0.060734566*ni1.z; + float x = 0.1266532*na1.w + 0.061005235*nb1.w + 0.0046074055*nc1.w + 0.09715183*nd1.w + -0.3036943*ne1.w + 0.07832144*nf1.w + -0.003973035*ng1.w + 0.08835643*nh1.w + 0.04062082*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.02271852; + i = 0.18110195*a0.x + -0.17357115*b0.x + 0.026732111*c0.x + 0.012301222*d0.x + -0.455591*e0.x + -0.26068583*f0.x + -0.08844089*g0.x + -0.0048143766*h0.x + -0.03246129*i0.x; + j = -0.09655088*a0.y + 0.095917135*b0.y + 0.032161884*c0.y + 0.06800457*d0.y + 0.20549932*e0.y + -0.028239787*f0.y + 0.023079311*g0.y + -0.05668374*h0.y + -0.06884348*i0.y; + k = 0.15276624*a0.z + -0.054857254*b0.z + -0.018425446*c0.z + -0.005746271*d0.z + 0.002684244*e0.z + 0.07194655*f0.z + 0.047085393*g0.z + -0.068998106*h0.z + 0.11390368*i0.z; + l = -0.108120814*a0.w + -0.19515012*b0.w + -0.13582878*c0.w + 0.07356536*d0.w + 0.18283905*e0.w + -0.039374176*f0.w + 0.02256634*g0.w + 0.05627407*h0.w + 0.044026434*i0.w; + m = -0.10994438*a1.x + 0.05130847*b1.x + -0.1455887*c1.x + 0.08437886*d1.x + 0.15179005*e1.x + -0.14680521*f1.x + 0.06338043*g1.x + 0.086142145*h1.x + 0.0077787247*i1.x; + n = -0.29151785*a1.y + 0.03852581*b1.y + -0.041870143*c1.y + -0.08994941*d1.y + -0.41039798*e1.y + -0.048835553*f1.y + -0.05302519*g1.y + -0.020273345*h1.y + -0.0685774*i1.y; + o = 0.040446658*a1.z + 0.05880254*b1.z + 0.1353693*c1.z + -0.005083114*d1.z + -0.40046036*e1.z + 0.09095645*f1.z + 0.033785086*g1.z + 0.045549124*h1.z + -0.018644862*i1.z; + p = -0.062142696*a1.w + -0.15257972*b1.w + 0.28831935*c1.w + 0.27487394*d1.w + 0.82982075*e1.w + 0.4084299*f1.w + 0.21701102*g1.w + 0.12382357*h1.w + -0.06802407*i1.w; + q = -0.0730035*na0.x + 0.12232848*nb0.x + -0.12472037*nc0.x + 0.12043143*nd0.x + 0.37559772*ne0.x + 0.017626943*nf0.x + -0.0844148*ng0.x + 0.062597916*nh0.x + 0.10833959*ni0.x; + r = 0.18921937*na0.y + 0.0033235173*nb0.y + -0.062161192*nc0.y + -0.25184554*nd0.y + -0.14324915*ne0.y + 0.03589457*nf0.y + 0.051313072*ng0.y + 0.05705345*nh0.y + -0.14872095*ni0.y; + s = -0.025778696*na0.z + 0.42599228*nb0.z + 0.1270628*nc0.z + 0.30984098*nd0.z + 0.2527526*ne0.z + 0.01553217*nf0.z + -0.012882554*ng0.z + -0.109922536*nh0.z + 0.04123468*ni0.z; + t = -0.017181087*na0.w + -0.10710051*nb0.w + 0.009613792*nc0.w + -0.043247163*nd0.w + -0.16020131*ne0.w + -0.010467985*nf0.w + -0.03849282*ng0.w + -0.049011692*nh0.w + -0.011761578*ni0.w; + u = 0.09972438*na1.x + -0.2580635*nb1.x + -0.017552543*nc1.x + 0.018904842*nd1.x + 0.39619398*ne1.x + 0.21503401*nf1.x + -0.07482423*ng1.x + -0.26168364*nh1.x + -0.009754018*ni1.x; + v = -0.038097814*na1.y + -0.4189689*nb1.y + 0.059011087*nc1.y + 0.15903711*nd1.y + 0.19178723*ne1.y + -0.051329754*nf1.y + -0.09679991*ng1.y + 0.06918306*nh1.y + 0.06901496*ni1.y; + w = -0.06428947*na1.z + -0.09784677*nb1.z + -0.057076678*nc1.z + -0.12429604*nd1.z + 0.5481482*ne1.z + -0.02944002*nf1.z + -0.021831183*ng1.z + -0.18884462*nh1.z + 0.09481327*ni1.z; + x = -0.14835794*na1.w + -0.0015569549*nb1.w + -0.020120803*nc1.w + -0.0118614435*nd1.w + 0.10279072*ne1.w + 0.019891072*nf1.w + 0.024419032*ng1.w + -0.07522632*nh1.w + 0.0125360815*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.016688297; + i = 0.022757962*a0.x + 0.02831483*b0.x + -0.024892079*c0.x + -0.043009497*d0.x + -0.36408705*e0.x + 0.022713907*f0.x + -0.0811036*g0.x + 0.08509479*h0.x + -0.0022488856*i0.x; + j = 0.022810793*a0.y + 0.0048847296*b0.y + -0.028201994*c0.y + 0.03456093*d0.y + 0.059152238*e0.y + -0.01956595*f0.y + 0.14083938*g0.y + 0.022517703*h0.y + -0.03256878*i0.y; + k = 0.08028264*a0.z + -0.043960344*b0.z + -0.05163768*c0.z + -0.053347483*d0.z + 0.1713494*e0.z + -0.08546151*f0.z + 0.12917145*g0.z + -0.11523469*h0.z + 0.04434896*i0.z; + l = 0.0070776334*a0.w + 0.01771322*b0.w + 0.031519383*c0.w + 0.06731833*d0.w + 0.5843218*e0.w + 0.0075026383*f0.w + -0.007780201*g0.w + -0.09049023*h0.w + 0.0283541*i0.w; + m = -0.051404253*a1.x + 0.06477344*b1.x + 0.011257389*c1.x + -0.018775849*d1.x + -0.15087715*e1.x + -0.051606953*f1.x + -0.05180129*g1.x + -0.07518411*h1.x + -0.05315761*i1.x; + n = 0.03283867*a1.y + 0.2618311*b1.y + 0.18127936*c1.y + 0.09457198*d1.y + 0.022065504*e1.y + 0.17226379*f1.y + 0.039727535*g1.y + 0.053066168*h1.y + 0.0070788665*i1.y; + o = 0.0069599035*a1.z + 0.115369335*b1.z + 0.02263262*c1.z + 0.020387944*d1.z + -0.19383186*e1.z + -0.028164485*f1.z + 0.019880418*g1.z + 0.24371304*h1.z + -0.0074491054*i1.z; + p = -0.03378131*a1.w + 0.05114272*b1.w + 0.03528374*c1.w + 0.11546386*d1.w + 0.1651586*e1.w + 0.01913313*f1.w + -0.060500108*g1.w + -0.13903178*h1.w + 0.16105473*i1.w; + q = -0.014397411*na0.x + -0.037639458*nb0.x + -0.06076013*nc0.x + 0.096218646*nd0.x + 0.20562719*ne0.x + -0.12546235*nf0.x + 0.013834853*ng0.x + -0.00888692*nh0.x + 0.0678355*ni0.x; + r = 0.026385974*na0.y + 0.028375747*nb0.y + -0.0004898619*nc0.y + -0.087545976*nd0.y + -0.003575773*ne0.y + 0.013268005*nf0.y + -0.14466694*ng0.y + -0.25483954*nh0.y + -0.007429993*ni0.y; + s = 0.021479474*na0.z + 0.13291408*nb0.z + -0.062883794*nc0.z + 0.04626535*nd0.z + -0.33509022*ne0.z + -0.0073142285*nf0.z + -0.09122149*ng0.z + 0.15395486*nh0.z + 0.011943047*ni0.z; + t = -0.052496914*na0.w + 0.08686347*nb0.w + -0.053467993*nc0.w + -0.038849387*nd0.w + -0.4468472*ne0.w + -0.05134658*nf0.w + -0.01964563*ng0.w + 0.0945286*nh0.w + -0.07229256*ni0.w; + u = -0.19383687*na1.x + -0.12413539*nb1.x + 0.12611891*nc1.x + -0.05177286*nd1.x + -0.15787035*ne1.x + -0.22586027*nf1.x + -0.02653507*ng1.x + -0.09208067*nh1.x + 0.0790026*ni1.x; + v = 0.045514755*na1.y + -0.20552722*nb1.y + -0.06940295*nc1.y + -0.12299648*nd1.y + 0.22533223*ne1.y + 0.020092113*nf1.y + 0.022371564*ng1.y + -0.10912476*nh1.y + -0.010708719*ni1.y; + w = 0.038367108*na1.z + -0.09583574*nb1.z + 0.034882225*nc1.z + 0.04124136*nd1.z + 0.08524068*ne1.z + -0.09192149*nf1.z + -0.010648737*ng1.z + -0.06619061*nh1.z + 0.0106395045*ni1.z; + x = -0.015929854*na1.w + 0.012495014*nb1.w + 0.025708143*nc1.w + -0.023310695*nd1.w + 0.0024336246*ne1.w + -0.10202505*nf1.w + 0.01887081*ng1.w + 0.040374048*nh1.w + -0.058974277*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.014066884; + i = 0.079134114*a0.x + 0.30642658*b0.x + 0.037026163*c0.x + -0.1397397*d0.x + -0.18622641*e0.x + -0.25758827*f0.x + 0.16240206*g0.x + 0.09670797*h0.x + 0.014849251*i0.x; + j = 0.01725062*a0.y + -0.17767917*b0.y + -0.18663113*c0.y + 0.26138157*d0.y + 0.19073991*e0.y + -0.10480241*f0.y + 0.12942258*g0.y + 0.12483446*h0.y + 0.0077056396*i0.y; + k = -0.12391253*a0.z + -0.26585296*b0.z + -0.26151463*c0.z + 0.032111064*d0.z + -0.03331119*e0.z + -0.17423038*f0.z + 0.08324542*g0.z + -0.16682643*h0.z + 0.060358673*i0.z; + l = -0.008409101*a0.w + 0.14207964*b0.w + 0.099567175*c0.w + -0.20250678*d0.w + 0.41887495*e0.w + 0.0065913643*f0.w + -0.09693957*g0.w + -0.013416045*h0.w + -0.06445816*i0.w; + m = 0.0032202955*a1.x + -0.17340574*b1.x + 0.03461825*c1.x + -0.09251894*d1.x + -0.29680246*e1.x + -0.07626895*f1.x + -0.041007422*g1.x + -0.21885623*h1.x + 0.0700853*i1.x; + n = 0.24577692*a1.y + 0.4333059*b1.y + 0.29536775*c1.y + 0.4680353*d1.y + 0.11400569*e1.y + 0.45554742*f1.y + 0.13454184*g1.y + 0.15872881*h1.y + 0.07784182*i1.y; + o = 0.009872529*a1.z + 0.124596514*b1.z + 0.018574009*c1.z + -0.072379544*d1.z + -0.04941264*e1.z + -0.00915017*f1.z + 0.027756197*g1.z + 0.33998618*h1.z + 0.116189346*i1.z; + p = 0.1058891*a1.w + 0.05857415*b1.w + -0.039698068*c1.w + -0.19868894*d1.w + -0.069923036*e1.w + 0.02231115*f1.w + -0.13126382*g1.w + -0.029347654*h1.w + 0.39165783*i1.w; + q = -0.025738433*na0.x + -0.28366303*nb0.x + -0.25851208*nc0.x + 0.24409194*nd0.x + -0.08504448*ne0.x + -0.024518859*nf0.x + -0.049040448*ng0.x + -0.17092372*nh0.x + 0.14129514*ni0.x; + r = 0.03214811*na0.y + 0.1917868*nb0.y + 0.018803194*nc0.y + -0.20698068*nd0.y + -0.069450565*ne0.y + 0.20778154*nf0.y + 0.0216441*ng0.y + -0.2653748*nh0.y + 0.024219675*ni0.y; + s = -0.053946424*na0.z + 0.096878186*nb0.z + -0.00033841882*nc0.z + -0.3057939*nd0.z + -0.05195126*ne0.z + -0.08680512*nf0.z + -0.14885134*ng0.z + 0.28472355*nh0.z + -0.08745689*ni0.z; + t = -0.07490327*na0.w + -0.08654825*nb0.w + -0.17518339*nc0.w + 0.026284566*nd0.w + -0.30165738*ne0.w + -0.039188627*nf0.w + 0.022762645*ng0.w + 0.06316042*nh0.w + 0.02202224*ni0.w; + u = 0.036116045*na1.x + 0.26480165*nb1.x + 0.10783618*nc1.x + -0.089616984*nd1.x + 0.0107042035*ne1.x + -0.06687872*nf1.x + 0.12741867*ng1.x + 0.003457752*nh1.x + -0.15184306*ni1.x; + v = 0.1127287*na1.y + -0.041010577*nb1.y + -0.27225387*nc1.y + -0.41610608*nd1.y + -0.122540645*ne1.y + -0.120056964*nf1.y + 0.055733103*ng1.y + -0.16395383*nh1.y + 0.04145389*ni1.y; + w = -0.04001325*na1.z + -0.06777769*nb1.z + 0.015195856*nc1.z + 0.033097956*nd1.z + 0.057564102*ne1.z + -0.099886894*nf1.z + -0.112823404*ng1.z + -0.23096414*nh1.z + 0.05393515*ni1.z; + x = 0.0071186554*na1.w + -0.090610534*nb1.w + 0.027379468*nc1.w + 0.095270984*nd1.w + -0.29638094*ne1.w + -0.14165857*nf1.w + 0.015547657*ng1.w + -0.04642255*nh1.w + -0.088592134*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0047451044; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN80 +//!BIND LUMAN81 +//!SAVE LUMAN90 + +#define L0_tex LUMAN80_tex +#define L1_tex LUMAN81_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.01673993*a0.x + -0.037069164*b0.x + -0.021666236*c0.x + -0.054466546*d0.x + 0.11536388*e0.x + -0.11321502*f0.x + 0.022819944*g0.x + 0.17252871*h0.x + -0.057995472*i0.x; + float j = -0.007967937*a0.y + -0.17712031*b0.y + 0.016880952*c0.y + -0.083251245*d0.y + -0.15771297*e0.y + -0.13910829*f0.y + 0.030402234*g0.y + -0.115201585*h0.y + -0.07342557*i0.y; + float k = 0.085715905*a0.z + 0.07485739*b0.z + 0.054513015*c0.z + -0.05891022*d0.z + 0.19971131*e0.z + -0.022042107*f0.z + -0.06854997*g0.z + -0.010311588*h0.z + 0.057499334*i0.z; + float l = 0.020319302*a0.w + 0.120197445*b0.w + 0.03553909*c0.w + 0.017385498*d0.w + 0.29975125*e0.w + -0.049928416*f0.w + 0.033703424*g0.w + 0.03045727*h0.w + 0.10002958*i0.w; + float m = 0.084152445*a1.x + 0.08455505*b1.x + 0.02041311*c1.x + 0.102138616*d1.x + 0.40321913*e1.x + 0.28508592*f1.x + 0.106993325*g1.x + 0.05451918*h1.x + 0.09983337*i1.x; + float n = 0.070165634*a1.y + -0.0591608*b1.y + 0.037770163*c1.y + -0.07990405*d1.y + 0.3184371*e1.y + -0.05943587*f1.y + -0.07691292*g1.y + 0.04498132*h1.y + 0.06921544*i1.y; + float o = -0.1045011*a1.z + 0.07288938*b1.z + 0.055906463*c1.z + 0.021307817*d1.z + 0.44578484*e1.z + 0.2429832*f1.z + 0.06300683*g1.z + 0.29262158*h1.z + -0.09437396*i1.z; + float p = 0.05430943*a1.w + 0.0139438715*b1.w + -0.050196573*c1.w + -0.09235537*d1.w + 0.13077335*e1.w + 0.017000332*f1.w + -0.13289788*g1.w + 0.034622394*h1.w + 0.0610517*i1.w; + float q = 0.03385471*na0.x + 0.033639524*nb0.x + 0.05674448*nc0.x + 0.07767901*nd0.x + 0.02196186*ne0.x + 0.25706187*nf0.x + -0.0076677273*ng0.x + -0.09732604*nh0.x + 0.14318047*ni0.x; + float r = 0.015254236*na0.y + 0.06871284*nb0.y + 0.051175963*nc0.y + 0.022096684*nd0.y + 0.15930523*ne0.y + 0.079166576*nf0.y + -0.042781763*ng0.y + 0.09532545*nh0.y + 0.13425186*ni0.y; + float s = -0.071213774*na0.z + -0.053588025*nb0.z + -0.0053879456*nc0.z + -0.07423497*nd0.z + -0.35910574*ne0.z + -0.058686115*nf0.z + -0.0402255*ng0.z + -0.013840895*nh0.z + -0.11806706*ni0.z; + float t = -0.015750997*na0.w + -0.00010075004*nb0.w + -0.034971394*nc0.w + 0.043374218*nd0.w + -0.34966478*ne0.w + 0.144251*nf0.w + 0.03849565*ng0.w + -0.036949884*nh0.w + -0.049831018*ni0.w; + float u = -0.032960076*na1.x + -0.029984819*nb1.x + 0.0038729531*nc1.x + 0.04013631*nd1.x + -0.41830102*ne1.x + -0.062018484*nf1.x + -0.04079244*ng1.x + 0.011654456*nh1.x + -0.022535775*ni1.x; + float v = -0.08759464*na1.y + -0.00021272714*nb1.y + -0.11620911*nc1.y + 0.03606701*nd1.y + -0.40236366*ne1.y + -0.045454267*nf1.y + 0.05412641*ng1.y + -0.13487701*nh1.y + -0.07317703*ni1.y; + float w = 0.1449464*na1.z + -0.02041889*nb1.z + -0.010942047*nc1.z + -0.008885966*nd1.z + -0.34565923*ne1.z + -0.16011216*nf1.z + -0.08167504*ng1.z + -0.046127446*nh1.z + 0.039120726*ni1.z; + float x = -0.01631185*na1.w + 0.0676745*nb1.w + -0.020729579*nc1.w + 0.10552644*nd1.w + -0.16281195*ne1.w + 0.009668374*nf1.w + 0.079011016*ng1.w + -0.00016317324*nh1.w + -0.0427317*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.027371084; + i = 0.21151558*a0.x + -0.18965739*b0.x + 0.041234616*c0.x + -0.20431332*d0.x + -0.192977*e0.x + -0.3690884*f0.x + -0.028841114*g0.x + -0.025547253*h0.x + -0.2393515*i0.x; + j = -0.16114618*a0.y + 0.02555935*b0.y + -0.055616144*c0.y + -0.22684114*d0.y + 0.13186994*e0.y + 0.12789656*f0.y + -0.20806582*g0.y + -0.09056336*h0.y + 0.118119605*i0.y; + k = 0.056821354*a0.z + -0.076682806*b0.z + 0.038370475*c0.z + -0.07335088*d0.z + -0.3635085*e0.z + -0.03416517*f0.z + 0.04906234*g0.z + 0.11570622*h0.z + -0.08483406*i0.z; + l = 0.1062231*a0.w + 0.14855738*b0.w + 0.112187356*c0.w + 0.23658897*d0.w + -0.1633562*e0.w + -0.057498056*f0.w + 0.09591738*g0.w + 0.13960145*h0.w + -0.013841925*i0.w; + m = 0.011678073*a1.x + -0.23525913*b1.x + 0.0675899*c1.x + -0.18475027*d1.x + -0.2588696*e1.x + 0.0573932*f1.x + 0.07389367*g1.x + -0.35012266*h1.x + -0.027212784*i1.x; + n = 0.14043884*a1.y + -0.16013291*b1.y + 0.007676279*c1.y + 0.3247241*d1.y + -0.057386484*e1.y + 0.05311225*f1.y + 0.116353445*g1.y + -0.07527317*h1.y + -0.026991287*i1.y; + o = 0.07864914*a1.z + 0.18995948*b1.z + 0.08229445*c1.z + 0.16711219*d1.z + 0.027085537*e1.z + 0.074351706*f1.z + 0.024535442*g1.z + -0.018759357*h1.z + -0.0057313796*i1.z; + p = -0.09812256*a1.w + -0.27372065*b1.w + -0.09263667*c1.w + 0.13855068*d1.w + -0.111439824*e1.w + -0.03597043*f1.w + -0.14000732*g1.w + -0.10901257*h1.w + -0.07922191*i1.w; + q = 0.040044893*na0.x + 0.19487256*nb0.x + -0.13011783*nc0.x + 0.24166034*nd0.x + -0.17673162*ne0.x + -0.025188932*nf0.x + -0.0058249906*ng0.x + 0.16676581*nh0.x + 0.17515136*ni0.x; + r = -0.20160529*na0.y + 0.14567824*nb0.y + 0.016001804*nc0.y + 0.1217445*nd0.y + -0.25463247*ne0.y + -0.100964166*nf0.y + 0.118399285*ng0.y + 0.13229755*nh0.y + -0.069706514*ni0.y; + s = 0.09526997*na0.z + 0.14274715*nb0.z + -0.041326083*nc0.z + 0.10334673*nd0.z + 0.46550584*ne0.z + -0.012944695*nf0.z + -0.16464376*ng0.z + 0.056298282*nh0.z + 0.06888725*ni0.z; + t = -0.107257456*na0.w + -0.11098056*nb0.w + -0.08392639*nc0.w + 0.19929354*nd0.w + 0.028095637*ne0.w + 0.00913141*nf0.w + -0.076629944*ng0.w + -0.13897711*nh0.w + 0.02622423*ni0.w; + u = -0.0925085*na1.x + 0.06457904*nb1.x + -0.0049878457*nc1.x + 0.11465199*nd1.x + 0.22704247*ne1.x + -0.043633565*nf1.x + -0.10444418*ng1.x + 0.29974872*nh1.x + 0.06018791*ni1.x; + v = -0.08709729*na1.y + 0.07285598*nb1.y + -0.01770537*nc1.y + -0.29214376*nd1.y + 0.22107948*ne1.y + 0.019745916*nf1.y + -0.14918393*ng1.y + -0.11788365*nh1.y + 0.12358068*ni1.y; + w = -0.06538392*na1.z + -0.18160456*nb1.z + -0.04809002*nc1.z + -0.18138257*nd1.z + -0.027151896*ne1.z + -0.10860557*nf1.z + 0.020112576*ng1.z + -0.14805503*nh1.z + -0.10933812*ni1.z; + x = 0.1827798*na1.w + 0.12197832*nb1.w + -0.009565886*nc1.w + -0.27849162*nd1.w + 0.22912863*ne1.w + 0.0802533*nf1.w + -0.10039779*ng1.w + 0.11130157*nh1.w + 0.09659571*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.052480474; + i = 0.045794196*a0.x + 0.13822739*b0.x + 0.028153861*c0.x + 0.01838999*d0.x + -0.26929635*e0.x + -0.32540554*f0.x + -0.007450455*g0.x + -0.18232581*h0.x + 0.18821949*i0.x; + j = -0.039932244*a0.y + -0.12997177*b0.y + -0.13555567*c0.y + -0.09634756*d0.y + -0.16149253*e0.y + -0.20098837*f0.y + 0.012647376*g0.y + -0.1371011*h0.y + 0.06029709*i0.y; + k = 0.019579187*a0.z + 0.10097545*b0.z + 0.05210322*c0.z + 0.10484725*d0.z + 0.026984831*e0.z + -0.052300893*f0.z + 0.0020612779*g0.z + -0.0465344*h0.z + -0.026893035*i0.z; + l = 0.06849055*a0.w + -0.083517805*b0.w + -0.13908811*c0.w + -0.020601919*d0.w + 0.33350495*e0.w + 0.21439402*f0.w + -0.01956267*g0.w + 0.012073342*h0.w + -0.0054884916*i0.w; + m = 0.03604873*a1.x + 0.21375208*b1.x + 0.036831096*c1.x + 0.0046485276*d1.x + 0.20850915*e1.x + 0.11940648*f1.x + 0.06595058*g1.x + 0.12713948*h1.x + -0.05690868*i1.x; + n = -0.026217025*a1.y + 0.08774772*b1.y + 0.07639648*c1.y + 0.06645757*d1.y + 0.1777672*e1.y + -0.010187055*f1.y + 0.016854076*g1.y + 0.06763791*h1.y + -0.0028121404*i1.y; + o = 0.053403556*a1.z + 0.03793781*b1.z + 0.040200714*c1.z + -0.045618698*d1.z + 0.40721974*e1.z + 0.16023849*f1.z + 0.064655244*g1.z + 0.091353275*h1.z + 0.039854866*i1.z; + p = 0.026788633*a1.w + 0.06319608*b1.w + 0.151287*c1.w + -0.007950356*d1.w + -0.20728241*e1.w + 0.0028189872*f1.w + 0.117827214*g1.w + 0.15493579*h1.w + 0.041015457*i1.w; + q = -0.039269663*na0.x + 0.050309796*nb0.x + 0.087594524*nc0.x + -0.07746412*nd0.x + 0.19615553*ne0.x + 0.14228563*nf0.x + 0.021518724*ng0.x + 0.2964698*nh0.x + 0.0070668804*ni0.x; + r = 0.0679682*na0.y + 0.044831708*nb0.y + 0.103279434*nc0.y + 0.21164313*nd0.y + 0.079107836*ne0.y + 0.19867145*nf0.y + 0.0008177772*ng0.y + 0.15454973*nh0.y + 0.02802561*ni0.y; + s = 0.04692509*na0.z + -0.053589255*nb0.z + -0.0033790166*nc0.z + -0.093176946*nd0.z + -0.05238289*ne0.z + 0.10088563*nf0.z + -0.04555708*ng0.z + 0.06308933*nh0.z + 0.018524157*ni0.z; + t = -0.057916578*na0.w + 0.061617002*nb0.w + 0.14458352*nc0.w + -0.054579273*nd0.w + -0.53670573*ne0.w + -0.228154*nf0.w + 0.02780815*ng0.w + 0.00490978*nh0.w + -0.020166898*ni0.w; + u = -0.056519195*na1.x + -0.22715457*nb1.x + -0.02716323*nc1.x + -0.013233275*nd1.x + -0.24903058*ne1.x + -0.06436639*nf1.x + -0.0015489759*ng1.x + -0.14657818*nh1.x + -0.081550956*ni1.x; + v = 0.033547156*na1.y + 0.038033575*nb1.y + 0.015526869*nc1.y + -0.021106038*nd1.y + -0.18488556*ne1.y + 0.12066344*nf1.y + 0.030849671*ng1.y + -0.13188018*nh1.y + -0.038346265*ni1.y; + w = 0.008629792*na1.z + 0.04979525*nb1.z + 0.07539893*nc1.z + 0.18835813*nd1.z + -0.43886295*ne1.z + -0.11143093*nf1.z + 0.012449111*ng1.z + 0.108359024*nh1.z + -0.0559463*ni1.z; + x = 0.009246566*na1.w + 0.11861902*nb1.w + -0.032966357*nc1.w + -0.03323096*nd1.w + 0.05179375*ne1.w + -0.022796564*nf1.w + -0.014877862*ng1.w + -0.03710343*nh1.w + -0.042962812*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.059826102; + i = 0.031115327*a0.x + 0.188035*b0.x + -0.0015120074*c0.x + -0.131305*d0.x + -0.07819419*e0.x + 0.11171441*f0.x + -0.25416902*g0.x + -0.23302929*h0.x + 0.13815945*i0.x; + j = 0.0237918*a0.y + -0.00224626*b0.y + -0.0049168402*c0.y + 0.0073136603*d0.y + -0.24698296*e0.y + 0.00880072*f0.y + -0.0756857*g0.y + 0.12252117*h0.y + -0.025413495*i0.y; + k = -0.1162883*a0.z + 0.07945833*b0.z + 0.06966924*c0.z + 0.007765573*d0.z + -0.118527874*e0.z + 0.049568437*f0.z + -0.06863759*g0.z + 0.06234623*h0.z + 0.064663865*i0.z; + l = -0.02149897*a0.w + -0.29959664*b0.w + -0.18817009*c0.w + -0.1439664*d0.w + 0.104499996*e0.w + -0.020972226*f0.w + -0.059752535*g0.w + -0.18361354*h0.w + 0.01439171*i0.w; + m = 0.100922875*a1.x + 0.12474121*b1.x + -0.14212026*c1.x + -0.09471235*d1.x + -0.13905098*e1.x + -0.31022635*f1.x + -0.3038933*g1.x + 0.01049297*h1.x + -0.025776217*i1.x; + n = -0.107000016*a1.y + 0.08123589*b1.y + 0.06011893*c1.y + 0.09692082*d1.y + -0.18460457*e1.y + 0.062181763*f1.y + -0.005365826*g1.y + 0.21681735*h1.y + 0.0449017*i1.y; + o = 0.16393377*a1.z + -0.056784745*b1.z + -0.13678862*c1.z + 0.055320717*d1.z + -0.08491486*e1.z + 0.06182906*f1.z + -0.051199604*g1.z + -0.26727825*h1.z + -0.12346331*i1.z; + p = 0.025211822*a1.w + -0.22271319*b1.w + -0.12196882*c1.w + 0.011243396*d1.w + -0.1590806*e1.w + 0.041453175*f1.w + 0.049322482*g1.w + 0.06001341*h1.w + 0.10338395*i1.w; + q = 0.062355123*na0.x + -0.14010982*nb0.x + -0.013285964*nc0.x + 0.17744683*nd0.x + 0.33579433*ne0.x + 0.20541832*nf0.x + 0.23999332*ng0.x + 0.35488084*nh0.x + 0.054412443*ni0.x; + r = -0.14752464*na0.y + 0.016193591*nb0.y + -0.036918044*nc0.y + -0.13732186*nd0.y + 0.026388014*ne0.y + -0.022620546*nf0.y + 0.04923403*ng0.y + -0.027308352*nh0.y + 0.03592577*ni0.y; + s = 0.031187518*na0.z + 0.044220183*nb0.z + 0.0065388796*nc0.z + 0.09006831*nd0.z + 0.06268174*ne0.z + 0.070364945*nf0.z + 0.10115674*ng0.z + 0.12275451*nh0.z + -0.092501625*ni0.z; + t = 0.100292124*na0.w + 0.12261562*nb0.w + 0.13493334*nc0.w + -0.031619906*nd0.w + -0.2335329*ne0.w + -0.058594678*nf0.w + 0.08104001*ng0.w + 0.1943844*nh0.w + 0.049995773*ni0.w; + u = -0.117773786*na1.x + -0.21409196*nb1.x + 0.10084039*nc1.x + -0.056045495*nd1.x + -0.16103372*ne1.x + 0.07381369*nf1.x + 0.10142957*ng1.x + -0.1807354*nh1.x + -0.0010455581*ni1.x; + v = 0.12607928*na1.y + 0.08553089*nb1.y + 0.031399067*nc1.y + -0.075404786*nd1.y + 0.4368805*ne1.y + 0.09070479*nf1.y + 0.113353856*ng1.y + 0.0416148*nh1.y + -0.058077883*ni1.y; + w = -0.14058512*na1.z + 0.011479399*nb1.z + -0.0010025998*nc1.z + -0.052256066*nd1.z + 0.121283926*ne1.z + 0.086709*nf1.z + -0.15059915*ng1.z + 0.24566013*nh1.z + 0.11308803*ni1.z; + x = 0.02165811*na1.w + 0.06249563*nb1.w + 0.10453432*nc1.w + 0.026702216*nd1.w + 0.30528623*ne1.w + -0.11512455*nf1.w + 0.005231443*ng1.w + -0.050155234*nh1.w + -0.12619454*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0350281; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN80 +//!BIND LUMAN81 +//!SAVE LUMAN91 + +#define L0_tex LUMAN80_tex +#define L1_tex LUMAN81_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.06470165*a0.x + -0.08358711*b0.x + 0.013491288*c0.x + 0.011742262*d0.x + -0.00771037*e0.x + -0.11896797*f0.x + 0.06461668*g0.x + 0.061307684*h0.x + 0.07116608*i0.x; + float j = -0.03955721*a0.y + 0.28637338*b0.y + -0.082954586*c0.y + -0.2748898*d0.y + -0.22996616*e0.y + -0.14736032*f0.y + 0.11470954*g0.y + 0.11117193*h0.y + -0.10298252*i0.y; + float k = -0.057315275*a0.z + 0.12893961*b0.z + 0.0063475855*c0.z + 0.08474854*d0.z + 0.09001076*e0.z + 0.08567542*f0.z + -0.056418125*g0.z + 0.05012468*h0.z + -0.045200672*i0.z; + float l = 0.01666514*a0.w + -0.06555822*b0.w + 0.02927531*c0.w + 0.054559793*d0.w + 0.06740099*e0.w + 0.03187214*f0.w + -0.071890905*g0.w + -0.013122654*h0.w + 0.05740963*i0.w; + float m = -0.11991389*a1.x + -0.11246538*b1.x + 0.033758763*c1.x + 0.014906028*d1.x + -0.0044450792*e1.x + 0.038439434*f1.x + -0.048276383*g1.x + 0.014512463*h1.x + -0.017534567*i1.x; + float n = -0.033943206*a1.y + 0.045253187*b1.y + -0.009190007*c1.y + 0.025217501*d1.y + 0.13089441*e1.y + 0.058218688*f1.y + -0.029480472*g1.y + 0.016915878*h1.y + -0.0751522*i1.y; + float o = 0.13308804*a1.z + -0.19329911*b1.z + 0.07438569*c1.z + -0.16606416*d1.z + 0.020418571*e1.z + -0.18963277*f1.z + -0.0749325*g1.z + -0.07508134*h1.z + -0.011499833*i1.z; + float p = -0.11286829*a1.w + -0.11931518*b1.w + 0.016420303*c1.w + -0.057171043*d1.w + 0.0062648696*e1.w + 0.115521714*f1.w + -0.006577926*g1.w + -0.07811505*h1.w + -0.05461923*i1.w; + float q = 0.10067804*na0.x + 0.07973617*nb0.x + 0.027652912*nc0.x + -0.07360306*nd0.x + -0.13135643*ne0.x + -0.0074246284*nf0.x + -0.00038905264*ng0.x + -0.17269708*nh0.x + -0.10112847*ni0.x; + float r = -0.09158818*na0.y + -0.03690496*nb0.y + 0.045822922*nc0.y + 0.07835432*nd0.y + 0.10308012*ne0.y + 0.066562936*nf0.y + -0.12854502*ng0.y + 0.067591466*nh0.y + 0.09179545*ni0.y; + float s = 0.101400144*na0.z + -0.083806686*nb0.z + -0.085281074*nc0.z + -0.21147355*nd0.z + 0.18145746*ne0.z + -0.13636465*nf0.z + 0.026483217*ng0.z + -0.004932833*nh0.z + 0.028615177*ni0.z; + float t = -0.05400892*na0.w + 0.019047134*nb0.w + -0.02612906*nc0.w + -0.009508591*nd0.w + -0.07480499*ne0.w + 0.006003379*nf0.w + 0.049930554*ng0.w + -4.4581393e-05*nh0.w + -0.083937*ni0.w; + float u = 0.14270985*na1.x + -0.03368466*nb1.x + -0.0005758635*nc1.x + 0.0043432894*nd1.x + -0.038472593*ne1.x + 0.010285344*nf1.x + -0.008681097*ng1.x + -0.067345016*nh1.x + 0.05746432*ni1.x; + float v = -0.0005384013*na1.y + -0.13938713*nb1.y + 0.003350033*nc1.y + -0.069848955*nd1.y + -0.17162758*ne1.y + -0.15474541*nf1.y + 0.016965603*ng1.y + -0.0441896*nh1.y + 0.059310254*ni1.y; + float w = -0.107777886*na1.z + 0.4298284*nb1.z + -0.055417135*nc1.z + 0.13713273*nd1.z + 0.2949338*ne1.z + 0.23024732*nf1.z + -0.03803199*ng1.z + 0.12479006*nh1.z + 0.111074045*ni1.z; + float x = 0.13028695*na1.w + 0.041605808*nb1.w + -0.000780396*nc1.w + 0.06629394*nd1.w + -0.030616602*ne1.w + -0.12750441*nf1.w + -0.04776373*ng1.w + -0.11282136*nh1.w + 0.015392388*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0048413826; + i = -0.1829601*a0.x + 0.13851579*b0.x + 0.05251664*c0.x + -0.029195292*d0.x + 0.10835054*e0.x + 0.11980737*f0.x + -0.020615224*g0.x + 0.23010024*h0.x + 0.15591237*i0.x; + j = 0.06646273*a0.y + 0.08660124*b0.y + -0.12217587*c0.y + -0.2832269*d0.y + -0.073232226*e0.y + -0.09045713*f0.y + 0.0903346*g0.y + 0.051303506*h0.y + -0.13163151*i0.y; + k = 0.089250736*a0.z + 0.17210086*b0.z + -0.17334868*c0.z + 0.0636137*d0.z + 0.18805827*e0.z + -0.17250285*f0.z + -0.044774864*g0.z + -0.02882258*h0.z + 0.06518661*i0.z; + l = -0.1539726*a0.w + 0.27703896*b0.w + 0.15240592*c0.w + 0.14633532*d0.w + 0.10149569*e0.w + 0.15621641*f0.w + 0.052911468*g0.w + 0.14841467*h0.w + 0.10176992*i0.w; + m = -0.002441106*a1.x + -0.16499574*b1.x + 0.12205949*c1.x + 0.048980992*d1.x + 0.15491192*e1.x + -0.05774106*f1.x + -0.26510295*g1.x + 0.049354106*h1.x + 0.1075961*i1.x; + n = 0.09788552*a1.y + 0.15087374*b1.y + -0.1643212*c1.y + -0.12409809*d1.y + -0.12229354*e1.y + -0.16194592*f1.y + -0.08719358*g1.y + -0.031453002*h1.y + 0.13846967*i1.y; + o = -0.2732155*a1.z + -0.20257822*b1.z + 0.08830974*c1.z + -0.17554928*d1.z + 0.44935164*e1.z + 0.1659096*f1.z + -0.2140584*g1.z + 0.08412646*h1.z + 0.11356992*i1.z; + p = -0.004162997*a1.w + 0.34235054*b1.w + 0.22631416*c1.w + -0.013886235*d1.w + -0.017690673*e1.w + -0.15543605*f1.w + 0.075665236*g1.w + -0.13077445*h1.w + 0.039470974*i1.w; + q = 0.08467723*na0.x + -0.17728072*nb0.x + 0.11084081*nc0.x + 0.002506899*nd0.x + 0.0554393*ne0.x + -0.20072418*nf0.x + -0.11415738*ng0.x + -0.31256598*nh0.x + -0.13746846*ni0.x; + r = 0.16444927*na0.y + -0.14218701*nb0.y + 0.10822578*nc0.y + 0.24295563*nd0.y + 0.35401732*ne0.y + 0.32688105*nf0.y + 0.0372747*ng0.y + -0.14621079*nh0.y + 0.078144416*ni0.y; + s = -0.15721494*na0.z + -0.2906935*nb0.z + 0.13447869*nc0.z + -0.052099284*nd0.z + 0.028965846*ne0.z + 0.20206948*nf0.z + -0.046471443*ng0.z + -0.13676575*nh0.z + -0.04567316*ni0.z; + t = 0.056960203*na0.w + -0.31676304*nb0.w + -0.031032804*nc0.w + -0.31833902*nd0.w + 0.07669968*ne0.w + -0.15262993*nf0.w + 0.038909554*ng0.w + -0.11278675*nh0.w + 0.009159681*ni0.w; + u = 0.07172047*na1.x + 0.09011544*nb1.x + -0.11960295*nc1.x + -0.12533994*nd1.x + -0.07057406*ne1.x + -0.061811112*nf1.x + 0.15623203*ng1.x + -0.06906789*nh1.x + -0.13188761*ni1.x; + v = -0.15868309*na1.y + -0.062547915*nb1.y + 0.32852596*nc1.y + 0.15347436*nd1.y + 0.40474093*ne1.y + 0.25103953*nf1.y + 0.15425627*ng1.y + 0.13292617*nh1.y + -0.18120067*ni1.y; + w = 0.34258303*na1.z + 0.030543402*nb1.z + -0.07673708*nc1.z + 0.37881675*nd1.z + -0.063546225*ne1.z + -0.21133995*nf1.z + 0.07185787*ng1.z + -0.24808413*nh1.z + -0.0833815*ni1.z; + x = -0.022112627*na1.w + -0.3086634*nb1.w + -0.032956105*nc1.w + 0.03767927*nd1.w + 0.14323393*ne1.w + 0.2049924*nf1.w + -0.04453286*ng1.w + 0.13178921*nh1.w + 0.03475982*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.020809302; + i = 0.029212562*a0.x + 0.04520052*b0.x + 0.19492471*c0.x + 0.08813598*d0.x + -0.19385792*e0.x + 0.22746195*f0.x + -0.05792946*g0.x + 0.098720476*h0.x + -0.078137845*i0.x; + j = 0.11748217*a0.y + -0.15551092*b0.y + -0.041184764*c0.y + -0.11294156*d0.y + -0.48724166*e0.y + 0.06820542*f0.y + 0.10558965*g0.y + 0.2602658*h0.y + -0.046648268*i0.y; + k = 0.055756707*a0.z + 0.023304457*b0.z + -0.017790463*c0.z + 0.06274627*d0.z + 0.19655561*e0.z + 0.14073813*f0.z + -0.050541375*g0.z + -0.09031988*h0.z + 0.048210446*i0.z; + l = 0.09856984*a0.w + 0.2757346*b0.w + 0.12035966*c0.w + -0.07751128*d0.w + 0.08767396*e0.w + -0.098144054*f0.w + -0.11670308*g0.w + -0.10254689*h0.w + -0.07100567*i0.w; + m = -0.07163324*a1.x + 0.029479492*b1.x + -0.107981086*c1.x + 0.0785065*d1.x + 0.47879705*e1.x + -0.5006183*f1.x + -0.113591515*g1.x + -0.28396955*h1.x + -0.09156115*i1.x; + n = 0.010061719*a1.y + -0.06959705*b1.y + -0.023433782*c1.y + -0.061150227*d1.y + -0.20881256*e1.y + 0.06986817*f1.y + -0.024993578*g1.y + -0.23687747*h1.y + 0.048823558*i1.y; + o = -0.12649736*a1.z + 0.16880566*b1.z + 0.056255385*c1.z + -0.13327794*d1.z + 0.5323194*e1.z + 0.13708395*f1.z + -0.17057353*g1.z + -0.5180934*h1.z + 0.2036042*i1.z; + p = 0.025205363*a1.w + 0.0148605555*b1.w + -0.07160804*c1.w + -0.11104438*d1.w + -0.28952584*e1.w + -0.20536195*f1.w + -0.055619787*g1.w + -0.20000336*h1.w + -0.13830769*i1.w; + q = -0.10966534*na0.x + -0.16984549*nb0.x + -0.12228675*nc0.x + -0.17389281*nd0.x + -0.03828372*ne0.x + -0.37848768*nf0.x + 0.14367533*ng0.x + 0.078726806*nh0.x + -0.05469816*ni0.x; + r = 0.005045079*na0.y + 0.060812112*nb0.y + 0.12286593*nc0.y + 0.025669502*nd0.y + 0.41187903*ne0.y + 0.15332839*nf0.y + -0.12220754*ng0.y + -0.34907588*nh0.y + -0.15346427*ni0.y; + s = -0.10867897*na0.z + -0.06867772*nb0.z + 0.04260707*nc0.z + 0.012931835*nd0.z + -0.2426067*ne0.z + 0.06771253*nf0.z + 0.08149514*ng0.z + -0.09523016*nh0.z + 0.089101076*ni0.z; + t = -0.08355936*na0.w + -0.2323209*nb0.w + -0.10957743*nc0.w + -0.098291025*nd0.w + 0.00647761*ne0.w + 0.05178958*nf0.w + 0.049700283*ng0.w + 0.17216198*nh0.w + 0.15758623*ni0.w; + u = -0.062969774*na1.x + -0.23237999*nb1.x + 0.025046721*nc1.x + -0.21818307*nd1.x + -0.44225112*ne1.x + 0.15906236*nf1.x + 0.060607016*ng1.x + 0.03830812*nh1.x + -0.01450312*ni1.x; + v = -0.042574733*na1.y + 0.1477671*nb1.y + 0.1738519*nc1.y + 0.10186733*nd1.y + 0.4633304*ne1.y + 0.04933609*nf1.y + 0.0599997*ng1.y + 0.32341382*nh1.y + -0.02965749*ni1.y; + w = 0.05251006*na1.z + -0.24486646*nb1.z + -0.19625907*nc1.z + 0.11287113*nd1.z + -0.2547342*ne1.z + -0.091655985*nf1.z + -0.08782904*ng1.z + -0.24473846*nh1.z + -0.17752169*ni1.z; + x = -0.025825348*na1.w + 0.030143617*nb1.w + 0.03985646*nc1.w + 0.058778826*nd1.w + 0.6242806*ne1.w + 0.08659011*nf1.w + 0.011712522*ng1.w + 0.030967578*nh1.w + 0.19279975*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.031122295; + i = -0.056274638*a0.x + 0.0994429*b0.x + 0.100331664*c0.x + 0.13507071*d0.x + -0.44366753*e0.x + 0.35566956*f0.x + -0.0155030945*g0.x + -0.111121856*h0.x + -0.08261402*i0.x; + j = 0.1621978*a0.y + -0.13188677*b0.y + 0.09493277*c0.y + -0.22416183*d0.y + -0.19327287*e0.y + -0.017433945*f0.y + 0.055452533*g0.y + 0.019975124*h0.y + -0.022349617*i0.y; + k = -0.04813199*a0.z + -0.044552036*b0.z + 0.009757977*c0.z + 0.15600084*d0.z + 0.06667113*e0.z + 0.07466154*f0.z + 0.02013024*g0.z + -0.05830345*h0.z + 0.0066436944*i0.z; + l = 0.022262586*a0.w + 0.2051477*b0.w + 0.02359226*c0.w + -0.016940195*d0.w + -0.103408664*e0.w + -0.0143246995*f0.w + -0.04390832*g0.w + -0.19666824*h0.w + -0.037004247*i0.w; + m = -0.12699056*a1.x + 0.007297183*b1.x + -0.116264924*c1.x + -0.07206143*d1.x + -0.177836*e1.x + -0.22506171*f1.x + -0.08196095*g1.x + -0.32255578*h1.x + -0.059720334*i1.x; + n = -0.024888419*a1.y + -0.074888624*b1.y + 0.0148301255*c1.y + 0.080827035*d1.y + -0.12504773*e1.y + -0.006246837*f1.y + 0.0814444*g1.y + -0.1826526*h1.y + 0.038656585*i1.y; + o = -0.078399174*a1.z + 0.11893796*b1.z + -0.05013238*c1.z + -0.27203092*d1.z + 0.039230514*e1.z + 0.20820205*f1.z + -0.1379687*g1.z + 0.07932462*h1.z + 0.0252875*i1.z; + p = 0.087690495*a1.w + -0.06339423*b1.w + -0.1162743*c1.w + -0.050107308*d1.w + -0.46825767*e1.w + -0.16134012*f1.w + 0.16483293*g1.w + -0.027519228*h1.w + -0.021023685*i1.w; + q = -0.038559947*na0.x + -0.15457825*nb0.x + -0.058549345*nc0.x + -0.18923534*nd0.x + -0.041225646*ne0.x + -0.4356616*nf0.x + -0.024729528*ng0.x + 0.36071044*nh0.x + 0.21629138*ni0.x; + r = -0.06251338*na0.y + -0.16642195*nb0.y + 0.06348546*nc0.y + 0.08825678*nd0.y + 0.22040902*ne0.y + 0.045454938*nf0.y + -0.13521202*ng0.y + 0.061059624*nh0.y + 0.04230984*ni0.y; + s = 0.12856871*na0.z + 0.033738554*nb0.z + 0.081973396*nc0.z + -0.11980315*nd0.z + -0.17240024*ne0.z + 0.035350345*nf0.z + -0.03828312*ng0.z + 0.08390367*nh0.z + -0.0007110002*ni0.z; + t = -0.04138246*na0.w + -0.14146684*nb0.w + -0.07614185*nc0.w + -0.32412106*nd0.w + 0.14123203*ne0.w + 0.093974575*nf0.w + 0.039202336*ng0.w + 0.21533422*nh0.w + 0.10451938*ni0.w; + u = 0.11685781*na1.x + -0.111199625*nb1.x + 0.031322613*nc1.x + -0.10094856*nd1.x + 0.061218377*ne1.x + 0.21430455*nf1.x + 0.04603686*ng1.x + 0.13180679*nh1.x + -0.006573115*ni1.x; + v = -0.042008765*na1.y + 0.05046256*nb1.y + 0.054701287*nc1.y + -0.024479102*nd1.y + 0.23996788*ne1.y + 0.026132362*nf1.y + 0.044675305*ng1.y + 0.24155937*nh1.y + 0.007674547*ni1.y; + w = 0.06194381*na1.z + -0.12647893*nb1.z + -0.06262424*nc1.z + 0.2765175*nd1.z + -0.13114145*ne1.z + -0.18654919*nf1.z + 0.13385575*ng1.z + -0.070887975*nh1.z + 0.03256101*ni1.z; + x = -0.11918977*na1.w + 0.108421154*nb1.w + -0.04607389*nc1.w + 0.048322722*nd1.w + 0.56062996*ne1.w + 0.14422773*nf1.w + -0.06938887*ng1.w + -0.004306145*nh1.w + 0.0469783*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.021502014; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN90 +//!BIND LUMAN91 +//!SAVE LUMAN100 + +#define L0_tex LUMAN90_tex +#define L1_tex LUMAN91_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.07265925*a0.x + 0.023700966*b0.x + -0.15656962*c0.x + 0.07880878*d0.x + 0.19290538*e0.x + -0.05890005*f0.x + -0.07099894*g0.x + -0.22249503*h0.x + -0.064054154*i0.x; + float j = -0.015663067*a0.y + -0.103533*b0.y + -0.08357721*c0.y + -0.09838063*d0.y + -0.009890742*e0.y + -0.20688708*f0.y + -0.012291536*g0.y + 0.103740424*h0.y + -0.18892547*i0.y; + float k = -0.039948575*a0.z + -0.08890566*b0.z + 0.08356973*c0.z + -0.07202497*d0.z + 0.3098249*e0.z + 0.03797432*f0.z + 0.061603986*g0.z + -0.028556094*h0.z + -0.03887841*i0.z; + float l = 0.061304227*a0.w + 0.0834474*b0.w + 0.0052142297*c0.w + 0.076062456*d0.w + -0.2550855*e0.w + -0.22246034*f0.w + -0.1461618*g0.w + -0.031381596*h0.w + -0.023259843*i0.w; + float m = 0.10203523*a1.x + -0.10106587*b1.x + -0.09936241*c1.x + 0.0121586565*d1.x + -0.21350412*e1.x + 0.03773418*f1.x + -0.08036912*g1.x + 0.00054510345*h1.x + 0.082109995*i1.x; + float n = -0.030281091*a1.y + -0.019464297*b1.y + -0.03343086*c1.y + -0.041807972*d1.y + -0.29519844*e1.y + 0.0011670708*f1.y + -0.005358335*g1.y + 0.13223964*h1.y + -0.026167693*i1.y; + float o = 0.06085577*a1.z + -0.092274785*b1.z + 0.032507356*c1.z + 0.053823147*d1.z + 0.42793903*e1.z + 0.114983246*f1.z + -0.04069393*g1.z + -0.0006949501*h1.z + 0.02710441*i1.z; + float p = 0.07505709*a1.w + 0.075499974*b1.w + -0.03323268*c1.w + 0.02439534*d1.w + 0.1352862*e1.w + -0.057262182*f1.w + 0.03444901*g1.w + -0.10126648*h1.w + 0.07005253*i1.w; + float q = -0.056289457*na0.x + -0.088067494*nb0.x + 0.009072137*nc0.x + -0.16945772*nd0.x + 0.65056986*ne0.x + -0.09137104*nf0.x + -0.0958041*ng0.x + -0.0035324264*nh0.x + 0.22158822*ni0.x; + float r = -0.023618907*na0.y + 0.040410213*nb0.y + 0.04133351*nc0.y + 0.0027878582*nd0.y + 0.13161965*ne0.y + 0.04786032*nf0.y + -0.032071363*ng0.y + 0.013592457*nh0.y + 0.04103818*ni0.y; + float s = -0.083262034*na0.z + 0.038279414*nb0.z + -0.10495058*nc0.z + -0.0018889415*nd0.z + 0.4518251*ne0.z + -0.16235441*nf0.z + 0.025422582*ng0.z + -0.10999959*nh0.z + -0.0810986*ni0.z; + float t = -0.017079756*na0.w + -0.07210158*nb0.w + 0.11943926*nc0.w + -0.04239276*nd0.w + 0.2123338*ne0.w + 0.19151181*nf0.w + 0.03208812*ng0.w + 0.08681117*nh0.w + -0.041525204*ni0.w; + float u = -0.11309481*na1.x + 0.012464375*nb1.x + 0.090306304*nc1.x + 0.047231033*nd1.x + 0.38329974*ne1.x + -0.19688864*nf1.x + 0.121593945*ng1.x + -0.19659187*nh1.x + -0.17173418*ni1.x; + float v = -0.054151945*na1.y + 0.14287822*nb1.y + -0.026752962*nc1.y + 0.08045844*nd1.y + -0.44710386*ne1.y + 0.10896626*nf1.y + -0.12193901*ng1.y + -0.009104244*nh1.y + -0.08056834*ni1.y; + float w = -0.04259294*na1.z + 0.013424774*nb1.z + -0.02073511*nc1.z + -0.0671494*nd1.z + -0.742374*ne1.z + -0.013341901*nf1.z + 0.02841971*ng1.z + 0.028205762*nh1.z + -0.015515695*ni1.z; + float x = -0.1253503*na1.w + -0.037713774*nb1.w + -0.047447044*nc1.w + 0.056887742*nd1.w + -0.25439355*ne1.w + 0.017710002*nf1.w + -0.060918324*ng1.w + 0.06975122*nh1.w + 0.018493392*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.060576435; + i = -0.10078301*a0.x + -0.22060892*b0.x + -0.1408605*c0.x + 0.054186974*d0.x + 0.48175207*e0.x + 0.15784572*f0.x + -0.11044774*g0.x + 0.015674137*h0.x + -0.10430155*i0.x; + j = -0.00055243395*a0.y + 0.07688996*b0.y + -0.02225426*c0.y + 0.02965376*d0.y + 0.1604641*e0.y + 0.036843646*f0.y + -0.03089809*g0.y + -0.028821243*h0.y + 0.07116369*i0.y; + k = 0.04849076*a0.z + -0.051908575*b0.z + 0.11398473*c0.z + -0.11207367*d0.z + 0.17258276*e0.z + 0.072021425*f0.z + 0.08204*g0.z + 0.05697239*h0.z + 0.05384689*i0.z; + l = 0.06526782*a0.w + -0.16998854*b0.w + -0.20337874*c0.w + -0.06894729*d0.w + -0.060269777*e0.w + 0.059943512*f0.w + -0.06256188*g0.w + -0.19321574*h0.w + 0.12563857*i0.w; + m = 0.09504388*a1.x + 0.23444028*b1.x + 0.054108813*c1.x + -0.1511119*d1.x + -0.33046558*e1.x + -0.11355755*f1.x + 0.06791499*g1.x + -0.09154602*h1.x + 0.08613581*i1.x; + n = -0.005308559*a1.y + -0.06617806*b1.y + -0.08029687*c1.y + -0.18528762*d1.y + 0.29541174*e1.y + -0.050635237*f1.y + -0.13667068*g1.y + 0.058555737*h1.y + 0.049990308*i1.y; + o = 0.057100374*a1.z + -0.0053014755*b1.z + -0.036915854*c1.z + 0.048231576*d1.z + -0.08578811*e1.z + 0.0061042877*f1.z + 0.12712461*g1.z + -0.049631786*h1.z + -0.03644509*i1.z; + p = -0.07754365*a1.w + 0.08114286*b1.w + 0.13754186*c1.w + 0.046926335*d1.w + -0.00015599096*e1.w + -0.06885081*f1.w + 0.002506939*g1.w + -0.0041841757*h1.w + -0.03963556*i1.w; + q = 0.06525129*na0.x + 0.29605383*nb0.x + 0.17160998*nc0.x + -0.10999347*nd0.x + -0.4261982*ne0.x + 0.008851736*nf0.x + 0.17348845*ng0.x + -0.11618347*nh0.x + -0.0013678032*ni0.x; + r = 0.004887045*na0.y + 0.09394849*nb0.y + -0.022832435*nc0.y + 0.0618829*nd0.y + -0.1206567*ne0.y + -0.047747064*nf0.y + -0.018334484*ng0.y + -0.15676217*nh0.y + -0.037948433*ni0.y; + s = -0.05387299*na0.z + -0.07547661*nb0.z + -0.02826463*nc0.z + 0.19316924*nd0.z + -0.21108967*ne0.z + -0.07424726*nf0.z + -0.048655987*ng0.z + 0.011288455*nh0.z + 0.07454638*ni0.z; + t = -0.02382715*na0.w + 0.04737313*nb0.w + 0.16604757*nc0.w + -0.1252276*nd0.w + -0.11555547*ne0.w + -0.117093794*nf0.w + 0.22003125*ng0.w + 0.050628174*nh0.w + -0.16738409*ni0.w; + u = 0.14754699*na1.x + 0.17303196*nb1.x + 0.04876307*nc1.x + 0.17099535*nd1.x + 0.28009477*ne1.x + 0.09900106*nf1.x + -0.1232106*ng1.x + 0.120199144*nh1.x + -0.018348478*ni1.x; + v = 0.06373986*na1.y + -0.16076994*nb1.y + 0.04006142*nc1.y + 0.039994188*nd1.y + 0.21252097*ne1.y + 0.009857251*nf1.y + 0.16954108*ng1.y + -0.18738723*nh1.y + -0.06068558*ni1.y; + w = -0.023124985*na1.z + -0.13765894*nb1.z + 0.00794977*nc1.z + -0.043664034*nd1.z + 0.30050248*ne1.z + -0.0797709*nf1.z + -0.09831398*ng1.z + 0.0090835*nh1.z + 0.050792087*ni1.z; + x = 0.16089995*na1.w + 0.18940108*nb1.w + -0.062164474*nc1.w + -0.009729548*nd1.w + 0.3687626*ne1.w + 0.11795869*nf1.w + 0.111944266*ng1.w + 0.030715724*nh1.w + -0.06897518*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0110156555; + i = -0.09201335*a0.x + 0.35571313*b0.x + 0.03867107*c0.x + -0.52388316*d0.x + 0.26164815*e0.x + -0.003940324*f0.x + -0.034470525*g0.x + -0.38801426*h0.x + 0.007453677*i0.x; + j = -0.025017906*a0.y + 0.11159069*b0.y + -0.083097436*c0.y + -0.087925516*d0.y + 0.41674057*e0.y + -0.09842924*f0.y + 0.016759802*g0.y + -0.043557372*h0.y + -0.09356397*i0.y; + k = -0.07435264*a0.z + -0.027982665*b0.z + -0.2546462*c0.z + -0.15379149*d0.z + 0.0483275*e0.z + 0.33086976*f0.z + 0.17203465*g0.z + -0.011223424*h0.z + 0.059527423*i0.z; + l = -0.084952295*a0.w + 0.13025886*b0.w + -0.04452213*c0.w + -0.03323946*d0.w + -0.44131833*e0.w + -0.098421805*f0.w + -0.14595895*g0.w + 0.0012506093*h0.w + 0.01602149*i0.w; + m = -0.0002257706*a1.x + 0.049014594*b1.x + -0.06539944*c1.x + -0.06921464*d1.x + -0.08951907*e1.x + 0.00308963*f1.x + 0.24626851*g1.x + 0.024575666*h1.x + -0.17135943*i1.x; + n = 0.04957859*a1.y + -0.005085414*b1.y + 0.17520362*c1.y + -0.25757977*d1.y + 0.29797918*e1.y + -0.36955053*f1.y + -0.05837521*g1.y + -0.009809658*h1.y + 0.08120866*i1.y; + o = 0.038373098*a1.z + 0.43602607*b1.z + -0.33427376*c1.z + 0.11876386*d1.z + -0.015821876*e1.z + 0.23957412*f1.z + 0.21176071*g1.z + -0.04274422*h1.z + -0.0017289559*i1.z; + p = -0.06806067*a1.w + -0.2152604*b1.w + 0.2839844*c1.w + -0.15799695*d1.w + 0.08067578*e1.w + -0.18562378*f1.w + -0.15009342*g1.w + 0.037688468*h1.w + -0.013841675*i1.w; + q = 0.05784655*na0.x + -0.50880325*nb0.x + 0.00044681615*nc0.x + 0.23096287*nd0.x + 0.18685505*ne0.x + 0.033283934*nf0.x + 0.082515314*ng0.x + 0.34203875*nh0.x + 0.03886475*ni0.x; + r = 0.065260865*na0.y + -0.01993688*nb0.y + -0.05383619*nc0.y + 0.008454464*nd0.y + -0.28584716*ne0.y + 0.279069*nf0.y + 0.011580153*ng0.y + 0.005640261*nh0.y + 0.016977433*ni0.y; + s = 0.09752995*na0.z + -0.08544229*nb0.z + 0.20613973*nc0.z + 0.119378366*nd0.z + 0.2668687*ne0.z + -0.3592499*nf0.z + -0.13275231*ng0.z + -0.09630954*nh0.z + -0.07383545*ni0.z; + t = -0.16881555*na0.w + -0.2374875*nb0.w + -0.15595317*nc0.w + 0.04898601*nd0.w + 0.6815287*ne0.w + -0.031822093*nf0.w + 0.07903932*ng0.w + -0.20907608*nh0.w + 0.16599762*ni0.w; + u = 0.005852266*na1.x + -0.2368208*nb1.x + -0.23890223*nc1.x + 0.13112201*nd1.x + 0.26844802*ne1.x + 0.29751682*nf1.x + -0.08209781*ng1.x + 0.42122295*nh1.x + 0.20626803*ni1.x; + v = -0.04461377*na1.y + 0.123583965*nb1.y + 0.25949335*nc1.y + 0.3643682*nd1.y + -0.31355467*ne1.y + 0.1577375*nf1.y + 0.17515017*ng1.y + 0.1719694*nh1.y + 0.050687797*ni1.y; + w = 0.033197664*na1.z + -0.110326655*nb1.z + 0.16151339*nc1.z + -0.29232344*nd1.z + -0.043201648*ne1.z + -0.25910446*nf1.z + -0.17897853*ng1.z + 0.04508204*nh1.z + 0.024959387*ni1.z; + x = -0.004740871*na1.w + 0.58068645*nb1.w + -0.13135849*nc1.w + 0.08470749*nd1.w + 0.5434785*ne1.w + -0.09824885*nf1.w + 0.175141*ng1.w + -0.031553842*nh1.w + 0.12030425*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.023395553; + i = 0.2182098*a0.x + -0.17617948*b0.x + -0.016086245*c0.x + 0.01979135*d0.x + -0.038408197*e0.x + -0.052498348*f0.x + 0.06095527*g0.x + 0.13581404*h0.x + -0.073346384*i0.x; + j = 0.049381066*a0.y + 0.027663233*b0.y + -0.08703131*c0.y + 0.079707064*d0.y + 0.019048419*e0.y + -0.11821768*f0.y + -0.03539825*g0.y + -0.00968409*h0.y + 0.14233379*i0.y; + k = 0.042935178*a0.z + 0.32729605*b0.z + 0.014347606*c0.z + 0.118802175*d0.z + 0.038908485*e0.z + 0.047662012*f0.z + -0.23271957*g0.z + 0.1071721*h0.z + -5.6695158e-06*i0.z; + l = 0.044800732*a0.w + 0.07532898*b0.w + 0.10070666*c0.w + -0.067275*d0.w + 0.34835663*e0.w + -0.00016411445*f0.w + 0.22446546*g0.w + -0.040508043*h0.w + 0.074288964*i0.w; + m = -0.14405896*a1.x + -0.07136379*b1.x + -0.08497759*c1.x + -0.099492*d1.x + -0.44610918*e1.x + 0.016733484*f1.x + -0.019361196*g1.x + -0.122206904*h1.x + -0.033448443*i1.x; + n = -0.037161253*a1.y + -0.104310274*b1.y + -0.101612695*c1.y + -0.08269007*d1.y + -0.196907*e1.y + 0.04373784*f1.y + -0.076424465*g1.y + -0.23708011*h1.y + -0.015432182*i1.y; + o = -0.07932446*a1.z + -0.25158814*b1.z + 0.1456538*c1.z + -0.056997314*d1.z + -0.16408537*e1.z + -0.092957675*f1.z + -0.05784946*g1.z + 0.17916061*h1.z + -0.03714659*i1.z; + p = 0.056439318*a1.w + 0.30886337*b1.w + -0.10099246*c1.w + 0.00921742*d1.w + 0.0060571055*e1.w + -0.0045387703*f1.w + 0.056307647*g1.w + -0.10007432*h1.w + 0.10579334*i1.w; + q = -0.12815917*na0.x + 0.25816068*nb0.x + 0.005832022*nc0.x + 0.021733731*nd0.x + -0.002896373*ne0.x + -0.021967378*nf0.x + -0.08993149*ng0.x + 0.01349081*nh0.x + 0.14037557*ni0.x; + r = -0.10641641*na0.y + -0.14336166*nb0.y + 0.13905756*nc0.y + -0.006768771*nd0.y + -0.20818397*ne0.y + -0.072607264*nf0.y + 0.0653376*ng0.y + -0.0009878871*nh0.y + -0.23695026*ni0.y; + s = -0.011296526*na0.z + -0.1702861*nb0.z + -0.13592866*nc0.z + 0.08330013*nd0.z + -0.14053744*ne0.z + 0.04229139*nf0.z + 0.18999486*ng0.z + -0.06729747*nh0.z + -0.012406001*ni0.z; + t = -0.053658824*na0.w + -0.011490368*nb0.w + -0.02576516*nc0.w + 0.025684359*nd0.w + -0.27654237*ne0.w + 0.2556309*nf0.w + -0.11121926*ng0.w + 0.021481138*nh0.w + 0.020300712*ni0.w; + u = 0.056904268*na1.x + 0.1031669*nb1.x + 0.092109516*nc1.x + 0.1674974*nd1.x + 0.1272128*ne1.x + 0.051365383*nf1.x + 0.09436225*ng1.x + -0.1498395*nh1.x + 0.027604343*ni1.x; + v = 0.14711578*na1.y + -0.04096398*nb1.y + 0.06807073*nc1.y + 0.07105637*nd1.y + 0.14142494*ne1.y + -0.039062362*nf1.y + 0.04731659*ng1.y + 0.16940498*nh1.y + 0.10303104*ni1.y; + w = -0.0059321444*na1.z + 0.18455246*nb1.z + -0.10695806*nc1.z + 0.23861645*nd1.z + 0.04773088*ne1.z + 0.14045008*nf1.z + 4.7836074e-05*ng1.z + -0.16641098*nh1.z + 0.04553746*ni1.z; + x = -0.11129073*na1.w + -0.43785414*nb1.w + 0.14205389*nc1.w + -0.07631603*nd1.w + -0.28033093*ne1.w + -0.061731882*nf1.w + -0.17013927*ng1.w + -0.018501334*nh1.w + -0.08734041*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0043154894; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN90 +//!BIND LUMAN91 +//!SAVE LUMAN101 + +#define L0_tex LUMAN90_tex +#define L1_tex LUMAN91_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.04086044*a0.x + 0.30147836*b0.x + -0.17311159*c0.x + 0.18290026*d0.x + 0.29126215*e0.x + 0.083450966*f0.x + 0.03202223*g0.x + -0.17335223*h0.x + 0.0129949255*i0.x; + float j = -0.07097973*a0.y + 0.18275109*b0.y + -0.04680662*c0.y + 0.059881072*d0.y + -0.15083359*e0.y + 0.0364367*f0.y + 0.08146268*g0.y + 0.009621425*h0.y + 0.07292491*i0.y; + float k = -0.1243348*a0.z + -0.08893849*b0.z + -0.04332789*c0.z + -0.31888697*d0.z + 0.103336014*e0.z + 0.26384127*f0.z + 0.023423515*g0.z + 0.016750999*h0.z + 0.10389888*i0.z; + float l = -0.09181854*a0.w + 0.27054423*b0.w + -0.03821117*c0.w + 0.05981993*d0.w + -0.3537547*e0.w + 0.089075744*f0.w + 0.16270332*g0.w + 0.025306432*h0.w + 0.064135864*i0.w; + float m = -0.003473569*a1.x + 0.22022933*b1.x + -0.10967152*c1.x + 0.09498084*d1.x + -0.108349755*e1.x + -0.32422996*f1.x + 0.17902786*g1.x + 0.39498124*h1.x + -0.4621785*i1.x; + float n = 0.050144423*a1.y + 0.022015644*b1.y + -0.103678636*c1.y + -0.21861544*d1.y + -0.4575561*e1.y + -0.11950478*f1.y + -0.16512674*g1.y + -0.25170276*h1.y + -0.092178196*i1.y; + float o = 0.07426705*a1.z + 0.20278463*b1.z + -0.12125511*c1.z + 0.13472858*d1.z + 0.2342844*e1.z + -0.00045797927*f1.z + 0.16019689*g1.z + 0.13096984*h1.z + 0.14349672*i1.z; + float p = -0.1870569*a1.w + 0.17617738*b1.w + 0.12292782*c1.w + -0.037125535*d1.w + -0.07933675*e1.w + -0.25381994*f1.w + 0.0037806593*g1.w + 0.11210973*h1.w + -0.1399592*i1.w; + float q = -0.08505993*na0.x + -0.1399554*nb0.x + 0.15090756*nc0.x + -0.2961579*nd0.x + 0.116405025*ne0.x + -0.22164461*nf0.x + 0.055569395*ng0.x + 0.28131577*nh0.x + 0.06910265*ni0.x; + float r = 0.03829472*na0.y + -0.16269873*nb0.y + 0.11553206*nc0.y + 0.0879146*nd0.y + 0.09228102*ne0.y + -0.021050004*nf0.y + 0.029262071*ng0.y + -0.040860407*nh0.y + -0.19934064*ni0.y; + float s = 0.1826632*na0.z + -0.019763405*nb0.z + 0.057691265*nc0.z + 0.23001699*nd0.z + 0.3764493*ne0.z + -0.18463586*nf0.z + -0.1123537*ng0.z + -0.22568218*nh0.z + -0.07268684*ni0.z; + float t = -0.056782905*na0.w + -0.34061006*nb0.w + -0.13305256*nc0.w + 0.12895769*nd0.w + 0.105644956*ne0.w + 0.106645614*nf0.w + -0.04421649*ng0.w + 0.08628332*nh0.w + 0.09497531*ni0.w; + float u = 0.25516704*na1.x + -0.09295428*nb1.x + 0.10734516*nc1.x + 0.22108944*nd1.x + 0.4646307*ne1.x + 0.3175236*nf1.x + 0.1708444*ng1.x + 0.3606606*nh1.x + 0.5949483*ni1.x; + float v = 0.19442004*na1.y + 0.070592254*nb1.y + 0.112586305*nc1.y + 0.3487895*nd1.y + 0.013322714*ne1.y + 0.29852825*nf1.y + 0.52252096*ng1.y + 0.4961997*nh1.y + 0.24512465*ni1.y; + float w = -0.050976038*na1.z + -0.21076718*nb1.z + 0.032281205*nc1.z + -0.11800584*nd1.z + -0.6611534*ne1.z + -0.1621408*nf1.z + -0.2365334*ng1.z + -0.19470689*nh1.z + -0.12453201*ni1.z; + float x = 0.24511613*na1.w + 0.22603223*nb1.w + 0.0017550752*nc1.w + 0.047750197*nd1.w + 0.15508509*ne1.w + 0.28011647*nf1.w + 0.015352654*ng1.w + -0.16725023*nh1.w + 0.18291974*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.05279069; + i = 0.008404003*a0.x + -0.10627176*b0.x + 0.09229888*c0.x + 0.13318692*d0.x + -0.24829465*e0.x + 0.025945714*f0.x + -0.03172702*g0.x + -0.2484376*h0.x + -0.12043164*i0.x; + j = -0.06373101*a0.y + -0.13484426*b0.y + 0.05406028*c0.y + -0.06776945*d0.y + -0.37291196*e0.y + 0.0011398172*f0.y + -0.0439159*g0.y + -0.18156001*h0.y + 0.11207086*i0.y; + k = 0.08483646*a0.z + -0.058685873*b0.z + 0.062697396*c0.z + 0.16926341*d0.z + -0.17863348*e0.z + 0.011582497*f0.z + 0.16292098*g0.z + -0.10258071*h0.z + 0.098842606*i0.z; + l = 0.0444924*a0.w + -0.17097838*b0.w + -0.10876493*c0.w + 0.032117974*d0.w + 0.06896584*e0.w + -0.016933667*f0.w + 0.054590322*g0.w + -0.02500689*h0.w + -0.12707044*i0.w; + m = 0.07611656*a1.x + -0.018643428*b1.x + -0.15429781*c1.x + 0.11813699*d1.x + -0.14487611*e1.x + -0.016811037*f1.x + 0.06799785*g1.x + 0.08665557*h1.x + -0.06913339*i1.x; + n = 0.034149908*a1.y + -0.09554191*b1.y + 0.014189771*c1.y + -0.05355791*d1.y + 0.32009345*e1.y + -0.105629094*f1.y + -0.0029237983*g1.y + -0.08419368*h1.y + -0.047896426*i1.y; + o = 0.14945614*a1.z + -0.028181762*b1.z + -0.07658237*c1.z + 0.20731671*d1.z + -0.30175722*e1.z + 0.047350425*f1.z + 0.16912727*g1.z + -0.04453804*h1.z + 0.04918582*i1.z; + p = -0.11123826*a1.w + 0.17230445*b1.w + 0.08132904*c1.w + -0.0010809727*d1.w + 0.0515975*e1.w + 0.10869532*f1.w + -0.05706394*g1.w + 0.029299952*h1.w + -0.031174589*i1.w; + q = 0.0028094754*na0.x + -0.008476241*nb0.x + -0.05977881*nc0.x + -0.24555667*nd0.x + 0.41245478*ne0.x + 0.011358212*nf0.x + -0.07180912*ng0.x + 0.055240646*nh0.x + 0.05751845*ni0.x; + r = 0.15239914*na0.y + 0.053603504*nb0.y + 0.029692866*nc0.y + 0.05225717*nd0.y + 0.14193916*ne0.y + 0.3205421*nf0.y + 0.012476601*ng0.y + 0.127102*nh0.y + 0.049093354*ni0.y; + s = -0.07585988*na0.z + 0.1699522*nb0.z + -0.08202527*nc0.z + -0.07837919*nd0.z + 0.31239763*ne0.z + -0.15695018*nf0.z + -0.19814327*ng0.z + 0.026116237*nh0.z + -0.08477578*ni0.z; + t = -0.028754836*na0.w + 0.11850428*nb0.w + 0.04073512*nc0.w + 0.05534531*nd0.w + 0.07258342*ne0.w + 0.073158294*nf0.w + -0.032114208*ng0.w + 0.037527297*nh0.w + 0.14149861*ni0.w; + u = -0.08361215*na1.x + -0.08683338*nb1.x + 0.07566075*nc1.x + -0.23667093*nd1.x + 0.11633339*ne1.x + 0.13111743*nf1.x + -0.05344559*ng1.x + -0.04330547*nh1.x + 0.059771866*ni1.x; + v = -0.0070694364*na1.y + 0.048788145*nb1.y + 0.0056230226*nc1.y + 0.1291915*nd1.y + 0.041900184*ne1.y + 0.118090354*nf1.y + 0.0027303898*ng1.y + -0.11506767*nh1.y + 0.02518101*ni1.y; + w = -0.066354156*na1.z + 0.11174939*nb1.z + 0.07267902*nc1.z + -0.20309606*nd1.z + 0.3313923*ne1.z + -0.044157956*nf1.z + -0.04583175*ng1.z + 0.051006425*nh1.z + -0.040038593*ni1.z; + x = 0.10450858*na1.w + -0.31238818*nb1.w + -0.09804203*nc1.w + 0.20055936*nd1.w + -0.04483531*ne1.w + -0.15076743*nf1.w + 0.1274108*ng1.w + -0.04509676*nh1.w + 0.014934564*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.014012165; + i = 0.116196275*a0.x + -0.12301849*b0.x + 0.037762836*c0.x + 0.07923946*d0.x + 0.52848935*e0.x + -0.22463503*f0.x + 0.12021454*g0.x + 0.08782382*h0.x + -0.1143211*i0.x; + j = 0.0014436735*a0.y + 0.03878902*b0.y + 0.020114185*c0.y + 0.022503676*d0.y + 0.057359222*e0.y + -0.15808989*f0.y + 0.04650529*g0.y + 0.0057854573*h0.y + -0.12186424*i0.y; + k = -0.056676134*a0.z + 0.39353767*b0.z + -0.084844075*c0.z + -0.40938848*d0.z + 0.43433994*e0.z + -0.0467868*f0.z + 0.05856174*g0.z + -0.0035573053*h0.z + 0.06727593*i0.z; + l = 0.07382817*a0.w + 0.09749001*b0.w + 0.10126295*c0.w + 0.008741454*d0.w + 0.39640576*e0.w + -0.04807935*f0.w + -0.06656666*g0.w + 0.25684914*h0.w + 0.0019193583*i0.w; + m = -0.11828054*a1.x + 0.0019712716*b1.x + -0.13174061*c1.x + -0.1187297*d1.x + 0.2771482*e1.x + -0.049998764*f1.x + -0.014556588*g1.x + 0.021141794*h1.x + -0.11514141*i1.x; + n = 0.054093186*a1.y + 0.037061032*b1.y + 0.033518914*c1.y + -0.064772524*d1.y + 0.032749593*e1.y + -0.13419507*f1.y + 0.03170873*g1.y + -0.2231949*h1.y + -0.012648845*i1.y; + o = -0.22901534*a1.z + 0.08525871*b1.z + 0.0018718509*c1.z + -0.24271463*d1.z + 0.16937853*e1.z + -0.010539479*f1.z + 0.051749635*g1.z + 0.021106198*h1.z + -0.00473413*i1.z; + p = 0.121054955*a1.w + 0.017015804*b1.w + -0.16921929*c1.w + 0.17097035*d1.w + -0.17894094*e1.w + 0.09484096*f1.w + -0.036366504*g1.w + -0.17848694*h1.w + 0.08738928*i1.w; + q = -0.056598846*na0.x + 0.08514117*nb0.x + -0.089687414*nc0.x + -0.11324739*nd0.x + -0.17677836*ne0.x + 0.09375303*nf0.x + -0.033391934*ng0.x + 0.015983*nh0.x + 0.18625529*ni0.x; + r = 0.002394124*na0.y + 0.062107176*nb0.y + 0.096476205*nc0.y + 0.0063232374*nd0.y + 0.0089889495*ne0.y + 0.22078408*nf0.y + -0.020800646*ng0.y + 0.17141153*nh0.y + 0.015246565*ni0.y; + s = 0.022962576*na0.z + -0.2124664*nb0.z + -0.029383652*nc0.z + 0.26072204*nd0.z + -0.075786315*ne0.z + -0.05708116*nf0.z + -0.08542466*ng0.z + -0.050992683*nh0.z + -0.12126194*ni0.z; + t = 0.024848187*na0.w + -0.04938356*nb0.w + -0.077254295*nc0.w + 0.043234512*nd0.w + -0.15014283*ne0.w + 0.20598838*nf0.w + 0.046027232*ng0.w + -0.18911807*nh0.w + 0.123776875*ni0.w; + u = 0.20604062*na1.x + -0.23251836*nb1.x + 0.081893235*nc1.x + 0.12732284*nd1.x + -0.5516895*ne1.x + 0.061047662*nf1.x + -0.0370991*ng1.x + -0.14647527*nh1.x + -0.0705801*ni1.x; + v = 0.073026024*na1.y + -0.08535302*nb1.y + 0.05075408*nc1.y + 0.09554201*nd1.y + 0.0929716*ne1.y + 0.29073346*nf1.y + 0.12636878*ng1.y + 0.21003686*nh1.y + 0.09685778*ni1.y; + w = 0.070990615*na1.z + 0.101455785*nb1.z + -0.020180527*nc1.z + 0.08770532*nd1.z + -0.3649432*ne1.z + 0.04242679*nf1.z + 0.0056111766*ng1.z + -0.07642413*nh1.z + 0.01310854*ni1.z; + x = -0.10968941*na1.w + -0.08435011*nb1.w + 0.03254347*nc1.w + -0.37846026*nd1.w + 0.21967432*ne1.w + -0.18490723*nf1.w + 0.0048353807*ng1.w + 0.010850792*nh1.w + -0.017531307*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.00060440507; + i = -0.013804354*a0.x + 0.021247795*b0.x + 0.061585147*c0.x + 0.09833304*d0.x + -0.30245215*e0.x + 0.008355005*f0.x + -0.13107775*g0.x + 0.21611948*h0.x + 0.06137902*i0.x; + j = -0.098681964*a0.y + -0.037771676*b0.y + 0.047770564*c0.y + 0.13817668*d0.y + 0.040083956*e0.y + 0.025086235*f0.y + -0.019439515*g0.y + -0.045821697*h0.y + 0.0014383323*i0.y; + k = 0.033921614*a0.z + -0.06321198*b0.z + -0.024385406*c0.z + 0.054660544*d0.z + -0.29555362*e0.z + -0.025737336*f0.z + 0.035136692*g0.z + -0.23046388*h0.z + 0.039965965*i0.z; + l = 0.013431202*a0.w + -0.0061672954*b0.w + -0.060486417*c0.w + -0.24859713*d0.w + -0.13546251*e0.w + 0.076836795*f0.w + -0.002994137*g0.w + 0.07161491*h0.w + 0.06443895*i0.w; + m = -0.017377341*a1.x + 0.12906437*b1.x + -0.020969361*c1.x + 0.15516324*d1.x + 0.21561222*e1.x + -0.20739709*f1.x + 0.091706246*g1.x + -0.10040115*h1.x + -0.034028374*i1.x; + n = -0.0063148965*a1.y + 0.08987722*b1.y + 0.029218154*c1.y + -0.054101445*d1.y + -0.13817003*e1.y + -0.029354995*f1.y + 0.04757919*g1.y + -0.13517953*h1.y + -0.08134147*i1.y; + o = 0.010582513*a1.z + 0.21907906*b1.z + -0.05613645*c1.z + 0.2769764*d1.z + -0.20559123*e1.z + -0.06640349*f1.z + 0.00692517*g1.z + -0.059551317*h1.z + 0.06395893*i1.z; + p = -0.14352207*a1.w + -0.16687149*b1.w + 0.13081709*c1.w + -0.051290963*d1.w + 0.25922292*e1.w + -0.014545821*f1.w + -0.005920325*g1.w + 0.005911838*h1.w + -0.09514923*i1.w; + q = -0.08228784*na0.x + 0.000581186*nb0.x + -0.09652686*nc0.x + 0.06880835*nd0.x + 0.0076048165*ne0.x + 0.12021452*nf0.x + 0.12102143*ng0.x + -0.17097168*nh0.x + -0.010007838*ni0.x; + r = 0.036096275*na0.y + 0.14173397*nb0.y + -0.07032519*nc0.y + 0.004925754*nd0.y + -0.07576388*ne0.y + -0.0563072*nf0.y + -0.07073694*ng0.y + 0.039116677*nh0.y + -0.010859262*ni0.y; + s = -0.0020870338*na0.z + -0.028113784*nb0.z + 0.04989161*nc0.z + -0.09156798*nd0.z + 0.07752935*ne0.z + -0.017505554*nf0.z + -0.025690995*ng0.z + 0.25614643*nh0.z + -0.083168246*ni0.z; + t = -0.079945564*na0.w + -0.09527443*nb0.w + 0.03347835*nc0.w + 0.15164866*nd0.w + -0.10824011*ne0.w + -0.13326558*nf0.w + 0.15131363*ng0.w + -0.03776239*nh0.w + -0.033501238*ni0.w; + u = 0.035662424*na1.x + -0.27835503*nb1.x + -0.016060097*nc1.x + -0.1452523*nd1.x + -0.07443286*ne1.x + -0.019472402*nf1.x + -0.1322107*ng1.x + 0.034941226*nh1.x + 0.052179255*ni1.x; + v = -0.0181661*na1.y + 0.12392778*nb1.y + 0.097098775*nc1.y + -0.08682108*nd1.y + 0.27572918*ne1.y + 0.28702986*nf1.y + 0.124801435*ng1.y + 0.015296429*nh1.y + 0.017991979*ni1.y; + w = -0.021040164*na1.z + -0.15109229*nb1.z + 0.07820955*nc1.z + -0.067696646*nd1.z + 0.4926855*ne1.z + 0.005093849*nf1.z + 0.01170877*ng1.z + -0.033637036*nh1.z + -0.029393932*ni1.z; + x = 0.22366229*na1.w + 0.45942515*nb1.w + -0.17588852*nc1.w + 0.10926712*nd1.w + -0.074878484*ne1.w + 0.12930797*nf1.w + 0.042554796*ng1.w + 0.037292596*nh1.w + -0.024673386*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.010160626; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN100 +//!BIND LUMAN101 +//!SAVE LUMAN110 + +#define L0_tex LUMAN100_tex +#define L1_tex LUMAN101_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.03602069*a0.x + -0.0065346938*b0.x + 0.08521494*c0.x + -0.041519314*d0.x + -0.5841501*e0.x + 0.18409619*f0.x + -0.05032032*g0.x + 0.0011552947*h0.x + -0.005042036*i0.x; + float j = 0.030269936*a0.y + 0.013622225*b0.y + 0.23117489*c0.y + -0.005249265*d0.y + -0.28945604*e0.y + 0.26844555*f0.y + -0.14357369*g0.y + -0.14488666*h0.y + -0.14479089*i0.y; + float k = -0.12555563*a0.z + -0.09965008*b0.z + 0.017267741*c0.z + -0.119758226*d0.z + -0.4075112*e0.z + -0.18350755*f0.z + 0.04012238*g0.z + 0.00733259*h0.z + 0.07676842*i0.z; + float l = -0.12535982*a0.w + 0.16426282*b0.w + -0.05104696*c0.w + -0.058004126*d0.w + -0.17966852*e0.w + -0.07398425*f0.w + -0.094065726*g0.w + -0.2342982*h0.w + -0.06416653*i0.w; + float m = -0.05863216*a1.x + -0.13490738*b1.x + -0.046150867*c1.x + 0.17273849*d1.x + -0.009401783*e1.x + -0.036789127*f1.x + 0.0071901856*g1.x + -0.047581356*h1.x + -0.016197177*i1.x; + float n = 0.06269741*a1.y + -0.016592018*b1.y + -0.043655146*c1.y + -0.06522069*d1.y + -0.30029792*e1.y + -0.04420866*f1.y + -0.04570528*g1.y + 0.0646861*h1.y + 0.030200183*i1.y; + float o = 0.14399967*a1.z + 0.028651504*b1.z + 0.05778356*c1.z + 0.08821856*d1.z + 0.29038462*e1.z + 0.22381328*f1.z + -0.008642876*g1.z + -0.09654283*h1.z + -0.10973205*i1.z; + float p = 0.12103744*a1.w + 0.2311598*b1.w + -0.036589112*c1.w + -0.04680214*d1.w + 0.26473337*e1.w + -0.18286628*f1.w + -0.050546758*g1.w + 0.27403802*h1.w + -0.005307289*i1.w; + float q = -0.04546302*na0.x + -0.17213371*nb0.x + 0.003806862*nc0.x + 0.023668943*nd0.x + 0.36936614*ne0.x + -0.17300197*nf0.x + 0.030298656*ng0.x + 0.05799353*nh0.x + 0.08662349*ni0.x; + float r = -0.04944561*na0.y + -0.056982957*nb0.y + -0.20022678*nc0.y + 0.017711869*nd0.y + 0.3456449*ne0.y + -0.29923084*nf0.y + 0.057976753*ng0.y + 0.19869696*nh0.y + 0.08283148*ni0.y; + float s = 0.07260866*na0.z + 0.068223044*nb0.z + 0.06357076*nc0.z + 0.124097474*nd0.z + 0.78690267*ne0.z + 0.30145773*nf0.z + 0.030661518*ng0.z + -0.02760832*nh0.z + -0.112959*ni0.z; + float t = 0.08632359*na0.w + -0.05515791*nb0.w + 0.07179812*nc0.w + 0.11407412*nd0.w + 0.2622368*ne0.w + -0.018783974*nf0.w + -0.0041560098*ng0.w + 0.03821421*nh0.w + 0.06326718*ni0.w; + float u = 0.069282204*na1.x + 0.03544544*nb1.x + 0.025868848*nc1.x + -0.09281634*nd1.x + 0.058544382*ne1.x + 0.04652626*nf1.x + -0.07156491*ng1.x + 0.017106233*nh1.x + 0.047421742*ni1.x; + float v = -0.044539373*na1.y + -0.042148568*nb1.y + 0.07050117*nc1.y + 0.053141985*nd1.y + 0.48459253*ne1.y + 0.11035981*nf1.y + 0.07965893*ng1.y + -0.17465805*nh1.y + -0.091129944*ni1.y; + float w = -0.07218466*na1.z + -0.06529778*nb1.z + -0.039833274*nc1.z + -0.15487763*nd1.z + -0.43414643*ne1.z + -0.18884458*nf1.z + 0.011959076*ng1.z + 0.26235119*nh1.z + 0.13393946*ni1.z; + float x = -0.17639084*na1.w + -0.48395765*nb1.w + -0.032830775*nc1.w + -0.021607742*nd1.w + 0.21255508*ne1.w + 0.11890606*nf1.w + -0.08791553*ng1.w + -0.22008047*nh1.w + -0.06060257*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.024112992; + i = 0.015220411*a0.x + 0.00021640473*b0.x + 0.00384377*c0.x + 0.12334635*d0.x + 0.08264294*e0.x + 0.015325374*f0.x + 0.103720956*g0.x + -0.11786532*h0.x + -0.12656337*i0.x; + j = -0.042295307*a0.y + -0.12803623*b0.y + 0.056015495*c0.y + 0.27728587*d0.y + 0.076958366*e0.y + -0.15539825*f0.y + 0.04920014*g0.y + 0.3072905*h0.y + -0.16387074*i0.y; + k = -0.0845296*a0.z + 0.0045217043*b0.z + -0.00032858725*c0.z + -0.28042564*d0.z + -0.2551264*e0.z + 0.033419732*f0.z + 0.1324542*g0.z + -0.33311492*h0.z + -0.073407345*i0.z; + l = 0.03763565*a0.w + -0.101808086*b0.w + 0.12194186*c0.w + -0.11221479*d0.w + 0.011986732*e0.w + 0.036151536*f0.w + 0.16944255*g0.w + -0.47388855*h0.w + -0.20185669*i0.w; + m = 0.16554914*a1.x + -0.043454412*b1.x + 0.06277518*c1.x + 0.080631435*d1.x + 0.13178025*e1.x + -0.035219252*f1.x + -0.0050541796*g1.x + 0.16690767*h1.x + 0.13405177*i1.x; + n = 0.017330913*a1.y + -0.10955309*b1.y + -0.039075293*c1.y + -0.19225971*d1.y + 0.24710307*e1.y + 0.0546898*f1.y + -0.020972615*g1.y + -0.10566769*h1.y + 0.13435537*i1.y; + o = -0.09115333*a1.z + 0.028685523*b1.z + 0.059706703*c1.z + -0.013648075*d1.z + -0.22919676*e1.z + -0.18372746*f1.z + 0.023510983*g1.z + -0.0011091923*h1.z + 0.0075845607*i1.z; + p = 0.037163705*a1.w + -0.04032177*b1.w + 0.036643118*c1.w + 0.26878777*d1.w + 0.3817339*e1.w + 0.07120527*f1.w + -0.09457787*g1.w + -0.07276129*h1.w + 0.0101238405*i1.w; + q = 0.10527173*na0.x + 0.007218408*nb0.x + -0.01260221*nc0.x + -0.07497777*nd0.x + -0.13471922*ne0.x + -0.014607285*nf0.x + -0.085688256*ng0.x + 0.050644316*nh0.x + 0.22081862*ni0.x; + r = 0.020645555*na0.y + 0.004109053*nb0.y + 0.024294011*nc0.y + -0.1366366*nd0.y + 0.230857*ne0.y + 0.2505362*nf0.y + 0.014395575*ng0.y + -0.20022038*nh0.y + 0.24387321*ni0.y; + s = 0.022694416*na0.z + -0.0010274414*nb0.z + -0.018127205*nc0.z + 0.11808406*nd0.z + 0.067578726*ne0.z + -0.06129588*nf0.z + -0.1027712*ng0.z + -0.07272307*nh0.z + -0.036023825*ni0.z; + t = 0.06470276*na0.w + 0.10388846*nb0.w + -0.0006190098*nc0.w + 0.07504703*nd0.w + 0.016774131*ne0.w + 0.012262067*nf0.w + -0.04258665*ng0.w + 0.46223727*nh0.w + 0.1648368*ni0.w; + u = -0.19243379*na1.x + 0.12196685*nb1.x + 0.04699072*nc1.x + -0.116037935*nd1.x + -0.25312606*ne1.x + 0.07425659*nf1.x + 0.125147*ng1.x + -0.10115886*nh1.x + -0.08619349*ni1.x; + v = 0.13461848*na1.y + 0.30897498*nb1.y + 0.049649116*nc1.y + 0.14223924*nd1.y + -0.3189692*ne1.y + 0.12078284*nf1.y + -0.13881688*ng1.y + 0.39585662*nh1.y + -0.121917404*ni1.y; + w = 0.017644675*na1.z + -0.02583539*nb1.z + -0.03376057*nc1.z + 0.21698844*nd1.z + 0.20131592*ne1.z + 0.036263432*nf1.z + -0.12243008*ng1.z + 0.2662984*nh1.z + -0.05208568*ni1.z; + x = -0.08311993*na1.w + 0.06898596*nb1.w + 0.1168798*nc1.w + 0.06794715*nd1.w + -0.2179697*ne1.w + -0.020453759*nf1.w + -0.22404517*ng1.w + 0.44327855*nh1.w + -0.084174156*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.021556964; + i = 0.10353498*a0.x + 0.028292345*b0.x + -0.14651915*c0.x + 0.07447917*d0.x + 0.7510377*e0.x + 0.037376225*f0.x + -0.08991325*g0.x + -0.15310106*h0.x + 0.021130428*i0.x; + j = -0.042429667*a0.y + -0.109997764*b0.y + -0.17000705*c0.y + -0.23916405*d0.y + -0.31910843*e0.y + 0.24798077*f0.y + -0.18227191*g0.y + 0.020335764*h0.y + 0.103075214*i0.y; + k = 0.101871334*a0.z + -0.096882686*b0.z + -0.095259584*c0.z + 0.11459477*d0.z + -0.14924978*e0.z + -0.0914223*f0.z + 0.08352624*g0.z + -2.2024558e-05*h0.z + -0.10669735*i0.z; + l = 0.07058873*a0.w + 0.055611346*b0.w + -0.27597594*c0.w + 0.060510594*d0.w + -0.06938622*e0.w + 0.031955447*f0.w + -0.06676932*g0.w + 0.015034923*h0.w + 0.13512042*i0.w; + m = 0.005268731*a1.x + 0.06342999*b1.x + 0.17636086*c1.x + 0.07072773*d1.x + 0.2873334*e1.x + 0.0025959408*f1.x + -0.007068777*g1.x + 0.06448795*h1.x + -0.03921053*i1.x; + n = -0.086861365*a1.y + -0.23956086*b1.y + 0.023615625*c1.y + -0.016472433*d1.y + 0.77977765*e1.y + -0.2707349*f1.y + 0.15484811*g1.y + -0.11511586*h1.y + 0.0015578099*i1.y; + o = -0.009912772*a1.z + -0.018964097*b1.z + 0.02293317*c1.z + -0.043342438*d1.z + -0.003991376*e1.z + 0.14810553*f1.z + -0.04009368*g1.z + 0.11626676*h1.z + 0.08746776*i1.z; + p = 0.1307143*a1.w + -0.38829568*b1.w + -0.04730003*c1.w + -0.3073631*d1.w + 0.0039590085*e1.w + -0.03159446*f1.w + -0.110455066*g1.w + -0.2890916*h1.w + 0.13814703*i1.w; + q = -0.015642561*na0.x + 0.14379875*nb0.x + 0.22320704*nc0.x + 0.10343936*nd0.x + -0.37316132*ne0.x + -0.12211642*nf0.x + 0.151595*ng0.x + 0.08496525*nh0.x + -0.07385503*ni0.x; + r = -0.005425541*na0.y + 0.25162533*nb0.y + 0.17031972*nc0.y + 0.37817922*nd0.y + 0.1751982*ne0.y + -0.19810377*nf0.y + 0.05232508*ng0.y + 0.071171805*nh0.y + -0.08274256*ni0.y; + s = 0.04870444*na0.z + 0.069402404*nb0.z + 0.06612454*nc0.z + -0.16123009*nd0.z + 0.37446707*ne0.z + 0.17678879*nf0.z + 0.15383762*ng0.z + -0.017722199*nh0.z + 0.11936048*ni0.z; + t = -0.04180779*na0.w + -0.006943261*nb0.w + 0.060121372*nc0.w + -0.2158157*nd0.w + -0.0751999*ne0.w + -0.059396897*nf0.w + -0.019060649*ng0.w + -0.20357497*nh0.w + 0.07698966*ni0.w; + u = 0.08368119*na1.x + -0.12918562*nb1.x + -0.18324965*nc1.x + 0.10304961*nd1.x + -0.14763509*ne1.x + 0.10546128*nf1.x + -0.10853921*ng1.x + -0.16994037*nh1.x + 0.08002449*ni1.x; + v = 0.023527468*na1.y + 0.31890285*nb1.y + 0.06943346*nc1.y + -0.061519075*nd1.y + -0.17082773*ne1.y + -0.0750498*nf1.y + -0.026083339*ng1.y + 0.050275475*nh1.y + -0.04482955*ni1.y; + w = 0.13297354*na1.z + -0.25774565*nb1.z + 0.04645572*nc1.z + -0.21069203*nd1.z + -0.019796975*ne1.z + -0.19346039*nf1.z + 0.028876891*ng1.z + -0.22818841*nh1.z + -0.017355708*ni1.z; + x = 0.099980265*na1.w + 0.20437594*nb1.w + 0.036823206*nc1.w + -0.035766415*nd1.w + 0.29052198*ne1.w + -0.0441845*nf1.w + 0.14488915*ng1.w + -0.095914885*nh1.w + 0.04632105*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.020339007; + i = 0.018414905*a0.x + 0.051992606*b0.x + -0.026458269*c0.x + -0.056065753*d0.x + -0.57431364*e0.x + 0.14583828*f0.x + -0.20091495*g0.x + 0.036064938*h0.x + 0.24589996*i0.x; + j = 0.12951489*a0.y + 0.22155547*b0.y + -0.03793838*c0.y + -0.37865022*d0.y + -0.8699486*e0.y + 0.30465844*f0.y + -0.05505082*g0.y + -0.1808131*h0.y + -0.043180563*i0.y; + k = -0.093806*a0.z + -0.08082797*b0.z + -0.05212279*c0.z + 0.059532817*d0.z + 0.18182111*e0.z + -0.030775163*f0.z + -0.056424897*g0.z + -0.06331663*h0.z + 0.16157578*i0.z; + l = -0.13735132*a0.w + 0.12328133*b0.w + -0.116585016*c0.w + -0.14569259*d0.w + -0.37743783*e0.w + 0.043045748*f0.w + -0.16366433*g0.w + 0.047612697*h0.w + 0.06902134*i0.w; + m = -0.11859453*a1.x + 0.085688874*b1.x + -0.012032304*c1.x + 0.038115133*d1.x + -0.23642606*e1.x + -0.06443288*f1.x + 0.010304007*g1.x + -0.11454085*h1.x + -0.19266266*i1.x; + n = -0.041277226*a1.y + 0.14278844*b1.y + 0.09594997*c1.y + 0.22554651*d1.y + -0.4707059*e1.y + -0.5767265*f1.y + -0.07657722*g1.y + 0.0763926*h1.y + 0.16180336*i1.y; + o = 0.14852785*a1.z + -0.03800648*b1.z + -0.08576322*c1.z + 0.035554264*d1.z + -0.069700964*e1.z + 0.37610474*f1.z + 0.08681652*g1.z + 0.1506625*h1.z + -0.12656021*i1.z; + p = -0.024719054*a1.w + 0.003164649*b1.w + -0.13945296*c1.w + -0.13508745*d1.w + 0.13328283*e1.w + -0.11239675*f1.w + -0.08487616*g1.w + 0.23727833*h1.w + 0.056444455*i1.w; + q = -0.10184672*na0.x + -0.059290465*nb0.x + 0.0059381626*nc0.x + 0.013273808*nd0.x + 0.21650733*ne0.x + -0.2524956*nf0.x + 0.102933444*ng0.x + 0.035939015*nh0.x + -0.14319602*ni0.x; + r = -0.022619557*na0.y + -0.018408645*nb0.y + 0.10522426*nc0.y + 0.32646754*nd0.y + 0.80208266*ne0.y + -0.46869853*nf0.y + -0.016906548*ng0.y + 0.17456181*nh0.y + -0.029142622*ni0.y; + s = 0.096661486*na0.z + 0.18941526*nb0.z + 0.08153988*nc0.z + -0.10972477*nd0.z + -0.13448085*ne0.z + 0.057993986*nf0.z + -0.026086971*ng0.z + 0.09751599*nh0.z + 0.018404521*ni0.z; + t = 0.044939417*na0.w + -0.066798955*nb0.w + 0.033069726*nc0.w + 0.08848126*nd0.w + 0.22031724*ne0.w + 0.21239568*nf0.w + -0.03176487*ng0.w + -0.08072932*nh0.w + -0.18890536*ni0.w; + u = 0.20835902*na1.x + -0.18376575*nb1.x + -0.20231391*nc1.x + -0.039601583*nd1.x + 0.39764643*ne1.x + 0.14225262*nf1.x + -0.123099715*ng1.x + 0.09194234*nh1.x + 0.17620787*ni1.x; + v = -0.005739508*na1.y + -0.20032057*nb1.y + -0.09430665*nc1.y + -0.11195265*nd1.y + 0.4117789*ne1.y + 0.29875347*nf1.y + 0.18852101*ng1.y + -0.25315195*nh1.y + -0.23462892*ni1.y; + w = 0.07256975*na1.z + 0.063809015*nb1.z + 0.15035653*nc1.z + -0.13318999*nd1.z + -0.27948493*ne1.z + 0.008878333*nf1.z + -0.034100264*ng1.z + 0.09170595*nh1.z + 0.019607466*ni1.z; + x = 0.122655496*na1.w + 0.16501404*nb1.w + -0.20922776*nc1.w + -0.35553262*nd1.w + -0.38473418*ne1.w + 0.33719665*nf1.w + 0.117218845*ng1.w + -0.20784451*nh1.w + -0.14332327*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.026562545; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN100 +//!BIND LUMAN101 +//!SAVE LUMAN111 + +#define L0_tex LUMAN100_tex +#define L1_tex LUMAN101_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.17383257*a0.x + 0.19359857*b0.x + -0.008506656*c0.x + -0.0024075257*d0.x + -0.0035203139*e0.x + -0.089835465*f0.x + 0.112369776*g0.x + -0.062991165*h0.x + -0.09123371*i0.x; + float j = 0.18316449*a0.y + 0.016517052*b0.y + 0.06764748*c0.y + 0.046583068*d0.y + 0.24939087*e0.y + -0.19446205*f0.y + 0.02954913*g0.y + 0.13914897*h0.y + 0.061350036*i0.y; + float k = -0.06663179*a0.z + 0.10225051*b0.z + -0.055374082*c0.z + -0.17434083*d0.z + 0.11235246*e0.z + -0.03738717*f0.z + 0.113932945*g0.z + -0.12036072*h0.z + 0.067093164*i0.z; + float l = -0.35936478*a0.w + 0.25206113*b0.w + 0.062964626*c0.w + 0.18188629*d0.w + -0.06851797*e0.w + 0.0070859026*f0.w + 0.1354472*g0.w + -0.12759088*h0.w + 0.00045594518*i0.w; + float m = 0.028956862*a1.x + -0.3117937*b1.x + 0.08079537*c1.x + 0.01991457*d1.x + -0.20107096*e1.x + 0.10075411*f1.x + -0.030672783*g1.x + -0.008995862*h1.x + 0.0033733798*i1.x; + float n = 0.0636544*a1.y + 0.19053148*b1.y + 0.09280553*c1.y + -0.12814613*d1.y + 0.40875462*e1.y + -0.12533753*f1.y + 0.03432*g1.y + -0.10794891*h1.y + -0.115061335*i1.y; + float o = -0.13256124*a1.z + -0.25365067*b1.z + -0.019771395*c1.z + -0.50099087*d1.z + -0.52115613*e1.z + 0.0525626*f1.z + -0.21533427*g1.z + -0.090868905*h1.z + 0.12670971*i1.z; + float p = -0.098364204*a1.w + 0.42667642*b1.w + 0.019137595*c1.w + -0.143334*d1.w + 0.31880572*e1.w + -0.022834571*f1.w + 0.102781296*g1.w + -0.025588622*h1.w + -0.058978826*i1.w; + float q = 0.17132543*na0.x + -0.3008873*nb0.x + -0.059462246*nc0.x + -0.119294114*nd0.x + 0.1022395*ne0.x + 0.014199865*nf0.x + -0.07571218*ng0.x + -0.11296554*nh0.x + 0.07032073*ni0.x; + float r = 0.037491314*na0.y + -0.058757633*nb0.y + -0.06759223*nc0.y + 0.07403289*nd0.y + -0.049440965*ne0.y + 0.16491657*nf0.y + -0.1802418*ng0.y + 0.07016352*nh0.y + 0.10195126*ni0.y; + float s = 0.071089566*na0.z + -0.16521877*nb0.z + 0.16861384*nc0.z + 0.05623844*nd0.z + -0.39791787*ne0.z + 0.05436925*nf0.z + 0.054514594*ng0.z + -0.06257326*nh0.z + -0.0682845*ni0.z; + float t = 0.061884217*na0.w + -0.2286*nb0.w + 0.11185325*nc0.w + 0.1820207*nd0.w + -0.27744997*ne0.w + 0.17514008*nf0.w + -0.028395107*ng0.w + -0.07900793*nh0.w + 0.08224395*ni0.w; + float u = -0.006974786*na1.x + 0.2775666*nb1.x + -0.05748193*nc1.x + -0.107195705*nd1.x + 0.13472128*ne1.x + -0.17489615*nf1.x + 0.08438403*ng1.x + 0.05627347*nh1.x + 0.014787926*ni1.x; + float v = -0.10634387*na1.y + -0.21718432*nb1.y + -0.05429719*nc1.y + 0.39874536*nd1.y + 0.1328281*ne1.y + 0.07176977*nf1.y + 0.10495411*ng1.y + 0.03204737*nh1.y + 0.043627903*ni1.y; + float w = 0.20148818*na1.z + 0.2715468*nb1.z + 0.027095042*nc1.z + 0.50055045*nd1.z + 0.12403425*ne1.z + 0.19137537*nf1.z + 0.107188895*ng1.z + -0.16039443*nh1.z + -0.11896027*ni1.z; + float x = 0.22292997*na1.w + -0.32840404*nb1.w + 0.057060912*nc1.w + -0.102952555*nd1.w + -0.4768226*ne1.w + 0.13585155*nf1.w + -0.024274329*ng1.w + 0.045635037*nh1.w + 0.15334982*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.021949163; + i = -0.057763852*a0.x + -0.08316332*b0.x + -0.11650133*c0.x + 0.08359192*d0.x + -0.30200738*e0.x + -0.20410018*f0.x + -0.056469277*g0.x + 0.03727088*h0.x + -0.23919475*i0.x; + j = 0.24101874*a0.y + -0.19743818*b0.y + -0.22980976*c0.y + 0.17798895*d0.y + 0.41507307*e0.y + -0.56685776*f0.y + -0.2121568*g0.y + 0.29752794*h0.y + -0.12151107*i0.y; + k = -0.07609526*a0.z + 0.021728436*b0.z + 0.0085501745*c0.z + -0.28034872*d0.z + 0.20530029*e0.z + 0.035212994*f0.z + -0.057961874*g0.z + 0.06513409*h0.z + 0.042886022*i0.z; + l = 0.035863068*a0.w + -0.539069*b0.w + 0.004749654*c0.w + -0.13944298*d0.w + 0.15007691*e0.w + 0.01589523*f0.w + -0.1202698*g0.w + -0.5025889*h0.w + 0.013119389*i0.w; + m = 0.009390274*a1.x + -0.059049968*b1.x + 0.050254676*c1.x + 0.16650045*d1.x + -0.22121963*e1.x + 0.10251527*f1.x + 0.066131234*g1.x + -0.019349663*h1.x + 0.011245998*i1.x; + n = 0.072220445*a1.y + 0.04791526*b1.y + -0.033404786*c1.y + -0.04082059*d1.y + -0.07151034*e1.y + 0.025489205*f1.y + 0.16244847*g1.y + -0.31598613*h1.y + -0.3642761*i1.y; + o = -0.23894922*a1.z + 0.06735179*b1.z + -0.0923391*c1.z + -0.48843756*d1.z + -0.39792565*e1.z + -0.18545644*f1.z + -0.176065*g1.z + -0.33453122*h1.z + 0.20319647*i1.z; + p = -0.061228007*a1.w + -0.07530811*b1.w + -0.23172612*c1.w + -0.05970527*d1.w + -0.7531555*e1.w + -0.28645357*f1.w + -0.0015547524*g1.w + 0.11225589*h1.w + 0.056063578*i1.w; + q = 0.038223065*na0.x + 0.111754596*nb0.x + 0.0130218845*nc0.x + -0.05061665*nd0.x + 0.41986698*ne0.x + 0.123574205*nf0.x + 0.06880718*ng0.x + -0.095840216*nh0.x + 0.12724164*ni0.x; + r = -0.14341785*na0.y + -0.058098536*nb0.y + 0.22877641*nc0.y + 0.02612737*nd0.y + -0.2091377*ne0.y + 0.5626278*nf0.y + 0.061045192*ng0.y + -0.005432363*nh0.y + 0.25937176*ni0.y; + s = -0.042168606*na0.z + -0.014749729*nb0.z + 0.079212315*nc0.z + 0.36512303*nd0.z + -0.38474083*ne0.z + -0.032575715*nf0.z + 0.24942294*ng0.z + -0.28649905*nh0.z + -0.13864756*ni0.z; + t = 0.11840045*na0.w + 0.06969945*nb0.w + 0.017670378*nc0.w + 0.17346504*nd0.w + -0.48784158*ne0.w + 0.09433169*nf0.w + 0.13065694*ng0.w + 0.006293475*nh0.w + 0.20921776*ni0.w; + u = -0.052700095*na1.x + 0.03280169*nb1.x + -0.041704353*nc1.x + -0.23268354*nd1.x + 0.3779702*ne1.x + -0.15453738*nf1.x + -0.100402474*ng1.x + -0.040295973*nh1.x + 0.05908061*ni1.x; + v = 0.0090148505*na1.y + -0.09874868*nb1.y + 0.0287044*nc1.y + 0.37773392*nd1.y + -0.11349941*ne1.y + 0.060884114*nf1.y + 0.076751046*ng1.y + 0.16020733*nh1.y + 0.090913005*ni1.y; + w = 0.03725819*na1.z + 0.08141571*nb1.z + 0.12553579*nc1.z + 0.17851456*nd1.z + 0.29002705*ne1.z + 0.45743072*nf1.z + 0.17406096*ng1.z + 0.13529126*nh1.z + -0.122617625*ni1.z; + x = -0.06723492*na1.w + 0.108511336*nb1.w + 0.08086323*nc1.w + 0.3413091*nd1.w + -0.066336535*ne1.w + 0.030476777*nf1.w + 0.01769155*ng1.w + -0.20934762*nh1.w + 0.25853097*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.013970954; + i = -0.13062532*a0.x + 0.14739287*b0.x + 0.13013633*c0.x + -0.15238641*d0.x + 0.41811723*e0.x + 0.09137209*f0.x + 0.008867647*g0.x + -0.18663251*h0.x + -0.025392555*i0.x; + j = -0.080881484*a0.y + 0.13228063*b0.y + 0.14924963*c0.y + 0.013383812*d0.y + 0.646058*e0.y + -0.23729008*f0.y + -0.03326502*g0.y + 0.1341266*h0.y + 0.0050697867*i0.y; + k = -0.07851864*a0.z + -0.003983806*b0.z + 0.03482352*c0.z + 0.12479716*d0.z + -0.28953743*e0.z + 0.13379917*f0.z + 0.08265414*g0.z + -0.22911206*h0.z + 0.076923214*i0.z; + l = -0.18052709*a0.w + -0.08884755*b0.w + 0.20002027*c0.w + -0.04775166*d0.w + -0.47042155*e0.w + -0.037522048*f0.w + 0.022297889*g0.w + -0.554439*h0.w + -0.05526164*i0.w; + m = 0.11441356*a1.x + -0.21099038*b1.x + -0.0595072*c1.x + -0.20941521*d1.x + -0.063228935*e1.x + -0.035564374*f1.x + 0.020967439*g1.x + 0.01850741*h1.x + -0.000115429575*i1.x; + n = 0.06921214*a1.y + 0.02414473*b1.y + 0.06690077*c1.y + -0.06028668*d1.y + 0.21183336*e1.y + 0.07774993*f1.y + -0.046541408*g1.y + -0.037885994*h1.y + -0.0068330625*i1.y; + o = 0.09289483*a1.z + -0.09876539*b1.z + -0.004070522*c1.z + 0.105470106*d1.z + 0.44143915*e1.z + -0.17103986*f1.z + -0.08861693*g1.z + 0.08426412*h1.z + 0.016740821*i1.z; + p = 0.044459134*a1.w + 0.1889552*b1.w + -0.036764797*c1.w + -0.10289402*d1.w + 0.1978711*e1.w + -0.12065221*f1.w + -0.001048663*g1.w + -0.0873868*h1.w + 0.056002572*i1.w; + q = 0.12984878*na0.x + -0.2310601*nb0.x + -0.15985721*nc0.x + 0.001380659*nd0.x + -0.40654126*ne0.x + -0.024795063*nf0.x + -0.020679224*ng0.x + 0.064191334*nh0.x + 0.086150564*ni0.x; + r = 0.10204934*na0.y + -0.10334769*nb0.y + -0.07872581*nc0.y + 0.2238558*nd0.y + -0.5565347*ne0.y + 0.17858714*nf0.y + 0.004345275*ng0.y + 0.03389987*nh0.y + 0.10307973*ni0.y; + s = -0.005913493*na0.z + -0.018920904*nb0.z + 0.04759889*nc0.z + -0.17818558*nd0.z + 0.1905599*ne0.z + -0.12743413*nf0.z + -0.10214076*ng0.z + -0.20663314*nh0.z + -0.14263868*ni0.z; + t = 0.096049815*na0.w + 0.0089668585*nb0.w + 0.03275695*nc0.w + -0.046080954*nd0.w + 0.32457682*ne0.w + -0.09166253*nf0.w + 0.07651577*ng0.w + 0.3473302*nh0.w + 0.107547484*ni0.w; + u = -0.06589269*na1.x + 0.11446591*nb1.x + 0.0869667*nc1.x + 0.23969674*nd1.x + 0.012473717*ne1.x + 0.028081264*nf1.x + 0.048592523*ng1.x + 0.0057853544*nh1.x + 0.11369988*ni1.x; + v = -0.076878786*na1.y + -0.14412941*nb1.y + 0.06001701*nc1.y + -0.11859855*nd1.y + -0.3363305*ne1.y + -0.018759733*nf1.y + 0.035113666*ng1.y + 0.1236211*nh1.y + -0.20992972*ni1.y; + w = 0.08501675*na1.z + 0.2189646*nb1.z + -0.03941925*nc1.z + 0.00064086955*nd1.z + -0.18323024*ne1.z + 0.1369047*nf1.z + -0.003876649*ng1.z + 0.10710443*nh1.z + -0.033321608*ni1.z; + x = 0.04007519*na1.w + -0.35836148*nb1.w + -0.0013083797*nc1.w + -0.21432324*nd1.w + -0.115432896*ne1.w + -0.13674262*nf1.w + -0.12126403*ng1.w + 0.44424897*nh1.w + -0.044962328*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.012365917; + i = 0.019780008*a0.x + 0.02274219*b0.x + 0.10404665*c0.x + 0.07233267*d0.x + 0.00033344718*e0.x + -0.11473831*f0.x + 0.007841103*g0.x + -0.09002325*h0.x + -0.014212253*i0.x; + j = 0.14563526*a0.y + -0.35928094*b0.y + 0.027741157*c0.y + -0.13243575*d0.y + 0.33321407*e0.y + -0.04980373*f0.y + -0.060561076*g0.y + -0.1198479*h0.y + 0.00798767*i0.y; + k = -0.06430791*a0.z + -0.11245109*b0.z + 0.009785175*c0.z + 0.110398166*d0.z + 0.11003975*e0.z + -0.0776389*f0.z + -0.028760761*g0.z + -0.23346215*h0.z + 0.06697744*i0.z; + l = 0.08202895*a0.w + -0.24874268*b0.w + -0.04023727*c0.w + 0.12763147*d0.w + -0.30607232*e0.w + 0.032928344*f0.w + 0.045949936*g0.w + -0.17675872*h0.w + 0.029689215*i0.w; + m = 0.13074832*a1.x + 0.08795887*b1.x + -0.08088709*c1.x + -0.15996866*d1.x + -0.13460127*e1.x + 0.07417794*f1.x + 0.06528235*g1.x + 0.05802189*h1.x + -0.016238518*i1.x; + n = -0.10472487*a1.y + -0.13672562*b1.y + -0.15355995*c1.y + 0.116645455*d1.y + 0.07894707*e1.y + 0.16333249*f1.y + -0.08795837*g1.y + 0.08170686*h1.y + -0.084028274*i1.y; + o = -0.06835426*a1.z + 0.04501379*b1.z + -0.13693433*c1.z + 0.05058851*d1.z + 0.24882804*e1.z + 0.24579862*f1.z + -0.07010665*g1.z + -0.08789114*h1.z + -0.076151535*i1.z; + p = 0.020215815*a1.w + 0.10511275*b1.w + 0.11385788*c1.w + 0.15657057*d1.w + 0.31428078*e1.w + -0.13243453*f1.w + 0.06416473*g1.w + 0.08187778*h1.w + -0.11577077*i1.w; + q = 0.015488034*na0.x + 0.040379517*nb0.x + -0.09120673*nc0.x + -0.014149155*nd0.x + 0.23621029*ne0.x + 0.14273776*nf0.x + -0.019648748*ng0.x + 0.0119334655*nh0.x + 0.018822623*ni0.x; + r = -0.014699327*na0.y + 0.09688736*nb0.y + 0.06137839*nc0.y + -0.12673396*nd0.y + -0.15387636*ne0.y + -0.013648953*nf0.y + 0.083632514*ng0.y + 0.1163354*nh0.y + -0.012966456*ni0.y; + s = -0.06854618*na0.z + -0.02779076*nb0.z + -0.04635937*nc0.z + -0.003767295*nd0.z + 0.20731288*ne0.z + 0.08137424*nf0.z + -0.039111614*ng0.z + 0.03876307*nh0.z + -0.18224968*ni0.z; + t = 0.06683969*na0.w + 0.07981624*nb0.w + 0.08222712*nc0.w + -0.13783932*nd0.w + -0.0445704*ne0.w + -0.018779598*nf0.w + 0.03472594*ng0.w + 0.16947825*nh0.w + 0.020174187*ni0.w; + u = -0.1262914*na1.x + -0.19105656*nb1.x + 0.12632288*nc1.x + 0.072970435*nd1.x + 0.24985978*ne1.x + -0.20835976*nf1.x + -0.030065924*ng1.x + -0.124369994*nh1.x + 0.011736978*ni1.x; + v = 0.10787027*na1.y + 0.1833925*nb1.y + 0.23094161*nc1.y + -0.088033065*nd1.y + -0.373916*ne1.y + -0.167832*nf1.y + 0.04991799*ng1.y + 0.04659217*nh1.y + -0.014462782*ni1.y; + w = 0.032293074*na1.z + -0.05536869*nb1.z + 0.13973999*nc1.z + -0.24594264*nd1.z + -0.303236*ne1.z + -0.1465525*nf1.z + 0.035377152*ng1.z + 0.1454314*nh1.z + 0.07324023*ni1.z; + x = -0.01987264*na1.w + -0.33423734*nb1.w + -0.021509413*nc1.w + -0.13169123*nd1.w + -0.30786726*ne1.w + -0.0486691*nf1.w + 0.0018869397*ng1.w + 0.118683584*nh1.w + 0.06499663*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.009061854; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN110 +//!BIND LUMAN111 +//!SAVE LUMAN120 + +#define L0_tex LUMAN110_tex +#define L1_tex LUMAN111_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.03630481*a0.x + 0.042853218*b0.x + -0.0062229345*c0.x + 0.08429192*d0.x + 0.13565867*e0.x + -0.018807288*f0.x + -0.11221368*g0.x + -0.10852543*h0.x + 0.009985365*i0.x; + float j = 0.14488101*a0.y + -0.1160535*b0.y + -0.13947323*c0.y + -0.018930992*d0.y + 0.16590987*e0.y + 0.18357886*f0.y + 0.032227106*g0.y + 0.080029584*h0.y + 0.044059783*i0.y; + float k = -0.029785704*a0.z + 0.0791055*b0.z + -0.085092425*c0.z + -0.118694134*d0.z + -0.2608379*e0.z + 0.056919962*f0.z + 0.039711855*g0.z + -0.010369595*h0.z + 0.00017742845*i0.z; + float l = -0.17972772*a0.w + -0.044206228*b0.w + -0.036466025*c0.w + 0.15869567*d0.w + 0.5135247*e0.w + 0.0132639455*f0.w + 0.087311976*g0.w + -0.06682728*h0.w + -0.047050804*i0.w; + float m = 0.0092488015*a1.x + 0.045739576*b1.x + -0.05253328*c1.x + 0.020989254*d1.x + -0.071142375*e1.x + 0.110861145*f1.x + -0.045121893*g1.x + -0.0890038*h1.x + -0.07344975*i1.x; + float n = -0.041313894*a1.y + 0.0865044*b1.y + -0.019986475*c1.y + -0.06508032*d1.y + -0.3258336*e1.y + -0.0133614205*f1.y + 0.08247431*g1.y + 0.12428612*h1.y + 0.009780545*i1.y; + float o = -0.04787042*a1.z + 0.07645056*b1.z + -0.052095477*c1.z + -0.107472844*d1.z + -0.18740825*e1.z + 0.023972819*f1.z + 0.0010516763*g1.z + -0.07725984*h1.z + -0.03339135*i1.z; + float p = -0.05169909*a1.w + 0.11179708*b1.w + 0.04700733*c1.w + 0.10380468*d1.w + -0.0051869787*e1.w + -0.024982737*f1.w + 0.19216102*g1.w + 0.13560702*h1.w + 0.023853956*i1.w; + float q = -0.032461137*na0.x + -0.29817888*nb0.x + 0.009580925*nc0.x + -0.19076568*nd0.x + -0.06736066*ne0.x + 0.075534545*nf0.x + 0.1596698*ng0.x + 0.27802217*nh0.x + -0.020082833*ni0.x; + float r = 0.04561214*na0.y + -0.2268211*nb0.y + -0.033104133*nc0.y + -0.18460363*nd0.y + 0.1687154*ne0.y + -0.203963*nf0.y + -0.0034705887*ng0.y + -0.054667573*nh0.y + 0.011704252*ni0.y; + float s = -0.0025704687*na0.z + -0.076398775*nb0.z + 0.07168415*nc0.z + 0.16773182*nd0.z + 0.12653217*ne0.z + -0.030956728*nf0.z + -0.06234241*ng0.z + 0.1002548*nh0.z + 0.015520437*ni0.z; + float t = -0.0015870314*na0.w + -0.013954021*nb0.w + 0.052499443*nc0.w + 0.06986832*nd0.w + -0.017726257*ne0.w + -0.06904766*nf0.w + -0.11802487*ng0.w + -0.15650262*nh0.w + -0.013071912*ni0.w; + float u = -0.050452612*na1.x + 0.10086934*nb1.x + 0.017438639*nc1.x + 0.07873438*nd1.x + -0.24193725*ne1.x + 0.017887043*nf1.x + 0.057130046*ng1.x + 0.12398589*nh1.x + -0.0051867655*ni1.x; + float v = 0.026148327*na1.y + -0.07549014*nb1.y + 0.007604178*nc1.y + 0.08956475*nd1.y + 0.29691312*ne1.y + 0.031737674*nf1.y + -0.08130795*ng1.y + -0.13281015*nh1.y + 0.0027009016*ni1.y; + float w = -0.038594443*na1.z + -0.09979849*nb1.z + 0.02744579*nc1.z + 0.111809075*nd1.z + 0.08823714*ne1.z + -0.009796724*nf1.z + -0.0020764987*ng1.z + 0.027102355*nh1.z + 0.014978432*ni1.z; + float x = -0.015462624*na1.w + -0.019302703*nb1.w + -0.010519787*nc1.w + 0.025670882*nd1.w + -0.27587906*ne1.w + -0.0023357677*nf1.w + -0.057278287*ng1.w + -0.17058408*nh1.w + -0.023692317*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0037216332; + i = 0.06428213*a0.x + -0.039442237*b0.x + -0.00015441276*c0.x + 0.27578467*d0.x + -0.20546672*e0.x + 0.051709026*f0.x + 0.091907986*g0.x + -0.20595479*h0.x + 0.05069401*i0.x; + j = -0.0015483696*a0.y + 0.084184326*b0.y + -0.082643285*c0.y + -0.020861834*d0.y + -0.09652075*e0.y + -0.0027274876*f0.y + -0.030430764*g0.y + 0.020421056*h0.y + 0.004766083*i0.y; + k = 0.003211529*a0.z + -0.10061028*b0.z + 0.0075153783*c0.z + 0.07965502*d0.z + 0.16045961*e0.z + 0.27895573*f0.z + 0.058805324*g0.z + -0.094317034*h0.z + -0.0026893024*i0.z; + l = -0.08095427*a0.w + 0.122727305*b0.w + -0.17080276*c0.w + 0.0702275*d0.w + -0.7364643*e0.w + 0.19323185*f0.w + -0.14044754*g0.w + 0.24313556*h0.w + -0.1266726*i0.w; + m = -0.023697993*a1.x + 0.0018436237*b1.x + 0.056907523*c1.x + 0.03974732*d1.x + -0.16493993*e1.x + 0.15792988*f1.x + 0.1423698*g1.x + -0.0062908884*h1.x + -0.06975383*i1.x; + n = 0.119774625*a1.y + -0.3077789*b1.y + 0.12898988*c1.y + 0.026241446*d1.y + -0.6198384*e1.y + -0.058987133*f1.y + 0.09120274*g1.y + -0.134381*h1.y + 0.043369815*i1.y; + o = 0.16480406*a1.z + 0.12151589*b1.z + 0.025838127*c1.z + 0.2519131*d1.z + 0.08198142*e1.z + 0.3078468*f1.z + -0.052510783*g1.z + 0.15783007*h1.z + -0.0039160047*i1.z; + p = 0.068643615*a1.w + -0.0060765394*b1.w + -0.15508175*c1.w + 0.20387188*d1.w + 0.1344372*e1.w + 0.2220656*f1.w + -0.29686332*g1.w + 0.10761737*h1.w + 0.08267347*i1.w; + q = -0.1427859*na0.x + 0.13410714*nb0.x + 0.006750742*nc0.x + -0.119788475*nd0.x + 0.34537068*ne0.x + -0.090779886*nf0.x + -0.13245101*ng0.x + 0.06902025*nh0.x + 0.070811994*ni0.x; + r = -0.023257682*na0.y + -0.48287916*nb0.y + -0.08024248*nc0.y + -0.23683101*nd0.y + -0.36748612*ne0.y + 0.09897269*nf0.y + 0.072566874*ng0.y + -0.06901731*nh0.y + -0.33572045*ni0.y; + s = -0.031415988*na0.z + 0.16148424*nb0.z + 0.011690278*nc0.z + -0.21647319*nd0.z + -0.15012386*ne0.z + -0.12023273*nf0.z + 0.07779024*ng0.z + 0.08440504*nh0.z + 0.009941279*ni0.z; + t = -0.013498529*na0.w + 0.07958699*nb0.w + -0.08360842*nc0.w + 0.05095159*nd0.w + 0.48715267*ne0.w + -0.052980598*nf0.w + 0.111399*ng0.w + -0.09430513*nh0.w + -0.11216889*ni0.w; + u = -0.0034462619*na1.x + -0.0815332*nb1.x + 0.047141153*nc1.x + 0.0968686*nd1.x + 0.006086954*ne1.x + -0.07627388*nf1.x + 0.016371105*ng1.x + 1.5434503e-05*nh1.x + -0.08802993*ni1.x; + v = -0.175829*na1.y + 0.08813627*nb1.y + 0.026431296*nc1.y + 0.05342739*nd1.y + 0.26712433*ne1.y + 0.0015671187*nf1.y + -0.009087923*ng1.y + 0.034405686*nh1.y + -0.014833625*ni1.y; + w = -0.094343*na1.z + -0.02134733*nb1.z + -0.12081456*nc1.z + 0.0008002904*nd1.z + -0.837031*ne1.z + -0.024695735*nf1.z + 0.05592583*ng1.z + 0.049783334*nh1.z + 0.070664614*ni1.z; + x = 0.02560576*na1.w + -0.0652353*nb1.w + -0.026176922*nc1.w + 0.027611544*nd1.w + 0.101991735*ne1.w + 0.16426045*nf1.w + -0.06456173*ng1.w + 0.04814978*nh1.w + -0.096576855*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.016174361; + i = 0.024099488*a0.x + -0.04376103*b0.x + -0.02405819*c0.x + 0.12269029*d0.x + -0.1942582*e0.x + 0.015290831*f0.x + -0.11447452*g0.x + -0.10286806*h0.x + 0.063465975*i0.x; + j = -0.006165612*a0.y + 0.036118105*b0.y + -0.08798518*c0.y + 0.047540434*d0.y + -0.09047972*e0.y + -0.022543581*f0.y + -0.09121134*g0.y + 0.07566583*h0.y + 0.13097523*i0.y; + k = -0.027949635*a0.z + 0.007452225*b0.z + 0.07362078*c0.z + -0.15921377*d0.z + 0.14054917*e0.z + -0.039097846*f0.z + -0.036522493*g0.z + -0.03235028*h0.z + -0.07254958*i0.z; + l = -0.06354746*a0.w + 0.0061436766*b0.w + 0.054778658*c0.w + 0.048113804*d0.w + 0.2520769*e0.w + 0.032121573*f0.w + 0.11395284*g0.w + 0.053529907*h0.w + -0.07020516*i0.w; + m = -0.004473757*a1.x + -0.03699893*b1.x + 0.049494844*c1.x + 0.10144713*d1.x + -0.10123659*e1.x + -0.055154715*f1.x + -0.005653055*g1.x + -0.110076346*h1.x + 0.024537917*i1.x; + n = -0.14722843*a1.y + 0.021588054*b1.y + -0.06555156*c1.y + -0.1452367*d1.y + 0.12776113*e1.y + -0.054516274*f1.y + 0.09456384*g1.y + -0.019024763*h1.y + -0.13002178*i1.y; + o = -0.15221575*a1.z + -0.03642865*b1.z + 0.09059142*c1.z + 0.010224373*d1.z + 0.03270087*e1.z + 0.04611254*f1.z + 0.14100742*g1.z + -0.12469271*h1.z + -0.07808319*i1.z; + p = -0.15530752*a1.w + -0.024299711*b1.w + 0.043005124*c1.w + -0.14870381*d1.w + -0.08807392*e1.w + -0.1681088*f1.w + 0.11866316*g1.w + 0.0023098018*h1.w + -0.11600331*i1.w; + q = -0.030142544*na0.x + -0.023051897*nb0.x + 0.00072538806*nc0.x + -0.1408511*nd0.x + 0.24454293*ne0.x + 0.053074066*nf0.x + 0.05282571*ng0.x + 0.08888112*nh0.x + -0.008027229*ni0.x; + r = -0.21948075*na0.y + -0.14563307*nb0.y + 0.045105882*nc0.y + 0.034859292*nd0.y + 0.0013962422*ne0.y + -0.14472541*nf0.y + 0.057272803*ng0.y + -0.2343438*nh0.y + 0.027103126*ni0.y; + s = 0.056929775*na0.z + -0.04044756*nb0.z + -0.021619841*nc0.z + 0.093900874*nd0.z + -0.0845011*ne0.z + 0.015461744*nf0.z + 0.10533744*ng0.z + -0.12869626*nh0.z + 0.029572072*ni0.z; + t = 0.054964267*na0.w + -0.052984565*nb0.w + -0.005397013*nc0.w + -0.0025362761*nd0.w + -0.11459516*ne0.w + -0.019547295*nf0.w + 0.033938434*ng0.w + -0.15661421*nh0.w + -0.005126746*ni0.w; + u = -0.09801664*na1.x + 0.03373932*nb1.x + -0.013610346*nc1.x + -0.097029574*nd1.x + -0.025516622*ne1.x + -0.007453025*nf1.x + 0.15229116*ng1.x + -0.051520813*nh1.x + -0.02699927*ni1.x; + v = 0.069439575*na1.y + 0.04628353*nb1.y + 0.0040131556*nc1.y + 0.02876258*nd1.y + -0.16168404*ne1.y + -0.019609036*nf1.y + -0.10225833*ng1.y + -0.0046634357*nh1.y + 0.01479129*ni1.y; + w = 0.1177245*na1.z + 0.058011517*nb1.z + -0.01947146*nc1.z + -0.09292472*nd1.z + 0.34092692*ne1.z + -0.015576386*nf1.z + 0.038489033*ng1.z + 0.3955167*nh1.z + 0.012101536*ni1.z; + x = 0.045038175*na1.w + -0.022596413*nb1.w + -0.03933641*nc1.w + 0.080800526*nd1.w + -0.02215942*ne1.w + -0.024267819*nf1.w + -0.035784304*ng1.w + -0.087287374*nh1.w + -0.02052485*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.00032290322; + i = 0.070857085*a0.x + -0.01668739*b0.x + -0.043324713*c0.x + -0.06547115*d0.x + 0.11349051*e0.x + -0.005361818*f0.x + -0.111147895*g0.x + 0.08678277*h0.x + -0.0183157*i0.x; + j = 0.11876117*a0.y + -0.2199258*b0.y + -0.1539111*c0.y + -0.28561905*d0.y + -0.11965133*e0.y + 0.111326285*f0.y + -0.025783801*g0.y + 0.040516805*h0.y + -0.06974189*i0.y; + k = 0.006097977*a0.z + -0.03751161*b0.z + -0.053452376*c0.z + -0.21998845*d0.z + -0.5963481*e0.z + 0.13975018*f0.z + 0.02308284*g0.z + 0.09210324*h0.z + 0.022642707*i0.z; + l = -0.06739223*a0.w + -0.2233416*b0.w + -0.020142328*c0.w + 0.015575219*d0.w + -0.13870761*e0.w + -0.019826427*f0.w + -0.024176579*g0.w + -0.021784797*h0.w + 0.010930772*i0.w; + m = -0.05648233*a1.x + 0.055072162*b1.x + -0.050247695*c1.x + 0.14057279*d1.x + -0.3961134*e1.x + 0.24045974*f1.x + 0.04301311*g1.x + 0.3693387*h1.x + -0.06275665*i1.x; + n = -0.08295624*a1.y + 0.064236194*b1.y + -0.10241233*c1.y + 0.050927226*d1.y + -0.383068*e1.y + -0.050085917*f1.y + 0.034017723*g1.y + 0.019846056*h1.y + -0.021734528*i1.y; + o = -0.00295437*a1.z + 0.13545579*b1.z + 0.06447699*c1.z + 0.07401292*d1.z + -0.33343366*e1.z + 0.013114421*f1.z + 0.022527028*g1.z + 0.024657745*h1.z + 0.0600506*i1.z; + p = -0.18444572*a1.w + 0.17483403*b1.w + 0.0592025*c1.w + 0.22725746*d1.w + -0.18361235*e1.w + 0.016755791*f1.w + -0.14157054*g1.w + 0.2188402*h1.w + 0.04028393*i1.w; + q = -0.06708157*na0.x + -0.12640335*nb0.x + 0.09772259*nc0.x + 0.059448905*nd0.x + -0.06731923*ne0.x + -0.0049867667*nf0.x + -0.040434554*ng0.x + 0.031092996*nh0.x + -0.031176891*ni0.x; + r = 0.07233832*na0.y + -0.08197527*nb0.y + 0.23841408*nc0.y + 0.21141063*nd0.y + -0.54487336*ne0.y + 0.043145727*nf0.y + 0.057069533*ng0.y + 0.046939872*nh0.y + -0.018745638*ni0.y; + s = 0.063471414*na0.z + 0.06705344*nb0.z + 0.06628736*nc0.z + 0.059250414*nd0.z + 0.47430512*ne0.z + 0.07250447*nf0.z + 0.06917669*ng0.z + 0.025787285*nh0.z + -0.0953519*ni0.z; + t = -0.05104128*na0.w + 0.010402208*nb0.w + 0.04540505*nc0.w + 0.124114424*nd0.w + 0.12031291*ne0.w + -0.04741522*nf0.w + 0.0006948206*ng0.w + 0.020641474*nh0.w + -0.054883998*ni0.w; + u = -0.04498074*na1.x + 0.15552297*nb1.x + 0.018448073*nc1.x + 0.15998206*nd1.x + -0.029625095*ne1.x + -0.06423182*nf1.x + -0.026536018*ng1.x + -0.12014951*nh1.x + -0.03999141*ni1.x; + v = -0.056055978*na1.y + -0.020384263*nb1.y + -0.040418874*nc1.y + -0.11311765*nd1.y + 0.075490616*ne1.y + 0.052754566*nf1.y + 0.06173458*ng1.y + -0.04975295*nh1.y + 0.02391373*ni1.y; + w = -0.004391017*na1.z + -0.19458464*nb1.z + -0.06401953*nc1.z + 0.09041939*nd1.z + 0.18180522*ne1.z + 0.06055868*nf1.z + -0.04002065*ng1.z + 0.01991273*nh1.z + -0.012687855*ni1.z; + x = -0.030503593*na1.w + -0.04218965*nb1.w + -0.029646637*nc1.w + 0.118616536*nd1.w + -0.20543875*ne1.w + 0.12086292*nf1.w + -0.16321474*ng1.w + 0.077902816*nh1.w + -0.10479198*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.009935257; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN110 +//!BIND LUMAN111 +//!SAVE LUMAN121 + +#define L0_tex LUMAN110_tex +#define L1_tex LUMAN111_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.016040666*a0.x + -0.079013824*b0.x + 0.012161549*c0.x + -0.18754423*d0.x + 0.10386809*e0.x + -0.05148479*f0.x + -0.021997137*g0.x + -0.08336444*h0.x + 0.067358404*i0.x; + float j = 0.10831344*a0.y + 0.044687204*b0.y + 0.020710824*c0.y + -0.058832403*d0.y + 0.40822786*e0.y + 0.041033354*f0.y + -0.094072744*g0.y + 0.114720725*h0.y + -0.10669224*i0.y; + float k = -0.0904427*a0.z + -0.11462908*b0.z + 0.12511547*c0.z + -0.109776616*d0.z + -0.7715242*e0.z + 0.24116163*f0.z + 0.061702237*g0.z + -0.33219382*h0.z + 0.014017773*i0.z; + float l = 0.05424565*a0.w + 0.032643985*b0.w + -0.019493097*c0.w + 0.27252126*d0.w + -0.27409044*e0.w + 0.20315622*f0.w + 0.10155818*g0.w + -0.06734094*h0.w + -0.052686546*i0.w; + float m = -0.10103298*a1.x + -0.086472794*b1.x + 0.071667865*c1.x + -0.1433287*d1.x + -0.17060891*e1.x + 0.30879197*f1.x + -0.028106824*g1.x + -0.10957076*h1.x + -0.14003031*i1.x; + float n = 0.037159156*a1.y + -0.09297984*b1.y + 0.10879765*c1.y + 0.4043785*d1.y + -0.011262256*e1.y + 0.16364406*f1.y + 0.060078543*g1.y + -0.06293068*h1.y + 0.005272298*i1.y; + float o = 0.05688141*a1.z + -0.036100924*b1.z + 0.020668587*c1.z + 0.21269542*d1.z + -0.8095734*e1.z + 0.030226132*f1.z + -0.006395501*g1.z + -0.085511655*h1.z + 0.06279881*i1.z; + float p = 0.07261218*a1.w + 0.02863619*b1.w + -0.16154937*c1.w + 0.19046474*d1.w + -0.47981185*e1.w + 0.22103396*f1.w + 0.14944506*g1.w + -0.51756424*h1.w + 0.04801966*i1.w; + float q = 0.053131744*na0.x + 0.10765578*nb0.x + -0.022114653*nc0.x + 0.36228356*nd0.x + -0.40098524*ne0.x + 0.028483007*nf0.x + -0.04952111*ng0.x + 0.0701001*nh0.x + -0.04002665*ni0.x; + float r = -0.21960498*na0.y + -0.5954419*nb0.y + 0.017739328*nc0.y + 0.17854628*nd0.y + -0.568993*ne0.y + 1.2022981e-05*nf0.y + -0.014976303*ng0.y + -0.14732927*nh0.y + -0.037275933*ni0.y; + float s = 0.013482193*na0.z + 0.2103902*nb0.z + -0.15309614*nc0.z + 0.020884098*nd0.z + 0.5714031*ne0.z + -0.07772716*nf0.z + -0.040384546*ng0.z + 0.23391339*nh0.z + -0.002278687*ni0.z; + float t = -0.1575747*na0.w + 0.082207*nb0.w + -0.054898545*nc0.w + -0.21570413*nd0.w + -0.12128415*ne0.w + -0.03145261*nf0.w + 0.027723502*ng0.w + -0.009790279*nh0.w + -0.024533553*ni0.w; + float u = 0.09017486*na1.x + 0.048559707*nb1.x + 0.050434425*nc1.x + 0.22550671*nd1.x + 0.057977412*ne1.x + -0.23715238*nf1.x + 0.1749362*ng1.x + -0.16195343*nh1.x + 0.044198424*ni1.x; + float v = -0.016162207*na1.y + 0.08958053*nb1.y + -0.039311912*nc1.y + -0.36521596*nd1.y + 0.00661652*ne1.y + -0.06413147*nf1.y + -0.034688678*ng1.y + 0.01979752*nh1.y + -0.062167786*ni1.y; + float w = -0.03062324*na1.z + -0.09115997*nb1.z + -0.14492631*nc1.z + 0.06484779*nd1.z + 0.28366563*ne1.z + 0.21266897*nf1.z + 0.17541467*ng1.z + 0.05103093*nh1.z + -0.111022934*ni1.z; + float x = -0.037943065*na1.w + 0.115353756*nb1.w + -0.029521808*nc1.w + -0.09523847*nd1.w + 0.18609662*ne1.w + -0.14930874*nf1.w + -0.13944234*ng1.w + 0.4082743*nh1.w + -0.06819748*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.017916761; + i = 0.078538805*a0.x + -0.014506211*b0.x + 0.007213099*c0.x + 0.23117511*d0.x + 0.5029679*e0.x + -0.024810337*f0.x + -0.11901346*g0.x + 0.37581027*h0.x + 0.04474014*i0.x; + j = -0.24559873*a0.y + -0.031275712*b0.y + -0.027128898*c0.y + -0.27093834*d0.y + 0.30001357*e0.y + 0.29637352*f0.y + -0.0680391*g0.y + -0.2771114*h0.y + -0.19408922*i0.y; + k = 0.14039402*a0.z + -0.068264335*b0.z + -0.01212566*c0.z + -0.21079351*d0.z + 0.055527776*e0.z + 0.07600091*f0.z + 0.030332029*g0.z + 0.020096777*h0.z + -0.0050814818*i0.z; + l = -0.009181755*a0.w + 0.12588453*b0.w + -0.0070843413*c0.w + -0.14150868*d0.w + 0.2352925*e0.w + 0.18276747*f0.w + -0.1489265*g0.w + -0.17832929*h0.w + 0.110232346*i0.w; + m = -0.11440625*a1.x + 0.08030438*b1.x + -0.05019389*c1.x + 0.055185206*d1.x + -0.1997354*e1.x + 0.06907418*f1.x + -0.030523853*g1.x + -0.028598374*h1.x + 0.00402331*i1.x; + n = -0.01400436*a1.y + -0.24602963*b1.y + -0.02763552*c1.y + 0.09377703*d1.y + 0.46817556*e1.y + 0.0045891483*f1.y + -0.022928033*g1.y + -0.18903275*h1.y + -0.057461683*i1.y; + o = 5.8573256e-05*a1.z + -0.11550677*b1.z + -0.021250665*c1.z + 0.12628284*d1.z + 0.100589834*e1.z + -0.043524556*f1.z + -0.010048345*g1.z + -0.015392035*h1.z + -0.027857235*i1.z; + p = -0.13938811*a1.w + -0.21711211*b1.w + -0.058005977*c1.w + 0.23330635*d1.w + 0.4241299*e1.w + 0.269014*f1.w + -0.024776803*g1.w + -0.47112796*h1.w + -0.3242568*i1.w; + q = -0.006770948*na0.x + 0.35251966*nb0.x + -0.025183031*nc0.x + 0.06321988*nd0.x + -0.41219017*ne0.x + 0.15581898*nf0.x + -0.004353107*ng0.x + -0.51320714*nh0.x + -0.012421451*ni0.x; + r = 0.053276803*na0.y + 0.209102*nb0.y + -0.25939527*nc0.y + 0.2583048*nd0.y + -0.034931976*ne0.y + -0.16499095*nf0.y + 0.013150661*ng0.y + 0.06966307*nh0.y + 0.2715032*ni0.y; + s = 0.034249242*na0.z + 0.1393413*nb0.z + 0.027955504*nc0.z + 0.014944762*nd0.z + -0.27539375*ne0.z + 0.059065677*nf0.z + 0.12535436*ng0.z + 0.0002367743*nh0.z + -0.03134692*ni0.z; + t = 0.09574407*na0.w + -0.15512376*nb0.w + -0.1326283*nc0.w + 0.14824554*nd0.w + -0.48301983*ne0.w + -0.23208317*nf0.w + 0.04110218*ng0.w + 0.37239522*nh0.w + 0.054267284*ni0.w; + u = -0.0373547*na1.x + -0.02183789*nb1.x + 0.09611865*nc1.x + 0.15454161*nd1.x + 0.15370527*ne1.x + -0.27192718*nf1.x + 0.037774384*ng1.x + -0.16705795*nh1.x + 0.06983236*ni1.x; + v = -0.07095513*na1.y + 0.24687336*nb1.y + 0.0107697025*nc1.y + -0.0119912075*nd1.y + -0.5358361*ne1.y + 0.006414817*nf1.y + -0.00023970919*ng1.y + 0.17173849*nh1.y + 0.036765322*ni1.y; + w = -0.085393295*na1.z + 0.1269853*nb1.z + -0.13470225*nc1.z + -0.01905929*nd1.z + -0.21131584*ne1.z + 0.24164923*nf1.z + -0.10498182*ng1.z + 0.23248348*nh1.z + -0.11942628*ni1.z; + x = -0.06611594*na1.w + -0.22679096*nb1.w + 0.07775526*nc1.w + 0.04741113*nd1.w + -0.16081128*ne1.w + -0.015265322*nf1.w + -0.1981768*ng1.w + 0.121538855*nh1.w + -0.040517036*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0011177635; + i = 0.02273682*a0.x + -0.088348575*b0.x + -0.08505771*c0.x + 0.11942239*d0.x + 0.030293586*e0.x + -0.036713593*f0.x + -0.07345445*g0.x + 0.013857765*h0.x + 0.0212622*i0.x; + j = 0.0007158205*a0.y + -0.18034282*b0.y + -0.1834693*c0.y + 0.07001304*d0.y + 0.052562915*e0.y + -0.13766013*f0.y + -0.026889255*g0.y + -0.13756591*h0.y + 0.0137952035*i0.y; + k = 0.064204454*a0.z + 0.047363076*b0.z + -0.10146915*c0.z + -0.036393903*d0.z + 0.32186893*e0.z + 0.03890354*f0.z + -0.11350703*g0.z + 0.17804417*h0.z + -0.018982997*i0.z; + l = -0.25930753*a0.w + -0.18717201*b0.w + 0.0046631163*c0.w + -0.16714166*d0.w + 0.19198583*e0.w + -0.13205843*f0.w + -0.043268327*g0.w + -0.1133368*h0.w + -0.019991325*i0.w; + m = 0.046559814*a1.x + -0.036047865*b1.x + -0.124785714*c1.x + 0.19851595*d1.x + 0.13792649*e1.x + 0.29890996*f1.x + 0.07801649*g1.x + 0.3574968*h1.x + -0.051048357*i1.x; + n = -0.22643399*a1.y + 0.09982359*b1.y + -0.25325596*c1.y + -0.30298874*d1.y + -0.019899191*e1.y + -0.17703082*f1.y + -0.06602016*g1.y + 0.11570044*h1.y + -0.12564936*i1.y; + o = -0.1295181*a1.z + 0.28571597*b1.z + 0.2268508*c1.z + -0.024426803*d1.z + 0.34369537*e1.z + -0.03543822*f1.z + 0.05623628*g1.z + 0.15945889*h1.z + 0.1357874*i1.z; + p = -0.38786048*a1.w + 0.021101061*b1.w + 0.08719239*c1.w + -0.42795762*d1.w + -0.78074217*e1.w + -0.25849733*f1.w + 0.02313279*g1.w + 0.31115445*h1.w + -0.071271494*i1.w; + q = -0.14247255*na0.x + -0.10166665*nb0.x + 0.103710435*nc0.x + -0.24971257*nd0.x + 0.10551559*ne0.x + -0.00049025*nf0.x + 0.006096725*ng0.x + 0.16235337*nh0.x + -0.04087*ni0.x; + r = 0.086958386*na0.y + 0.10708686*nb0.y + 0.3118142*nc0.y + 0.07566404*nd0.y + 0.17142205*ne0.y + 0.22888596*nf0.y + 0.0071828454*ng0.y + 0.08257271*nh0.y + 0.15891534*ni0.y; + s = 0.05018579*na0.z + -0.07106771*nb0.z + 0.12580445*nc0.z + 0.060565155*nd0.z + -0.61150587*ne0.z + 0.14322163*nf0.z + 0.17771058*ng0.z + 0.04116199*nh0.z + -0.081307195*ni0.z; + t = 0.10838823*na0.w + -0.03343494*nb0.w + 0.048816755*nc0.w + 0.13234074*nd0.w + 0.10686867*ne0.w + 0.09964101*nf0.w + 0.08175459*ng0.w + -0.06954629*nh0.w + -0.029273745*ni0.w; + u = -0.20302375*na1.x + 0.08947134*nb1.x + 0.03863508*nc1.x + -0.25542068*nd1.x + -0.09526631*ne1.x + -0.15511604*nf1.x + -0.018706609*ng1.x + 0.05693273*nh1.x + -0.04958124*ni1.x; + v = 0.08167861*na1.y + 0.024107322*nb1.y + -0.017528*nc1.y + 0.12498806*nd1.y + -0.026749128*ne1.y + 0.04120715*nf1.y + 0.04201204*ng1.y + -0.07951507*nh1.y + 0.042167943*ni1.y; + w = 0.12541983*na1.z + -0.18357356*nb1.z + -0.13145879*nc1.z + -0.11632926*nd1.z + -0.09411829*ne1.z + -0.01572608*nf1.z + -0.0408734*ng1.z + 0.0049628583*nh1.z + -0.098303616*ni1.z; + x = 0.12511753*na1.w + -0.05077767*nb1.w + -0.03821508*nc1.w + 0.24773093*nd1.w + -0.35870612*ne1.w + 0.2990459*nf1.w + 0.09982773*ng1.w + -0.20098032*nh1.w + 0.05284909*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0033040443; + i = -0.06944622*a0.x + -0.10423638*b0.x + 0.069951385*c0.x + 0.23499304*d0.x + -0.6945679*e0.x + 0.2103992*f0.x + 0.08824105*g0.x + -0.113604896*h0.x + -0.050930798*i0.x; + j = -0.022496594*a0.y + 0.2566942*b0.y + -0.2720837*c0.y + 0.04151481*d0.y + 0.615091*e0.y + 0.031925738*f0.y + -0.01268215*g0.y + 0.13197616*h0.y + 0.057147793*i0.y; + k = 0.023931816*a0.z + -0.060358107*b0.z + 0.13954204*c0.z + -0.00084565545*d0.z + 0.16548394*e0.z + -0.14032264*f0.z + -0.024453849*g0.z + -0.08643635*h0.z + 0.01871022*i0.z; + l = 0.13153385*a0.w + -0.025538351*b0.w + -0.07633621*c0.w + -0.077443674*d0.w + 0.18425244*e0.w + -0.27681804*f0.w + -0.03891747*g0.w + 0.1728622*h0.w + 0.014027938*i0.w; + m = -0.01709888*a1.x + -0.007245669*b1.x + -0.03169653*c1.x + -0.013408079*d1.x + -0.06904381*e1.x + -0.13671531*f1.x + 0.013620854*g1.x + -0.028004795*h1.x + 0.012526964*i1.x; + n = 0.0021771193*a1.y + 0.008561536*b1.y + 0.097160086*c1.y + 0.14685316*d1.y + 0.087293826*e1.y + -0.15369013*f1.y + 0.0627115*g1.y + 0.05304755*h1.y + 0.067732826*i1.y; + o = 0.032449223*a1.z + 0.22557947*b1.z + 0.1398121*c1.z + 0.10890622*d1.z + -0.25275087*e1.z + -0.010474938*f1.z + 0.0049850484*g1.z + -0.0447395*h1.z + -0.05385253*i1.z; + p = -0.0591078*a1.w + 0.3782494*b1.w + 0.15983337*c1.w + 0.0970239*d1.w + 0.69504625*e1.w + -0.008993506*f1.w + -0.13960648*g1.w + -0.09371603*h1.w + 0.1152446*i1.w; + q = 0.05103658*na0.x + 0.17705862*nb0.x + -0.07009867*nc0.x + -0.04754582*nd0.x + 0.5219954*ne0.x + -0.1565835*nf0.x + -0.0675379*ng0.x + 0.103392586*nh0.x + 0.04235708*ni0.x; + r = -0.23430078*na0.y + -0.64712304*nb0.y + 0.12920478*nc0.y + -0.054820143*nd0.y + -0.97405654*ne0.y + -0.30315155*nf0.y + -0.016655972*ng0.y + -0.03896125*nh0.y + -0.173349*ni0.y; + s = 0.05556909*na0.z + 0.053752027*nb0.z + -0.036756348*nc0.z + -0.0490644*nd0.z + 0.071526386*ne0.z + 0.068898395*nf0.z + -0.01937113*ng0.z + -0.0062772087*nh0.z + 0.0061466885*ni0.z; + t = -0.045044784*na0.w + -0.18968368*nb0.w + 0.16444425*nc0.w + -0.035680916*nd0.w + -0.4223159*ne0.w + 0.16560689*nf0.w + 0.04517244*ng0.w + -0.14496626*nh0.w + -0.032995377*ni0.w; + u = -0.06689851*na1.x + 0.13716511*nb1.x + 0.005473301*nc1.x + 0.0002938986*nd1.x + 0.18790975*ne1.x + 0.08589993*nf1.x + -0.04463413*ng1.x + -0.056907386*nh1.x + 0.061555363*ni1.x; + v = -0.0131601775*na1.y + 0.0031908813*nb1.y + -0.13029572*nc1.y + -0.0044121663*nd1.y + 0.033651654*ne1.y + 0.0380712*nf1.y + 0.009084121*ng1.y + -0.04157535*nh1.y + -0.097756535*ni1.y; + w = -0.04474378*na1.z + -0.3508171*nb1.z + 0.021858547*nc1.z + -0.028869407*nd1.z + 0.24122404*ne1.z + -0.06238071*nf1.z + 0.022699818*ng1.z + 0.08334816*nh1.z + 0.100933604*ni1.z; + x = 0.009949947*na1.w + -0.110267356*nb1.w + 0.028339155*nc1.w + 0.019174134*nd1.w + -0.24451639*ne1.w + -0.04752991*nf1.w + 0.055869248*ng1.w + -0.019406948*nh1.w + -0.10016147*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.013138915; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN120 +//!BIND LUMAN121 +//!SAVE LUMAN130 + +#define L0_tex LUMAN120_tex +#define L1_tex LUMAN121_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = 0.0720364*a0.x + 0.053900342*b0.x + -0.21529675*c0.x + -0.12641624*d0.x + 0.30030486*e0.x + 0.551456*f0.x + 0.27861387*g0.x + -0.2737028*h0.x + -0.13878943*i0.x; + float j = -0.02189806*a0.y + 0.1282205*b0.y + -0.051351424*c0.y + -0.057394408*d0.y + -0.26498213*e0.y + 0.083696656*f0.y + 0.07437768*g0.y + -0.035797276*h0.y + 0.0072549833*i0.y; + float k = 0.3213268*a0.z + -0.101973765*b0.z + 0.5751187*c0.z + 0.02748092*d0.z + 0.20441727*e0.z + -0.32831758*f0.z + 0.006279489*g0.z + 0.1129889*h0.z + -0.07455723*i0.z; + float l = -0.20170602*a0.w + -0.029677728*b0.w + 0.21061352*c0.w + -0.03956498*d0.w + 1.1667198*e0.w + -0.35484713*f0.w + 0.13235599*g0.w + 0.279684*h0.w + -0.0017781351*i0.w; + float m = 0.11718651*a1.x + -0.5752775*b1.x + -0.020617453*c1.x + 0.06882931*d1.x + 0.7212933*e1.x + 0.08547659*f1.x + -0.17777194*g1.x + -0.021172713*h1.x + -0.0023153338*i1.x; + float n = -0.01634213*a1.y + 0.036722466*b1.y + 0.06310859*c1.y + 0.29112598*d1.y + -0.86670053*e1.y + 0.47648278*f1.y + 0.04528508*g1.y + 0.055748977*h1.y + -0.2048171*i1.y; + float o = -0.19556583*a1.z + 0.36164042*b1.z + -0.09667081*c1.z + 0.21346582*d1.z + -0.4927472*e1.z + 0.12774333*f1.z + 0.010652053*g1.z + -0.038168952*h1.z + -0.03643873*i1.z; + float p = 0.10009163*a1.w + 0.038237605*b1.w + -0.20403148*c1.w + -0.020671103*d1.w + -0.38168794*e1.w + 0.17990908*f1.w + -0.051244512*g1.w + 0.084622525*h1.w + -0.027635513*i1.w; + float q = -0.10643615*na0.x + 0.25769755*nb0.x + -0.03955322*nc0.x + -0.042580277*nd0.x + -0.08685573*ne0.x + 0.05128617*nf0.x + -0.024551174*ng0.x + -0.1028651*nh0.x + -0.030856699*ni0.x; + float r = -0.0027716025*na0.y + 0.07249121*nb0.y + -0.13051115*nc0.y + -0.20297952*nd0.y + -0.41265818*ne0.y + -0.26338387*nf0.y + 0.015494835*ng0.y + 0.17138383*nh0.y + -0.041941557*ni0.y; + float s = -0.05208767*na0.z + 0.19243212*nb0.z + 0.03244124*nc0.z + 0.05880827*nd0.z + 0.049452126*ne0.z + -0.036401723*nf0.z + 0.060772587*ng0.z + -0.020842567*nh0.z + 0.03108091*ni0.z; + float t = 0.060901362*na0.w + -0.076049685*nb0.w + -0.048797954*nc0.w + -0.09112989*nd0.w + -0.19524314*ne0.w + -0.1572243*nf0.w + 0.10201878*ng0.w + -0.16085689*nh0.w + -0.04018849*ni0.w; + float u = -0.19130763*na1.x + 0.08725573*nb1.x + 0.029222598*nc1.x + 0.18555334*nd1.x + 0.022093318*ne1.x + -0.02745416*nf1.x + -0.105766304*ng1.x + 0.12067458*nh1.x + -0.04069638*ni1.x; + float v = -0.029775381*na1.y + 0.032387253*nb1.y + 0.03466246*nc1.y + 0.02369626*nd1.y + -0.16729066*ne1.y + -0.020458123*nf1.y + -0.01582285*ng1.y + -0.07273139*nh1.y + 0.040606122*ni1.y; + float w = 0.06475696*na1.z + -0.16653204*nb1.z + -0.0077233436*nc1.z + 0.10893418*nd1.z + 0.65086246*ne1.z + -0.098068416*nf1.z + -0.0773279*ng1.z + 0.089927696*nh1.z + -0.02523359*ni1.z; + float x = -0.12416535*na1.w + -0.09939505*nb1.w + 0.055258464*nc1.w + 0.07517963*nd1.w + 0.7682969*ne1.w + -0.16346167*nf1.w + -0.116884045*ng1.w + -0.19306831*nh1.w + 0.21045157*ni1.w; + float o0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.014230527; + i = 0.042195965*a0.x + 0.06986607*b0.x + -0.24697801*c0.x + 0.04542666*d0.x + 0.27491724*e0.x + 0.10283969*f0.x + -0.108544946*g0.x + 0.09708539*h0.x + 0.076082796*i0.x; + j = -0.011562874*a0.y + -0.023208117*b0.y + -0.026359199*c0.y + 0.055193163*d0.y + 0.3459738*e0.y + 0.011495178*f0.y + -0.0134636685*g0.y + -0.03179513*h0.y + -0.042669583*i0.y; + k = -0.21953447*a0.z + -0.04466294*b0.z + -0.020435272*c0.z + -0.025197655*d0.z + 0.21284917*e0.z + -0.36867225*f0.z + 0.029473593*g0.z + 0.069737464*h0.z + -0.2412335*i0.z; + l = -0.0886459*a0.w + 4.3053482e-05*b0.w + 0.11051342*c0.w + 0.018638419*d0.w + -0.24568723*e0.w + 0.17777503*f0.w + 0.06575594*g0.w + 0.25569072*h0.w + -0.101264775*i0.w; + m = 0.04524546*a1.x + -0.4179094*b1.x + 0.24467756*c1.x + 0.22226599*d1.x + -0.7805491*e1.x + 0.055788055*f1.x + 0.23372273*g1.x + -0.5262877*h1.x + -0.017132355*i1.x; + n = -0.04794995*a1.y + 0.1435481*b1.y + -0.087677024*c1.y + 0.15902305*d1.y + -0.1106174*e1.y + 0.15267508*f1.y + -0.05356673*g1.y + 0.027613819*h1.y + -0.008245554*i1.y; + o = 0.04367896*a1.z + -0.1107194*b1.z + 0.053921375*c1.z + 0.017062154*d1.z + -0.022771189*e1.z + 0.1649813*f1.z + 0.0182314*g1.z + -0.18771137*h1.z + 0.12790245*i1.z; + p = -0.12690932*a1.w + 0.25788826*b1.w + -0.10910936*c1.w + 0.22243069*d1.w + 0.1625307*e1.w + 0.15770349*f1.w + -0.042958364*g1.w + -0.09920023*h1.w + 0.13091087*i1.w; + q = 0.10414487*na0.x + -0.17305346*nb0.x + -0.06085659*nc0.x + 0.065868944*nd0.x + -0.09042784*ne0.x + 0.204011*nf0.x + -0.024687342*ng0.x + -0.059094653*nh0.x + 0.04609744*ni0.x; + r = -0.056715347*na0.y + 0.057856467*nb0.y + 0.024845932*nc0.y + -0.08401126*nd0.y + -0.14726245*ne0.y + -0.025106642*nf0.y + 0.020385504*ng0.y + 0.082516894*nh0.y + 0.028151123*ni0.y; + s = -0.20315938*na0.z + 0.362484*nb0.z + 0.014427934*nc0.z + -0.027487164*nd0.z + 0.08667763*ne0.z + 0.04351746*nf0.z + -0.004871366*ng0.z + -0.046117496*nh0.z + -0.037482645*ni0.z; + t = 0.043089945*na0.w + 0.047222134*nb0.w + 0.0950088*nc0.w + 0.16747418*nd0.w + -0.10982015*ne0.w + 0.15402111*nf0.w + -0.1335398*ng0.w + -0.11832875*nh0.w + 0.026953021*ni0.w; + u = 0.00231662*na1.x + -0.12017328*nb1.x + -0.04228793*nc1.x + 0.02145167*nd1.x + 0.5365495*ne1.x + 0.0565665*nf1.x + 0.13905151*ng1.x + 0.06894558*nh1.x + -0.02964981*ni1.x; + v = -0.09530613*na1.y + 0.04113546*nb1.y + -0.024054382*nc1.y + 0.058662873*nd1.y + 0.20826623*ne1.y + -0.10249503*nf1.y + -0.01461215*ng1.y + -0.02553676*nh1.y + -0.049127422*ni1.y; + w = 0.08890218*na1.z + -0.24309717*nb1.z + -0.056736678*nc1.z + 0.025733534*nd1.z + -0.30327016*ne1.z + -0.14851654*nf1.z + 0.035958145*ng1.z + -0.20333517*nh1.z + 0.12468914*ni1.z; + x = -0.011648334*na1.w + 0.07754441*nb1.w + -0.013317935*nc1.w + 0.14822938*nd1.w + -0.5553622*ne1.w + -0.051771417*nf1.w + 0.05677903*ng1.w + -0.4363098*nh1.w + 0.21202224*ni1.w; + float p0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.02925727; + i = -0.05948352*a0.x + -0.06827033*b0.x + -0.05872591*c0.x + -0.16184679*d0.x + -0.32632825*e0.x + 0.13031824*f0.x + -0.06273351*g0.x + 0.0751629*h0.x + -0.018216845*i0.x; + j = -0.0031350395*a0.y + -0.1708727*b0.y + 0.013089089*c0.y + 0.05907608*d0.y + 0.31262067*e0.y + -0.073811896*f0.y + -0.07709014*g0.y + 0.1276176*h0.y + 0.0058660284*i0.y; + k = -0.24557771*a0.z + 0.16375028*b0.z + -0.22536363*c0.z + 0.07369996*d0.z + -0.057278607*e0.z + -0.39154586*f0.z + -0.04884829*g0.z + -0.1366349*h0.z + 0.24759868*i0.z; + l = 0.10663502*a0.w + -0.12446211*b0.w + 0.1506388*c0.w + -0.01982975*d0.w + 0.20480362*e0.w + -0.41742992*f0.w + 0.049913086*g0.w + -0.1817123*h0.w + 0.22587766*i0.w; + m = -0.061524637*a1.x + 0.022391686*b1.x + 0.038758367*c1.x + 0.00053620304*d1.x + -0.5066745*e1.x + 0.18239973*f1.x + -0.09501334*g1.x + 0.20157869*h1.x + -0.13881125*i1.x; + n = -0.12882727*a1.y + 0.20879474*b1.y + -0.00059160107*c1.y + -0.014318971*d1.y + -0.5696044*e1.y + -0.35852292*f1.y + -0.03647296*g1.y + -0.06009444*h1.y + 0.15110119*i1.y; + o = 0.12342001*a1.z + -0.18652305*b1.z + -0.0014908996*c1.z + -0.10899112*d1.z + -0.017930519*e1.z + 0.18477388*f1.z + -0.13977689*g1.z + 0.070096254*h1.z + -0.03545615*i1.z; + p = -0.086738124*a1.w + 0.15161462*b1.w + 0.10906371*c1.w + 0.2625266*d1.w + -0.269705*e1.w + 0.025931107*f1.w + -0.11208182*g1.w + 0.08186576*h1.w + -0.07676666*i1.w; + q = 0.09199121*na0.x + -0.27253303*nb0.x + 0.0879107*nc0.x + -0.02903099*nd0.x + 0.18778248*ne0.x + -0.03874832*nf0.x + 0.11142419*ng0.x + -0.023944143*nh0.x + 0.0322812*ni0.x; + r = -0.05937444*na0.y + 0.11862651*nb0.y + 0.07161282*nc0.y + 0.25135022*nd0.y + -0.88968176*ne0.y + 0.118918404*nf0.y + -0.01776999*ng0.y + -0.327005*nh0.y + 0.05625477*ni0.y; + s = 0.055206*na0.z + 0.12737331*nb0.z + -0.03233187*nc0.z + 0.023461618*nd0.z + -0.55450785*ne0.z + 0.100796655*nf0.z + -0.050018337*ng0.z + -0.0022815724*nh0.z + -0.014608387*ni0.z; + t = -0.0479968*na0.w + 0.24388584*nb0.w + -0.1321874*nc0.w + -0.07816068*nd0.w + -0.18306968*ne0.w + 0.39243156*nf0.w + -0.07366988*ng0.w + 0.06475454*nh0.w + -0.06459748*ni0.w; + u = 0.15943104*na1.x + -0.1733297*nb1.x + 0.05210581*nc1.x + -0.11547031*nd1.x + 0.4288051*ne1.x + -0.20570897*nf1.x + 0.058616944*ng1.x + -0.06744855*nh1.x + 0.10000475*ni1.x; + v = -0.006472779*na1.y + -0.0043406556*nb1.y + 0.013603341*nc1.y + 0.061792597*nd1.y + 0.16454408*ne1.y + -0.016365727*nf1.y + 0.030575326*ng1.y + 0.021532707*nh1.y + -0.0021026765*ni1.y; + w = -0.041022096*na1.z + -0.09020705*nb1.z + 0.09366692*nc1.z + 0.029392594*nd1.z + -0.29391944*ne1.z + -0.37208745*nf1.z + -0.047162127*ng1.z + 0.024105158*nh1.z + 0.13907216*ni1.z; + x = 0.048761297*na1.w + 0.02027834*nb1.w + -0.011769053*nc1.w + 0.13861202*nd1.w + -0.93677044*ne1.w + 0.13267428*nf1.w + -0.0030979784*ng1.w + 0.3423763*nh1.w + -0.06951905*ni1.w; + float q0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.005624808; + i = 0.13118735*a0.x + 0.07113565*b0.x + 0.16039217*c0.x + -0.40914395*d0.x + -1.1901436*e0.x + -0.80681556*f0.x + 0.17610377*g0.x + 0.29843616*h0.x + 0.020422373*i0.x; + j = -0.049343202*a0.y + -0.0517756*b0.y + 0.050104957*c0.y + -0.014763915*d0.y + 0.4998198*e0.y + 0.096728146*f0.y + -0.051926754*g0.y + 0.011204003*h0.y + -0.042198427*i0.y; + k = -0.08628184*a0.z + 0.06601232*b0.z + -0.107486784*c0.z + 0.05744938*d0.z + 0.1578089*e0.z + -0.051302865*f0.z + -0.08990291*g0.z + -0.09367884*h0.z + -0.07134853*i0.z; + l = -0.02123226*a0.w + 0.13681176*b0.w + 0.046004575*c0.w + -0.021490892*d0.w + -0.35558495*e0.w + 0.6628715*f0.w + 0.08220385*g0.w + -0.04994965*h0.w + 0.005171286*i0.w; + m = 0.07417716*a1.x + 0.14565495*b1.x + -0.0264066*c1.x + 0.032688186*d1.x + 0.12341635*e1.x + 0.018151537*f1.x + -0.18696725*g1.x + 0.33744487*h1.x + 0.061498195*i1.x; + n = -0.24309224*a1.y + -0.17748205*b1.y + 0.016042624*c1.y + 0.112358056*d1.y + -0.24729848*e1.y + 0.03562591*f1.y + 0.017833492*g1.y + -0.17484981*h1.y + -0.25359344*i1.y; + o = 0.043698203*a1.z + 0.04489889*b1.z + -0.073181756*c1.z + 0.11985575*d1.z + 0.22422*e1.z + -0.12087687*f1.z + -0.22577973*g1.z + 0.09884975*h1.z + 0.063056536*i1.z; + p = -0.124570355*a1.w + 0.093162924*b1.w + 0.14458434*c1.w + 0.37257236*d1.w + -0.069118515*e1.w + -0.5091309*f1.w + -0.18350491*g1.w + -0.2106979*h1.w + 0.18569984*i1.w; + q = -0.065402165*na0.x + -0.009163924*nb0.x + 0.18047854*nc0.x + -0.040900815*nd0.x + 0.6451143*ne0.x + 0.13821948*nf0.x + 0.14300165*ng0.x + 0.18637063*nh0.x + -0.15026084*ni0.x; + r = -0.11006149*na0.y + 0.108389065*nb0.y + -0.05199778*nc0.y + 0.16926324*nd0.y + -0.25438145*ne0.y + -0.015659789*nf0.y + -0.01217484*ng0.y + -0.011138012*nh0.y + -0.06696381*ni0.y; + s = 0.010872508*na0.z + 0.13563438*nb0.z + -0.055016384*nc0.z + 0.060038235*nd0.z + -0.20824054*ne0.z + 0.049065523*nf0.z + 0.017672228*ng0.z + -0.057060678*nh0.z + 0.016657824*ni0.z; + t = 0.024448738*na0.w + 0.21845391*nb0.w + -0.1874952*nc0.w + -0.12823004*nd0.w + 0.0062414245*ne0.w + -0.13627508*nf0.w + 0.005506856*ng0.w + 0.20545638*nh0.w + 0.017150477*ni0.w; + u = 0.0687205*na1.x + -0.08278135*nb1.x + 0.005573482*nc1.x + -0.10245802*nd1.x + 0.13818142*ne1.x + 0.1382157*nf1.x + -0.05744559*ng1.x + -0.008268709*nh1.x + -0.01924858*ni1.x; + v = -0.088420264*na1.y + 0.013855669*nb1.y + -0.00802846*nc1.y + 0.037918523*nd1.y + 0.44768977*ne1.y + 0.08474023*nf1.y + 0.06538366*ng1.y + 0.08541458*nh1.y + 0.016029092*ni1.y; + w = -0.040740877*na1.z + -0.097147815*nb1.z + -0.01924434*nc1.z + 0.049527176*nd1.z + 0.008897777*ne1.z + 0.1514258*nf1.z + -0.097710766*ng1.z + -0.14009525*nh1.z + -0.0010996665*ni1.z; + x = -0.04477202*na1.w + 0.0044697854*nb1.w + -0.015193141*nc1.w + 0.26928583*nd1.w + 0.20772855*ne1.w + 0.0049727107*nf1.w + -0.09731218*ng1.w + 0.05057508*nh1.w + 0.17789689*ni1.w; + float r0 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.018371338; + return vec4(o0, p0, q0, r0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-4x3x3x16 +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN120 +//!BIND LUMAN121 +//!SAVE LUMAN131 + +#define L0_tex LUMAN120_tex +#define L1_tex LUMAN121_tex + +vec4 hook() { + vec2 dp = HOOKED_pt; + + vec4 a0 = L0_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b0 = L0_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c0 = L0_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d0 = L0_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e0 = L0_tex(HOOKED_pos + vec2(0, 0)); + vec4 f0 = L0_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g0 = L0_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h0 = L0_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i0 = L0_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na0 = -min(a0, 0); + vec4 nb0 = -min(b0, 0); + vec4 nc0 = -min(c0, 0); + vec4 nd0 = -min(d0, 0); + vec4 ne0 = -min(e0, 0); + vec4 nf0 = -min(f0, 0); + vec4 ng0 = -min(g0, 0); + vec4 nh0 = -min(h0, 0); + vec4 ni0 = -min(i0, 0); + + a0 = max(a0, 0); + b0 = max(b0, 0); + c0 = max(c0, 0); + d0 = max(d0, 0); + e0 = max(e0, 0); + f0 = max(f0, 0); + g0 = max(g0, 0); + h0 = max(h0, 0); + i0 = max(i0, 0); + + vec4 a1 = L1_tex(HOOKED_pos + vec2(-dp.x, -dp.y)); + vec4 b1 = L1_tex(HOOKED_pos + vec2(-dp.x, 0)); + vec4 c1 = L1_tex(HOOKED_pos + vec2(-dp.x, dp.y)); + vec4 d1 = L1_tex(HOOKED_pos + vec2(0, -dp.y)); + vec4 e1 = L1_tex(HOOKED_pos + vec2(0, 0)); + vec4 f1 = L1_tex(HOOKED_pos + vec2(0, dp.y)); + vec4 g1 = L1_tex(HOOKED_pos + vec2(dp.x, -dp.y)); + vec4 h1 = L1_tex(HOOKED_pos + vec2(dp.x, 0)); + vec4 i1 = L1_tex(HOOKED_pos + vec2(dp.x, dp.y)); + + vec4 na1 = -min(a1, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng1 = -min(g1, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni1 = -min(i1, 0); + + a1 = max(a1, 0); + b1 = max(b1, 0); + c1 = max(c1, 0); + d1 = max(d1, 0); + e1 = max(e1, 0); + f1 = max(f1, 0); + g1 = max(g1, 0); + h1 = max(h1, 0); + i1 = max(i1, 0); + float i = -0.00244338*a0.x + 0.11307278*b0.x + 0.12787521*c0.x + -0.2943862*d0.x + -0.2921561*e0.x + 0.008935062*f0.x + 0.06479446*g0.x + 0.13043961*h0.x + -0.1714768*i0.x; + float j = 0.013158007*a0.y + 0.0006180399*b0.y + 0.02082021*c0.y + -0.0055130427*d0.y + -0.35134313*e0.y + 0.015023051*f0.y + 0.074687675*g0.y + 0.0017952712*h0.y + 0.008813734*i0.y; + float k = 0.36869514*a0.z + -0.3975647*b0.z + 0.09764463*c0.z + -0.35800827*d0.z + 0.41010195*e0.z + -0.5792003*f0.z + 0.15331651*g0.z + -0.36079472*h0.z + 0.49991408*i0.z; + float l = -0.11267275*a0.w + 0.2564035*b0.w + -0.3156238*c0.w + 0.03255897*d0.w + -0.046007052*e0.w + 0.20846844*f0.w + 0.045643665*g0.w + -0.101280876*h0.w + 0.13227348*i0.w; + float m = 0.104666136*a1.x + -0.44706202*b1.x + -0.120112754*c1.x + 0.33853054*d1.x + -0.3021414*e1.x + 0.05516387*f1.x + -0.22213428*g1.x + -0.1561559*h1.x + -0.049735755*i1.x; + float n = -0.24272442*a1.y + 0.22630493*b1.y + -0.14520976*c1.y + 0.39483866*d1.y + -0.5144888*e1.y + 0.19356416*f1.y + -0.10334906*g1.y + 0.17973821*h1.y + -0.11484032*i1.y; + float o = -0.09583847*a1.z + -0.1129651*b1.z + 0.012596975*c1.z + 0.08921078*d1.z + -0.10718446*e1.z + -0.059247594*f1.z + -0.26023668*g1.z + 0.2826532*h1.z + 0.010967167*i1.z; + float p = -0.13766983*a1.w + -0.104451194*b1.w + 0.16943164*c1.w + 0.35144225*d1.w + -0.19897774*e1.w + -0.16400898*f1.w + -0.3423532*g1.w + 0.07869511*h1.w + 0.030806515*i1.w; + float q = -0.006596797*na0.x + -0.059110187*nb0.x + 0.002848751*nc0.x + 0.17357026*nd0.x + -0.14421764*ne0.x + -0.06304003*nf0.x + 0.13224718*ng0.x + -0.023200989*nh0.x + -0.12691686*ni0.x; + float r = 0.11914472*na0.y + -0.19565365*nb0.y + -0.000771549*nc0.y + -0.25671166*nd0.y + 0.20033528*ne0.y + 0.0735273*nf0.y + 0.13748841*ng0.y + -0.37766397*nh0.y + 0.12674737*ni0.y; + float s = -0.1831876*na0.z + 0.066708036*nb0.z + 0.10256126*nc0.z + 0.15450269*nd0.z + -0.20681731*ne0.z + -0.015312072*nf0.z + 0.043404207*ng0.z + -0.19648848*nh0.z + 0.01756101*ni0.z; + float t = 0.015516292*na0.w + 0.033659857*nb0.w + 0.11546558*nc0.w + 0.009801586*nd0.w + -0.17479457*ne0.w + 0.0348424*nf0.w + -0.013284617*ng0.w + 0.105703555*nh0.w + -0.04040842*ni0.w; + float u = 0.044866323*na1.x + 0.037231002*nb1.x + -0.117976025*nc1.x + 0.0068701687*nd1.x + 0.10561169*ne1.x + 0.084872715*nf1.x + 0.0064239427*ng1.x + -0.03047784*nh1.x + 0.029405242*ni1.x; + float v = -0.07337999*na1.y + -0.06394039*nb1.y + -0.046697747*nc1.y + 0.036859673*nd1.y + 0.13936268*ne1.y + -0.075560674*nf1.y + -0.15364087*ng1.y + -0.18054913*nh1.y + 0.11931447*ni1.y; + float w = -0.05103358*na1.z + 0.08348278*nb1.z + -0.28102404*nc1.z + -0.21405233*nd1.z + -0.54452616*ne1.z + 0.25575173*nf1.z + -0.30355924*ng1.z + -0.1978982*nh1.z + -0.094412416*ni1.z; + float x = -0.016140953*na1.w + 0.09675898*nb1.w + 0.14103526*nc1.w + 0.23741934*nd1.w + 0.63036114*ne1.w + -0.07908827*nf1.w + -0.17087603*ng1.w + 0.33402947*nh1.w + 0.056142833*ni1.w; + float o1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.0011128266; + i = 0.16161652*a0.x + 0.12943652*b0.x + -0.13306782*c0.x + 0.2013924*d0.x + -0.57761663*e0.x + -0.12975514*f0.x + 0.055114973*g0.x + -0.13329576*h0.x + -0.018094175*i0.x; + j = -0.030814277*a0.y + 0.08002339*b0.y + -0.005033146*c0.y + -0.02831855*d0.y + -0.5265581*e0.y + 0.019913586*f0.y + 0.03260515*g0.y + 0.011793753*h0.y + -0.041797128*i0.y; + k = -0.25511903*a0.z + 0.25464353*b0.z + 0.21382432*c0.z + 0.11112703*d0.z + 0.16102943*e0.z + 0.1905486*f0.z + -0.00034825585*g0.z + 0.14595897*h0.z + -0.4637904*i0.z; + l = -0.08947852*a0.w + 0.07941216*b0.w + 0.20093243*c0.w + 0.092082925*d0.w + -0.21647456*e0.w + 0.12925042*f0.w + -0.01412983*g0.w + 0.24494526*h0.w + -0.183682*i0.w; + m = 0.13686138*a1.x + 0.02519254*b1.x + 0.06689273*c1.x + -0.011823985*d1.x + 0.258628*e1.x + 0.007803134*f1.x + 0.19866021*g1.x + -0.25535232*h1.x + 0.119317554*i1.x; + n = 0.0047901995*a1.y + -0.13939868*b1.y + 0.060697857*c1.y + 0.14214286*d1.y + -0.21600221*e1.y + 0.14889002*f1.y + 0.06126688*g1.y + -0.07895497*h1.y + -0.119672194*i1.y; + o = -0.0138838105*a1.z + 0.12933673*b1.z + -0.03332595*c1.z + 0.07831325*d1.z + -0.059107892*e1.z + 0.005517338*f1.z + 0.2374747*g1.z + -0.30386606*h1.z + 0.04849136*i1.z; + p = -0.09577165*a1.w + 0.23200892*b1.w + -0.17583735*c1.w + 0.017538643*d1.w + 0.06286067*e1.w + -0.012105216*f1.w + 0.19660373*g1.w + -0.17324452*h1.w + 0.2364622*i1.w; + q = -0.06426943*na0.x + 0.04773957*nb0.x + 0.0773234*nc0.x + -0.09523922*nd0.x + 0.13199873*ne0.x + -0.025846584*nf0.x + -0.20022635*ng0.x + 0.061152507*nh0.x + 0.088116445*ni0.x; + r = -0.11550139*na0.y + 0.25616938*nb0.y + -0.097736865*nc0.y + -0.13098818*nd0.y + 0.89877933*ne0.y + -0.12454773*nf0.y + -0.06655521*ng0.y + 0.3536072*nh0.y + -0.14577657*ni0.y; + s = -0.051433016*na0.z + 0.19780602*nb0.z + -0.14342086*nc0.z + -0.13246888*nd0.z + 0.4712179*ne0.z + -0.0760168*nf0.z + -0.04112054*ng0.z + 0.079995714*nh0.z + -0.058594123*ni0.z; + t = 0.0016922381*na0.w + 0.00911373*nb0.w + -0.07531611*nc0.w + 0.04930686*nd0.w + -0.1493241*ne0.w + -0.12848157*nf0.w + 0.08809475*ng0.w + -0.121985435*nh0.w + -0.03775289*ni0.w; + u = -0.07355293*na1.x + -0.039990127*nb1.x + 0.047119513*nc1.x + -0.03806374*nd1.x + -0.4200097*ne1.x + 0.09158625*nf1.x + 0.0069479328*ng1.x + 0.0620529*nh1.x + -0.08495328*ni1.x; + v = -0.075022444*na1.y + -0.0073552867*nb1.y + 0.03055895*nc1.y + 0.009506485*nd1.y + -0.1973273*ne1.y + 0.027589366*nf1.y + 0.012759572*ng1.y + 0.07665317*nh1.y + -0.098346196*ni1.y; + w = 0.16676155*na1.z + -0.14621955*nb1.z + 0.024160169*nc1.z + 0.23157723*nd1.z + -0.19967304*ne1.z + 0.12788779*nf1.z + 0.09393534*ng1.z + 0.01697747*nh1.z + 0.041690193*ni1.z; + x = -0.080800764*na1.w + -0.030657865*nb1.w + -0.02087746*nc1.w + 0.12705413*nd1.w + -0.20709507*ne1.w + 0.028442968*nf1.w + 0.12675458*ng1.w + -0.5194139*nh1.w + 0.030896883*ni1.w; + float p1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+0.021323992; + i = -0.08442577*a0.x + -0.16754927*b0.x + -0.03041835*c0.x + 0.16821916*d0.x + -0.18141311*e0.x + 0.25875506*f0.x + -0.18979077*g0.x + -0.17813158*h0.x + 0.07395593*i0.x; + j = 0.018562902*a0.y + -0.048745874*b0.y + -0.0027680758*c0.y + 0.045562364*d0.y + 0.2797026*e0.y + -0.07017949*f0.y + -0.08035512*g0.y + 0.023879478*h0.y + 0.057773773*i0.y; + k = -0.09978134*a0.z + 0.20431131*b0.z + 0.0063662054*c0.z + 0.053208336*d0.z + 0.32056963*e0.z + -0.017122522*f0.z + -0.093939885*g0.z + 0.10500729*h0.z + -0.06635838*i0.z; + l = 0.120458245*a0.w + -0.1402537*b0.w + 0.019860635*c0.w + 0.046299618*d0.w + 0.06872489*e0.w + -0.0447052*f0.w + -0.122726254*g0.w + -0.018221956*h0.w + 0.00511015*i0.w; + m = -0.14980844*a1.x + 0.13525958*b1.x + 0.22277893*c1.x + 0.13094072*d1.x + 0.37916073*e1.x + 0.14051563*f1.x + 0.2966822*g1.x + 0.14121437*h1.x + -0.0024877277*i1.x; + n = 0.16860826*a1.y + 0.07913927*b1.y + 0.026983129*c1.y + -0.28781673*d1.y + -0.74781907*e1.y + -0.2333515*f1.y + -0.025983952*g1.y + -0.06339631*h1.y + 0.17988972*i1.y; + o = 0.094248205*a1.z + 0.09552581*b1.z + -0.10647933*c1.z + -0.15245505*d1.z + 0.18795626*e1.z + 0.056246266*f1.z + 0.022347486*g1.z + -0.032658946*h1.z + -0.06520757*i1.z; + p = 0.07874395*a1.w + 0.008490275*b1.w + -0.077739514*c1.w + -0.33134314*d1.w + -0.17488837*e1.w + 0.17983681*f1.w + 0.16872159*g1.w + -0.033116516*h1.w + -0.31637248*i1.w; + q = -0.02984741*na0.x + -0.033106074*nb0.x + -0.074626714*nc0.x + 0.05186759*nd0.x + 0.4411205*ne0.x + 0.19929363*nf0.x + -0.058961373*ng0.x + 0.101995006*nh0.x + 0.10353861*ni0.x; + r = -0.009323741*na0.y + -0.058106888*nb0.y + -0.017135192*nc0.y + 0.059093058*nd0.y + -0.102931276*ne0.y + -0.06872296*nf0.y + -0.06365373*ng0.y + -0.077900395*nh0.y + -0.03728999*ni0.y; + s = 0.12995155*na0.z + 0.01138708*nb0.z + -0.036738325*nc0.z + -0.10337543*nd0.z + -0.038482923*ne0.z + -0.013563022*nf0.z + -0.025379518*ng0.z + 0.042860765*nh0.z + 0.03405761*ni0.z; + t = 0.005264784*na0.w + 0.09006554*nb0.w + -0.12094439*nc0.w + -0.009473829*nd0.w + 0.20297761*ne0.w + 0.011412984*nf0.w + -0.03707713*ng0.w + 0.0050331065*nh0.w + 0.060511*ni0.w; + u = -0.014951561*na1.x + -0.13426088*nb1.x + 0.12397659*nc1.x + 0.011123405*nd1.x + 0.0801173*ne1.x + -0.14290653*nf1.x + -0.0031461562*ng1.x + -0.03238526*nh1.x + 0.022475414*ni1.x; + v = 0.11766882*na1.y + 0.059661616*nb1.y + 0.011924227*nc1.y + -0.056074142*nd1.y + 0.27363485*ne1.y + -0.011868344*nf1.y + 0.078302376*ng1.y + 0.13220052*nh1.y + 0.009441565*ni1.y; + w = 0.001944502*na1.z + -0.0788648*nb1.z + 0.31860432*nc1.z + -0.10753583*nd1.z + -0.68318206*ne1.z + -0.31693053*nf1.z + 0.18960947*ng1.z + 0.2173563*nh1.z + 0.085332215*ni1.z; + x = 0.130883*na1.w + 0.003096905*nb1.w + -0.053123176*nc1.w + -0.13724625*nd1.w + 0.09753227*ne1.w + 0.1972498*nf1.w + 0.117141895*ng1.w + 0.22924557*nh1.w + -0.032398295*ni1.w; + float q1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.0017100481; + i = -0.2086925*a0.x + -0.0054902593*b0.x + 0.008958661*c0.x + 0.42889228*d0.x + -0.12530953*e0.x + 0.077938266*f0.x + -0.7147147*g0.x + -0.5884967*h0.x + -0.5328939*i0.x; + j = 0.048498508*a0.y + 0.10627258*b0.y + 0.07233314*c0.y + 0.10546068*d0.y + -0.06300838*e0.y + -0.24016523*f0.y + 0.24212515*g0.y + 0.10866001*h0.y + 0.102079205*i0.y; + k = 0.09554628*a0.z + -0.47269112*b0.z + 0.6283155*c0.z + -1.0036635*d0.z + 0.374161*e0.z + -0.6817927*f0.z + 0.45258063*g0.z + -0.678372*h0.z + 0.32231042*i0.z; + l = -0.076917365*a0.w + 0.6876095*b0.w + -0.8204501*c0.w + 0.50143707*d0.w + -0.74970007*e0.w + 0.51672864*f0.w + -0.28516588*g0.w + -0.00871703*h0.w + 0.06765322*i0.w; + m = 0.23171157*a1.x + -0.06027903*b1.x + 0.173762*c1.x + 0.6158802*d1.x + 0.3154452*e1.x + 0.45508003*f1.x + 0.9706311*g1.x + -1.6833194*h1.x + 0.113559*i1.x; + n = -0.034078702*a1.y + 0.9735393*b1.y + -0.31849742*c1.y + 0.7111899*d1.y + -0.75236*e1.y + 0.27595088*f1.y + -0.2722964*g1.y + 1.0745589*h1.y + 0.26156154*i1.y; + o = 0.05916842*a1.z + -0.533813*b1.z + -0.12367357*c1.z + -0.40096056*d1.z + 0.042316306*e1.z + -0.15953232*f1.z + 0.25937524*g1.z + -0.0830802*h1.z + -0.024787977*i1.z; + p = -0.35923687*a1.w + -0.12255826*b1.w + 0.0049088905*c1.w + -0.14611141*d1.w + -0.25195587*e1.w + 0.049888752*f1.w + 0.13142404*g1.w + 0.02036451*h1.w + -0.032000273*i1.w; + q = -0.052361045*na0.x + -0.169529*nb0.x + -0.22907723*nc0.x + 0.5950341*nd0.x + -0.55356836*ne0.x + -0.32379588*nf0.x + -0.47245145*ng0.x + 0.17733522*nh0.x + 0.1722754*ni0.x; + r = 0.36969483*na0.y + -0.42018405*nb0.y + -0.14842306*nc0.y + -1.371239*nd0.y + 0.40536565*ne0.y + -0.0020769117*nf0.y + 0.10199822*ng0.y + -0.5455371*nh0.y + 0.024899451*ni0.y; + s = -0.33689135*na0.z + -0.28642964*nb0.z + -0.1993493*nc0.z + -0.27277672*nd0.z + -0.043820284*ne0.z + -0.47440007*nf0.z + -0.08644334*ng0.z + -0.34078324*nh0.z + -0.072105184*ni0.z; + t = -0.009965928*na0.w + -0.3160174*nb0.w + 0.27566355*nc0.w + 0.29919168*nd0.w + 0.029478045*ne0.w + 0.04593068*nf0.w + 0.021061787*ng0.w + -0.13073102*nh0.w + -0.20637748*ni0.w; + u = 0.09760966*na1.x + 0.0013239577*nb1.x + -0.047888342*nc1.x + -0.12741305*nd1.x + 0.114507146*ne1.x + 0.04859413*nf1.x + 0.17341557*ng1.x + -0.036477488*nh1.x + 0.025525432*ni1.x; + v = 0.012610979*na1.y + -0.20527816*nb1.y + -0.030312076*nc1.y + -0.075593516*nd1.y + -0.15593761*ne1.y + -0.19141406*nf1.y + -0.38559288*ng1.y + -0.19755952*nh1.y + 0.019317854*ni1.y; + w = 0.28485414*na1.z + 0.5175772*nb1.z + -0.12245438*nc1.z + -0.2878212*nd1.z + 0.19877273*ne1.z + 0.66879386*nf1.z + -0.20288914*ng1.z + 0.06298292*nh1.z + -0.10582869*ni1.z; + x = 0.015750764*na1.w + 0.40560052*nb1.w + 0.29314628*nc1.w + 0.3076136*nd1.w + -0.4744141*ne1.w + 0.5406656*nf1.w + 0.47665957*ng1.w + -0.21204963*nh1.w + -0.4425803*ni1.w; + float r1 = i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+-0.36796984; + return vec4(o1, p1, q1, r1); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-Reduce +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN10 +//!BIND LUMAN11 +//!BIND LUMAN20 +//!BIND LUMAN21 +//!BIND LUMAN30 +//!BIND LUMAN31 +//!BIND LUMAN40 +//!BIND LUMAN41 +//!BIND LUMAN50 +//!BIND LUMAN51 +//!BIND LUMAN60 +//!BIND LUMAN61 +//!BIND LUMAN70 +//!BIND LUMAN71 +//!SAVE LUMAN0 + +vec4 hook() { + vec4 a0 = LUMAN10_tex(HOOKED_pos); + vec4 a1 = LUMAN11_tex(HOOKED_pos); + vec4 b0 = LUMAN20_tex(HOOKED_pos); + vec4 b1 = LUMAN21_tex(HOOKED_pos); + vec4 c0 = LUMAN30_tex(HOOKED_pos); + vec4 c1 = LUMAN31_tex(HOOKED_pos); + vec4 d0 = LUMAN40_tex(HOOKED_pos); + vec4 d1 = LUMAN41_tex(HOOKED_pos); + vec4 e0 = LUMAN50_tex(HOOKED_pos); + vec4 e1 = LUMAN51_tex(HOOKED_pos); + vec4 f0 = LUMAN60_tex(HOOKED_pos); + vec4 f1 = LUMAN61_tex(HOOKED_pos); + vec4 g0 = LUMAN70_tex(HOOKED_pos); + vec4 g1 = LUMAN71_tex(HOOKED_pos); + vec4 na0 = -min(a0, 0); + vec4 na1 = -min(a1, 0); + vec4 nb0 = -min(b0, 0); + vec4 nb1 = -min(b1, 0); + vec4 nc0 = -min(c0, 0); + vec4 nc1 = -min(c1, 0); + vec4 nd0 = -min(d0, 0); + vec4 nd1 = -min(d1, 0); + vec4 ne0 = -min(e0, 0); + vec4 ne1 = -min(e1, 0); + vec4 nf0 = -min(f0, 0); + vec4 nf1 = -min(f1, 0); + vec4 ng0 = -min(g0, 0); + vec4 ng1 = -min(g1, 0); + a0 = max(a0, 0); + a1 = max(a1, 0); + b0 = max(b0, 0); + b1 = max(b1, 0); + c0 = max(c0, 0); + c1 = max(c1, 0); + d0 = max(d0, 0); + d1 = max(d1, 0); + e0 = max(e0, 0); + e1 = max(e1, 0); + f0 = max(f0, 0); + f1 = max(f1, 0); + g0 = max(g0, 0); + g1 = max(g1, 0); + float o = -0.049245942*a0.x + -0.023370795*a0.y + -7.225961e-05*a0.z + 0.0019568612*a0.w + -0.00049920427*a1.x + -0.010696693*a1.y + -0.004388618*a1.z + 0.022109183*a1.w + 0.008315857*na0.x + 0.0069180024*na0.y + -0.007631315*na0.z + -0.007783451*na0.w + -0.0075604366*na1.x + 0.026377324*na1.y + -0.0029770704*na1.z + 0.011379547*na1.w + -0.0050308816*b0.x + -0.033095017*b0.y + 0.0063684434*b0.z + -0.020444078*b0.w + -0.00080785167*b1.x + -0.015184868*b1.y + 0.020060046*b1.z + -0.008944791*b1.w + 0.013595589*nb0.x + 0.061495364*nb0.y + 0.012803664*nb0.z + 0.019761315*nb0.w + 0.0051377523*nb1.x + 0.0017010213*nb1.y + -0.027974507*nb1.z + 0.008423463*nb1.w + 0.0024215514*c0.x + -0.006051995*c0.y + -0.00015901314*c0.z + 0.027880907*c0.w + 0.009972766*c1.x + -0.0074346033*c1.y + -0.0036655844*c1.z + -0.0062128934*c1.w + -0.00037509945*nc0.x + 0.01976033*nc0.y + 0.005408765*nc0.z + -0.018663349*nc0.w + -0.014102515*nc1.x + 0.012015511*nc1.y + 0.008370724*nc1.z + 0.023661008*nc1.w + -0.00367092*d0.x + 0.012974275*d0.y + 0.0073438482*d0.z + -0.0015102059*d0.w + 0.022306425*d1.x + -0.0013535774*d1.y + -0.0024372635*d1.z + 0.0016232622*d1.w + 0.010132437*nd0.x + -0.00309114*nd0.y + -0.011687519*nd0.z + -0.0048595825*nd0.w + -0.019726558*nd1.x + -0.0021050463*nd1.y + 0.0018076926*nd1.z + -0.0023482873*nd1.w + -0.024257407*e0.x + 0.029996531*e0.y + -0.0022063444*e0.z + -0.0003799291*e0.w + -0.030580392*e1.x + -0.011823871*e1.y + 0.00317984*e1.z + -0.0034969174*e1.w + 0.014147132*ne0.x + 0.0004943756*ne0.y + -0.011309435*ne0.z + 0.015305287*ne0.w + -0.011446511*ne1.x + 0.04074529*ne1.y + -0.01560624*ne1.z + -0.0014475479*ne1.w + 0.0049414146*f0.x + -0.0055082254*f0.y + 0.0031141897*f0.z + 0.0041451626*f0.w + -0.010021149*f1.x + 0.003212007*f1.y + 0.025077049*f1.z + 0.015682345*f1.w + -0.009822955*nf0.x + -0.006624521*nf0.y + -0.008527181*nf0.z + 0.021705732*nf0.w + 0.022870867*nf1.x + 0.0025929692*nf1.y + -0.0042776894*nf1.z + -0.014903406*nf1.w + -0.0028529165*g0.x + -0.008448063*g0.y + 0.0038560058*g0.z + 0.0027421543*g0.w + -0.0074425405*g1.x + -0.01334431*g1.y + -0.010088023*g1.z + -0.055267867*g1.w + -0.0031185371*ng0.x + 0.006812255*ng0.y + 0.012340063*ng0.z + 0.00865805*ng0.w + -0.022648849*ng1.x + 0.053120937*ng1.y + 0.008478949*ng1.z + 0.0018696731*ng1.w + 0; + float p = -0.017464954*a0.x + -0.062101785*a0.y + 0.0072054444*a0.z + 0.0092836935*a0.w + 0.030784087*a1.x + -0.0009286972*a1.y + -0.025769833*a1.z + 0.0029487966*a1.w + 0.011547049*na0.x + 0.038597062*na0.y + -0.0055242833*na0.z + -0.014001495*na0.w + -0.004512439*na1.x + -0.0015175719*na1.y + 0.031619832*na1.z + 0.010452482*na1.w + -0.011093101*b0.x + -0.026935358*b0.y + 0.010374769*b0.z + -0.011456625*b0.w + -0.012582297*b1.x + -0.0039999993*b1.y + 0.008492968*b1.z + 0.0036855722*b1.w + 0.032127716*nb0.x + 0.032859474*nb0.y + -0.00094432937*nb0.z + 0.0121680675*nb0.w + 0.008618216*nb1.x + 0.020981947*nb1.y + -0.008120534*nb1.z + -0.009373491*nb1.w + -0.032179736*c0.x + -0.0020254073*c0.y + -0.015011599*c0.z + 0.019616578*c0.w + 0.008940445*c1.x + -0.0009415161*c1.y + -0.0045905844*c1.z + -0.0006653611*c1.w + 0.021794854*nc0.x + 0.015203587*nc0.y + 0.0048818532*nc0.z + -0.0049212994*nc0.w + -0.008172868*nc1.x + -0.00083788636*nc1.y + -0.002970197*nc1.z + 0.014330884*nc1.w + -0.022657929*d0.x + 0.0047842865*d0.y + -0.004193357*d0.z + -0.005666559*d0.w + 0.036750663*d1.x + 0.0012512826*d1.y + 0.0049374495*d1.z + -0.0039908453*d1.w + -0.0017866646*nd0.x + -0.004390495*nd0.y + -0.0028988542*nd0.z + 0.0032729157*nd0.w + -0.009221632*nd1.x + -0.006040727*nd1.y + 0.0049432437*nd1.z + 0.0003587606*nd1.w + -0.024484716*e0.x + -0.0030389426*e0.y + 0.0056222766*e0.z + 0.011582306*e0.w + 0.028530948*e1.x + -0.03800588*e1.y + -9.8310156e-05*e1.z + -0.002393195*e1.w + 0.0018349448*ne0.x + 0.0049751736*ne0.y + -0.0015016596*ne0.z + 0.0057502403*ne0.w + 0.01291333*ne1.x + -0.043678798*ne1.y + -0.01860552*ne1.z + 0.0075467303*ne1.w + -0.0067772456*f0.x + -0.0141757745*f0.y + -0.007010874*f0.z + 0.008192591*f0.w + -0.009293183*f1.x + -0.0022445754*f1.y + -0.0038566703*f1.z + -0.011925102*f1.w + 0.0045418083*nf0.x + 0.00095765846*nf0.y + -0.01474841*nf0.z + 0.01208856*nf0.w + 0.013340873*nf1.x + -0.011797794*nf1.y + -0.0035833723*nf1.z + 0.009597474*nf1.w + 0.022398442*g0.x + 0.008746581*g0.y + -0.0002473681*g0.z + 0.0032298858*g0.w + -0.011354966*g1.x + 0.003285763*g1.y + 0.014755322*g1.z + 0.019556405*g1.w + -0.0148762*ng0.x + -0.004329214*ng0.y + 0.015337845*ng0.z + 0.03924461*ng0.w + 0.037563473*ng1.x + -0.06123901*ng1.y + -0.004094344*ng1.z + -0.004294583*ng1.w + 0; + float q = 0.0018004067*a0.x + -0.026203306*a0.y + -0.00039891893*a0.z + 0.010159007*a0.w + -0.03651082*a1.x + -0.007902821*a1.y + -0.007732508*a1.z + 0.027953705*a1.w + -0.002475687*na0.x + 0.008221053*na0.y + -0.005450067*na0.z + -0.011696027*na0.w + 0.0026707612*na1.x + 0.0019173208*na1.y + -0.008400457*na1.z + -0.008031958*na1.w + 0.035621405*b0.x + -0.0073195556*b0.y + -0.003661516*b0.z + -0.019455852*b0.w + -0.026372172*b1.x + 0.013939379*b1.y + 0.0082747955*b1.z + -0.0022468078*b1.w + -0.011789901*nb0.x + 0.0015583938*nb0.y + 0.0013948897*nb0.z + 0.019545833*nb0.w + 0.013844493*nb1.x + 0.012033381*nb1.y + -0.017193947*nb1.z + -0.016286712*nb1.w + 0.0006176892*c0.x + 0.0013999133*c0.y + -0.018609513*c0.z + 0.019960135*c0.w + 0.010915818*c1.x + 0.001732765*c1.y + -0.008637271*c1.z + -0.0027007023*c1.w + 0.015978742*nc0.x + 0.006627152*nc0.y + 0.045912735*nc0.z + -0.004495457*nc0.w + -0.010189089*nc1.x + 0.0023047698*nc1.y + 0.011235966*nc1.z + -0.05359617*nc1.w + -0.0002535656*d0.x + -0.0074861352*d0.y + 0.0072714468*d0.z + 0.016833195*d0.w + 0.022890443*d1.x + -0.009765689*d1.y + 0.009508351*d1.z + 0.0062339636*d1.w + -0.012663426*nd0.x + -0.005541378*nd0.y + -0.011128237*nd0.z + -0.022598132*nd0.w + -0.014917645*nd1.x + 0.011874683*nd1.y + -0.008611195*nd1.z + -0.01414024*nd1.w + 0.013602081*e0.x + 0.0031817604*e0.y + -0.004745976*e0.z + -0.007916127*e0.w + 0.041977737*e1.x + 0.007487502*e1.y + 0.014730856*e1.z + -0.0007972412*e1.w + 0.007999292*ne0.x + 0.0016938462*ne0.y + -0.017985921*ne0.z + 0.0017458921*ne0.w + -0.0006560395*ne1.x + -0.006504917*ne1.y + -0.016750248*ne1.z + 0.0015032388*ne1.w + 0.005011853*f0.x + -0.031059701*f0.y + 0.01985983*f0.z + 0.0015322289*f0.w + -0.0007681325*f1.x + -0.008150405*f1.y + 0.022249863*f1.z + 0.017525308*f1.w + -0.008532365*nf0.x + -0.028016925*nf0.y + -0.0025936463*nf0.z + 0.009671558*nf0.w + -0.010893107*nf1.x + -0.009454452*nf1.y + -0.0044735065*nf1.z + 0.002920707*nf1.w + -0.011938847*g0.x + 0.0061559035*g0.y + 0.003996976*g0.z + -0.01185357*g0.w + -0.012531663*g1.x + 0.020186577*g1.y + -0.019036353*g1.z + -0.016737767*g1.w + 0.017701386*ng0.x + 0.012132338*ng0.y + 0.012208775*ng0.z + 0.029298969*ng0.w + -0.0061062295*ng1.x + 0.0284989*ng1.y + -0.014577586*ng1.z + 0.013448756*ng1.w + 0; + float r = -0.002185117*a0.x + -0.04247913*a0.y + 0.004220362*a0.z + 0.0076788394*a0.w + 0.0035369084*a1.x + 0.008566372*a1.y + -0.006938411*a1.z + 0.011668423*a1.w + 0.014652536*na0.x + 0.032199837*na0.y + -0.008722521*na0.z + -0.011981545*na0.w + -0.02009355*na1.x + 0.0014413322*na1.y + 0.019279627*na1.z + 0.004017313*na1.w + 0.037228394*b0.x + -0.009032077*b0.y + 0.0065939324*b0.z + -0.01897076*b0.w + -0.0244419*b1.x + 0.024367949*b1.y + 0.0075981435*b1.z + -0.005133444*b1.w + -0.021923918*nb0.x + 0.0018044459*nb0.y + -0.005583812*nb0.z + 0.01524464*nb0.w + 0.026689446*nb1.x + 0.013745508*nb1.y + -0.01277478*nb1.z + -0.00086198887*nb1.w + -0.0010721319*c0.x + 0.007368921*c0.y + -0.0069245184*c0.z + 0.014952648*c0.w + 0.013611681*c1.x + -0.0011588702*c1.y + 0.003343768*c1.z + -0.0043547642*c1.w + 0.0050957454*nc0.x + 0.006349954*nc0.y + 0.016560592*nc0.z + -0.011598952*nc0.w + -0.017487887*nc1.x + 0.005505784*nc1.y + 0.005762446*nc1.z + -0.053730555*nc1.w + -0.0006759549*d0.x + -0.01235309*d0.y + 0.019650614*d0.z + 0.013408972*d0.w + -0.007804249*d1.x + -0.004979333*d1.y + -1.3350682e-05*d1.z + 0.020800084*d1.w + -0.0022109053*nd0.x + -0.0041485596*nd0.y + -0.002133069*nd0.z + -0.009645172*nd0.w + 0.008907387*nd1.x + -0.0068519185*nd1.y + 0.0025965276*nd1.z + 0.016099922*nd1.w + 0.04939659*e0.x + -0.0060820593*e0.y + 0.010794697*e0.z + -0.006137374*e0.w + -0.01290872*e1.x + 0.0075298487*e1.y + 0.004041271*e1.z + 0.0064650383*e1.w + 0.00063551264*ne0.x + -0.0027215453*ne0.y + -0.008020362*ne0.z + 0.003695057*ne0.w + -0.018387295*ne1.x + 0.014318577*ne1.y + -0.006835443*ne1.z + -0.00326252*ne1.w + -0.010896453*f0.x + 0.026144367*f0.y + 0.0012133884*f0.z + 0.010121205*f0.w + -0.0072969613*f1.x + 0.0034968446*f1.y + 0.0045040734*f1.z + -0.008679804*f1.w + 0.008097594*nf0.x + -0.008647307*nf0.y + -0.023421394*nf0.z + 0.006397582*nf0.w + -0.012903569*nf1.x + -0.013746394*nf1.y + -0.005604688*nf1.z + 0.024614112*nf1.w + 0.006448986*g0.x + -0.0010337069*g0.y + -0.0021236644*g0.z + -0.02637876*g0.w + -0.017765772*g1.x + 0.009548466*g1.y + 0.009302046*g1.z + 0.055873007*g1.w + -0.023443764*ng0.x + 0.025910184*ng0.y + 0.02454128*ng0.z + -0.0014853663*ng0.w + 0.015091205*ng1.x + -0.097650506*ng1.y + -0.012416881*ng1.z + -0.0017395458*ng1.w + 0; + return vec4(o, p, q, r); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL)-Conv-Reduce +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!COMPONENTS 4 +//!BIND LUMAN80 +//!BIND LUMAN81 +//!BIND LUMAN90 +//!BIND LUMAN91 +//!BIND LUMAN100 +//!BIND LUMAN101 +//!BIND LUMAN110 +//!BIND LUMAN111 +//!BIND LUMAN120 +//!BIND LUMAN121 +//!BIND LUMAN130 +//!BIND LUMAN131 +//!BIND LUMAN0 +//!SAVE LUMAN0 + +vec4 hook() { + vec4 h0 = LUMAN80_tex(HOOKED_pos); + vec4 h1 = LUMAN81_tex(HOOKED_pos); + vec4 i0 = LUMAN90_tex(HOOKED_pos); + vec4 i1 = LUMAN91_tex(HOOKED_pos); + vec4 j0 = LUMAN100_tex(HOOKED_pos); + vec4 j1 = LUMAN101_tex(HOOKED_pos); + vec4 k0 = LUMAN110_tex(HOOKED_pos); + vec4 k1 = LUMAN111_tex(HOOKED_pos); + vec4 l0 = LUMAN120_tex(HOOKED_pos); + vec4 l1 = LUMAN121_tex(HOOKED_pos); + vec4 m0 = LUMAN130_tex(HOOKED_pos); + vec4 m1 = LUMAN131_tex(HOOKED_pos); + vec4 nh0 = -min(h0, 0); + vec4 nh1 = -min(h1, 0); + vec4 ni0 = -min(i0, 0); + vec4 ni1 = -min(i1, 0); + vec4 nj0 = -min(j0, 0); + vec4 nj1 = -min(j1, 0); + vec4 nk0 = -min(k0, 0); + vec4 nk1 = -min(k1, 0); + vec4 nl0 = -min(l0, 0); + vec4 nl1 = -min(l1, 0); + vec4 nm0 = -min(m0, 0); + vec4 nm1 = -min(m1, 0); + h0 = max(h0, 0); + h1 = max(h1, 0); + i0 = max(i0, 0); + i1 = max(i1, 0); + j0 = max(j0, 0); + j1 = max(j1, 0); + k0 = max(k0, 0); + k1 = max(k1, 0); + l0 = max(l0, 0); + l1 = max(l1, 0); + m0 = max(m0, 0); + m1 = max(m1, 0); + float o = LUMAN0_tex(HOOKED_pos).x + 0.034401156*h0.x + 0.009962745*h0.y + 0.004650459*h0.z + -0.014043792*h0.w + -0.0045827245*h1.x + -0.0098359445*h1.y + -0.038034104*h1.z + 0.012327318*h1.w + 0.0052528363*nh0.x + -0.01484837*nh0.y + -0.0046127653*nh0.z + -0.017336814*nh0.w + 0.0017943914*nh1.x + 0.012748614*nh1.y + 0.045215413*nh1.z + -0.014139176*nh1.w + 0.008896243*i0.x + 0.03842194*i0.y + -0.03274889*i0.z + -0.0058000316*i0.w + -0.025357485*i1.x + -0.008246465*i1.y + 0.012221546*i1.z + 0.00085157016*i1.w + 0.006214815*ni0.x + 9.9459925e-05*ni0.y + 0.0038164293*ni0.z + -0.0022133805*ni0.w + -0.006646422*ni1.x + 0.028549185*ni1.y + 0.015540295*ni1.z + -0.0012580348*ni1.w + 0.010400454*j0.x + 0.009329043*j0.y + -0.0138742*j0.z + -0.021820448*j0.w + 0.0064277314*j1.x + 0.004760106*j1.y + 0.0067427587*j1.z + -0.0051277643*j1.w + -0.009292018*nj0.x + 0.0025945473*nj0.y + 0.0081010815*nj0.z + 0.01822323*nj0.w + 0.00030703348*nj1.x + -0.051875446*nj1.y + -0.019228334*nj1.z + 0.016917307*nj1.w + -0.0005357173*k0.x + -0.016460193*k0.y + -0.034852613*k0.z + -0.011156134*k0.w + 0.0127446605*k1.x + 0.021746593*k1.y + -0.024992103*k1.z + 0.08019326*k1.w + -0.023824502*nk0.x + -0.02147762*nk0.y + 0.045119874*nk0.z + 0.015192997*nk0.w + 0.019346148*nk1.x + -0.014151585*nk1.y + 0.019203197*nk1.z + -0.0044191247*nk1.w + -0.013625817*l0.x + 0.07165393*l0.y + -0.027658032*l0.z + -0.07151944*l0.w + -0.062443268*l1.x + 0.112457685*l1.y + 0.003210102*l1.z + -0.008732399*l1.w + -0.00975312*nl0.x + -0.057808086*nl0.y + -0.027749574*nl0.z + 0.02227914*nl0.w + 0.041571714*nl1.x + -0.0055755195*nl1.y + 0.108266085*nl1.z + -0.047125004*nl1.w + 0.00368833*m0.x + -0.013775068*m0.y + 0.009254338*m0.z + -0.01990427*m0.w + 0.08963279*m1.x + 0.14566979*m1.y + 0.05224272*m1.z + -0.014552166*m1.w + 0.02561676*nm0.x + -0.04545395*nm0.y + -0.04238542*nm0.z + -0.031158658*nm0.w + -0.08434943*nm1.x + -0.08503576*nm1.y + 0.022166187*nm1.z + 0.014980171*nm1.w + -0.00483469; + float p = LUMAN0_tex(HOOKED_pos).y + -0.0020752167*h0.x + 0.0063545695*h0.y + 0.01010751*h0.z + -0.0072764643*h0.w + 0.014333199*h1.x + 0.006697225*h1.y + -0.0039110226*h1.z + 0.0051922174*h1.w + -0.0057791336*nh0.x + 0.007639546*nh0.y + 0.026147008*nh0.z + -0.010151784*nh0.w + -0.0034361628*nh1.x + -0.0078110364*nh1.y + 0.0014328938*nh1.z + 0.008421343*nh1.w + -0.022844987*i0.x + 0.010086591*i0.y + -0.018408401*i0.z + -0.004033717*i0.w + 0.0112133*i1.x + -0.002165153*i1.y + 0.013305925*i1.z + -0.010266089*i1.w + -0.023234507*ni0.x + -0.010901275*ni0.y + 0.027079165*ni0.z + -0.00265954*ni0.w + 0.013545362*ni1.x + -0.013553712*ni1.y + -0.0007794197*ni1.z + 0.0006961812*ni1.w + -0.012110603*j0.x + 0.00034297214*j0.y + -0.01231997*j0.z + -0.048298255*j0.w + 0.00949085*j1.x + -0.02060489*j1.y + 0.025083434*j1.z + 0.021471046*j1.w + -0.005938651*nj0.x + 0.014816684*nj0.y + -0.008995274*nj0.z + 0.020351132*nj0.w + -0.009883385*nj1.x + -0.03256145*nj1.y + -0.009079754*nj1.z + 0.03015216*nj1.w + -0.0018545875*k0.x + -0.05275722*k0.y + -0.022588806*k0.z + -0.018863019*k0.w + 0.0075146845*k1.x + 0.01169195*k1.y + -0.015616609*k1.z + -0.012367684*k1.w + -0.01055377*nk0.x + -0.012352354*nk0.y + 0.0029030296*nk0.z + 0.027570033*nk0.w + -0.0065908534*nk1.x + -0.005981111*nk1.y + 0.04049675*nk1.z + 0.0067684855*nk1.w + 0.062252034*l0.x + -0.049764156*l0.y + 0.044663634*l0.z + -0.061189957*l0.w + -0.036176555*l1.x + -0.07700532*l1.y + 0.039644565*l1.z + -0.0011335541*l1.w + -0.027153872*nl0.x + 0.08411512*nl0.y + 0.06614775*nl0.z + 0.05199803*nl0.w + -0.048121814*nl1.x + -0.0107329795*nl1.y + -0.1509652*nl1.z + 0.0063024173*nl1.w + 0.0059478707*m0.x + 0.0075850477*m0.y + 0.009046631*m0.z + 0.035324626*m0.w + -0.042710908*m1.x + -0.009776915*m1.y + -0.03474221*m1.z + 0.02385393*m1.w + -0.03071705*nm0.x + -0.07975045*nm0.y + 0.024966806*nm0.z + 0.020511841*nm0.w + 0.07649801*nm1.x + 0.053998437*nm1.y + -0.033258416*nm1.z + -0.028651386*nm1.w + 0.01118088; + float q = LUMAN0_tex(HOOKED_pos).z + 0.027928034*h0.x + -0.00063064933*h0.y + 0.021734828*h0.z + 0.008412935*h0.w + -0.00065761775*h1.x + -0.0146809*h1.y + -0.03234976*h1.z + 0.013460963*h1.w + -0.0064559532*nh0.x + -0.011165762*nh0.y + -0.05918726*nh0.z + -0.0060834796*nh0.w + -0.004770562*nh1.x + 0.014993997*nh1.y + 0.0113063315*nh1.z + -0.00597723*nh1.w + -0.03202363*i0.x + -0.008795591*i0.y + -0.009579226*i0.z + -0.012104499*i0.w + -0.026801545*i1.x + -0.002506526*i1.y + 0.011310535*i1.z + -0.0018107444*i1.w + 0.0005081284*ni0.x + -0.0077190883*ni0.y + -0.0075142644*ni0.z + 0.014105534*ni0.w + -0.014206757*ni1.x + 0.018670745*ni1.y + -0.0050449176*ni1.z + 0.013789966*ni1.w + 0.0002744412*j0.x + 0.002148134*j0.y + -0.01950388*j0.z + 0.020904543*j0.w + 0.0054305815*j1.x + -0.016772006*j1.y + 0.0029093702*j1.z + 0.04141592*j1.w + -0.014153547*nj0.x + 0.01092091*nj0.y + 0.015726041*nj0.z + 0.022187172*nj0.w + 0.0046619656*nj1.x + 0.022695398*nj1.y + 0.040521663*nj1.z + 0.023822222*nj1.w + 0.0025603063*k0.x + -0.0328092*k0.y + -0.025544703*k0.z + -0.052972298*k0.w + -0.007406237*k1.x + -0.0014704907*k1.y + -0.007823923*k1.z + 0.046964526*k1.w + -0.010520701*nk0.x + -2.8234057e-05*nk0.y + -0.002981609*nk0.z + 0.021067832*nk0.w + 0.0069698454*nk1.x + -0.006944726*nk1.y + 0.011752712*nk1.z + -0.013274593*nk1.w + -0.0018958533*l0.x + 0.020418048*l0.y + -0.013365399*l0.z + 0.03520888*l0.w + 0.079659395*l1.x + -0.014603256*l1.y + 0.01026993*l1.z + -0.042973697*l1.w + 0.018409628*nl0.x + -0.10567821*nl0.y + 0.0065107034*nl0.z + 0.027540475*nl0.w + 0.0030548468*nl1.x + 0.010502121*nl1.y + -0.019647006*nl1.z + 0.04516226*nl1.w + -0.06554564*m0.x + -0.011442246*m0.y + -0.005114018*m0.z + -0.0024996835*m0.w + -0.017295208*m1.x + -0.055293165*m1.y + -0.031979002*m1.z + -0.0038506282*m1.w + 0.026960757*nm0.x + 0.07022051*nm0.y + 0.044133842*nm0.z + -0.055684086*nm0.w + -0.0016015825*nm1.x + -0.000436681*nm1.y + 0.082399815*nm1.z + 0.0022714457*nm1.w + -0.001444129; + float r = LUMAN0_tex(HOOKED_pos).w + 0.0065791705*h0.x + -0.0015403025*h0.y + 0.0064169746*h0.z + 0.007963498*h0.w + 0.021180913*h1.x + -0.004136175*h1.y + 0.028494531*h1.z + -0.0008609896*h1.w + 0.00068162434*nh0.x + 0.005812571*nh0.y + 7.799883e-05*nh0.z + 0.00028619578*nh0.w + -0.015010334*nh1.x + -0.0044445735*nh1.y + 0.020106055*nh1.z + 0.021773782*nh1.w + 0.006280354*i0.x + 0.0071694613*i0.y + -0.032603383*i0.z + 0.0054596756*i0.w + 0.022585317*i1.x + 0.0045749573*i1.y + 0.007902826*i1.z + -0.024760662*i1.w + 0.010345332*ni0.x + 0.0003124174*ni0.y + 0.020316618*ni0.z + -0.0061475406*ni0.w + -0.01166553*ni1.x + -0.004341632*ni1.y + -0.0030678716*ni1.z + 0.0054059103*ni1.w + -0.031425413*j0.x + -0.015989859*j0.y + -0.002786248*j0.z + 0.013642373*j0.w + 0.0026142476*j1.x + -0.019014874*j1.y + -0.0077111414*j1.z + -0.00042229125*j1.w + -0.025821427*nj0.x + 0.0060142726*nj0.y + -0.0030788877*nj0.z + 0.002942042*nj0.w + -0.0059427544*nj1.x + 0.003509379*nj1.y + 0.028800465*nj1.z + 0.017977864*nj1.w + -0.013082354*k0.x + -0.029519752*k0.y + -0.006436361*k0.z + 0.019291043*k0.w + -0.011995411*k1.x + -0.0096671805*k1.y + -0.011445856*k1.z + -0.032207422*k1.w + -0.0072086384*nk0.x + 0.0104716765*nk0.y + -0.009410261*nk0.z + 0.01848859*nk0.w + -0.004418158*nk1.x + -0.0037927034*nk1.y + 0.02927223*nk1.z + -0.0026371046*nk1.w + -0.009728005*l0.x + 0.053604573*l0.y + -0.0477697*l0.z + -0.014545695*l0.w + 0.0729068*l1.x + 0.029571975*l1.y + 0.04266492*l1.z + 0.0028515104*l1.w + 0.035755076*nl0.x + 0.002351535*nl0.y + 0.056750543*nl0.z + 0.025379483*nl0.w + 0.008843858*nl1.x + 0.02538903*nl1.y + 0.009231505*nl1.z + 0.01620967*nl1.w + 0.024939101*m0.x + -0.031211093*m0.y + 0.051891036*m0.z + -0.05012903*m0.w + 0.026645886*m1.x + -0.0222343*m1.y + -0.008087572*m1.z + -0.0046961857*m1.w + -0.00022882015*nm0.x + 0.09123664*nm0.y + -0.093280986*nm0.z + 0.10796022*nm0.w + -0.02372915*nm1.x + -0.03217392*nm1.y + -0.047164705*nm1.z + 0.005004752*nm1.w + -0.0045874715; + return vec4(o, p, q, r); +} + +//!HOOK NATIVE +//!BIND HOOKED +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!BIND LUMAN0 +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!DESC Anime4K-v3.1-Upscale(x2)+Denoise-CNN(UL) + +vec4 hook() { + vec2 f = fract(LUMAN0_pos * LUMAN0_size); + ivec2 i = ivec2(f * vec2(2)); + float c = LUMAN0_tex((vec2(0.5) - f) * LUMAN0_pt + LUMAN0_pos)[i.y * 2 + i.x]; + return vec4(c + HOOKED_tex(HOOKED_pos).x, HOOKED_tex(HOOKED_pos).yz, 0); +} + diff --git a/.config/mpv/shaders/Anime4K_Upscale_DTD_x2.glsl b/.config/mpv/shaders/Anime4K_Upscale_DTD_x2.glsl new file mode 100644 index 0000000..abe88fc --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_DTD_x2.glsl @@ -0,0 +1,548 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + + +//!DESC Anime4K-v3.1-Upscale(x2)-DTD-Kernel(X) +//!HOOK NATIVE +//!BIND HOOKED +//!SAVE MMKERNEL +//!COMPONENTS 1 + +#define L_tex HOOKED_tex + +#define SIGMA 1 + +float gaussian(float x, float s, float m) { + return (1 / (s * sqrt(2 * 3.14159))) * exp(-0.5 * pow(abs(x - m) / s, 2.0)); +} + +float lumGaussian(vec2 pos, vec2 d) { + float s = SIGMA * HOOKED_size.y / 1080; + float kernel_size = s * 2 + 1; + + float g = (L_tex(pos).x) * gaussian(0, s, 0); + float gn = gaussian(0, s, 0); + + g += (L_tex(pos - d).x + L_tex(pos + d).x) * gaussian(1, s, 0); + gn += gaussian(1, s, 0) * 2; + + for (int i=2; i NOISE_THRESHOLD) { + c_t = (c_t - NOISE_THRESHOLD) / t_range; + c_t = pow(c_t, BLUR_CURVE); + c_t = c_t * t_range + NOISE_THRESHOLD; + c_t = c_t * sign(c); + } else { + c_t = c; + } + return vec4(clamp(c_t + L_tex(HOOKED_pos).x, MMKERNEL_tex(HOOKED_pos).y, MMKERNEL_tex(HOOKED_pos).z), HOOKED_tex(HOOKED_pos).yz, 0); +} + + + diff --git a/.config/mpv/shaders/Anime4K_Upscale_DoG_x2.glsl b/.config/mpv/shaders/Anime4K_Upscale_DoG_x2.glsl new file mode 100644 index 0000000..629c525 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_DoG_x2.glsl @@ -0,0 +1,124 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Upscale(x2)-DoG-Kernel(X) +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!HOOK NATIVE +//!BIND HOOKED +//!SAVE GAUSS_X2 +//!COMPONENTS 3 + +#define L_tex HOOKED_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a = L_tex(pos - d).x; + float b = L_tex(pos).x; + float c = L_tex(pos + d).x; + + return vec2(min3v(a, b, c), max3v(a, b, c)); +} + +float lumGaussian7(vec2 pos, vec2 d) { + float g = (L_tex(pos - (d + d)).x + L_tex(pos + (d + d)).x) * 0.06136; + g = g + (L_tex(pos - d).x + L_tex(pos + d).x) * 0.24477; + g = g + (L_tex(pos).x) * 0.38774; + + return g; +} + + +vec4 hook() { + return vec4(lumGaussian7(HOOKED_pos, vec2(HOOKED_pt.x, 0)), minmax3(HOOKED_pos, vec2(HOOKED_pt.x, 0)), 0); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)-DoG-Kernel(Y) +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!HOOK NATIVE +//!BIND HOOKED +//!BIND GAUSS_X2 +//!SAVE GAUSS_X2 +//!COMPONENTS 3 + +#define L_tex GAUSS_X2_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a0 = L_tex(pos - d).y; + float b0 = L_tex(pos).y; + float c0 = L_tex(pos + d).y; + + float a1 = L_tex(pos - d).z; + float b1 = L_tex(pos).z; + float c1 = L_tex(pos + d).z; + + return vec2(min3v(a0, b0, c0), max3v(a1, b1, c1)); +} + +float lumGaussian7(vec2 pos, vec2 d) { + float g = (L_tex(pos - (d + d)).x + L_tex(pos + (d + d)).x) * 0.06136; + g = g + (L_tex(pos - d).x + L_tex(pos + d).x) * 0.24477; + g = g + (L_tex(pos).x) * 0.38774; + + return g; +} + + +vec4 hook() { + return vec4(lumGaussian7(HOOKED_pos, vec2(0, HOOKED_pt.y)), minmax3(HOOKED_pos, vec2(0, HOOKED_pt.y)), 0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-DoG +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!HOOK NATIVE +//!BIND HOOKED +//!BIND GAUSS_X2 +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * + +#define STRENGTH 0.8 //De-blur proportional strength, higher is sharper. + +#define L_tex HOOKED_tex + +vec4 hook() { + float c = (L_tex(HOOKED_pos).x - GAUSS_X2_tex(HOOKED_pos).x) * STRENGTH; + return vec4(clamp(c + L_tex(HOOKED_pos).x, GAUSS_X2_tex(HOOKED_pos).y, GAUSS_X2_tex(HOOKED_pos).z), HOOKED_tex(HOOKED_pos).yz, 0); +} + + + diff --git a/.config/mpv/shaders/Anime4K_Upscale_DoG_x2_Deblur.glsl b/.config/mpv/shaders/Anime4K_Upscale_DoG_x2_Deblur.glsl new file mode 100644 index 0000000..8167b94 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_DoG_x2_Deblur.glsl @@ -0,0 +1,139 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-DoG-Kernel(X) +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!HOOK NATIVE +//!BIND HOOKED +//!SAVE GAUSS_X2 +//!COMPONENTS 3 + +#define L_tex HOOKED_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a = L_tex(pos - d).x; + float b = L_tex(pos).x; + float c = L_tex(pos + d).x; + + return vec2(min3v(a, b, c), max3v(a, b, c)); +} + +float lumGaussian7(vec2 pos, vec2 d) { + float g = (L_tex(pos - (d + d)).x + L_tex(pos + (d + d)).x) * 0.06136; + g = g + (L_tex(pos - d).x + L_tex(pos + d).x) * 0.24477; + g = g + (L_tex(pos).x) * 0.38774; + + return g; +} + + +vec4 hook() { + return vec4(lumGaussian7(HOOKED_pos, vec2(HOOKED_pt.x, 0)), minmax3(HOOKED_pos, vec2(HOOKED_pt.x, 0)), 0); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-DoG-Kernel(Y) +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!HOOK NATIVE +//!BIND HOOKED +//!BIND GAUSS_X2 +//!SAVE GAUSS_X2 +//!COMPONENTS 3 + +#define L_tex GAUSS_X2_tex + +float max3v(float a, float b, float c) { + return max(max(a, b), c); +} +float min3v(float a, float b, float c) { + return min(min(a, b), c); +} + +vec2 minmax3(vec2 pos, vec2 d) { + float a0 = L_tex(pos - d).y; + float b0 = L_tex(pos).y; + float c0 = L_tex(pos + d).y; + + float a1 = L_tex(pos - d).z; + float b1 = L_tex(pos).z; + float c1 = L_tex(pos + d).z; + + return vec2(min3v(a0, b0, c0), max3v(a1, b1, c1)); +} + +float lumGaussian7(vec2 pos, vec2 d) { + float g = (L_tex(pos - (d + d)).x + L_tex(pos + (d + d)).x) * 0.06136; + g = g + (L_tex(pos - d).x + L_tex(pos + d).x) * 0.24477; + g = g + (L_tex(pos).x) * 0.38774; + + return g; +} + + +vec4 hook() { + return vec4(lumGaussian7(HOOKED_pos, vec2(0, HOOKED_pt.y)), minmax3(HOOKED_pos, vec2(0, HOOKED_pt.y)), 0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-DoG +//!WHEN OUTPUT.w NATIVE.w / 1.200 > OUTPUT.h NATIVE.h / 1.200 > * +//!HOOK NATIVE +//!BIND HOOKED +//!BIND GAUSS_X2 +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * + +#define STRENGTH 0.6 //De-blur proportional strength, higher is sharper. However, it is better to tweak BLUR_CURVE instead to avoid ringing. +#define BLUR_CURVE 0.6 //De-blur power curve, lower is sharper. Good values are between 0.3 - 1. Values greater than 1 softens the image; +#define BLUR_THRESHOLD 0.1 //Value where curve kicks in, used to not de-blur already sharp edges. Only de-blur values that fall below this threshold. +#define NOISE_THRESHOLD 0.001 //Value where curve stops, used to not sharpen noise. Only de-blur values that fall above this threshold. + +#define L_tex HOOKED_tex + +vec4 hook() { + float c = (L_tex(HOOKED_pos).x - GAUSS_X2_tex(HOOKED_pos).x) * STRENGTH; + + float t_range = BLUR_THRESHOLD - NOISE_THRESHOLD; + + float c_t = abs(c); + if (c_t > NOISE_THRESHOLD && c_t < BLUR_THRESHOLD) { + c_t = (c_t - NOISE_THRESHOLD) / t_range; + c_t = pow(c_t, BLUR_CURVE); + c_t = c_t * t_range + NOISE_THRESHOLD; + c_t = c_t * sign(c); + } else { + c_t = c; + } + return vec4(clamp(c_t + L_tex(HOOKED_pos).x, GAUSS_X2_tex(HOOKED_pos).y, GAUSS_X2_tex(HOOKED_pos).z), HOOKED_tex(HOOKED_pos).yz, 0); +} + + + diff --git a/.config/mpv/shaders/Anime4K_Upscale_Original_x2.glsl b/.config/mpv/shaders/Anime4K_Upscale_Original_x2.glsl new file mode 100644 index 0000000..7193a28 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_Original_x2.glsl @@ -0,0 +1,264 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Upscale(x2)-Original-Kernel(X) +//!HOOK NATIVE +//!BIND HOOKED +//!SAVE LUMAD +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!COMPONENTS 2 + +vec4 hook() { + vec2 d = HOOKED_pt; + + //[tl t tr] + //[ l c r] + //[bl b br] + float l = HOOKED_tex(HOOKED_pos + vec2(-d.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos).x; + float r = HOOKED_tex(HOOKED_pos + vec2(d.x, 0)).x; + + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (-l + r); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (l + c + c + r); + + //Computes the luminance's gradient + return vec4(xgrad, ygrad, 0, 0); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)-Original-Kernel(Y) +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAD +//!SAVE LUMAD +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!COMPONENTS 2 + + +/* --------------------- SETTINGS --------------------- */ + +//Strength of edge refinement, good values are between 0.2 and 4 +#define REFINE_STRENGTH 0.5 + + +/* --- MODIFY THESE SETTINGS BELOW AT YOUR OWN RISK --- */ + +//Bias of the refinement function, good values are between 0 and 1 +#define REFINE_BIAS 0 + +//Polynomial fit obtained by minimizing MSE error on image +#define P5 ( 11.68129591) +#define P4 (-42.46906057) +#define P3 ( 60.28286266) +#define P2 (-41.84451327) +#define P1 ( 14.05517353) +#define P0 (-1.081521930) + +/* ----------------- END OF SETTINGS ----------------- */ + +float power_function(float x) { + float x2 = x * x; + float x3 = x2 * x; + float x4 = x2 * x2; + float x5 = x2 * x3; + + return P5*x5 + P4*x4 + P3*x3 + P2*x2 + P1*x + P0; +} + +vec4 hook() { + vec2 d = HOOKED_pt; + + //[tl t tr] + //[ l cc r] + //[bl b br] + float tx = LUMAD_tex(HOOKED_pos + vec2(0, -d.y)).x; + float cx = LUMAD_tex(HOOKED_pos).x; + float bx = LUMAD_tex(HOOKED_pos + vec2(0, d.y)).x; + + + float ty = LUMAD_tex(HOOKED_pos + vec2(0, -d.y)).y; + //float cy = LUMAD_tex(HOOKED_pos).y; + float by = LUMAD_tex(HOOKED_pos + vec2(0, d.y)).y; + + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (tx + cx + cx + bx); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (-ty + by); + + //Computes the luminance's gradient + float sobel_norm = clamp(sqrt(xgrad * xgrad + ygrad * ygrad), 0, 1); + + float dval = clamp(power_function(clamp(sobel_norm, 0, 1)) * REFINE_STRENGTH + REFINE_BIAS, 0, 1); + + return vec4(sobel_norm, dval, 0, 0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)-Original-Kernel(X) +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAD +//!SAVE LUMAMM +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!COMPONENTS 2 + + +vec4 hook() { + vec2 d = HOOKED_pt; + + if (LUMAD_tex(HOOKED_pos).y < 0.1) { + return vec4(0); + } + + //[tl t tr] + //[ l c r] + //[bl b br] + float l = LUMAD_tex(HOOKED_pos + vec2(-d.x, 0)).x; + float c = LUMAD_tex(HOOKED_pos).x; + float r = LUMAD_tex(HOOKED_pos + vec2(d.x, 0)).x; + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (-l + r); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (l + c + c + r); + + + return vec4(xgrad, ygrad, 0, 0); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)-Original-Kernel(Y) +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAD +//!BIND LUMAMM +//!SAVE LUMAMM +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!COMPONENTS 2 + +vec4 hook() { + vec2 d = HOOKED_pt; + + if (LUMAD_tex(HOOKED_pos).y < 0.1) { + return vec4(0); + } + + //[tl t tr] + //[ l cc r] + //[bl b br] + float tx = LUMAMM_tex(HOOKED_pos + vec2(0, -d.y)).x; + float cx = LUMAMM_tex(HOOKED_pos).x; + float bx = LUMAMM_tex(HOOKED_pos + vec2(0, d.y)).x; + + float ty = LUMAMM_tex(HOOKED_pos + vec2(0, -d.y)).y; + //float cy = LUMAMM_tex(HOOKED_pos).y; + float by = LUMAMM_tex(HOOKED_pos + vec2(0, d.y)).y; + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (tx + cx + cx + bx); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (-ty + by); + + float norm = sqrt(xgrad * xgrad + ygrad * ygrad); + if (norm <= 0.001) { + xgrad = 0; + ygrad = 0; + norm = 1; + } + + return vec4(xgrad/norm, ygrad/norm, 0, 0); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)-Original +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAD +//!BIND LUMAMM +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * + + +vec4 hook() { + vec2 d = HOOKED_pt; + + float dval = LUMAD_tex(HOOKED_pos).y; + if (dval < 0.1) { + return HOOKED_tex(HOOKED_pos); + } + + vec4 dc = LUMAMM_tex(HOOKED_pos); + if (abs(dc.x + dc.y) <= 0.0001) { + return HOOKED_tex(HOOKED_pos); + } + + float xpos = -sign(dc.x); + float ypos = -sign(dc.y); + + vec4 xval = HOOKED_tex(HOOKED_pos + vec2(d.x * xpos, 0)); + vec4 yval = HOOKED_tex(HOOKED_pos + vec2(0, d.y * ypos)); + + float xyratio = abs(dc.x) / (abs(dc.x) + abs(dc.y)); + + vec4 avg = xyratio * xval + (1-xyratio) * yval; + + return avg * dval + HOOKED_tex(HOOKED_pos) * (1 - dval); + +} diff --git a/.config/mpv/shaders/Anime4K_Upscale_Original_x2_Deblur_x2.glsl b/.config/mpv/shaders/Anime4K_Upscale_Original_x2_Deblur_x2.glsl new file mode 100644 index 0000000..a39f6e2 --- /dev/null +++ b/.config/mpv/shaders/Anime4K_Upscale_Original_x2_Deblur_x2.glsl @@ -0,0 +1,264 @@ +//Anime4K v3.1 GLSL + +// MIT License + +// Copyright (c) 2019-2020 bloc97 +// All rights reserved. + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-Original-Kernel(X) +//!HOOK NATIVE +//!BIND HOOKED +//!SAVE LUMAD +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!COMPONENTS 2 + +vec4 hook() { + vec2 d = HOOKED_pt; + + //[tl t tr] + //[ l c r] + //[bl b br] + float l = HOOKED_tex(HOOKED_pos + vec2(-d.x, 0)).x; + float c = HOOKED_tex(HOOKED_pos).x; + float r = HOOKED_tex(HOOKED_pos + vec2(d.x, 0)).x; + + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (-l + r); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (l + c + c + r); + + //Computes the luminance's gradient + return vec4(xgrad, ygrad, 0, 0); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-Original-Kernel(Y) +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAD +//!SAVE LUMAD +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!COMPONENTS 2 + + +/* --------------------- SETTINGS --------------------- */ + +//Strength of edge refinement, good values are between 0.2 and 4 +#define REFINE_STRENGTH 1 + + +/* --- MODIFY THESE SETTINGS BELOW AT YOUR OWN RISK --- */ + +//Bias of the refinement function, good values are between 0 and 1 +#define REFINE_BIAS 0 + +//Polynomial fit obtained by minimizing MSE error on image +#define P5 ( 11.68129591) +#define P4 (-42.46906057) +#define P3 ( 60.28286266) +#define P2 (-41.84451327) +#define P1 ( 14.05517353) +#define P0 (-1.081521930) + +/* ----------------- END OF SETTINGS ----------------- */ + +float power_function(float x) { + float x2 = x * x; + float x3 = x2 * x; + float x4 = x2 * x2; + float x5 = x2 * x3; + + return P5*x5 + P4*x4 + P3*x3 + P2*x2 + P1*x + P0; +} + +vec4 hook() { + vec2 d = HOOKED_pt; + + //[tl t tr] + //[ l cc r] + //[bl b br] + float tx = LUMAD_tex(HOOKED_pos + vec2(0, -d.y)).x; + float cx = LUMAD_tex(HOOKED_pos).x; + float bx = LUMAD_tex(HOOKED_pos + vec2(0, d.y)).x; + + + float ty = LUMAD_tex(HOOKED_pos + vec2(0, -d.y)).y; + //float cy = LUMAD_tex(HOOKED_pos).y; + float by = LUMAD_tex(HOOKED_pos + vec2(0, d.y)).y; + + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (tx + cx + cx + bx); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (-ty + by); + + //Computes the luminance's gradient + float sobel_norm = clamp(sqrt(xgrad * xgrad + ygrad * ygrad), 0, 1); + + float dval = clamp(power_function(clamp(sobel_norm, 0, 1)) * REFINE_STRENGTH + REFINE_BIAS, 0, 1); + + return vec4(sobel_norm, dval, 0, 0); +} + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-Original-Kernel(X) +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAD +//!SAVE LUMAMM +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!COMPONENTS 2 + + +vec4 hook() { + vec2 d = HOOKED_pt; + + if (LUMAD_tex(HOOKED_pos).y < 0.1) { + return vec4(0); + } + + //[tl t tr] + //[ l c r] + //[bl b br] + float l = LUMAD_tex(HOOKED_pos + vec2(-d.x, 0)).x; + float c = LUMAD_tex(HOOKED_pos).x; + float r = LUMAD_tex(HOOKED_pos + vec2(d.x, 0)).x; + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (-l + r); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (l + c + c + r); + + + return vec4(xgrad, ygrad, 0, 0); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-Original-Kernel(Y) +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAD +//!BIND LUMAMM +//!SAVE LUMAMM +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * +//!COMPONENTS 2 + +vec4 hook() { + vec2 d = HOOKED_pt; + + if (LUMAD_tex(HOOKED_pos).y < 0.1) { + return vec4(0); + } + + //[tl t tr] + //[ l cc r] + //[bl b br] + float tx = LUMAMM_tex(HOOKED_pos + vec2(0, -d.y)).x; + float cx = LUMAMM_tex(HOOKED_pos).x; + float bx = LUMAMM_tex(HOOKED_pos + vec2(0, d.y)).x; + + float ty = LUMAMM_tex(HOOKED_pos + vec2(0, -d.y)).y; + //float cy = LUMAMM_tex(HOOKED_pos).y; + float by = LUMAMM_tex(HOOKED_pos + vec2(0, d.y)).y; + + //Horizontal Gradient + //[-1 0 1] + //[-2 0 2] + //[-1 0 1] + float xgrad = (tx + cx + cx + bx); + + //Vertical Gradient + //[-1 -2 -1] + //[ 0 0 0] + //[ 1 2 1] + float ygrad = (-ty + by); + + float norm = sqrt(xgrad * xgrad + ygrad * ygrad); + if (norm <= 0.001) { + xgrad = 0; + ygrad = 0; + norm = 1; + } + + return vec4(xgrad/norm, ygrad/norm, 0, 0); +} + + +//!DESC Anime4K-v3.1-Upscale(x2)+Deblur-Original +//!HOOK NATIVE +//!BIND HOOKED +//!BIND LUMAD +//!BIND LUMAMM +//!WIDTH NATIVE.w 2 * +//!HEIGHT NATIVE.h 2 * + + +vec4 hook() { + vec2 d = HOOKED_pt; + + float dval = LUMAD_tex(HOOKED_pos).y; + if (dval < 0.1) { + return HOOKED_tex(HOOKED_pos); + } + + vec4 dc = LUMAMM_tex(HOOKED_pos); + if (abs(dc.x + dc.y) <= 0.0001) { + return HOOKED_tex(HOOKED_pos); + } + + float xpos = -sign(dc.x); + float ypos = -sign(dc.y); + + vec4 xval = HOOKED_tex(HOOKED_pos + vec2(d.x * xpos, 0)); + vec4 yval = HOOKED_tex(HOOKED_pos + vec2(0, d.y * ypos)); + + float xyratio = abs(dc.x) / (abs(dc.x) + abs(dc.y)); + + vec4 avg = xyratio * xval + (1-xyratio) * yval; + + return avg * dval + HOOKED_tex(HOOKED_pos) * (1 - dval); + +} -- 2.45.2