[vlc-devel] [PATCH] [WIP] RFC: add HDR/BT.2020 support (using libplacebo)

Niklas Haas vlc at haasn.xyz
Thu Oct 26 15:59:20 CEST 2017

On Thu, 26 Oct 2017 00:59:56 +0200, Niklas Haas <vlc at haasn.xyz> wrote:
> Attached is my preliminary patch for how to use libplacebo
> (https://github.com/haasn/libplacebo) to convert between color spaces in
> VLC, including HDR->SDR tone mapping. libplacebo is an ongoing project
> to develop the GLSL rendering system from the mpv project into an
> independent, reusable library.
> Remaining issues that need to be resolved:
> - It needs to be added to the build system. Due to the early nature of
>   libplacebo and the unstable API that results from it, it should be
>   configured to use a pinned commit and build the library statically.
> - libplacebo requires LC_NUMERIC="C" (so `snprintf` works). I'm not sure
>   what the best way to accomplish this in VLC is; but one way is to use
>   `uselocale` from opengl/vout_helper.c to explicitly set the locale for
>   that thread. Alternatively, I could try making libplacebo set the
>   locale back and forth in every function so as to not depend on it, but
>   I'd rather not if I can avoid it.
> - We should use libplacebo in more ways, for example to replace the
>   YUV->RGB conversion code (which would also allow VLC to support the
>   proper BT.2020 transformation including BT.2020-CL; and also allow VLC
>   to get rid of the special cased code for XYZ12). But I think this
>   would probably be better off as a second/separate commit.
> Thoughts? Milestone?

Another thing I remembered:

- Needs integration with the VLC options menu, at least for the
  pl_tone_mapping_params; and ideally also for the desired output color
  space (so users with wide gamut monitors and so forth can configure

More information about the vlc-devel mailing list