[vorbis-dev] Vorbis packet sizes
John Ripley
jripley at rioaudio.com
Thu Jun 5 16:31:16 PDT 2003
In reply to myself...
John Ripley wrote:
>
> The "unknown" and "arbitrary" upper bounds of Vorbis streams is something I
> don't particularly like. However, if you assumed stereo (I'm throwing away
> anything with more), 8192 block size, and worst case entropy (all codes are
> 32 bits), I bet it would still be reasonably small. I'll calculate this when
> I have some spare time.
I've just worked out the actual numbers. The maximum packet size given
the worst case number of mappings, partitions, no redundant
channel->submap mappings, but leaving block size, channels and codeword
size as variables is:
Intro:
9 bits for the packet intro (type, mode, previous/next flags)
Floor decode:
channels * (17 + 32 * codeword_size)
Residue decode:
9 * block_size * channels * codeword_size
I'll assume worst case codeword_size 32 bits (completely silly entropy),
and 2 channels.
For block_size = 2048, you need 1181739 bits, or 144.26KB.
For block_size = 8192, you need 4720683 bits, or 576.26KB.
>From an arbitrary file, codeword_size is roughly 4.5 bits on average,
which gives:
For block_size = 2048, 20.29KB.
For block_size = 8192, 81.04KB.
Totally useless numbers, but there you go :)
- John Ripley.
--- >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