Another installment on compression from Telestream’s Paul Turner. Click here to read his previous article on “Why Compression Matters.”
In my previous blog, I explained how pervasive compression is in our day to day lives. In a nutshell, it’s used everywhere there is information to be shared – written, spoken, viewed. So the next question is “how do you compress information?”
The idea of compression has been around for many, many years. In all cases, it involves finding redundant information in the data and removing it, and then – potentially – removing as much real information as you can while still leaving the information as intelligible. Now that’s a pretty scientific sentence, so I’ll give you some examples to make it clearer (by the way, the 2 techniques directly refer to “lossless” compression and “lossy” compression respectively).
Lossless Vs. Lossy
Look at this article: between the paragraphs are blank lines. Now, my word processor could create those by inserting a string of space characters. That would take up quite a number of bytes to do. Instead, it inserts a single line break character, which your computer interprets as “display a blank line”. You just removed some redundant information, and removing it has not altered the information (words, document) at all. That corresponds to lossless compression. Absolutely no information is lost in the data compression. On the other hand, think about the quality of the audio in a phone call. You can tell that the audio quality isn’t high-fidelity (on land lines, you’re limited to around the lowest 16% of the audio spectrum that humans can hear), but you can still understand what’s being said by the other person. That corresponds to lossy compression – without question, some of the information has been lost and can never be recovered (despite what you may see on forensic shows!!!!), but the result is still intelligible.
Most video compressions technologies offer lossy compression, though in some cases you can set them to to lossless mode, as long as you’re OK with a 2:1 compression ratio or less (2:1 means basically that the resulting file is half the size of the original). They do this by analyzing the frequencies involved in the video using some mathematics called a “Discrete Cosine Transform” or sometimes a “Fourier Transform,” and then decreasing or throwing away the highest frequency components, which your eyes are the least sensitive to.
Audio compression uses the same basic principle, but also makes use of a quirk of human hearing: if one frequency is quite loud, you don’t perceive other frequencies that are close to it. Your brain engages something called “masking”. So if you can identify the loudest frequencies, then you can throw away frequencies nearby – you don’t need to send them at all. This is how mp3, etc. works.
In both cases, the lower the bit rate, the more information you’re discarding. The truly smart part is deciding which bits you can throw away….
Want to learn more? Download our white paper on “The Essentials of Video Transcoding”