[opus] Error running opus encoder/decoder under PIC32

Manuel Heras mheras at wavenetradio.com
Thu Nov 10 09:50:08 UTC 2016

I'm new using OPUS and I've implemented the OPUS lib under PIC32MZ, using
the MIPS configuration. It compiles correctly and it seems that all the
procedures invoked returns no error. However, when I excite the encoder with
a pure 1 kHz tone, the encoding/decoding procedure returns al the samples to
silence (the buffer is filled with 0x8001 or 0x7fff). The configuration is
48000 sps, 64kHz bandwidth, two channels, OPUS_APPLICATION_AUDIO
application. The lib version is 1.1.3. The initialization procedure is as


                _encoder = opus_encoder_create(48000, 2,

                error = opus_encoder_ctl(_encoder, OPUS_SET_BITRATE(64000));

                _decoder = opus_decoder_create(48000, 2, &error);


The variable error is always set to OPUS_OK.

The encoding and decoding procedure is as follows:


                bytesEncoded = opus_encode(_encoder, _encoderBuffer,
_frameSize, codedBuffer, sizeof(codedBuffer));

                sampsDecoded = opus_decode(_decoder, codedBuffer,
bytesEncoded, decoderBuffer, _frameSize, false);


In this case, _frameSize is 960 (20 ms), bytesEncoded returns 0xa1 and
sampsDecoded returns 960; codedBuffer is large enough to store the encoding


Everything seems to be correct, but the result is not. I've also tried with
other configurations and the results are very similar. Any idea about what
can be wrong in my implementation?


Thanks in advance for your help and kind regards,

M. Heras

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/opus/attachments/20161110/b155422e/attachment.html>

More information about the opus mailing list