diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-02-07 10:25:09 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-02-07 10:25:09 +1100 |
| commit | a67cd1dec69242f144e6ce8646de3091921b65e8 (patch) | |
| tree | fd485cccdd035f9a1be2399fcfd60229ce8fdc5f /lib/speexdsp/libspeexdsp | |
| parent | 1b7821a474da216bd89052902347f97f2a1d796c (diff) | |
| download | tangara-fw-a67cd1dec69242f144e6ce8646de3091921b65e8.tar.gz | |
Ensure the resampler is allocated in internal ram
It's quite small!
Diffstat (limited to 'lib/speexdsp/libspeexdsp')
| -rw-r--r-- | lib/speexdsp/libspeexdsp/config.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/speexdsp/libspeexdsp/config.h b/lib/speexdsp/libspeexdsp/config.h index 060002b4..19095a04 100644 --- a/lib/speexdsp/libspeexdsp/config.h +++ b/lib/speexdsp/libspeexdsp/config.h @@ -4,6 +4,8 @@ #pragma once +#include "esp_heap_caps.h" + #define FIXED_POINT #define EXPORT #define STDC_HEADERS @@ -11,3 +13,19 @@ #define DISABLE_ENCODER #define DISABLE_FLOAT_API + +#define OVERRIDE_SPEEX_ALLOC +#define OVERRIDE_SPEEX_REALLOC +#define OVERRIDE_SPEEX_FREE + +static inline void* speex_alloc(int size) { + return heap_caps_calloc(size, 1, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); +} + +static inline void* speex_realloc(void* ptr, int size) { + return heap_caps_realloc(ptr, size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT); +} + +static inline void speex_free(void* ptr) { + heap_caps_free(ptr); +} |
