The lib and vq, at least, build again. Tackling the examples and xmms
[platform/upstream/libvorbis.git] / lib / lpc.h
1 /********************************************************************
2  *                                                                  *
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.                            *
7  *                                                                  *
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/                                             *
11  *                                                                  *
12  ********************************************************************
13
14   function: LPC low level routines
15   last mod: $Id: lpc.h,v 1.9 2000/01/28 09:05:12 xiphmont Exp $
16
17  ********************************************************************/
18
19 #ifndef _V_LPC_H_
20 #define _V_LPC_H_
21
22 #include "vorbis/codec.h"
23 #include "smallft.h"
24
25 typedef struct lpclook{
26   /* en/decode lookups */
27   int *linearmap;
28   double *barknorm;
29   drft_lookup fft;
30
31   int n;
32   int ln;
33   int m;
34
35 } lpc_lookup;
36
37 extern void lpc_init(lpc_lookup *l,int n, long mapped, long rate, int m);
38 extern void lpc_clear(lpc_lookup *l);
39
40 /* simple linear scale LPC code */
41 extern double vorbis_lpc_from_data(double *data,double *lpc,int n,int m);
42 extern double vorbis_lpc_from_spectrum(double *curve,double *lpc,lpc_lookup *l);
43
44 /* log scale layer */
45 extern double vorbis_curve_to_lpc(double *curve,double *lpc,lpc_lookup *l);
46 extern void vorbis_lpc_to_curve(double *curve,double *lpc, double amp,
47                                 lpc_lookup *l);
48
49 /* standard lpc stuff */
50 extern void vorbis_lpc_residue(double *coeff,double *prime,int m,
51                         double *data,long n);
52 extern void vorbis_lpc_predict(double *coeff,double *prime,int m,
53                         double *data,long n);
54
55 #endif