Hi, We have observed that the stack usage in Opus Encoder/Decoder is enormous(50-60Kb approx). As we all know, in embedded systems, high stack usage is discouraged. How are we planning to take care of that? One idea is to allocate the required memory on heap and pass it on as an argument to the main Opus API and allocate the internal buffers used by the internal modules on the allocated buffer. This is currently not supported on Opus. I believe, Opus is going to be a part of Android in the near future and since Android is meant for Embedded domain, I just thought of raising this issue. I am new to this group, hence if this has already been discussed, please point me to the correct mailing list. Thanks and Regards, Rhishi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20130920/d3ce9f52/attachment.htm
Actually, the code already has an option for using the heap rather than the stack, see NONTHREADSAFE_PSEUDOSTACK in the code. As the name implies, it's not thread-safe though. Cheers, Jean-Marc On 20/09/13 01:29 AM, Rhishikesh Agashe wrote:> Hi, > > > > We have observed that the stack usage in Opus Encoder/Decoder is > enormous(50-60Kb approx). As we all know, in embedded systems, high > stack usage is discouraged. > > How are we planning to take care of that? > > > > One idea is to allocate the required memory on heap and pass it on as an > argument to the main Opus API and allocate the internal buffers used by > the internal modules on the allocated buffer. This is currently not > supported on Opus. > > > > I believe, Opus is going to be a part of Android in the near future and > since Android is meant for Embedded domain, I just thought of raising > this issue. > > > > I am new to this group, hence if this has already been discussed, please > point me to the correct mailing list. > > > > Thanks and Regards, > > Rhishi > > > > > > > > _______________________________________________ > opus mailing list > opus at xiph.org > http://lists.xiph.org/mailman/listinfo/opus >
Yeah I see the definition, but unlike USE_ALLOCA and VAR_ARRAYS, it has not been used/set anywhere in the code for allocating buffers! Regards, Rhishi -----Original Message----- From: Jean-Marc Valin [mailto:jmvalin at jmvalin.ca] Sent: Friday, September 20, 2013 12:00 To: Rhishikesh Agashe Cc: opus at xiph.org Subject: Re: [opus] Regarding stack usage in Opus Actually, the code already has an option for using the heap rather than the stack, see NONTHREADSAFE_PSEUDOSTACK in the code. As the name implies, it's not thread-safe though. Cheers, Jean-Marc On 20/09/13 01:29 AM, Rhishikesh Agashe wrote:> Hi, > > > > We have observed that the stack usage in Opus Encoder/Decoder is > enormous(50-60Kb approx). As we all know, in embedded systems, high > stack usage is discouraged. > > How are we planning to take care of that? > > > > One idea is to allocate the required memory on heap and pass it on as > an argument to the main Opus API and allocate the internal buffers > used by the internal modules on the allocated buffer. This is > currently not supported on Opus. > > > > I believe, Opus is going to be a part of Android in the near future > and since Android is meant for Embedded domain, I just thought of > raising this issue. > > > > I am new to this group, hence if this has already been discussed, > please point me to the correct mailing list. > > > > Thanks and Regards, > > Rhishi > > > > > > > > _______________________________________________ > opus mailing list > opus at xiph.org > http://lists.xiph.org/mailman/listinfo/opus >