shithub: riscv

Download patch

ref: 7fc78023587e6cb238d5fa16f5acafb4078c6798
parent: 2750062701e8dd84b78d8619f164769be7e0a5aa
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Mar 3 04:00:59 EST 2014

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.

--- a/sys/src/cmd/audio/pcmconv/pcmconv.c
+++ b/sys/src/cmd/audio/pcmconv/pcmconv.c
@@ -209,7 +209,7 @@
 {
 	static ulong prnd;
 
-	if(ibits >= 32 || obits >= ibits)
+	if(ibits >= 32 || ibits >= obits)
 		return;
 
 	while(count--){