# Display Stream Compression

Display Stream Compression (DSC) is a VESA-developed video compression algorithm designed to enable increased display resolutions and frame rates over existing physical interfaces, and make devices smaller and lighter, with longer battery life. It is a low-latency algorithm based on delta PCM coding and YC$_G$C$_O$-R color space.

## Effect

Although DSC is not mathematically lossless, it meets the ISO/IEC 29170 standard for "visually lossless" compression, a form of compression in which "the user cannot tell the difference between a compressed and uncompressed image". ISO 29170 more specifically defines an algorithm as visually lossless "when all the observers fail to correctly identify the reference image more than 75% of the trials".$^{:18}$ However, the standard allows for images that "exhibit particularly strong artifacts" to be disregarded or excluded from testing, such as engineered test images.$^{:13,18}$ Research of DSC using the ISO/IEC 29170 interleaved protocol, in which an uncompressed reference image is presented side by side with a rapidly alternating sequence of the compressed test image and uncompressed reference image,$^{:10}$ and performed with various types of images (such as people, natural and man-made scenery, text, and known challenging imagery) shows that in most images DSC satisfies the standard's criterion for visually lossless performance, although in some trials participants were able to detect the presence of compression on certain images.

## Algorithm

DSC compression works on a horizontal line of pixels encoded using groups of three consecutive pixels for native 4:4:4 and simple 4:2:2 formats, or six pixels (three compressed containers) for native 4:2:2 and 4:2:0 formats.
* Preprocessing:
** If RGB encoding is used, it is first converted to reversible YC$_G$C$_O$.
** If "simple 4:2:2" is used, it is converted to 4:4:4 by adding missing chroma samples through interpolating neighboring pixels.
* Each component (1 luma, 2 chroma) is coded separately using three independent substreams (four substreams in native 4:2:2 mode). Prediction step is performed using one of the three modes: modified median adaptive coding (MMAP) algorithm similar to the one used by JPEG-LS, block prediction (optional for decoders due to high computational complexity, negotiated at DSC handshake), and midpoint prediction.
* Bit rate control algorithm tracks color flatness and buffer fullness to adjust the quantization bit depth for a pixel group in a way that minimizes compression artifacts while staying within the bitrate limits.
** DSC can work in constant or variable bitrate mode. The minimum allowed bits-per-pixel (BPP) is 6 bit/px;$^{:52}$ the typical BPP given on VESA's website is 8 bit/px. The variable-bitrate is actually a way to temporarily disable the display link;$^{:125}$ it only adds the possibility of choosing 0 bit/px.$^{:41}$
* Repeating recent pixels can be stored in 32-entry Indexed Color History (ICH) buffer, which can be referenced directly by each group in a slice; this improves compression quality of computer-generated images. Alternatively, prediction residuals are computed and encoded with entropy coding algorithm based on delta size unit-variable length coding (DSU-VLC).
* Encoded pixel groups are then combined into slices of various height and width; common combinations include 100% or 25% picture width, and 8-, 32-, or 108-line height.
A modified version of DSC, VDC-M, is used in DSI-2. It allows for more compression at 6 bit/px at the cost of higher algorithmic complexity.

## History

DSC version 1.0 was released on 10 March 2014, but was soon deprecated by DSC version 1.1 released on 1 August 2014. The DSC standard supports up to a 3∶1 compression ratio (reducing the data stream to 8 bits per pixel) with constant or variable bit rate, RGB or Y′C$_B$C$_R$ 4:4:4, 4:2:2, or 4:2:0 color format, and color depth of 6, 8, 10, or 12 bits per color component.
DSC version 1.2 was released on 27 January 2016 and is included in version 1.4 of the DisplayPort standard; DSC version 1.2a was released on 18 January 2017. The update includes native encoding of 4:2:2 and 4:2:0 formats in six-pixel containers, 14/16 bits per color, and minor modifications to the encoding algorithm.
On 4 January 2017, HDMI 2.1 was announced which supports up to 10K resolution and uses DSC 1.2 for video that is higher than 8K resolution with 4:2:0 chroma subsampling.
Using DSC with HBR3 transmission rates, DisplayPort 1.4 can support 8K UHD (7680 × 4320) at 60 Hz or 4K UHD (3840 × 2160) at 240 Hz with 30 bit/px RGB color and HDR. 4K at 96 Hz 30 bit/px RGB/HDR can be achieved without the need for DSC. On displays which do not support DSC, the maximum limits are unchanged from DisplayPort 1.3 (4K 120 Hz, 5K 60 Hz, 8K 30 Hz).
DisplayPort version 1.4a was published in April 2018. VESA made no official press release for this version. It updated DisplayPort's DSC implementation from DSC 1.2 to 1.2a.
With HDMI 2.1, which can also use DSC 1.2, is also capable of 8K up to 120 Hz with HDR.