channelmix: Convert matrices to float arrays

Convert matrix_orig and matrix to float arrays and use variable size 2d
arrays to access the elements of the matrices. This removes the need for
storing pointers to matrix rows.
This commit is contained in:
Jonas Holmberg 2026-05-12 14:47:57 +02:00
parent 7cfcb46fbf
commit a7994882b9
6 changed files with 161 additions and 134 deletions

View file

@ -38,6 +38,8 @@
#define CHANNELMIX_DEFAULT_WIDEN 0.0f
#define CHANNELMIX_DEFAULT_HILBERT_TAPS 0
#define CHANNELMIX_DEF_MATRIX(var, mix, m) float (*(var))[(mix)->src_chan] = (float (*)[(mix)->src_chan])(mix)->m
struct channelmix {
uint32_t src_chan;
uint32_t dst_chan;
@ -62,8 +64,8 @@ struct channelmix {
#define CHANNELMIX_FLAG_EQUAL (1<<2) /**< all values are equal */
#define CHANNELMIX_FLAG_COPY (1<<3) /**< 1 on diagonal, can be nxm */
uint32_t flags;
float **matrix_orig;
float **matrix;
float *matrix_orig;
float *matrix;
float freq; /* sample frequency */
float lfe_cutoff; /* in Hz, 0 is disabled */