From 58a7d81dc55835fb0f5cc6a3f14288d722f83c91 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 26 May 2013 01:48:39 +0200 Subject: gl_video: improve dithering Use a different algorithm to generate the dithering matrix. This looks much better than the previous ordered dither matrix with its cross-hatch artifacts. The matrix generation algorithm as well as its implementation was contributed by Wessel Dankers aka Fruit. The code in dither.c is his implementation, reformatted and with static global variables removed by me. The new matrix is uploaded as float texture - before this commit, it was a normal integer fixed point matrix. This means dithering will be disabled on systems without float textures. The size of the dithering matrix can be configured, as the matrix is generated at runtime. The generation of the matrix can take rather long, and is already unacceptable with size 8. The default is at 6, which takes about 100 ms on a Core2 Duo system with dither.c compiled at -O2, which I consider just about acceptable. The old ordered dithering is still available and can be selected by putting the dither=ordered sub-option. The ordered dither matrix generation code was moved to dither.c. This function was originally written by Uoti Urpala. --- DOCS/man/en/vo.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'DOCS/man/en') diff --git a/DOCS/man/en/vo.rst b/DOCS/man/en/vo.rst index 3204169a47..0aaee33965 100644 --- a/DOCS/man/en/vo.rst +++ b/DOCS/man/en/vo.rst @@ -342,6 +342,24 @@ opengl detected. Often, LCD panels will do dithering on their own, which conflicts with vo_opengl's dithering, and leads to ugly output. + dither-size=<2-8> + Set the size of the dither matrix (default: 6). The actual size of + the matrix is ``(N^2) x (N^2)`` for an option value of ``N``, so a + value of 6 gives a size of 64x64. The matrix is generated at startup + time, and a large matrix can take rather long to compute (seconds). + + Used for ``fruit`` dithering only. + + dither= + Select dithering algorithm (default: fruit). + + temporal-dither + Enable temporal dithering. (Only active if dithering is enabled in + general.) This changes between 8 different dithering pattern on each + frame by changing the orientation of the tiled dithering matrix. + Unfortunately, this can lead to flicker on LCD displays, since these + have a high reaction time. + debug Check for OpenGL errors, i.e. call glGetError(). Also request a debug OpenGL context (which does nothing with current graphics drivers -- cgit v1.2.3