git: 9front

Download patch

ref: 413d65e4bb9d9189792f6a86dadd87939a68890d
parent: a4a412e4dda8e56bdcf820bf94a18e7b5f6968ec
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--){
--