[gst-devel] mad decoder plugin : only 16bit audio, and no dither

Benjamin Otte in7y118 at public.uni-hamburg.de
Sun Jun 27 19:02:04 CEST 2004

On Wed, 23 Jun 2004, Samuel Krempp wrote:

> 1. 16bit audio raw data seems to be the norm.
First of all GStreamer can do pretty much anything you want it to. The
hard part is getting it to do it. Since most of the GStreamer developers
have a focus on pure media playback or processing, it shouldn't come as a
surprise that the plugins focus on that. And since most files are encoded
as 16bit or the soundcards don't take more, we never bothered.
If some pro audio enthusiasts pick up and improve the elements they need,
it's greatly appreciated. It just hasn't been a priority for me.

> But then gstreamer's mad decoder plugin also forces 16 bit output.
> Why is that ?
> The mad decoder library takes great care to decode the mp3 bitstream
> with 32 bits precision, that's a waste not to use it.
As Ronald said: oversight when doing the transition from 0.6 - vorbis uses
its native float format right now. So mad should probably do so, too.

> 2. no dither
> looking at the mad decoder plugin, the 32 bits samples are simply
> rounded into 16bit ints.
> That's simply a mistake, from a signal theory point of view.
> Reduction of bitdepth should be done only with a proper dither applied
> (to make the quantization linear, in average).
> The scale function in gstmad.c should include a dither step (just as the
> minimad.c MAD usage sample from where it was taken suggests)
> There are free C implementations of good random number generators (eg
> mersenne twisters) around, so the only difficulty here is to understand
> what dither is, and what amplitude of noise should be added.
> (I can provide a simple dither.c with mersenne-twister and ready-to-use
> dither function if needed).
See above. We're all no pro-audio enthusiasts, so haven't bothered. Audio
transformations are currently done in the audioconvert plugin. It's a
simple-and-easy-as-possible implementation without thinking 1 second about
how to keep the noise down. Feel free to send patches that improve the

> dither is an important part of digital audio, that's a fact.
> This is my first contact with gstreamer, so I might be speaking
> nonsense, but at first glance, gstreamer's handling of audio seems a bit
> gauche.


More information about the gstreamer-devel mailing list