[Audacity-devel] Bug 200: Rounding error in Dither.cpp
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Matt B. <mbr...@cs...> - 2004-11-26 17:27:22
|
Markus Kuhn pointed out a problem in Dither.cpp that causes noise to be introduced in conversion from 16 bits to 32 bits and back even when dithering is turned off. He also suggested a fix. Can someone with floating-point conversion knowledge review this patch? http://audacity.sourceforge.net/cgi-bin/bugzilla/show_bug.cgi?id=200 I've verified that it works with the testcase, but I'm worried that it may cause problems when dithering is turned on, or in other situations. (For example, won't PROMOTE_TO_INT16(1.0f) cause overflow now?) If this patch isn't correct, what's a better way to fix this problem? |