Skip to content

Stack memory in DirAC decoder

The DirAC decoder uses a mechanism of allocatting and deallocating stack memory in functions ivas_dirac_alloc_mem() and ivas_dirac_free_mem().

However, there are two issues with the current approach:

  • malloc()/free() routines are used inside ivas_dirac_alloc_mem() and ivas_dirac_free_mem(). If the related memory is really the dynamic one (TBC), the memory should be allocated using dynamic_malloc() and dynamic_free(), otherwise it is counted as part of the Static RAM when the code is instrumented using the WMC-tool.
  • When dynamic_malloc() and dynamic_free() is used, there is no mechanism how this memory is related to the stack numbers of the whole codec.
    • Should dynamic_malloc() and dynamic_free() be called at every frame?