1 /********************************************************************
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
5 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
9 * by the XIPHOPHORUS Company http://www.xiph.org/ *
11 ********************************************************************
13 function: function call to do simple data cascading
14 last mod: $Id: cascade.c,v 1.12 2001/02/26 03:51:12 xiphmont Exp $
16 ********************************************************************/
18 /* this one outputs residue to stdout. */
30 void process_preprocess(codebook **bs,char *basename){
33 void process_postprocess(codebook **b,char *basename){
34 fprintf(stderr,"Done. \n");
37 float process_one(codebook *b,float *a,int dim,int step,int addmul,
41 if(b->c->q_sequencep){
50 vorbis_book_besterror(b,a,step,addmul);
55 void process_vector(codebook **bs,int *addmul,int inter,float *a,int n){
66 base=process_one(b,a+i,dim,n/dim,addmul[bi],base);
68 for(i=0;i<=n-dim;i+=dim)
69 base=process_one(b,a+i,dim,1,addmul[bi],base);
78 fprintf(stdout,"%f, ",a[i]);
81 if((long)(count++)%100)spinnit("working.... lines: ",count);
84 void process_usage(void){
86 "usage: vqcascade [-i] +|*<codebook>.vqh [ +|*<codebook.vqh> ]... \n"
87 " datafile.vqd [datafile.vqd]...\n\n"
88 " data can be taken on stdin. residual error data sent to\n"