add Hyllian's detail-preserving super-xbr parameters and presets

This commit is contained in:
hunterk 2017-07-27 09:44:14 -05:00
parent bf8c497809
commit e9315c669e
7 changed files with 199 additions and 5 deletions

View file

@ -35,11 +35,13 @@ layout(push_constant) uniform Push
float XBR_EDGE_STR;
float XBR_WEIGHT;
float XBR_ANTI_RINGING;
float DETAILS;
} params;
#pragma parameter XBR_EDGE_STR "Xbr - Edge Strength p0" 0.6 0.0 5.0 0.2
#pragma parameter XBR_WEIGHT "Xbr - Filter Weight" 1.0 0.00 1.50 0.01
#pragma parameter XBR_ANTI_RINGING "Xbr - Anti-Ringing Level" 1.0 0.0 1.0 1.0
#pragma parameter DETAILS "Xbr - Preserve Details" 0.0 0.0 1.0 1.0
#define XBR_EDGE_STR params.XBR_EDGE_STR
#define XBR_WEIGHT params.XBR_WEIGHT
@ -55,7 +57,7 @@ layout(std140, set = 0, binding = 0) uniform UBO
#define wp1 1.0
#define wp2 0.0
#define wp3 0.0
#define wp4 2.0
//#define wp4 2.0
#define wp5 -1.0
#define wp6 0.0
@ -87,11 +89,13 @@ float df(float A, float B)
float d_wd(float b0, float b1, float c0, float c1, float c2, float d0, float d1, float d2, float d3, float e1, float e2, float e3, float f2, float f3)
{
float wp4 = (params.DETAILS > 0.5) ? 1.0 : 2.0;
return (wp1*(df(c1,c2) + df(c1,c0) + df(e2,e1) + df(e2,e3)) + wp2*(df(d2,d3) + df(d0,d1)) + wp3*(df(d1,d3) + df(d0,d2)) + wp4*df(d1,d2) + wp5*(df(c0,c2) + df(e1,e3)) + wp6*(df(b0,b1) + df(f2,f3)));
}
float hv_wd(float i1, float i2, float i3, float i4, float e1, float e2, float e3, float e4)
{
float wp4 = (params.DETAILS > 0.5) ? 1.0 : 2.0;
return ( wp4*(df(i1,i2)+df(i3,i4)) + wp1*(df(i1,e1)+df(i2,e2)+df(i3,e3)+df(i4,e4)) + wp3*(df(i1,e2)+df(i3,e4)+df(e1,i2)+df(e3,i4)));
}

View file

@ -36,8 +36,11 @@ layout(push_constant) uniform Push
vec4 OriginalSize;
vec4 OutputSize;
uint FrameCount;
float DETAILS;
} params;
#pragma parameter DETAILS "Xbr - Preserve Details" 0.0 0.0 1.0 1.0
layout(std140, set = 0, binding = 0) uniform UBO
{
mat4 MVP;
@ -48,8 +51,8 @@ layout(std140, set = 0, binding = 0) uniform UBO
#define wp1 1.0
#define wp2 0.0
#define wp3 0.0
#define wp4 0.0
#define wp5 0.0
//#define wp4 0.0
//#define wp5 0.0
#define wp6 0.0
#define weight1 (XBR_WEIGHT*1.75068/10.0)
@ -79,11 +82,19 @@ float df(float A, float B)
float d_wd(float b0, float b1, float c0, float c1, float c2, float d0, float d1, float d2, float d3, float e1, float e2, float e3, float f2, float f3)
{
float wp4 = 0.0;
float wp5 = 0.0;
if(params.DETAILS > 0.5)
{
wp4 = 1.0;
wp5 = -1.0;
}
return (wp1*(df(c1,c2) + df(c1,c0) + df(e2,e1) + df(e2,e3)) + wp2*(df(d2,d3) + df(d0,d1)) + wp3*(df(d1,d3) + df(d0,d2)) + wp4*df(d1,d2) + wp5*(df(c0,c2) + df(e1,e3)) + wp6*(df(b0,b1) + df(f2,f3)));
}
float hv_wd(float i1, float i2, float i3, float i4, float e1, float e2, float e3, float e4)
{
float wp4 = (params.DETAILS > 0.5) ? 1.0 : 0.0;
return ( wp4*(df(i1,i2)+df(i3,i4)) + wp1*(df(i1,e1)+df(i2,e2)+df(i3,e3)+df(i4,e4)) + wp3*(df(i1,e2)+df(i3,e4)+df(e1,i2)+df(e3,i4)));
}

View file

@ -36,8 +36,11 @@ layout(push_constant) uniform Push
vec4 OriginalSize;
vec4 OutputSize;
uint FrameCount;
float DETAILS;
} params;
#pragma parameter DETAILS "Xbr - Preserve Details" 0.0 0.0 1.0 1.0
layout(std140, set = 0, binding = 0) uniform UBO
{
mat4 MVP;
@ -48,8 +51,8 @@ layout(std140, set = 0, binding = 0) uniform UBO
#define wp1 1.0
#define wp2 0.0
#define wp3 0.0
#define wp4 0.0
#define wp5 0.0
//#define wp4 0.0
//#define wp5 0.0
#define wp6 0.0
#define weight1 (XBR_WEIGHT*1.29633/10.0)
@ -79,11 +82,19 @@ float df(float A, float B)
float d_wd(float b0, float b1, float c0, float c1, float c2, float d0, float d1, float d2, float d3, float e1, float e2, float e3, float f2, float f3)
{
float wp4 = 0.0;
float wp5 = 0.0;
if(params.DETAILS > 0.5)
{
wp4 = 1.0;
wp5 = -1.0;
}
return (wp1*(df(c1,c2) + df(c1,c0) + df(e2,e1) + df(e2,e3)) + wp2*(df(d2,d3) + df(d0,d1)) + wp3*(df(d1,d3) + df(d0,d2)) + wp4*df(d1,d2) + wp5*(df(c0,c2) + df(e1,e3)) + wp6*(df(b0,b1) + df(f2,f3)));
}
float hv_wd(float i1, float i2, float i3, float i4, float e1, float e2, float e3, float e4)
{
float wp4 = (params.DETAILS > 0.5) ? 1.0 : 0.0;
return ( wp4*(df(i1,i2)+df(i3,i4)) + wp1*(df(i1,e1)+df(i2,e2)+df(i3,e3)+df(i4,e4)) + wp3*(df(i1,e2)+df(i3,e4)+df(e1,i2)+df(e3,i4)));
}

View file

@ -0,0 +1,18 @@
shaders = "3"
shader0 = "shaders/super-xbr/super-xbr-pass0.slang"
filter_linear0 = false
scale_type_x0 = "source"
scale_x0 = "1.000000"
scale_type_y0 = "source"
scale_y0 = "1.000000"
shader1 = "shaders/super-xbr/super-xbr-pass1.slang"
filter_linear1 = false
scale_type_x1 = "source"
scale_x1 = "2.000000"
scale_type_y1 = "source"
scale_y1 = "2.000000"
shader2 = "shaders/super-xbr/custom-jinc2-sharper.slang"
filter_linear2 = false
parameters = "DETAILS"
DETAILS = "1.0"

View file

@ -0,0 +1,24 @@
shaders = "4"
shader0 = "shaders/super-xbr/super-xbr-pass0.slang"
filter_linear0 = false
scale_type_x0 = "source"
scale_x0 = "1.000000"
scale_type_y0 = "source"
scale_y0 = "1.000000"
shader1 = "shaders/super-xbr/super-xbr-pass1.slang"
filter_linear1 = false
scale_type_x1 = "source"
scale_x1 = "2.000000"
scale_type_y1 = "source"
scale_y1 = "2.000000"
shader2 = "shaders/super-xbr/super-xbr-pass2.slang"
filter_linear2 = false
scale_type_x2 = "source"
scale_x2 = "1.000000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = "shaders/super-xbr/custom-jinc2-sharper.slang"
filter_linear3 = false
parameters = "DETAILS"
DETAILS = "1.0"

View file

@ -0,0 +1,43 @@
shaders = "7"
shader0 = "shaders/super-xbr/super-xbr-pass0.slang"
filter_linear0 = false
scale_type_x0 = "source"
scale_x0 = "1.000000"
scale_type_y0 = "source"
scale_y0 = "1.000000"
shader1 = "shaders/super-xbr/super-xbr-pass1.slang"
filter_linear1 = false
scale_type_x1 = "source"
scale_x1 = "2.000000"
scale_type_y1 = "source"
scale_y1 = "2.000000"
alias2 = "PassPrev2"
shader2 = "shaders/super-xbr/super-xbr-pass2.slang"
filter_linear2 = false
scale_type_x2 = "source"
scale_x2 = "1.000000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = "shaders/super-xbr/super-xbr-pass0.slang"
filter_linear3 = false
scale_type_x3 = "source"
scale_x3 = "1.000000"
scale_type_y3 = "source"
scale_y3 = "1.000000"
shader4 = "shaders/super-xbr/super-xbr-pass1b.slang"
filter_linear4 = false
scale_type_x4 = "source"
scale_x4 = "2.000000"
scale_type_y4 = "source"
scale_y4 = "2.000000"
shader5 = "shaders/super-xbr/super-xbr-pass2.slang"
filter_linear5 = false
scale_type_x5 = "source"
scale_x5 = "1.000000"
scale_type_y5 = "source"
scale_y5 = "1.000000"
shader6 = "shaders/super-xbr/custom-jinc2-sharper.slang"
filter_linear6 = false
parameters = "DETAILS"
DETAILS = "1.0"

View file

@ -0,0 +1,83 @@
shaders = "6"
shader0 = "..\misc\deposterize-pass0.slang"
filter_linear0 = "false"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = ""
float_framebuffer0 = "false"
srgb_framebuffer0 = "false"
scale_type_x0 = "source"
scale_x0 = "1.000000"
scale_type_y0 = "source"
scale_y0 = "1.000000"
shader1 = "..\misc\deposterize-pass1.slang"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = ""
float_framebuffer1 = "false"
srgb_framebuffer1 = "false"
scale_type_x1 = "source"
scale_x1 = "1.000000"
scale_type_y1 = "source"
scale_y1 = "1.000000"
shader2 = "..\xbr\shaders\super-xbr\super-xbr-pass0.slang"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = ""
float_framebuffer2 = "false"
srgb_framebuffer2 = "false"
scale_type_x2 = "source"
scale_x2 = "1.000000"
scale_type_y2 = "source"
scale_y2 = "1.000000"
shader3 = "..\xbr\shaders\super-xbr\super-xbr-pass1.slang"
filter_linear3 = "false"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "false"
alias3 = ""
float_framebuffer3 = "false"
srgb_framebuffer3 = "false"
scale_type_x3 = "source"
scale_x3 = "2.000000"
scale_type_y3 = "source"
scale_y3 = "2.000000"
shader4 = "..\xbr\shaders\super-xbr\super-xbr-pass2.slang"
filter_linear4 = "false"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
alias4 = ""
float_framebuffer4 = "false"
srgb_framebuffer4 = "false"
scale_type_x4 = "source"
scale_x4 = "1.000000"
scale_type_y4 = "source"
scale_y4 = "1.000000"
shader5 = "..\xbr\shaders\super-xbr\custom-jinc2-sharper.slang"
filter_linear5 = "false"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
alias5 = ""
float_framebuffer5 = "false"
srgb_framebuffer5 = "false"
parameters = "DETAILS;EQ_THRESH1;DIFF_THRESH1;EQ_THRESH2;DIFF_THRESH2;XBR_EDGE_STR;XBR_HV_EDGE_STR;XBR_WEIGHT;XBR_WEIGHT2;XBR_ANTI_RINGING;WP1;WP2;WP3;WP4;WP5;WP6;JINC2_WINDOW_SINC;JINC2_SINC;JINC2_AR_STRENGTH"
EQ_THRESH1 = "0.010000"
DIFF_THRESH1 = "0.060000"
EQ_THRESH2 = "0.010000"
DIFF_THRESH2 = "0.060000"
XBR_EDGE_STR = "2.000000"
XBR_HV_EDGE_STR = "2.000000"
XBR_WEIGHT = "1.000000"
XBR_WEIGHT2 = "1.000000"
XBR_ANTI_RINGING = "0.000000"
WP1 = "2.000000"
WP2 = "1.000000"
WP3 = "-1.000000"
WP4 = "4.000000"
WP5 = "-1.000000"
WP6 = "1.000000"
JINC2_WINDOW_SINC = "0.420000"
JINC2_SINC = "0.920000"
JINC2_AR_STRENGTH = "0.000000"
DETAILS = "1.0"