Sound Open Firmware
Loading...
Searching...
No Matches

Audio sample format conversion and size calculation helpers for modules. More...

Include dependency graph for format.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static uint32_t get_sample_bytes (enum sof_ipc_frame fmt)
 Get the byte size of a single audio sample for a given frame format.
 
static uint32_t get_sample_bitdepth (enum sof_ipc_frame fmt)
 Get the bit depth of a single audio sample for a given frame format.
 
static uint32_t get_frame_bytes (enum sof_ipc_frame fmt, uint32_t channels)
 Get the byte size of an entire multi-channel audio frame.
 

Detailed Description

Audio sample format conversion and size calculation helpers for modules.

Function Documentation

◆ get_frame_bytes()

static uint32_t get_frame_bytes ( enum sof_ipc_frame  fmt,
uint32_t  channels 
)
inlinestatic

Get the byte size of an entire multi-channel audio frame.

Parameters
fmtAudio frame format enum (enum sof_ipc_frame).
channelsNumber of audio channels.
Returns
Total frame size in bytes (sample_bytes * channels).

◆ get_sample_bitdepth()

static uint32_t get_sample_bitdepth ( enum sof_ipc_frame  fmt)
inlinestatic

Get the bit depth of a single audio sample for a given frame format.

Parameters
fmtAudio frame format enum (enum sof_ipc_frame).
Returns
Number of active audio bits per sample (8, 16, 24, or 32).

◆ get_sample_bytes()

static uint32_t get_sample_bytes ( enum sof_ipc_frame  fmt)
inlinestatic

Get the byte size of a single audio sample for a given frame format.

Parameters
fmtAudio frame format enum (enum sof_ipc_frame).
Returns
Number of bytes per sample (1, 2, 3, or 4).