Skip to content

Commit

Permalink
Audio: Bugfix: Optimize level_update function by using int32_t
Browse files Browse the repository at this point in the history
Use int32_t instead of int64_t for the operation to improve
performance.

Signed-off-by: Shriram Shastry <[email protected]>
  • Loading branch information
ShriramShastry committed Jun 23, 2024
1 parent 8adadca commit 8767df4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/audio/tdfb/tdfb_direction.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 8767df4

Please sign in to comment.