Tomas Ogren
2003-Feb-02 19:09 UTC
[vorbis-dev] Observations about the floating point data in vorbisfile
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.
I've made some plots of encoding the start of Rammsteins Feuer from the
xXx soundtrack (it's a pretty loud soundtrack, but max is still max.. ).
http://www.ing.umu.se/~stric/tmp/vorbis/
These are plots of data read with ov_read_file, printf()'d and fed into
gnuplot. The x axis is sample number, counting from sample 900k
(left,right,left,right,...)
Looking at ov_read(), it clips the data to [-1..1], but I have encoded
files where samples go up to 1.45 which I suppose isn't right.
Both 1.0 and 1.0rc3 show similar stuff.
/Tomas
--
Tomas Ögren, stric@ing.umu.se, http://www.ing.umu.se/~stric/
|- Student at Computing Science, University of Umeå
`- Sysadmin at {cs,ing,acc}.umu.se
--- >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@xiph.org'
containing only the word 'unsubscribe' in the body. No subject is
needed.
Unsubscribe messages sent to the list will be ignored/filtered.
Michael Smith
2003-Feb-02 19:57 UTC
[vorbis-dev] Observations about the floating point data in vorbisfile
Tomas Ogren <stric@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 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. Mike --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.