I was wondering if this compression method already exists:
If we have a sequence of bytes, we translate them into offsets pointing backwards at the nearest occurence of the same byte (kind of like in normal LZ compression).
For example, following sequence:
...
...
48
69
0
132
69
69
132
48
could translate into:
...
...
129
6627
9
150
3
1
3
7
In the result, frequent bytes turn into smaller numbers which can be stored in less bits - just like in Huffman. Infrequent bytes can turn into numbers larger than 255.
Compared to Huffman, you avoid building a huffman tree and the method also adapts to changes in frequency through the data.
I've tested it in practise with mixed results on different kinds of data...
For now, I just wanted to know if it was already existing![]()