X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=gst-plugins-base-subtitles0.10%2Fgst-libs%2Fgst%2Ffft%2Fgstfft.c;fp=gst-plugins-base-subtitles0.10%2Fgst-libs%2Fgst%2Ffft%2Fgstfft.c;h=b1708c7725a4749dd30a74ecf4875c684dda76f9;hb=57ba96e291a055f69dbfd4ae9f1ae2390e36986e;hp=0000000000000000000000000000000000000000;hpb=be2c98fb83895d10ac44af7b9a9c3e00ca54bf49;p=mafwsubrenderer diff --git a/gst-plugins-base-subtitles0.10/gst-libs/gst/fft/gstfft.c b/gst-plugins-base-subtitles0.10/gst-libs/gst/fft/gstfft.c new file mode 100644 index 0000000..b1708c7 --- /dev/null +++ b/gst-plugins-base-subtitles0.10/gst-libs/gst/fft/gstfft.c @@ -0,0 +1,54 @@ +/* GStreamer + * Copyright (C) <2007> Sebastian Dröge + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/** + * SECTION:gstfft + * @short_description: General FFT functions and declarations + * + * This library includes general definitions and functions, useful for + * all typed FFT classes. + */ + +#include + +#include "gstfft.h" +#include "kiss_fft_s16.h" + +/** + * gst_fft_next_fast_length: + * @n: Number for which the next fast length should be returned + * + * Returns the next number to @n that is entirely a product + * of 2, 3 and 5. Using this as the @len parameter for + * the different GstFFT types will provide the best performance. + * + * Returns: the next fast FFT length. + * + */ +gint +gst_fft_next_fast_length (gint n) +{ + gint half = (n + 1) / 2; + + /* It's the same for all data types so call the s16 + * version */ + + /* The real FFT needs an even length so calculate that */ + return 2 * kiss_fft_s16_next_fast_size (half); +}