What, Exactly, Is Compression?
Whether you realize it or not, your Mac probably uses compression nearly every day. Almost anything that comes with an Installer uses compression, and many file formats, such as GIF, JPEG, and PDF, have built-in compression and decompression. If you've ever seen StuffIt Expander doing its thing on your Mac, chances are it was decompressing a compressed file.
So what's this compression thing all about? Do you care? Do you need to care?
In the simplest terms, compression makes files smaller. Smaller files use less disk space and travel faster. As for whether you care, if all you want to do is to make some DVDs quickly and easily, the answer is a qualified, "no." Compression goes on "behind the scenes" or "under the hood." You don't see it but it's almost always there. And just as you don't need to know what's going on under the hood of your car to drive it, you don't need to know one iota about compression to make yourself a darned impressive little DVD.
But I believe that the more you know, the better your decisions can be. Since compression affects almost everything you do with iDVD (and with the Mac itself), you probably should know something about it (even though I just said you don't have to).
But first, we interrupt this chapter for an acronym break. As you know, where technology goes, acronyms follow, and DVD-making is no exception. So before we travel any further, here's a brief explanation of some common video and DVD-making word jumbles.
Enough MPEG to get by
Though iDVD makes things easy, there's more to making a DVD that will play in a consumer DVD player than meets the eye. For one thing, the video has to be encoded in the proper format. In the case of DVDs, that's a format called MPEG-2.
I'm going to hit the high points of MPEG-2; if you want the down-to-the-bone nitty-gritty, with all the mathematics and buzzwords included, check out http://mpeg.telecomitalialab.com/ and http://bmrc.berkeley.edu/frame/research/mpeg/mpeg2faq.html.
But merely being encoded in MPEG-2 is not enough. To play back properly, the bit rate (data transfer speed) has to be within a certain range, the frame size has to be just so, and various support files must be on the disc and in the proper directory (folder).
MPEG-2 isn't just for making $3 DVD-R discs, either. SVCD is another format that uses MPEG-2 compression. SVCD can record up to 90 minutes of video on inexpensive CD-R discs (although for good quality, 40-45 minutes is more typical).
And that's enough about MPEG to get you by.
Most compression algorithms (methods or recipes) are designed to work best on a particular type of data. Different schemes excel with different types of data text, graphics, video, audio, or whatever.
Whatever the technique (algorithm), compression comes in two flavors: lossless and lossy.
You use lossless compression when you want to lose nothing in the compression and decompression process. It's the proper choice to reduce the size of files containing text (such as word processor or spreadsheet files), or any other file that needs to be exactly the same when decompressed.
StuffIt, ZIP, TAR, and some flavors of GIF and TIFF use lossless compression. Figure B.1 shows the effect of compression on a 1 MB folder.
Figure B.1. StuffIt Deluxe's lossless compression shrinks the Royal Flush folder by more than 50 percent!
Aladdin Systems' StuffIt turned a 1 MB folder (Royal Flush) into a 472 KB archive file (Royal Flush.sit).
When decompressed, the 472 KB StuffIt Archive will yield a 1 MB folder identical to the original, without having lost a single bit or byte.
The other flavor is lossy compression. It's called that because some data is always thrown away forever when the file is compressed. In most cases, it's data that doesn't affect the way the file looks or sounds after decompression, or at least doesn't affect it too much. JPEG and MPEG are types of lossy compression.
Figure B.2 shows the effect of lossy compression on a low-resolution picture (a screen capture). The one on the left is compressed around 25 percent, and doesn't look much worse than the original. If you were displaying this graphic on a Web page, the compressed version would load faster.
Figure B.2. Compare the slightly compressed (bottom left) and highly compressed (bottom right) JPEG-encoded pictures to the uncompressed original (top).
Figure B.3 shows the result of JPEG compression on a high-resolution photo.
Figure B.3. The more compression, the lower the image quality.
There are three sets of pictures in Figure B.3. Each set has six images: The original 5.1 MB high-resolution TIFF file, four JPEG-compressed copies, and the Finder window displaying their sizes. The set in the lower right is actual size, the middle set is magnified 300 percent, and the set in the upper left is magnified 600 percent.
The 25 percent setting applies the least compression, but produces a file one-fortieth the size that looks almost identical to the (bloated) original.
The 50 percent setting applies a bit more compression, and yields a file even smaller a mere 88 KB. But as you can see in the magnified sets, you're beginning to get some image degradation.
You'd rarely use compression settings as high as 75 percent or 100 percent in real life, but you can see what happens to an image when you do detail is lost and image quality suffers. Sure the files are even smaller, but now they're ugly.
Video compression works almost the same way the more similar each frame is to the ones before and after it, the more compression you can apply without ill effects.
There are many other ways to reduce the size of a movie file besides compression. The two most obvious ways are reducing the frame size and the frame rate. The smaller the image, the less disk space required; the fewer images displayed per second, the less disk space required.
Beyond these rather brute-force techniques, though, you'll find a plethora of compression schemes for video involving the use of one codec (compressor-decompressor) or another.
The codecs used for video CDs and DVDs are different flavors of MPEG. Other codecs that QuickTime can use include DV Stream, Sorenson, Animation, and CinePak, to name just a few. The one that's most important to you at this time is DV Stream, since it's the format iMovie feeds to iDVD.
At the end of the day, it all comes down to this: the more compression, the worse the image quality. Compression is good, but there's such a thing as too much of a good thing. Don't overdo it.
I have two more compression tips for you before we move on.