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

Monty xiphmont at xiph.org
Thu Dec 6 04:47:35 PST 2001



xiphmont    01/12/06 04:47:34

  Modified:    lib      Tag: branch_monty_20011009 vorbisenc.c
               lib/modes Tag: branch_monty_20011009 residue_44.h
  Log:
  fix more 'first time around' bugs found in testing

Revision  Changes    Path
No                   revision

No                   revision

1.17.2.6  +24 -19    vorbis/lib/vorbisenc.c

Index: vorbisenc.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/vorbisenc.c,v
retrieving revision 1.17.2.5
retrieving revision 1.17.2.6
diff -u -r1.17.2.5 -r1.17.2.6
--- vorbisenc.c	2001/12/06 09:58:56	1.17.2.5
+++ vorbisenc.c	2001/12/06 12:47:33	1.17.2.6
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: simple programmatic interface for encoder mode setup
- last mod: $Id: vorbisenc.c,v 1.17.2.5 2001/12/06 09:58:56 xiphmont Exp $
+ last mod: $Id: vorbisenc.c,v 1.17.2.6 2001/12/06 12:47:33 xiphmont Exp $
 
  ********************************************************************/
 
@@ -408,6 +408,28 @@
 
   /* for uncoupled, we use type 1, else type 2 */
   if(coupled_p){
+    ci->residue_type[block]=2;
+  }else{
+    ci->residue_type[block]=1;
+  }
+
+  switch(ci->residue_type[block]){
+  case 1:
+    n=r->end=ci->blocksizes[block?1:0]>>1; /* 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;
+    break;
+  case 2:
+    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;
+  }
+
+  for(i=0;i<r->partitions;i++)
+    if(r->blimit[i]<0)r->blimit[i]=partition_position;
+  
+  if(coupled_p){
     int k;
     vorbis_info_mapping0 *map=ci->map_param[block];
 
@@ -415,8 +437,6 @@
     map->coupling_mag[0]=0;
     map->coupling_ang[0]=1;
 
-    ci->residue_type[block]=2;
-
     psy->couple_pass[0].granulem=1.;
     psy->couple_pass[0].igranulem=1.;
 
@@ -424,7 +444,7 @@
     psy->couple_pass[0].couple_pass[0].outofphase_redundant_flip_p=1;
     psy->couple_pass[0].couple_pass[0].outofphase_requant_limit=9e10;
     psy->couple_pass[0].couple_pass[0].amppost_point=0;
-    psy->couple_pass[0].couple_pass[0].limit=9999;
+    psy->couple_pass[0].couple_pass[1].limit=9999;
     psy->couple_pass[0].couple_pass[1].outofphase_redundant_flip_p=1;
     psy->couple_pass[0].couple_pass[1].outofphase_requant_limit=9e10;
     psy->couple_pass[0].couple_pass[1].amppost_point=stereo_threshholds[a[iq]];
@@ -476,8 +496,6 @@
       memcpy(ci->psy_param[block+1],psy,sizeof(*psy));
 
   }else{
-    ci->residue_type[block]=1;
-
     ci->passlimit[0]=3;
 
     if(residue_backfill_p){
@@ -521,19 +539,6 @@
     }
   }
 
-  switch(ci->residue_type[block]){
-  case 1:
-    n=r->end=ci->blocksizes[block?1:0]>>1; /* to be adjusted by lowpass later */
-    break;
-  case 2:
-    n=r->end=ci->blocksizes[block?1:0]; /* to be adjusted by lowpass later */
-    break;
-  }
-
-  partition_position=rint((double)c[iq]*1000/(vi->rate/2)*n/r->grouping);
-  for(i=0;i<r->partitions;i++)
-    if(r->blimit[i]<0)r->blimit[i]=partition_position;
-  
   return(0);
 }      
 

No                   revision

No                   revision

1.1.2.4   +2 -2      vorbis/lib/modes/Attic/residue_44.h

Index: residue_44.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/modes/Attic/residue_44.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- residue_44.h	2001/12/06 09:58:56	1.1.2.3
+++ residue_44.h	2001/12/06 12:47:34	1.1.2.4
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: toplevel residue templates for 32/44.1/48kHz
- last mod: $Id: residue_44.h,v 1.1.2.3 2001/12/06 09:58:56 xiphmont Exp $
+ last mod: $Id: residue_44.h,v 1.1.2.4 2001/12/06 12:47:34 xiphmont Exp $
 
  ********************************************************************/
 
@@ -109,7 +109,7 @@
      {{0}}, /* 6dB (2.5) stereo */
      {{0}}, /* 12dB (4.5) stereo */
      {{0}}, /* 17dB (7.5) stereo */
-     {{0,0,&44c0_s0_p1_0},{0,0,&44c0_s0_p2_0},{0,0,&44c0_s0_p3_0},{&44c0_s0_p4_0,&44c0_p4_1},
+     {{0},{0,0,&44c0_s0_p1_0},{0,0,&44c0_s0_p2_0},{0,0,&44c0_s0_p3_0},{&44c0_s0_p4_0,&44c0_p4_1},
       {0,0,&44c0_s1_p5_0},{0,0,&44c0_s1_p6_0},{0,0,&44c0_s2_p7_0},{&44c0_s4_p8_0,&44c0_s4_p8_1},
       {&44c0_s4_p9_0,&44c0_s4_p9_1,&44c0_s4_p9_2}}, /* 22dB (12.5) stereo */
      {{0}}, /* 27dB (22.5) stereo */

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