OPUS Decoder Memory Usage

Hello,

I'm evaluating using the opus library included as a of the "nRFready Smart Remote 3 nRF52" as a part of our zephyr based application. We only need to decode stored opus voice files and don't do any encoding. Our application is quite limited on RAM, so we'd like to reduce the stack sizes used by opus as much as possible. I've been able to integrate it properly and things to seem to work, but am wondering how to set the stack sizes accordingly. Currently we're using 8kHz Sampling Frequency, CELT, 16K constant bitrate, 10mS Frame Size, 1 Channel. This leads to  9224 for the OpusDecoder structure, and our stack size is set at 10k bytes for the dynamically allocated ALLOCs throughout the opus code. 

I wanted to ask for recommendations on the recommended minimum stack size for opus decoding?

Also, would you modify any of the parameters to reduce the RAM usage?

Thanks,

Francisco 

Parents Reply
  • Hi, Yes I ran puncover to determine the worse case stack size, but because of the use of ALLOCs inside the OPUS code, we end up having a lot of dynamic stack allocations which puncover cannot calculate since the size of the variable is set at run time. For example OPUS uses these ALLOC calls throughout their code which dynamically allocate to the stack size:

    #
    define ALLOC(var, size, type) type var[size]

    I could moved these to be in  the heap, but then I wouldn't know how big my heap should be.

Children
No Data
Related