Merge tag 'v1.3.7' into tizen
[platform/upstream/libvorbis.git] / vq / distribution.c
index b678bbf..7c0c095 100644 (file)
@@ -6,12 +6,11 @@
  * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
  *                                                                  *
  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
- * by the Xiph.Org Foundation http://www.xiph.org/                  *
+ * by the Xiph.Org Foundation https://xiph.org/                     *
  *                                                                  *
  ********************************************************************
 
  function: utility for finding the distribution in a data set
- last mod: $Id: distribution.c 16037 2009-05-26 21:10:58Z xiphmont $
 
  ********************************************************************/
 
@@ -108,7 +107,7 @@ int main(int argc,char *argv[]){
           if(c->lengthlist[j]){
             int indexdiv=1;
             printf("%4d: ",j);
-            for(k=0;k<b->dim;k++){        
+            for(k=0;k<b->dim;k++){
               int index= (j/indexdiv)%bins;
               printf("%+3.1f,", c->quantlist[index]*_float32_unpack(c->q_delta)+
                      _float32_unpack(c->q_min));
@@ -138,7 +137,7 @@ int main(int argc,char *argv[]){
           long maxcount=0,i,j;
           for(i=0;i<bins;i++)
             if(countarray[i]>maxcount)maxcount=countarray[i];
-      
+
           for(i=0;i<bins;i++){
             int ptr=sort[i]-c->quantlist;
             int stars=rint(50./maxcount*countarray[ptr]);
@@ -161,30 +160,30 @@ int main(int argc,char *argv[]){
 
     /* do it the simple way; two pass. */
     line=setup_line(in);
-    while(line){      
+    while(line){
       float code;
       char buf[80];
       lines++;
 
       sprintf(buf,"getting min/max (%.2f::%.2f). lines...",min,max);
       if(!(lines&0xff))spinnit(buf,lines);
-      
+
       while(!flag && sscanf(line,"%f",&code)==1){
         line=strchr(line,',');
         min=max=code;
         flag=1;
       }
-      
+
       while(line && sscanf(line,"%f",&code)==1){
         line=strchr(line,',');
         if(line)line++;
         if(code<min)min=code;
         if(code>max)max=code;
       }
-      
+
       line=setup_line(in);
     }
-    
+
     if(bins<1){
       if((int)(max-min)==min-max){
         bins=max-min;
@@ -192,43 +191,43 @@ int main(int argc,char *argv[]){
         bins=25;
       }
     }
-    
+
     printf("\r                                                     \r");
     printf("Minimum scalar value: %f\n",min);
     printf("Maximum scalar value: %f\n",max);
 
     if(argv[2]){
-      
+
       printf("\n counting hits into %ld bins...\n",bins+1);
       countarray=calloc(bins+1,sizeof(long));
-      
+
       rewind(in);
       line=setup_line(in);
-      while(line){      
+      while(line){
         float code;
         lines--;
         if(!(lines&0xff))spinnit("counting distribution. lines so far...",lines);
-        
+
         while(line && sscanf(line,"%f",&code)==1){
           line=strchr(line,',');
           if(line)line++;
-          
+
           code-=min;
           code/=(max-min);
           code*=bins;
           countarray[(int)rint(code)]++;
           total++;
         }
-        
+
         line=setup_line(in);
       }
-    
+
       /* make a pretty graph */
       {
         long maxcount=0,i,j;
         for(i=0;i<bins+1;i++)
           if(countarray[i]>maxcount)maxcount=countarray[i];
-        
+
         printf("\r                                                     \r");
         printf("Total scalars: %ld\n",total);
         for(i=0;i<bins+1;i++){