diff options
author | wm4 <wm4@nowhere> | 2013-03-28 21:39:17 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-03-28 21:46:18 +0100 |
commit | 2585baa649afdda14069aa1d20d32706bb97b8f9 (patch) | |
tree | 61192e0a31cbb9b4997543e1dc5200560b2f7794 | |
parent | 8d7858dd9d10181e4cb812827f1f631d06fc779e (diff) | |
download | mpv-2585baa649afdda14069aa1d20d32706bb97b8f9.tar.bz2 mpv-2585baa649afdda14069aa1d20d32706bb97b8f9.tar.xz |
gl_video: use choice option type for dither-depth suboption
Replaces the numeric magic values -1 and 0 with "no" and "auto". The
numeric values are still allowed for compatibility.
-rw-r--r-- | DOCS/man/en/vo.rst | 12 | ||||
-rw-r--r-- | video/out/gl_video.c | 3 | ||||
-rw-r--r-- | video/out/vo_opengl.c | 12 |
3 files changed, 14 insertions, 13 deletions
diff --git a/DOCS/man/en/vo.rst b/DOCS/man/en/vo.rst index f3336afef6..6d64e3062e 100644 --- a/DOCS/man/en/vo.rst +++ b/DOCS/man/en/vo.rst @@ -319,12 +319,12 @@ opengl Enable use of PBOs. This is faster, but can sometimes lead to sporadic and temporary image corruption. - dither-depth=<n> - Positive non-zero values select the target bit depth. Default: 0. + dither-depth=<N|no|auto> + Set dither target depth to N. Default: auto. - \-1 + no Disable any dithering done by mpv. - 0 + auto Automatic selection. If output bit depth can't be detected, 8 bits per component are assumed. 8 @@ -444,10 +444,10 @@ opengl-hq This is equivalent to: - | --vo=opengl:lscale=lanczos2:dither-depth=0:pbo:fbo-format=rgb16 + | --vo=opengl:lscale=lanczos2:dither-depth=auto:pbo:fbo-format=rgb16 Note that some cheaper LCDs do dithering that gravely interferes with - vo_opengl's dithering. Disabling dithering with ``dither-depth=-1`` helps. + vo_opengl's dithering. Disabling dithering with ``dither-depth=no`` helps. Unlike ``opengl``, ``opengl-hq`` makes use of FBOs by default. Sometimes you can achieve better quality or performance by changing the fbo-format diff --git a/video/out/gl_video.c b/video/out/gl_video.c index 5b98e42d56..22f4100e9a 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -256,7 +256,8 @@ const struct m_sub_options gl_video_conf = { {"rgba16", GL_RGBA16}, {"rgba16f", GL_RGBA16F}, {"rgba32f", GL_RGBA32F})), - OPT_INTRANGE("dither-depth", dither_depth, 0, -1, 16), + OPT_CHOICE_OR_INT("dither-depth", dither_depth, 0, -1, 16, + ({"no", -1}, {"auto", 0})), OPT_FLAG("alpha", enable_alpha, 0), {0} }, diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index ba31e0cbf5..3469cae794 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -390,7 +390,7 @@ const struct vo_driver video_out_opengl_hq = { .priv_size = sizeof(struct gl_priv), .options = options, .help_text = help_text, - .init_option_string = "lscale=lanczos2:dither-depth=0:pbo:fbo-format=rgb16", + .init_option_string = "lscale=lanczos2:dither-depth=auto:pbo:fbo-format=rgb16", }; static const char help_text[] = @@ -431,11 +431,11 @@ static const char help_text[] = " sporadic and temporary image corruption.\n" " dither-depth=<n>\n" " Positive non-zero values select the target bit depth.\n" -" -1: Disable any dithering done by mpv.\n" -" 0: Automatic selection. If output bit depth can't be detected,\n" -" 8 bits per component are assumed.\n" -" 8: Dither to 8 bit output.\n" -" Default: -1.\n" +" no: Disable any dithering done by mpv.\n" +" auto: Automatic selection. If output bit depth can't be detected,\n" +" 8 bits per component are assumed.\n" +" 8: Dither to 8 bit output.\n" +" Default: no.\n" " debug\n" " Check for OpenGL errors, i.e. call glGetError(). Also request a\n" " debug OpenGL context.\n" |