[vorbis-dev] Small files encoding problem

J.W. Harris index at cox.net
Sun Jul 13 04:30:15 PDT 2003



> On Wednesday 02 July 2003 19:42, Rany. wrote:

> > I must compress some thousands of very small WAV samples. I
> > compressed them with OGG and got a very strange result:
> >
> > uncompressed WAV size is 1 kb,
> > and compressed OGG size is 3 kb.

On Thu, 3 Jul 2003, Michael Smith wrote:

> Yes, this is one downside of the vorbis bitstream format - it
> includes large headers (several kB).
>
> There may or may not be things you can do about this, depending on
> what you're using it for. If you want normal ogg files as output,
> then you're pretty much stuck - that's how the format works.
> However, if you're doing this for use in an application-specific
> way, and you have control over the application, there are several
> things you could do.
>
> The headers are the same every time (assuming you're using the same
> encoder with the same settings), so you could just save a single
> copy of the headers, then, on decoding, supply this header to the
> decoder along with the actual compressed data. Obviously, then, you
> don't have standard ogg files, but this is pretty easy to implement
> and use in some circumstances.

If the headers are the same every time, and you're just
trying to archive the sound files, then putting the .ogg
files into a .tar archive, then using bzip2 should work very
well.  So long as the uncompressed archive is smaller than
bzip2's block size (900kb), bzip2 will do an extremely good
job of compressing recurring patterns.  (Sometimes I've
ordered my .tar archives specifically to place several files
within 900kb of each other...)

Rany, I don't know what platform you're working on or what
your application is, but if you're using Vorbis (rather than
Ogg Vorbis) inside some other application, many people have
done something similar to Michael Smith's proposal for
various games.  If you have a similar app, I'm sure you can
ask and get more specific advice.

If you're doing something embedded, bzip2 or a naive
adaptation of it may be a poor choice -- bzip2 is a memory
hog.  See ( http://www.go.dlr.de/htbin/man?bzip2#toc4 ).

--J.W. Harris

--- >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