[FAQ] Video Levels and Color Spaces Demystified -- Get the Best Picture Quality
#61
Hi everyone, is this thread still alive?

One question please from my side:
I am trying to set up my device chain correctly regarding video levels. And there is one thing that confuses me: What exactly is happening in Kodi when I am displaying a calibration image like this?
Image

The image says the TV should be configured, so everything below level 17 is black/invisible. When I do that, and then displaying a similar calibration video afterward, then the black levels of the video are quite off. I have the feeling that the instruction in the image to calibrate to what is marked in the image as 17 might be misleading. Can this be true?

Maybe I can explain what I think is going on, and you can tell if this is right or wrong.

For images when Kodi is configured to "Limited":
Images (regular jpegs) are not using limited levels (16-235) but the full range of 0-255. Now, when I have configured Kodi to "Limited" and let it show the calibration image, then Kodi will "compress" the image to limited level. Bringing level 0 from the image to actual 16 and level 255 to actual 235.
So what is marked in the image as reference black level 17 is not really level 17, but it is higher, probably roughly 33 (16 + 17), due to Kodi's compression. If that is true, then I would not calibrate the TV to make all bars marked as 17 and above visible, but actually _all_ bars down to 0 zero need to be visible. Because Kodi compressed it and what is marked in the image as level 0 is in reality level 16 then.

For videos when Kodi is configured to "Limited":
Kodi will detect (or just know?) that videos are already mastered to limited levels on its own. So Kodi will not "compress" them when displaying them, but just pass them through. So it is fine to calibrate to the bar in the video that is marked as 17.

Can anyone help me out if this is correct so far or tell me where I am wrong? Thanks!
Reply
#62
(2023-09-21, 23:17)devkid Wrote: Hi everyone, is this thread still alive?

One question please from my side:
I am trying to set up my device chain correctly regarding video levels. And there is one thing that confuses me: What exactly is happening in Kodi when I am displaying a calibration image like this?
Image

The image says the TV should be configured, so everything below level 17 is black/invisible. When I do that, and then displaying a similar calibration video afterward, then the black levels of the video are quite off. I have the feeling that the instruction in the image to calibrate to what is marked in the image as 17 might be misleading. Can this be true?

Maybe I can explain what I think is going on, and you can tell if this is right or wrong.

For images when Kodi is configured to "Limited":
Images (regular jpegs) are not using limited levels (16-235) but the full range of 0-255. Now, when I have configured Kodi to "Limited" and let it show the calibration image, then Kodi will "compress" the image to limited level. Bringing level 0 from the image to actual 16 and level 255 to actual 235.
So what is marked in the image as reference black level 17 is not really level 17, but it is higher, probably roughly 33 (16 + 17), due to Kodi's compression. If that is true, then I would not calibrate the TV to make all bars marked as 17 and above visible, but actually _all_ bars down to 0 zero need to be visible. Because Kodi compressed it and what is marked in the image as level 0 is in reality level 16 then.

For videos when Kodi is configured to "Limited":
Kodi will detect (or just know?) that videos are already mastered to limited levels on its own. So Kodi will not "compress" them when displaying them, but just pass them through. So it is fine to calibrate to the bar in the video that is marked as 17.

Can anyone help me out if this is correct so far or tell me where I am wrong? Thanks!

You only configure Kodi to "Limited" in the output menu in a very specific circumstance - if you do it in most cases it will give you lifted blacks (i.e. grey blacks) and desaturated colours.  It's there  for when your GPU outputs 0-255 (i.e. Full Range) but your display wants 16-235 (i.e Limited Range).  If your GPU is already outputting 16-235 Limited range - there's no need to enable it in Kodi - and doing so will give you grey blacks.
Reply
#63
Hm, but according to the Wiki page, putting Kodi to "Limited" is the best option and actually the only option that does not introduce unnecessary scaling:
Quote:Which Combination to Use
Out of the eight combinations, only three have correct video levels by the time they reach the TV:
Full,Full,Full -- Both Desktop & Video Content will look correct but video content is also scaled during the Y'CbCr --> RGB color space transformation. BtB & WtW are clipped so calibration will be more difficult

Full, Limited, Limited -- This should be avoided since there are two levels of scaling which will likely cause unnecessary banding.

Limited, Full, Limited -- Best option for embedded video player as there is zero video content scaling during the Y'CbCr --> RGB color space transformation. BtB & WtW are preserved to make calibration easier. If using a Desktop it will look overly dark
What am I missing?
Reply
#64
(2023-09-24, 17:22)devkid Wrote: Hm, but according to the Wiki page, putting Kodi to "Limited" is the best option and actually the only option that does not introduce unnecessary scaling:
Quote:Which Combination to Use
Out of the eight combinations, only three have correct video levels by the time they reach the TV:
Full,Full,Full -- Both Desktop & Video Content will look correct but video content is also scaled during the Y'CbCr --> RGB color space transformation. BtB & WtW are clipped so calibration will be more difficult

Full, Limited, Limited -- This should be avoided since there are two levels of scaling which will likely cause unnecessary banding.

Limited, Full, Limited -- Best option for embedded video player as there is zero video content scaling during the Y'CbCr --> RGB color space transformation. BtB & WtW are preserved to make calibration easier. If using a Desktop it will look overly dark
What am I missing?

As I have said - that route only works if your GPU thinks it is outputting FULL, but your TV is configured to accept LIMITED.  The article is correct about the scaling - but that combination of modes is increasingly difficult to implement - particularly now HDMI InfoFrames are in widespread use.  The wiki may not have been updated for a while.  If your TV is displaying the Full output from your GPU (which Kodi is sending Limited via - but without scaling to Full) AND your TV is in Full mode - it will expect black at 0/1 and white at 254/255 - but Kodi will be sending black at 16 and white at 235 - hence grey blacks. 

If you have lifted black levels - the chances are you aren't in Limited/Full/Limited mode (the chances are you are in Limited/Full/Full).  Have you tried forcing your TV into Limited mode?  I suspect very strongly Kodi is outputting Limited-in-Full - but your TV is interpreting its input as Full, not Limited (HDMI InfoFrames now flag this - they weren't such a widespread thing 5-10 or more years ago)
Reply
#65
(2023-09-24, 22:14)noggin Wrote: The wiki may not have been updated for a while.

not since 2015 to be precise - https://kodi.wiki/index.php?title=Video_...on=history
Reply
#66
(2023-09-24, 22:14)noggin Wrote:
(2023-09-24, 17:22)devkid Wrote: Hm, but according to the Wiki page, putting Kodi to "Limited" is the best option and actually the only option that does not introduce unnecessary scaling:
Quote:Which Combination to Use
Out of the eight combinations, only three have correct video levels by the time they reach the TV:
Full,Full,Full -- Both Desktop & Video Content will look correct but video content is also scaled during the Y'CbCr --> RGB color space transformation. BtB & WtW are clipped so calibration will be more difficult

Full, Limited, Limited -- This should be avoided since there are two levels of scaling which will likely cause unnecessary banding.

Limited, Full, Limited -- Best option for embedded video player as there is zero video content scaling during the Y'CbCr --> RGB color space transformation. BtB & WtW are preserved to make calibration easier. If using a Desktop it will look overly dark
What am I missing?

As I have said - that route only works if your GPU thinks it is outputting FULL, but your TV is configured to accept LIMITED.  The article is correct about the scaling - but that combination of modes is increasingly difficult to implement - particularly now HDMI InfoFrames are in widespread use.  The wiki may not have been updated for a while.  If your TV is displaying the Full output from your GPU (which Kodi is sending Limited via - but without scaling to Full) AND your TV is in Full mode - it will expect black at 0/1 and white at 254/255 - but Kodi will be sending black at 16 and white at 235 - hence grey blacks. 

If you have lifted black levels - the chances are you aren't in Limited/Full/Limited mode (the chances are you are in Limited/Full/Full).  Have you tried forcing your TV into Limited mode?  I suspect very strongly Kodi is outputting Limited-in-Full - but your TV is interpreting its input as Full, not Limited (HDMI InfoFrames now flag this - they weren't such a widespread thing 5-10 or more years ago)
I have configured my setup as described in the Wiki: Kodi Limited, GPU Full, TV Limited
I was using that for quite some time, but now I updated to LibreELEC 11. And with the DRM rendering, something has changed regarding the "Kodi Limited" setting, cause toggling it does not affect playing video anymore. This is related to the DRM rendering path, as I have learned:
https://forum.kodi.tv/showthread.php?tid...pid3166917

So, my configuration from the past seems to only work when I disable DRM. But I am still confused what it means to me as a result. I have a NUC7i5BNK and a RPi4. Should I enable DRM at all? What is currently the best approach regarding Kodi/GPU/TV/Limited/Full with DRM enabled? In the past I relied on the Wiki page, but if it is outdated then I am out of luck.
With DRM enabled, I experienced with many settings that either video player is ok OR Kodi UI is fine, but often they are different regarding black levels.

One configuration that made them equal was Kodi:Full, GPU:Limited and TV:Limited (tested on the RPi4). That might work, but I am afraid that GPU:Limited introduces an unwanted scaling step because that's how I understood the (outdated) Wiki in the past.
Reply
#67
(2023-09-24, 22:43)devkid Wrote:
(2023-09-24, 22:14)noggin Wrote:
(2023-09-24, 17:22)devkid Wrote: Hm, but according to the Wiki page, putting Kodi to "Limited" is the best option and actually the only option that does not introduce unnecessary scaling:
What am I missing?

As I have said - that route only works if your GPU thinks it is outputting FULL, but your TV is configured to accept LIMITED.  The article is correct about the scaling - but that combination of modes is increasingly difficult to implement - particularly now HDMI InfoFrames are in widespread use.  The wiki may not have been updated for a while.  If your TV is displaying the Full output from your GPU (which Kodi is sending Limited via - but without scaling to Full) AND your TV is in Full mode - it will expect black at 0/1 and white at 254/255 - but Kodi will be sending black at 16 and white at 235 - hence grey blacks. 

If you have lifted black levels - the chances are you aren't in Limited/Full/Limited mode (the chances are you are in Limited/Full/Full).  Have you tried forcing your TV into Limited mode?  I suspect very strongly Kodi is outputting Limited-in-Full - but your TV is interpreting its input as Full, not Limited (HDMI InfoFrames now flag this - they weren't such a widespread thing 5-10 or more years ago)
I have configured my setup as described in the Wiki: Kodi Limited, GPU Full, TV Limited
I was using that for quite some time, but now I updated to LibreELEC 11. And with the DRM rendering, something has changed regarding the "Kodi Limited" setting, cause toggling it does not affect playing video anymore. This is related to the DRM rendering path, as I have learned:
https://forum.kodi.tv/showthread.php?tid...pid3166917

So, my configuration from the past seems to only work when I disable DRM. But I am still confused what it means to me as a result. I have a NUC7i5BNK and a RPi4. Should I enable DRM at all? What is currently the best approach regarding Kodi/GPU/TV/Limited/Full with DRM enabled? In the past I relied on the Wiki page, but if it is outdated then I am out of luck.
With DRM enabled, I experienced with many settings that either video player is ok OR Kodi UI is fine, but often they are different regarding black levels.

One configuration that made them equal was Kodi:Full, GPU:Limited and TV:Limited (tested on the RPi4). That might work, but I am afraid that GPU:Limited introduces an unwanted scaling step because that's how I understood the (outdated) Wiki in the past.

The video path on ARM devices can diverge significantly for that on PC GPUs - I think you'd need to check with a Pi Dev to find out what the route from 16-235 (and 10-bit equivalent) YCbCr sources to 16-235 (and 10-bit equivalent) RGB or YCbCr output follows.  Some platforms may not take everything to RGB 0-255/1-254 for compositing video + OSD content for instance.

(NB I'm not sure if 0/1 or 254/255 are used for Full range black and white - on some systems like SDI 0 and 255 are reserved for signalling for instance)
Reply
#68
The RPi is not _that_ important for me. It's mostly music player. My primary concern is the NUC at my main TV. Most important question (because other things seem to depend on it): Should I enable DRM?
Reply

Logout Mark Read Team Forum Stats Members Help
[FAQ] Video Levels and Color Spaces Demystified -- Get the Best Picture Quality1