[xiph-cvs] cvs commit: vorbis/lib/modes psych_44.h

Monty xiphmont at xiph.org
Fri Apr 5 19:07:27 PST 2002



xiphmont    02/04/05 19:07:26

  Modified:    lib      envelope.c mapping0.c
               lib/modes psych_44.h
  Log:
  Correct a few more idiot bugs in short block triggering

Revision  Changes    Path
1.49      +23 -16    vorbis/lib/envelope.c

Index: envelope.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/envelope.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- envelope.c	2002/04/01 00:49:41	1.48
+++ envelope.c	2002/04/06 03:07:25	1.49
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: PCM data envelope analysis 
- last mod: $Id: envelope.c,v 1.48 2002/04/01 00:49:41 xiphmont Exp $
+ last mod: $Id: envelope.c,v 1.49 2002/04/06 03:07:25 xiphmont Exp $
 
  ********************************************************************/
 
@@ -51,12 +51,12 @@
 
   /* magic follows */
   e->band[0].begin=2;  e->band[0].end=4;
-  e->band[1].begin=4;  e->band[1].end=8;
-  e->band[2].begin=6;  e->band[2].end=10;
-  e->band[3].begin=12; e->band[3].end=12;
-  e->band[4].begin=18; e->band[4].end=16;
-  e->band[5].begin=26; e->band[5].end=20;
-  e->band[6].begin=36; e->band[6].end=24;
+  e->band[1].begin=4;  e->band[1].end=5;
+  e->band[2].begin=6;  e->band[2].end=6;
+  e->band[3].begin=9;  e->band[3].end=8;
+  e->band[4].begin=13;  e->band[4].end=8;
+  e->band[5].begin=17;  e->band[5].end=8;
+  e->band[6].begin=22;  e->band[6].end=8;
 
   for(j=0;j<VE_BANDS;j++){
     n=e->band[j].end;
@@ -192,6 +192,7 @@
       valmin=postmin-premin;
       valmax=postmax-premax;
 
+      /*filters[j].markers[pos]=valmax;*/
       filters[j].ampbuf[this]=acc;
       filters[j].ampptr++;
       if(filters[j].ampptr>=VE_AMP)filters[j].ampptr=0;
@@ -208,6 +209,11 @@
   return(ret);
 }
 
+#if 0
+static int seq=0;
+static ogg_int64_t totalshift=-1024;
+#endif
+
 long _ve_envelope_search(vorbis_dsp_state *v){
   vorbis_info *vi=v->vi;
   codec_setup_info *ci=vi->codec_setup;
@@ -221,7 +227,7 @@
 
   /* make sure we have enough storage to match the PCM */
   if(last>ve->storage){
-    ve->storage=last+VE_WIN;
+    ve->storage=last+VE_WIN+VE_POST; /* be sure */
     ve->mark=_ogg_realloc(ve->mark,ve->storage*sizeof(*ve->mark));
   }
 
@@ -239,6 +245,7 @@
 
     ve->mark[j+VE_POST]=0;
     if(ret&1){
+      //ve->mark[j-1]=1;
       ve->mark[j]=1;
       ve->mark[j+1]=1;
     }
@@ -301,14 +308,14 @@
               _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);
+	    for(l=0;l<last;l++)marker[l*ve->searchstep]=ve->mark[l]*.4;
+	    _analysis_output_always("mark",seq,marker,v->pcm_current,0,0,totalshift);
+	   
             
             seq++;
             
           }
-	  #endif
+#endif
 
           ve->curmark=j;
           if(j>=testW)return(1);
@@ -349,20 +356,20 @@
 }
 
 void _ve_envelope_shift(envelope_lookup *e,long shift){
-  int smallsize=e->current/e->searchstep; 
+  int smallsize=e->current/e->searchstep+VE_POST; /* adjust for placing marks
+						     ahead of ve->current */
   int smallshift=shift/e->searchstep;
   int i;
 
   memmove(e->mark,e->mark+smallshift,(smallsize-smallshift)*sizeof(*e->mark));
   
-#if 0
+  #if 0
   for(i=0;i<VE_BANDS*e->ch;i++)
     memmove(e->filter[i].markers,
             e->filter[i].markers+smallshift,
             (1024-smallshift)*sizeof(*(*e->filter).markers));
-  memmove(e->stretchm,e->stretchm+smallshift,(smallsize-smallshift)*sizeof(*e->stretchm));
   totalshift+=shift;
-#endif 
+  #endif 
 
   e->current-=shift;
   if(e->curmark>=0)

<p><p>1.49      +2 -2      vorbis/lib/mapping0.c

Index: mapping0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/mapping0.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- mapping0.c	2002/03/29 07:10:39	1.48
+++ mapping0.c	2002/04/06 03:07:25	1.49
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: channel mapping 0 implementation
- last mod: $Id: mapping0.c,v 1.48 2002/03/29 07:10:39 xiphmont Exp $
+ last mod: $Id: mapping0.c,v 1.49 2002/04/06 03:07:25 xiphmont Exp $
 
  ********************************************************************/
 
@@ -340,7 +340,7 @@
     _vorbis_apply_window(pcm,b->window,ci->blocksizes,vb->lW,vb->W,vb->nW);
     memcpy(fft,pcm,sizeof(*fft)*n);
     
-    //_analysis_output_always("windowed",seq+i,pcm,n,0,0,total-n/2);
+    /*_analysis_output_always("windowed",seq+i,pcm,n,0,0,total-n/2);*/
 
     /* transform the PCM data */
     /* only MDCT right now.... */

<p><p>1.14      +6 -6      vorbis/lib/modes/psych_44.h

Index: psych_44.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/modes/psych_44.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- psych_44.h	2002/03/30 01:56:59	1.13
+++ psych_44.h	2002/04/06 03:07:26	1.14
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: key psychoacoustic settings for 44.1/48kHz
- last mod: $Id: psych_44.h,v 1.13 2002/03/30 01:56:59 xiphmont Exp $
+ last mod: $Id: psych_44.h,v 1.14 2002/04/06 03:07:26 xiphmont Exp $
 
  ********************************************************************/
 
@@ -22,27 +22,27 @@
 
   {8,   /* lines per eighth octave */
    {20.f,14.f,10.f,10.f,10.f,10.f,10.f}, 
-   {-60.f,-30.f,-40.f,-40.f,-40.f,-40.f,-40.f}, 4,-75.f,
+   {-60.f,-30.f,-40.f,-40.f,-40.f,-40.f,-40.f}, 2,-75.f,
    -6.f, 0,
   },
   {8,   /* lines per eighth octave */
    {14.f,10.f,8.f,8.f,8.f,8.f,8.f}, 
-   {-40.f,-30.f,-25.f,-25.f,-25.f,-25.f,-25.f}, 4,-80.f,
+   {-40.f,-30.f,-25.f,-25.f,-25.f,-25.f,-25.f}, 2,-80.f,
    -6.f, 0,
   },
   {8,   /* lines per eighth octave */
    {12.f,8.f,8.f,8.f,8.f,8.f,8.f}, 
-   {-20.f,-20.f,-15.f,-15.f,-15.f,-15.f,-15.f}, 4,-80.f,
+   {-20.f,-20.f,-15.f,-15.f,-15.f,-15.f,-15.f}, 0,-80.f,
    -6.f, 0,
   },
   {8,   /* lines per eighth octave */
    {10.f,8.f,6.f,6.f,6.f,6.f,6.f}, 
-   {-20.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 2,-80.f,
+   {-20.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-80.f,
    -6.f, 0,
   },
   {8,   /* lines per eighth octave */
    {10.f,6.f,6.f,6.f,6.f,6.f,6.f}, 
-   {-15.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 2,-85.f,
+   {-15.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-85.f,
    -6.f, 0,
   },
 };

<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