[vorbis-dev] comment field proposal

Daniel Phillips phillips at bonn-fries.net
Fri May 12 22:01:44 PDT 2000



On Fri, 12 May 2000, Monty wrote:
> Well, this is a bit stronger than a proposal...
> 
> ...the length of each vector is limited to 2^32 bytes...

You may have meant 2^32-1, assuming 0 is a valid length which it probably
ought to be, allowing a user to make positional assignments within the comment
vector, leaving some comments null.

I have used a counted-string format in the past where the count is variable
length, something like UTF-8.  If the count is encoded in N bytes, the high
N-1 bits of the leading byte are 1, the next bit is 0, and the count is encoded
in the remaining bits plus the following N-1 bytes, with the Nth byte being the
LSB of the count.  This has the pleasing result that almost all counts are just
a single byte.

It takes only a tiny amount of code to encode and decode this format and this
just seems like a nice thing to do for a format whose whole raison d'etre is,
after all compression.

Another nice effect is to eliminate endedness considerations, at least in this
one place.

On the other hand, and inconsistently, I'd think that compressing the text
fields would be an unecessarily awkwardness.


-- 
Daniel

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/




More information about the Vorbis-dev mailing list