Commit d2cbe459 authored by lu_zero's avatar lu_zero

Clarify

svn path=/trunk/vorbis/; revision=14214
parent c258da0a
......@@ -435,11 +435,33 @@ The RTP timestamp value MUST reflect the transmission time of the next data pack
A Vorbis Packed Configuration is indicated with the Vorbis Data Type field set
to 1. Of the three headers defined in the
<xref target="vorbis-spec-ref">Vorbis I specification</xref>, the
Identification and the Setup MUST be packed as they are, while the comment header MAY be replaced with a dummy one. The packed configuration follows a generic way to store Xiph codec configurations: The first field stores the number of the following packets minus one (count field), the next ones represent the size of the headers (length fields), the headers immediately follow the list of length fields. The size of the last header is implicit.
The count and the length fields are encoded using the following logic: the data is in network byte order, every byte has the most significant bit used as flag and the following 7 used to store the value. The first N bit are to be taken, where N is number of bits needed to represent the value, taken modulo 7, and stored in
the first byte.
If there are more bits, the flag bit is set to 1 and the subsequent 7bit are stored in the following byte, if there are remaining bits set the flag to 1 and the same procedure is repeated. The ending byte has the flag bit set to 0. In order to decode it is enough to iterate over the bytes until the flag bit set to 0, for every byte the data is added to the accumulated value multiplied by 128.
The headers are packed in the same order they are present in ogg: Identification, Comment, Setup.</t>
Identification and the Setup MUST be packed as they are, while the comment
header MAY be replaced with a dummy one.</t>
<t>
The packed configuration follows a generic way to store Xiph codec
configurations: The first field stores the number of the following packets
minus one (count field), the next ones represent the size of the headers
(length fields), the headers immediately follow the list of length fields.
The size of the last header is implicit.</t>
<t>
The count and the length fields are encoded using the following logic: the data
is in network byte order, every byte has the most significant bit used as flag
and the following 7 used to store the value.
The first N bit are to be taken, where N is number of bits needed to represent
the value, taken modulo 7, and stored in the first byte.
If there are more bits, the flag bit is set to 1 and the subsequent 7bit are
stored in the following byte, if there are remaining bits set the flag to 1 and
the same procedure is repeated.
The ending byte has the flag bit set to 0. In order to decode it is enough to
iterate over the bytes until the flag bit set to 0, for every byte the data is
added to the accumulated value multiplied by 128.</t>
<t>
The headers are packed in the same order they are present in ogg:
Identification, Comment, Setup.</t>
<t>
The 2 byte length tag defines the length of the packed headers as the sum of
the Configuration, Comment and Setup lengths.</t>
<figure anchor="Packed Configuration Figure" title="Packed Configuration Figure">
<artwork><![CDATA[
......@@ -526,11 +548,6 @@ payload for each chained Vorbis stream.
]]></artwork>
</figure>
<t>
Since the Configuration Ident and the Identification Header are fixed length
there is only a 2 byte length tag to define the length of the packed headers.
</t>
<figure anchor="Packed Headers Detail Figure" title="Packed Headers Detail">
<artwork><![CDATA[
0 1 2 3
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment