[xiph-cvs] cvs commit: vorbis/doc/xml 04-codec.xml 07-floor1.xml 08-residue.xml

Monty xiphmont at xiph.org
Tue Mar 11 03:02:17 PST 2003



xiphmont    03/03/11 06:02:17

  Modified:    doc/xml  04-codec.xml 07-floor1.xml 08-residue.xml
  Added:       doc      xifish.pdf
  Log:
  Many small but vital fixes to the spec pseudocode pointed out by
  jripley at sonicblue.com.

Revision  Changes    Path
1.1                  vorbis/doc/xifish.pdf

Index: xifish.pdf
===================================================================
%PDF-1.3
%Ç쏢
6 0 obj
<</Length 7 0 R/Filter /FlateDecode>>
stream
xœÝVË’7¼ÏWðœÃ˜à >ÃÑ'¨b'U«ƒíƒ?Ý ©µ¼ëS¶œÄ%•„Á
6Š± /R€	Y
±”1ŽZŸeõ»ý`®²ôˆÝ<ùˆÐu@Ô@éZ“×H «ji
yñÒ7ÄÁÄà­z·Ì#¿Z-¨6ÝÉ·„
êtŠ;O¿x˜ØÌÄIÀkš¹ÃeUº…1#¨iŠ"ɬºÛJ4aÖÖøZH¡I£è–œº2Áì¡t&°¯<—†È6°n±•åŠPž1\K4×Ó¡…¢Ä*[Îv™.­äR·1@‰1ú.oáRO{c=ô¦‚xC&¯IqnxÖÕ£¾åÿßËÚ5l¶“d×@F]«f ´f¹˜¦_w¼™ÕÔš-;îšµ¾šãíQ/Ïã;ªf¼b@<V‚mÈr~–fu1ƒ[ò%¦zŽÉy;:j_,ÌÉGQ¬³ž
ÇÝ„­­fŸ
6j«+–ûäWÄL÷Ût Qv·ÐiòàvO'ŲoâÎ\¡esîAùÃ÷ó±3Tº=*‰…úh鯸ꏉzP{Å’Êï
÷p/VzaJe”éú?Ð~@ôFÖ+Jï/iq~>(‘BkœßÊ{EˆÊ'òQ~6›à}”)\æ…oçš%ßÍC&
L(Ö®tßæ<Þ…ÂõØà|ŠE—ùË•ì@óë•ÞŸ«
endobj
7 0 obj
891
endobj
5 0 obj
<</Type/Page/MediaBox [0 0 199 199]
/Rotate 0/Parent 3 0 R
/Resources<</ProcSet[/PDF]
/ExtGState 8 0 R
>>
/Contents 6 0 R
>>
endobj
3 0 obj
<< /Type /Pages /Kids [
5 0 R
] /Count 1
>>
endobj
1 0 obj
<</Type /Catalog /Pages 3 0 R
>>
endobj
4 0 obj
<</Type/ExtGState/Name/R4/TR/Identity/OPM 1/SM 0.02>>
endobj
8 0 obj
<</R4
4 0 R>>
endobj
2 0 obj
<</Producer(GNU Ghostscript 7.05)
/Title(xiph.eps)
/Creator(fig2dev Version 3.2 Patchlevel 3a)
/Author(xiphmont at Snotfish \(Monty,,,\))>>endobj
xref
0 9
0000000000 65535 f 
0000001194 00000 n 
0000001340 00000 n 
0000001135 00000 n 
0000001242 00000 n 
0000000995 00000 n 
0000000015 00000 n 
0000000976 00000 n 
0000001311 00000 n 
trailer
<< /Size 9 /Root 1 0 R /Info 2 0 R
>>
startxref
1491
%%EOF

<p><p>1.8       +7 -8      vorbis/doc/xml/04-codec.xml

Index: 04-codec.xml
===================================================================
RCS file: /usr/local/cvsroot/vorbis/doc/xml/04-codec.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- 04-codec.xml	27 Oct 2002 16:20:47 -0000	1.7
+++ 04-codec.xml	11 Mar 2003 11:02:17 -0000	1.8
@@ -7,8 +7,8 @@
 <section id="vorbis-spec-codec">
 <sectioninfo>
 <releaseinfo>
- $Id: 04-codec.xml,v 1.7 2002/10/27 16:20:47 giles Exp $
- <emphasis>Last update to this document: October 15, 2002</emphasis>
+ $Id: 04-codec.xml,v 1.8 2003/03/11 11:02:17 xiphmont Exp $
+ <emphasis>Last update to this document: March 11, 2003</emphasis>
 </releaseinfo>
 </sectioninfo>
 <title>Codec Setup and Packet Decode</title>
@@ -357,7 +357,6 @@
 
 <orderedlist>
  <listitem><simpara> <varname>[window_center]</varname> = <varname>[n]</varname> / 2</simpara></listitem>
- <listitem><simpara> <varname>[left_window_start]</varname></simpara></listitem>
  <listitem><para> if (<varname>[vorbis_mode_blockflag]</varname> is set and <varname>[previous_window_flag]</varname> is
 not set) then
   <orderedlist>
@@ -393,7 +392,7 @@
  <listitem><simpara> for <varname>[i]</varname> in range <varname>[left_window_start]</varname> ...
 <varname>[left_window_end]</varname>-1, window(<varname>[i]</varname>) = sin(.5 * &pi; * sin^2( (<varname>[i]</varname>-<varname>[left_window_start]</varname>+.5) / <varname>[left_n]</varname> * .5 * &pi;) )</simpara></listitem>
  <listitem><simpara> window from range <varname>[left_window_end]</varname> ... <varname>[right_window_start]</varname>-1
-inclusive is one</simpara></listitem><listitem><simpara> for <varname>[i]</varname> in range <varname>[right_window_start]</varname> ... <varname>[right_window_end]</varname>-1, window(<varname>[i]</varname>) = sin(.5 * &pi; * sin^2( (<varname>[i]</varname>-<varname>[right_window_start]</varname>+.5) / <varname>[right_n]</varname> * .5 * &pi;/2. + .5 * &pi;) )</simpara></listitem>
+inclusive is one</simpara></listitem><listitem><simpara> for <varname>[i]</varname> in range <varname>[right_window_start]</varname> ... <varname>[right_window_end]</varname>-1, window(<varname>[i]</varname>) = sin(.5 * &pi; * sin^2( (<varname>[i]</varname>-<varname>[right_window_start]</varname>+.5) / <varname>[right_n]</varname> * .5 * &pi; + .5 * &pi;) )</simpara></listitem>
 <listitem><simpara> window from range <varname>[rigth_window_start]</varname> ... <varname>[n]</varname>-1 is
 zero</simpara></listitem>
 </orderedlist>
@@ -483,17 +482,17 @@
 
 <orderedlist>
  <listitem><simpara><varname>[ch]</varname> = 0</simpara></listitem>
- <listitem><simpara>for each channel <varname>[j]</varname> in order from 0 ... <varname>[audio_channels]</varname></simpara>
+ <listitem><simpara>for each channel <varname>[j]</varname> in order from 0 ... <varname>[audio_channels]</varname> - 1</simpara>
   <orderedlist>
-   <listitem><simpara>if channel <varname>[j]</varname> is in submap <varname>[i]</varname> (vector <varname>[vorbis_mapping_mux]</varname> element <varname>[j]</varname> is equal to <varname>[i]</varname>)</simpara>
+   <listitem><simpara>if channel <varname>[j]</varname> in submap <varname>[i]</varname> (vector <varname>[vorbis_mapping_mux]</varname> element <varname>[j]</varname> is equal to <varname>[i]</varname>)</simpara>
     <orderedlist>
      <listitem><para>if vector <varname>[no_residue]</varname> element <varname>[j]</varname> is true
       <orderedlist>
-       <listitem><simpara>vector <varname>[do_not_decode_flag]</varname> element <varname>[channels_in_bundle]</varname> is set</simpara></listitem>
+       <listitem><simpara>vector <varname>[do_not_decode_flag]</varname> element <varname>[ch]</varname> is set</simpara></listitem>
       </orderedlist>
      else
       <orderedlist>
-       <listitem><simpara>vector <varname>[do_not_decode_flag]</varname> element <varname>[channels_in_bundle]</varname> is unset</simpara></listitem>
+       <listitem><simpara>vector <varname>[do_not_decode_flag]</varname> element <varname>[ch]</varname> is unset</simpara></listitem>
       </orderedlist></para>
      </listitem>
      <listitem><simpara>increment <varname>[ch]</varname></simpara></listitem>

<p><p>1.5       +4 -5      vorbis/doc/xml/07-floor1.xml

Index: 07-floor1.xml
===================================================================
RCS file: /usr/local/cvsroot/vorbis/doc/xml/07-floor1.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- 07-floor1.xml	27 Oct 2002 16:20:47 -0000	1.4
+++ 07-floor1.xml	11 Mar 2003 11:02:17 -0000	1.5
@@ -7,8 +7,8 @@
 <section id="vorbis-spec-floor1">
 <sectioninfo>
 <releaseinfo>
- $Id: 07-floor1.xml,v 1.4 2002/10/27 16:20:47 giles Exp $
- <emphasis>Last update to this document: October 15, 2002</emphasis>
+ $Id: 07-floor1.xml,v 1.5 2003/03/11 11:02:17 xiphmont Exp $
+ <emphasis>Last update to this document: March 11, 2003</emphasis>
 </releaseinfo>
 </sectioninfo>
 <title>Floor type 1 setup and decode</title>
@@ -185,9 +185,8 @@
        20) iterate [j] over the range 0 ... ([floor1_class_dimensions] element [current_class_number])-1 {
              21) vector [floor1_X_list] element ([j] + [floor1_values]) = 
                  read [rangebits] bits as unsigned integer
-            }
-
-       22) [floor1_values] = [floor1_values] + [floor1_class_dimensions] element [i]
+             22) increment [floor1_values] by one
+           }
      }
  
  23) done

<p><p>1.5       +37 -36    vorbis/doc/xml/08-residue.xml

Index: 08-residue.xml
===================================================================
RCS file: /usr/local/cvsroot/vorbis/doc/xml/08-residue.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- 08-residue.xml	27 Oct 2002 16:20:47 -0000	1.4
+++ 08-residue.xml	11 Mar 2003 11:02:17 -0000	1.5
@@ -7,8 +7,8 @@
 <section id="vorbis-spec-residue">
 <sectioninfo>
  <releaseinfo>
-  $Id: 08-residue.xml,v 1.4 2002/10/27 16:20:47 giles Exp $
-  <emphasis>Last update to this document: July 19, 2002</emphasis>
+  $Id: 08-residue.xml,v 1.5 2003/03/11 11:02:17 xiphmont Exp $
+  <emphasis>Last update to this document: March 11, 2003</emphasis>
  </releaseinfo>
 </sectioninfo>
 <title>Residue setup and decode</title>
@@ -286,8 +286,8 @@
 the decode process:</para>
 
 <programlisting>
-  1) [classvals_per_codeword] = [codebook_dimensions] value of codebook [residue_classbook]
-  2) [n_to_read] = [residue_end] - [residue-begin]
+  1) [classwords_per_codeword] = [codebook_dimensions] value of codebook [residue_classbook]
+  2) [n_to_read] = [residue_end] - [residue_begin]
   3) [partitions_to_read] = [n_to_read] / [residue_partition_size]
 </programlisting>
 
@@ -298,6 +298,7 @@
   2) iterate [pass] over the range 0 ... 7 {
 
        3) [partition_count] = 0
+
        4) if ([pass] is zero) {
      
             5) iterate [j] over the range 0 .. [ch]-1 {
@@ -305,9 +306,9 @@
                  6) if vector [j] is not marked 'do not decode' {
 
                       7) [temp] = read from packet using codebook [residue_classbook] in scalar context
-                      8) iterate [k] descending over the range [classvals_per_codeword]-1 ... 0 {
+                      8) iterate [i] descending over the range [classwords_per_codeword]-1 ... 0 {
 
-                           9) array [classifications] element [j],([partition_count]+[k]) =
+                           9) array [classifications] element [j],([i]+[partition_count]) =
                               [temp] integer modulo [residue_classifications]
                           10) [temp] = [temp] / [residue_classifications] using integer division
 
@@ -319,32 +320,29 @@
         
           }
 
-      11) [classword_count] = 0
-      12) iterate [j] over the range 0 .. [ch]-1 {
-
-            13) if vector [j] is not marked 'do not decode' {
+      11) iterate [i] over the range 0 .. ([classwords_per_codeword] - 1) while [partition_count] 
+          is also less than [partitions_to_read] {
 
-  
-                 14) [vqclass] = array [classifications] element [j],([partition_count]+[classword_count])
-                 15) [vqbook] = array [residue_books] element [vqclass],[pass]
-                 16) if ([vqbook] is not 'unused') {
+            12) iterate [j] over the range 0 .. [ch]-1 {
    
-                       17) decode partition into output vector number [j], starting at scalar 
+                 13) if vector [j] is not marked 'do not decode' {
+   
+                      14) [vqclass] = array [classifications] element [j],[partition_count]
+                      15) [vqbook] = array [residue_books] element [vqclass],[pass]
+                      16) if ([vqbook] is not 'unused') {
+   
+                           17) decode partition into output vector number [j], starting at scalar 
                            offset [residue_begin]+[partition_count]*[residue_partition_size] using 
                            codebook number [vqbook] in VQ context
                      }
-               }
+                }
+   
+            18) increment [partition_count] by one
 
           }
-
-      18) increment [classword_count]
-      19) increment [partition_count]
-      20) if ([classword_count] is less than [classvals_per_codeword]) AND 
-             ([partition_count] is less than [partitions_to_read) then continue at step 11
-      21) if ([partition_count] is less than [partitions_to_read) then continue at step 4
-    }
+     }
  
- 22) done
+ 19) done
 
 </programlisting>
 
@@ -424,18 +422,27 @@
 <section><title>format 2 specifics</title>
  
 <para>
-Format 2 is reducible to format 1 through the following steps, performed in order:
+Format 2 is reducible to format 1.  It may be implemented as an additional stepprior to and an additional post-decode step after a normal format 1 decode.
+</para>
+
+<para>
+Format 2 handles 'do not decode' vectors differently than residue 0 or
+1; if all vectors are marked 'do not decode', no decode occurrs.
+However, if at least one vector is to be decoded, all the vectors are
+decoded.  We then request normal format 1 to decode a single vector
+representing all output channels, rather than a vector for each
+channel.  After decode, deinterleave the vector into independent vectors, one for each output channel.  That is:</para>
 
 <orderedlist>
- <listitem><simpara>Assume format 2 is to decode <emphasis>ch</emphasis> vectors of length <emphasis>n</emphasis>.</simpara></listitem>
- <listitem><simpara>Decode, using format 1, a single vector <varname>[v]</varname>of length <emphasis>ch</emphasis>*<emphasis>n</emphasis>.</simpara></listitem>
- <listitem><para>Deinterleave this single vector <varname>[v]</varname> into <emphasis>ch</emphasis> independent vectors according to:
+ <listitem><simpara>If all vectors 0 through <emphasis>ch</emphasis>-1 are marked 'do not decode', allocate and clear a single vector <varname>[v]</varname>of length <emphasis>ch*n</emphasis> and skip step 2 below; proceed directly to the post-decode step.</simpara></listitem>
+ <listitem><simpara>Rather than performing format 1 decode to produce <emphasis>ch</emphasis> vectors of length <emphasis>n</emphasis> each, call format 1 decode to produce a single vector <varname>[v]</varname> of length <emphasis>ch*n</emphasis>. </simpara></listitem>
+ <listitem><para>Post decode: Deinterleave the single vector <varname>[v]</varname> returned by format 1 decode as described above into <emphasis>ch</emphasis> independent vectors, one for each outputchannel, according to:
   <programlisting>
   1) iterate [i] over the range 0 ... [n]-1 {
 
        2) iterate [j] over the range 0 ... [ch]-1 {
 
-            3) output vector number [j] element [i] = vector [t] element ([i] * [ch] +[j])
+            3) output vector number [j] element [i] = vector [v] element ([i] * [ch] + [j])
 
           }
      }
@@ -444,16 +451,10 @@
   </programlisting>
  </para></listitem>
 </orderedlist>
-</para>
-
-<para>
-Format 2 handles 'do not decode' vectors differently that residue 0 or
-1; if all vectors are marked 'do not decode', no decode occurrs.
-However, if at least one vector is to be decoded, all the vectors are
-decoded.</para>
 
 </section>
 
 </section>
 
 </section>
+

<p><p>--- >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 'cvs-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 commits mailing list