mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
smoother: avoid losing precision
Avoid losing precision by subtracting uint64 values before converting them to doubles.
This commit is contained in:
parent
a65825fa45
commit
3d9b710bea
1 changed files with 1 additions and 3 deletions
|
|
@ -313,10 +313,8 @@ static void estimate(pa_smoother *s, pa_usec_t x, pa_usec_t *y, double *deriv) {
|
|||
|
||||
calc_abc(s);
|
||||
|
||||
tx = (double) x;
|
||||
|
||||
/* Move to origin */
|
||||
tx -= (double) s->ex;
|
||||
tx = (double) (x - s->ex);
|
||||
|
||||
/* Horner scheme */
|
||||
ty = (tx * (s->c + tx * (s->b + tx * s->a)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue