[xiph-cvs] cvs commit: vorbis/lib envelope.c scales.h

Monty xiphmont at xiph.org
Fri Mar 29 00:18:24 PST 2002



xiphmont    02/03/29 00:18:24

  Modified:    lib      envelope.c scales.h
  Log:
  Two segfault fixes to new envelope.c [correcting stupid logic mistakes]
  one fix to FABS() for VORBIS_IEEE_FLOAT32

Revision  Changes    Path
1.46      +15 -10    vorbis/lib/envelope.c

Index: envelope.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/envelope.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- envelope.c	2002/03/29 07:10:39	1.45
+++ envelope.c	2002/03/29 08:18:23	1.46
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: PCM data envelope analysis 
- last mod: $Id: envelope.c,v 1.45 2002/03/29 07:10:39 xiphmont Exp $
+ last mod: $Id: envelope.c,v 1.46 2002/03/29 08:18:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -245,7 +245,7 @@
 
     if(ret&2){
       ve->mark[j]=1;
-      ve->mark[j-1]=1;
+      if(j>0)ve->mark[j-1]=1;
     }
   }
 
@@ -264,10 +264,13 @@
     while(j<ve->current-(ve->searchstep)){/* account for postecho
                                              working back one window */
       if(j>=testW)return(1);
+ 
+      ve->cursor=j;
+
       if(ve->mark[j/ve->searchstep]){
         if(j>centerW){
 
-	  #if 0
+#if 0
           if(j>ve->curmark){
             float *marker=alloca(v->pcm_current*sizeof(*marker));
             int l,m;
@@ -295,17 +298,16 @@
               for(l=0;l<last;l++)marker[l*ve->searchstep]=ve->filter[m+VE_BANDS].markers[l]*.1;
               _analysis_output_always(buf,seq,marker,v->pcm_current,0,0,totalshift);
             }
-
+	    
             for(l=0;l<last;l++)marker[l*ve->searchstep]=ve->stretchm[l]*.1;
             _analysis_output_always("stretch",seq,marker,v->pcm_current,0,0,totalshift);
-
+	    
             seq++;
-
+	    
           }
-	  #endif
+#endif
 
           ve->curmark=j;
-	  ve->cursor=j;
           if(j>=testW)return(1);
           return(0);
         }
@@ -313,8 +315,7 @@
       j+=ve->searchstep;
     }
   }
-  ve->cursor=j;
- 
+  
   return(-1);
 }
 
@@ -367,5 +368,9 @@
     e->curmark-=shift;
   e->cursor-=shift;
 }
+
+
+
+
 
 

<p><p>1.24      +2 -2      vorbis/lib/scales.h

Index: scales.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/scales.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- scales.h	2002/03/29 07:10:39	1.23
+++ scales.h	2002/03/29 08:18:23	1.24
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: linear scale -> dB, Bark and Mel scales
- last mod: $Id: scales.h,v 1.23 2002/03/29 07:10:39 xiphmont Exp $
+ last mod: $Id: scales.h,v 1.24 2002/03/29 08:18:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -31,7 +31,7 @@
 }
 
 static float FABS(float *x){
-  ogg_uint32_t *ix=(ogg_uint32_t *)&x;
+  ogg_uint32_t *ix=(ogg_uint32_t *)x;
   *ix&=0x7fffffffUL;
   return(*x);
 }

<p><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