mapping0.c (mapping0_unpack): kill a useless memset()
[platform/upstream/libvorbis.git] / vq / latticebuild.c
index ef225ae..acfe9ff 100644 (file)
@@ -11,7 +11,6 @@
  ********************************************************************
 
  function: utility main for building codebooks from lattice descriptions
- last mod: $Id$
 
  ********************************************************************/
 
@@ -25,7 +24,7 @@
 /* The purpose of this util is just to finish packaging the
    description into a static codebook.  It used to count hits for a
    histogram, but I've divorced that out to add some flexibility (it
-   currently generates an equal probability codebook) 
+   currently generates an equal probability codebook)
 
    command line:
    latticebuild description.vql
@@ -34,7 +33,7 @@
 
    <n> <dim> <multiplicitavep> <sequentialp>
    <value_0> <value_1> <value_2> ... <value_n-1>
-   
+
    a threshmap (or pigeonmap) struct is generated by latticehint;
    there are fun tricks one can do with the threshmap and cascades,
    but the utils don't know them...
@@ -82,7 +81,7 @@ int main(int argc,char *argv[]){
       fprintf(stderr,"Could not open input file %s\n",filename);
       exit(1);
     }
-    
+
     ptr=strrchr(filename,'.');
     if(ptr){
       *ptr='\0';
@@ -92,7 +91,7 @@ int main(int argc,char *argv[]){
     }
 
   }
-  
+
   /* read the description */
   line=get_line(in);
   if(sscanf(line,"%d %d %d %d",&quantvals,&dim,&addmul,&sequencep)!=4){
@@ -116,7 +115,7 @@ int main(int argc,char *argv[]){
 
   reset_next_value();
   line=setup_line(in);
-  for(j=0;j<quantvals;j++){ 
+  for(j=0;j<quantvals;j++){
     char *temp;
     if(!line || sscanf(line,"%lf",quantlist+j)!=1){
       fprintf(stderr,"Ran out of data on line 2 of description file\n");
@@ -136,14 +135,14 @@ int main(int argc,char *argv[]){
     for(j=1;j<quantvals;j++)if(quantlist[j]<min)min=quantlist[j];
     for(j=0;j<quantvals;j++)
       for(i=j+1;i<quantvals;i++)
-       if(mindel==-1 || fabs(quantlist[j]-quantlist[i])<mindel)
-         mindel=fabs(quantlist[j]-quantlist[i]);
+        if(mindel==-1 || fabs(quantlist[j]-quantlist[i])<mindel)
+          mindel=fabs(quantlist[j]-quantlist[i]);
 
     j=0;
     while(j<quantvals){
       for(j=0;j<quantvals;j++){
-       double test=fac*(quantlist[j]-min)/mindel;
-       if( fabs(rint(test)-test)>.00001f) break;
+        double test=fac*(quantlist[j]-min)/mindel;
+        if( fabs(rint(test)-test)>.00001f) break;
       }
       if(fac>100)break;
       if(j<quantvals)fac++;
@@ -172,6 +171,6 @@ int main(int argc,char *argv[]){
   /* save the book in C header form */
   write_codebook(stdout,name,&c);
   fprintf(stderr,"\r                                                     "
-         "\nDone.\n");
+          "\nDone.\n");
   exit(0);
 }