summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2016-03-05 12:02:01 +0100
committerwm4 <wm4@nowhere>2016-03-05 13:08:38 +0100
commitb81036524a834ebf33d7ae520153be0062d3dae5 (patch)
tree4e1ec94567826f8e585871d6c7d3b90850241dc6
parent8ac6f6acf0845b390fe02f8d7fd5b3155a592c2d (diff)
downloadmpv-b81036524a834ebf33d7ae520153be0062d3dae5.tar.bz2
mpv-b81036524a834ebf33d7ae520153be0062d3dae5.tar.xz
vo_opengl: rename prescale to prescale-luma
Since prescale now literally only affects the luma plane (and the filters are all designed for luma-only operation either way), the option has been renamed and the documentation updated to clarify this.
-rw-r--r--DOCS/man/vo.rst14
-rw-r--r--video/out/opengl/video.c25
-rw-r--r--video/out/opengl/video.h2
3 files changed, 18 insertions, 23 deletions
diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst
index 58bd91cd55..9c5a2bc2c1 100644
--- a/DOCS/man/vo.rst
+++ b/DOCS/man/vo.rst
@@ -582,12 +582,10 @@ Available video output drivers are:
better than without it) since it will extend the size to match only the
milder of the scale factors between the axes.
- ``prescale=<filter>``
- This option provides non-convolution-based filters for upscaling. These
- filters resize the video to multiple of the original size (all currently
- supported prescalers can only perform image doubling in a single pass).
- Generally another convolution based filter (the main scaler) will be
- applied after prescaler to match the target display size.
+ ``prescale-luma=<filter>``
+ Apply additional pre-scaling (image doubling) on the luma plane
+ (if present). As the name implies, these will run before the main
+ upscaling pass.
``none``
Disable all prescalers. This is the default.
@@ -605,10 +603,6 @@ Available video output drivers are:
Extremely slow and requires a recent mid or high end graphics card
to work smoothly (as of 2015).
- Note that all the filters above are designed (or implemented) to process
- luma plane only and probably won't work as intended for video in RGB
- format.
-
``prescale-passes=<1..5>``
The number of passes to apply the prescaler (defaults to be 1). Setting
it to 2 will perform a 4x upscaling.
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 3ad6bfe482..f748dd18b9 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -485,7 +485,7 @@ const struct m_sub_options gl_video_conf = {
OPT_FLAG("deband", deband, 0),
OPT_SUBSTRUCT("deband", deband_opts, deband_conf, 0),
OPT_FLOAT("sharpen", unsharp, 0),
- OPT_CHOICE("prescale", prescale, 0,
+ OPT_CHOICE("prescale-luma", prescale_luma, 0,
({"none", 0},
{"superxbr", 1}
#if HAVE_NNEDI
@@ -520,6 +520,7 @@ const struct m_sub_options gl_video_conf = {
OPT_REPLACED("smoothmotion-threshold", "tscale-param1"),
OPT_REPLACED("scale-down", "dscale"),
OPT_REPLACED("fancy-downscaling", "correct-downscaling"),
+ OPT_REPLACED("prescale", "prescale-luma"),
{0}
},
@@ -1317,7 +1318,7 @@ static void pass_sample(struct gl_video *p, struct img_tex tex,
// Get the number of passes for prescaler, with given display size.
static int get_prescale_passes(struct gl_video *p, struct img_tex tex[4])
{
- if (!p->opts.prescale)
+ if (!p->opts.prescale_luma)
return 0;
// Return 0 if no luma planes exist
@@ -1374,9 +1375,9 @@ static void upload_nnedi3_weights(struct gl_video *p)
// Applies a single pass of the prescaler, and accumulates the offset in
// pass_transform.
-static void pass_prescale(struct gl_video *p, struct img_tex *tex,
- struct gl_transform *pass_transform,
- struct fbotex fbo[MAX_PRESCALE_STEPS])
+static void pass_prescale_luma(struct gl_video *p, struct img_tex *tex,
+ struct gl_transform *pass_transform,
+ struct fbotex fbo[MAX_PRESCALE_STEPS])
{
// Happens to be the same for superxbr and nnedi3.
const int num_steps = 2;
@@ -1385,7 +1386,7 @@ static void pass_prescale(struct gl_video *p, struct img_tex *tex,
struct gl_transform step_transform = {{{0}}};
int id = pass_bind(p, *tex);
- switch(p->opts.prescale) {
+ switch(p->opts.prescale_luma) {
case 1:
pass_superxbr(p->sc, tex->components, id, step, tex->multiplier,
p->opts.superxbr_opts, &step_transform);
@@ -1574,8 +1575,8 @@ static void pass_read_video(struct gl_video *p)
// Plane still needs prescaling passes
if (needs_prescale[n]) {
GLSLF("// prescaling plane %d (%d left)\n", n, needs_prescale[n]);
- pass_prescale(p, &tex[n], &tex_trans,
- p->prescale_fbo[needs_prescale[n]-1]);
+ pass_prescale_luma(p, &tex[n], &tex_trans,
+ p->prescale_fbo[needs_prescale[n]-1]);
needs_prescale[n]--;
// We can skip scaling if we arrived at our target res
@@ -2556,7 +2557,7 @@ static bool check_dumb_mode(struct gl_video *p)
return true;
if (o->target_prim || o->target_trc || o->linear_scaling ||
o->correct_downscaling || o->sigmoid_upscaling || o->interpolation ||
- o->blend_subs || o->deband || o->unsharp || o->prescale)
+ o->blend_subs || o->deband || o->unsharp || o->prescale_luma)
return false;
// check remaining scalers (tscale is already implicitly excluded above)
for (int i = 0; i < SCALER_COUNT; i++) {
@@ -2674,13 +2675,13 @@ static void check_gl_features(struct gl_video *p)
MP_WARN(p, "Disabling debanding (GLSL version too old).\n");
}
- if (p->opts.prescale == 2) {
+ if (p->opts.prescale_luma == 2) {
if (p->opts.nnedi3_opts->upload == NNEDI3_UPLOAD_UBO) {
// Check features for uniform buffer objects.
if (!gl->BindBufferBase || !gl->GetUniformBlockIndex) {
MP_WARN(p, "Disabling NNEDI3 (%s required).\n",
gl->es ? "OpenGL ES 3.0" : "OpenGL 3.1");
- p->opts.prescale = 0;
+ p->opts.prescale_luma = 0;
}
} else if (p->opts.nnedi3_opts->upload == NNEDI3_UPLOAD_SHADER) {
// Check features for hard coding approach.
@@ -2689,7 +2690,7 @@ static void check_gl_features(struct gl_video *p)
{
MP_WARN(p, "Disabling NNEDI3 (%s required).\n",
gl->es ? "OpenGL ES 3.0" : "OpenGL 3.3");
- p->opts.prescale = 0;
+ p->opts.prescale_luma = 0;
}
}
}
diff --git a/video/out/opengl/video.h b/video/out/opengl/video.h
index db1a80e074..706982f9e5 100644
--- a/video/out/opengl/video.h
+++ b/video/out/opengl/video.h
@@ -110,7 +110,7 @@ struct gl_video_opts {
int deband;
struct deband_opts *deband_opts;
float unsharp;
- int prescale;
+ int prescale_luma;
int prescale_passes;
float prescale_downscaling_threshold;
struct superxbr_opts *superxbr_opts;