What are codecs?
A codec is a computer program that compresses/decompresses digital data according to a given file format or streaming format.
Ref URL - http://en.wikipedia.org/wiki/Codec
The relationship between a codec and a container :
Codec is the program used to code / decode OR compress / decompress raw data (called 'essence'). Container is the format that allows the compressed / coded data to be encapsulated and stored in a single place along with the meta data (meta data is the data used for things like synchronization of audio and video in case of formats that contain both kinds of data). So, effectively a container might contain different types of codecs (only some containers are codec specific). e.g. - In case of the Ogg Vorbis audio format, Ogg is the container and Vorbis is the codec. Ogg can contain several other codecs like FLAC and Speex. The combination of a container and a codec creates the entity known as a file format (compression format).
NOTE - In real life, codec and file format, are terms which ppl tend to use interchangeably.
Are codecs software specific?
Codecs are NOT software specific. They basically refer to a standard that can be implement in different ways by different multimedia applications (something on the lines of the TCP / IP protocal being a standard that is implemented in different ways by different OSs). Normally, the codec implementation will NOT be an integral part of the application... rather it will be a separate configurable plug-in. This gives a person (as well as the application developer) more control over what codecs he wants to add or remove support for.
Codec comparision shoot out :
http://www.extremetech.com/article2/0,1558,1560783,00.asp
Parameters associated with codecs :
To understand the parameters that define a particular file format, we need to understand how analog signal is converted into digital. This is done by taking samples from the analog signal at certain regular time intervals. These intervals are expressed in terms of a parameter known as the 'sampling frequency'.
Sampling freq (in Hz) = No. of samples taken per sec
Another critical factor when talking about A to D conversion is the amount of data that can be captured per sample. This is expressed in terms of the 'bit depth'.
Bit depth = The no. of bits used to express the magnitude of a particular data sample.
e.g. - a bit depth of 8 bits means that a particular data sample can assume one amongst 2 to the power 8 values (thus implying that greater data has been captured).
The 'data rate / bit rate' for the conversion is another key parameter. It is actually dependent on the sampling freq and the bit depth
Bit rate (in bits per sec) = Sampling freq (Hz) * Bit depth (bits)
If we were just talking about uncompressed audio, then mentioning ANY two of these three parameters - Sampling freq, Bit depth and Bit rate, would have sufficed (normally, we tend to define the first two parameters)... but, in case of compressed audio, things change a little bit...
For compressed audio (assuming that the compression algorithm is 'lossy' one), the actual bit rate is FAR lesser than the ideal bit rate (as calculated using the formula given above).
So, Bit rate (for compressed audio format) = Actual bit rate - X (loss factor)
Hence, when talking about compressed audio, mentioning all the three parameters - sampling freq, bit depth and bit rate, becomes essential. In fact, the bit rate parameter overshadows the other two.
So, e.g. - when we talk about MP3 encoding, we can list the parameters as -
Sampling freq = 44.1 KHz
Bit rate = 128 Kbps
and so on...
NOTE - In this post I haven't yet discussed the concept of Variable Bit Rate (VBR), more about that later on...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment