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: Mixin_mixout: Add HiFi5 implementation. #8793

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

andrula-song
Copy link
Contributor

Add HiFi5 implementation of mix functions, compared with HiFi3 version, can reduce about 27% cycles.

@andrula-song
Copy link
Contributor Author

here is the xtensa simulator test result:
Screenshot from 2024-01-25 19-17-31
compared with the hifi3 version:
hifi5 implementation of mix_s16 can reduce about 26.3% cycles;
hifi5 implementation of mix_s24 can reduce about 27.8% cycles;
hifi5 implementation of mix_s32 can reduce about 29.9% cycles;

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.

LGTM. @singalsu ?
@andrula-song whats still pending for non draft ?

@andrula-song andrula-song marked this pull request as ready for review January 29, 2024 09:10
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Looks great @andrula-song ! You can update to the new-style HIFI ifdef @marc-hb and @btian1 added, but I'm ok to add this in a follow-up PR as well.

@andrula-song
Copy link
Contributor Author

Looks great @andrula-song ! You can update to the new-style HIFI ifdef @marc-hb and @btian1 added, but I'm ok to add this in a follow-up PR as well.

yeah, I would like to use a follow-up PR after #8791 merged.

@lgirdwood
Copy link
Member

@andrula-song can you check CI. Thanks

@andrula-song andrula-song marked this pull request as draft January 30, 2024 06:50
@lgirdwood
Copy link
Member

@andrula-song #8791 now merged, pls rebase.

Add HiFi5 implementation of mix functions, compared with
HiFi3 version, can reduce about 27% cycles.

Signed-off-by: Andrula Song <[email protected]>
@lgirdwood
Copy link
Member

@andrula-song ready ?
@singalsu pls review.

@andrula-song andrula-song marked this pull request as ready for review February 27, 2024 01:31
@andrula-song
Copy link
Contributor Author

hi @wszypelt , can you help to trigger the internal CI again? Seems failed on build.

AE_LA32X2X2_IP(in_sample, in_sample1, inu, in);
AE_LA32X2X2_IP(out_sample, out_sample1, outu1, out);
out--;
out_sample = AE_ADD24S(in_sample, out_sample);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Has this mix code been been verified? The ALSA S24_LE is aligned to least significant bits while ae_f24 in Xtensa is most significant bits aligned. In the past at least SOF was using the ALSA S24_LE. We used to have a mess with this and I'm no more sure if we have discarded the 24 bit ALSA format to be compatible with Windows OS's 24 bit format. Is the previous generic or HiFi3 mixing like this, if yes this would be OK. Changing 24 bit assumptions is another discussion and apparently we may support both in parts of code (cc @kv2019i ). But we should reject in prepare() unsupported 24 bit flavor.

Copy link
Member

Choose a reason for hiding this comment

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

ok - having a reject message would be fine here until support for both 24bit formats is upstream. This message and 24 bit support can be added incrementally though since this is good for testing now and passing CI.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I hope CI is testing the 24 bit case. Proposing to make another test patch that breaks mix_s24() function and see if it fails the CI run.

@lgirdwood lgirdwood merged commit 0b3b574 into thesofproject:main Feb 27, 2024
38 of 44 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