user1873073
user1873073

Reputation: 3670

If you didn't have to worry about time what would be the best compression technique?

I don't mean compression for images or videos but compression in general. As a domain say you had 1 hour to compress or decompress a 10MB file on an i9 with a good GPU and 64GB of RAM. I'm not saying that power has to be used.

I recently heard about pifs which just finds the index of a file in pi. That got me thinking about other ways a number can be, effectively, compressed.

Upvotes: 1

Views: 53

Answers (1)

Mark Adler
Mark Adler

Reputation: 112502

I will assume by "best" you mean the smallest compressed representation, which implies that you are talking about lossless compression. For lossy compression, e.g. on images, any method can make the result as small as you like, with a continued degradation in quality. So the rest of this answer is about lossless compression.

There is no such thing as "compression in general". Compression always depends on redundancy in the statistics and patterns expected in the particular kind of data being compressed. Random data cannot be compressed.

For example, English text has a particular kind of redundancy, with some characters repeated more than others, words that are repeated and more common than others, certain words that are more likely to follow certain other words, grammar, punctuation structure, etc.

For English text, look at Matt Mahoney's Large Text Compression Benchmark. The top ranked algorithms use Prediction by Partial Matching techniques (also search for "PAQ"), often preceded by a lossless filter that replaces words from a dictionary with shorter symbols, including coding leading capitalization. Very complex context modeling is done to improve the probability of predicting the next bit given all of the bits that preceded it.

Upvotes: 1

Related Questions