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

Mess with BRR decoding for hopefully the last time #45

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

PhoenixBound
Copy link
Collaborator

  • Finally use the BRR filter formulas provided in fullsnes, instead of ones that approximate the exact rounding. For some very short, unstable samples, this has been shown to result in a completely different sound.
  • Up the max iteration count for samples, since 64 doesn't cut it anymore (and didn't really work for many non-EarthBound games, before this change).
  • Don't override the range to 0 for the first block of a sample, since homebrew non-glitch samples may store something other than silence in the first block.
  • In anticipation of one day turning on UBSan, get rid of a left shift of a potentially negative number, and turn it into a multiplication. A left shift like this is undefined behavior in C (but not C++). gcc 13 seems to optimize the "* (1 << n)" pattern when UBSan is on just fine.

* Finally give in and use the filter formulas provided in fullsnes. For
  some very short, unstable samples, this has been shown to result in a
  completely different sound.
* Up the max iteration count for samples, since 64 doesn't cut it
  anymore (and didn't really work for many non-EarthBound games, before
  this change).
* Don't override the range to 0 for the first block of a sample, since
  homebrew non-glitch samples may store something other than silence in
  the first block.
* In anticipation of one day turning on UBSan, get rid of a left shift
  of a potentially negative number, and turn it into a multiplication.
  This is undefined behavior in C (but not C++). gcc 13 doesn't seem to
  recognize the "* (1 << n)" pattern when UBSan is on, unfortunately...
@ChrisBlueStone ChrisBlueStone merged commit ff86770 into PKHackers:master Jul 10, 2023
@PhoenixBound PhoenixBound deleted the better_filters branch July 10, 2023 02:07
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.

2 participants