Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

volume: fix processing size in HiFi3 implementation #81

Merged
merged 1 commit into from
Jul 13, 2018
Merged
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: 5 additions & 10 deletions src/audio/volume_hifi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ static void vol_s16_to_s16(struct comp_dev *dev, struct comp_buffer *sink,
ae_f16x4 in_sample;
size_t channel;
int i;
int limit = source->size / (dev->params.channels << 1);
ae_int16 *in = (ae_int16 *)source->r_ptr;
ae_int16 *out = (ae_int16 *)sink->w_ptr;

Expand All @@ -69,7 +68,7 @@ static void vol_s16_to_s16(struct comp_dev *dev, struct comp_buffer *sink,
vol_scaled[channel] = cd->volume[channel] * VOL_SCALE;

/* Main processing loop */
for (i = 0; i < limit; i++) {
for (i = 0; i < dev->frames; i++) {
/* Processing per channel */
for (channel = 0; channel < dev->params.channels; channel++) {
/* Load the input sample */
Expand Down Expand Up @@ -109,7 +108,6 @@ static void vol_s16_to_sX(struct comp_dev *dev, struct comp_buffer *sink,
size_t channel;
uint8_t shift_left = 0;
int i;
int limit = source->size / (dev->params.channels << 1);
ae_int16 *in = (ae_int16 *)source->r_ptr;
ae_int32 *out = (ae_int32 *)sink->w_ptr;

Expand All @@ -124,7 +122,7 @@ static void vol_s16_to_sX(struct comp_dev *dev, struct comp_buffer *sink,
vol_scaled[channel] = cd->volume[channel] * VOL_SCALE;

/* Main processing loop */
for (i = 0; i < limit; i++) {
for (i = 0; i < dev->frames; i++) {
/* Processing per channel */
for (channel = 0; channel < dev->params.channels; channel++) {
/* Load the input sample */
Expand Down Expand Up @@ -166,7 +164,6 @@ static void vol_sX_to_s16(struct comp_dev *dev, struct comp_buffer *sink,
size_t channel;
uint8_t shift_left = 0;
int i;
int limit = source->size / (dev->params.channels << 2);
ae_int32 *in = (ae_int32 *)source->r_ptr;
ae_int16 *out = (ae_int16 *)sink->w_ptr;

Expand All @@ -179,7 +176,7 @@ static void vol_sX_to_s16(struct comp_dev *dev, struct comp_buffer *sink,
vol_scaled[channel] = cd->volume[channel] * VOL_SCALE;

/* Main processing loop */
for (i = 0; i < limit; i++) {
for (i = 0; i < dev->frames; i++) {
/* Processing per channel */
for (channel = 0; channel < dev->params.channels; channel++) {
/* Load the input sample */
Expand Down Expand Up @@ -222,7 +219,6 @@ static void vol_s24_to_s24_s32(struct comp_dev *dev, struct comp_buffer *sink,
size_t channel;
uint8_t shift_left = 0;
int i;
int limit = source->size / (dev->params.channels << 2);
ae_int32 *in = (ae_int32 *)source->r_ptr;
ae_int32 *out = (ae_int32 *)sink->w_ptr;

Expand All @@ -235,7 +231,7 @@ static void vol_s24_to_s24_s32(struct comp_dev *dev, struct comp_buffer *sink,
vol_scaled[channel] = cd->volume[channel] * VOL_SCALE;

/* Main processing loop */
for (i = 0; i < limit; i++) {
for (i = 0; i < dev->frames; i++) {
/* Processing per channel */
for (channel = 0; channel < dev->params.channels; channel++) {
/* Load the input sample */
Expand Down Expand Up @@ -277,7 +273,6 @@ static void vol_s32_to_s24_s32(struct comp_dev *dev, struct comp_buffer *sink,
size_t channel;
uint8_t shift_right = 0;
int i;
int limit = source->size / (dev->params.channels << 2);
ae_int32 *in = (ae_int32 *)source->r_ptr;
ae_int32 *out = (ae_int32 *)sink->w_ptr;

Expand All @@ -290,7 +285,7 @@ static void vol_s32_to_s24_s32(struct comp_dev *dev, struct comp_buffer *sink,
vol_scaled[channel] = cd->volume[channel] * VOL_SCALE;

/* Main processing loop */
for (i = 0; i < limit; i++) {
for (i = 0; i < dev->frames; i++) {
/* Processing per channel */
for (channel = 0; channel < dev->params.channels; channel++) {
/* Load the input sample */
Expand Down