vo_opengl: use low quality default settings, add opengl-hq alias

Change the default settings for vo_opengl to highest performance and
compatibility, but lowest quality. Use bilinear as default scaler.

Add "opengl-hq" as alias for high quality settings. This alias uses
exactly the same settings as vo_opengl did before this commit.
This commit is contained in:
wm4 2012-09-29 18:36:05 +02:00
parent 3cbce1eb07
commit 47d15a5b6b
3 changed files with 50 additions and 17 deletions

View File

@ -228,14 +228,13 @@ corevideo (Mac OS X 10.6 and later)
for vo_opengl_).
.. _vo_opengl:
opengl
OpenGL video output driver.
OpenGL video output driver. It supports extended scaling methods, dithering
and color management.
It supports extended scaling methods, dithering and color management.
It tries to use sane defaults for good quality output.
Note that some cheaper LCDs do dithering that gravely interferes with
vo_opengl's dithering. Disabling dithering with ``dither-depth=-1`` helps.
By default, it tries to use fast and fail-safe settings. Use the driver
``opengl-hq`` to use this driver with a high quality rendering preset.
Requires at least OpenGL 2.1 and the GL_ARB_texture_rg extension. For older
drivers, ``opengl-old`` may work.
@ -375,10 +374,9 @@ opengl
RGB. If chroma is not subsampled, this option is ignored, and the
luma scaler is used instead. Setting this option is often useless.
no-fancy-downscaling
When using convolution based filters, don't extend the filter
size when downscaling. Trades downscaling performance for
reduced quality.
fancy-downscaling
When using convolution based filters, extend the filter size
when downscaling. Trades quality for reduced downscaling performance.
no-npot
Force use of power-of-2 texture sizes. For debugging only.
@ -443,6 +441,17 @@ opengl
dimension. Default is 128x256x64.
Sizes must be a power of two, and 256 at most.
opengl-hq
Same as ``opengl``, but with default settings for high quality rendering.
This is equivalent to:
| --vo=opengl:lscale=lanczos2:fancy-downscaling:dither-depth=0
Note that some cheaper LCDs do dithering that gravely interferes with
vo_opengl's dithering. Disabling dithering with ``dither-depth=-1`` helps.
opengl-old
OpenGL video output driver, old version. Video size must be smaller
than the maximum texture size of your OpenGL implementation. Intended to

View File

@ -75,6 +75,7 @@ extern struct vo_driver video_out_x11;
extern struct vo_driver video_out_vdpau;
extern struct vo_driver video_out_xv;
extern struct vo_driver video_out_opengl;
extern struct vo_driver video_out_opengl_hq;
extern struct vo_driver video_out_opengl_old;
extern struct vo_driver video_out_null;
extern struct vo_driver video_out_image;
@ -120,6 +121,9 @@ const struct vo_driver *video_out_drivers[] =
&video_out_image,
#ifdef CONFIG_ENCODING
&video_out_lavc,
#endif
#ifdef CONFIG_GL
&video_out_opengl_hq,
#endif
NULL
};
@ -287,7 +291,7 @@ static void replace_legacy_vo_name(bstr *name)
if (bstr_equals0(*name, "gl"))
new = bstr0("opengl");
if (bstr_equals0(*name, "gl3"))
new = bstr0("opengl");
new = bstr0("opengl-hq");
if (!bstr_equals(*name, new)) {
mp_tmsg(MSGT_CPLAYER, MSGL_ERR, "VO driver '%.*s' has been replaced "
"with '%.*s'!\n", BSTR_P(*name), BSTR_P(new));

View File

@ -2323,6 +2323,8 @@ static int preinit(struct vo *vo, const char *arg)
struct gl_priv *p = talloc_zero(vo, struct gl_priv);
vo->priv = p;
bool hq = strcmp(vo->driver->info->short_name, "opengl-hq") == 0;
*p = (struct gl_priv) {
.vo = vo,
.colorspace = MP_CSP_DETAILS_DEFAULTS,
@ -2330,11 +2332,12 @@ static int preinit(struct vo *vo, const char *arg)
.use_pbo = 0,
.swap_interval = vo_vsync,
.osd_color = 0xffffff,
.dither_depth = hq ? 0 : -1,
.fbo_format = GL_RGB16,
.use_scale_sep = 1,
.use_fancy_downscaling = 1,
.use_fancy_downscaling = hq,
.scalers = {
{ .index = 0, .name = "lanczos2" },
{ .index = 0, .name = hq ? "lanczos2" : "bilinear" },
{ .index = 1, .name = "bilinear" },
},
.scaler_params = {NAN, NAN},
@ -2459,6 +2462,24 @@ const struct vo_driver video_out_opengl = {
.uninit = uninit,
};
const struct vo_driver video_out_opengl_hq = {
.is_new = true,
.info = &(const vo_info_t) {
"Extended OpenGL Renderer (high quality rendering preset)",
"opengl-hq",
"Based on vo_gl.c by Reimar Doeffinger",
""
},
.preinit = preinit,
.config = config,
.control = control,
.draw_slice = draw_slice,
.draw_osd = draw_osd,
.flip_page = flip_page,
.check_events = check_events,
.uninit = uninit,
};
static const char help_text[] =
"\n--vo=opengl command line help:\n"
"Example: mplayer --vo=opengl:scale-sep:lscale=lanczos2\n"
@ -2528,10 +2549,9 @@ static const char help_text[] =
" Note that with some scaling filters, upscaling is always done in\n"
" RGB. If chroma is not subsampled, this option is ignored, and the\n"
" luma scaler is used instead. Setting this option is often useless.\n"
" no-fancy-downscaling\n"
" When using convolution based filters, don't extend the filter\n"
" size when downscaling. Trades downscaling performance for\n"
" reduced quality.\n"
" fancy-downscaling\n"
" When using convolution based filters, extend the filter size\n"
" when downscaling. Trades quality for reduced downscaling performance.\n"
" no-npot\n"
" Force use of power-of-2 texture sizes. For debugging only.\n"
" Borders will look discolored due to filtering.\n"