From 8767df4ec3bdf4adaf756378485b67520b14ff5e Mon Sep 17 00:00:00 2001 From: Shriram Shastry Date: Sun, 23 Jun 2024 19:46:50 +0530 Subject: [PATCH] Audio: Bugfix: Optimize level_update function by using int32_t Use int32_t instead of int64_t for the operation to improve performance. Signed-off-by: Shriram Shastry --- src/audio/tdfb/tdfb_direction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/tdfb/tdfb_direction.c b/src/audio/tdfb/tdfb_direction.c index 8bb87a973406..73617d144657 100644 --- a/src/audio/tdfb/tdfb_direction.c +++ b/src/audio/tdfb/tdfb_direction.c @@ -280,9 +280,9 @@ static void level_update(struct tdfb_comp_data *cd, int frames, int ch_count, in /* Calculate mean square level */ for (n = 0; n < frames; n++) { s = *p; + tmp += ((int32_t)s * s); p += ch_count; tdfb_cinc_s16(&p, cd->direction.d_end, cd->direction.d_size); - tmp += ((int64_t)s * s); } /* Calculate mean square power */