vo_gpu: remove --scaler-lut-size

Pointless bloat option, hard-coded as 256 now in libplacebo and no
reason not to also hard-code in mpv.

See-Also: haasn/libplacebo@64d7c5aab0
This commit is contained in:
Niklas Haas 2023-09-20 18:18:59 +02:00 committed by Niklas Haas
parent 57fad2d5f9
commit 44cf6288c7
7 changed files with 10 additions and 23 deletions

View File

@ -91,6 +91,7 @@ Interface changes
- add `--window-corners` option
- rename `--cdrom-device` to `--cdda-device`
- remove `--scale-cutoff`, `--cscale-cutoff`, `--dscale-cutoff`, `--tscale-cutoff`
- remove `--scaler-lut-size`
--- mpv 0.36.0 ---
- add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used.

View File

@ -5391,14 +5391,6 @@ them.
Scale parameter (t). Increasing this makes the window wider. Defaults
to 1.
``--scaler-lut-size=<4..10>``
Set the size of the lookup texture for scaler kernels (default: 6). The
actual size of the texture is ``2^N`` for an option value of ``N``. So the
lookup texture with the default setting uses 64 samples.
All weights are linearly interpolated from those samples, so increasing
the size of lookup table might improve the accuracy of scaler.
``--scaler-resizes-only``
Disable the scaler if the video image is not resized. In that case,
``bilinear`` is used instead of whatever is set with ``--scale``. Bilinear

View File

@ -55,7 +55,6 @@ hdr-peak-percentile=99.995
hdr-contrast-recovery=0.30
allow-delayed-peak-detect=no
deband=yes
scaler-lut-size=8
# Deprecated alias
[gpu-hq]

View File

@ -311,7 +311,6 @@ static const struct gl_video_opts gl_video_opts_def = {
.correct_downscaling = true,
.linear_downscaling = true,
.sigmoid_upscaling = true,
.scaler_lut_size = 6,
.interpolation_threshold = 0.01,
.alpha_mode = ALPHA_BLEND_TILES,
.background = {0, 0, 0, 255},
@ -425,7 +424,7 @@ const struct m_sub_options gl_video_conf = {
SCALER_OPTS("dscale", SCALER_DSCALE),
SCALER_OPTS("cscale", SCALER_CSCALE),
SCALER_OPTS("tscale", SCALER_TSCALE),
{"scaler-lut-size", OPT_INT(scaler_lut_size), M_RANGE(4, 10)},
{"scaler-lut-size", OPT_REMOVED("hard-coded as 8")},
{"scaler-resizes-only", OPT_BOOL(scaler_resizes_only)},
{"correct-downscaling", OPT_BOOL(correct_downscaling)},
{"linear-downscaling", OPT_BOOL(linear_downscaling)},
@ -1784,17 +1783,16 @@ static void reinit_scaler(struct gl_video *p, struct scaler *scaler,
int stride = width * num_components;
assert(size <= stride);
scaler->lut_size = 1 << p->opts.scaler_lut_size;
float *weights = talloc_array(NULL, float, scaler->lut_size * stride);
mp_compute_lut(scaler->kernel, scaler->lut_size, stride, weights);
static const int lut_size = 256;
float *weights = talloc_array(NULL, float, lut_size * stride);
mp_compute_lut(scaler->kernel, lut_size, stride, weights);
bool use_1d = scaler->kernel->polar && (p->ra->caps & RA_CAP_TEX_1D);
struct ra_tex_params lut_params = {
.dimensions = use_1d ? 1 : 2,
.w = use_1d ? scaler->lut_size : width,
.h = use_1d ? 1 : scaler->lut_size,
.w = use_1d ? lut_size : width,
.h = use_1d ? 1 : lut_size,
.d = 1,
.format = fmt,
.render_src = true,

View File

@ -52,7 +52,6 @@ struct scaler {
struct ra_tex *lut;
struct ra_tex *sep_fbo;
bool insufficient;
int lut_size;
// kernel points here
struct filter_kernel kernel_storage;
@ -133,7 +132,6 @@ struct gl_tone_map_opts {
struct gl_video_opts {
int dumb_mode;
struct scaler_config scaler[4];
int scaler_lut_size;
float gamma;
bool gamma_auto;
int target_prim;

View File

@ -41,7 +41,7 @@ static void pass_sample_separated_get_weights(struct gl_shader_cache *sc,
struct scaler *scaler)
{
gl_sc_uniform_texture(sc, "lut", scaler->lut);
GLSLF("float ypos = LUT_POS(fcoord, %d.0);\n", scaler->lut_size);
GLSLF("float ypos = LUT_POS(fcoord, %d.0);\n", scaler->lut->params.h);
int N = scaler->kernel->size;
int width = (N + 3) / 4; // round up
@ -123,10 +123,10 @@ static void polar_sample(struct gl_shader_cache *sc, struct scaler *scaler,
// get the weight for this pixel
if (scaler->lut->params.dimensions == 1) {
GLSLF("w = tex1D(lut, LUT_POS(d * 1.0/%f, %d.0)).r;\n",
radius, scaler->lut_size);
radius, scaler->lut->params.w);
} else {
GLSLF("w = texture(lut, vec2(0.5, LUT_POS(d * 1.0/%f, %d.0))).r;\n",
radius, scaler->lut_size);
radius, scaler->lut->params.h);
}
GLSL(wsum += w;)

View File

@ -2063,7 +2063,6 @@ static void update_render_options(struct vo *vo)
struct priv *p = vo->priv;
pl_options pars = p->pars;
const struct gl_video_opts *opts = p->opts_cache->opts;
pars->params.lut_entries = 1 << opts->scaler_lut_size;
pars->params.antiringing_strength = opts->scaler[0].antiring;
pars->params.background_color[0] = opts->background.r / 255.0;
pars->params.background_color[1] = opts->background.g / 255.0;