[vlc-devel] Colorimetry Accuracy

Rémi Denis-Courmont remi at remlab.net
Tue Apr 19 10:56:16 CEST 2016

Le 2016-04-18 17:25, Steve Lhomme a écrit :
> I've looked at the patches following this week-end work for better
> color accuracy. It seems the additions on all the vouts do best 
> effort
> with what the API provided but don't update their output
> video_format_t to tell what changes they made from the input format.

XVideo partly does - at least it sets the YUV encoding.

> IMO it should be done.

Of course.

> But that means some filter will need to be inserted to match
> the codec output with the format the vout is actually assuming.

I'm not sure if video conversion filter can return their input picture 
as output picture; the core might assume that they always allocate a 
picture and write into it. That would require memory copying in the 
optimized for speed case... not so nice.

> We don't have such filters yet AFAIK but even when
> we do that will impact performance, as a trade off for accurate
> colors.

> Should this be an option to chose between speed and accuracy ?

It's not that simple. If you need to change the colour primaries or the 
gamma correction, then it's really dumb and inefficient to reencode as 
YUV afterwards. You should stick to RGB. And it's questionable if we 
want to support accurate color rendering with CPU conversions at all.

And then, the elephant in the room: you just can't render BT.2020 on a 
typical sRGB display: you can't expand the gamut by conversion, unless 
you accept values outside the nominal range. You need the monitor, the 
graphic card and the rendering API to support BT.2020. Currently, we 
don't have any video output exposing such API.

> If we add an option then, when accurate colors are selected, we
> shouldn't try to guess UNDEF values. That will give the false sense
> that it's going to be accurate. And if the vout also treats it as
> unknown/UNDEF there won't be any filter added either.
> Opinion ?

I think normal video outputs should always know their expect output. If 
it's not explicitly documented, then it's sRGB primaries, sRGB gamma 
and, if applicable, BT.601 encoding. OpenGL is sRGB primaries and linear 

Rémi Denis-Courmont

More information about the vlc-devel mailing list