MP3 and Ogg source material
The following encoded files all feature very low amplitude levels, to perform
dither tests. Wherever possible, lowering of the volume is done partially on
encoded signals or in the codec itself. This way, the 16 bit WAV signal
entering the codec has larger amplitude, so it's (lack of) dither and
nonlineairities don't obscure results.
1) hotel.mp3
Very low amplitude music. (-74dB compared to the source CD)
-CDrip using Exact audio copy
-Lower the WAV volume by -38dB using CoolEdit
-LAME 192JS MP3 encode
-MP3gain was used to lower the MP3 volume another -36 dB in 3 -12dB steps
2) hotel.ogg
Another piece of very low amplitude music. (-74dB)
-CDrip using exact audio copy
-Lowered the WAV volume by -34 dB using CoolEdit
-Encoder: oggdrop XPd V1.6.11e settings: Quality=4.99 1% scale factor (=40dB attenuation)
3) 2tone.mp3
This MP3 file features two low amplitude sine waves at -85 and -91 dB for
spectrum plots.
-Using cooledit a MP3 is made with two sines at -61 and -67 dB
-LAME 128Mono MP3 encode
-MP3gain was used to lower the MP3 volume -24 dB in 2 -12dB steps
Output WAVs
During tests, the encoded hotel.mp3 source files from above is decoded to wav
for several decoder setups. To get back to a normal volume level (the mp3 source file was attenuated 74dB) ,
the WAV files are amplified by the same amount of 74dB using cool-edit.
To minimize download times without obscuring results, these WAV files have been
losslessly encoded using FLAC.
http://flac.sourceforge.net
1) nodither.flac
Decoded by MPG123pre0.59s, using it's standard i586 assembler routine (make
linux-pentium)
Essentially, this is how 3 bit digital audio sounds without dither.
2) dithered.flac
Decoded by MPG123, using the modified i586 assembler routine.
For safety reasons, also a 15kHz low pass is applied, so there's no risk of
blowing your tweeters: The dither noise might have considerable HF-energy after
74dB (=5000x) attenuation.
3) nodither_mmx.flac
Decoded by standard MPG123, using the mmx assembler routine (make
linux-mmx). The output is so heavily distorted that the music is hardly
recognizable! Obvious, you're better off spending some extra cpu cycles on the
pentium routine.
The ogg test file gave very similar results with dither enabled/disabled so I
didn't place the results here (also to preserve bandwidth). Noteworthy however
the difference in mplayers ogg decoders:
The Tremor decoder features better LSB lineairity than the "classic"
floating point implementation.
Source Code
1) MPG123-pre0.59s
Dither routines are only implemented for pentium mode (make linux-pentium).
Replace decode_i586.s for the one in this
archive for noise shaped dither output mode.
For test purposes a wide band dither noise version is also available in this
archive.
2) Ogg123
Instead of mpg123, the ogg stuff is very modular and based on libraries. At the
moment I only have only a dithered version of outdated libvorbis1.0.1 lying
around. Replace vorbisfile by this version
to compile a dithered 1.0.1 version.
When there's demand for a dithered version of the latest libvorbis library, I'll
make one....
3) Mplayer
A patch is presented against daily CVS MPlayer-20050516.
First of all you need the dither table.
The ogg patch is pretty straightforward and can be downloaded here.
The mp3lib patch needs more comment: several files are patched just to force the
use of the pentium, not MMX, decoding routine. Also, if you apply this
patch without the ogg patch, uncomment the line
"#include "../dither.h" in decode_i586.c
More codecs in mplayer can be changed like this. Even lossless playback of FLAC using replaygain might benefit from dither.