[vorbis-dev] Observations about the floating point data in vorbisfile

Beni Cherniavsky cben at techunix.technion.ac.il
Tue Feb 4 13:38:46 PST 2003

On 2003-02-04, Segher Boessenkool wrote:

> Michael Smith wrote:
> > Tomas Ogren <stric at ing.umu.se> said:
> >
> >>Hello.
> >>
> >>I noticed that when reading data with ov_read_float(), you can get
> >>values outside [-1..1] when the stream is encoded at lower quality, but
> >>with higher quality, the values trim down to inside [-1..1].
> >>Looking at the plot from -q10, the data from ov_read_float seems
> >>clipped.
> >
> > This is correct. As a lossy codec, vorbis does not guarantee that the output
> > will be the same as the input (obviously) - and part of that is that the
> Not all lossy codecs have overshoot.  It would be really great
> if Vorbis could deal with this (yes, I know it's a hard problem).
The other ones should be called "strictly amplitude-lossy", I presume? :-)

More seriously, how do they solve this?  Detect the case and locally
attenuate?  I can't think of something that will be better than applying a
limiter in the decoder, which has the benefit of allowing experimentation
and avoiding the distortion alogether when decoding to lower volume...

> > approximations may produce out of range output. ov_read() performs clipping,
> > as you noted, in order to deal with this. If you use ov_read_float(), it's up
> > to you to deal with the values produced appropriately.
> >
> > This problem generally only happens (at least in ways that matter - i.e. could
> > be audible) with peak-to-peak inputs, which are a bad idea anyway.
> Why are full-range inputs a bad idea?
Because of they are not handled <wink>.

Beni Cherniavsky <cben at tx.technion.ac.il>

If somebody builds a time machine he can gateway the Internet to itself
with a time offset.  I wonder what implications that would have...
--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.

More information about the Vorbis-dev mailing list