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

Monty xiphmont at xiph.org
Tue Jul 10 17:41:53 PDT 2001



xiphmont    01/07/10 17:41:52

  Modified:    lib      Tag: branch_monty_20010708 psy.c
  Log:
  Fix the too late static declare of decay

Revision  Changes    Path
No                   revision

No                   revision

1.48.2.2  +39 -38    vorbis/lib/psy.c

Index: psy.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/psy.c,v
retrieving revision 1.48.2.1
retrieving revision 1.48.2.2
diff -u -r1.48.2.1 -r1.48.2.2
--- psy.c	2001/07/08 08:48:01	1.48.2.1
+++ psy.c	2001/07/11 00:41:51	1.48.2.2
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: psychoacoustics not including preecho
- last mod: $Id: psy.c,v 1.48.2.1 2001/07/08 08:48:01 xiphmont Exp $
+ last mod: $Id: psy.c,v 1.48.2.2 2001/07/11 00:41:51 xiphmont Exp $
 
  ********************************************************************/
 
@@ -541,6 +541,44 @@
 
 }
 
+static int seq=0;
+static void _vp_compute_mask_decay(vorbis_look_psy *p,
+				   vorbis_look_psy_global *g,
+				   float *seed,int channel){
+  if(g->gi->decaydBpms<0){
+    int i;
+
+    /* first decay the entire cached buffer */
+    float *decay=g->decay[channel];
+    float ms=p->n*1000.f/p->rate;
+    float decaydB=g->gi->decaydBpms*ms;
+
+    for(i=0;i<g->decaylines;i++){
+      decay[i]+=decaydB;
+      if(decay[i]<-9999.f)decay[i]=-9999.f;
+    }
+    _analysis_output("decay",seq,decay+200,g->decaylines-200,0,0);
+    _analysis_output("seed",seq++,seed-p->firstoc+200,p->total_octave_lines+p->firstoc-200,0,0);
+
+    /* now, apply decayed buffer to the valid range of the seeds,
+       copy back larger seeds into cache */
+    {
+      float end=p->total_octave_lines+p->firstoc-1;
+      int begin=-p->firstoc;
+
+      if(end>g->decaylines)end=g->decaylines;
+      if(begin<260)begin=260;
+      for(i=begin;i<end;i++){
+	if(decay[i]>seed[i-p->firstoc])
+	  seed[i-p->firstoc]=decay[i];
+	else
+	  decay[i]=seed[i-p->firstoc];
+      }
+    }
+  }
+}
+
+
 /* bleaugh, this is more complicated than it needs to be */
 static void max_seeds(vorbis_look_psy *p,
                       vorbis_look_psy_global *g,
@@ -703,43 +741,6 @@
     noise[i]= (median+1)*.5f+off[i];
   }
 
-}
-
-static int seq=0;
-static void _vp_compute_mask_decay(vorbis_look_psy *p,
-				   vorbis_look_psy_global *g,
-				   float *seed,int channel){
-  if(g->gi->decaydBpms<0){
-    int i;
-
-    /* first decay the entire cached buffer */
-    float *decay=g->decay[channel];
-    float ms=p->n*1000.f/p->rate;
-    float decaydB=g->gi->decaydBpms*ms;
-
-    for(i=0;i<g->decaylines;i++){
-      decay[i]+=decaydB;
-      if(decay[i]<-9999.f)decay[i]=-9999.f;
-    }
-    _analysis_output("decay",seq,decay+200,g->decaylines-200,0,0);
-    _analysis_output("seed",seq++,seed-p->firstoc+200,p->total_octave_lines+p->firstoc-200,0,0);
-
-    /* now, apply decayed buffer to the valid range of the seeds,
-       copy back larger seeds into cache */
-    {
-      float end=p->total_octave_lines+p->firstoc-1;
-      int begin=-p->firstoc;
-
-      if(end>g->decaylines)end=g->decaylines;
-      if(begin<260)begin=260;
-      for(i=begin;i<end;i++){
-	if(decay[i]>seed[i-p->firstoc])
-	  seed[i-p->firstoc]=decay[i];
-	else
-	  decay[i]=seed[i-p->firstoc];
-      }
-    }
-  }
 }
 
 float _vp_compute_mask(vorbis_look_psy *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