[vlc-devel] [PATCH] opengl: add GUI options for libplacebo settings

Rémi Denis-Courmont remi at remlab.net
Sat Dec 30 18:24:18 CET 2017


On samedi 30 décembre 2017 05:14:57 EET vlc at haasn.xyz wrote:
> From: Niklas Haas <git at haasn.xyz>
> 
> This allows user to override the target colorspace, some of the
> colorspace conversion options, the tone mapping settings, and some of
> the dithering settings.
> 
> Settings which I decided to omit include:
> - dither LUT size (limited by the shader embedding method)
> - temporal dither (not currently possible)
> - overrides for the source colorspace (shouldn't persist)
> - target display's light type (unlikely to not be _DISPLAY)
> - target display's HDR metadata (usually taken care of by the display)
> 
> Note: This is based on top of my previous patchset, so don't be
> surprised if it fails merging as-is.
> ---
>  modules/video_output/opengl/display.c          | 169
> +++++++++++++++++++++++++ modules/video_output/opengl/fragment_shaders.c | 
> 32 ++++-
>  2 files changed, 194 insertions(+), 7 deletions(-)
> 
> diff --git a/modules/video_output/opengl/display.c
> b/modules/video_output/opengl/display.c index 2ecdd0caaa..e4006fcd01 100644
> --- a/modules/video_output/opengl/display.c
> +++ b/modules/video_output/opengl/display.c
> @@ -42,6 +42,149 @@ static void Close (vlc_object_t *);
>  #define PROVIDER_LONGTEXT N_( \
>      "Extension through which to use the Open Graphics Library (OpenGL).")
> 
> +#ifdef HAVE_LIBPLACEBO
> +
> +#include <libplacebo/shaders/colorspace.h>
> +
> +#define RENDER_INTENT_TEXT N_("Rendering intent for color conversion")
> +#define RENDER_INTENT_LONGTEXT N_("The algorithm used to convert between
> color spaces") +
> +static const enum pl_rendering_intent intent_values[] = {
> +    PL_INTENT_PERCEPTUAL,
> +    PL_INTENT_RELATIVE_COLORIMETRIC,
> +    PL_INTENT_SATURATION,
> +    PL_INTENT_ABSOLUTE_COLORIMETRIC,
> +};
> +
> +static const char * const intent_text[] = {
> +    "Perceptual",
> +    "Relative colorimetric",
> +    "Absolute colorimetric",
> +    "Saturation",
> +};
> +
> +#define PRIM_TEXT N_("Display primaries")
> +#define PRIM_LONGTEXT N_("The primaries associated with the output
> display") +
> +static const enum pl_color_primaries prim_values[] = {
> +    PL_COLOR_PRIM_UNKNOWN,
> +    PL_COLOR_PRIM_BT_601_525,
> +    PL_COLOR_PRIM_BT_601_625,
> +    PL_COLOR_PRIM_BT_709,
> +    PL_COLOR_PRIM_BT_470M,
> +    PL_COLOR_PRIM_BT_2020,
> +    PL_COLOR_PRIM_APPLE,
> +    PL_COLOR_PRIM_ADOBE,
> +    PL_COLOR_PRIM_PRO_PHOTO,
> +    PL_COLOR_PRIM_CIE_1931,
> +    PL_COLOR_PRIM_DCI_P3,
> +    PL_COLOR_PRIM_V_GAMUT,
> +    PL_COLOR_PRIM_S_GAMUT,
> +};

Integers list must be (const) int *. There are no warranties that enum is 
compatible int. That's definitely not universally true.

> +
> +static const char * const prim_text[] = {
> +    "Unknown primaries",
> +    "ITU-R Rec. BT.601 (525-line = NTSC, SMPTE-C)",
> +    "ITU-R Rec. BT.601 (625-line = PAL, SECAM)",
> +    "ITU-R Rec. BT.709 (HD), also sRGB",
> +    "ITU-R Rec. BT.470 M",
> +    "ITU-R Rec. BT.2020 (UltraHD)",
> +    "Apple RGB",
> +    "Adobe RGB (1998)",
> +    "ProPhoto RGB (ROMM)",
> +    "CIE 1931 RGB primaries",
> +    "DCI-P3 (Digital Cinema)",
> +    "Panasonic V-Gamut (VARICAM)",
> +    "Sony S-Gamut",
> +};
> +
> +#define TRC_TEXT N_("Display gamma / transfer function")
> +#define TRC_LONGTEXT N_("The gamma/transfer function associated with the
> output display") +
> +static const enum pl_color_transfer trc_values[] = {
> +    PL_COLOR_TRC_UNKNOWN,
> +    PL_COLOR_TRC_BT_1886,
> +    PL_COLOR_TRC_SRGB,
> +    PL_COLOR_TRC_LINEAR,
> +    PL_COLOR_TRC_GAMMA18,
> +    PL_COLOR_TRC_GAMMA22,
> +    PL_COLOR_TRC_GAMMA28,
> +    PL_COLOR_TRC_PRO_PHOTO,
> +    PL_COLOR_TRC_PQ,
> +    PL_COLOR_TRC_HLG,
> +    PL_COLOR_TRC_V_LOG,
> +    PL_COLOR_TRC_S_LOG1,
> +    PL_COLOR_TRC_S_LOG2,
> +};

Ditto.


-- 
Rémi Denis-Courmont


More information about the vlc-devel mailing list