[xiph-cvs] cvs commit: vorbis/lib mdct.c window.c

Monty xiphmont at xiph.org
Tue Oct 15 19:43:48 PDT 2002



xiphmont    02/10/15 22:43:48

  Modified:    doc      vorbis-spec-floor1.html vorbis-spec-ref.html
               lib      mdct.c window.c
  Log:
  Corrections from Tor-Einar Jarnbjo added to spec

Revision  Changes    Path
1.9       +11 -11    vorbis/doc/vorbis-spec-floor1.html

Index: vorbis-spec-floor1.html
===================================================================
RCS file: /usr/local/cvsroot/vorbis/doc/vorbis-spec-floor1.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- vorbis-spec-floor1.html	20 Sep 2002 02:49:35 -0000	1.8
+++ vorbis-spec-floor1.html	16 Oct 2002 02:43:48 -0000	1.9
@@ -6,7 +6,7 @@
 Ogg Vorbis I format specification: floor type 1 setup and decode
 </font></h1>
 
-Last update to this document: September 19, 2002</em><br>
+Last update to this document: October 15, 2002</em><br>
 
 <h1>Overview</h1>
 
@@ -247,8 +247,8 @@
        8) [high_neighbor_offset] = high_neighbor([floor1_X_list],[i])
 
        9) [predicted] = render_point( vector [floor1_X_list] element [low_neighbor_offset],
-                                      vector [floor1_X_list] element [high_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] )
 
@@ -278,7 +278,7 @@
                      
                       } else [hiroom] is not greater than [lowroom] {
               
-                        23) vector [floor1_final_Y] element [i] = [predicted] - ([val] - [lowroom]) - 1
+                        23) vector [floor1_final_Y] element [i] = [predicted] - [val] + [hiroom] - 1
                    
                       }
                
@@ -287,7 +287,7 @@
                   24) if ([val] is odd) {
                  
                         25) vector [floor1_final_Y] element [i] = 
-                            [predicted] - (([val] - 1) divided by  2 using integer division)
+                            [predicted] - (([val] + 1) divided by  2 using integer division)
 
                       } else [val] is even {
 
@@ -342,22 +342,22 @@
 
              6) [hy] = [floor1_final_Y]' element [i] * [floor1_multiplier]
               7) [hx] = [floor1_X_list]' element [i]
-             8) render_line( [lx], [hx], [ly], [hy], [floor] )
+             8) render_line( [lx], [ly], [hx], [hy], [floor] )
              9) [lx] = [hx]
             10) [ly] = [hy]
           }
+     }
  
-      11) if ( [hx] is less than [n] ) {
+ 11) if ( [hx] is less than [n] ) {
 
-            12) render_line( [hx], [hy], [n], [hy], [floor] )
+       12) render_line( [hx], [hy], [n], [hy], [floor] )
 
-          }
+     }
 
-      13) if ( [hx] is greater than [n] ) {
+ 13) if ( [hx] is greater than [n] ) {
 
-            14) truncate vector [floor] to [n] elements
+       14) truncate vector [floor] to [n] elements
 
-          }
      }
  
  15) for each scalar in vector [floor], perform a lookup substitution using 

<p><p>1.6       +18 -14    vorbis/doc/vorbis-spec-ref.html

Index: vorbis-spec-ref.html
===================================================================
RCS file: /usr/local/cvsroot/vorbis/doc/vorbis-spec-ref.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vorbis-spec-ref.html	20 Sep 2002 09:52:31 -0000	1.5
+++ vorbis-spec-ref.html	16 Oct 2002 02:43:48 -0000	1.6
@@ -168,15 +168,18 @@
              <ol><li>if set, <tt>[vorbis_mapping_submaps]</tt> = read 4 bits as unsigned integer and add one<p>
                  <li>if unset, <tt>[vorbis_mapping_submaps]</tt> = 1<p>
              </ol>
-          <li>read 1 bit as a boolean flag; if set, square polar channel mapping is in use:<p>
-              <ol><li><tt>[vorbis_mapping_coupling_steps]</tt>= read 8 bits as unsigned integer and add one<p>
-                  <li>for <tt>[j]</tt> each of <tt>[vorbis_mapping_coupling_steps]</tt> steps:<p>
-                      <ol>
-                      <li>vector <tt>[vorbis_mapping_magnitude]</tt> element <tt>[j]</tt>= read ilog([audio_channels] - 1) bits as unsigned integer<p>
-                      <li>vector <tt>[vorbis_mapping_angle]</tt> element <tt>[j]</tt>= read ilog([audio_channels] - 1) bits as unsigned integer<p>
-                      <li>the numbers read in the above two steps are channel numbers representing the channel to treat as magnitude and the channel to treat as angle, respectively.  If for any coupling step the angle channel number equals the magnitude channel number, the magnitude channel number is greater than <tt>[audio_channels]</tt>-1, or the angle channel is greater than <tt>[audio_channels]</tt>-1, the stream is undecodable.<p>
-                      </ol>
-               </ol>
+          <li>read 1 bit as a boolean flag<p>
+	     <ol><li>if set, square polar channel mapping is in use:<p>
+                  <ol><li><tt>[vorbis_mapping_coupling_steps]</tt> = read 8 bits as unsigned integer and add one<p>
+                      <li>for <tt>[j]</tt> each of <tt>[vorbis_mapping_coupling_steps]</tt> steps:<p>
+                          <ol>
+                          <li>vector <tt>[vorbis_mapping_magnitude]</tt> element <tt>[j]</tt>= read ilog([audio_channels] - 1) bits as unsigned integer<p>
+                          <li>vector <tt>[vorbis_mapping_angle]</tt> element <tt>[j]</tt>= read ilog([audio_channels] - 1) bits as unsigned integer<p>
+                          <li>the numbers read in the above two steps are channel numbers representing the channel to treat as magnitude and the channel to treat as angle, respectively.  If for any coupling step the angle channel number equals the magnitude channel number, the magnitude channel number is greater than <tt>[audio_channels]</tt>-1, or the angle channel is greater than <tt>[audio_channels]</tt>-1, the stream is undecodable.<p>
+                          </ol>
+                   </ol>
+               <li>if unset, <tt>[vorbis_mapping_coupling_steps]</tt> = 0
+	       </ol>
            <li>read 2 bits (reserved field); if the value is nonzero, the stream is undecodable<p>
            <li>if <tt>[vorbis_mapping_submaps]</tt> is greater than one, we read channel multiplex settings.  For each <tt>[j]</tt> of <tt>[audio_channels]</tt> channels:<p>
                <ol><li>vector <tt>[vorbis_mapping_mux]</tt> element <tt>[j]</tt> = read 4 bits as unsigned integer<p>
@@ -259,9 +262,10 @@
   </ol>
 </ol>
 
-Vorbis windows all use the slope function y=sin(2*PI*sin^2(x/n)),
-but dissimilar lapping requirements can affect overall shape.  Window
-generation proceeds as follows:<p>
+Vorbis windows all use the slope function y=sin( .5 * PI * sin^2( (x+.5) /
+n * PI) ) where n is window size and x ranges 0...n-1, but dissimilar
+lapping requirements can affect overall shape.  Window generation
+proceeds as follows:<p>
 
 <ol>
 <li> <tt>[window_center]</tt> = <tt>[n]</tt> / 2
@@ -289,12 +293,12 @@
     </ol>
 <li> window from range 0 ... <tt>[left_window_start]</tt>-1 inclusive is zero
 
-<li> for <tt>[i]</tt> in range <tt>[left_window_start]</tt> ... <tt>[left_window_end]</tt>-1, window(<tt>[i]</tt>) = sin(2*PI*sin^2((<tt>[i]</tt>-<tt>[left_window_start]</tt>+.5)/<tt>[left_n]</tt>*PI/2))
+<li> for <tt>[i]</tt> in range <tt>[left_window_start]</tt> ... <tt>[left_window_end]</tt>-1, window(<tt>[i]</tt>) = sin(.5 * PI * sin^2( (<tt>[i]</tt>-<tt>[left_window_start]</tt>+.5) / <tt>[left_n]</tt> * .5 * PI) )
 
 
 <li> window from range <tt>[left_window_end]</tt> ... <tt>[right_window_start]</tt>-1 inclusive is one
 
-<li> for <tt>[i]</tt> in range <tt>[right_window_start]</tt> ... <tt>[right_window_end]</tt>-1, window(<tt>[i]</tt>) = sin(2*PI*sin^2((<tt>[i]</tt>-<tt>[right_window_start]</tt>+.5)/<tt>[right_n]</tt>*PI/2.+PI/2.))
+<li> for <tt>[i]</tt> in range <tt>[right_window_start]</tt> ... <tt>[right_window_end]</tt>-1, window(<tt>[i]</tt>) = sin(.5 * PI * sin^2( (<tt>[i]</tt>-<tt>[right_window_start]</tt>+.5) / <tt>[right_n]</tt> * .5 * PI/2. + .5 * PI) )
 
 <li> window from range <tt>[rigth_window_start]</tt> ... <tt>[n]</tt>-1 is zero
 

<p><p>1.32      +2 -2      vorbis/lib/mdct.c

Index: mdct.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/mdct.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- mdct.c	28 Jun 2002 22:19:36 -0000	1.31
+++ mdct.c	16 Oct 2002 02:43:48 -0000	1.32
@@ -12,7 +12,7 @@
 
  function: normalized modified discrete cosine transform
            power of two length transform only [64 <= n ]
- last mod: $Id: mdct.c,v 1.31 2002/06/28 22:19:36 xiphmont Exp $
+ last mod: $Id: mdct.c,v 1.32 2002/10/16 02:43:48 xiphmont Exp $
 
  Original algorithm adapted long ago from _The use of multirate filter
  banks for coding of high quality digital audio_, by T. Sporer,
@@ -26,7 +26,7 @@
 
  This module DOES NOT INCLUDE code to generate/apply the window
  function.  Everybody has their own weird favorite including me... I
- happen to like the properties of y=sin(2PI*sin^2(x)), but others may
+ happen to like the properties of y=sin(.5PI*sin^2(x)), but others may
  vehemently disagree.
 
  ********************************************************************/

<p><p>1.18      +2 -2      vorbis/lib/window.c

Index: window.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/window.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- window.c	23 Mar 2002 03:17:34 -0000	1.17
+++ window.c	16 Oct 2002 02:43:48 -0000	1.18
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: window functions
- last mod: $Id: window.c,v 1.17 2002/03/23 03:17:34 xiphmont Exp $
+ last mod: $Id: window.c,v 1.18 2002/10/16 02:43:48 xiphmont Exp $
 
  ********************************************************************/
 
@@ -26,7 +26,7 @@
 
   switch(type){
   case 0:
-    /* The 'vorbis window' (window 0) is sin(sin(x)*sin(x)*2pi) */
+    /* The 'vorbis window' (window 0) is sin(sin(x)*sin(x)*pi*.5) */
     {
     
       for(i=0;i<left;i++){

<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