Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio: Optimize division by speed of sound using fixed-point reciprocal #9160

Conversation

ShriramShastry
Copy link
Contributor

This commit optimizes the division by the speed of sound in the theoretical_time_differences function. By precomputing the fixed-point reciprocal of the speed of sound, we eliminate the need for a costly division operation in each iteration.

@ShriramShastry
Copy link
Contributor Author

SOFCI

@singalsu
Copy link
Collaborator

Thanks @ShriramShastry , this saves 1.4 MCPS with 4ch beamformer in TGL platform. I'll review this PR later.

@ShriramShastry ShriramShastry marked this pull request as ready for review May 23, 2024 16:23
@ShriramShastry ShriramShastry force-pushed the shastry_perf_inv_sound_speed_optimization branch 3 times, most recently from 09f83ff to 0a29b59 Compare May 27, 2024 07:02
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one @ShriramShastry !

@ShriramShastry ShriramShastry force-pushed the shastry_perf_inv_sound_speed_optimization branch from 0a29b59 to 849bce3 Compare June 11, 2024 15:21
@ShriramShastry ShriramShastry requested a review from singalsu June 11, 2024 15:30
@ShriramShastry ShriramShastry force-pushed the shastry_perf_inv_sound_speed_optimization branch from 849bce3 to ef64f75 Compare June 13, 2024 15:45
Copy link
Collaborator

@singalsu singalsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code works correctly, checked with direction_test.m but need to reject due to mistakes in comments, sorry! Can you please fix. This is a quick approve after done.

@ShriramShastry ShriramShastry force-pushed the shastry_perf_inv_sound_speed_optimization branch from ef64f75 to 9186364 Compare June 17, 2024 14:36
@kv2019i
Copy link
Collaborator

kv2019i commented Jun 20, 2024

Ready to merge, pending the mandatory CI to pass.

This commit optimizes the division by the speed of sound in the
`theoretical_time_differences` function. By precomputing the fixed-point
reciprocal of the speed of sound, we eliminate the need for a costly
division operation in each iteration.

Additionally, a redundant 'if' statement is removed from the
'tdfb_direction_copy_emphasis' function, simplifying the code.

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
@ShriramShastry ShriramShastry force-pushed the shastry_perf_inv_sound_speed_optimization branch from 9186364 to b39cd56 Compare June 23, 2024 16:51
@lgirdwood
Copy link
Member

@wszypelt looks like CI has been pending a while. Good to merge ?

@lgirdwood lgirdwood added this to the v2.11 milestone Jun 25, 2024
@wszypelt
Copy link

@lgirdwood good to merge :)

@lgirdwood lgirdwood merged commit b12b69f into thesofproject:main Jun 26, 2024
43 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants