[xiph-cvs] cvs commit: vorbis/lib/books lsp12_0.vqh lsp12_1.vqh

Monty xiphmont at xiph.org
Fri Dec 7 00:38:40 PST 2001



xiphmont    01/12/07 00:38:37

  Modified:    lib      Tag: branch_monty_20011009 mapping0.c vorbisenc.c
  Removed:     lib/books Tag: branch_monty_20011009 lsp12_0.vqh lsp12_1.vqh
  Log:
  ongoing work

Revision  Changes    Path
No                   revision

No                   revision

1.37.2.12 +29 -27    vorbis/lib/mapping0.c

Index: mapping0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/mapping0.c,v
retrieving revision 1.37.2.11
retrieving revision 1.37.2.12
diff -u -r1.37.2.11 -r1.37.2.12
--- mapping0.c	2001/12/05 08:03:17	1.37.2.11
+++ mapping0.c	2001/12/07 08:38:26	1.37.2.12
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: channel mapping 0 implementation
- last mod: $Id: mapping0.c,v 1.37.2.11 2001/12/05 08:03:17 xiphmont Exp $
+ last mod: $Id: mapping0.c,v 1.37.2.12 2001/12/07 08:38:26 xiphmont Exp $
 
  ********************************************************************/
 
@@ -547,34 +547,36 @@
       }
       i++;
         
-      /* down-couple/down-quantize from perfect-'so-far' -> 
+      if(i<quant_passes){
+	/* down-couple/down-quantize from perfect-'so-far' -> 
          new quantized vector */
-      if(info->coupling_steps==0){
-	/* this assumes all or nothing coupling right now.  it should pass
-	   through any channels left uncoupled, but it doesn't do that now */
-	int k;
-	for(k=0;k<vi->channels;k++){
-	  float *lpcm=pcm[k];
-	  float *lsof=sofar[k];
-	  float *lqua=quantized[k];
-	  for(j=0;j<n/2;j++)
-	    lqua[j]=lpcm[j]-lsof[j];
+	if(info->coupling_steps==0){
+	  /* this assumes all or nothing coupling right now.  it should pass
+	     through any channels left uncoupled, but it doesn't do that now */
+	  int k;
+	  for(k=0;k<vi->channels;k++){
+	    float *lpcm=pcm[k];
+	    float *lsof=sofar[k];
+	    float *lqua=quantized[k];
+	    for(j=0;j<n/2;j++)
+	      lqua[j]=lpcm[j]-lsof[j];
+	  }
+	}else{
+	  char buf[80];
+	  
+	  _vp_quantize_couple(look->psy_look[blocktype],
+			      info,
+			      pcm,
+			      sofar,
+			      quantized,
+			      nonzero,
+			      i);
+	  
+	  sprintf(buf,"quant%d",i);
+	  for(j=0;j<vi->channels;j++)
+	    _analysis_output(buf,seq+j,quantized[j],n/2,1,0);
+	  
         }
-      }else{
-	char buf[80];
-	
-	_vp_quantize_couple(look->psy_look[blocktype],
-			    info,
-			    pcm,
-			    sofar,
-			    quantized,
-			    nonzero,
-			    i);
-	
-	sprintf(buf,"quant%d",i);
-	for(j=0;j<vi->channels;j++)
-	  _analysis_output(buf,seq+j,quantized[j],n/2,1,0);
-	
       }
     }
     seq+=vi->channels;

1.17.2.7  +17 -22    vorbis/lib/vorbisenc.c

Index: vorbisenc.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/vorbisenc.c,v
retrieving revision 1.17.2.6
retrieving revision 1.17.2.7
diff -u -r1.17.2.6 -r1.17.2.7
--- vorbisenc.c	2001/12/06 12:47:33	1.17.2.6
+++ vorbisenc.c	2001/12/07 08:38:27	1.17.2.7
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: simple programmatic interface for encoder mode setup
- last mod: $Id: vorbisenc.c,v 1.17.2.6 2001/12/06 12:47:33 xiphmont Exp $
+ last mod: $Id: vorbisenc.c,v 1.17.2.7 2001/12/07 08:38:27 xiphmont Exp $
 
  ********************************************************************/
 
@@ -36,11 +36,13 @@
 typedef struct {
   vorbis_info_residue0 *res;
   static_codebook *book_aux[2];
-  static_codebook *books_base[6][10][3];
-  static_codebook *books_stereo_backfill[6][10];
-  static_codebook *books_residue_backfill[6][10][2];
+  static_codebook *books_base[5][10][3];
+  static_codebook *books_stereo_backfill[5][10];
+  static_codebook *books_residue_backfill[5][10][2];
 } vorbis_residue_template;
 
+static double stereo_threshholds[]={0.0, 2.5, 4.5, 8.5, 16.5};
+
 typedef struct vp_adjblock{
   int block[P_BANDS][P_LEVELS];
 } vp_adjblock;
@@ -128,12 +130,12 @@
     int maxbook=-1;
     for(i=0;i<partitions;i++)
       if(f->partitionclass[i]>maxclass)maxclass=f->partitionclass[i];
-    for(i=0;i<maxclass;i++){
+    for(i=0;i<=maxclass;i++){
       if(f->class_book[i]>maxbook)maxbook=f->class_book[i];
       f->class_book[i]+=ci->books;
       for(k=0;k<(1<<f->class_subs[i]);k++){
         if(f->class_subbook[i][k]>maxbook)maxbook=f->class_subbook[i][k];
-	f->class_subbook[i][k]+=ci->books;
+	if(f->class_subbook[i][k]>=0)f->class_subbook[i][k]+=ci->books;
       }
     }
 
@@ -364,7 +366,6 @@
   return(0);
 }
 
-static double stereo_threshholds[]={0.0, 2.5, 4.5, 7.5, 12.5, 22.5};
 static int vorbis_encode_residue_init(vorbis_info *vi,double q,int block,
                                       int coupled_p,
                                       int stereo_backfill_p,
@@ -399,6 +400,7 @@
 
   r=ci->residue_param[block]=malloc(sizeof(*r));
   memcpy(r,in[iq].res,sizeof(*r));
+  if(ci->residues<=block)ci->residues=block+1;
 
   if(block){
     r->grouping=32;
@@ -420,7 +422,7 @@
     res_position=partition_position*r->grouping;
     break;
   case 2:
-    n=r->end=ci->blocksizes[block?1:0]>>1*vi->channels; /* to be adjusted by lowpass later */
+    n=r->end=(ci->blocksizes[block?1:0]>>1)*vi->channels; /* to be adjusted by lowpass later */
     partition_position=rint((double)c[iq]*1000/(vi->rate/2)*n/r->grouping);
     res_position=partition_position*r->grouping/vi->channels;
     break;
@@ -461,7 +463,7 @@
       memcpy(psy->couple_pass+iterations,psy->couple_pass+iterations-1,
              sizeof(*psy->couple_pass));
       amplitude_select=a[iq]-1;
-      psy->couple_pass[1].couple_pass[1].limit=stereo_threshholds[a[iq]-1];
+      psy->couple_pass[1].couple_pass[1].amppost_point=stereo_threshholds[a[iq]-1];
       ci->passlimit[1]=4;
       for(i=0;i<r->partitions;i++)
         if(in[iq].books_stereo_backfill[a[iq]-1][i])
@@ -597,13 +599,6 @@
                            float base_quality /* 0. to 1. */
                            ){
   int ret=0;
-  int stereo_backfill_p=0;
-  int residue_backfill_p=0;
-
-#ifdef TRAIN_RES
-  stereo_backfill_p=1;
-  residue_backfill_p=1;
-#endif
 
   base_quality=0.;
 
@@ -659,17 +654,17 @@
       /* unmanaged, one iteration residue setup */
       ret|=vorbis_encode_residue_init(vi,base_quality,0,
                                       1, /* coupled */
-				      stereo_backfill_p, /* no mid stereo backfill */
-				      residue_backfill_p, /* no residue backfill */
-				      _residue_template_44_stereo_temp,
+				      0, /* no mid stereo backfill */
+				      0, /* no residue backfill */
+				      _residue_template_44_stereo,
                                       4,  3,  3,  2,   1,  0,  0,  0,  0,  0,  0,
                                       4., 4., 6., 6., 10., 4., 4., 4., 4., 4., 4.);
       
       ret|=vorbis_encode_residue_init(vi,base_quality,1,
                                       1, /* coupled */
-				      stereo_backfill_p, /* no mid stereo backfill */
-				      residue_backfill_p, /* no residue backfill */
-				      _residue_template_44_stereo_temp,
+				      0, /* no mid stereo backfill */
+				      0, /* no residue backfill */
+				      _residue_template_44_stereo,
                                       4,  3,  3,   2,   1,  0,  0,  0,  0,  0,  0,
                                       4., 6., 6., 10., 10., 4., 4., 4., 4., 4., 4.);      
 

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