O'Reilly logo

Understanding Compression by Aleks Haecky, Colton McAnlis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Evaluating Compression

Before bounding off into the weeds and jamming compression into every part of your fancy application, it’s important to note all of the trade-offs and use cases involved. Not every algorithm is suited for every use case, and in some instances, a different implementation of the same compression format might better match your need.

So, when it comes to data compression, what matters?

Compression Usage Scenarios

Let’s begin this discussion by setting the stage on where data is compressed, stored, and decompressed. This is critical for understanding where the data is coming from and where it’s going, because of the important interplay between encoder and decoder, which we’ll talk about more in a bit. First, let’s look at four common scenarios.

Compressed Offline, Decompressed On-Client

In this first scenario, the data is compressed somewhere unrelated to the client, and then distributed to the client, where it’s decompressed for use.

This scenario is most common for things like packaged applications or video games, and the resources often include copious amounts of images, videos, and music. Another use case is artists creating and sharing their work. In both cases, the original art is created by using high-resolution, high-fidelity tools, and then exported and compressed for distribution.

Compression aims to optimize for the smallest possible media files.

The trade-off is one of quality.

Compressed On-Client, Decompressed In-Cloud

Most modern ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required