diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-03-03 09:00:59 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-03-03 09:00:59 +0100 |
commit | 7fc78023587e6cb238d5fa16f5acafb4078c6798 (patch) | |
tree | bf3fbeaf97be6af55e1eb572b7a7420b0dc384e0 | |
parent | 2750062701e8dd84b78d8619f164769be7e0a5aa (diff) | |
download | plan9front-7fc78023587e6cb238d5fa16f5acafb4078c6798.tar.xz |
pcmconv: fix dither clipping
the check in dither() was inverted. we should only
add noise when the output bit count is greater
than input bit count (samples shifted up) to
fill the lower zero bits produced by the shift.
-rw-r--r-- | sys/src/cmd/audio/pcmconv/pcmconv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/cmd/audio/pcmconv/pcmconv.c b/sys/src/cmd/audio/pcmconv/pcmconv.c index f86bfa59a..0c9cba35c 100644 --- a/sys/src/cmd/audio/pcmconv/pcmconv.c +++ b/sys/src/cmd/audio/pcmconv/pcmconv.c @@ -209,7 +209,7 @@ dither(int *y, int ibits, int obits, int count) { static ulong prnd; - if(ibits >= 32 || obits >= ibits) + if(ibits >= 32 || ibits >= obits) return; while(count--){ |