What is a Codec?

Man using computer for video call
Zero Creatives/Cultura/Getty Images

A codec is an algorithm (OK lets be simple – sort of a program!), most of the time installed as a software on a server or embedded within a piece of hardware (ATA, IP Phone etc.), that is used to convert voice (in the case of VoIP) signals into digital data to be transmitted over the Internet or any network during a VoIP call.

The word codec comes from the composed words coder-decoder or compressor-decompressor. Codecs normally achieve the following three tasks (very few do the last one):

  • Encoding – decoding
  • Compression – decompression
  • Encryption - Decryption

Encoding - decoding

When you talk over normal PSTN phone, your voice is transported in an analog way over the phone line. But with VoIP, your voice is converted into digital signals. This conversion is technically called encoding, and is achieved by a codec. When the digitized voice reaches its destination, it has to be decoded back to its original analog state so that the other correspondent can hear and understand it.

Compression – decompression

Bandwidth is a scarce commodity. Therefore, if the data to be sent is made lighter, you can send more in a certain amount of time, and thus improve performance. To make the digitized voice less bulky, it is compressed. Compression is a complex process whereby the same data is stored but using lesser space (digital bits). During compression, the data is confined to a structure (packet) proper to the compression algorithm. The compressed data is sent over the network and once it reaches its destination, it is decompressed back to it original state before being decoded. In most cases, however, it is not necessary to decompress the data back, since the compressed data is already in a consumable state.

Types of compression

When data is compressed, it becomes lighter and hence performance is improved. However, it tends to be that the best compression algorithms decrease the quality of the compressed data. There are two types of compression: lossless and lossy. With lossless compression, you lose nothing, but you cant compress that much. With lossy compression, you achieve great downsizing, but you lose in quality. You normally cant get the compressed data back to its original state with lossy compression, since the quality had been sacrificed for size. But this is most of the time not necessary.

A good example of lossy compression is MP3 for audio. When you compress to audio, you cant compress back, you MP3 audio is already very good to listen to, compared to huge pure audio files.

Encryption – decryption

Encryption is one of the best tools for achieving security. It is the process of changing data into such a state that it no one can understand. This way, even if the encrypted data is intercepted by unauthorized people, the data still remains confidential. Once the encrypted data reaches destination, it is decrypted back to its original form. Often, when data is compressed, it already is encrypted to a certain extent, since it is altered from its original state.

Go to this link for a list of the most common codecs used for VoIP.