From 6adaddbe63196ba0c75796ce157d2e041c390b71 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 6 Dec 2014 23:59:22 +0100 Subject: vo_opengl: extend filter size to 64 For better downscaling. Maybe the list of filter sizes shouldn't be static... --- video/out/gl_video.c | 7 ++++--- video/out/gl_video_shaders.glsl | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/video/out/gl_video.c b/video/out/gl_video.c index 9fa1b4974f..efc1b7b9a7 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -82,10 +82,11 @@ const struct lut_tex_format lut_tex_formats[] = { [12] = {3, GL_RGBA16F, GL_RGBA}, [16] = {4, GL_RGBA16F, GL_RGBA}, [32] = {8, GL_RGBA16F, GL_RGBA}, + [64] = {16, GL_RGBA16F, GL_RGBA}, }; // must be sorted, and terminated with 0 -static const int filter_sizes[] = {2, 4, 6, 8, 12, 16, 32, 0}; +static const int filter_sizes[] = {2, 4, 6, 8, 12, 16, 32, 64, 0}; struct vertex { float position[2]; @@ -336,8 +337,8 @@ const struct m_sub_options gl_video_conf = { OPT_FLOAT("lparam2", scaler_params[0][1], 0), OPT_FLOAT("cparam1", scaler_params[1][0], 0), OPT_FLOAT("cparam2", scaler_params[1][1], 0), - OPT_FLOATRANGE("lradius", scaler_radius[0], 0, 1.0, 16.0), - OPT_FLOATRANGE("cradius", scaler_radius[1], 0, 1.0, 16.0), + OPT_FLOATRANGE("lradius", scaler_radius[0], 0, 1.0, 32.0), + OPT_FLOATRANGE("cradius", scaler_radius[1], 0, 1.0, 32.0), OPT_FLAG("scaler-resizes-only", scaler_resizes_only, 0), OPT_FLAG("fancy-downscaling", fancy_downscaling, 0), OPT_FLAG("indirect", indirect, 0), diff --git a/video/out/gl_video_shaders.glsl b/video/out/gl_video_shaders.glsl index 9998badbca..c4a70af2e4 100644 --- a/video/out/gl_video_shaders.glsl +++ b/video/out/gl_video_shaders.glsl @@ -255,6 +255,7 @@ WEIGHTS_N(weights8, 8) WEIGHTS_N(weights12, 12) WEIGHTS_N(weights16, 16) WEIGHTS_N(weights32, 32) +WEIGHTS_N(weights64, 64) #define CONVOLUTION_SEP_N(NAME, N) \ vec4 NAME(VIDEO_SAMPLER tex, vec2 texcoord, vec2 pt, float weights[N]) {\ @@ -272,6 +273,7 @@ CONVOLUTION_SEP_N(convolution_sep8, 8) CONVOLUTION_SEP_N(convolution_sep12, 12) CONVOLUTION_SEP_N(convolution_sep16, 16) CONVOLUTION_SEP_N(convolution_sep32, 32) +CONVOLUTION_SEP_N(convolution_sep64, 64) // The dir parameter is (0, 1) or (1, 0), and we expect the shader compiler to // remove all the redundant multiplications and additions. @@ -292,6 +294,7 @@ SAMPLE_CONVOLUTION_SEP_N(sample_convolution_sep8, 8, sampler2D, convolution_sep8 SAMPLE_CONVOLUTION_SEP_N(sample_convolution_sep12, 12, sampler2D, convolution_sep12, weights12) SAMPLE_CONVOLUTION_SEP_N(sample_convolution_sep16, 16, sampler2D, convolution_sep16, weights16) SAMPLE_CONVOLUTION_SEP_N(sample_convolution_sep32, 32, sampler2D, convolution_sep32, weights32) +SAMPLE_CONVOLUTION_SEP_N(sample_convolution_sep64, 64, sampler2D, convolution_sep64, weights64) #define CONVOLUTION_N(NAME, N) \ @@ -314,6 +317,7 @@ CONVOLUTION_N(convolution8, 8) CONVOLUTION_N(convolution12, 12) CONVOLUTION_N(convolution16, 16) CONVOLUTION_N(convolution32, 32) +CONVOLUTION_N(convolution64, 64) #define SAMPLE_CONVOLUTION_N(NAME, N, SAMPLERT, CONV_FUNC, WEIGHTS_FUNC) \ vec4 NAME(SAMPLERT lookup, VIDEO_SAMPLER tex, vec2 texsize, vec2 texcoord) {\ @@ -332,6 +336,7 @@ SAMPLE_CONVOLUTION_N(sample_convolution8, 8, sampler2D, convolution8, weights8) SAMPLE_CONVOLUTION_N(sample_convolution12, 12, sampler2D, convolution12, weights12) SAMPLE_CONVOLUTION_N(sample_convolution16, 16, sampler2D, convolution16, weights16) SAMPLE_CONVOLUTION_N(sample_convolution32, 32, sampler2D, convolution32, weights32) +SAMPLE_CONVOLUTION_N(sample_convolution64, 64, sampler2D, convolution64, weights64) // Unsharp masking -- cgit v1.2.3