Several logical fixes to the spec pseudocode as submitted by ods15.
authorMonty <xiphmont@xiph.org>
Wed, 23 Nov 2005 08:44:18 +0000 (08:44 +0000)
committerMonty <xiphmont@xiph.org>
Wed, 23 Nov 2005 08:44:18 +0000 (08:44 +0000)
svn path=/trunk/vorbis/; revision=10424

doc/xml/06-floor0.xml
doc/xml/07-floor1.xml
doc/xml/08-residue.xml

index 8b4f830..deb06bb 100644 (file)
@@ -79,11 +79,10 @@ Packet decode proceeds as follows:</para>
   1) [amplitude] = read an unsigned integer of [floor0_amplitude_bits] bits
   2) if ( [amplitude] is greater than zero ) {
        3) [coefficients] is an empty, zero length vector
-
        4) [booknumber] = read an unsigned integer of <link linkend="vorbis-spec-ilog">ilog</link>( [floor0_number_of_books] ) bits
        5) if ( [booknumber] is greater than the highest number decode codebook ) then packet is undecodable
        6) [last] = zero;
-       7) vector [temp_vector] = read vector from bitstream using codebook number [booknumber] in VQ context.
+       7) vector [temp_vector] = read vector from bitstream using codebook number [floor0_book_list] element [booknumber] in VQ context.
        8) add the scalar value [last] to each scalar in vector [temp_vector]
        9) [last] = the value of the last scalar in vector [temp_vector]
       10) concatenate [temp_vector] onto the end of the [coefficients] vector
index c2caa24..c134602 100644 (file)
@@ -182,7 +182,7 @@ context.</para>
 
        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 ([j] + [floor1_values]) = 
+             21) vector [floor1_X_list] element ([floor1_values]) = 
                  read [rangebits] bits as unsigned integer
              22) increment [floor1_values] by one
            }
@@ -326,7 +326,7 @@ Unwrap the always-positive-or-zero values read from the packet into
          
           } else [highroom] is not less than [lowroom] {
                      
-            15) [root] = [lowroom] * 2
+            15) [room] = [lowroom] * 2
         
           }
 
@@ -409,7 +409,7 @@ Then compute the final curve in one pass:</para>
   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]' 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]
index 65e0e4e..8cd47e2 100644 (file)
@@ -298,50 +298,53 @@ Packet decode proceeds as follows, matching the description offered earlier in t
 
        3) [partition_count] = 0
 
-       4) if ([pass] is zero) {
+       4) while [partition_count] is less than [partitions_to_read]
+
+            5) if ([pass] is zero) {
      
-            5) iterate [j] over the range 0 .. [ch]-1 {
+                 6) iterate [j] over the range 0 .. [ch]-1 {
 
-                 6) if vector [j] is not marked 'do not decode' {
+                      7) if vector [j] is not marked 'do not decode' {
 
-                      7) [temp] = read from packet using codebook [residue_classbook] in scalar context
-                      8) iterate [i] descending over the range [classwords_per_codeword]-1 ... 0 {
+                           8) [temp] = read from packet using codebook [residue_classbook] in scalar context
+                           9) iterate [i] descending over the range [classwords_per_codeword]-1 ... 0 {
 
-                           9) array [classifications] element [j],([i]+[partition_count]) =
-                              [temp] integer modulo [residue_classifications]
-                          10) [temp] = [temp] / [residue_classifications] using integer division
+                               10) array [classifications] element [j],([i]+[partition_count]) =
+                                   [temp] integer modulo [residue_classifications]
+                               11) [temp] = [temp] / [residue_classifications] using integer division
 
-                         }
+                              }
       
-                    }
+                         }
             
+                    }
+          
                }
-        
-          }
 
-      11) iterate [i] over the range 0 .. ([classwords_per_codeword] - 1) while [partition_count] 
-          is also less than [partitions_to_read] {
+           12) iterate [i] over the range 0 .. ([classwords_per_codeword] - 1) while [partition_count] 
+               is also less than [partitions_to_read] {
 
-            12) iterate [j] over the range 0 .. [ch]-1 {
+                 13) iterate [j] over the range 0 .. [ch]-1 {
    
-                 13) if vector [j] is not marked 'do not decode' {
+                      14) 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') {
+                           15) [vqclass] = array [classifications] element [j],[partition_count]
+                           16) [vqbook] = array [residue_books] element [vqclass],[pass]
+                           17) 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) 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
+                 19) increment [partition_count] by one
 
+               }
           }
      }
  
19) done
20) done
 
 </programlisting>