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
15 changes: 8 additions & 7 deletions src/audio/aria/aria_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,20 @@ static void aria_algo_get_data(struct processing_module *mod,
int32_t gain_begin = cd->gains[sof_aria_index_tab[gain_state_add_2]];
/* do linear approximation between points gain_begin and gain_end */
int32_t gain_end = cd->gains[sof_aria_index_tab[gain_state_add_3]];
int32_t m, n, i, ch;
int32_t samples = frames * audio_stream_get_channels(sink);
size_t m, n, i;
int ch;
size_t samples = frames * audio_stream_get_channels(sink);
int32_t *out = audio_stream_get_wptr(sink);
int32_t *in = cd->data_ptr;
int32_t gain;
const int ch_n = cd->chan_cnt;
const int shift = 31 - cd->att;

for (i = 1; i < ARIA_MAX_GAIN_STATES - 1; i++) {
if (cd->gains[sof_aria_index_tab[gain_state_add_2 + i]] < gain_begin)
gain_begin = cd->gains[sof_aria_index_tab[gain_state_add_2 + i]];
if (cd->gains[sof_aria_index_tab[gain_state_add_3 + i]] < gain_end)
gain_end = cd->gains[sof_aria_index_tab[gain_state_add_3 + i]];
for (ch = 1; ch < ARIA_MAX_GAIN_STATES - 1; ch++) {
if (cd->gains[sof_aria_index_tab[gain_state_add_2 + ch]] < gain_begin)
gain_begin = cd->gains[sof_aria_index_tab[gain_state_add_2 + ch]];
if (cd->gains[sof_aria_index_tab[gain_state_add_3 + ch]] < gain_end)
gain_end = cd->gains[sof_aria_index_tab[gain_state_add_3 + ch]];
}
step = (gain_end - gain_begin) / frames;
gain = gain_begin;
Expand Down
8 changes: 4 additions & 4 deletions src/audio/asrc/asrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ static void src_copy_s32(struct processing_module *mod,
int32_t *buf;
const int32_t *src = source->ptr;
int32_t *snk = sink->ptr;
int n_wrap_src;
int n_wrap_snk;
size_t n_wrap_src;
size_t n_wrap_snk;
int n_copy;
unsigned int n;
int ret;
Expand Down Expand Up @@ -118,8 +118,8 @@ static void src_copy_s16(struct processing_module *mod,
const int16_t *src = source->ptr;
int16_t *snk = sink->ptr;
int16_t *buf;
int n_wrap_src;
int n_wrap_snk;
size_t n_wrap_src;
size_t n_wrap_snk;
int n_copy;
int s_copy;
int ret;
Expand Down
6 changes: 3 additions & 3 deletions src/audio/igo_nr/igo_nr.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static int igo_nr_capture_s16(struct comp_data *cd,
int16_t const *x, *x_start, *x_end;
int16_t *y1, *y2, *y_start, *y_end;
int16_t sample;
int x_size, y_size;
size_t x_size, y_size;
size_t request_size = frames * source_get_frame_bytes(source);
int sink_samples_without_wrap;
int samples_without_wrap;
Expand Down Expand Up @@ -179,7 +179,7 @@ static int igo_nr_capture_s24(struct comp_data *cd,
{
int32_t const *x, *x_start, *x_end;
int32_t *y1, *y2, *y_start, *y_end;
int x_size, y_size;
size_t x_size, y_size;
size_t request_size = frames * source_get_frame_bytes(source);
int sink_samples_without_wrap;
int samples_without_wrap;
Expand Down Expand Up @@ -285,7 +285,7 @@ static int igo_nr_capture_s32(struct comp_data *cd,
{
int32_t const *x, *x_start, *x_end;
int32_t *y1, *y2, *y_start, *y_end;
int x_size, y_size;
size_t x_size, y_size;
size_t request_size = frames * source_get_frame_bytes(source);
int sink_samples_without_wrap;
int samples_without_wrap;
Expand Down
6 changes: 3 additions & 3 deletions src/audio/level_multiplier/level_multiplier-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static int level_multiplier_s16(const struct processing_module *mod,
const int32_t gain = cd->gain;
int16_t const *x, *x_start, *x_end;
int16_t *y, *y_start, *y_end;
int x_size, y_size;
size_t x_size, y_size;
int source_samples_without_wrap;
int samples_without_wrap;
int remaining_samples = frames * cd->channels;
Expand Down Expand Up @@ -108,7 +108,7 @@ static int level_multiplier_s24(const struct processing_module *mod,
const int32_t gain = cd->gain;
int32_t const *x, *x_start, *x_end;
int32_t *y, *y_start, *y_end;
int x_size, y_size;
size_t x_size, y_size;
int source_samples_without_wrap;
int samples_without_wrap;
int remaining_samples = frames * cd->channels;
Expand Down Expand Up @@ -179,7 +179,7 @@ static int level_multiplier_s32(const struct processing_module *mod,
const int32_t gain = cd->gain;
int32_t const *x, *x_start, *x_end;
int32_t *y, *y_start, *y_end;
int x_size, y_size;
size_t x_size, y_size;
int source_samples_without_wrap;
int samples_without_wrap;
int remaining_samples = frames * cd->channels;
Expand Down
6 changes: 3 additions & 3 deletions src/audio/level_multiplier/level_multiplier-hifi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static int level_multiplier_s16(const struct processing_module *mod,
ae_f16x4 *y;
int16_t const *x_start, *x_end;
int16_t *y_start, *y_end;
int x_size, y_size;
size_t x_size, y_size;
int source_samples_without_wrap;
int samples_without_wrap;
int remaining_samples = frames * cd->channels;
Expand Down Expand Up @@ -143,7 +143,7 @@ static int level_multiplier_s24(const struct processing_module *mod,
ae_f32x2 *y;
int32_t const *x_start, *x_end;
int32_t *y_start, *y_end;
int x_size, y_size;
size_t x_size, y_size;
int source_samples_without_wrap;
int samples_without_wrap;
int remaining_samples = frames * cd->channels;
Expand Down Expand Up @@ -234,7 +234,7 @@ static int level_multiplier_s32(const struct processing_module *mod,
ae_f32x2 *y;
int32_t const *x_start, *x_end;
int32_t *y_start, *y_end;
int x_size, y_size;
size_t x_size, y_size;
int source_samples_without_wrap;
int samples_without_wrap;
int remaining_samples = frames * cd->channels;
Expand Down
6 changes: 3 additions & 3 deletions src/audio/level_multiplier/level_multiplier-hifi5.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static int level_multiplier_s16(const struct processing_module *mod,
ae_int16x8 *y;
int16_t const *x_start, *x_end;
int16_t *y_start, *y_end;
int x_size, y_size;
size_t x_size, y_size;
int source_samples_without_wrap;
int samples_without_wrap;
int remaining_samples = frames * cd->channels;
Expand Down Expand Up @@ -149,7 +149,7 @@ static int level_multiplier_s24(const struct processing_module *mod,
ae_int32x4 *y;
int32_t const *x_start, *x_end;
int32_t *y_start, *y_end;
int x_size, y_size;
size_t x_size, y_size;
int source_samples_without_wrap;
int samples_without_wrap;
int remaining_samples = frames * cd->channels;
Expand Down Expand Up @@ -243,7 +243,7 @@ static int level_multiplier_s32(const struct processing_module *mod,
ae_int32x4 *y;
int32_t const *x_start, *x_end;
int32_t *y_start, *y_end;
int x_size, y_size;
size_t x_size, y_size;
int source_samples_without_wrap;
int samples_without_wrap;
int remaining_samples = frames * cd->channels;
Expand Down
6 changes: 3 additions & 3 deletions src/audio/mfcc/mfcc_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void mfcc_source_copy_s16(struct sof_source *source, struct mfcc_buffer *buf,
int16_t const *x;
int16_t const *x_start;
int16_t const *x_end;
int x_size;
size_t x_size;
int num_channels = source_get_channels(source);
size_t req_bytes = frames * num_channels * sizeof(int16_t);
int16_t *w = buf->w_ptr;
Expand Down Expand Up @@ -126,7 +126,7 @@ void mfcc_source_copy_s24(struct sof_source *source, struct mfcc_buffer *buf,
int32_t const *x;
int32_t const *x_start;
int32_t const *x_end;
int x_size;
size_t x_size;
int num_channels = source_get_channels(source);
size_t req_bytes = frames * num_channels * sizeof(int32_t);
int16_t *w = buf->w_ptr;
Expand Down Expand Up @@ -200,7 +200,7 @@ void mfcc_source_copy_s32(struct sof_source *source, struct mfcc_buffer *buf,
int32_t const *x;
int32_t const *x_start;
int32_t const *x_end;
int x_size;
size_t x_size;
int num_channels = source_get_channels(source);
size_t req_bytes = frames * num_channels * sizeof(int32_t);
int16_t *w = buf->w_ptr;
Expand Down
52 changes: 23 additions & 29 deletions src/audio/mixer/mixer_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ static void mix_n_s16(struct comp_dev *dev, struct audio_stream *sink,
int16_t *src[PLATFORM_MAX_CHANNELS];
int16_t *dest;
int32_t val;
int nmax;
int i, j, n, ns;
int processed = 0;
int nch = audio_stream_get_channels(sink);
int samples = frames * nch;
size_t nmax, ns, n, i, processed = 0;
uint32_t j;
int samples = frames * audio_stream_get_channels(sink);
Comment on lines +22 to +24

dest = audio_stream_get_wptr(sink);
for (j = 0; j < num_sources; j++)
Expand All @@ -33,8 +31,8 @@ static void mix_n_s16(struct comp_dev *dev, struct audio_stream *sink,
nmax = samples - processed;
n = audio_stream_samples_without_wrap_s16(sink, dest);
n = MIN(n, nmax);
for (i = 0; i < num_sources; i++) {
ns = audio_stream_samples_without_wrap_s16(sources[i], src[i]);
for (j = 0; j < num_sources; j++) {
ns = audio_stream_samples_without_wrap_s16(sources[j], src[j]);
n = MIN(n, ns);
}
for (i = 0; i < n; i++) {
Expand All @@ -50,8 +48,8 @@ static void mix_n_s16(struct comp_dev *dev, struct audio_stream *sink,
}
processed += n;
dest = audio_stream_wrap(sink, dest);
for (i = 0; i < num_sources; i++)
src[i] = audio_stream_wrap(sources[i], src[i]);
for (j = 0; j < num_sources; j++)
src[j] = audio_stream_wrap(sources[j], src[j]);
}
}
#endif /* CONFIG_FORMAT_S16LE */
Expand All @@ -62,15 +60,13 @@ static void mix_n_s24(struct comp_dev *dev, struct audio_stream *sink,
const struct audio_stream **sources, uint32_t num_sources,
uint32_t frames)
{
int32_t *src[PLATFORM_MAX_CHANNELS];
const int32_t *src[PLATFORM_MAX_CHANNELS];
size_t nmax, ns, n, i, processed = 0;
int32_t *dest;
uint32_t j;
int32_t val;
int32_t x;
int nmax;
int i, j, n, ns;
int processed = 0;
int nch = audio_stream_get_channels(sink);
int samples = frames * nch;
int samples = frames * audio_stream_get_channels(sink);

dest = audio_stream_get_wptr(sink);
for (j = 0; j < num_sources; j++)
Expand All @@ -80,8 +76,8 @@ static void mix_n_s24(struct comp_dev *dev, struct audio_stream *sink,
nmax = samples - processed;
n = audio_stream_samples_without_wrap_s24(sink, dest);
n = MIN(n, nmax);
for (i = 0; i < num_sources; i++) {
ns = audio_stream_samples_without_wrap_s24(sources[i], src[i]);
for (j = 0; j < num_sources; j++) {
ns = audio_stream_samples_without_wrap_s24(sources[j], src[j]);
n = MIN(n, ns);
}
for (i = 0; i < n; i++) {
Expand All @@ -98,8 +94,8 @@ static void mix_n_s24(struct comp_dev *dev, struct audio_stream *sink,
}
processed += n;
dest = audio_stream_wrap(sink, dest);
for (i = 0; i < num_sources; i++)
src[i] = audio_stream_wrap(sources[i], src[i]);
for (j = 0; j < num_sources; j++)
src[j] = audio_stream_wrap(sources[j], src[j]);
}
}
#endif /* CONFIG_FORMAT_S24LE */
Expand All @@ -110,14 +106,12 @@ static void mix_n_s32(struct comp_dev *dev, struct audio_stream *sink,
const struct audio_stream **sources, uint32_t num_sources,
uint32_t frames)
{
int32_t *src[PLATFORM_MAX_CHANNELS];
const int32_t *src[PLATFORM_MAX_CHANNELS];
size_t nmax, ns, i, n, processed = 0;
int32_t *dest;
int64_t val;
int nmax;
int i, j, n, ns;
int processed = 0;
int nch = audio_stream_get_channels(sink);
int samples = frames * nch;
uint32_t j;
size_t samples = frames * audio_stream_get_channels(sink);

dest = audio_stream_get_wptr(sink);
for (j = 0; j < num_sources; j++)
Expand All @@ -127,8 +121,8 @@ static void mix_n_s32(struct comp_dev *dev, struct audio_stream *sink,
nmax = samples - processed;
n = audio_stream_samples_without_wrap_s32(sink, dest);
n = MIN(n, nmax);
for (i = 0; i < num_sources; i++) {
ns = audio_stream_samples_without_wrap_s32(sources[i], src[i]);
for (j = 0; j < num_sources; j++) {
ns = audio_stream_samples_without_wrap_s32(sources[j], src[j]);
n = MIN(n, ns);
}
for (i = 0; i < n; i++) {
Expand All @@ -144,8 +138,8 @@ static void mix_n_s32(struct comp_dev *dev, struct audio_stream *sink,
}
processed += n;
dest = audio_stream_wrap(sink, dest);
for (i = 0; i < num_sources; i++)
src[i] = audio_stream_wrap(sources[i], src[i]);
for (j = 0; j < num_sources; j++)
src[j] = audio_stream_wrap(sources[j], src[j]);
}
}
#endif /* CONFIG_FORMAT_S32LE */
Expand Down
17 changes: 10 additions & 7 deletions src/audio/mixer/mixer_hifi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ static void mix_n_s16(struct comp_dev *dev, struct audio_stream *sink,
ae_int32x2 val2;
ae_int32x2 sample_1;
ae_int32x2 sample_2;
unsigned int n, m, nmax, i, j, left_samples;
unsigned int samples = frames * audio_stream_get_channels(sink);
size_t n, m, nmax, i, left_samples;
uint32_t j;
size_t samples = frames * audio_stream_get_channels(sink);

for (j = 0; j < num_sources; j++)
in[j] = audio_stream_get_rptr(sources[j]);
Expand Down Expand Up @@ -78,8 +79,9 @@ static void mix_n_s24(struct comp_dev *dev, struct audio_stream *sink,
ae_int32x2 *out = audio_stream_get_wptr(sink);
ae_int32x2 val;
ae_int32x2 sample = AE_ZERO32();
unsigned int n, m, nmax, i, j, left_samples;
unsigned int samples = frames * audio_stream_get_channels(sink);
size_t n, m, nmax, i, left_samples;
uint32_t j;
size_t samples = frames * audio_stream_get_channels(sink);

for (j = 0; j < num_sources; j++)
in[j] = audio_stream_get_rptr(sources[j]);
Expand Down Expand Up @@ -124,9 +126,10 @@ static void mix_n_s32(struct comp_dev *dev, struct audio_stream *sink,
ae_int64 sample;
ae_int64 val;
ae_int32x2 res;
unsigned int n, nmax, i, j, left_samples;
unsigned int m = 0;
unsigned int samples = frames * audio_stream_get_channels(sink);
size_t n, nmax, i, left_samples;
size_t m = 0;
uint32_t j;
size_t samples = frames * audio_stream_get_channels(sink);

for (j = 0; j < num_sources; j++)
in[j] = audio_stream_get_rptr(sources[j]);
Expand Down
6 changes: 3 additions & 3 deletions src/audio/multiband_drc/multiband_drc_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static int multiband_drc_s16_default(const struct processing_module *mod,
int32_t *band_buf_drc_sink;
const int16_t *x, *buf_x_start;
int16_t *y, *buf_y_start;
int buf_x_samples, buf_y_samples;
size_t buf_x_samples, buf_y_samples;
size_t n_bytes = frames * source_get_frame_bytes(source);
int band;
int nbuf;
Expand Down Expand Up @@ -304,7 +304,7 @@ static int multiband_drc_s24_default(const struct processing_module *mod,
int32_t *band_buf_drc_sink;
const int32_t *x, *buf_x_start;
int32_t *y, *buf_y_start;
int buf_x_samples, buf_y_samples;
size_t buf_x_samples, buf_y_samples;
size_t n_bytes = frames * source_get_frame_bytes(source);
int band;
int nbuf;
Expand Down Expand Up @@ -389,7 +389,7 @@ static int multiband_drc_s32_default(const struct processing_module *mod,
int32_t *band_buf_drc_sink;
const int32_t *x, *buf_x_start;
int32_t *y, *buf_y_start;
int buf_x_samples, buf_y_samples;
size_t buf_x_samples, buf_y_samples;
size_t n_bytes = frames * source_get_frame_bytes(source);
int band;
int nbuf;
Expand Down
Loading
Loading