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

ipc4: mixin: Add "mix with gain" HiFi5 impl #9795

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

serhiy-katsyuba-intel
Copy link
Contributor

  • Adds HiFi5 implementation of "mix with gain" functions.

  • Adds sign-extension to HiFi5 implementation of 24-bit mixing (similarly as it was done recently for HiFi3).
    AE_ADD24S() expects input arguments to be Q9.23 values. Therefore, negative 24-bit values in a 32-bit container should have their sign extended to the upper 8 bits. Our other implementations of 24-bit mixing all perform sign extension prior to mixing and do not rely on samples being already sign-extended.

  • Fixes to HiFi5 implementation of mix functions and correcting comments.

Corrections to misleading comments in the HiFi3 implementation of mixin.

Signed-off-by: Serhiy Katsyuba <[email protected]>
Fixes HiFi5 impl of mix_s24() and mix_s32().

Signed-off-by: Serhiy Katsyuba <[email protected]>
AE_ADD24S() expects input arguments to be Q9.23 values. Therefore,
negative 24-bit values in a 32-bit container should have their sign
extended to the upper 8 bits. Our other implementations of 24-bit mixing
all perform sign extension prior to mixing and do not rely on samples
being already sign-extended.

Signed-off-by: Serhiy Katsyuba <[email protected]>
Adds HiFi5 implementation of "mix with gain" functions.

Signed-off-by: Serhiy Katsyuba <[email protected]>
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.

Can your check my comments, not 100% sure but I recall those operations are not needed.

/* cir_buf_wrap() is required and is done below in a loop */
ae_int16 *dst = (ae_int16 *)sink->ptr + start_sample;
ae_int16 *src = source->ptr;
ae_f16x4 gain_vec;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I'd arrange the variables with ae types first, from largest (128 bits) to smallest.

ae_int16x4 out_sample, out_sample1;
ae_int16x8 *in;
ae_int16x8 *out;
ae_valignx2 inu = AE_ZALIGN128();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think you need to initialize align register for reads (inu and outu1).

ae_int32x2 out_sample, out_sample1;
ae_int32x4 *in;
ae_int32x4 *out;
ae_valignx2 inu = AE_ZALIGN128();
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

ae_int32x2 out_sample, out_sample1;
ae_int32x4 *in;
ae_int32x4 *out;
ae_valignx2 inu = AE_ZALIGN128();
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

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