a little bughunting
authorMonty <xiphmont@xiph.org>
Sun, 13 Feb 2000 11:53:48 +0000 (11:53 +0000)
committerMonty <xiphmont@xiph.org>
Sun, 13 Feb 2000 11:53:48 +0000 (11:53 +0000)
svn path=/trunk/vorbis/; revision=260

lib/mapping0.c
lib/res0.c

index df36ce5..5a1eb74 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: channel mapping 0 implementation
- last mod: $Id: mapping0.c,v 1.9 2000/02/12 08:33:06 xiphmont Exp $
+ last mod: $Id: mapping0.c,v 1.10 2000/02/13 11:53:46 xiphmont Exp $
 
  ********************************************************************/
 
@@ -228,15 +228,16 @@ static int forward(vorbis_block *vb,vorbis_look_mapping *l){
       _vp_mask_floor(look->psy_look+submap,pcm,mask,1);
  
       /* perform floor encoding; takes transform floor, returns decoded floor */
+      /*      nonzero[i]=look->floor_func[submap]->
+             forward(vb,look->floor_look[submap],floor,decfloor);*/
       nonzero[i]=look->floor_func[submap]->
-       forward(vb,look->floor_look[submap],floor,decfloor);
-      
-      /* no iterative residue/floor tuning at the moment */
-      
+       forward(vb,look->floor_look[submap],mask,decfloor);
+
 #ifdef TRAIN
       if(nonzero[i]){
        FILE *of;
        char buffer[80];
+       int i;
        
        sprintf(buffer,"masked_%d.vqd",vb->mode);
        of=fopen(buffer,"a");
@@ -253,6 +254,9 @@ static int forward(vorbis_block *vb,vorbis_look_mapping *l){
       }
 #endif      
 
+      /* no iterative residue/floor tuning at the moment */
+      if(nonzero[i])for(j=0;j<n/2;j++)pcm[j]/=decfloor[j];
+      
     }
     
     /* perform residue encoding with residue mapping; this is
@@ -263,7 +267,7 @@ static int forward(vorbis_block *vb,vorbis_look_mapping *l){
       int ch_in_bundle=0;
       for(j=0;j<vi->channels;j++){
        if(map->chmuxlist[j]==i && nonzero[j]==1){
-         pcmbundle[ch_in_bundle]=vb->pcm[j];
+         pcmbundle[ch_in_bundle++]=vb->pcm[j];
        }
       }
       
index ec0b27c..0134d7d 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: residue backend 0 implementation
- last mod: $Id: res0.c,v 1.5 2000/02/12 08:33:09 xiphmont Exp $
+ last mod: $Id: res0.c,v 1.6 2000/02/13 11:53:48 xiphmont Exp $
 
  ********************************************************************/
 
@@ -114,7 +114,7 @@ int forward(vorbis_block *vb,vorbis_look_residue *l,
   vorbis_info_residue0 *info=look->info;
   for(i=0;i<ch;i++)
     for(j=0;j<vb->pcmend/2;j++)
-      _oggpack_write(&vb->opb,rint(in[i][j])+16,5);
+      _oggpack_write(&vb->opb,rint(in[i][j])+32,6);
   return(0);
 }
 
@@ -122,7 +122,7 @@ int inverse(vorbis_block *vb,vorbis_look_residue *l,double **in,int ch){
   long i,j;
   for(i=0;i<ch;i++)
     for(j=0;j<vb->pcmend/2;j++)
-      in[i][j]*=_oggpack_read(&vb->opb,5)-16;
+      in[i][j]*=_oggpack_read(&vb->opb,6)-32;
   return(0);
 }