-# $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 $
###############################################################################
# #
# #
###############################################################################
-FLAGS=-I. -I../include
+FLAGS=-I. -I../lib -I../include
OPT=-O20 $(FLAGS)
DEBUG=-g -Wall $(FLAGS)
PROFILE=-g -pg -O20 $(FLAGS)
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\
********************************************************************
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 $
********************************************************************/
#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 */
********************************************************************
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 $
********************************************************************/
#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);
********************************************************************
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 $
********************************************************************/
#include <math.h>
#include <string.h>
#include <errno.h>
-#include "vorbis/codebook.h"
-#include "../lib/sharedbook.h"
#include "bookutil.h"
#include "vqgen.h"
********************************************************************
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 $
********************************************************************/
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
-#include "vorbis/codebook.h"
-#include "../lib/sharedbook.h"
#include "bookutil.h"
/* set up metrics */
********************************************************************
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 $
********************************************************************/
#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
********************************************************************
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 $
********************************************************************/
#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"
********************************************************************
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 $
********************************************************************/
#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"
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.
exit(1);
}
- if(!strcmp(argv[0],"latticetune")){
+ if(!strrcmp_i(argv[0],"latticetune")){
long lines=0;
line=setup_line(in);
while(line){
}
}
- if(!strcmp(argv[0],"restune")){
+ if(!strrcmp_i(argv[0],"restune")){
long step;
long lines=0;
long cols=-1;
********************************************************************
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 $
********************************************************************/
#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 */
********************************************************************
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 $
********************************************************************/
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
-#include "vorbis/codebook.h"
-#include "../lib/sharedbook.h"
#include "bookutil.h"
/* collect the following metrics:
********************************************************************
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 $
********************************************************************/
#include <string.h>
#include "vqgen.h"
#include "bookutil.h"
-#include "../lib/sharedbook.h"
#include "../lib/scales.h"
#include "vqext.h"
********************************************************************
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 $
********************************************************************/
#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 */
********************************************************************
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 $
********************************************************************/
#include "vqgen.h"
#include "bookutil.h"
-#include "../lib/sharedbook.h"
/* Codebook generation happens in two steps:
********************************************************************
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 $
********************************************************************/
#include "vqgen.h"
#include "vqsplit.h"
#include "bookutil.h"
-#include "../lib/sharedbook.h"
/* Codebook generation happens in two steps:
********************************************************************
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);