Sound Open Firmware
Loading...
Searching...
No Matches
inner_model_ops Struct Reference

#include <smart_amp.h>

Data Fields

int(* init )(struct smart_amp_mod_data_base *mod)
 Initializes model.
int(* query_memblk_size )(struct smart_amp_mod_data_base *mod, enum smart_amp_mod_memblk blk)
 Returns the required bytesize for the specific memblk.
int(* set_memblk )(struct smart_amp_mod_data_base *mod, enum smart_amp_mod_memblk blk, struct smart_amp_buf *buf)
 Sets the allocated memblk info.
int(* get_supported_fmts )(struct smart_amp_mod_data_base *mod, const uint16_t **mod_fmts, int *num_mod_fmts)
 Returns the list of supported frame formats.
int(* set_fmt )(struct smart_amp_mod_data_base *mod, uint16_t mod_fmt)
 Sets the frame format after resolved.
int(* ff_proc )(struct smart_amp_mod_data_base *mod, uint32_t frames, struct smart_amp_mod_stream *in, struct smart_amp_mod_stream *out)
 Runs the feed-forward process.
int(* fb_proc )(struct smart_amp_mod_data_base *mod, uint32_t frames, struct smart_amp_mod_stream *in)
 Runs the feedback process.
int(* get_config )(struct smart_amp_mod_data_base *mod, struct sof_ipc_ctrl_data *cdata, uint32_t size)
 Gets config data from model.
int(* set_config )(struct smart_amp_mod_data_base *mod, struct sof_ipc_ctrl_data *cdata)
 Sets config data to model.
int(* reset )(struct smart_amp_mod_data_base *mod)
 Resets model.

Field Documentation

◆ fb_proc

int(* inner_model_ops::fb_proc) (struct smart_amp_mod_data_base *mod, uint32_t frames, struct smart_amp_mod_stream *in)

Runs the feedback process.

Args: mod - the pointer of model data struct object. frames - the number of frames to be processed. in - the pointer of input stream buffer object. Inner model should set "consumed" to the number of conusmed frames. Returns: 0 or negative error code.

◆ ff_proc

int(* inner_model_ops::ff_proc) (struct smart_amp_mod_data_base *mod, uint32_t frames, struct smart_amp_mod_stream *in, struct smart_amp_mod_stream *out)

Runs the feed-forward process.

Args: mod - the pointer of model data struct object. frames - the number of frames to be processed. in - the pointer of input stream buffer object. Inner model should set "consumed" to the number of conusmed frames. out - the pointer of output stream buffer object. Inner model should set "produced" to the number of produced frames. Returns: 0 or negative error code.

◆ get_config

int(* inner_model_ops::get_config) (struct smart_amp_mod_data_base *mod, struct sof_ipc_ctrl_data *cdata, uint32_t size)

Gets config data from model.

Args: mod - the pointer of model data struct object. cdata - the pointer of sof_ipc_ctrl_data object. size - the maximal size for config data to read. Returns: 0 or negative error code.

◆ get_supported_fmts

int(* inner_model_ops::get_supported_fmts) (struct smart_amp_mod_data_base *mod, const uint16_t **mod_fmts, int *num_mod_fmts)

Returns the list of supported frame formats.

It will be called on comp_ops.prepare() by generic layer.

Inner model should report all supported formats in the list at once. Generic layer will resolve the applicable format according to this list and the formats requested from external source/sink stream buffers. If it turns out to be no format applicable, generic layer will report errors which will force the early-termination of the starting process for the whole pipeline. Args: mod - the pointer of model data struct object. mod_fmts - the pointer for returning the supported format list. Format values should be aligned to "enum sof_ipc_frame" and put in ascending order. num_mod_fmts - the pointer for returning the length of mod_fmts. Returns: 0 or negative error code.

◆ init

int(* inner_model_ops::init) (struct smart_amp_mod_data_base *mod)

Initializes model.

It will be called on comp_ops.create() by generic layer. Args: mod - the pointer of model data struct object. Returns: 0 or negative error code.

◆ query_memblk_size

int(* inner_model_ops::query_memblk_size) (struct smart_amp_mod_data_base *mod, enum smart_amp_mod_memblk blk)

Returns the required bytesize for the specific memblk.

It will be called on comp_ops.create() by generic layer, before or after mod_ops.init() according to the memblk usage. Args: mod - the pointer of model data struct object. blk - the memblk usage type. Returns: The bytesize or negative error code. 0 means no memory required

◆ reset

int(* inner_model_ops::reset) (struct smart_amp_mod_data_base *mod)

Resets model.

It will be called on comp_ops.reset() by generic layer. Args: mod - the pointer of model data struct object. Returns: 0 or negative error code.

◆ set_config

int(* inner_model_ops::set_config) (struct smart_amp_mod_data_base *mod, struct sof_ipc_ctrl_data *cdata)

Sets config data to model.

Args: mod - the pointer of model data struct object. cdata - the pointer of sof_ipc_ctrl_data object. Returns: 0 or negative error code.

◆ set_fmt

int(* inner_model_ops::set_fmt) (struct smart_amp_mod_data_base *mod, uint16_t mod_fmt)

Sets the frame format after resolved.

It will be called on comp_ops.prepare() by generic layer, in sequence after mod_ops.get_supported_fmts() if the format is resolvable.

Inner model should honor the received format on processing. The FF and FB frames (if available) will be put to the input buffers in the same format. It will be the last function called before audio stream starts processing. needed, inner model should execute the preparing tasks as soon as it is called. Args: mod - the pointer of model data struct object. mod_fmt - the frame format to be applied.. Returns: 0 or negative error code.

◆ set_memblk

int(* inner_model_ops::set_memblk) (struct smart_amp_mod_data_base *mod, enum smart_amp_mod_memblk blk, struct smart_amp_buf *buf)

Sets the allocated memblk info.

It should be called in sequence after mod_ops.query_memblk_size(). Args: mod - the pointer of model data struct object. blk - the memblk usage type. buf - the pointer of smart_amp_buf object including allocated memory. Returns: 0 or negative error code.


The documentation for this struct was generated from the following file:
  • /home/lrg/work/sof-dox-work/src/include/sof/audio/smart_amp/smart_amp.h