]> git.sesse.net Git - kdenlive/blob - src/lib/external/kiss_fft/tools/kfc.h
Add an fps counter for debugging.
[kdenlive] / src / lib / external / kiss_fft / tools / kfc.h
1 #ifndef KFC_H
2 #define KFC_H
3
4 /*
5 Copyright (c) 2003-2010, Mark Borgerding
6
7 All rights reserved.
8
9 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
10
11     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
12     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
13     * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission.
14
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 */
17
18 #include "../kiss_fft.h"
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /*
25 KFC -- Kiss FFT Cache
26
27 Not needing to deal with kiss_fft_alloc and a config 
28 object may be handy for a lot of programs.
29
30 KFC uses the underlying KISS FFT functions, but caches the config object. 
31 The first time kfc_fft or kfc_ifft for a given FFT size, the cfg 
32 object is created for it.  All subsequent calls use the cached 
33 configuration object.
34
35 NOTE:
36 You should probably not use this if your program will be using a lot 
37 of various sizes of FFTs.  There is a linear search through the
38 cached objects.  If you are only using one or two FFT sizes, this
39 will be negligible. Otherwise, you may want to use another method 
40 of managing the cfg objects.
41  
42  There is no automated cleanup of the cached objects.  This could lead 
43 to large memory usage in a program that uses a lot of *DIFFERENT* 
44 sized FFTs.  If you want to force all cached cfg objects to be freed,
45 call kfc_cleanup.
46  
47  */
48
49 /*forward complex FFT */
50 void kfc_fft(int nfft, const kiss_fft_cpx * fin,kiss_fft_cpx * fout);
51 /*reverse complex FFT */
52 void kfc_ifft(int nfft, const kiss_fft_cpx * fin,kiss_fft_cpx * fout);
53
54 /*free all cached objects*/
55 void kfc_cleanup(void);
56
57 #ifdef __cplusplus
58 }
59 #endif
60
61 #endif