X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=vq%2Fhuffbuild.c;h=04a6a1a6d902e7779b6504259256bf859acc9a8d;hb=679433ebb8287744a9801f847b7a105dbc2a0404;hp=632571c4976f40d5410cc0eda4af9472b681ccde;hpb=d3cd0c4a8f6862b014212cc3be1e00955e999ea6;p=platform%2Fupstream%2Flibvorbis.git
diff --git a/vq/huffbuild.c b/vq/huffbuild.c
index 632571c..04a6a1a 100644
--- a/vq/huffbuild.c
+++ b/vq/huffbuild.c
@@ -5,13 +5,12 @@
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
- * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2014 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: hufftree builder
- last mod: $Id$
********************************************************************/
@@ -49,13 +48,13 @@ static int getval(FILE *in,int begin,int n,int group,int max){
static void usage(){
fprintf(stderr,
- "usage:\n"
- "huffbuild .vqd | [noguard]\n"
- " where begin,n,group is first scalar, \n"
- " number of scalars of each in line,\n"
- " number of scalars in a group\n"
- "eg: huffbuild reslongaux.vqd 0,1024,4\n"
- "produces reslongaux.vqh\n\n");
+ "usage:\n"
+ "huffbuild .vqd | [noguard]\n"
+ " where begin,n,group is first scalar, \n"
+ " number of scalars of each in line,\n"
+ " number of scalars in a group\n"
+ "eg: huffbuild reslongaux.vqd 0,1024,4\n"
+ "produces reslongaux.vqh\n\n");
exit(1);
}
@@ -86,17 +85,17 @@ int main(int argc, char *argv[]){
}else{
begin=atoi(argv[2]);
if(!pos)
- usage();
+ usage();
else
- n=atoi(pos+1);
+ n=atoi(pos+1);
pos=strchr(pos+1,',');
if(!pos)
- usage();
+ usage();
else
- subn=atoi(pos+1);
+ subn=atoi(pos+1);
if(n/subn*subn != n){
- fprintf(stderr,"n must be divisible by group\n");
- exit(1);
+ fprintf(stderr,"n must be divisible by group\n");
+ exit(1);
}
}
}
@@ -136,10 +135,10 @@ int main(int argc, char *argv[]){
reset_next_value();
i/=subn;
while(!feof(file)){
- long val=getval(file,begin,n,subn,maxval);
- if(val==-1 || val>=vals)break;
- hist[val]++;
- if(!(i--&0xff))spinnit("loading... ",i*subn);
+ long val=getval(file,begin,n,subn,maxval);
+ if(val==-1 || val>=vals)break;
+ hist[val]++;
+ if(!(i--&0xff))spinnit("loading... ",i*subn);
}
fclose(file);
}
@@ -155,18 +154,18 @@ int main(int argc, char *argv[]){
strcat(buffer,".vqh");
file=fopen(buffer,"w");
if(!file){
- fprintf(stderr,"Could not open file %s\n",buffer);
- exit(1);
+ fprintf(stderr,"Could not open file %s\n",buffer);
+ exit(1);
}
}
/* first, the static vectors, then the book structure to tie it together. */
/* lengthlist */
- fprintf(file,"static const long _huff_lengthlist_%s[] = {\n",base);
+ fprintf(file,"static const char _huff_lengthlist_%s[] = {\n",base);
for(j=0;j