Commit ab9ee4a0 authored by Monty's avatar Monty
Browse files

More underscore cleanups; it appears that \usepackage{underscore} in

unreliable in several environments like \mathtt and \emph


svn path=/trunk/vorbis/; revision=18067
parent 228e3c57
......@@ -517,7 +517,7 @@ transform orthogonality. Pay attention however to returning the
correct data range; the amount of data to be returned is:
\begin{Verbatim}[commandchars=\\\{\}]
window_blocksize(previous_window)/4+window_blocksize(current_window)/4
window\_blocksize(previous\_window)/4+window\_blocksize(current\_window)/4
\end{Verbatim}
from the center of the previous window to the center of the current
......
......@@ -41,16 +41,16 @@ byte 1: [ 0 1 0 0 0 0 1 1 ] (0x43)
byte 2: [ 0 1 0 1 0 1 1 0 ] (0x56)
\end{Verbatim}
16 bit \varname{[codebook_dimensions]} and 24 bit \varname{[codebook_entries]} fields:
16 bit \varname{[codebook\_dimensions]} and 24 bit \varname{[codebook\_entries]} fields:
\begin{Verbatim}[commandchars=\\\{\}]
byte 3: [ X X X X X X X X ]
byte 4: [ X X X X X X X X ] [codebook_dimensions] (16 bit unsigned)
byte 4: [ X X X X X X X X ] [codebook\_dimensions] (16 bit unsigned)
byte 5: [ X X X X X X X X ]
byte 6: [ X X X X X X X X ]
byte 7: [ X X X X X X X X ] [codebook_entries] (24 bit unsigned)
byte 7: [ X X X X X X X X ] [codebook\_entries] (24 bit unsigned)
\end{Verbatim}
......@@ -63,9 +63,9 @@ byte 8: [ X ] [ordered] (1 bit)
\end{Verbatim}
Each entry, numbering a
total of \varname{[codebook_entries]}, is assigned a codeword length.
total of \varname{[codebook\_entries]}, is assigned a codeword length.
We now read the list of codeword lengths and store these lengths in
the array \varname{[codebook_codeword_lengths]}. Decode of lengths is
the array \varname{[codebook\_codeword\_lengths]}. Decode of lengths is
according to whether the \varname{[ordered]} flag is set or unset.
\begin{itemize}
......@@ -83,7 +83,7 @@ according to whether the \varname{[ordered]} flag is set or unset.
byte 8: [ X 1 ] [sparse] flag (1 bit)
\end{Verbatim}
The decoder now performs for each of the \varname{[codebook_entries]}
The decoder now performs for each of the \varname{[codebook\_entries]}
codebook entries:
\begin{Verbatim}[commandchars=\\\{\}]
......@@ -118,16 +118,16 @@ byte 8: [ X 1 ] [sparse] flag (1 bit)
codewords per length. That is, beginning at entry zero:
\begin{Verbatim}[commandchars=\\\{\}]
1) [current_entry] = 0;
2) [current_length] = read a five bit unsigned integer and add 1;
3) [number] = read \link{vorbis:spec:ilog}{ilog}([codebook_entries] - [current_entry]) bits as an unsigned integer
4) set the entries [current_entry] through [current_entry]+[number]-1, inclusive,
of the [codebook_codeword_lengths] array to [current_length]
5) set [current_entry] to [number] + [current_entry]
6) increment [current_length] by 1
7) if [current_entry] is greater than [codebook_entries] ERROR CONDITION;
1) [current\_entry] = 0;
2) [current\_length] = read a five bit unsigned integer and add 1;
3) [number] = read \link{vorbis:spec:ilog}{ilog}([codebook\_entries] - [current\_entry]) bits as an unsigned integer
4) set the entries [current\_entry] through [current\_entry]+[number]-1, inclusive,
of the [codebook\_codeword\_lengths] array to [current\_length]
5) set [current\_entry] to [number] + [current\_entry]
6) increment [current\_length] by 1
7) if [current\_entry] is greater than [codebook\_entries] ERROR CONDITION;
the decoder will not be able to read this stream.
8) if [current_entry] is less than [codebook_entries], repeat process starting at 3)
8) if [current\_entry] is less than [codebook\_entries], repeat process starting at 3)
9) done.
\end{Verbatim}
......@@ -148,10 +148,10 @@ VQ)
The lookup table type is read as a four bit unsigned integer:
\begin{Verbatim}[commandchars=\\\{\}]
1) [codebook_lookup_type] = read four bits as an unsigned integer
1) [codebook\_lookup\_type] = read four bits as an unsigned integer
\end{Verbatim}
Codebook decode precedes according to \varname{[codebook_lookup_type]}:
Codebook decode precedes according to \varname{[codebook\_lookup\_type]}:
\begin{itemize}
\item
Lookup type zero indicates no lookup to be read. Proceed past
......@@ -160,32 +160,32 @@ lookup decode.
Lookup types one and two are similar, differing only in the
number of lookup values to be read. Lookup type one reads a list of
values that are permuted in a set pattern to build a list of vectors,
each vector of order \varname{[codebook_dimensions]} scalars. Lookup
each vector of order \varname{[codebook\_dimensions]} scalars. Lookup
type two builds the same vector list, but reads each scalar for each
vector explicitly, rather than building vectors from a smaller list of
possible scalar values. Lookup decode proceeds as follows:
\begin{Verbatim}[commandchars=\\\{\}]
1) [codebook_minimum_value] = \link{vorbis:spec:float32:unpack}{float32_unpack}( read 32 bits as an unsigned integer)
2) [codebook_delta_value] = \link{vorbis:spec:float32:unpack}{float32_unpack}( read 32 bits as an unsigned integer)
3) [codebook_value_bits] = read 4 bits as an unsigned integer and add 1
4) [codebook_sequence_p] = read 1 bit as a boolean flag
1) [codebook\_minimum\_value] = \link{vorbis:spec:float32:unpack}{float32\_unpack}( read 32 bits as an unsigned integer)
2) [codebook\_delta\_value] = \link{vorbis:spec:float32:unpack}{float32\_unpack}( read 32 bits as an unsigned integer)
3) [codebook\_value\_bits] = read 4 bits as an unsigned integer and add 1
4) [codebook\_sequence\_p] = read 1 bit as a boolean flag
if ( [codebook_lookup_type] is 1 ) \{
if ( [codebook\_lookup\_type] is 1 ) \{
5) [codebook_lookup_values] = \link{vorbis:spec:lookup1:values}{lookup1_values}(\varname{[codebook_entries]}, \varname{[codebook_dimensions]} )
5) [codebook\_lookup\_values] = \link{vorbis:spec:lookup1:values}{lookup1\_values}(\varname{[codebook\_entries]}, \varname{[codebook\_dimensions]} )
\} else \{
6) [codebook_lookup_values] = \varname{[codebook_entries]} * \varname{[codebook_dimensions]}
6) [codebook\_lookup\_values] = \varname{[codebook\_entries]} * \varname{[codebook\_dimensions]}
\}
7) read a total of [codebook_lookup_values] unsigned integers of [codebook_value_bits] each;
store these in order in the array [codebook_multiplicands]
7) read a total of [codebook\_lookup\_values] unsigned integers of [codebook\_value\_bits] each;
store these in order in the array [codebook\_multiplicands]
\end{Verbatim}
\item
A \varname{[codebook_lookup_type]} of greater than two is reserved
A \varname{[codebook\_lookup\_type]} of greater than two is reserved
and indicates a stream that is not decodable by the specification in this
document.
......@@ -197,8 +197,8 @@ considered an error condition rendering the stream undecodable.
\paragraph{Huffman decision tree representation}
The \varname{[codebook_codeword_lengths]} array and
\varname{[codebook_entries]} value uniquely define the Huffman decision
The \varname{[codebook\_codeword\_lengths]} array and
\varname{[codebook\_entries]} value uniquely define the Huffman decision
tree used for entropy decoding.
Briefly, each used codebook entry (recall that length-unordered
......@@ -282,20 +282,20 @@ decode to that entry number.
Unpacking the VQ lookup table vectors relies on the following values:
\begin{programlisting}
the [codebook_multiplicands] array
[codebook_minimum_value]
[codebook_delta_value]
[codebook_sequence_p]
[codebook_lookup_type]
[codebook_entries]
[codebook_dimensions]
[codebook_lookup_values]
the [codebook\_multiplicands] array
[codebook\_minimum\_value]
[codebook\_delta\_value]
[codebook\_sequence\_p]
[codebook\_lookup\_type]
[codebook\_entries]
[codebook\_dimensions]
[codebook\_lookup\_values]
\end{programlisting}
\bigskip
Decoding (unpacking) a specific vector in the vector lookup table
proceeds according to \varname{[codebook_lookup_type]}. The unpacked
proceeds according to \varname{[codebook\_lookup\_type]}. The unpacked
vector values are what a codebook would return during audio packet
decode in a VQ context.
......@@ -304,25 +304,25 @@ decode in a VQ context.
Lookup type one specifies a lattice VQ lookup table built
algorithmically from a list of scalar values. Calculate (unpack) the
final values of a codebook entry vector from the entries in
\varname{[codebook_multiplicands]} as follows (\varname{[value_vector]}
\varname{[codebook\_multiplicands]} as follows (\varname{[value\_vector]}
is the output vector representing the vector of values for entry number
\varname{[lookup_offset]} in this codebook):
\varname{[lookup\_offset]} in this codebook):
\begin{Verbatim}[commandchars=\\\{\}]
1) [last] = 0;
2) [index_divisor] = 1;
3) iterate [i] over the range 0 ... [codebook_dimensions]-1 (once for each scalar value in the value vector) \{
2) [index\_divisor] = 1;
3) iterate [i] over the range 0 ... [codebook\_dimensions]-1 (once for each scalar value in the value vector) \{
4) [multiplicand_offset] = ( [lookup_offset] divided by [index_divisor] using integer
division ) integer modulo [codebook_lookup_values]
4) [multiplicand\_offset] = ( [lookup\_offset] divided by [index\_divisor] using integer
division ) integer modulo [codebook\_lookup\_values]
5) vector [value_vector] element [i] =
( [codebook_multiplicands] array element number [multiplicand_offset] ) *
[codebook_delta_value] + [codebook_minimum_value] + [last];
5) vector [value\_vector] element [i] =
( [codebook\_multiplicands] array element number [multiplicand\_offset] ) *
[codebook\_delta\_value] + [codebook\_minimum\_value] + [last];
6) if ( [codebook_sequence_p] is set ) then set [last] = vector [value_vector] element [i]
6) if ( [codebook\_sequence\_p] is set ) then set [last] = vector [value\_vector] element [i]
7) [index_divisor] = [index_divisor] * [codebook_lookup_values]
7) [index\_divisor] = [index\_divisor] * [codebook\_lookup\_values]
\}
......@@ -334,25 +334,25 @@ is the output vector representing the vector of values for entry number
\paragraph{Vector value decode: Lookup type 2}
Lookup type two specifies a VQ lookup table in which each scalar in
each vector is explicitly set by the \varname{[codebook_multiplicands]}
each vector is explicitly set by the \varname{[codebook\_multiplicands]}
array in a one-to-one mapping. Calculate [unpack] the
final values of a codebook entry vector from the entries in
\varname{[codebook_multiplicands]} as follows (\varname{[value_vector]}
\varname{[codebook\_multiplicands]} as follows (\varname{[value\_vector]}
is the output vector representing the vector of values for entry number
\varname{[lookup_offset]} in this codebook):
\varname{[lookup\_offset]} in this codebook):
\begin{Verbatim}[commandchars=\\\{\}]
1) [last] = 0;
2) [multiplicand_offset] = [lookup_offset] * [codebook_dimensions]
3) iterate [i] over the range 0 ... [codebook_dimensions]-1 (once for each scalar value in the value vector) \{
2) [multiplicand\_offset] = [lookup\_offset] * [codebook\_dimensions]
3) iterate [i] over the range 0 ... [codebook\_dimensions]-1 (once for each scalar value in the value vector) \{
4) vector [value_vector] element [i] =
( [codebook_multiplicands] array element number [multiplicand_offset] ) *
[codebook_delta_value] + [codebook_minimum_value] + [last];
4) vector [value\_vector] element [i] =
( [codebook\_multiplicands] array element number [multiplicand\_offset] ) *
[codebook\_delta\_value] + [codebook\_minimum\_value] + [last];
5) if ( [codebook_sequence_p] is set ) then set [last] = vector [value_vector] element [i]
5) if ( [codebook\_sequence\_p] is set ) then set [last] = vector [value\_vector] element [i]
6) increment [multiplicand_offset]
6) increment [multiplicand\_offset]
\}
......
This diff is collapsed.
......@@ -46,15 +46,15 @@ unaligned 32 bit little endian unsigned integers.
The comment header is decoded as follows:
\begin{programlisting}
1) [vendor_length] = read an unsigned integer of 32 bits
2) [vendor_string] = read a UTF-8 vector as [vendor_length] octets
3) [user_comment_list_length] = read an unsigned integer of 32 bits
4) iterate [user_comment_list_length] times {
1) [vendor\_length] = read an unsigned integer of 32 bits
2) [vendor\_string] = read a UTF-8 vector as [vendor\_length] octets
3) [user\_comment\_list\_length] = read an unsigned integer of 32 bits
4) iterate [user\_comment\_list\_length] times {
5) [length] = read an unsigned integer of 32 bits
6) this iteration's user comment = read a UTF-8 vector as [length] octets
}
7) [framing_bit] = read a single bit as boolean
8) if ( [framing_bit] unset or end-of-packet ) then ERROR
7) [framing\_bit] = read a single bit as boolean
8) if ( [framing\_bit] unset or end-of-packet ) then ERROR
9) done.
\end{programlisting}
......@@ -124,7 +124,7 @@ info)
Use Permitted', a URL to a license such as a Creative Commons license
("www.creativecommons.org/blahblah/license.html") or the EFF Open
Audio License ('distributed under the terms of the Open Audio
License. see http://www.eff.org/IP/Open_licenses/eff_oal.html for
License. see http://www.eff.org/IP/Open\_licenses/eff\_oal.html for
details'), etc.
\item[ORGANIZATION]
......@@ -231,7 +231,7 @@ bitstream octet first):
\end{enumerate}
This is actually somewhat easier to describe in code; implementation of the above can be found in \filename{vorbis/lib/info.c}, \function{_vorbis_pack_comment()} and \function{_vorbis_unpack_comment()}.
This is actually somewhat easier to describe in code; implementation of the above can be found in \filename{vorbis/lib/info.c}, \function{\_vorbis\_pack\_comment()} and \function{\_vorbis\_unpack\_comment()}.
......
......@@ -111,44 +111,44 @@ context.
\begin{Verbatim}[commandchars=\\\{\}]
1) [floor1_partitions] = read 5 bits as unsigned integer
2) [maximum_class] = -1
3) iterate [i] over the range 0 ... [floor1_partitions]-1 \{
1) [floor1\_partitions] = read 5 bits as unsigned integer
2) [maximum\_class] = -1
3) iterate [i] over the range 0 ... [floor1\_partitions]-1 \{
4) vector [floor1_partition_class_list] element [i] = read 4 bits as unsigned integer
4) vector [floor1\_partition\_class\_list] element [i] = read 4 bits as unsigned integer
\}
5) [maximum_class] = largest integer scalar value in vector [floor1_partition_class_list]
6) iterate [i] over the range 0 ... [maximum_class] \{
5) [maximum\_class] = largest integer scalar value in vector [floor1\_partition\_class\_list]
6) iterate [i] over the range 0 ... [maximum\_class] \{
7) vector [floor1_class_dimensions] element [i] = read 3 bits as unsigned integer and add 1
8) vector [floor1_class_subclasses] element [i] = read 2 bits as unsigned integer
9) if ( vector [floor1_class_subclasses] element [i] is nonzero ) \{
7) vector [floor1\_class\_dimensions] element [i] = read 3 bits as unsigned integer and add 1
8) vector [floor1\_class\_subclasses] element [i] = read 2 bits as unsigned integer
9) if ( vector [floor1\_class\_subclasses] element [i] is nonzero ) \{
10) vector [floor1_class_masterbooks] element [i] = read 8 bits as unsigned integer
10) vector [floor1\_class\_masterbooks] element [i] = read 8 bits as unsigned integer
\}
11) iterate [j] over the range 0 ... (2 exponent [floor1_class_subclasses] element [i]) - 1 \{
11) iterate [j] over the range 0 ... (2 exponent [floor1\_class\_subclasses] element [i]) - 1 \{
12) array [floor1_subclass_books] element [i],[j] =
12) array [floor1\_subclass\_books] element [i],[j] =
read 8 bits as unsigned integer and subtract one
\}
\}
13) [floor1_multiplier] = read 2 bits as unsigned integer and add one
13) [floor1\_multiplier] = read 2 bits as unsigned integer and add one
14) [rangebits] = read 4 bits as unsigned integer
15) vector [floor1_X_list] element [0] = 0
16) vector [floor1_X_list] element [1] = 2 exponent [rangebits];
17) [floor1_values] = 2
18) iterate [i] over the range 0 ... [floor1_partitions]-1 \{
19) [current_class_number] = vector [floor1_partition_class_list] element [i]
20) iterate [j] over the range 0 ... ([floor1_class_dimensions] element [current_class_number])-1 \{
21) vector [floor1_X_list] element ([floor1_values]) =
15) vector [floor1\_X\_list] element [0] = 0
16) vector [floor1\_X\_list] element [1] = 2 exponent [rangebits];
17) [floor1\_values] = 2
18) iterate [i] over the range 0 ... [floor1\_partitions]-1 \{
19) [current\_class\_number] = vector [floor1\_partition\_class\_list] element [i]
20) iterate [j] over the range 0 ... ([floor1\_class\_dimensions] element [current\_class\_number])-1 \{
21) vector [floor1\_X\_list] element ([floor1\_values]) =
read [rangebits] bits as unsigned integer
22) increment [floor1_values] by one
22) increment [floor1\_values] by one
\}
\}
......@@ -157,11 +157,11 @@ context.
An end-of-packet condition while reading any aspect of a floor 1
configuration during setup renders a stream undecodable. In addition,
a \varname{[floor1_class_masterbooks]} or
\varname{[floor1_subclass_books]} scalar element greater than the
a \varname{[floor1\_class\_masterbooks]} or
\varname{[floor1\_subclass\_books]} scalar element greater than the
highest numbered codebook configured in this stream is an error
condition that renders the stream undecodable. All vector
[floor1_x_list] element values must be unique within the vector; a
[floor1\_x\_list] element values must be unique within the vector; a
non-unique value renders the stream undecodable.
\paragraph{packet decode} \label{vorbis:spec:floor1-decode}
......@@ -183,35 +183,35 @@ which happens to be approximately -140dB).
Assuming \varname{[nonzero]} is set, decode proceeds as follows:
\begin{Verbatim}[commandchars=\\\{\}]
1) [range] = vector \{ 256, 128, 86, 64 \} element ([floor1_multiplier]-1)
2) vector [floor1_Y] element [0] = read \link{vorbis:spec:ilog}{ilog}([range]-1) bits as unsigned integer
3) vector [floor1_Y] element [1] = read \link{vorbis:spec:ilog}{ilog}([range]-1) bits as unsigned integer
1) [range] = vector \{ 256, 128, 86, 64 \} element ([floor1\_multiplier]-1)
2) vector [floor1\_Y] element [0] = read \link{vorbis:spec:ilog}{ilog}([range]-1) bits as unsigned integer
3) vector [floor1\_Y] element [1] = read \link{vorbis:spec:ilog}{ilog}([range]-1) bits as unsigned integer
4) [offset] = 2;
5) iterate [i] over the range 0 ... [floor1_partitions]-1 \{
5) iterate [i] over the range 0 ... [floor1\_partitions]-1 \{
6) [class] = vector [floor1_partition_class] element [i]
7) [cdim] = vector [floor1_class_dimensions] element [class]
8) [cbits] = vector [floor1_class_subclasses] element [class]
6) [class] = vector [floor1\_partition\_class] element [i]
7) [cdim] = vector [floor1\_class\_dimensions] element [class]
8) [cbits] = vector [floor1\_class\_subclasses] element [class]
9) [csub] = (2 exponent [cbits])-1
10) [cval] = 0
11) if ( [cbits] is greater than zero ) \{
12) [cval] = read from packet using codebook number
(vector [floor1_class_masterbooks] element [class]) in scalar context
(vector [floor1\_class\_masterbooks] element [class]) in scalar context
\}
13) iterate [j] over the range 0 ... [cdim]-1 \{
14) [book] = array [floor1_subclass_books] element [class],([cval] bitwise AND [csub])
14) [book] = array [floor1\_subclass\_books] element [class],([cval] bitwise AND [csub])
15) [cval] = [cval] right shifted [cbits] bits
16) if ( [book] is not less than zero ) \{
17) vector [floor1_Y] element ([j]+[offset]) = read from packet using codebook
17) vector [floor1\_Y] element ([j]+[offset]) = read from packet using codebook
[book] in scalar context
\} else [book] is less than zero \{
18) vector [floor1_Y] element ([j]+[offset]) = 0
18) vector [floor1\_Y] element ([j]+[offset]) = 0
\}
\}
......@@ -229,7 +229,7 @@ operation above, floor decode is to return 'unused' status as if the
\varname{[nonzero]} flag had been unset at the beginning of decode.
Vector \varname{[floor1_Y]} contains the values from packet decode
Vector \varname{[floor1\_Y]} contains the values from packet decode
needed for floor 1 synthesis.
......@@ -256,23 +256,23 @@ Unwrap the always-positive-or-zero values read from the packet into
+/- difference values, then apply to line prediction.
\begin{Verbatim}[commandchars=\\\{\}]
1) [range] = vector \{ 256, 128, 86, 64 \} element ([floor1_multiplier]-1)
2) vector [floor1_step2_flag] element [0] = set
3) vector [floor1_step2_flag] element [1] = set
4) vector [floor1_final_Y] element [0] = vector [floor1_Y] element [0]
5) vector [floor1_final_Y] element [1] = vector [floor1_Y] element [1]
6) iterate [i] over the range 2 ... [floor1_values]-1 \{
7) [low_neighbor_offset] = \link{vorbis:spec:low:neighbor}{low_neighbor}([floor1_X_list],[i])
8) [high_neighbor_offset] = \link{vorbis:spec:high:neighbor}{high_neighbor}([floor1_X_list],[i])
9) [predicted] = \link{vorbis:spec:render:point}{render_point}( vector [floor1_X_list] element [low_neighbor_offset],
vector [floor1_final_Y] element [low_neighbor_offset],
vector [floor1_X_list] element [high_neighbor_offset],
vector [floor1_final_Y] element [high_neighbor_offset],
vector [floor1_X_list] element [i] )
10) [val] = vector [floor1_Y] element [i]
1) [range] = vector \{ 256, 128, 86, 64 \} element ([floor1\_multiplier]-1)
2) vector [floor1\_step2\_flag] element [0] = set
3) vector [floor1\_step2\_flag] element [1] = set
4) vector [floor1\_final\_Y] element [0] = vector [floor1\_Y] element [0]
5) vector [floor1\_final\_Y] element [1] = vector [floor1\_Y] element [1]
6) iterate [i] over the range 2 ... [floor1\_values]-1 \{
7) [low\_neighbor\_offset] = \link{vorbis:spec:low:neighbor}{low\_neighbor}([floor1\_X\_list],[i])
8) [high\_neighbor\_offset] = \link{vorbis:spec:high:neighbor}{high\_neighbor}([floor1\_X\_list],[i])
9) [predicted] = \link{vorbis:spec:render:point}{render\_point}( vector [floor1\_X\_list] element [low\_neighbor\_offset],
vector [floor1\_final\_Y] element [low\_neighbor\_offset],
vector [floor1\_X\_list] element [high\_neighbor\_offset],
vector [floor1\_final\_Y] element [high\_neighbor\_offset],
vector [floor1\_X\_list] element [i] )
10) [val] = vector [floor1\_Y] element [i]
11) [highroom] = [range] - [predicted]
12) [lowroom] = [predicted]
13) if ( [highroom] is less than [lowroom] ) \{
......@@ -287,18 +287,18 @@ Unwrap the always-positive-or-zero values read from the packet into
16) if ( [val] is nonzero ) \{
17) vector [floor1_step2_flag] element [low_neighbor_offset] = set
18) vector [floor1_step2_flag] element [high_neighbor_offset] = set
19) vector [floor1_step2_flag] element [i] = set
17) vector [floor1\_step2\_flag] element [low\_neighbor\_offset] = set
18) vector [floor1\_step2\_flag] element [high\_neighbor\_offset] = set
19) vector [floor1\_step2\_flag] element [i] = set
20) if ( [val] is greater than or equal to [room] ) \{
21) if ( [highroom] is greater than [lowroom] ) \{
22) vector [floor1_final_Y] element [i] = [val] - [lowroom] + [predicted]
22) vector [floor1\_final\_Y] element [i] = [val] - [lowroom] + [predicted]
\} else [highroom] is not greater than [lowroom] \{
23) vector [floor1_final_Y] element [i] = [predicted] - [val] + [highroom] - 1
23) vector [floor1\_final\_Y] element [i] = [predicted] - [val] + [highroom] - 1
\}
......@@ -306,12 +306,12 @@ Unwrap the always-positive-or-zero values read from the packet into
24) if ([val] is odd) \{
25) vector [floor1_final_Y] element [i] =
25) vector [floor1\_final\_Y] element [i] =
[predicted] - (([val] + 1) divided by 2 using integer division)
\} else [val] is even \{
26) vector [floor1_final_Y] element [i] =
26) vector [floor1\_final\_Y] element [i] =
[predicted] + ([val] / 2 using integer division)
\}
......@@ -320,8 +320,8 @@ Unwrap the always-positive-or-zero values read from the packet into
\} else [val] is zero \{
27) vector [floor1_step2_flag] element [i] = unset
28) vector [floor1_final_Y] element [i] = [predicted]
27) vector [floor1\_step2\_flag] element [i] = unset
28) vector [floor1\_final\_Y] element [i] = [predicted]
\}
......@@ -338,18 +338,18 @@ Unwrap the always-positive-or-zero values read from the packet into
Curve synthesis generates a return vector \varname{[floor]} of length
\varname{[n]} (where \varname{[n]} is provided by the decode process
calling to floor decode). Floor 1 curve synthesis makes use of the
\varname{[floor1_X_list]}, \varname{[floor1_final_Y]} and
\varname{[floor1_step2_flag]} vectors, as well as [floor1_multiplier]
and [floor1_values] values.
\varname{[floor1\_X\_list]}, \varname{[floor1\_final\_Y]} and
\varname{[floor1\_step2\_flag]} vectors, as well as [floor1\_multiplier]
and [floor1\_values] values.
Decode begins by sorting the scalars from vectors
\varname{[floor1_X_list]}, \varname{[floor1_final_Y]} and
\varname{[floor1_step2_flag]} together into new vectors
\varname{[floor1_X_list]'}, \varname{[floor1_final_Y]'} and
\varname{[floor1_step2_flag]'} according to ascending sort order of the
values in \varname{[floor1_X_list]}. That is, sort the values of
\varname{[floor1_X_list]} and then apply the same permutation to
elements of the other two vectors so that the X, Y and step2_flag
\varname{[floor1\_X\_list]}, \varname{[floor1\_final\_Y]} and
\varname{[floor1\_step2\_flag]} together into new vectors
\varname{[floor1\_X\_list]'}, \varname{[floor1\_final\_Y]'} and
\varname{[floor1\_step2\_flag]'} according to ascending sort order of the
values in \varname{[floor1\_X\_list]}. That is, sort the values of
\varname{[floor1\_X\_list]} and then apply the same permutation to
elements of the other two vectors so that the X, Y and step2\_flag
values still match.
Then compute the final curve in one pass:
......@@ -357,14 +357,14 @@ Then compute the final curve in one pass:
\begin{Verbatim}[commandchars=\\\{\}]
1) [hx] = 0
2) [lx] = 0
3) [ly] = vector [floor1_final_Y]' element [0] * [floor1_multiplier]
4) iterate [i] over the range 1 ... [floor1_values]-1 \{
3) [ly] = vector [floor1\_final\_Y]' element [0] * [floor1\_multiplier]
4) iterate [i] over the range 1 ... [floor1\_values]-1 \{
5) if ( [floor1_step2_flag]' element [i] is set ) \{
5) if ( [floor1\_step2\_flag]' element [i] is set ) \{
6) [hy] = [floor1_final_Y]' element [i] * [floor1_multiplier]
7) [hx] = [floor1_X_list]' element [i]
8) \link{vorbis:spec:render:line}{render_line}( [lx], [ly], [hx], [hy], [floor] )
6) [hy] = [floor1\_final\_Y]' element [i] * [floor1\_multiplier]
7) [hx] = [floor1\_X\_list]' element [i]
8) \link{vorbis:spec:render:line}{render\_line}( [lx], [ly], [hx], [hy], [floor] )
9) [lx] = [hx]
10) [ly] = [hy]
\}
......@@ -372,7 +372,7 @@ Then compute the final curve in one pass:
11) if ( [hx] is less than [n] ) \{
12) \link{vorbis:spec:render:line}{render_line}( [hx], [hy], [n], [hy], [floor] )
12) \link{vorbis:spec:render:line}{render\_line}( [hx], [hy], [n], [hy], [floor] )
\}
......@@ -383,7 +383,7 @@ Then compute the final curve in one pass:
\}
15) for each scalar in vector [floor], perform a lookup substitution using
the scalar value from [floor] as an offset into the vector \link{vorbis:spec:floor1:inverse:dB:table}{[floor1_inverse_dB_static_table]}
the scalar value from [floor] as an offset into the vector \link{vorbis:spec:floor1:inverse:dB:table}{[floor1\_inverse\_dB\_static\_table]}
16) done
......
......@@ -37,11 +37,11 @@ encoded and simply trusting that it is, is as follows:
\begin{itemize}
\item Each vector is partitioned into multiple equal sized chunks
according to configuration specified. If we have a vector size of
\emph{n}, a partition size \emph{residue_partition_size}, and a total
\emph{n}, a partition size \emph{residue\_partition\_size}, and a total
of \emph{ch} residue vectors, the total number of partitioned chunks
coded is \emph{n}/\emph{residue_partition_size}*\emph{ch}. It is
coded is \emph{n}/\emph{residue\_partition\_size}*\emph{ch}. It is
important to note that the integer division truncates. In the below
example, we assume an example \emph{residue_partition_size} of 8.
example, we assume an example \emph{residue\_partition\_size} of 8.
\item Each partition in each vector has a classification number that
specifies which of multiple configured VQ codebook setups are used to
......@@ -156,48 +156,48 @@ vector to begin with, residue type 1 and type 2 are equivalent.
Header decode for all three residue types is identical.
\begin{programlisting}
1) [residue_begin] = read 24 bits as unsigned integer
2) [residue_end] = read 24 bits as unsigned integer
3) [residue_partition_size] = read 24 bits as unsigned integer and add one
4) [residue_classifications] = read 6 bits as unsigned integer and add one
5) [residue_classbook] = read 8 bits as unsigned integer
1) [residue\_begin] = read 24 bits as unsigned integer
2) [residue\_end] = read 24 bits as unsigned integer
3) [residue\_partition\_size] = read 24 bits as unsigned integer and add one
4) [residue\_classifications] = read 6 bits as unsigned integer and add one
5) [residue\_classbook] = read 8 bits as unsigned integer
\end{programlisting}
\varname{[residue_begin]} and
\varname{[residue_end]} select the specific sub-portion of
\varname{[residue\_begin]} and
\varname{[residue\_end]} select the specific sub-portion of
each vector that is actually coded; it implements akin to a bandpass
where, for coding purposes, the vector effectively begins at element
\varname{[residue_begin]} and ends at
\varname{[residue_end]}. Preceding and following values in
\varname{[residue\_begin]} and ends at
\varname{[residue\_end]}. Preceding and following values in
the unpacked vectors are zeroed. Note that for residue type 2, these
values as well as \varname{[residue_partition_size]}apply to
values as well as \varname{[residue\_partition\_size]}apply to
the interleaved vector, not the individual vectors before interleave.
\varname{[residue_partition_size]} is as explained above,
\varname{[residue_classifications]} is the number of possible
\varname{[residue\_partition\_size]} is as explained above,
\varname{[residue\_classifications]} is the number of possible
classification to which a partition can belong and
\varname{[residue_classbook]} is the codebook number used to
\varname{[residue\_classbook]} is the codebook number used to
code classification codewords. The number of dimensions in book
\varname{[residue_classbook]} determines how many
\varname{[residue\_classbook]} determines how many
classification values are grouped into a single classification
codeword. Note that the number of entries and dimensions in book
\varname{[residue_classbook]}, along with