summaryrefslogtreecommitdiff
path: root/lib/envelope.c
diff options
context:
space:
mode:
authorMonty <xiphmont@xiph.org>2002-03-29 08:18:23 +0000
committerMonty <xiphmont@xiph.org>2002-03-29 08:18:23 +0000
commit36600ed5c72a45b99dbf1f878d233940301b53d3 (patch)
tree9868eb67d549d5b881d6072e56b3dcbd6e0f5e56 /lib/envelope.c
parent7aab9f3c87417ac2533a6bd909138eeea6141f3f (diff)
downloadlibvorbis-git-36600ed5c72a45b99dbf1f878d233940301b53d3.tar.gz
Two segfault fixes to new envelope.c [correcting stupid logic mistakes]
one fix to FABS() for VORBIS_IEEE_FLOAT32 svn path=/trunk/vorbis/; revision=3200
Diffstat (limited to 'lib/envelope.c')
-rw-r--r--lib/envelope.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/envelope.c b/lib/envelope.c
index 160ccccd..424a82b3 100644
--- a/lib/envelope.c
+++ b/lib/envelope.c
@@ -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 @@ long _ve_envelope_search(vorbis_dsp_state *v){
if(ret&2){
ve->mark[j]=1;
- ve->mark[j-1]=1;
+ if(j>0)ve->mark[j-1]=1;
}
}
@@ -264,10 +264,13 @@ long _ve_envelope_search(vorbis_dsp_state *v){
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 @@ long _ve_envelope_search(vorbis_dsp_state *v){
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 @@ long _ve_envelope_search(vorbis_dsp_state *v){
j+=ve->searchstep;
}
}
- ve->cursor=j;
-
+
return(-1);
}
@@ -369,3 +370,7 @@ void _ve_envelope_shift(envelope_lookup *e,long shift){
}
+
+
+
+