How does DSC affect image quality?

Advanced display talk, display hackers, advanced game programmers, scientists, display researchers, display manufacturers, vision researchers & Advanced Display Articles on Blur Busters. The masters on Blur Busters.
Post Reply
betonKruglosuTotchno
Posts: 11
Joined: 22 Feb 2023, 13:48

How does DSC affect image quality?

Post by betonKruglosuTotchno » 08 Jul 2023, 09:00

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 concentrate 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 372 times
Last edited by betonKruglosuTotchno on 28 May 2024, 17:41, edited 1 time in total.

User avatar
Chief Blur Buster
Site Admin
Posts: 11775
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

Re: How does DSC affect image quality?

Post by Chief Blur Buster » 11 Jul 2023, 03:25

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 Twitter

Image
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!

iopq
Posts: 49
Joined: 23 May 2020, 10:06

Re: How does DSC affect image quality?

Post by iopq » 16 May 2024, 05:06

Can we get before/after images of DSC compression?

betonKruglosuTotchno
Posts: 11
Joined: 22 Feb 2023, 13:48

Re: How does DSC affect image quality?

Post by betonKruglosuTotchno » 18 May 2024, 15:42

iopq wrote:
16 May 2024, 05:06
Can we get before/after images of DSC compression?
There's one example attached.

jazigo
Posts: 1
Joined: 26 May 2024, 22:53

Re: How does DSC affect image quality?

Post by jazigo » 26 May 2024, 23:21

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.

betonKruglosuTotchno
Posts: 11
Joined: 22 Feb 2023, 13:48

Re: How does DSC affect image quality?

Post by betonKruglosuTotchno » 31 May 2024, 00:17

jazigo wrote:
26 May 2024, 23:21
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.
Sure, here's the result. (losslessly compressed output from DSC)
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
DSC.jpg (2.67 MiB) Viewed 1367 times
JPEG.jpg
JPEG.jpg (2.08 MiB) Viewed 1367 times

Post Reply