Recognizes if input is ogg or not.
[xiph.git] / postfish / freq.h
blob247f18ea906d51cd51b6bd23b8eeff6ef3e69e00
1 /*
3 * postfish
4 *
5 * Copyright (C) 2002-2005 Monty and Xiph.Org
7 * Postfish is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
12 * Postfish is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Postfish; see the file COPYING. If not, write to the
19 * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include "postfish.h"
25 #include <fftw3.h>
27 typedef struct {
28 float *fftwf_buffer;
29 fftwf_plan fftwf_forward;
30 fftwf_plan fftwf_backward;
32 int qblocksize;
33 int bands;
35 float **ho_window;
36 float *ho_area;
38 float *window;
39 } freq_class_setup;
42 typedef struct {
43 time_linkage out;
44 feedback_generic_pool feedpool;
45 freq_class_setup *fc;
47 int *activeP;
48 int *active1;
49 int *active0;
51 u_int32_t mutemask0;
52 u_int32_t mutemask1;
53 u_int32_t mutemaskP;
55 float **lap1;
56 float **lap0;
57 float **lapC;
59 float **cache1;
60 float **cache0;
61 int cache_samples;
62 int fillstate; /* 0: uninitialized
63 1: half-primed
64 2: nominal
65 3: eof processed */
66 float **peak;
67 float **rms;
68 } freq_state;
72 extern int pull_freq_feedback(freq_state *ff,float **peak,float **rms);
73 extern int freq_class_load(freq_class_setup *f,const float *frequencies, int bands);
74 extern int freq_load(freq_state *f,freq_class_setup *fc,int ch);
76 extern int freq_reset(freq_state *f);
77 extern time_linkage *freq_read(time_linkage *in,
78 freq_state *f,
79 int *visible, int *active,
80 void (*func)(float *,int i));