Sound Open Firmware
Loading...
Searching...
No Matches
Audio Formats & Channel Routing

Channel map parsing, stream conversion, and audio sample saturation routines. More...

Files

file  channel_map.h
 Audio stream channel map lookup and sizing helpers.
 
file  format_generic.h
 Generic audio sample saturation helpers.
 

Functions

static uint32_t chmap_get_size (struct sof_ipc_channel_map *chmap)
 Returns the size of an IPC channel map structure in bytes.
 
struct sof_ipc_channel_map * chmap_get (struct sof_ipc_stream_map *smap, int index)
 Returns a channel map for a given channel index in a stream map.
 
static int32_t sat_int32 (int64_t x)
 Saturate a 64-bit integer to signed 32-bit integer range.
 
static int32_t sat_int24 (int32_t x)
 Saturate a 32-bit integer to signed 24-bit integer range.
 
static int16_t sat_int16 (int32_t x)
 Saturate a 32-bit integer to signed 16-bit integer range.
 
static int8_t sat_int8 (int32_t x)
 Saturate a 32-bit integer to signed 8-bit integer range.
 

Detailed Description

Channel map parsing, stream conversion, and audio sample saturation routines.

Function Documentation

◆ chmap_get()

struct sof_ipc_channel_map * chmap_get ( struct sof_ipc_stream_map *  smap,
int  index 
)

Returns a channel map for a given channel index in a stream map.

Parameters
[in]smapPointer to the stream map structure.
[in]indexChannel index.
Returns
Pointer to matching channel map structure, or NULL if not found.

◆ chmap_get_size()

static uint32_t chmap_get_size ( struct sof_ipc_channel_map *  chmap)
inlinestatic

Returns the size of an IPC channel map structure in bytes.

Parameters
[in]chmapPointer to the channel map structure.
Returns
Total size in bytes including dynamic channel coefficients.

◆ sat_int16()

static int16_t sat_int16 ( int32_t  x)
inlinestatic

Saturate a 32-bit integer to signed 16-bit integer range.

Parameters
[in]xInput 32-bit integer.
Returns
Saturated 16-bit integer clamped between INT16_MIN and INT16_MAX.

◆ sat_int24()

static int32_t sat_int24 ( int32_t  x)
inlinestatic

Saturate a 32-bit integer to signed 24-bit integer range.

Parameters
[in]xInput 32-bit integer.
Returns
Saturated 24-bit integer clamped between INT24_MINVALUE and INT24_MAXVALUE.

◆ sat_int32()

static int32_t sat_int32 ( int64_t  x)
inlinestatic

Saturate a 64-bit integer to signed 32-bit integer range.

Parameters
[in]xInput 64-bit integer.
Returns
Saturated 32-bit integer clamped between INT32_MIN and INT32_MAX.

◆ sat_int8()

static int8_t sat_int8 ( int32_t  x)
inlinestatic

Saturate a 32-bit integer to signed 8-bit integer range.

Parameters
[in]xInput 32-bit integer.
Returns
Saturated 8-bit integer clamped between INT8_MIN and INT8_MAX.