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

[BUGFIX] Make LanczosResampler's hard-coded buffer size more conservative #9

Merged
merged 1 commit into from
Jan 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dsp/ResamplingContainer/Dependencies/LanczosResampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ class LanczosResampler

// The buffer size. This needs to be at least as large as the largest block of samples
// that the input side will see.
static constexpr size_t kBufferSize = 4096;
// WARNING: hard-coded to accommodate 8192 samples, from 44.1 to 192k!
// If someone is past this, then maybe they know what they're doing ;)
// (size_t)(8192 * 3 * 192000 / 44100)+1 = 106998
static constexpr size_t kBufferSize = 131072; // Round up to pow2. I don't know why, but it doesn't work otherwise.
// The filter width. 2x because the filter goes from -A to A
static constexpr size_t kFilterWidth = A * 2;
// The discretization resolution for the filter table.
Expand Down