diff options
author | Bin Jin <bjin1990@gmail.com> | 2015-12-05 19:14:23 +0000 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-12-07 23:48:18 +0100 |
commit | e6058d3dc30ca8160ebeb8bba562ba08574164bb (patch) | |
tree | 50e9a8e877f002054dc35434203552f0b8792002 /video | |
parent | c1a96de41c9e3b38d0946d5c02c1faf5b39d4074 (diff) | |
download | mpv-e6058d3dc30ca8160ebeb8bba562ba08574164bb.tar.bz2 mpv-e6058d3dc30ca8160ebeb8bba562ba08574164bb.tar.xz |
vo_opengl: make LOOKUP_TEXTURE_SIZE configurable
Diffstat (limited to 'video')
-rw-r--r-- | video/out/opengl/video.c | 8 | ||||
-rw-r--r-- | video/out/opengl/video.h | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index de20984cdc..0fdc4df0a2 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -49,9 +49,6 @@ #include "video/out/dither.h" #include "video/out/vo.h" -// Pixel width of 1D lookup textures. -#define LOOKUP_TEXTURE_SIZE 256 - // Maximal number of passes that prescaler can be applied. #define MAX_PRESCALE_PASSES 5 @@ -348,6 +345,7 @@ const struct gl_video_opts gl_video_opts_def = { {{"mitchell", .params={NAN, NAN}}, {.params = {NAN, NAN}}, .clamp = 1, }, // tscale }, + .scaler_lut_size = 8, .alpha_mode = 2, .background = {0, 0, 0, 255}, .gamma = 1.0f, @@ -371,6 +369,7 @@ const struct gl_video_opts gl_video_opts_hq_def = { {{"mitchell", .params={NAN, NAN}}, {.params = {NAN, NAN}}, .clamp = 1, }, // tscale }, + .scaler_lut_size = 8, .alpha_mode = 2, .background = {0, 0, 0, 255}, .gamma = 1.0f, @@ -412,6 +411,7 @@ const struct m_sub_options gl_video_conf = { SCALER_OPTS("dscale", 1), SCALER_OPTS("cscale", 2), SCALER_OPTS("tscale", 3), + OPT_INTRANGE("scaler-lut-size", scaler_lut_size, 0, 4, 10), OPT_FLAG("scaler-resizes-only", scaler_resizes_only, 0), OPT_FLAG("linear-scaling", linear_scaling, 0), OPT_FLAG("correct-downscaling", correct_downscaling, 0), @@ -1081,7 +1081,7 @@ static void reinit_scaler(struct gl_video *p, struct scaler *scaler, gl->BindTexture(target, scaler->gl_lut); - scaler->lut_size = LOOKUP_TEXTURE_SIZE; + scaler->lut_size = 1 << p->opts.scaler_lut_size; float *weights = talloc_array(NULL, float, scaler->lut_size * size); mp_compute_lut(scaler->kernel, scaler->lut_size, weights); diff --git a/video/out/opengl/video.h b/video/out/opengl/video.h index a56c0c1c09..4dab617cda 100644 --- a/video/out/opengl/video.h +++ b/video/out/opengl/video.h @@ -71,6 +71,7 @@ struct scaler { struct gl_video_opts { int dumb_mode; struct scaler_config scaler[4]; + int scaler_lut_size; float gamma; int gamma_auto; int target_prim; |