Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/audio/mux/mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static int demux_process(struct processing_module *mod,
const void *source_start;
size_t source_size;
size_t source_bytes;
uint32_t frames;
size_t frames;
int ret;
int i;

Expand Down Expand Up @@ -353,7 +353,7 @@ static int mux_process(struct processing_module *mod,
size_t source_bytes[MUX_MAX_STREAMS] = { 0 };
struct cir_buf_sink sink_buf;
size_t sink_bytes, size;
uint32_t frames;
size_t frames;
int i, idx, ret;

comp_dbg(dev, "entry");
Expand Down
4 changes: 2 additions & 2 deletions src/audio/mux/mux.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ struct mux_stream_data {
typedef int(*demux_func)(struct comp_dev *dev, struct sof_sink *sink,
struct sof_source *source, const void *source_data,
const void *source_start, size_t source_size,
uint32_t frames, struct mux_look_up *look_up);
size_t frames, struct mux_look_up *look_up);
typedef void(*mux_func)(struct comp_dev *dev, struct sof_sink *sink,
struct cir_buf_sink *sink_buf, struct sof_source **sources,
struct cir_buf_source *source_bufs, uint32_t frames,
struct cir_buf_source *source_bufs, size_t frames,
struct mux_look_up *look_up);

/**
Expand Down
68 changes: 34 additions & 34 deletions src/audio/mux/mux_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ static void demux_check_for_wrap(struct cir_buf_sink *sink,

#if CONFIG_FORMAT_S16LE

static uint32_t demux_calc_frames_without_wrap_s16(struct cir_buf_sink *sink,
struct cir_buf_source *source,
struct mux_look_up *lookup)
static size_t demux_calc_frames_without_wrap_s16(struct cir_buf_sink *sink,
struct cir_buf_source *source,
struct mux_look_up *lookup)
{
uint32_t frames;
uint32_t min_frames;
size_t frames;
size_t min_frames;
const void *ptr;

/* for demux we process each source buffer separately - dest/src for
Expand All @@ -86,13 +86,13 @@ static uint32_t demux_calc_frames_without_wrap_s16(struct cir_buf_sink *sink,
return min_frames;
}

static uint32_t mux_calc_frames_without_wrap_s16(struct cir_buf_sink *sink,
struct cir_buf_source *source_bufs,
struct mux_look_up *lookup)
static size_t mux_calc_frames_without_wrap_s16(struct cir_buf_sink *sink,
struct cir_buf_source *source_bufs,
struct mux_look_up *lookup)
{
struct cir_buf_source *source;
uint32_t frames;
uint32_t min_frames;
size_t frames;
size_t min_frames;
uint32_t elem;
const void *ptr;

Expand Down Expand Up @@ -165,15 +165,15 @@ static void demux_init_look_up_pointers_s16(struct sof_sink *sink,
static int demux_s16le(struct comp_dev *dev, struct sof_sink *sink,
struct sof_source *source, const void *source_data,
const void *source_start, size_t source_size,
uint32_t frames, struct mux_look_up *lookup)
size_t frames, struct mux_look_up *lookup)
{
int16_t *y, *y_start, *y_end;
int y_size;
struct cir_buf_sink sink_buf;
struct cir_buf_source source_buf;
int bytes = frames * sink_get_frame_bytes(sink);
size_t bytes = frames * sink_get_frame_bytes(sink);
uint32_t elem;
uint32_t i;
size_t i;
int ret;

comp_dbg(dev, "entry");
Expand Down Expand Up @@ -202,7 +202,7 @@ static int demux_s16le(struct comp_dev *dev, struct sof_sink *sink,
lookup->copy_elem[0].in_ch;
int16_t *dst = (int16_t *)lookup->copy_elem[0].dest -
lookup->copy_elem[0].out_ch;
uint32_t frames_without_wrap;
size_t frames_without_wrap;

frames_without_wrap =
demux_calc_frames_without_wrap_s16(&sink_buf, &source_buf, lookup);
Expand Down Expand Up @@ -244,14 +244,14 @@ static int demux_s16le(struct comp_dev *dev, struct sof_sink *sink,
*/
static void mux_s16le(struct comp_dev *dev, struct sof_sink *sink,
struct cir_buf_sink *sink_buf, struct sof_source **sources,
struct cir_buf_source *source_bufs, uint32_t frames,
struct cir_buf_source *source_bufs, size_t frames,
struct mux_look_up *lookup)
{
uint32_t i;
size_t i;
const int16_t *src;
int16_t *dst;
uint32_t elem;
uint32_t frames_without_wrap;
size_t frames_without_wrap;

comp_dbg(dev, "entry");

Expand Down Expand Up @@ -287,13 +287,13 @@ static void mux_s16le(struct comp_dev *dev, struct sof_sink *sink,

#if CONFIG_FORMAT_S24LE || CONFIG_FORMAT_S32LE

static uint32_t mux_calc_frames_without_wrap_s32(struct cir_buf_sink *sink,
struct cir_buf_source *source_bufs,
struct mux_look_up *lookup)
static size_t mux_calc_frames_without_wrap_s32(struct cir_buf_sink *sink,
struct cir_buf_source *source_bufs,
struct mux_look_up *lookup)
{
struct cir_buf_source *source;
uint32_t frames;
uint32_t min_frames;
size_t frames;
size_t min_frames;
uint32_t elem;
const void *ptr;

Expand All @@ -320,12 +320,12 @@ static uint32_t mux_calc_frames_without_wrap_s32(struct cir_buf_sink *sink,
return min_frames;
}

static uint32_t demux_calc_frames_without_wrap_s32(struct cir_buf_sink *sink,
struct cir_buf_source *source,
struct mux_look_up *lookup)
static size_t demux_calc_frames_without_wrap_s32(struct cir_buf_sink *sink,
struct cir_buf_source *source,
struct mux_look_up *lookup)
{
uint32_t frames;
uint32_t min_frames;
size_t frames;
size_t min_frames;
const void *ptr;

/* for demux we process each source buffer separately - dest/src for
Expand Down Expand Up @@ -409,15 +409,15 @@ static void demux_init_look_up_pointers_s32(struct sof_sink *sink,
static int demux_s32le(struct comp_dev *dev, struct sof_sink *sink,
struct sof_source *source, const void *source_data,
const void *source_start, size_t source_size,
uint32_t frames, struct mux_look_up *lookup)
size_t frames, struct mux_look_up *lookup)
{
int32_t *y, *y_start, *y_end;
int y_size;
struct cir_buf_sink sink_buf;
struct cir_buf_source source_buf;
int bytes = frames * sink_get_frame_bytes(sink);
size_t bytes = frames * sink_get_frame_bytes(sink);
uint32_t elem;
uint32_t i;
size_t i;
int ret;

comp_dbg(dev, "entry");
Expand Down Expand Up @@ -446,7 +446,7 @@ static int demux_s32le(struct comp_dev *dev, struct sof_sink *sink,
lookup->copy_elem[0].in_ch;
int32_t *dst = (int32_t *)lookup->copy_elem[0].dest -
lookup->copy_elem[0].out_ch;
uint32_t frames_without_wrap;
size_t frames_without_wrap;

frames_without_wrap =
demux_calc_frames_without_wrap_s32(&sink_buf, &source_buf, lookup);
Expand Down Expand Up @@ -488,14 +488,14 @@ static int demux_s32le(struct comp_dev *dev, struct sof_sink *sink,
*/
static void mux_s32le(struct comp_dev *dev, struct sof_sink *sink,
struct cir_buf_sink *sink_buf, struct sof_source **sources,
struct cir_buf_source *source_bufs, uint32_t frames,
struct cir_buf_source *source_bufs, size_t frames,
struct mux_look_up *lookup)
{
uint32_t i;
size_t i;
const int32_t *src;
int32_t *dst;
uint32_t elem;
uint32_t frames_without_wrap;
size_t frames_without_wrap;

comp_dbg(dev, "entry");

Expand Down
4 changes: 2 additions & 2 deletions src/include/module/audio/audio_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ struct sof_audio_stream_params {
* @param channels number of channels, i.e. samples per frame
* @return number of frames that can be processed without wrapping
*/
static inline int circ_buf_frames_without_wrap(const void *began, const void *end,
int sample_bytes, int channels)
static inline size_t circ_buf_frames_without_wrap(const void *began, const void *end,
size_t sample_bytes, size_t channels)
{
assert(sample_bytes > 0);
assert(channels > 0);
Expand Down
Loading