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
21 changes: 12 additions & 9 deletions src/audio/volume/volume_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ static void vol_s24_to_s24(struct processing_module *mod, struct cir_buf_source
const int32_t *x, *x0;
int32_t *y, *y0;
int32_t vol;
int nmax, n, i, j;
const int nch = cd->channels;
int nmax, n, i;
unsigned int j;
const unsigned int nch = cd->channels;
int remaining_samples = frames * nch;

x = source->ptr;
Expand Down Expand Up @@ -108,7 +109,7 @@ static void vol_passthrough_s24_to_s24(struct processing_module *mod,
const int32_t *x;
int32_t *y;
int nmax, n;
const int nch = cd->channels;
const unsigned int nch = cd->channels;
int remaining_samples = frames * nch;

x = source->ptr;
Expand Down Expand Up @@ -145,8 +146,9 @@ static void vol_s32_to_s32(struct processing_module *mod, struct cir_buf_source
const int32_t *x, *x0;
int32_t *y, *y0;
int32_t vol;
int nmax, n, i, j;
const int nch = cd->channels;
int nmax, n, i;
unsigned int j;
const unsigned int nch = cd->channels;
int remaining_samples = frames * nch;

x = source->ptr;
Expand Down Expand Up @@ -194,7 +196,7 @@ static void vol_passthrough_s32_to_s32(struct processing_module *mod,
const int32_t *x;
int32_t *y;
int nmax, n;
const int nch = cd->channels;
const unsigned int nch = cd->channels;
int remaining_samples = frames * nch;

x = source->ptr;
Expand Down Expand Up @@ -231,8 +233,9 @@ static void vol_s16_to_s16(struct processing_module *mod, struct cir_buf_source
const int16_t *x, *x0;
int16_t *y, *y0;
int32_t vol;
int nmax, n, i, j;
const int nch = cd->channels;
int nmax, n, i;
unsigned int j;
const unsigned int nch = cd->channels;
int remaining_samples = frames * nch;

x = source->ptr;
Expand Down Expand Up @@ -277,7 +280,7 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod,
const int16_t *x;
int16_t *y;
int nmax, n;
const int nch = cd->channels;
const unsigned int nch = cd->channels;
int remaining_samples = frames * nch;

x = source->ptr;
Expand Down
30 changes: 18 additions & 12 deletions src/audio/volume/volume_generic_with_peakvol.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ static void vol_s24_to_s24(struct processing_module *mod, struct cir_buf_source
int32_t *y, *y0;
int32_t vol;
int32_t tmp;
int nmax, n, i, j;
const int nch = cd->channels;
int nmax, n, i;
unsigned int j;
const unsigned int nch = cd->channels;
int remaining_samples = frames * nch;

x = source->ptr;
Expand Down Expand Up @@ -109,8 +110,9 @@ static void vol_passthrough_s24_to_s24(struct processing_module *mod,
const int32_t *x, *x0;
int32_t *y, *y0;
int32_t tmp;
int nmax, n, i, j;
const int nch = cd->channels;
int nmax, n, i;
unsigned int j;
const unsigned int nch = cd->channels;
int remaining_samples = frames * nch;

x = source->ptr;
Expand Down Expand Up @@ -158,8 +160,9 @@ static void vol_s32_to_s32(struct processing_module *mod, struct cir_buf_source
int32_t *y, *y0;
int32_t vol;
int32_t tmp;
int nmax, n, i, j;
const int nch = cd->channels;
int nmax, n, i;
unsigned int j;
const unsigned int nch = cd->channels;
int remaining_samples = frames * nch;

x = source->ptr;
Expand Down Expand Up @@ -211,8 +214,9 @@ static void vol_passthrough_s32_to_s32(struct processing_module *mod,
const int32_t *x, *x0;
int32_t *y, *y0;
int32_t tmp;
int nmax, n, i, j;
const int nch = cd->channels;
int nmax, n, i;
unsigned int j;
const unsigned int nch = cd->channels;
int remaining_samples = frames * nch;

x = source->ptr;
Expand Down Expand Up @@ -263,8 +267,9 @@ static void vol_s16_to_s16(struct processing_module *mod, struct cir_buf_source
int16_t *y, *y0;
int32_t vol;
uint32_t tmp;
int nmax, n, i, j;
const int nch = cd->channels;
int nmax, n, i;
unsigned int j;
const unsigned int nch = cd->channels;
int remaining_samples = frames * nch;

x = source->ptr;
Expand Down Expand Up @@ -313,8 +318,9 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod,
const int16_t *x, *x0;
int16_t *y, *y0;
uint32_t tmp;
int nmax, n, i, j;
const int nch = cd->channels;
int nmax, n, i;
unsigned int j;
const unsigned int nch = cd->channels;
int remaining_samples = frames * nch;

x = source->ptr;
Expand Down
16 changes: 8 additions & 8 deletions src/audio/volume/volume_hifi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ LOG_MODULE_DECLARE(volume_hifi3, CONFIG_SOF_LOG_LEVEL);
* \param[in,out] cd Volume component private data.
* \param[in] channels_count Number of channels to process.
*/
static void vol_store_gain(struct vol_data *cd, const int channels_count)
static void vol_store_gain(struct vol_data *cd, const unsigned int channels_count)
{
int32_t i;
unsigned int i;

/* using for loop instead of memcpy_s(), because for loop costs less cycles */
for (i = 0; i < channels_count; i++) {
Expand Down Expand Up @@ -72,7 +72,7 @@ static void vol_s24_to_s24_s32(struct processing_module *mod, struct cir_buf_sou
ae_valign outu = AE_ZALIGN64();
const ae_f32x2 *in = source->ptr;
ae_f32x2 *out = sink->ptr;
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
const int inc = sizeof(ae_f32x2);
int samples = channels_count * frames;

Expand Down Expand Up @@ -148,7 +148,7 @@ static void vol_passthrough_s24_to_s24_s32(struct processing_module *mod,
ae_valign outu = AE_ZALIGN64();
const ae_f32x2 *in = source->ptr;
ae_f32x2 *out = sink->ptr;
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
int samples = channels_count * frames;

while (samples) {
Expand Down Expand Up @@ -195,7 +195,7 @@ static void vol_s32_to_s24_s32(struct processing_module *mod, struct cir_buf_sou
ae_f32x2 *vol;
ae_valign inu;
ae_valign outu = AE_ZALIGN64();
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
const int inc = sizeof(ae_f32x2);
int samples = channels_count * frames;
const ae_f32x2 *in = source->ptr;
Expand Down Expand Up @@ -269,7 +269,7 @@ static void vol_passthrough_s32_to_s24_s32(struct processing_module *mod,
int i, n, m;
ae_valign inu;
ae_valign outu = AE_ZALIGN64();
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
int samples = channels_count * frames;
const ae_f32x2 *in = source->ptr;
ae_f32x2 *out = sink->ptr;
Expand Down Expand Up @@ -322,7 +322,7 @@ static void vol_s16_to_s16(struct processing_module *mod, struct cir_buf_source
ae_valign outu = AE_ZALIGN64();
const ae_f16x4 *in = source->ptr;
ae_f16x4 *out = sink->ptr;
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
const int inc = sizeof(ae_f32x2);
int samples = channels_count * frames;

Expand Down Expand Up @@ -409,7 +409,7 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod,
ae_valign outu = AE_ZALIGN64();
const ae_f16x4 *in = source->ptr;
ae_f16x4 *out = sink->ptr;
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
int samples = channels_count * frames;

while (samples) {
Expand Down
30 changes: 18 additions & 12 deletions src/audio/volume/volume_hifi3_with_peakvol.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ static void vol_s24_to_s24_s32(struct processing_module *mod, struct cir_buf_sou
ae_f32x2 in_sample;
ae_f32x2 out_sample;
ae_f32x2 volume;
int channel, n, i, m;
unsigned int channel;
int n, i, m;
ae_f32 *in0 = (void *)source->ptr;
ae_f32 *out0 = sink->ptr;
ae_f32 *in, *out;
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
const int inc = sizeof(ae_f32) * channels_count;
int samples = channels_count * frames;
ae_f32x2 peak_vol;
Expand Down Expand Up @@ -114,11 +115,12 @@ static void vol_passthrough_s24_to_s24_s32(struct processing_module *mod,
{
struct vol_data *cd = module_get_private_data(mod);
ae_f32x2 in_sample;
int channel, n, i, m;
unsigned int channel;
int n, i, m;
ae_f32 *in0 = (void *)source->ptr;
ae_f32 *out0 = sink->ptr;
ae_f32 *in, *out;
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
const int inc = sizeof(ae_f32) * channels_count;
int samples = channels_count * frames;
ae_f32x2 peak_vol;
Expand Down Expand Up @@ -170,8 +172,9 @@ static void vol_s32_to_s24_s32(struct processing_module *mod, struct cir_buf_sou
ae_f32x2 in_sample;
ae_f32x2 out_sample;
ae_f32x2 volume;
int i, n, channel, m;
const int channels_count = cd->channels;
int i, n, m;
unsigned int channel;
const unsigned int channels_count = cd->channels;
const int inc = sizeof(ae_f32) * channels_count;
int samples = channels_count * frames;
ae_f32 *in0 = (void *)source->ptr;
Expand Down Expand Up @@ -238,8 +241,9 @@ static void vol_passthrough_s32_to_s24_s32(struct processing_module *mod,
{
struct vol_data *cd = module_get_private_data(mod);
ae_f32x2 in_sample;
int i, n, channel, m;
const int channels_count = cd->channels;
int i, n, m;
unsigned int channel;
const unsigned int channels_count = cd->channels;
const int inc = sizeof(ae_f32) * channels_count;
int samples = channels_count * frames;
ae_f32 *in0 = (void *)source->ptr;
Expand Down Expand Up @@ -295,12 +299,13 @@ static void vol_s16_to_s16(struct processing_module *mod, struct cir_buf_source
ae_f32x2 out_sample0;
ae_f16x4 in_sample;
ae_f16x4 out_sample;
int i, n, channel, m;
int i, n, m;
unsigned int channel;
ae_f16 *in;
ae_f16 *out;
ae_f16 *in0 = (void *)source->ptr;
ae_f16 *out0 = sink->ptr;
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
const int inc = sizeof(ae_f16) * channels_count;
int samples = channels_count * frames;
ae_f32x2 peak_vol;
Expand Down Expand Up @@ -370,12 +375,13 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod,
{
struct vol_data *cd = module_get_private_data(mod);
ae_f16x4 in_sample;
int i, n, channel, m;
int i, n, m;
unsigned int channel;
ae_f16 *in;
ae_f16 *out;
ae_f16 *in0 = (void *)source->ptr;
ae_f16 *out0 = sink->ptr;
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
const int inc = sizeof(ae_f16) * channels_count;
int samples = channels_count * frames;
ae_f32x2 peak_vol;
Expand Down
14 changes: 7 additions & 7 deletions src/audio/volume/volume_hifi4.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ LOG_MODULE_DECLARE(volume_hifi4, CONFIG_SOF_LOG_LEVEL);
* \param[in,out] cd Volume component private data.
* \param[in] channels_count Number of channels to process.
*/
static void vol_store_gain(struct vol_data *cd, const int channels_count)
static void vol_store_gain(struct vol_data *cd, const unsigned int channels_count)
{
int32_t i;
unsigned int i;

/* using for loop instead of memcpy_s(), because for loop costs less cycles */
for (i = 0; i < channels_count; i++) {
Expand Down Expand Up @@ -72,7 +72,7 @@ static void vol_s24_to_s24_s32(struct processing_module *mod, struct cir_buf_sou
ae_valign outu = AE_ZALIGN64();
const ae_f32x2 *in = source->ptr;
ae_f32x2 *out = sink->ptr;
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
const int inc = sizeof(ae_f32x2);
int samples = channels_count * frames;

Expand Down Expand Up @@ -195,7 +195,7 @@ static void vol_s32_to_s24_s32(struct processing_module *mod, struct cir_buf_sou
ae_f32x2 *vol;
ae_valign inu;
ae_valign outu = AE_ZALIGN64();
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
const int inc = sizeof(ae_f32x2);
int samples = channels_count * frames;
const ae_f32x2 *in = source->ptr;
Expand Down Expand Up @@ -271,7 +271,7 @@ static void vol_passthrough_s32_to_s24_s32(struct processing_module *mod,
int i, n, m;
ae_valign inu;
ae_valign outu = AE_ZALIGN64();
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
int samples = channels_count * frames;
const ae_f32x2 *in = source->ptr;
ae_f32x2 *out = sink->ptr;
Expand Down Expand Up @@ -324,7 +324,7 @@ static void vol_s16_to_s16(struct processing_module *mod, struct cir_buf_source
ae_valign outu = AE_ZALIGN64();
const ae_f16x4 *in = source->ptr;
ae_f16x4 *out = sink->ptr;
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
const int inc = sizeof(ae_f32x2);
int samples = channels_count * frames;

Expand Down Expand Up @@ -438,7 +438,7 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod,
ae_valign outu = AE_ZALIGN64();
const ae_f16x4 *in = source->ptr;
ae_f16x4 *out = sink->ptr;
const int channels_count = cd->channels;
const unsigned int channels_count = cd->channels;
int samples = channels_count * frames;

while (samples) {
Expand Down
Loading
Loading