Skip to content

Commit

Permalink
Merge pull request #81 from tlauda/topic/volume_processing
Browse files Browse the repository at this point in the history
volume: fix processing size in HiFi3 implementation
  • Loading branch information
plbossart authored Jul 13, 2018
2 parents f9c597e + b56e6ac commit 295d0c1
Showing 1 changed file with 5 additions and 10 deletions.
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 = AE_ZERO16();
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

0 comments on commit 295d0c1

Please sign in to comment.