[mythtv-commits] [MythTV/mythtv] dc5f91: VideoColourSpace: Add Colour Primaries conversion ...

Mark Kendall noreply at github.com
Fri Jun 28 09:11:42 UTC 2019

  Branch: refs/heads/devel/2019-render
  Home:   https://github.com/MythTV/mythtv
  Commit: dc5f911c428cf18e66f6515b3f0618ac6c8878ef
  Author: Mark Kendall <mark.kendall at gmail.com>
  Date:   2019-06-28 (Fri, 28 Jun 2019)

  Changed paths:
    M mythtv/libs/libmythtv/mythvdpauinterop.cpp
    M mythtv/libs/libmythtv/mythvdpauinterop.h
    M mythtv/libs/libmythtv/openglvideo.cpp
    M mythtv/libs/libmythtv/openglvideo.h
    M mythtv/libs/libmythtv/openglvideoshaders.h
    M mythtv/libs/libmythtv/videocolourspace.cpp
    M mythtv/libs/libmythtv/videocolourspace.h
    M mythtv/libs/libmythtv/videoouttypes.h

  Log Message:
  VideoColourSpace: Add Colour Primaries conversion support

- the existing colourspace support converts YCbCr data to RGB using a
conversion matrix calculated for the colourspace standard in use.
- this works well most of the time for 'old school' colour standards
which have very similar primaries and gamma and are generally displayed
on a Rec BT 709 display - again with similar primaries and gamma.
- it starts to break down with newer BT2020/HDR material where the
primaries start to diverge and the gamma is different - or if the user
has a modern display that is not Rec BT 709 (untested though!)
- to account for the different primaries, we convert to linear values
with the source gamma, convert that to XYZ, XYZ to the new (display)
colourspace and then back to non-linear values with the inverse display

- this is a potentially expensive operation that will hurt older GPUs
- the default or auto behaviour is to only convert colourpspaces when
the gamma is different - which currently implies BT2020 to a BT709
display. most people will not be able to notice the difference for other
- there is currently no setting to change this behaviour - but it will
be added to the video display profile in due course(auto, off, on)

- there is also placeholder code to use a custom set of display
primaries and gamma - with the immediate intention that these will be
fetched from the EDID - and hence we can match the output to the exact
tv/monitor settings.

More information about the mythtv-commits mailing list