[xiph-rtp] Updated revision vorbis-rtp

Ralph Giles giles at xiph.org
Mon May 7 14:43:36 PDT 2007


On Sat, May 05, 2007 at 04:45:52PM +0200, Luca Barbato wrote:

> The current mechanism in place in ffmpeg/nut and mkv should be flexible
> enough to fit your requests and probably makes the life of implementors
> easier since they'd have just to pass the decoded blob to their routines
> w/out having to parse and reformat.

I guess I don't like using the lacing method (quasi-unary encoding of 
the length). It has its place in Ogg, but it's quite inefficient in
something like a length field. I prefer the old fixed-width 16-bit field 
to that .

What I was proposing was:

a = readbyte(stream);
length = a & 0x7f;
bytes = 1;
while ((a & 0x80) && (bytes < 8)) {
  a = readbyte(stream)
  length = (length << 7) | (a & 0x7f);
  bytes += 1;
}

examples:
0 -> 00
1 -> 01
 ...
127 -> 7f
128 -> 81 00
129 -> 81 01
 ...
4100 -> 90 04

and so on.

 -r


More information about the xiph-rtp mailing list