[opus] [EXTERNAL] Re: Developing OPUS on TI CC3220
vince.rodriguez at ti.com
Fri Feb 23 20:47:35 UTC 2018
Thanks for the quick reply.
Using your comments, I was able to get my implementation to be much closer to working. Decode taking ~8 msecs and encode is ~13 ms.
I noticed with decode, if I use a file saved on the device, I can decode it in 4 ms. This is the timing I need to make the bi-directional work.
Looking into how my encoder is setup. It seems I can isolate my overflow condition to the Silk implementation. On the first call to Encode with silk, the codec does a malloc, and I get a null pointer returned.
I guess I'm a little hazy on the memory requirements. We have a heap, that holds the state of the codec (~25 kB), but do we also need to malloc other memory to encode? Or does the codec use the heap allocated to do all encoding?
From: Jean-Marc Valin [mailto:jmvalin at jmvalin.ca]
Sent: Friday, February 23, 2018 11:12 AM
To: Rodriguez, Vince; opus at xiph.org
Subject: Re: [EXTERNAL] Re: [opus] Developing OPUS on TI CC3220
On 02/23/2018 10:47 AM, Rodriguez, Vince wrote:
> Currently decode takes 16~22 ms and encode is ~13 ms. What is the best
> way to try to reduce this time? Also, unsure why encode is taking less
> time than decode...
Tried running a profiler?
> I've also noticed if I change my encoder to silk only, I get a Heap
> overflow... I have dynamically allocated a heap for the codec, got the
> size using the api and used encode init so that the memory is
> allocated to my created heap. I have 30k currently in heap, since the
> return of get size was ~25 kB. This seems to happen when I change the
> application as well. :/
SILK and CELT use exactly as much heap since the only heap Opus needs is the encoder state which holds both the SILK and the CELT state. What stack allocator did you end up choosing? If you used the pseudo-stack, then that allocates a lot of heap memory. If not, then maybe you have some sort of collision between the stack and heap?
> i32error = opus_encoder_init(sOpusEnc, 16000, 1,
OPUS_APPLICATION_RESTRICTED_LOWDELAY will force CELT-only mode here, regardless of other options.
> opus_encoder_ctl(sOpusEnc, OPUS_SET_FORCE_CHANNELS(1));//Mono
No need to force mono since you're only encoding one channel (this does nothing).
More information about the opus