Comment 6 for bug 1639499

Revision history for this message
Daniel Schürmann (daschuer) wrote :

The relevant sox code is here:
https://sourceforge.net/p/sox/code/ci/master/tree/src/dither.c

Noise shaping would be a nice, but it requires significant more CPU, so it should be optional.

libav / ffmpeg has also a dither solution:
http://code.metager.de/source/xref/ffmpeg/libavresample/dither.c

This is the Portaudio Implementation:
https://github.com/EddieRingle/portaudio/blob/9eb5f0b3d820a81d385504d9c54534abbeea1099/src/common/pa_converters.c#L673
The issue with that is that the noise is calculated on the fly and the high pass to the noise is questionable.