mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04: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
|
|
@ -394,7 +394,10 @@ int convert_init(struct convert *conv)
|
|||
const struct conv_info *info;
|
||||
uint32_t i, dither_flags;
|
||||
|
||||
conv->scale = 1.0f / (float)(INT32_MAX >> conv->noise);
|
||||
conv->scale = 1.0f / (float)(INT32_MAX);
|
||||
|
||||
if (conv->noise > 0)
|
||||
conv->scale *= (1 << (conv->noise + 1));
|
||||
|
||||
/* disable dither if not needed */
|
||||
if (!need_dither(conv->dst_fmt))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue