Skip to content

Commit

Permalink
vo_gpu: fix gamma scale
Browse files Browse the repository at this point in the history
This never really made sense since the BT.1886 changes. It should get
*brighter* for bright rooms, not darker for dark rooms. Picked some new
values that seemed reasonable-ish.
  • Loading branch information
haasn committed Sep 21, 2017
1 parent 61f5c42 commit db0fb3c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions DOCS/man/options.rst
Expand Up @@ -4649,22 +4649,22 @@ The following video options are currently all specific to ``--vo=gpu`` and
Recommended values based on the environmental brightness:

1.0
Brightly illuminated (default)
0.9
Slightly dim
0.8
Pitch black room
Pitch black or dimly lit room (default)
1.1
Moderately lit room, home
1.2
Brightly illuminated room, office

NOTE: Typical movie content (Blu-ray etc.) already contains a gamma drop of
about 0.8, so specifying it here as well will result in even darker
image than intended!
NOTE: This is based around the assumptions of typical movie content, which
contains an implicit end-to-end of about 0.8 from scene to display. For
bright environments it can be useful to cancel that out.

``--gamma-auto``
Automatically corrects the gamma value depending on ambient lighting
conditions (adding a gamma boost for dark rooms).
conditions (adding a gamma boost for bright rooms).

With ambient illuminance of 64lux, mpv will pick the 1.0 gamma value (no
boost), and slightly increase the boost up until 0.8 for 16lux.
With ambient illuminance of 16 lux, mpv will pick the 1.0 gamma value (no
boost), and slightly increase the boost up until 1.2 for 256 lux.

NOTE: Only implemented on OS X.

Expand Down
6 changes: 3 additions & 3 deletions video/out/gpu/video.c
Expand Up @@ -3738,9 +3738,9 @@ float gl_video_scale_ambient_lux(float lmin, float lmax,
void gl_video_set_ambient_lux(struct gl_video *p, int lux)
{
if (p->opts.gamma_auto) {
float gamma = gl_video_scale_ambient_lux(16.0, 64.0, 2.40, 1.961, lux);
MP_VERBOSE(p, "ambient light changed: %dlux (gamma: %f)\n", lux, gamma);
p->opts.gamma = MPMIN(1.0, 1.961 / gamma);
p->opts.gamma = gl_video_scale_ambient_lux(16.0, 256.0, 1.0, 1.2, lux);
MP_VERBOSE(p, "ambient light changed: %d lux (gamma: %f)\n", lux,
p->opts.gamma);
}
}

Expand Down

0 comments on commit db0fb3c

Please sign in to comment.