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 follows: _encoder = opus_encoder_create(48000, 2, OPUS_APPLICATION_AUDIO, &error); 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 data. 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>
Jean-Marc Valin
2016-Dec-15 19:09 UTC
[opus] Error running opus encoder/decoder under PIC32
On 10/11/16 04:50 AM, Manuel Heras wrote:> 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).0x8001 and 0x7fff aren't silence. They're the largest signal representable. Did you use the float API with very large values (should be +/-1) by any chance?> 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 follows:See if you can reproduce the problem with opus_demo. Cheers, Jean-Marc