vf_format: add gamma override option

This commit is contained in:
Niklas Haas 2015-03-31 07:47:13 +02:00
parent 51bb5e8194
commit 717e7a5baa
2 changed files with 26 additions and 0 deletions

View File

@ -305,6 +305,28 @@ Available filters are:
:prophoto: ProPhoto RGB (ROMM)
:cie1931: CIE 1931 RGB
``<gamma>``
Gamma function the source file was encoded with. Normally this should be set
in the file header, but when playing broken or mistagged files this can be
used to override the setting.
This option only affects video output drivers that perform color management.
If this option is set to ``auto`` (which is the default), the gamma will
be set to BT.1886 for YCbCr content, sRGB for RGB content and Linear for
XYZ content.
Available gamma functions are:
:auto: automatic selection (default)
:bt.1886: ITU-R BT.1886 (approximation of BT.601/BT.709/BT.2020 curve)
:srgb: IEC 61966-2-4 (sRGB)
:linear: Linear light
:gamma1.8: Pure power curve (gamma 1.8)
:gamma2.2: Pure power curve (gamma 2.2)
:gamma2.8: Pure power curve (gamma 2.8)
:prophoto: ProPhoto RGB (ROMM) curve
``<stereo-in>``
Set the stereo mode the video is assumed to be encoded in. Takes the
same values as the ``--video-stereo-mode`` option.

View File

@ -37,6 +37,7 @@ struct vf_priv_s {
int colorlevels;
int outputlevels;
int primaries;
int gamma;
int chroma_location;
int stereo_in;
int stereo_out;
@ -93,6 +94,8 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in,
out->outputlevels = p->outputlevels;
if (p->primaries)
out->primaries = p->primaries;
if (p->gamma)
out->gamma = p->gamma;
if (p->chroma_location)
out->chroma_location = p->chroma_location;
if (p->stereo_in)
@ -137,6 +140,7 @@ static const m_option_t vf_opts_fields[] = {
OPT_CHOICE_C("colorlevels", colorlevels, 0, mp_csp_levels_names),
OPT_CHOICE_C("outputlevels", outputlevels, 0, mp_csp_levels_names),
OPT_CHOICE_C("primaries", primaries, 0, mp_csp_prim_names),
OPT_CHOICE_C("gamma", gamma, 0, mp_csp_trc_names),
OPT_CHOICE_C("chroma-location", chroma_location, 0, mp_chroma_names),
OPT_CHOICE_C("stereo-in", stereo_in, 0, mp_stereo3d_names),
OPT_CHOICE_C("stereo-out", stereo_out, 0, mp_stereo3d_names),