How does DSC affect image quality?
-
- Posts: 15
- Joined: 22 Feb 2023, 13:48
How does DSC affect image quality?
I was going to buy my first >60Hz LCD in my entire life and I stumbled upon the fact that even recent-ish 4k 144 Hz LCDs cannot function without stream compression (VESA DSC) even if HDMI2.1 is present.
What are the reasons to compress display output? Well, there's only one: cost saving. VESA decided to implement smallest common denominator of compression which can be used in cheap and low powered devices and expensive powerful solutions are expected to use multiple connections and DisplayID instead of compression. Instead, OEMs chose DSC to save costs.
What alternatives do OEMs have if they wanted to output dense uncompressed datastream?
a) Faster HDMI 2.1 and DP2.0 link speed.
b) VESA DisplayID allows to use more than one DisplayPort connection for a single panel and is supported by Radeon at least since HD7xxx series and Nvidia has been supporting it for a long time too.
Here's an article about it:
https://media.extron.com/public/downloa ... ngedid.pdf
And there are several examples of using that technology, most notable being LCD conversion kit engineered exclusively by a smart individual:
http://www.zisworks.com/making_of_x28x39.html
https://www.reddit.com/r/Monitors/comme ... n_also_do/
https://www.youtube.com/watch?v=rG_a7Qs2odc
Okay, but what if the monitor you want to buy uses VESA DSC? Let me tell you how to evaluate it's impact.
First of all, DSC is an open standard available from VESA directly for free.
https://vesa.org/vesa-display-compression-codecs/
https://app.box.com/s/vcocw3z73ta09txis ... 1133487793
Here's a presentation about it:
https://www.astrodesign.co.jp/astro_upd ... andDSC.pdf
It's also very convenient that VESA distributes a reference implementation written in C as a console program which simulates the compression and decompression. We will use it to study compression errors.
Fact sheet:
1) It supports all important image coding options: both RGB and YCbCr, chroma subsampling and any bit depth.
2) The compression ratio is almost steplessly adjustable.
3) Requires very simple computations.
4) Operates on very small buffer (one line of pixels at most) so it does not introduce any lag by itself.
5) For a 30 bit per pixel image the compression which yields best quality is 15 bit per pixel (50%). That's very weak compression compared to most modern image codecs, so even if the codec is weak it won't yield a lot of errors.
6) It's lossy compression. "Visually lossless" may be objectively true but it's a lie to say that it's lossless.
7) Compression yields stream with very consistent bitrate.
It's possible for GPU to select best possible compression quality to transmit image so that it fits link bandwidth.
Positive characteritics:
1) There are a lot of scenarios when best possible compression yields very few or no errors.
2) There is a mechanism named Index Color History which makes it possible to code generic display test patterns losslessly and code some fine grained grids very well.
3) Smooth gradients are preserved very well regardless of direction.
4) Compression errors gather around hard transitions and do have small magnitude compared to the transition itself.
Negative characteristics:
1) The standard prescribes no spacial or temporal dithering.
2) The compression algorythm does not use previous frame to improve compression quality.
These mean that it's literally impossible to exactly display even a still image with DSC enabled. Contrary to that all advanced video codecs improve still image quality if it lasts multiple frames.
VESA provides sample implementation in C code along with a windows executable which can be used to evaluate effect of compression on image quality. It's in folder named DSC_model_20210623W which also contains README and templates for common encoding scenarios. For example, rc_10bpc_6bpp_420 is for 10 bit per channel image chroma-sampled in 4:2:0 mode and which will be compressed to consume at most 6 bits per pixel on average. The program DSC.exe will
- reencode each input image using the bit depth and chroma sampling provided by config and save it
- save intermediate image to .out file
- encode them with DSC and spit out decompressed image which you can then compare with
I've attached a sample comparison which one can do in GIMP to better understand which details of image are affected. Notably, I verified that image artifacts described in this review:
https://www.rtings.com/monitor/reviews/ ... #test_4264
cannot be a result of DSC and are insted result of a LCD firmware bug.
There are two notable tweaks which might yield better image quality if you ever get bothered:
1) the GPU will always output uncompressed image if it fits the link. Lowering refresh rate or reducing blanking is the way to go.
2) YCbCr coding. If your monitor supports it you can choose it in control panel of your GPU (at least there's direct selection of YCbCr and bit depth in my Radeon panel). YCbCr uses available bandwidth much more efficiently than RGB coding.
What are the reasons to compress display output? Well, there's only one: cost saving. VESA decided to implement smallest common denominator of compression which can be used in cheap and low powered devices and expensive powerful solutions are expected to use multiple connections and DisplayID instead of compression. Instead, OEMs chose DSC to save costs.
What alternatives do OEMs have if they wanted to output dense uncompressed datastream?
a) Faster HDMI 2.1 and DP2.0 link speed.
b) VESA DisplayID allows to use more than one DisplayPort connection for a single panel and is supported by Radeon at least since HD7xxx series and Nvidia has been supporting it for a long time too.
Here's an article about it:
https://media.extron.com/public/downloa ... ngedid.pdf
And there are several examples of using that technology, most notable being LCD conversion kit engineered exclusively by a smart individual:
http://www.zisworks.com/making_of_x28x39.html
https://www.reddit.com/r/Monitors/comme ... n_also_do/
https://www.youtube.com/watch?v=rG_a7Qs2odc
Okay, but what if the monitor you want to buy uses VESA DSC? Let me tell you how to evaluate it's impact.
First of all, DSC is an open standard available from VESA directly for free.
https://vesa.org/vesa-display-compression-codecs/
https://app.box.com/s/vcocw3z73ta09txis ... 1133487793
Here's a presentation about it:
https://www.astrodesign.co.jp/astro_upd ... andDSC.pdf
It's also very convenient that VESA distributes a reference implementation written in C as a console program which simulates the compression and decompression. We will use it to study compression errors.
Fact sheet:
1) It supports all important image coding options: both RGB and YCbCr, chroma subsampling and any bit depth.
2) The compression ratio is almost steplessly adjustable.
3) Requires very simple computations.
4) Operates on very small buffer (one line of pixels at most) so it does not introduce any lag by itself.
5) For a 30 bit per pixel image the compression which yields best quality is 15 bit per pixel (50%). That's very weak compression compared to most modern image codecs, so even if the codec is weak it won't yield a lot of errors.
6) It's lossy compression. "Visually lossless" may be objectively true but it's a lie to say that it's lossless.
7) Compression yields stream with very consistent bitrate.
It's possible for GPU to select best possible compression quality to transmit image so that it fits link bandwidth.
Positive characteritics:
1) There are a lot of scenarios when best possible compression yields very few or no errors.
2) There is a mechanism named Index Color History which makes it possible to code generic display test patterns losslessly and code some fine grained grids very well.
3) Smooth gradients are preserved very well regardless of direction.
4) Compression errors gather around hard transitions and do have small magnitude compared to the transition itself.
Negative characteristics:
1) The standard prescribes no spacial or temporal dithering.
2) The compression algorythm does not use previous frame to improve compression quality.
These mean that it's literally impossible to exactly display even a still image with DSC enabled. Contrary to that all advanced video codecs improve still image quality if it lasts multiple frames.
VESA provides sample implementation in C code along with a windows executable which can be used to evaluate effect of compression on image quality. It's in folder named DSC_model_20210623W which also contains README and templates for common encoding scenarios. For example, rc_10bpc_6bpp_420 is for 10 bit per channel image chroma-sampled in 4:2:0 mode and which will be compressed to consume at most 6 bits per pixel on average. The program DSC.exe will
- reencode each input image using the bit depth and chroma sampling provided by config and save it
- save intermediate image to .out file
- encode them with DSC and spit out decompressed image which you can then compare with
I've attached a sample comparison which one can do in GIMP to better understand which details of image are affected. Notably, I verified that image artifacts described in this review:
https://www.rtings.com/monitor/reviews/ ... #test_4264
cannot be a result of DSC and are insted result of a LCD firmware bug.
There are two notable tweaks which might yield better image quality if you ever get bothered:
1) the GPU will always output uncompressed image if it fits the link. Lowering refresh rate or reducing blanking is the way to go.
2) YCbCr coding. If your monitor supports it you can choose it in control panel of your GPU (at least there's direct selection of YCbCr and bit depth in my Radeon panel). YCbCr uses available bandwidth much more efficiently than RGB coding.
- Attachments
-
- gaussian 50px 800 22px blur.ref.xcf.7z
- (1.72 MiB) Downloaded 1004 times
Last edited by betonKruglosuTotchno on 27 Nov 2024, 13:34, edited 2 times in total.
- Chief Blur Buster
- Site Admin
- Posts: 11895
- Joined: 05 Dec 2013, 15:44
- Location: Toronto / Hamilton, Ontario, Canada
- Contact:
Re: How does DSC affect image quality?
This is a wealth of information for readers of Area 51. Thanks for sharing!
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on: BlueSky | Twitter | Facebook
Forum Rules wrote: 1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
2. Please report rule violations If you see a post that violates forum rules, then report the post.
3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!
Re: How does DSC affect image quality?
Can we get before/after images of DSC compression?
-
- Posts: 15
- Joined: 22 Feb 2023, 13:48
Re: How does DSC affect image quality?
I find the example attached is a bit hard to make sense of, unfortunately. Do you have access to reference implementation in C code now? If so, could you run the software on the image in this link?: https: //ratchet-galaxy. com/en/games/ps5/ratchet-and-clank-rift-apart/media/screenshots#&gid=screenshots&pid=21
I have done some light research on the topic of DSC artifacts and I have found some information here: https: //www.pulse-eight. com/News/BlogDscVsCsc and here: https: //blog.biamp .com/understanding-video-compression-artifacts/
In short, we should see the spatial artifacts occur with DSC, but I haven't found any example of this so far.
I have done some light research on the topic of DSC artifacts and I have found some information here: https: //www.pulse-eight. com/News/BlogDscVsCsc and here: https: //blog.biamp .com/understanding-video-compression-artifacts/
In short, we should see the spatial artifacts occur with DSC, but I haven't found any example of this so far.
-
- Posts: 15
- Joined: 22 Feb 2023, 13:48
Re: How does DSC affect image quality?
Sure, here's the result. (losslessly compressed output from DSC)jazigo wrote: ↑26 May 2024, 23:21I find the example attached is a bit hard to make sense of, unfortunately. Do you have access to reference implementation in C code now? If so, could you run the software on the image in this link?: https: //ratchet-galaxy. com/en/games/ps5/ratchet-and-clank-rift-apart/media/screenshots#&gid=screenshots&pid=21
I have done some light research on the topic of DSC artifacts and I have found some information here: https: //www.pulse-eight. com/News/BlogDscVsCsc and here: https: //blog.biamp .com/understanding-video-compression-artifacts/
In short, we should see the spatial artifacts occur with DSC, but I haven't found any example of this so far.
https://filebin.net/mj3tg4fuhriqhydb
You did not say what compression you wanted to use so I picked worst case - 24 bpp to 6 bpp (4x).
What artifacts do you expect? Some visible patterns of damage? There are none basically, the details are affected but it's hardly perceptible.
Here's quality loss (numerical difference between input and output) magnified by 50x, first in the DSC compression and then in 100% best quality JPEG compression. As you can see JPEG is generally better but affects image differently and yields more errors in the sky.
DSC output is 6,2 MB, JPEG output is 9,9MB.
- Attachments
-
- DSC.jpg (2.67 MiB) Viewed 7066 times
-
- JPEG.jpg (2.08 MiB) Viewed 7066 times
Re: How does DSC affect image quality?
Hi!
Sorry for my very delayed response! I have been digging down on a different topic recently.
Thank you for doing the testing, they really put things in perspective.
Regarding the results, I assume that we are watching the diffs from the original to the compressed one. Given that, the worst case example is clearly a very modified output. I find it interesting that the text is also very modified. Do you know the diff-rate of what is visualized here? Say that a pixel - 128,128,128 [RGB gray] - that is modified by the compression, would that be like 129,130,127 or are we talking bigger offsets?
This is probably asking a lot, but could we get a diff image from the same original image where only 24bpp to 12bpp? I think that would be the most common compression for people out the using this technology.
Sorry for my very delayed response! I have been digging down on a different topic recently.
Thank you for doing the testing, they really put things in perspective.
Regarding the results, I assume that we are watching the diffs from the original to the compressed one. Given that, the worst case example is clearly a very modified output. I find it interesting that the text is also very modified. Do you know the diff-rate of what is visualized here? Say that a pixel - 128,128,128 [RGB gray] - that is modified by the compression, would that be like 129,130,127 or are we talking bigger offsets?
This is probably asking a lot, but could we get a diff image from the same original image where only 24bpp to 12bpp? I think that would be the most common compression for people out the using this technology.
Re: How does DSC affect image quality?
Link doesn't work for mebetonKruglosuTotchno wrote: ↑31 May 2024, 00:17
Sure, here's the result. (losslessly compressed output from DSC)
https://filebin.net/mj3tg4fuhriqhydb
- Chief Blur Buster
- Site Admin
- Posts: 11895
- Joined: 05 Dec 2013, 15:44
- Location: Toronto / Hamilton, Ontario, Canada
- Contact:
Re: How does DSC affect image quality?
The original post was made in July 2023, so that filebin apparently expired, sadly.
The race to bottom (4 and 5 digit prices reduced to 3 digit prices in many cases) creates a lot of cost pressures.
At least DSC looks better than using 4:2:2 chroma or 4:2:0 chroma for same relative bandwidth savings (33% and 50% respectively). It gotta support a lot of chips that can only do cheap simple compression. Artifacts are massive bigger for 4:2:2 and 4:2:0 for real-world use cases.
My bigger worry is unnecessary DSC lag of improper DSC processing implementations. Properly implemented in a lagless way, rather than bad laggy implementations. Firmware engineering is sometimes cheaped out upon.
BTW, If milked to the maximum, DisplayPort 2.1 now support 16K 60Hz, and 8K 240Hz, and 4K 960Hz with large-ratio DSC. There's a bit of fudge factor here, you can push a bit beyond with a bit of optimizing (e.g. 4K 1000Hz over one cable is possible within the maximum milkings of DisplayPort 2.1 specification).
All of those modes are same number of pixels/sec processing. Quadrupling refresh rate ability via 4x DSC allows a large 4x motion resolution improvement if your frame rate can keep up (e.g. scrolling / panning in apps)! It is also works over 80GBps USB-C/Thunderbolt-to-DisplayPort adaptors such as this one supporting DisplayPort 2.1 which I recently purchased, as long as your GPU and OS supports it. Obviously, large-ratio DSC will begin to how minor artifacts if you really look but it's still relatively imperceptible.
Biggest DSC problem is badly implemented DSC logic that adds lag. DSC can be lagless, but it is not always implemented laglessly inside the display firmware (ugh). Things are getting better and better though.
New tip for new readers of this thread:
You can always turn off DSC during color critical work (e.g. PhotoShop or Gimp or Paint.Net or Krita doesn't need 240Hz), and turn on DSC for your gaming needs. The settings you play with in your game has bigger perceptible effects than the DSC setting for a gigantic refresh rate gain! Windows at lower Hz, gaming at higher Hz, setup hotkeys for Hz-switch, and using Win11's own Win+Alt+B to turn off HDR to free up DSC-free bandwidth. Whoopee.
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on: BlueSky | Twitter | Facebook
Forum Rules wrote: 1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
2. Please report rule violations If you see a post that violates forum rules, then report the post.
3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!
-
- Posts: 15
- Joined: 22 Feb 2023, 13:48
Re: How does DSC affect image quality?
I would be more than happy to answer any questions regarding using the console tool to get the results but you are not asking them, you just expect the result.
Sure but unlike more complicated video codecs DSC cannot use previous frames to save quality, so increasing FPS at same bitrate will hurt DSC image much more than it would hurt literally anything else like MPEG4. Consequentially, the quality loss is uniform and can't be improved when the scene has little movement like it happens with literally every common video codec.Chief Blur Buster wrote: ↑26 Nov 2024, 01:44All of those modes are same number of pixels/sec processing. Quadrupling refresh rate ability via 4x DSC allows a large 4x motion resolution improvement if your frame rate can keep up (e.g. scrolling / panning in apps)!