News for hackers. Stuff that matters.
Re:Improving compression with a preset DEFLATE dictionary by dantillberg on Monday March 30, 2015 @08:15AM (#9288956)
I love the explanation of how LZ77 works; compression algorithms often seem like they must use some sort of arcane magic, so it's great to lift the veil a bit.

I wonder: how many folks have Little Bunny Foo Foo stuck in their heads after reading this?

Re:Improving compression with a preset DEFLATE dictionary by userbinator on Monday March 30, 2015 @09:18AM (#9289243)
The "arcane magic" impression likely comes from the heavy use of information theory concepts and maths that are encountered in the traditional literature. Probably necessary to analyse in detail, but quite daunting for the beginner. I find LZ to be particularly intuitive since it embodies the natural notion of "abbreviation" by referring to something we've seen before, and writing compressors/decompressors for the algorithm is relatively easy (especially decompressors.)

On the other hand Huffman is somewhat less easy to grasp intuitively, but some aspects of its principle of reducing bits/symbol based on their frequency shows up in natural languages: the more common a word is, the shorter it tends to be. It's also a bit more difficult to implement.

Re:Improving compression with a preset DEFLATE dictionary by eru on Wednesday April 01, 2015 @02:49PM (#9305888)
And as words become more common (over time or in specific parts of the population), they often become shorter, too.

Eg see the evolution from phone / mobile phone, to landline / phone.

Re:Improving compression with a preset DEFLATE dictionary by ck2 on Monday March 30, 2015 @08:19AM (#9288970)
Now go read about Markov chains which will blow your mind.

Back in the late 80s I read an interview with Phil Katz who mentioned them to possibly improve PKZIP so I looked them up in the library. That's when it dawned on me there were people far, far more intelligent and clever in this world than I would ever be.

Re:Improving compression with a preset DEFLATE dictionary by mnw21cam on Monday March 30, 2015 @08:26AM (#9289001)
Now go and read about the Burrows-Wheeler block-sort algorithm, which is used by the bzip2 compression program. This can only be a product of a sick and twisted (but quite brilliant) mind.
Re:Improving compression with a preset DEFLATE dictionary by mbrock on Monday March 30, 2015 @08:57AM (#9289144)
Wow, I remember skipping class to sit in the library and implement the Burrows-Wheeler transform. Such a wonderfully clever algorithm, particularly the inverse step!
Re:Improving compression with a preset DEFLATE dictionary by draugadrotten on Monday March 30, 2015 @09:26AM (#9289287)
...and while we talk about blown minds and algorithms, be sure to watch the beautofully executed Quick-sort with Hungarian (Küküllőmenti legényes) https://www.youtube.com/user/AlgoRythmics/videos
Re:Improving compression with a preset DEFLATE dictionary by talideon on Monday March 30, 2015 @11:54AM (#9290326)
LZ77 is pretty trivial as compression algorithms go. Go take a look at this video for a explanation accessible to non-developers: https://www.youtube.com/watch?v=goOa3DGezUA
Re:Improving compression with a preset DEFLATE dictionary by Dylan16807 on Monday March 30, 2015 @10:03AM (#9289535)
The arcane part is what happens after the repetitions have been found and replaced. At that point you have the entropy encoding stage where more common tokens get shorter encodings and more rare tokens get longer encodings. The basic idea isn't too complex, but then optimizing it adds extra layers to efficiently store which tokens are common and which are rare. This results in something quite arcane indeed.