1 /********************************************************************
3 * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5 * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
6 * PLEASE READ THESE TERMS DISTRIBUTING. *
8 * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-2000 *
9 * by Monty <monty@xiph.org> and The XIPHOPHORUS Company *
10 * http://www.xiph.org/ *
12 ********************************************************************
14 function: function call to do simple data cascading
15 last mod: $Id: cascade.c,v 1.4 2000/01/07 12:11:30 xiphmont Exp $
17 ********************************************************************/
19 /* this one outputs residue to stdout. */
32 void process_preprocess(codebook **bs,char *basename){
37 work=malloc(sizeof(double)*dim);
40 fprintf(stderr,"Each codebook in a cascade must have the same dimensional order\n");
48 void process_postprocess(codebook **b,char *basename){
49 fprintf(stderr,"Done. \n");
52 void process_vector(codebook **bs,double *a){
54 memcpy(work,a,dim*sizeof(double));
58 int entry=codebook_entry(b,work);
59 double *e=b->valuelist+b->dim*entry;
61 for(i=0;i<b->dim;i++)work[i]-=e[i];
66 fprintf(stdout,"%f, ",work[i]);
69 if((long)(count++)%100)spinnit("working.... lines: ",count);
72 void process_usage(void){
74 "usage: vqcascade book.vqh [book.vqh]... datafile.vqd [datafile.vqd]...\n\n"
75 " data can be taken on stdin. residual error data sent to\n"