Skip to content

Commit

Permalink
Refactor: Remove redundancy and adjust data type in level update
Browse files Browse the repository at this point in the history
Removed redundant assignment in the level update loop.
Confirmed integer type adjustment to fit the int32_t type in the loop.

Signed-off-by: Shriram Shastry <[email protected]>
  • Loading branch information
ShriramShastry committed Jun 21, 2024
1 parent 4cf77dd commit 136faf7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/audio/tdfb/tdfb_direction.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ 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); /* use int32_t */
p += ch_count;
tdfb_cinc_s16(&p, cd->direction.d_end, cd->direction.d_size);
tmp += ((int64_t)s * s);
Expand Down

0 comments on commit 136faf7

Please sign in to comment.