2 * Copyright (C) <2007> Sebastian Dröge <slomo@circular-chaos.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
22 * @short_description: General FFT functions and declarations
24 * This library includes general definitions and functions, useful for
25 * all typed FFT classes.
31 #include "kiss_fft_s16.h"
34 * gst_fft_next_fast_length:
35 * @n: Number for which the next fast length should be returned
37 * Returns the next number to @n that is entirely a product
38 * of 2, 3 and 5. Using this as the @len parameter for
39 * the different GstFFT types will provide the best performance.
41 * Returns: the next fast FFT length.
45 gst_fft_next_fast_length (gint n)
47 gint half = (n + 1) / 2;
49 /* It's the same for all data types so call the s16
52 /* The real FFT needs an even length so calculate that */
53 return 2 * kiss_fft_s16_next_fast_size (half);