-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
Refactor waveform aligner and add test #766
Refactor waveform aligner and add test #766
Conversation
a2f695d
to
086aa37
Compare
{ | ||
errorSum += std::abs((newWaveformMips[octave][i + sample] - m_oldWaveformMips[octave][i + sample]) * m_aligmentWeights[octave][i]); | ||
errorSum += std::abs((newWaveformMips[octave][i + offset] - m_oldWaveformMips[octave][i]) * m_aligmentWeights[octave][i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix 1.
|
||
// Store mip levels for the next frame. Note that we need to recalculate the mips for the *shifted* | ||
// waveform, so we can't reuse the previous mips. | ||
ResampleOctaves(m_oldWaveformMips, newWaveform); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please split the individual changes into separate commits: one for the reformatting, one for each fix and one for the tests. This will make it easier to review and later much easier to see what was fixed where and why, without the need to dig up this PR.
If possible, add the reasoning for each change as mentioned in the PR into the respective commit messages.
086aa37
to
e81fe7f
Compare
I split the commit into several pieces that should be much easier to review. I've explained what's changing in each commit. The commit that splits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides ideally running clang-format on the changed files before each commit, it looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean and well tested! If you're ready, I could merge at any time.
d1f46d1
to
c5ecad0
Compare
This PR adds a friend test for WaveformAligner that verifies a few internal implementation details as well as verifying proper alignment for waveforms with supported offsets.
This PR also refactors WaveformAligner for readability and fixes two bugs: