So we’ve learned about multimedia containers and codecs in the last post. Today we will dig deeper into what happens to a file when we compress it. First I want to let you know that almost every video you see is compressed to some degree. From cable and satellite TV, to BluRay discs, Internet streaming and all video tape. The only way you will see uncompressed video is if you work on video that is uncompressed, usually transfered from film. The type of compression will directly relate to the quality you see. The quality experience on Internet streaming and cable/satellite feeds will degrade depending on either your current Internet speeds or in the case of cable can have many variables including how many people in your immediate neighborhood are currently watching. I have also noticed TV broadcasters giving sports priority in order that games will look great in HD while some sitcoms look terrible (in my opinion). This is because too much compression will cause artifacts with fast on-screen motion, especially when there are many colors involved. The compression actually removes some of the color information in order to lower the data rate. Normally, your eye cannot tell the difference.
Since we’ve learned that video is just just a series of still frames, compression algorithms attempt to reduce the amount of redundant pixels needed in the transition from one frame to the next. If there is no movement between 2 frames of video, then the pixels from the first frame can be repeated on the next without resending the data and your eye will still perceive the same image with no apparent loss in quality. If there is a person walking across the frame then theoretically only the pixels that represent that person need to change and the still background can remain. A variable bit rate can be used when some scenes have greater action than others by encoding more bits of data only when high motion is detected. This method can cause some undesirable artifacts as the data ramps up, and that’s when we use a two-pass encode. The first pass is strictly for analyzing the motion estimation and the second pass encodes the file based on the data from the first pass. When encoding DVD & BluRay professionally, the studios take much more time to ensure each scene is dialed in separately for the best quality.
And lets not forget about the audio. In the most simplest explanation I can come up with, when compressing audio, all sounds that are perceived to be inaudible to the human ear are simply dropped from the spectrum to save bits. In audio as well as video there are different levels of compression. Lossy, is more destructive and creates smaller file sizes and lossless tries to stay as close to uncompressed as possible but at the trade-off of larger data streams. A lossy audio codec like MP3 will crush music so bad that a trained ear will easily notice the lack of the high and low frequency response. Even though technically it’s only removing what we can’t hear, those extra frequencies re-enforce neighboring frequencies to reproduce a smoother, fatter tone. And of course audio compression can suffer from artifacts just like video can. I’m sure you have heard a bad MP3 file where there are encoding errors which sound like blips and hiccups. You may have also heard music having a tinny or underwater quality to it.
Of course I can’t go into all the details here. There is much more to compression so if you want to learn more I recommend some Googling and wrapping your head around this wikipedia article.