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

re-add custom core-audio truncation after syncing fork #3

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

lkotsonis
Copy link

@lkotsonis lkotsonis commented Nov 20, 2024

No description provided.

@lkotsonis lkotsonis requested a review from dgrahelj November 20, 2024 15:57
Copy link

@dgrahelj dgrahelj left a comment

Choose a reason for hiding this comment

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

I didn't know this was still used. Does any part of our stack still require bitperfect float<->int conversions?

@lkotsonis
Copy link
Author

lkotsonis commented Nov 20, 2024

I didn't know this was still used. Does any part of our stack still require bitperfect float<->int conversions?

I guess the question is if any part uses CoreAudio conversions... @wiccy46 are we doing any audio tests using CoreAudio/mac devices?

Copy link

@actondev actondev left a comment

Choose a reason for hiding this comment

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

nit: std::clamp to all max(.., min(..))

// Use llround() which returns `long long` which is guaranteed to be at least 64 bits.
out[info.outOffset[j]] = (Int32) std::max(std::min(std::llround(in[info.inOffset[j]] * 2147483648.f), 2147483647LL), -2147483648LL);
long long value = in[info.inOffset[j]] * 2147483648LL;
out[info.outOffset[j]] = std::max(-2147483648LL, std::min(value, 2147483647LL));

Choose a reason for hiding this comment

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

nit: std::clamp

@lkotsonis lkotsonis merged commit d901c0e into master Dec 3, 2024
24 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.

3 participants