Skip to content

Commit ffdfb3d

Browse files
ipc4: mixin: Fixes for HiFi5 impl of mix functions
Fixes HiFi5 impl of mix_s24() and mix_s32(). Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
1 parent f776272 commit ffdfb3d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/audio/mixin_mixout/mixin_mixout_hifi5.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static void mix_s16(struct cir_buf_ptr *sink, int32_t start_sample, int32_t mixe
8282
inu = AE_LA128_PP(in);
8383
m = n >> 3;
8484
left = n & 0x07;
85-
/* process 8 frames per loop */
85+
/* process 8 samples per loop */
8686
for (i = 0; i < m; i++) {
8787
AE_LA16X4X2_IP(in_sample, in_sample1, inu, in);
8888
AE_SA16X4X2_IP(in_sample, in_sample1, outu2, out);
@@ -137,7 +137,7 @@ static void mix_s24(struct cir_buf_ptr *sink, int32_t start_sample, int32_t mixe
137137
outu1 = AE_LA128_PP(out);
138138
m = n >> 2;
139139
left = n & 3;
140-
/* process 2 samples per time */
140+
/* process 4 samples per time */
141141
for (i = 0; i < m; i++) {
142142
AE_LA32X2X2_IP(in_sample, in_sample1, inu, in);
143143
AE_LA32X2X2_IP(out_sample, out_sample1, outu1, out);
@@ -148,8 +148,8 @@ static void mix_s24(struct cir_buf_ptr *sink, int32_t start_sample, int32_t mixe
148148
}
149149
AE_SA128POS_FP(outu2, out);
150150

151-
/* process the left sample to avoid memory access overrun */
152-
if (left) {
151+
/* process the left samples to avoid memory access overrun */
152+
for (i = 0; i < left; i++) {
153153
AE_L32_IP(in_sample, (ae_int32 *)in, sizeof(ae_int32));
154154
AE_L32_IP(out_sample, (ae_int32 *)out, 0);
155155
out_sample = AE_ADD24S(in_sample, out_sample);
@@ -174,8 +174,8 @@ static void mix_s24(struct cir_buf_ptr *sink, int32_t start_sample, int32_t mixe
174174
AE_SA32X2X2_IP(in_sample, in_sample1, outu2, out);
175175
}
176176
AE_SA128POS_FP(outu2, out);
177-
/* process the left sample to avoid memory access overrun */
178-
if (left) {
177+
/* process the left samples to avoid memory access overrun */
178+
for (i = 0; i < left; i++) {
179179
AE_L32_IP(in_sample, (ae_int32 *)in, sizeof(ae_int32));
180180
AE_S32_L_IP(in_sample, (ae_int32 *)out, sizeof(ae_int32));
181181
}
@@ -231,8 +231,8 @@ static void mix_s32(struct cir_buf_ptr *sink, int32_t start_sample, int32_t mixe
231231
}
232232
AE_SA128POS_FP(outu2, out);
233233

234-
/* process the left sample to avoid memory access overrun */
235-
if (left) {
234+
/* process the left samples to avoid memory access overrun */
235+
for (i = 0; i < left; i++) {
236236
AE_L32_IP(in_sample, (ae_int32 *)in, sizeof(ae_int32));
237237
AE_L32_IP(out_sample, (ae_int32 *)out, 0);
238238
out_sample = AE_ADD32S(in_sample, out_sample);
@@ -258,8 +258,8 @@ static void mix_s32(struct cir_buf_ptr *sink, int32_t start_sample, int32_t mixe
258258
AE_SA32X2X2_IP(in_sample, in_sample1, outu2, out);
259259
}
260260
AE_SA128POS_FP(outu2, out);
261-
/* process the left sample to avoid memory access overrun */
262-
if (left) {
261+
/* process the left samples to avoid memory access overrun */
262+
for (i = 0; i < left; i++) {
263263
AE_L32_IP(in_sample, (ae_int32 *)in, sizeof(ae_int32));
264264
AE_S32_L_IP(in_sample, (ae_int32 *)out, sizeof(ae_int32));
265265
}

0 commit comments

Comments
 (0)