Home > Audio, Linux, Testing, Texas Instruments OMAP 4 > Opus Open Source and License-free Audio Codec Decreases Latency over VoIP Codecs, (Slightly) Betters MP3 and AAC Quality

Opus Open Source and License-free Audio Codec Decreases Latency over VoIP Codecs, (Slightly) Betters MP3 and AAC Quality

I’ve just stumbled upon Opus, a relatively new audio codec, with the release of version 1.1 implementation which  improves encoding quality for VBR audio, automatically detect audio or speech to select the best encoding mode, and improved 5.1 surround quality/compression ratio. The new release also bring speed improvements for all architectures, and specifically for ARM, where decoding uses around 40% less CPU and encoding uses around 30% less CPU thanks to the use of NEON compared to an earlier version.


libopus 1.0 vs 1.1 for x86_64 and ARM Cortex A9 (OMAP4460)
N.B: The audio file is looped 16 times for x86 tests, and only 4 times for ARM tests

You can go to the online demo page to find more about the latest released, and try some of the latest improvements.

This all looks fun, but I wanted to know more about Opus, and especially how it compares against MP3 or AAC. It turns out Opus was not originally designed to compete against MP3/AAC which are used to store audio, but instead it was meant to be used for real-time applications like VoIP or video conferencing, which require a low latency. Opus codec is actually composed of two audio codecs SILK for voice, and CELT for music, and automatically selects the one most suited to the audio type to provide better quality and a lower bitrate.

I went over to Wikipedia for a couple of charts, and if these are correct, Opus is the holy grails of audio codecs. It’s royalty-free, and beats all other codecs in terms of latency, and quality/bitrate ratio. I haven’t found comparisons for encoding and decoding times, but it has to be very fast since VoIP is the main purpose of the codec. One downside is the lack of hardware decoding as seen for MP3 and AAC, so in a mobile device, it would most certainly lower the battery life compared to MP3 or AAC video.

Opus_bitrate_latency_comparisonOpus has a better latency compared to VoIP codecs (G.729, G.722, Speex,…) and is capable of high-fidelity at bitrate comparable to Vorbis, AAC, MP3.

Opus_Quality_Bitrate_ComparisonOpus can support a very wide range of codecs thanks to its speech and music codec, and has superior quality for a given bitrate over all other codecs, except at very low bitrates (<~10kb/s) where AMR-WB,  ARM-NB, and Speex may still have an advantage. Most of my MP3 files are usually encoded at 128kb/s or 192kb/s, and Opus can better the quality of MP3 @128kb/s, and is about the same as Vorbis and AAC. As Opus has about the same quality Vorbis, another royalty-free, open source code, and MP3 and AAC are omnipresent, it may struggle to gain traction in this area.

Opus is already supported in several well-known software and hardware platforms, such as Firefox, Chromium, Gstreamer, Icecast, VLC, ChromeCast and many more.

It’s open source, so let’s download the latest version. I’ll do that in Ubuntu 13.04, but you can also build libopus for Windows or Mac OS, or easier, directly download opus-tools. for these two platforms. Opus library and tools may already be in your Linux distribution repositories, but these will be an older version, so we’ll get the source code tarball, extract it and build the library and tools:

The implementation uses floating point by default, so if you’re using an embedded platform, you may want to use the fixed point implementation instead for better performance, albeit slightly lower quality with:

Beside the libopus, this will generate opus_demo and opus_compare executables in the top directory, btu these are mainly for test purposes and use raw PCM files as input and output raw fiels that are unasble for distributions. Opus will use the Ogg encapsulation, and to create playable OggOpus files we’ll need the Opus tools:

This will generate two utilities:

  • opusenc – Converts WAV, AIFF, FLAC, Ogg/FLAC, or raw files into OggOpus files
  • opusdec – Converts OggOpus files into a WAV or raw file

I’ll download the audio file used for libopus tests in the first chart of this post:

Let’s encode it to OggOplus:

The original file is 17.4MB, and the resulting file 1.3MB. I went to Nautilus, clicked on comp48s.opus, and the file started to play in Rhythmbox. Awesome!
Finally, let’s decode the opus file back to wav:

A quick check to play it back in Rhythmbox, it works. Perfect.

If you want to find out more, visit opus-codec.org

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

  1. No comments yet.
  1. No trackbacks yet.