diff options
author | Monty <xiphmont@xiph.org> | 2001-07-11 00:41:51 +0000 |
---|---|---|
committer | Monty <xiphmont@xiph.org> | 2001-07-11 00:41:51 +0000 |
commit | d81be2e3da00ef3c50d94efd1b3f3fdf0e3a75ad (patch) | |
tree | 1fdbdd9778fe93030a06abca638fee3aaa60aff1 | |
parent | cc47fb237698e97ef9ce3d526910f8b77b3f209d (diff) | |
download | libvorbis-git-d81be2e3da00ef3c50d94efd1b3f3fdf0e3a75ad.tar.gz |
Fix the too late static declare of decay
svn path=/branches/branch_monty_20010708/vorbis/; revision=1587
-rw-r--r-- | lib/psy.c | 77 |
1 files changed, 39 insertions, 38 deletions
@@ -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 void seed_chase(float *seeds, int linesper, long n){ } +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, @@ -705,43 +743,6 @@ static void bark_noise_median(int n,const long *b,const float *f, } -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, vorbis_look_psy_global *g, int channel, |