Thread: VirtualDub2
View Single Post
Old 13th January 2017, 21:06   #143  |  Link
dipje
Registered User
 
Join Date: Oct 2014
Posts: 268
As far as I see it, there is a '2020' that is possible as a regular color matrix, and another one that requires special coding that it can't be easily implemented in the same conversion routines (fmtconv in vapoursynth has a special function for it for instance).
'non constant luminance mode' (ncl) is the simpler one, and you'll encounter it more often. 'constant luminance mode' (cl) is the 'special' one.

The thing is, it's not just the colormatrix. Most 2020 stuff uses different color primaries then bt709 (although 2020ncl with bt709 does exist.. it's not _that_ weird, just not the only stuff out there).
So the correct way to change / convert color primaries is to go to RGB, then to linear RGB (gamma 1.0), convert the color primaries (from bt709 to 2020, or from bt709 to dci-p3 for example).
Then go to gamma-correct 'normal' RGB again then convert to the YUV with the colormatrix you want (or leave it RGB if that suites you).

This all is to convert the colormatrix and/or colorprimaries. The thing to remember is, this does NOT convert HDR to SDR or something. What you end up with is still all the HDR information but in a colorspace-configuration that you know from SDR times. To make the stuff watchable on SDR displays you would still have to do some kind of dynamic-range compression and / or clip some stuff out to get it watchable. I could get stuff looking pretty OK by tweaking the gamma correction but there are better ways (for example, what MadVR does to display HDR content on SDR displays).

So, colorspace conversion is one thing. HDR to SDR conversion is another. And of course stuff like the 2020 colormatrix and 2020 colorprimaries (or dci-p3 color primaries or something else) has a much wider gamut of colors available, so you will be loosing color precision / data somewhere (colors _should_ end up over saturated here and there in bt709, unless you use some smart 'desaturation' filter during the conversion.. again, like MadVR does).
dipje is offline   Reply With Quote