[xiph-cvs] cvs commit: vorbis/vq Makefile bookutil.c build.c huffbuild.c lspdata.c train.c Makefile.in
Monty
xiphmont at xiph.org
Tue Oct 31 00:25:19 PST 2000
xiphmont 00/10/31 00:25:19
Modified: vq Tag: branch_beta3 bookutil.c build.c huffbuild.c
lspdata.c train.c
Added: vq Tag: branch_beta3 Makefile
Removed: vq Tag: branch_beta3 Makefile.in
Log:
trainer fixes and a working vq/ Makefile for Greg
Monty
Revision Changes Path
No revision
No revision
1.17.2.1 +2 -2 vorbis/vq/bookutil.c
Index: bookutil.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/bookutil.c,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -u -r1.17 -r1.17.2.1
--- bookutil.c 2000/10/12 03:13:01 1.17
+++ bookutil.c 2000/10/31 08:25:17 1.17.2.1
@@ -12,7 +12,7 @@
********************************************************************
function: utility functions for loading .vqh and .vqd files
- last mod: $Id: bookutil.c,v 1.17 2000/10/12 03:13:01 xiphmont Exp $
+ last mod: $Id: bookutil.c,v 1.17.2.1 2000/10/31 08:25:17 xiphmont Exp $
********************************************************************/
@@ -308,7 +308,7 @@
/* how big? */
c->pigeon_tree=p=calloc(1,sizeof(encode_aux_pigeonhole));
line=get_line(in);
- if(sscanf(line,"%lf, %lf, %d, %d",&(p->min),&(p->del),
+ if(sscanf(line,"%f, %f, %d, %d",&(p->min),&(p->del),
&(p->mapentries),&(p->quantvals))!=4){
fprintf(stderr,"5: syntax in %s in line:\t %s",filename,line);
exit(1);
1.15.2.1 +3 -3 vorbis/vq/build.c
Index: build.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/build.c,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -u -r1.15 -r1.15.2.1
--- build.c 2000/10/12 03:13:01 1.15
+++ build.c 2000/10/31 08:25:17 1.15.2.1
@@ -12,7 +12,7 @@
********************************************************************
function: utility main for building codebooks from training sets
- last mod: $Id: build.c,v 1.15 2000/10/12 03:13:01 xiphmont Exp $
+ last mod: $Id: build.c,v 1.15.2.1 2000/10/31 08:25:17 xiphmont Exp $
********************************************************************/
@@ -152,7 +152,7 @@
float a;
for(k=0;k<dim;k++){
line=rline(in,out);
- sscanf(line,"%lf",&a);
+ sscanf(line,"%f",&a);
v.entrylist[i]=a;
quantlist[i++]=rint(a);
}
@@ -172,7 +172,7 @@
for(k=0;k<dim+aux;k++){
line=rline(in,out);
if(!line)break;
- sscanf(line,"%lf",b+k);
+ sscanf(line,"%f",b+k);
}
if(feof(in))break;
vqgen_addpoint(&v,b,NULL);
1.5.2.1 +3 -3 vorbis/vq/huffbuild.c
Index: huffbuild.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/huffbuild.c,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- huffbuild.c 2000/10/12 03:13:01 1.5
+++ huffbuild.c 2000/10/31 08:25:17 1.5.2.1
@@ -12,7 +12,7 @@
********************************************************************
function: hufftree builder
- last mod: $Id: huffbuild.c,v 1.5 2000/10/12 03:13:01 xiphmont Exp $
+ last mod: $Id: huffbuild.c,v 1.5.2.1 2000/10/31 08:25:17 xiphmont Exp $
********************************************************************/
@@ -20,11 +20,11 @@
#include <string.h>
#include <math.h>
#include <stdio.h>
-#include "../vq/bookutil.h"
+#include "bookutil.h"
static int nsofar=0;
static int getval(FILE *in,int begin,int n,int group,int max){
- double v;
+ float v;
int i;
long val=0;
1.13.2.1 +8 -10 vorbis/vq/lspdata.c
Index: lspdata.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/lspdata.c,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -r1.13 -r1.13.2.1
--- lspdata.c 2000/10/12 03:13:02 1.13
+++ lspdata.c 2000/10/31 08:25:17 1.13.2.1
@@ -12,7 +12,7 @@
********************************************************************
function: metrics and quantization code for LSP VQ codebooks
- last mod: $Id: lspdata.c,v 1.13 2000/10/12 03:13:02 xiphmont Exp $
+ last mod: $Id: lspdata.c,v 1.13.2.1 2000/10/31 08:25:17 xiphmont Exp $
********************************************************************/
@@ -117,11 +117,8 @@
return sqrt(acc/v->elements);
}
-/* Data files are line-vectors, starting with zero. If we want to
- train on a subvector starting in the middle, we need to adjust the
- data as if it was starting at zero. we also need to add the 'aux'
- value, which is an extra point at the end so we have leading and
- trailing space */
+/* Data files are line-vectors, now just deltas. The codebook entries
+ want to be monotonically increasing, so we adjust */
/* assume vqext_aux==1 */
void vqext_addpoint_adj(vqgen *v,float *b,int start,int dim,int cols,int num){
@@ -129,12 +126,13 @@
float base=0;
int i;
- if(start>0)base=b[start-1];
- for(i=0;i<dim;i++)a[i]=b[i+start]-base;
+ for(i=0;i<dim;i++)
+ base=a[i]=b[i+start]+base;
+
if(start+dim+1>cols) /* +aux */
- a[i]=a[i-1];
+ a[i]=M_PI;
else
- a[i]=b[i+start]-base;
+ a[i]=b[i+start]+base;
vqgen_addpoint(v,a,a+dim);
}
1.19.2.1 +9 -6 vorbis/vq/train.c
Index: train.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/vq/train.c,v
retrieving revision 1.19
retrieving revision 1.19.2.1
diff -u -r1.19 -r1.19.2.1
--- train.c 2000/10/12 03:13:02 1.19
+++ train.c 2000/10/31 08:25:17 1.19.2.1
@@ -12,7 +12,7 @@
********************************************************************
function: utility main for training codebooks
- last mod: $Id: train.c,v 1.19 2000/10/12 03:13:02 xiphmont Exp $
+ last mod: $Id: train.c,v 1.19.2.1 2000/10/31 08:25:17 xiphmont Exp $
********************************************************************/
@@ -151,7 +151,7 @@
for(j=0;j<entries;j++){
for(k=0;k<dim;k++){
line=rline(in,out,0);
- sscanf(line,"%lf",&a);
+ sscanf(line,"%f",&a);
v.entrylist[i++]=a;
}
}
@@ -161,7 +161,7 @@
i=0;
for(j=0;j<entries;j++){
line=rline(in,out,0);
- sscanf(line,"%lf",&a);
+ sscanf(line,"%f",&a);
v.bias[i++]=a;
}
@@ -173,7 +173,7 @@
for(k=0;k<dim+vqext_aux;k++){
line=rline(in,out,0);
if(!line)break;
- sscanf(line,"%lf",b+k);
+ sscanf(line,"%f",b+k);
}
if(feof(in))break;
vqgen_addpoint(&v,b,b+dim);
@@ -206,11 +206,11 @@
}
break;
case 'e':
- if(sscanf(argv[1],"%lf",&desired)!=1)
+ if(sscanf(argv[1],"%f",&desired)!=1)
goto syner;
break;
case 'd':
- if(sscanf(argv[1],"%lf",&mindist)!=1)
+ if(sscanf(argv[1],"%f",&mindist)!=1)
goto syner;
if(init)v.mindist=mindist;
break;
@@ -260,6 +260,9 @@
while(*temp>32)temp++;
while(*temp==' ')temp++;
}
+
+ fprintf(stderr,"%d colums per line in file %s\n",cols,file);
+
}
{
int i;
No revision
No revision
1.1.2.1 +90 -0 vorbis/vq/Attic/Makefile
--- >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