Fixes for codebook geenration (keeping up to date)
authorMonty <xiphmont@xiph.org>
Wed, 8 Nov 2000 03:23:24 +0000 (03:23 +0000)
committerMonty <xiphmont@xiph.org>
Wed, 8 Nov 2000 03:23:24 +0000 (03:23 +0000)
svn path=/trunk/vorbis/; revision=1022

16 files changed:
vq/Makefile
vq/bookutil.c
vq/bookutil.h
vq/build.c
vq/cascade.c
vq/latticebuild.c
vq/latticehint.c
vq/latticepare.c
vq/latticetune.c
vq/lspdata.c
vq/metrics.c
vq/residuedata.c
vq/residuesplit.c
vq/vqgen.c
vq/vqsplit.c
vq/vqsplit.h

index 8e401ef..2c8e285 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.2 2000/11/06 00:07:25 xiphmont Exp $
+# $Id: Makefile,v 1.3 2000/11/08 03:23:23 xiphmont Exp $
 
 ###############################################################################
 #                                                                             #
@@ -9,7 +9,7 @@
 #                                                                             #
 ###############################################################################
 
-FLAGS=-I. -I../include 
+FLAGS=-I. -I../lib -I../include 
 OPT=-O20 $(FLAGS)
 DEBUG=-g -Wall $(FLAGS)
 PROFILE=-g -pg -O20 $(FLAGS)
@@ -18,7 +18,7 @@ LD=gcc
 LDFLAGS=$(FLAGS)
 LIBS=-lm 
 
-HFILES =       ../include/vorbis/codebook.h vqgen.h vqext.h bookutil.h
+HFILES =       ../lib/codebook.h vqgen.h vqext.h bookutil.h
 
 OFILES =       vqgen.o vqsplit.o bookutil.o ../lib/sharedbook.o
 ALLOFILES =    $(OFILES) lspdata.o genericdata.o train.o build.o run.o\
index 8eee315..344f84e 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility functions for loading .vqh and .vqd files
- last mod: $Id: bookutil.c,v 1.18 2000/11/06 00:07:25 xiphmont Exp $
+ last mod: $Id: bookutil.c,v 1.19 2000/11/08 03:23:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -21,8 +21,6 @@
 #include <math.h>
 #include <string.h>
 #include <errno.h>
-#include "vorbis/codebook.h"
-#include "../lib/sharedbook.h"
 #include "bookutil.h"
 
 /* A few little utils for reading files */
index be9a983..4f84cf0 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility functions for loading .vqh and .vqd files
- last mod: $Id: bookutil.h,v 1.8 2000/11/06 00:07:25 xiphmont Exp $
+ last mod: $Id: bookutil.h,v 1.9 2000/11/08 03:23:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -22,7 +22,7 @@
 #include <stdio.h>
 #include <sys/time.h>
 
-#include "vorbis/codebook.h"
+#include "codebook.h"
 
 extern char     *get_line(FILE *in);
 extern char     *setup_line(FILE *in);
index 11e3e90..baaf8bc 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility main for building codebooks from training sets
- last mod: $Id: build.c,v 1.16 2000/11/06 00:07:25 xiphmont Exp $
+ last mod: $Id: build.c,v 1.17 2000/11/08 03:23:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -21,8 +21,6 @@
 #include <math.h>
 #include <string.h>
 #include <errno.h>
-#include "vorbis/codebook.h"
-#include "../lib/sharedbook.h"
 #include "bookutil.h"
 
 #include "vqgen.h"
index cae7580..91d019c 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: function call to do simple data cascading
- last mod: $Id: cascade.c,v 1.8 2000/11/06 00:07:25 xiphmont Exp $
+ last mod: $Id: cascade.c,v 1.9 2000/11/08 03:23:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -21,8 +21,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <math.h>
-#include "vorbis/codebook.h"
-#include "../lib/sharedbook.h"
 #include "bookutil.h"
 
 /* set up metrics */
index ef1e577..dc9befc 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility main for building codebooks from lattice descriptions
- last mod: $Id: latticebuild.c,v 1.7 2000/11/06 00:07:25 xiphmont Exp $
+ last mod: $Id: latticebuild.c,v 1.8 2000/11/08 03:23:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -21,8 +21,6 @@
 #include <math.h>
 #include <string.h>
 #include <errno.h>
-#include "vorbis/codebook.h"
-#include "../lib/sharedbook.h"
 #include "bookutil.h"
 
 /* The purpose of this util is just to finish packaging the
index 50bf3f6..1eecabc 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility main for building thresh/pigeonhole encode hints
- last mod: $Id: latticehint.c,v 1.4 2000/11/06 00:07:26 xiphmont Exp $
+ last mod: $Id: latticehint.c,v 1.5 2000/11/08 03:23:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -21,8 +21,6 @@
 #include <math.h>
 #include <string.h>
 #include <errno.h>
-#include "vorbis/codebook.h"
-#include "../lib/sharedbook.h"
 #include "../lib/scales.h"
 #include "bookutil.h"
 #include "vqgen.h"
index 3e3b41e..fbfc9b2 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: utility for paring low hit count cells from lattice codebook
- last mod: $Id: latticepare.c,v 1.6 2000/11/06 00:07:26 xiphmont Exp $
+ last mod: $Id: latticepare.c,v 1.7 2000/11/08 03:23:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -21,8 +21,6 @@
 #include <math.h>
 #include <string.h>
 #include <errno.h>
-#include "vorbis/codebook.h"
-#include "../lib/sharedbook.h"
 #include "../lib/scales.h"
 #include "bookutil.h"
 #include "vqgen.h"
index 0c67835..f7563b4 100644 (file)
@@ -13,7 +13,7 @@
 
  function: utility main for setting entropy encoding parameters
            for lattice codebooks
- last mod: $Id: latticetune.c,v 1.4 2000/11/06 00:07:26 xiphmont Exp $
+ last mod: $Id: latticetune.c,v 1.5 2000/11/08 03:23:23 xiphmont Exp $
 
  ********************************************************************/
 
 #include <math.h>
 #include <string.h>
 #include <errno.h>
-#include "vorbis/codebook.h"
-#include "../lib/sharedbook.h"
 #include "bookutil.h"
 
+static char *strrcmp_i(char *s,char *cmp){
+  return(strncmp(s+strlen(s)-strlen(cmp),cmp,strlen(cmp)));
+}
+
 /* This util takes a training-collected file listing codewords used in
    LSP fitting, then generates new codeword lengths for maximally
    efficient integer-bits entropy encoding.
@@ -90,7 +92,7 @@ int main(int argc,char *argv[]){
     exit(1);
   }
 
-  if(!strcmp(argv[0],"latticetune")){
+  if(!strrcmp_i(argv[0],"latticetune")){
     long lines=0;
     line=setup_line(in);
     while(line){      
@@ -105,7 +107,7 @@ int main(int argc,char *argv[]){
     }
   }
 
-  if(!strcmp(argv[0],"restune")){
+  if(!strrcmp_i(argv[0],"restune")){
     long step;
     long lines=0;
     long cols=-1;
index 76c94ac..4d972e3 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: metrics and quantization code for LSP VQ codebooks
- last mod: $Id: lspdata.c,v 1.14 2000/11/06 00:07:26 xiphmont Exp $
+ last mod: $Id: lspdata.c,v 1.15 2000/11/08 03:23:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -21,7 +21,7 @@
 #include <stdio.h>
 #include "vqgen.h"
 #include "vqext.h"
-#include "../lib/sharedbook.h"
+#include "codebook.h"
 
 char *vqext_booktype="LSPdata";  
 quant_meta q={0,0,0,1};          /* set sequence data */
index 964ce1a..013ad76 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: function calls to collect codebook metrics
- last mod: $Id: metrics.c,v 1.10 2000/11/06 00:07:26 xiphmont Exp $
+ last mod: $Id: metrics.c,v 1.11 2000/11/08 03:23:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -20,8 +20,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <math.h>
-#include "vorbis/codebook.h"
-#include "../lib/sharedbook.h"
 #include "bookutil.h"
 
 /* collect the following metrics:
index b9203a4..3de4f16 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: metrics and quantization code for residue VQ codebooks
- last mod: $Id: residuedata.c,v 1.5 2000/11/06 00:07:26 xiphmont Exp $
+ last mod: $Id: residuedata.c,v 1.6 2000/11/08 03:23:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -22,7 +22,6 @@
 #include <string.h>
 #include "vqgen.h"
 #include "bookutil.h"
-#include "../lib/sharedbook.h"
 #include "../lib/scales.h"
 #include "vqext.h"
 
index 9beab80..1711395 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: residue backend 0 partitioner/classifier
- last mod: $Id: residuesplit.c,v 1.6 2000/11/06 00:07:26 xiphmont Exp $
+ last mod: $Id: residuesplit.c,v 1.7 2000/11/08 03:23:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -20,8 +20,7 @@
 #include <string.h>
 #include <math.h>
 #include <stdio.h>
-#include "../vq/bookutil.h"
-#include "../lib/sharedbook.h"
+#include "bookutil.h"
 
 /* does not guard against invalid settings; eg, a subn of 16 and a
    subgroup request of 32.  Max subn of 128 */
index df2ebd7..e3bcea0 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: train a VQ codebook 
- last mod: $Id: vqgen.c,v 1.35 2000/11/06 00:07:26 xiphmont Exp $
+ last mod: $Id: vqgen.c,v 1.36 2000/11/08 03:23:23 xiphmont Exp $
 
  ********************************************************************/
 
@@ -32,7 +32,6 @@
 
 #include "vqgen.h"
 #include "bookutil.h"
-#include "../lib/sharedbook.h"
 
 /* Codebook generation happens in two steps: 
 
index d6ca6bd..6f5beac 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: build a VQ codebook and the encoding decision 'tree'
- last mod: $Id: vqsplit.c,v 1.21 2000/11/06 00:07:26 xiphmont Exp $
+ last mod: $Id: vqsplit.c,v 1.22 2000/11/08 03:23:24 xiphmont Exp $
 
  ********************************************************************/
 
@@ -34,7 +34,6 @@
 #include "vqgen.h"
 #include "vqsplit.h"
 #include "bookutil.h"
-#include "../lib/sharedbook.h"
 
 /* Codebook generation happens in two steps: 
 
index 8da7fd9..481c712 100644 (file)
  ********************************************************************
 
  function: build a VQ codebook decision tree 
- last mod: $Id: vqsplit.h,v 1.4 2000/11/06 00:07:26 xiphmont Exp $
+ last mod: $Id: vqsplit.h,v 1.5 2000/11/08 03:23:24 xiphmont Exp $
 
  ********************************************************************/
 
 #ifndef _VQSPL_H_
 #define _VQSPL_H_
 
-#include "vorbis/codebook.h"
+#include "codebook.h"
 
 extern void vqsp_book(vqgen *v,codebook *b,long *quantlist);
 extern int vqenc_entry(codebook *b,float *val);