[opus] Opus Requirement for embedded Application

Jean-Marc Valin jmvalin at jmvalin.ca
Sat Apr 27 05:29:00 UTC 2019

Hi Tarak,

So there's two issues here: memory and CPU cycles. In terms of memory
(and code size), there's probably a lot you can save just by removing
what you're not going to need. I don't know your application, but if you
can get away with just just SILK or just CELT, then you can remove the
other. Considering your complexity constraints, you can also remove the
analysis code as well.

CPU is a bit more tricky, but there's still options. The most important
is to make sure all the optimizations are actually enabled (there's
intrinsics/assembly for ARMv5, ARMv6 and ARMv7NEON). From there you'll
also want to try both fixed-point and floating point to see which is
fastest. As a last resort, if you're currently using SILK and it doesn't
work, you can either try a lower sampling rate, or force the use of CELT
(which often has a lower encoder complexity than SILK). If you're
compressing speech, be aware that CELT will likely require a higher
bitrate to achieve the same quality.

If none of the above works, then your only option is probably to start
writing some assembly code.

As for demo code, if it's for testing then use opus_demo. If it's for
sample code to start from, then look at doc/trivial_example.c



On 4/24/19 12:50 PM, tarek.maamar at sofia-technologies.com wrote:
> Hello everyone,
> I tried integrating opus middleware on an STM32L4 microcontroller based
> project. First thing I noticed is the considerable amount of memory
> allocated by the opus_encoder_create function (nearly 40 kbytes if I
> recall). After modifying my project’s memory setting (mainly heap size
> adjustments), I could bypass some aspects of this problems. What I’m
> noticing now is the time needed for the encode function to treat a 20 ms
> frame (nearly 50 ms for a complexity of 0 which I guess is the lowest
> possible). So here are my questions :
> 1) what is the minimal encoder configuration possible for a minimal
> memory footprint ?
> 2) Considering that I’m using framing to dissociate a large buffer into
> small frames before passing them to the encode function. Is there a way
> to minimize encoding time ?
> 3) Is there a demo code for compressing PCM/WAV ?
> Thanks in Advance.
> Tarak Maamar

More information about the opus mailing list