Skip to content

Commit e78627d

Browse files
committed
eq_iir: use buffer_copy function
Uses buffer_copy function for bypass mode to avoid code duplication. Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
1 parent ec20241 commit e78627d

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

src/audio/eq_iir/eq_iir.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -225,16 +225,7 @@ static void eq_iir_s16_pass(struct comp_dev *dev,
225225
struct comp_buffer *sink,
226226
uint32_t frames)
227227
{
228-
int16_t *x;
229-
int16_t *y;
230-
int i;
231-
int n = frames * dev->params.channels;
232-
233-
for (i = 0; i < n; i++) {
234-
x = buffer_read_frag_s16(source, i);
235-
y = buffer_write_frag_s16(sink, i);
236-
*y = *x;
237-
}
228+
buffer_copy_s16(source, sink, frames * dev->params.channels);
238229
}
239230
#endif /* CONFIG_FORMAT_S16LE */
240231

@@ -244,16 +235,7 @@ static void eq_iir_s32_pass(struct comp_dev *dev,
244235
struct comp_buffer *sink,
245236
uint32_t frames)
246237
{
247-
int32_t *x;
248-
int32_t *y;
249-
int i;
250-
int n = frames * dev->params.channels;
251-
252-
for (i = 0; i < n; i++) {
253-
x = buffer_read_frag_s32(source, i);
254-
y = buffer_write_frag_s32(sink, i);
255-
*y = *x;
256-
}
238+
buffer_copy_s32(source, sink, frames * dev->params.channels);
257239
}
258240
#endif /* CONFIG_FORMAT_S24LE || CONFIG_FORMAT_S32LE */
259241

0 commit comments

Comments
 (0)