Skip to content

Speed up kaiser_hq resampler and fix onset/beat tracker parity#4

Closed
olilarkin wants to merge 4 commits into
mainfrom
perf/beat-kaiser-hq-speedup
Closed

Speed up kaiser_hq resampler and fix onset/beat tracker parity#4
olilarkin wants to merge 4 commits into
mainfrom
perf/beat-kaiser-hq-speedup

Conversation

@olilarkin
Copy link
Copy Markdown
Owner

35x speed up.
kaiser_hq is still not matching soxr_hq and is the source of some disparities

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21c82eedcd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/beat.cpp Outdated
Comment on lines +307 to +308
Eigen::Index k_stop = std::min<Eigen::Index>(
i + half_window, window_size);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include the zero-frame convolution tap

When the convolution window overlaps frame 0, this exclusive upper bound omits k == i + half_window, which is exactly the tap for onset_envelope(0). For any onset envelope with energy at the first frame, the optimized loop now drops that contribution from every affected local score (at i == 0 it also drops the center tap), whereas the previous validity-checked loop included it; the bound should allow one more element.

Useful? React with 👍 / 👎.

Comment thread src/beat.cpp
Comment on lines +473 to +476
Eigen::Index n = 0;
while (n < localscore.size() && localscore(n) <= threshold) {
trimmed[static_cast<size_t>(n)] = false;
++n;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Trim beats in beat coordinates

This leading trim now scans every frame's localscore and stops on the first above-threshold frame, even if that frame is not a selected beat. If a strong non-beat onset occurs before a weak first beat, the loop exits early and leaves that weak leading beat untrimmed (with the analogous issue at the tail); trimming should be driven by the ordered selected beat scores/indices rather than arbitrary intervening frames.

Useful? React with 👍 / 👎.

@olilarkin olilarkin closed this May 30, 2026
@olilarkin olilarkin deleted the perf/beat-kaiser-hq-speedup branch May 30, 2026 09:22
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.

1 participant