facebook rss twitter

Codecs

by Steve Kerrison on 15 August 2005, 00:00

Tags: 3Com

Quick Link: HEXUS.net/qabno

Add to My Vault: x

Introduction

Often mentioned but little understood, codecs are the unsung heroes of our computing and digital-media world.

They make possible many of the fun and useful gadgets and technologies we take for granted, such as DVD movies, digital satellite TV, MP3 music players and the taking and editing of digital still images and videos.

Without them, we'd have no PC networking, no broadband, indeed, no internet – or, at least, nothing anywhere near as useful or affordable. But codecs have been with us for a long time, stretching back to and beyond Terry Welch's creation in the mid 80s of the LZW codec that underlies the widespread use today of Zip compressed files.

So, just what are codecs?

The technology

Codecs compress and decompress data. The word codec is a shortening of the term Compressor/Decompressor. Compressing a data stream or a file reduces its data rate. This cuts costs all the way down the line. It reduces the bandwidth required for transmission or broadcasting and the amount of space required for storage. Before the data can be used, though, it has to be decompressed. Both phases of a codec's work can be carried out in hardware, in software or a combination of both.

The simple fact is that we unknowingly use and take advantage of many different types of Codecs every day. As we move ever closer to creating the digital home, we'll be ever more reliant on Codecs – so some little knowledge of them might just be useful.

Whenever you stream or download music or video file from the internet, your computer uses codecs to decompress that data and present it to you. The same codec will have been used to encode and create that file originally. Compressing the file has reduced its size and allowed it to be passed over to you much quicker.

When an audio or video file is encoded, there are various things the codec can do to make it smaller. Some involve repackaging the data without losing any of the information. This method is called lossless and often analyses patterns in data and re-organises it more economically. Lossless compression is required with a Zip file, otherwise its contents, often an executable file, wouldn't work.

Other methods use lossy compression that removes and discards information. This is done if the loss of quality won't be noticeable or is acceptable given the benefit of a much smaller file or data stream. And everyday example is the options available when saving a JPEG still image file. These allow the user to decide how much information is lost as a trade-off against smaller file size.

Sometimes, lossless techniques are applied first, followed by lossy. Unless we say otherwise, all the codecs mention below are lossy.

The four letters "MPEG" crop up again and again in discussions about codecs so it's worth knowing what they mean. MPEG is the shortened version of Moving Pictures Experts Group which, just as it would appear, is a group of people who are expert in the technologies involved with moving pictures.

The group has representatives from broadcasters, hardware and software makers and many other interested parties. Between them, they try to create and agree standards that improve the quality and reduce the data rates of video and audio files and streams.

There is much rivalry between the companies these experts work for but, in theory, MPEG members also work for the common good and, so far, the system has worked pretty well. However, the increased emphasis on digital rights management to try to prevent wholesale copying demonstrates that the companies who own rights to music and movies think things are far from perfect.

When considering the encoding of video, there are a few things for MPEG – and yourself - to consider. First, does the video also have audio with it? If so, codecs will be needed for video and audio. Picture and sound must be synchronised with each other and the way this is done is to keep them together, or encapsulate them, in some sort of container. The result will be a file that contains the encoded audio data, the encoded video data and any data needed to keep the audio and video synched. Some containers support specific audio and video codecs, others allow almost any combination.