Macro qtTrIdx() replaced by tr() and QT_TRANSLATE_NOOP()
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / gst-libs / gst / fft / gstfft.c
1 /* GStreamer
2  * Copyright (C) <2007> Sebastian Dröge <slomo@circular-chaos.org>
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 /**
21  * SECTION:gstfft
22  * @short_description: General FFT functions and declarations
23  * 
24  * This library includes general definitions and functions, useful for
25  * all typed FFT classes.
26  */
27
28 #include <glib.h>
29
30 #include "gstfft.h"
31 #include "kiss_fft_s16.h"
32
33 /**
34  * gst_fft_next_fast_length:
35  * @n: Number for which the next fast length should be returned
36  *
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.
40  *
41  * Returns: the next fast FFT length.
42  *
43  */
44 gint
45 gst_fft_next_fast_length (gint n)
46 {
47   gint half = (n + 1) / 2;
48
49   /* It's the same for all data types so call the s16
50    * version */
51
52   /* The real FFT needs an even length so calculate that */
53   return 2 * kiss_fft_s16_next_fast_size (half);
54 }