summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-03-03 09:00:59 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-03-03 09:00:59 +0100
commit7fc78023587e6cb238d5fa16f5acafb4078c6798 (patch)
treebf3fbeaf97be6af55e1eb572b7a7420b0dc384e0
parent2750062701e8dd84b78d8619f164769be7e0a5aa (diff)
downloadplan9front-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.c2
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--){