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.7 2000/10/12 03:13:01 xiphmont Exp $
17 ********************************************************************/
19 /* this one outputs residue to stdout. */
24 #include "vorbis/codebook.h"
25 #include "../lib/sharedbook.h"
33 void process_preprocess(codebook **bs,char *basename){
36 void process_postprocess(codebook **b,char *basename){
37 fprintf(stderr,"Done. \n");
40 float process_one(codebook *b,float *a,int dim,int step,int addmul,
44 if(b->c->q_sequencep){
53 vorbis_book_besterror(b,a,step,addmul);
58 void process_vector(codebook **bs,int *addmul,int inter,float *a,int n){
69 base=process_one(b,a+i,dim,n/dim,addmul[bi],base);
71 for(i=0;i<=n-dim;i+=dim)
72 base=process_one(b,a+i,dim,1,addmul[bi],base);
81 fprintf(stdout,"%f, ",a[i]);
84 if((long)(count++)%100)spinnit("working.... lines: ",count);
87 void process_usage(void){
89 "usage: vqcascade [-i] +|*<codebook>.vqh [ +|*<codebook.vqh> ]... \n"
90 " datafile.vqd [datafile.vqd]...\n\n"
91 " data can be taken on stdin. residual error data sent to\n"