SPAR inter-frame vs. intra-frame memory
It seems that SBA SPAR modules memory usage is not always consistent and a review would result in maximum memory saving.
In particular, there are buffers which are defined as static and allocated in a inter-frame heap memory while these buffers could be defined locally in respective functions and allocated in a stack (or eventually in an intra-frame heap memory).
E.g. hSpar->hMdEnc->cov_real[][]
and hSpar->hMdEnc->cov_dtx_real[][]
could be defined in the function ivas_spar_enc_process()
. Or hMdEnc->mixer_mat_local
could be defined in the function ivas_spar_md_enc_process()
. Etc.
These buffers should be identified and used locally in a stack.