[Tremor] Memory Usage

Ripinder Singh ripinder.singh at gmail.com
Tue Feb 1 01:11:43 PST 2005


I would like to mention some of the findings regarding heap size and
data memory in general for tremor low_mem. I tried to compile the
low_mem branch code on VC++ 6.0 and our host platform. As the host
platform doesn't support alloca, I tried to fit the same with malloc
and (subsequent) free calls. Incorporating the dyanamic memory from
the heap only, I have received the following figures for the heap
usage of Tremor. Although the heap variance may be more for some other
songs, this is an estimate for song "sweet child" from GNR, encoded
using winLame on different bitrates.

Stereo   64Kbps                             34603 Bytes  
Stereo   128Kbps                           35424 Bytes  
Stereo   500Kbps                           40184 Bytes  
Stereo   64-128( variable)Kbps         33874 Bytes  
Stereo   64-500( variable)Kbps         40184 Bytes  

The stack usage for lowmem tremor branch is around 2KB and the
Rom(Constant Data)  is around 46KB.

So far these estimates are pretty much better that that for WMA(64KB
heap), given the doubts of greater heap usage due to non-fixed tables
for huffman.

Still some concerns in my mind reagrding the file codebook.c. In the
function vorbis_book_unpack, why is the memory for variable s->val is
put to NULL before returning from function. Is the assumption of
alloca automatically freeing the memory used somehow. This I ask
because I have to replace the alloca calls with a malloc and a free
call at the end. If the value is lost, memory is explicitly not freed.
Although I have applied a workaround still it would be nice if someone
can explain the use of the procedure.

Also wouldn't it be nice if a set of reference input and outputs were
provided with the source code as it would really help in
standadization of the codec. And is there any compliance criterion
defined for tremor ??

More information about the Tremor mailing list