Sound Open Firmware
Loading...
Searching...
No Matches
mfcc_comp.h File Reference
Include dependency graph for mfcc_comp.h:

Go to the source code of this file.

Data Structures

struct  mfcc_data_header
 Data header prepended to every MFCC output frame. More...
 
struct  mfcc_buffer
 
struct  mfcc_pre_emph
 
struct  mfcc_fft
 
struct  mfcc_cepstral_lifter
 
struct  mfcc_state
 
struct  mfcc_comp_data
 

Macros

#define MFCC_GENERIC
 
#define MFCC_MAGIC   0x6d666363 /* ASCII for "mfcc" */
 
#define MFCC_FFT_BITS   32
 
#define MFCC_MAX_SAMPLE_RATE   64000 /* Max sample rate in Hz, limited by int16_t Mel scale */
 
#define MFCC_CTRL_INDEX_VAD   0
 Switch control index for VAD notification to user space.
 

Typedefs

typedef void(* mfcc_source_func) (struct sof_source *source, struct mfcc_buffer *buf, struct mfcc_pre_emph *emph, int frames, int source_channel)
 Type definition for source/sink based input copy function.
 

Functions

static int mfcc_buffer_samples_without_wrap (struct mfcc_buffer *buffer, int16_t *ptr)
 
static int16_t * mfcc_buffer_wrap (struct mfcc_buffer *buffer, int16_t *ptr)
 
int mfcc_setup (struct processing_module *mod, int max_frames, int rate, int channels)
 
void mfcc_free_buffers (struct processing_module *mod)
 
void mfcc_fill_prev_samples (struct mfcc_buffer *buf, int16_t *prev_data, int prev_data_length)
 
void mfcc_fill_fft_buffer (struct mfcc_state *state)
 
void mfcc_apply_window (struct mfcc_state *state, int input_shift)
 
int mfcc_stft_process (struct processing_module *mod, struct mfcc_comp_data *cd)
 Run STFT and Mel/DCT processing.
 
int mfcc_process_output (struct processing_module *mod, struct mfcc_comp_data *cd, struct sof_source **sources, struct sof_sink **sinks, int num_ceps, int frames)
 Prepare and commit MFCC output data after STFT processing.
 
void mfcc_source_copy_s16 (struct sof_source *source, struct mfcc_buffer *buf, struct mfcc_pre_emph *emph, int frames, int source_channel)
 
void mfcc_source_copy_s24 (struct sof_source *source, struct mfcc_buffer *buf, struct mfcc_pre_emph *emph, int frames, int source_channel)
 
void mfcc_source_copy_s32 (struct sof_source *source, struct mfcc_buffer *buf, struct mfcc_pre_emph *emph, int frames, int source_channel)
 
int mfcc_ipc_notification_init (struct processing_module *mod)
 
void mfcc_send_vad_notification (struct processing_module *mod, uint32_t val)
 
int mfcc_get_config (struct processing_module *mod, uint32_t config_id, uint32_t *data_offset_size, uint8_t *fragment, size_t fragment_size)
 
int mfcc_set_config (struct processing_module *mod, uint32_t config_id, enum module_cfg_fragment_position pos, uint32_t data_offset_size, const uint8_t *fragment, size_t fragment_size, uint8_t *response, size_t response_size)
 

Macro Definition Documentation

◆ MFCC_CTRL_INDEX_VAD

#define MFCC_CTRL_INDEX_VAD   0

Switch control index for VAD notification to user space.

◆ MFCC_FFT_BITS

#define MFCC_FFT_BITS   32

◆ MFCC_GENERIC

#define MFCC_GENERIC

◆ MFCC_MAGIC

#define MFCC_MAGIC   0x6d666363 /* ASCII for "mfcc" */

◆ MFCC_MAX_SAMPLE_RATE

#define MFCC_MAX_SAMPLE_RATE   64000 /* Max sample rate in Hz, limited by int16_t Mel scale */

Typedef Documentation

◆ mfcc_source_func

typedef void(* mfcc_source_func) (struct sof_source *source, struct mfcc_buffer *buf, struct mfcc_pre_emph *emph, int frames, int source_channel)

Type definition for source/sink based input copy function.

Function Documentation

◆ mfcc_apply_window()

void mfcc_apply_window ( struct mfcc_state *  state,
int  input_shift 
)

◆ mfcc_buffer_samples_without_wrap()

static int mfcc_buffer_samples_without_wrap ( struct mfcc_buffer *  buffer,
int16_t *  ptr 
)
inlinestatic

◆ mfcc_buffer_wrap()

static int16_t * mfcc_buffer_wrap ( struct mfcc_buffer *  buffer,
int16_t *  ptr 
)
inlinestatic

◆ mfcc_fill_fft_buffer()

void mfcc_fill_fft_buffer ( struct mfcc_state *  state)

◆ mfcc_fill_prev_samples()

void mfcc_fill_prev_samples ( struct mfcc_buffer *  buf,
int16_t *  prev_data,
int  prev_data_length 
)

◆ mfcc_free_buffers()

void mfcc_free_buffers ( struct processing_module *  mod)

◆ mfcc_get_config()

int mfcc_get_config ( struct processing_module *  mod,
uint32_t  config_id,
uint32_t *  data_offset_size,
uint8_t *  fragment,
size_t  fragment_size 
)

◆ mfcc_ipc_notification_init()

int mfcc_ipc_notification_init ( struct processing_module *  mod)

◆ mfcc_process_output()

int mfcc_process_output ( struct processing_module *  mod,
struct mfcc_comp_data *  cd,
struct sof_source **  sources,
struct sof_sink **  sinks,
int  num_ceps,
int  frames 
)

Prepare and commit MFCC output data after STFT processing.

This handles the output data conversion and dispatches to either the compress-output or legacy PCM-output path.

Returns
0 on success or a negative error code.

◆ mfcc_send_vad_notification()

void mfcc_send_vad_notification ( struct processing_module *  mod,
uint32_t  val 
)

◆ mfcc_set_config()

int mfcc_set_config ( struct processing_module *  mod,
uint32_t  config_id,
enum module_cfg_fragment_position  pos,
uint32_t  data_offset_size,
const uint8_t *  fragment,
size_t  fragment_size,
uint8_t *  response,
size_t  response_size 
)

◆ mfcc_setup()

int mfcc_setup ( struct processing_module *  mod,
int  max_frames,
int  rate,
int  channels 
)

◆ mfcc_source_copy_s16()

void mfcc_source_copy_s16 ( struct sof_source *  source,
struct mfcc_buffer *  buf,
struct mfcc_pre_emph *  emph,
int  frames,
int  source_channel 
)

◆ mfcc_source_copy_s24()

void mfcc_source_copy_s24 ( struct sof_source *  source,
struct mfcc_buffer *  buf,
struct mfcc_pre_emph *  emph,
int  frames,
int  source_channel 
)

◆ mfcc_source_copy_s32()

void mfcc_source_copy_s32 ( struct sof_source *  source,
struct mfcc_buffer *  buf,
struct mfcc_pre_emph *  emph,
int  frames,
int  source_channel 
)

◆ mfcc_stft_process()

int mfcc_stft_process ( struct processing_module *  mod,
struct mfcc_comp_data *  cd 
)

Run STFT and Mel/DCT processing.

Returns
Number of output coefficients produced, or 0 if not enough data.