[vorbis-dev] Re: lossless ogg encoding with good compression rate

Dimitry Andric dim at xs4all.nl
Wed Jun 25 18:41:52 PDT 2003


On 2003-06-26 at 02:40:30 General purpose mail wrote:

> 1) create a wav file [A.wav]:
> 2) encode it in ogg format (my best result with high 7) [B.ogg]
> 3) decode the ogg into a wav again [C.wav] (the size will be the same as A.wav)
> 4) create a file with the diff of each sample from A.wav
> with B.wav [D.tmp] also with the  same size at least of the
> header.
> 5) bzip2 the D.tmp [D.tmp.bz2]
> 6) keep B.ogg and D.tmp.bz2 (the size will be around 17% of the original for each file)

> simply is't it?

I'm afraid this will not work, except in some special cases. It's
probably best to go read some books on data compression and
information theory. ;)

For example:

1) I start with test.wav here (5:59.200/63,362,924 bytes). It's just a
music track, nothing weird.
2) Encoding to ogg with -q7 gives me test.ogg, 10,472,702 bytes.
3) Decoding this ogg gives me test2.wav, 63,362,924 bytes again.
4) I make a diff with Cool Edit, by mix pasting an inverted copy of
test2.wav into test.wav. This gives diff.wav, also 63,362,924 bytes.
5) However, compressing diff.wav with bzip2 -9, results in
diff.wav.bz2, which is 39,858,199 bytes, so only ~62.9% compression.
6) The end size is thus: 10,472,702 bytes ogg + 39,858,199 bytes bz2,
totaling 50,330,901 bytes, so ~79.4% compression.
7) This is much worse than FLAC, for example, which manages to
compress the original test.wav to 37,728,889 bytes, so ~59.5%
compression. Monkey's Audio even manages to get it to 34,971,640
bytes, so ~55.2% compression.

The problem is that you cannot guarantee that step 5) will compress
the diff so much. If it were so simple, I guess FLAC/APE/etc would
already be using this for a long time. :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: part
Type: application/pgp-signature
Size: 184 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20030626/8f144869/part.pgp


More information about the Vorbis-dev mailing list