We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Video Capture and Colorspaces

00:00

Formale Metadaten

Titel
Video Capture and Colorspaces
Alternativer Titel
Graphics - Colorspace
Serientitel
Anzahl der Teile
150
Autor
Lizenz
CC-Namensnennung 2.0 Belgien:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen.
Identifikatoren
Herausgeber
Erscheinungsjahr
Sprache
Produktionsjahr2015

Inhaltliche Metadaten

Fachgebiet
Genre
18
20
Vorschaubild
55:22
24
Vorschaubild
49:05
26
Vorschaubild
45:24
30
Vorschaubild
25:44
37
Vorschaubild
26:33
87
89
90
104
Vorschaubild
22:20
126
Vorschaubild
16:49
127
VideokonferenzMotion CapturingFarbenraumDistributionenraumLeistung <Physik>FlächeninhaltMateriewelleRekursivfilterSensitivitätsanalyseTypentheorieInterpretiererSpezialrechnerAntwortfunktionDiskrete-Elemente-MethodeEinflussgrößeQuellcodeVorzeichen <Mathematik>Transformation <Mathematik>Imaginäre ZahlLineare AbbildungSchnittmengeICC-GruppeBeobachtungsstudieGraphfärbungFarbenraumDistributionenraumMateriewelleRelativitätstheoriePunktspektrumRechenbuchQuellcodeBitMatrizenrechnungLeistung <Physik>Transformation <Mathematik>Ordnung <Mathematik>Kernel <Informatik>StrahlungsleistungMereologieZweiUnendlichkeitDatensichtgerätDemoszene <Programmierung>PunktQuick-SortNeuroinformatikMultigraphDifferenteMathematikDemo <Programm>Hecke-OperatorLineare AbbildungVideokonferenzEndliche ModelltheorieCASE <Informatik>ZahlenbereichGlobale BeleuchtungSpannweite <Stochastik>DatensatzSensitivitätsanalyseObjekt <Kategorie>Element <Gruppentheorie>ART-NetzStandardabweichungSpeicherabzugSoftwarewartungMinkowski-MetrikDigitale PhotographieBasis <Mathematik>Physikalischer EffektFigurierte ZahlPlug inGoogolFolge <Mathematik>ExpertensystemZusammenhängender GraphInformatikNegative ZahlWellenlehreRechter WinkelFreewareLie-GruppeMeterÜberlagerung <Mathematik>TermRandverteilungDiskrete UntergruppeArithmetisches MittelStützpunkt <Mathematik>PhasenumwandlungXMLProgramm/Quellcode
TupelLokales MinimumMatrizenrechnungFarbenraumPunktEnergiedichteGeometrische QuantisierungFarbverwaltungssystemBildverstehenWärmeübergangLineare AbbildungFunktion <Mathematik>GammafunktionTextur-MappingMotion CapturingVideokonferenzDiskrete-Elemente-MethodeForcingKategorie <Mathematik>Auflösung <Mathematik>FarbenraumZahlenbereichDemoszene <Programmierung>VideokonferenzÜbertragungsfunktionAusdruck <Logik>SommerzeitSpeicherabzugDigitale PhotographieSystemaufrufPunktArithmetisches MittelZusammenhängender GraphCASE <Informatik>FunktionalLastLoopMinkowski-MetrikMultiplikationKartesische KoordinatenBasis <Mathematik>Rechter WinkelBildschirmmaskeSoundverarbeitungGreen-FunktionAbgeschlossene MengeTouchscreenLesen <Datenverarbeitung>BandmatrixChromatisches PolynomOrdnung <Mathematik>BeamerEinsMereologieGraphfärbungLokales MinimumMatrizenrechnungDatensichtgerätRechenbuchNegative ZahlPhysikalische TheorieSchnittmengeFlächeninhaltPeripheres GerätDifferenteLeistung <Physik>TupelHardwareGammafunktionTUNIS <Programm>StandardabweichungWärmeübergangBitrateProgramm/Quellcode
Diskrete-Elemente-MethodeMatrizenrechnungTransformation <Mathematik>Codierung <Programmierung>Funktion <Mathematik>WärmeübergangFarbenraumFarbverwaltungssystemAliasingGammafunktionStandardabweichungMotion CapturingVideokonferenzKontextbezogenes SystemBitEinsQuellcodeDemoszene <Programmierung>Chromatisches PolynomSpieltheorieMinkowski-MetrikDefaultComputergraphikPunktMatrizenrechnungFarbenraumÜbertragungsfunktionMereologieKreisflächeOrdnung <Mathematik>SummierbarkeitOffene MengeAliasingMultiplikationsoperatorDatensichtgerätStandardabweichungVideokonferenzIndexberechnungKartesische KoordinatenDifferenteKontrollstrukturGraphKategorie <Mathematik>SystemaufrufFamilie <Mathematik>Spannweite <Stochastik>BenutzerfreundlichkeitZusammenhängender GraphFunktionalRechenschieberCodierung <Programmierung>BeamerRechenbuchNichtlineares SystemVerband <Mathematik>MultigraphLinearisierungKernel <Informatik>Rechter WinkelPhysikalische TheorieWärmeübergangFunktion <Mathematik>NormalvektorGraphfärbungFarbverwaltungssystemNeuroinformatikDateiformatUmwandlungsenthalpieMaßerweiterungLeistung <Physik>Schreib-Lese-KopfComputeranimation
Codierung <Programmierung>FarbenraumGeometrische QuantisierungSpannweite <Stochastik>Diskrete-Elemente-MethodeKonstanteInformationWärmeübergangHardwareMatrizenrechnungTreiber <Programm>AdditionMeta-TagPunktDatensichtgerätLineare AbbildungIdeal <Mathematik>FarbverwaltungssystemPhysikalischer EffektMAPStandardabweichungZusammenhängender GraphÜbertragungsfunktionSpannweite <Stochastik>GradientFarbenraumTopologischer VektorraumElektronisches ForumInformationPhysikalisches SystemDifferenteTransmissionskoeffizientDatensichtgerätElektronischer ProgrammführerCodierung <Programmierung>Treiber <Programm>DateiformatWärmeübergangProgrammierungResultanteGeometrische QuantisierungWasserdampftafelHardwareEinsReelle ZahlProzess <Informatik>Elektronischer DatenaustauschSystemaufrufChromatisches PolynomBasis <Mathematik>Minkowski-MetrikInverser LimesMatrizenrechnungKartesische KoordinatenGraphische BenutzeroberflächePunktAuflösung <Mathematik>Gerichteter GraphStatistische HypotheseRahmenproblemEin-AusgabeRuhmasseVerkehrsinformationAggregatzustandRechenschieberWort <Informatik>Zeiger <Informatik>ComputerspielGruppenoperationOrdnung <Mathematik>EinfügungsdämpfungBitGraphfärbungComputergraphikAdditionVollständigkeitKernel <Informatik>DefaultProgramm/Quellcode
RekursivfilterFundamentalsatz der AlgebraDigitalsignalVideokonferenzInterface <Schaltung>Funktion <Mathematik>TypentheorieTermInformationKontrollstrukturSoftwareEin-AusgabeMultitaskingSoftwaretestDatentypRippen <Informatik>FarbenraumMotion CapturingGamecontrollerDefaultFestplatteSoundverarbeitungArithmetisches MittelBasis <Mathematik>SystemprogrammSystemaufrufSpannweite <Stochastik>MathematikDifferenteElektronischer ProgrammführerSoftwaretestWeb SiteMinimumRechter WinkelFramework <Informatik>Kartesische KoordinatenFarbenraumUmsetzung <Informatik>VideokonferenzComputerspielCoxeter-GruppeAutorisierungBeamerMarketinginformationssystemInverser LimesBitTreiber <Programm>Produkt <Mathematik>KreisflächeDigitale PhotographieShape <Informatik>RahmenproblemMAPOffene MengeAutomatische HandlungsplanungShader <Informatik>ÜbertragungsfunktionUmwandlungsenthalpieVersionsverwaltungRechenbuchTouchscreenCodierung <Programmierung>Physikalische TheorieKonditionszahlStandardabweichungGraphfärbungMinkowski-MetrikInstantiierungFunktion <Mathematik>Leistung <Physik>Lokales MinimumStützpunkt <Mathematik>Projektive EbeneEndliche ModelltheoriePhysikalisches SystemNotebook-ComputerWärmeübergangPhysikalismusDatensichtgerätProgramm/Quellcode
E-MailMustersprachePunktStandardabweichungRechenbuchUmwandlungsenthalpieKette <Mathematik>Geometrische QuantisierungLeistung <Physik>Elektronisches ForumMinkowski-MetrikCodierung <Programmierung>Lokales MinimumInformationsspeicherungAnalogieschlussRechter WinkelSystemaufrufMultiplikationsoperatorDifferenteSichtenkonzeptDatensichtgerätMultiplikationResultanteSpannweite <Stochastik>SoundverarbeitungFlächentheorieBitVerschlingungInverser LimesLoopTransmissionskoeffizientRundungsfehlerFarbenraumShader <Informatik>DokumentenserverDigitale PhotographieKomplex <Algebra>Physikalisches SystemOrdnung <Mathematik>SchnittmengeChromatisches PolynomHardwareGraphfärbungVideokonferenzRepository <Informatik>Zeitrichtung
URLGoogolComputeranimation
Transkript: Englisch(automatisch erzeugt)
Okay, I think I'll start video and color spaces. So I'm a co-maintainer of the video for Linux subsystem of the Linux kernel and sort of second part of last year I got some questions about color spaces and I realized that I
didn't really knew what it was all about. So I bought a bunch of books, started researching and experimenting and I'm definitely no expert, but I know a heck of a lot more now and this talk is really going into some
of the backgrounds of it and especially what are the practical consequences of what is going on and hopefully I can have a nice demo later as well. What the hell is color? Let's start with that.
First thing that you need to know about is what's called a spectral power distribution. So basically I'm looking at an object and I'm getting light of different wavelengths. They hit my eye and the spectral power distribution basically gives you for the wavelengths,
this is a nanometers of the visible spectrum, how much power do you get in those wavelengths from the objects? These are a few ABC, there are a few standard light sources, standardized light sources and these are the spectral power distribution.
Sounds great. So that's the physical thing that gives you color, just you get light of different wavelengths into your eye with certain intensities. Your eye does not have, what is it, 350 different wavelength detectors.
We have to do with three, shortwave, mediumwave, longwave, usually called SML and it's not that they are specific to one wavelength, they have overlap and they detect certain
ranges but with different efficiencies. What this means in practice is that light with a certain spectral distribution, power distribution hits the eye and it is converted in basically three values, electrical intensities
of electrical impulses, one for each cone, so shortwave, mediumwave, longwave and those three values are what are interpreted as color by your brain because you're basically
having, the spectral power distribution can have many, many, infinite, many different ways, graphs but they're all reduced to just three values, that means that there is an infinite number of spectral power distributions that will give you the same value.
So to reproduce a color on a display or on a photograph, you do not have to reproduce spectral power distribution, you just have to fake it so that your eye, the three intensities that your eye sees are the same as the original but the actual spectral power distribution can be and will look totally different. So it is a pure color, it is a pure illusion.
What you have on the display there has absolutely nothing to do with the original. It's all fake. The whole point is that the light emitting or whatever lamps, whatever
is in there, they create the illusion of the same color. Now these three colors that is pure biological, different species can have different number of light sensitive
elements in their eyes with the record holder that I found is the mantis shrimp that is sensitive to 12 different colors. So an RGB display, that wouldn't work for them. They would need one with 12 different color components in order to reproduce a color that they can see. So that's where the RGB, the three values come from that's purely
related to what your biological eye is doing. Now of course the next step is your brain that is interpreting it and that can throw up really weird things. This is I think
the strongest optical illusion that I know, there may be others, but certainly is one I cannot unsee. I see orange, magenta, blue and green there. However, blue and green are the same color. I have to go back, nobody believes it. Green, blue, no, same
color. I have been experimenting with this before, just blocking out just a little bit of that. I keep seeing it, only when I'm almost getting rid of the magenta then it
suddenly turns, it's slightly, very slowly actually, it just turns, changes color until it's back to green. And I have not seen a convincing explanation of this. There are a few ideas that people have, this is the single one that I believe. It doesn't seem
to fit. It's an amazing one. So whatever, so this is what I'm basically saying, color is a very big illusion. But you know, computer scientists, we do have to try and reproduce color. So you record some scene on video like this one, you want to reproduce later
on the display. It would be nice if I wouldn't look purple or blue or whatever, that sort of this color is roughly reproduced and that this is bluish. It would look really weird if it wasn't the case. So color space is all about how do you reproduce
color. And the model of all color spaces is called CIE XYZ. Based on studies done in the 1920s, where they actually tried to figure out how does the eye see color, but
how are the sensitivities of the eye. And they basically figured out how to reproduce specific wavelengths using three different primary light sources. This is called the CIE RGB color space, the mother of all color spaces. So this is the model of the
colors. And CIE is the Commission on Illumination. So they have commissions for everything including color. They deal with color. In practice, this turns out to be a fairly unwieldy color space for calculations. It turns out there are some negative values, which I don't understand how that's possible. But in practice, I don't care. And they have a transformation
that takes the RGB color space into what they call the XYZ color space, where everything is all nicely positive, linear, and easy to calculate with. The only thing is you
cannot, the primaries are imaginary. So the actual light sources that it's based on, they do not exist. They're not physically possible. But it's just a linear transformation through a matrix from the RGB to the XYZ. And that's really all you need to know.
And this is the foundation of all color space. All color spaces are defined in relation to that one. And it is really cool to think of that this is based on studies done by a pool of 17 people over 85 years ago. I think it's quite amazing that what they
did then is still valid today. Good to know is that the Y describes luminance. X and Z are color components. They're just letters. And if you think that is confusing, well, wait for it. It gets much more confusing. What I use often is XYZ lowercase,
where XYZ lowercase are calculated like this. What I use a lot more is capital Y lowercase XY. Don't blame me. The nice thing about this one, this keeps the original Y
standing for luminance. And the lowercase X and Y based on this formula, they are values for chromaticity. What it basically is is these are the colors with maximum intensity.
So, color is both the color itself and then you have how bright it is. So, the Y is roughly the brightness, the luminance. And X and Y lowercase, they are values that specify a color. So, if you're reading about this, then you will have to pay attention
to whether it's capital or lowercase and sometimes people don't do it quite right. So, if you think it's confusing, it really is confusing. Color space means that, okay, I know RGB, right? You have values for red, green and blue. But what exactly color
of red do you mean? There are many, many colors of red. So, which one do you mean? Which is the color of your red light source? And what is the color of your blue red light source and the green one? Because you need to know that in order to accurately reproduce
a color. So, you have these three lamps in a display or projector or sensors in a camera. And those, when you want to reproduce a color, you need to light them up with enough intensity so that you fake the eye of the receiver seeing a specific
color. But if you have different colors for your light sources, you will need to trigger them in different ways. So, color space is actually saying, okay, what are my colors? What are my light sources? I need a red one, a green one and a blue one. But exactly
what color, red, green and blue is it? And that is defined in usually just lowercase x and y because the capital Y is luminance, so we can discard that. That has nothing to do with the color as such. And basically, so you get a color space defined by which
color of red, which color of green, which color of blue. And they basically say if you pass in, give a display a red, that's a value at the maximum, say 25500 for an RGB, typical RGB display, that's the color that you get. You also need what's called
a white point. It says what color do I get if I turn on all three lamps at maximum? You know, if you have RGB full out, you should get white, but you have many, many tints of white, so you can actually play with that to specify specifically which
white you want. Usually, it's what's called D65, which is a standardized. It's supposed to mimic daylight, but photographs apparently use D50, which is slightly different. I don't
know the details. It's just numbers that you crunch and that you end up with a matrix. There used to be physical properties, so the old RCRTs, they were the colors that phosphorous in the cathode rate tube would give you. These days, they tend to be translated
by your display to whatever actual light sources you have. Any color space that is defined can be derived from the mother of all color spaces through a three by three matrix multiplication. That also mean, you often hear about what this color space can
only represent so many colors, and that color space can do more. It's not really true. All color space, it's just a three by three matrix multiplication. In theory, all color spaces can represent the same colors. The problem comes that certain color spaces
will have colors where you certainly have negative values, and you can't have a minus ten red value. It's not physically possible. For the calculation, you can still retrieve the original color, but once you go to the physical world, if you get negative
values or values above one, they are cut off, and that is what will limit the amount of colors that your physical device can reproduce. That's very confusing in the beginning because you don't really understand why it is, but you have XYZ, capital XYZ color space
that can reproduce all colors that the human eye can see. Every other color space can do the same, but once you go to the physical world, then you will have limitations. The original color spaces defined here, they are all linear. If you double the value
of red, you will get a red that is physically twice as intense as it was before. The eye, like the ear, is not linear. What every color space defines is what is called
the transfer function. Unfortunately, it's also called gamma. That's not really the right name. Transfer functions are a way of, it's basically power function. Usually the first part is linear, and then a power function takes over. That is usually a lot
more in tune with what the eye can see. The eye is more sensitive with color differences in certain areas, and the power function compensates for that. In order to tell that a color is actually specified after the power function has been
applied, they use quotes, while sometimes they use quotes. Quite often they don't, because people have no idea about the transfer function, and they just say RGB, but it really is RGB quoted, meaning that there has been a transfer function here first.
Then you have the YCBCR, or also called YUV, also incorrectly, but again all historical. That is derived from RGB. YCBCR, for those who don't know, very quickly, Y is, RGB
is red, green, blue, but for video you quite often want luminance and then two color components. The eye is more sensitive to luminance, so your luminance resolution is actually higher. The eye is less sensitive to color, color resolution, so the color resolution is actually lower. It's a more efficient way for video to reproduce the scene, which
means that you save bandwidth, which makes hardware manufacturers all happy. It's also why you typically don't do that for your desktop screen, because there you're close to your screen and you can actually see the effects of YCBCR that is not as ... The
color fidelity is not as good as it should be, but when you have moving video you won't see it. Now to convert from RGB to YCBCR, again you have a matrix, and color spaces, they actually define which matrix you should use, or matrices, because there are different
ways of doing it. YCBCR, contrary to what 90% of all documentation says, is not a color space. It's different encoding for a color. How to interpret that color, that is what the color space does. That tells you what those three values actually mean to
what color should they end up. I see this all the time. I had the same wrong idea in my head when I started out with this, and clearly most people writing documentation or data sheets, they make the same mistake. Just a nice fact, OpenGL,
if you use that, by default it expects linear RGB, so without the transfer function. Since most pictures that you get, JPEG, whatever, they are all with the transfer function,
so they are RGB-quoted, you need to tell that to OpenGL. If you don't do it, the image is misinterpreted, just for fun. This is what you have. You have the original color space, then you want to go to color space, and I will get to that in the next slide
that you actually want to use. That's a 3.3 matrix. Then it passes through a transfer function, so all the red, green, and blue components, they are converted by that function to a new value, non-linear RGB. Then it can go through a 3.3 matrix to non-linear YCBCR.
There really is no linear YCBCR, it's never used. In the end, the last one is that you quantize it, so you go from this floating point value to, say, 16 to 235, and you
discard any values outside of that range. That's where you basically go to the physical world. Everybody still follow it? Yeah. This states whether if it's linear RGB ...
No, no, this outcome, let me just first go a little bit to the color spaces itself. I will do the first one first and then go back to your question. As RGB, that's
the best known because that's the default for any graphic work that you do. It's standardized by this standard. First of all, it's defined by which color primaries do you use. What does it mean if you say red and green and blue? To which colors do they reproduce?
That's also called chromaticities, same name for that. The chromaticities of sRGB are defined and are identical to recommendation. I should probably go through these. sRGB, computer graphics, color space, SMPTE, 170M, that is standard definition, TV, color space.
Recommendation 709 is high definition color space. Just give a little bit of context. All these standards, they all refer to one another, so you get really, really confused very quickly. Just think recommendation 701, high definition, 170M, standard definition,
sRGB, used for computer graphics. The fact that there are three for very common applications is already an indication how confusing everything is, and that is one big bloody mess. For sRGB, the chromaticities are identical to recommendation 709. To go back to that,
chromaticities, they are going here. Those define which red, green, and blue lamps or sensors you are using, so what colors are they sensitive to exactly? They are defined
in the standards, and in order to go from the original color, so the original pure perfect specification of a color to how you would encode it in that color space, you have a three by three matrix. Three by three matrix is calculated from the chromaticities
that are part of the standard. Again, chromaticities basically what color red, green, and blue do you use in your projector or display, and what color white do you get if you turn them all on at the same time. sRGB, however, so the chromaticities are the same
as high definition TV, great, perfect. They are interchangeable, you would think. No, they are not because they decided to have different transfer functions. Again, normal pictures and computer graphics, they are not done in linear RGB, they are done in non-linear
RGB, so there is transfer function in between, power function, which is not the same between sRGB and HDTV. No idea why they didn't do that. sRGB is almost always, as the standard name says, red, green, blue, so you rarely use the YCBCR encoding. Again,
that's just a calculation. It's just a different way of representing a color. It has nothing to do with the chromaticities. There is actually one defined, SYCC, so I think it's
used in some JPEG formats or computer graphics, not going into detail there. Then you have standard definition color space, so that's the old style PAL CCAM TVs, also called SMPTE-C.
The transfer function is the same as that for high definition, but it has slightly different chromaticities, so the actual, if you want to reproduce it, you would have slightly different red, green, and blue colors. How to encode from RGB to YCBCR is
standardized by the BT601 standard. Now, lots of people probably have heard, if you're doing anything with video, you've heard about that one. The BT601 standard just defines how you go from RGB to YCBCR. It is not a color space. It says nothing about
the colors. You could make it purple, and for those chromaticities, you would still use BT601 to convert from RGB to YCBCR. It's very often used called color space. It's not. Usually, if it's called like that, it's really an alias to this standard.
There is an alternative encoding that you can use, so by default, 601, they will encode in the range from roughly 16 to 235. There is one that will use the full range from zero to 255, called extended gamut encoding. High definition color space, this is actually
very nice standard because it defines everything in just one standard. What you have in practice, if you have standard definition TV, following that standard,
and you want to display it on, say, a high definition output, then the YCBCR would encoding, YCBCR encoding, is different between the two. The rest is all the same, but the YCBCR encoding is different, so you have to compensate for that.
If you want to have an sRGB image and display it to a high definition TV, everything is the same except for the bloody transfer function. If you do not compensate for that, you will get the wrong colors.
The chromaticities between standard definition and high definition, or for that matter sRGB, as I've mentioned here, they are different. However, the differences are minute. I will actually show it later, what the differences are, if it's basically not almost undetectable, so nobody cares about that. But you will see the difference between the YCBCR encodings
and the transfer function. There are a few others that are in use. Adobe RGB, I'm not going into too much detail there. BT 2020, that's an interesting one because that is the one that is going into
ultra high definition TVs, 4K. The standard is there, but as far as I'm aware, the equipment is still in research R&D. There might be some cinema systems out there that can actually do it, but I don't know if they exist. Definitely way above my pay grade
to ever buy one thing, one of those things. The standard says that you only use it for deep color, so 10 bits or more per component. BT 2020 gives a much larger gamut, so the primaries are chosen in such a way, primary
colors are chosen in such a way that you can reproduce many more colors than the existing color spaces, physically reproducing it. So apparently you can get many more, especially very highly saturated and almost glowing colors are next to impossible to reproduce with the existing color spaces, but that
one should be able to do a much better job. I've seen some articles in the press about that and it seems to be really cool. Some older ones, 240M that was basically
for about 10 years in place for the early high definition equipment has been superseded by recommendation 709. There is an old NTSC, the original color space, nobody uses it anymore, superseded by 170M. The same for PAL and CECOM, again going to the same
color space. So I told you the chromaticities of standard definition and high definition are slightly different, but it's almost undetectable and in practice TV companies and studios are going completely to 709 for that.
The problem with high definition, you get signaling through the EDID and through info frames for HDMI or accelerating channels for display port that tells you what color space you use. Standard definition TV, you do not have that information. So if you would,
for example, play back a really old program that was done in the original color space, you wouldn't be able to know that. So that information has to come from outside which color space standard definition uses. But in practice, it is simple. I'm going
a bit too far ahead. Limited and full range, so we had chromaticities, what red, green and blue do you have? You have the transfer function, then you have YCBCR encoding and the last one is called quantization, so where you go from floating point to actual
values. Now you have two possibilities. One is full range and the other is limited range. Now RGB typically are 0 to 255, full range quantization. YCBCR typically limited range, but you have the alternates as well. So you have limited range RGB and you have
full range YCBCR. I've seen this. I've never seen that, but HDMI connectors can signal both. Unfortunately, HDMI, so you look through the spec and you look how do
they handle color spaces and quantization and all that stuff and it's really complicated. So this is I think in one slide more or less what you have to take care of. So if you as a transmitter, if the sync, the receiver cannot do, doesn't support AVI info frames
at all, so it's for example a DVI connector or something like that, or you cannot handle YCBCR video, then for IT, so basically anything but, you know, you can't handle the standard definition or high definition resolutions. You use full range as RGB, just what you would
expect. If you're sending out standard definition or high definition, so you know PAL or 720p or something, you have to use limited range as RGB. I have no clue which idiot came up with that or why you would ever want to do that. That is
the standard. If you do it wrong, you are likely to get wrong colors. Unfortunately, some equipment never implemented this, so they would for example expect full range anyway. It's an utter and total mess. So if you have HDMI, please just fill in
info frames and just give all the right information. I have not heard, if anyone knows why they came up with using limited range RGB here, let me know because I have no clue why you would ever want to do that. Anyway, if you are in a more sane situation
and you actually have info frames, then again you can signal that for graphics, computer graphics you use full range, standard definition, limited range, SMPTE, one set up standard definition color spaces, high definition recommendation. It supports a whole bunch of additional formats including the latest HDMI standard, includes the new ultra high
definition format as well and can signal. If you want to implement this, and I have actually been doing that for the past two, three weeks in Linux drivers, it's not easy.
But luckily, this is my one minute guide. Standard definition, use that. High definition, use that. Anything else, use that. You're okay if you just, it's a very good default. So what are the problems with all this? First of all, highly confusing names. Inconsistent,
so you have to calculate these three by three matrices. So you go through the literature and everybody has a slightly different matrix. Applications, most applications ignore this completely. Full range, limited and full range quantization usually ignored or done incorrectly.
Transfer functions seem to be a really bad boy when it comes to hardware, but they just ignore it. So they go from, so the ATV7604 I've been looking at, that's the HDMI receiver. If you give it high definition TV and you want to convert it to RGB to
show on your display, it uses the wrong, it just ignores the whole transfer function. So you end up with an sRGB picture that is not using the sRGB transfer function,
but the one from recommendation 709. So it's actually wrong. The good news is that support for all these color spaces, they have been added in kernel 3.19 for display. This covers HDMI 2.0 as far as I can tell completely. For display ports, there are a few missing
mostly because the display port standard basically says nothing about it. They say they are there, but they do not give me any pointers to standards or what it means. If anybody has experience with display ports and these color spaces, please let me know.
The only one that they could figure out was DCI-P3, which is used in cinemas and there is a proper standard for that. It could be added, but I can't test it anyway, so I've ignored it for now. Some resources, some books, first two. This is very practical.
This goes a bit, actually a lot more into the theory of color and physical and biological and everything related to it. One website that I found very useful goes a lot into the mathematics, going from one color space to another, how do the calculations work.
The video for Linux specification, this is the very latest version on my website. If you go to the chapter on color spaces, I've completely rewritten it and it's a fairly extensive and practical guide to how color spaces work.
Before questions, I am trying, let's see if that works, to give a little bit of demonstration. What exactly does it mean when you do something wrong with color? Let me see if I can make
this work. What I'm starting now is the vivid driver. Those who were in my previous
presentation know a lot more about it. It's basically a video for Linux driver that is generating the image. You can use it. It's emulating hardware. The nice thing about it is that it can emulate any color space. I've put in a lot of effort
to that. You can actually say generate pictures with what you have here, sRGB color space. This is what you will get. This is standard color bar. Actually, if you look
here in the test pattern, this is the color space conversion color bar. I've paid special attention that all the colors used here can be represented accurately without going out of range in all the other color spaces. If you would go to say, for example, a 100% color bar where you have maximum values of blue and green and whatever, then they
might be out of range in another color space. That would fuck up everything. If you want to compare colors, you would want to see the effect of different color space. You need to have colors that are reproducible by all the other color spaces.
Let's keep this as the reference. This is how, of course, remember this. I have absolutely no clue what the color reproduction system is of that projector. I don't know if these colors are probably not correct at all. What I'm interested in is to see
the effect of doing something wrong with colors. I just need to see the difference. I have two instances of this test framework. I'm going to put them next to one another.
The bottom one is the reference. That is what it should be. The top one is where I'm going to make changes. First, if I just change the color space, nothing happens. You see a very slight flickering sometimes, right? QV4L2, which is a test utility I use,
the application that reproduces, that makes the picture, it understands all these color spaces. It sets up big shaders inside OpenGL that will convert from whatever it receives to sRGB, which is the output. The flickering that you see is when it's
getting signaled that there is a new color space, but it is still displaying one frame as the old one. That's all. The next frame, it will have been caught up, and it's using the right shaders and does the right conversion. Changing color spaces here makes no effects. You do need to make a small change here.
I just remember YUV. Okay, that's correct. What I can do now is let me send out sRGB.
Here, I program the driver to send colors in a specific color space. In this step, this is what the application receives. By default, it's auto-detect, so just do whatever the
driver gives you, but I can say, no, no, no, no, I want to interpret it as high definition TV. Now, you see a difference, right? This is the difference caused by a different transfer function, because the transfer function is different between sRGB
and what you know, and different between recommendation 709 and sRGB. If you do not take that into account, you get the wrong color. You will never see this. If you're just watching a video or whatever, you will not see this. You only see it if you put
it next to one another, or perhaps if you're an artist and you're really experienced with color and you can detect these things. I mean, if you're a photographer, if you're a cinema cameraman, you work with color all day. Once I talk to people from General Motors, they make new models and they really want to know what color your car is.
That's important to them, that it's the right color. If you do not take this into account, you reproduce the wrong color. The other thing, what happens if you ... That
is sRGB versus recommendation 709. Now, let's say standard definition and definition.
Now I'm out of screen. I'm saying use the wrong YCBCR conversion. This is now converted using ... I'm not doing something. The differences are fairly small. You can see it primarily
in the green and here that these are different colors. That is the effect that you get if you use the wrong YCBCR to RGB encoding. It's actually a bit more stronger visible here on the laptop. If you ... I can show this better with ... This is when you
mess up full range and limited range. Projector messes things up. It's much better visible
on my laptop. If I switch it around, that's a bit ... Now it is a bit better visible that this is too bright. That's if you handle limited and full range quantization
incorrectly, then that's the effect that you get. One final one that I wanted to show, let me see. This is, if I got it, do I have
it right? It's getting very complicated to see what you are sending and what you're
receiving and how you interpret it. These are the differences between the chromaticities
of standard definition and high definition. As I said to you, it's next to impossible to detect. I'm going back and forth. You see very slight differences there. Yeah.
In practice, this is next to impossible to detect. Most people just ignore that one. With the VIVI2, you can use this to more or less detect differences between what
is the effect if I get it wrong. To really see if the whole chain of your ... Your whole color chain is correct, you need to do a lot more, but at least this gives you an idea of if I do it wrong, what are the results. Very nice as well. There's a generator inside here and also in video for Linux, VIVI2,
CTL2. The test pattern generator can generate all those different color spaces. You can actually feed it straight into your HDMI transmitter, loop it to an HDMI receiver and compare what you're sending in and what you're getting back to check whether your chain is correct, whether you're never messing up your color spaces.
It's actually what I've been doing in the past two weeks at work, just making sure that color isn't messed up somewhere around. I hope this gives a little bit of an idea of the complexities that you get into if you have to deal with color. The QV4L2 tool
is publicly available in the VIVI3 of Linux repository. It has all the shaders that we use to do the calculations. Test pattern generator is also available. Again, it does all the calculations to send out the right colors. If you're interested in that and
you want to work with it, you can just look it up. I spend a lot of time in trying to get this right because the only way to check if your hardware is correct is to first have the right test tools. I always feel that I'm just scratching the surface. I also feel that I still really don't know everything there is to know about color, but at least
I hope this gives a little bit of an impression of what is involved. I'm opening up the floor for questions. They all do. A color space needs to define ... The question is
are there any standards that define the white point? A proper standard dealing with color spaces will define the red, green, and blue primary and the white point. If
I remember correctly, it's in the SMPT170M standard. If you're looking in the BT601 standard, it's not there because that's not at all about data. The SMPT170M, I bought
all those standards. I'm pretty sure it's there. I know it's there. The question
is why do you need the white point at all? The white point is necessary to ... You
have these three colors, but you basically need to know if you put all colors, say the light bulbs ... Let's make it really physical. If you give maximum power to all the white bulbs, you should get the whitest color, but which one is it exactly? They may not
... If you put maximum power to it, some might actually shine a little bit brighter than the others, so you might come up with a slightly greenish white or a slightly bluish white. You don't want that. The white point is actually telling you ... Effectively, it's telling you how much power you should give to each primary to achieve that specific
white color. There are multiple ways how you could describe white points, but I think that is the most practical. It's a way of fine-tuning your color space, so that if you tell it to go to maximum power, where do you end up? Another
way of describing it is that it gives you the relationships of how much ... What the maximum values are for each color, maximum power that you can give each color. It took me ... It's complicated, and it actually took me also quite a long while before I
got the okayish idea of what it meant. I think it's fairly poorly described in practice, but you can ... The easiest way for me is just to say, if I want to give 255, 255, 255 to my display, what white should I end up with? That translates to how much
power should the three light sources get to get there. That's the way I can describe it. More questions. Is there a technical advantage
using limited range or full range? Short answer is no. Why is limited range used? It basically comes from, again, the old style analog systems, where you needed headroom because it was all analog, so sometimes your electrical signal would actually dip below
your minimum or go above your maximum. You needed headroom to accommodate that. It's basically a legacy thing from old CRTs, although I know that the old CRTs, the old CRTs, had some decoders, impact decoders, for example, that can have rounding arrows where you effectively can end up in roughly the same situation. Yeah. I better think that's
another one. No more questions? Who actually understood this? How understandable. Everybody's
colorblinds. Okay, thank you.