Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions src/audio/mfcc/llext/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# Copyright (c) 2024 Intel Corporation.
# SPDX-License-Identifier: Apache-2.0

set(MFCC_LLEXT_SOURCES
../mfcc.c
../mfcc_setup.c
../mfcc_common.c
../mfcc_generic.c
../mfcc_hifi3.c
../mfcc_hifi4.c
../mfcc_vad.c
)
if(CONFIG_IPC_MAJOR_4)
list(APPEND MFCC_LLEXT_SOURCES ../mfcc_ipc4.c)
endif()

sof_llext_build("mfcc"
SOURCES ../mfcc.c
../mfcc_setup.c
../mfcc_common.c
../mfcc_generic.c
../mfcc_hifi3.c
../mfcc_hifi4.c
SOURCES ${MFCC_LLEXT_SOURCES}
LIB openmodules
)
5 changes: 3 additions & 2 deletions src/kernel/audio/base_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static void get_codec_info(struct sof_tlv **tuple)
add_codec_info_item(&codec_info, SND_AUDIOCODEC_VORBIS,
SOF_IPC_STREAM_PLAYBACK);
#endif
#ifdef CONFIG_COMP_MFCC
#if defined(CONFIG_COMP_MFCC) || defined(CONFIG_COMP_MFCC_MODULE)
add_codec_info_item(&codec_info, SND_AUDIOCODEC_BESPOKE,
SOF_IPC_STREAM_CAPTURE);
#endif
Expand Down Expand Up @@ -235,7 +235,8 @@ static void get_codec_info(struct sof_tlv **tuple)
#if (defined(CONFIG_FFMPEG_ENC_SBC) || defined(CONFIG_FFMPEG_ENC_G722) || \
defined(CONFIG_FFMPEG_ENC_APTX) || defined(CONFIG_FFMPEG_ENC_APTX_HD) || \
defined(CONFIG_FFMPEG_ENC_G726) || defined(CONFIG_FFMPEG_ENC_ALAW) || \
defined(CONFIG_FFMPEG_ENC_MULAW)) && !defined(CONFIG_COMP_MFCC)
defined(CONFIG_FFMPEG_ENC_MULAW)) && \
!defined(CONFIG_COMP_MFCC) && !defined(CONFIG_COMP_MFCC_MODULE)
/* Also advertise BESPOKE capture for kernels with older SND_AUDIOCODEC_MAX. */
add_codec_info_item(&codec_info, SND_AUDIOCODEC_BESPOKE, SOF_IPC_STREAM_CAPTURE);
#endif
Expand Down
4 changes: 4 additions & 0 deletions src/math/auditory/auditory.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <ipc/topology.h>
#include <errno.h>
#include <stdint.h>
#include <rtos/symbol.h>

LOG_MODULE_REGISTER(math_auditory, CONFIG_SOF_LOG_LEVEL);

Expand Down Expand Up @@ -62,6 +63,7 @@ int16_t psy_hz_to_mel(int16_t hz)
mel = Q_MULTSR_32X32((int64_t)log, LOG_MULT_HZMEL_Q20, 26, 20, 2);
return mel;
}
EXPORT_SYMBOL(psy_hz_to_mel);

/**
* Convert Mel to Hz
Expand All @@ -88,6 +90,7 @@ int16_t psy_mel_to_hz(int16_t mel)
hz = Q_MULTSR_32X32((int64_t)exp, 700, 20, 0, 0);
return hz;
}
EXPORT_SYMBOL(psy_mel_to_hz);

int mod_psy_get_mel_filterbank(struct processing_module *mod, struct psy_mel_filterbank *fb)
{
Expand Down Expand Up @@ -239,6 +242,7 @@ int mod_psy_get_mel_filterbank(struct processing_module *mod, struct psy_mel_fil
fb->scratch_data2, sizeof(int16_t) * fb->data_length);
return 0;
}
EXPORT_SYMBOL(mod_psy_get_mel_filterbank);

int mod_psy_free_mel_filterbank(struct processing_module *mod, struct psy_mel_filterbank *mel_fb)
{
Expand Down
2 changes: 2 additions & 0 deletions src/math/auditory/mel_filterbank_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <sof/math/numbers.h>
#include <sof/math/sqrt.h>
#include <stdint.h>
#include <rtos/symbol.h>

static inline uint32_t mel_sqrt32(uint32_t num)
{
Expand Down Expand Up @@ -137,3 +138,4 @@ void psy_apply_mel_filterbank_32(struct psy_mel_filterbank *fb, struct icomplex3
{
psy_apply_mel_filterbank_with_linear_32(fb, fft_out, power_spectra, mel_log, NULL, bitshift);
}
EXPORT_SYMBOL(psy_apply_mel_filterbank_32);
2 changes: 2 additions & 0 deletions src/math/dct.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <sof/math/trig.h>
#include <errno.h>
#include <stdint.h>
#include <rtos/symbol.h>

#define PI_Q29 Q_CONVERT_FLOAT(3.1415926536, 29)
#define TWO_PI_Q24 Q_CONVERT_FLOAT(6.2831853072, 24)
Expand Down Expand Up @@ -78,6 +79,7 @@ int mod_dct_initialize_16(struct processing_module *mod, struct dct_plan_16 *dct

return 0;
}
EXPORT_SYMBOL(mod_dct_initialize_16);

int mod_dct_free_16(struct processing_module *mod, struct dct_plan_16 *dct)
{
Expand Down
2 changes: 2 additions & 0 deletions src/math/fft/fft_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#ifdef FFT_GENERIC
#include <sof/audio/coefficients/fft/twiddle_32.h>
#include <rtos/symbol.h>

/**
* \brief Execute the 32-bits Fast Fourier Transform (FFT) or Inverse FFT (IFFT)
Expand Down Expand Up @@ -93,5 +94,6 @@ void fft_execute_32(struct fft_plan *plan, bool ifft)
}
}
}
EXPORT_SYMBOL(fft_execute_32);

#endif /* FFT_GENERIC */
2 changes: 2 additions & 0 deletions src/math/fft/fft_32_hifi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#ifdef FFT_HIFI3
#include <sof/audio/coefficients/fft/twiddle_32.h>
#include <xtensa/tie/xt_hifi3.h>
#include <rtos/symbol.h>

void fft_execute_32(struct fft_plan *plan, bool ifft)
{
Expand Down Expand Up @@ -156,4 +157,5 @@ void fft_execute_32(struct fft_plan *plan, bool ifft)
}
}
}
EXPORT_SYMBOL(fft_execute_32);
#endif
3 changes: 3 additions & 0 deletions src/math/fft/fft_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <sof/common.h>
#include <rtos/alloc.h>
#include <sof/math/fft.h>
#include <rtos/symbol.h>
#include "fft_common.h"

LOG_MODULE_REGISTER(math_fft, CONFIG_SOF_LOG_LEVEL);
Expand Down Expand Up @@ -104,6 +105,7 @@ struct fft_plan *mod_fft_plan_new(struct processing_module *mod, void *inb,
fft_plan_init_bit_reverse(plan->bit_reverse_idx, plan->size, plan->len);
return plan;
}
EXPORT_SYMBOL(mod_fft_plan_new);

void mod_fft_plan_free(struct processing_module *mod, struct fft_plan *plan)
{
Expand All @@ -113,3 +115,4 @@ void mod_fft_plan_free(struct processing_module *mod, struct fft_plan *plan)
mod_free(mod, plan->bit_reverse_idx);
mod_free(mod, plan);
}
EXPORT_SYMBOL(mod_fft_plan_free);
3 changes: 3 additions & 0 deletions src/math/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <sof/math/matrix.h>
#include <errno.h>
#include <stdint.h>
#include <rtos/symbol.h>

int mat_multiply(struct mat_matrix_16b *a, struct mat_matrix_16b *b, struct mat_matrix_16b *c)
{
Expand Down Expand Up @@ -57,6 +58,7 @@ int mat_multiply(struct mat_matrix_16b *a, struct mat_matrix_16b *b, struct mat_
}
return 0;
}
EXPORT_SYMBOL(mat_multiply);

int mat_multiply_elementwise(struct mat_matrix_16b *a, struct mat_matrix_16b *b,
struct mat_matrix_16b *c)
Expand Down Expand Up @@ -94,3 +96,4 @@ int mat_multiply_elementwise(struct mat_matrix_16b *a, struct mat_matrix_16b *b,

return 0;
}
EXPORT_SYMBOL(mat_multiply_elementwise);
6 changes: 6 additions & 0 deletions src/math/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <sof/math/window.h>
#include <errno.h>
#include <stdint.h>
#include <rtos/symbol.h>

#define WIN_ONE_Q15 INT16_MAX
#define WIN_ONE_Q31 INT32_MAX
Expand Down Expand Up @@ -41,6 +42,7 @@ void win_rectangular_16b(int16_t *win, int length)
for (i = 0; i < length; i++)
win[i] = WIN_ONE_Q15;
}
EXPORT_SYMBOL(win_rectangular_16b);

void win_rectangular_32b(int32_t *win, int length)
{
Expand Down Expand Up @@ -76,6 +78,7 @@ void win_blackman_16b(int16_t win[], int length, int16_t a0)
win[n] = sat_int16(val);
}
}
EXPORT_SYMBOL(win_blackman_16b);

void win_blackman_32b(int32_t win[], int length, int32_t a0)
{
Expand Down Expand Up @@ -118,6 +121,7 @@ void win_hann_16b(int16_t win[], int length)
win[n] = sat_int16(val);
}
}
EXPORT_SYMBOL(win_hann_16b);

void win_hann_32b(int32_t win[], int length)
{
Expand Down Expand Up @@ -152,6 +156,7 @@ void win_hamming_16b(int16_t win[], int length)
win[n] = sat_int16(Q_SHIFT_RND(val, 30, 15));
}
}
EXPORT_SYMBOL(win_hamming_16b);

void win_hamming_32b(int32_t win[], int length)
{
Expand Down Expand Up @@ -195,3 +200,4 @@ void win_povey_16b(int16_t win[], int length)
win[n] = sat_int16(Q_SHIFT_RND(x4, 20, 15));
}
}
EXPORT_SYMBOL(win_povey_16b);
Loading