audioconvert: improve setup of quantization

Use the quantize value to specify how many bits to quantize to.
This commit is contained in:
Wim Taymans 2022-06-27 20:02:40 +02:00
parent 916050aacd
commit 67c2202044
3 changed files with 7 additions and 7 deletions

View file

@ -79,10 +79,10 @@ int dither_init(struct dither *d)
if (info == NULL)
return -ENOTSUP;
if (d->intensity >= 32)
if (d->quantize >= 32)
return -EINVAL;
d->scale = 1.0f / (1ULL << (31 + d->intensity));
d->scale = 1.0f / (1ULL << (63 - d->quantize));
d->dither_size = DITHER_SIZE;
d->dither = calloc(d->dither_size + DITHER_OPS_MAX_OVERREAD +