mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
audioconvert: fix dither scale
Rectangular dither should be [-0.5, 0.5] Triangular dither should be [-1.0, 1.0] Noise should add extra bits.
This commit is contained in:
parent
e313149f7f
commit
68f883ff77
4 changed files with 23 additions and 3 deletions
|
|
@ -237,6 +237,7 @@ static inline void update_dither_c(struct convert *conv, uint32_t n_samples)
|
|||
uint32_t *state = &conv->random[0];
|
||||
|
||||
if (conv->method < DITHER_METHOD_TRIANGULAR) {
|
||||
scale *= 0.5f;
|
||||
for (n = 0; n < n_samples; n++)
|
||||
dither[n] = lcnoise(state) * scale;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue