Skip to content

Commit f90291f

Browse files
committed
Audio: Volume: Remove unnecessary clear of HiFi registers
These registers are set later in the code in the load instructions. This change saves a bit of code size and a tiny amount of processor cycles. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 94ed04d commit f90291f

4 files changed

Lines changed: 58 additions & 58 deletions

File tree

src/audio/volume/volume_hifi3.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ static void vol_s24_to_s24_s32(struct processing_module *mod, struct input_strea
6363
struct vol_data *cd = module_get_private_data(mod);
6464
struct audio_stream *source = bsource->data;
6565
struct audio_stream *sink = bsink->data;
66-
ae_f32x2 in_sample = AE_ZERO32();
67-
ae_f32x2 out_sample = AE_ZERO32();
68-
ae_f32x2 volume = AE_ZERO32();
66+
ae_f32x2 in_sample;
67+
ae_f32x2 out_sample;
68+
ae_f32x2 volume;
6969
ae_f32x2 *buf;
7070
ae_f32x2 *buf_end;
7171
int i, n, m;
@@ -149,7 +149,7 @@ static void vol_passthrough_s24_to_s24_s32(struct processing_module *mod,
149149
{
150150
struct audio_stream *source = bsource->data;
151151
struct audio_stream *sink = bsink->data;
152-
ae_f32x2 in_sample = AE_ZERO32();
152+
ae_f32x2 in_sample;
153153
int i, n, m;
154154
ae_valign inu;
155155
ae_valign outu = AE_ZALIGN64();
@@ -200,9 +200,9 @@ static void vol_s32_to_s24_s32(struct processing_module *mod, struct input_strea
200200
struct vol_data *cd = module_get_private_data(mod);
201201
struct audio_stream *source = bsource->data;
202202
struct audio_stream *sink = bsink->data;
203-
ae_f32x2 in_sample = AE_ZERO32();
204-
ae_f32x2 out_sample = AE_ZERO32();
205-
ae_f32x2 volume = AE_ZERO32();
203+
ae_f32x2 in_sample;
204+
ae_f32x2 out_sample;
205+
ae_f32x2 volume;
206206
int i, n, m;
207207
ae_f64 mult0;
208208
ae_f64 mult1;
@@ -291,7 +291,7 @@ static void vol_passthrough_s32_to_s24_s32(struct processing_module *mod,
291291
{
292292
struct audio_stream *source = bsource->data;
293293
struct audio_stream *sink = bsink->data;
294-
ae_f32x2 in_sample = AE_ZERO32();
294+
ae_f32x2 in_sample;
295295
int i, n, m;
296296
ae_valign inu;
297297
ae_valign outu = AE_ZALIGN64();
@@ -341,12 +341,12 @@ static void vol_s16_to_s16(struct processing_module *mod, struct input_stream_bu
341341
struct vol_data *cd = module_get_private_data(mod);
342342
struct audio_stream *source = bsource->data;
343343
struct audio_stream *sink = bsink->data;
344-
ae_f32x2 volume0 = AE_ZERO32();
345-
ae_f32x2 volume1 = AE_ZERO32();
346-
ae_f32x2 out_sample0 = AE_ZERO32();
347-
ae_f32x2 out_sample1 = AE_ZERO32();
348-
ae_f16x4 in_sample = AE_ZERO16();
349-
ae_f16x4 out_sample = AE_ZERO16();
344+
ae_f32x2 volume0;
345+
ae_f32x2 volume1;
346+
ae_f32x2 out_sample0;
347+
ae_f32x2 out_sample1;
348+
ae_f16x4 in_sample;
349+
ae_f16x4 out_sample;
350350
int i, n, m;
351351
ae_f32x2 *buf;
352352
ae_f32x2 *buf_end;
@@ -438,7 +438,7 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod,
438438
{
439439
struct audio_stream *source = bsource->data;
440440
struct audio_stream *sink = bsink->data;
441-
ae_f16x4 in_sample = AE_ZERO16();
441+
ae_f16x4 in_sample;
442442
int i, n, m;
443443
ae_valign inu;
444444
ae_valign outu = AE_ZALIGN64();

src/audio/volume/volume_hifi3_with_peakvol.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ static void vol_s24_to_s24_s32(struct processing_module *mod, struct input_strea
4343
struct vol_data *cd = module_get_private_data(mod);
4444
struct audio_stream *source = bsource->data;
4545
struct audio_stream *sink = bsink->data;
46-
ae_f32x2 in_sample = AE_ZERO32();
47-
ae_f32x2 out_sample = AE_ZERO32();
48-
ae_f32x2 volume = AE_ZERO32();
46+
ae_f32x2 in_sample;
47+
ae_f32x2 out_sample;
48+
ae_f32x2 volume;
4949
int channel, n, i, m;
5050
ae_f32 *in0 = (ae_f32 *)audio_stream_wrap(source, (char *)audio_stream_get_rptr(source)
5151
+ bsource->consumed);
@@ -118,7 +118,7 @@ static void vol_passthrough_s24_to_s24_s32(struct processing_module *mod,
118118
struct vol_data *cd = module_get_private_data(mod);
119119
struct audio_stream *source = bsource->data;
120120
struct audio_stream *sink = bsink->data;
121-
ae_f32x2 in_sample = AE_ZERO32();
121+
ae_f32x2 in_sample;
122122
int channel, n, i, m;
123123
ae_f32 *in0 = (ae_f32 *)audio_stream_wrap(source, (char *)audio_stream_get_rptr(source)
124124
+ bsource->consumed);
@@ -178,9 +178,9 @@ static void vol_s32_to_s24_s32(struct processing_module *mod, struct input_strea
178178
struct vol_data *cd = module_get_private_data(mod);
179179
struct audio_stream *source = bsource->data;
180180
struct audio_stream *sink = bsink->data;
181-
ae_f32x2 in_sample = AE_ZERO32();
182-
ae_f32x2 out_sample = AE_ZERO32();
183-
ae_f32x2 volume = AE_ZERO32();
181+
ae_f32x2 in_sample;
182+
ae_f32x2 out_sample;
183+
ae_f32x2 volume;
184184
int i, n, channel, m;
185185
ae_f64 mult0;
186186
const int channels_count = audio_stream_get_channels(sink);
@@ -254,7 +254,7 @@ static void vol_passthrough_s32_to_s24_s32(struct processing_module *mod,
254254
struct vol_data *cd = module_get_private_data(mod);
255255
struct audio_stream *source = bsource->data;
256256
struct audio_stream *sink = bsink->data;
257-
ae_f32x2 in_sample = AE_ZERO32();
257+
ae_f32x2 in_sample;
258258
int i, n, channel, m;
259259
const int channels_count = audio_stream_get_channels(sink);
260260
const int inc = sizeof(ae_f32) * channels_count;
@@ -314,10 +314,10 @@ static void vol_s16_to_s16(struct processing_module *mod, struct input_stream_bu
314314
struct vol_data *cd = module_get_private_data(mod);
315315
struct audio_stream *source = bsource->data;
316316
struct audio_stream *sink = bsink->data;
317-
ae_f32x2 volume = AE_ZERO32();
318-
ae_f32x2 out_sample0 = AE_ZERO32();
319-
ae_f16x4 in_sample = AE_ZERO16();
320-
ae_f16x4 out_sample = AE_ZERO16();
317+
ae_f32x2 volume;
318+
ae_f32x2 out_sample0;
319+
ae_f16x4 in_sample;
320+
ae_f16x4 out_sample;
321321
int i, n, channel, m;
322322
ae_f16 *in;
323323
ae_f16 *out;
@@ -396,7 +396,7 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod,
396396
struct vol_data *cd = module_get_private_data(mod);
397397
struct audio_stream *source = bsource->data;
398398
struct audio_stream *sink = bsink->data;
399-
ae_f16x4 in_sample = AE_ZERO16();
399+
ae_f16x4 in_sample;
400400
int i, n, channel, m;
401401
ae_f16 *in;
402402
ae_f16 *out;

src/audio/volume/volume_hifi4.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ static void vol_s24_to_s24_s32(struct processing_module *mod, struct input_strea
6363
struct vol_data *cd = module_get_private_data(mod);
6464
struct audio_stream *source = bsource->data;
6565
struct audio_stream *sink = bsink->data;
66-
ae_f32x2 in_sample = AE_ZERO32();
67-
ae_f32x2 out_sample = AE_ZERO32();
68-
ae_f32x2 volume = AE_ZERO32();
66+
ae_f32x2 in_sample;
67+
ae_f32x2 out_sample;
68+
ae_f32x2 volume;
6969
ae_f32x2 *buf;
7070
ae_f32x2 *buf_end;
7171
int i, n, m;
@@ -149,7 +149,7 @@ static void vol_passthrough_s24_to_s24_s32(struct processing_module *mod,
149149
{
150150
struct audio_stream *source = bsource->data;
151151
struct audio_stream *sink = bsink->data;
152-
ae_f32x2 in_sample = AE_ZERO32();
152+
ae_f32x2 in_sample;
153153
int i, n, m;
154154
ae_valign inu;
155155
ae_valign outu = AE_ZALIGN64();
@@ -200,9 +200,9 @@ static void vol_s32_to_s24_s32(struct processing_module *mod, struct input_strea
200200
struct vol_data *cd = module_get_private_data(mod);
201201
struct audio_stream *source = bsource->data;
202202
struct audio_stream *sink = bsink->data;
203-
ae_f32x2 in_sample = AE_ZERO32();
204-
ae_f32x2 out_sample = AE_ZERO32();
205-
ae_f32x2 volume = AE_ZERO32();
203+
ae_f32x2 in_sample;
204+
ae_f32x2 out_sample;
205+
ae_f32x2 volume;
206206
int i, n, m;
207207
ae_f64 mult0;
208208
ae_f64 mult1;
@@ -291,7 +291,7 @@ static void vol_passthrough_s32_to_s24_s32(struct processing_module *mod,
291291
{
292292
struct audio_stream *source = bsource->data;
293293
struct audio_stream *sink = bsink->data;
294-
ae_f32x2 in_sample = AE_ZERO32();
294+
ae_f32x2 in_sample;
295295
int i, n, m;
296296
ae_valign inu;
297297
ae_valign outu = AE_ZALIGN64();
@@ -340,12 +340,12 @@ static void vol_s16_to_s16(struct processing_module *mod, struct input_stream_bu
340340
struct vol_data *cd = module_get_private_data(mod);
341341
struct audio_stream *source = bsource->data;
342342
struct audio_stream *sink = bsink->data;
343-
ae_f32x2 volume0 = AE_ZERO32();
344-
ae_f32x2 volume1 = AE_ZERO32();
345-
ae_f32x2 out_sample0 = AE_ZERO32();
346-
ae_f32x2 out_sample1 = AE_ZERO32();
347-
ae_f16x4 in_sample = AE_ZERO16();
348-
ae_f16x4 out_sample = AE_ZERO16();
343+
ae_f32x2 volume0;
344+
ae_f32x2 volume1;
345+
ae_f32x2 out_sample0;
346+
ae_f32x2 out_sample1;
347+
ae_f16x4 in_sample;
348+
ae_f16x4 out_sample;
349349
int i, n, m, left;
350350
ae_f32x2 *buf;
351351
ae_f32x2 *buf_end;
@@ -459,7 +459,7 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod,
459459
{
460460
struct audio_stream *source = bsource->data;
461461
struct audio_stream *sink = bsink->data;
462-
ae_f16x4 in_sample = AE_ZERO16();
462+
ae_f16x4 in_sample;
463463
int i, n, m, left;
464464
ae_valign inu;
465465
ae_valign outu = AE_ZALIGN64();

src/audio/volume/volume_hifi4_with_peakvol.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ static void vol_s24_to_s24_s32(struct processing_module *mod, struct input_strea
5656
struct vol_data *cd = module_get_private_data(mod);
5757
struct audio_stream *source = bsource->data;
5858
struct audio_stream *sink = bsink->data;
59-
ae_f32x2 in_sample = AE_ZERO32();
60-
ae_f32x2 out_sample = AE_ZERO32();
61-
ae_f32x2 volume = AE_ZERO32();
59+
ae_f32x2 in_sample;
60+
ae_f32x2 out_sample;
61+
ae_f32x2 volume;
6262
int i, n, m;
6363
ae_f32x2 *vol;
6464
ae_valign inu;
@@ -152,7 +152,7 @@ static void vol_passthrough_s24_to_s24_s32(struct processing_module *mod,
152152
struct vol_data *cd = module_get_private_data(mod);
153153
struct audio_stream *source = bsource->data;
154154
struct audio_stream *sink = bsink->data;
155-
ae_f32x2 in_sample = AE_ZERO32();
155+
ae_f32x2 in_sample;
156156

157157
int i, n, m;
158158
ae_valign inu;
@@ -219,9 +219,9 @@ static void vol_s32_to_s24_s32(struct processing_module *mod, struct input_strea
219219
struct vol_data *cd = module_get_private_data(mod);
220220
struct audio_stream *source = bsource->data;
221221
struct audio_stream *sink = bsink->data;
222-
ae_f32x2 in_sample = AE_ZERO32();
223-
ae_f32x2 out_sample = AE_ZERO32();
224-
ae_f32x2 volume = AE_ZERO32();
222+
ae_f32x2 in_sample;
223+
ae_f32x2 out_sample;
224+
ae_f32x2 volume;
225225
int i, n, m;
226226
ae_f64 mult0;
227227
ae_f64 mult1;
@@ -323,7 +323,7 @@ static void vol_passthrough_s32_to_s24_s32(struct processing_module *mod,
323323
struct vol_data *cd = module_get_private_data(mod);
324324
struct audio_stream *source = bsource->data;
325325
struct audio_stream *sink = bsink->data;
326-
ae_f32x2 in_sample = AE_ZERO32();
326+
ae_f32x2 in_sample;
327327
int i, n, m;
328328
ae_valign inu;
329329
ae_valign outu = AE_ZALIGN64();
@@ -387,12 +387,12 @@ static void vol_s16_to_s16(struct processing_module *mod, struct input_stream_bu
387387
struct vol_data *cd = module_get_private_data(mod);
388388
struct audio_stream *source = bsource->data;
389389
struct audio_stream *sink = bsink->data;
390-
ae_f32x2 volume0 = AE_ZERO32();
391-
ae_f32x2 volume1 = AE_ZERO32();
392-
ae_f32x2 out_sample0 = AE_ZERO32();
393-
ae_f32x2 out_sample1 = AE_ZERO32();
394-
ae_f16x4 in_sample = AE_ZERO16();
395-
ae_f16x4 out_sample = AE_ZERO16();
390+
ae_f32x2 volume0;
391+
ae_f32x2 volume1;
392+
ae_f32x2 out_sample0;
393+
ae_f32x2 out_sample1;
394+
ae_f16x4 in_sample;
395+
ae_f16x4 out_sample;
396396
int i, n, m, left;
397397
ae_f32x2 *buf;
398398
ae_f32x2 *buf_end;
@@ -529,7 +529,7 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod,
529529
struct vol_data *cd = module_get_private_data(mod);
530530
struct audio_stream *source = bsource->data;
531531
struct audio_stream *sink = bsink->data;
532-
ae_f16x4 in_sample = AE_ZERO16();
532+
ae_f16x4 in_sample;
533533
int i, n, m, left;
534534
ae_valign inu;
535535
ae_valign outu = AE_ZALIGN64();

0 commit comments

Comments
 (0)