Skip to content

Analysis of compression method used by 1st gen USB DisplayLink devices

License

Notifications You must be signed in to change notification settings

kjy00302/displaylink-compression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DisplayLink DL-1x0 compression technology analysis

This document is README.ko.md file translated with Google Translator.

This document describes the compression method used by the first generation DisplayLink devices to transmit compressed data.

How the compression works

The compression method uses a type of Huffman encoding as analyzed by the Tubecable developer, but it does not designate a code for every value. Instead, it has an accumulator that stores value. As the tree is traversed based on the input, the value assigned to the node is added to the accumulator, and if the next row is 0, it is considered the end and the value stored in the accumulator so far is used.

Decompression flows

Structure of the decompression table

A node of the decompression table consists of a total of 9 bytes. It consists of the following fields:

Compression table row

A node can be further decomposed into two elements.

Element Color UnkByte UnkBool NextNode
A ShortA Byte1A bool(Byte2A & 0x60) (Byte2A & 0x1f) << 4
B ShortB Byte1B bool(Byte2B & 0x60) (Byte2B & 0x1f) << 4

The fields in each element have the following roles:

  • Color: The color to add to the color accumulator.
  • UnkByte: Not yet figured out.
  • UnkBool: Not yet figured out.
  • NextNode: The number of the node to move to.

Example: How the bitstream 111000 is interpreted as 0xF800

decompression figure

Utilities

decomptable_util.py

A Python module for manipulating the decompression table transmitted to the device.

./decomptable_util.py decomptable.bin

generate_graph.py

Prints the graph (in DOT language format) of the decompression table to standard output.

./generate_graph.py decomptable.bin > graph.dot

Example: Generated graph of decompression table from Tubecable

lutgenerator.py

Generates compressed color values ​​that are transmitted to the device.

./lutgenerator.py decomptable.bin

About

Analysis of compression method used by 1st gen USB DisplayLink devices

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages