summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-06 23:59:22 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-01-25 17:00:12 +0900
commit60c6307a971dca17af902eabd0750b4d8556155f (patch)
treeb9e7bd140a9f91943285a1ae8e94802188d6885a
parent99f237beb9b13eb6a502fef92f29b462d4da9029 (diff)
downloadmpv-60c6307a971dca17af902eabd0750b4d8556155f.tar.bz2
mpv-60c6307a971dca17af902eabd0750b4d8556155f.tar.xz
vo_opengl: extend filter size to 64
For better downscaling. Maybe the list of filter sizes shouldn't be static...
-rw-r--r--video/out/gl_video.c7
-rw-r--r--video/out/gl_video_shaders.glsl5
2 files changed, 9 insertions, 3 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 70734129e7..df2be21a16 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -81,10 +81,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];
@@ -333,8 +334,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