resample: keep fractional part of in_rate when interpolating

When interpolating with rate correction != 1.0, don't floor the
resulting input rate to the nearest smallest integer.

This allows rate corrections < 1/in_rate to have some effect, and
reduces jumps in the response. One of the jumps is inconveniently
between rate=1.0 and rate=1.0+eps and will cause rate corrections to
oscillate if target rate varies close to 1.0.
This commit is contained in:
Pauli Virtanen 2025-07-27 01:49:34 +03:00 committed by Wim Taymans
parent 244d5a1cc1
commit 847982eb0e
2 changed files with 11 additions and 10 deletions

View file

@ -39,7 +39,7 @@ struct native_data {
double rate;
uint32_t n_taps;
uint32_t n_phases;
uint32_t in_rate;
struct fixp in_rate;
uint32_t out_rate;
struct fixp phase;
float pm;