mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
resample: optimize phase scaling
Precalculate the constant factor to avoid a division for each sample.
This commit is contained in:
parent
b52c490709
commit
0b0912cc5b
2 changed files with 7 additions and 6 deletions
|
|
@ -388,6 +388,7 @@ int resample_native_init(struct resample *r)
|
|||
d->in_rate = in_rate;
|
||||
d->out_rate = out_rate;
|
||||
d->gcd = gcd;
|
||||
d->pm = (float)n_phases / r->o_rate;
|
||||
d->filter = SPA_PTROFF_ALIGN(d, sizeof(struct native_data), 64, float);
|
||||
d->hist_mem = SPA_PTROFF_ALIGN(d->filter, filter_size, 64, float);
|
||||
d->history = SPA_PTROFF(d->hist_mem, history_size, float*);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue