gstreamer/gst-libs/gst/fft/gstfft.c
Tim-Philipp Müller 9f23b82b2c Give credit to Mark Borgerding (kissfft author)
and add myself to AUTHORS as well. Fixes #575638.
2009-04-14 17:11:19 +01:00

58 lines
1.8 KiB
C

/* GStreamer
* Copyright (C) <2007> Sebastian Dröge <slomo@circular-chaos.org>
*
* 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.
*
* The gstfft library is based on
* <a href="http://sourceforge.net/projects/kissfft">kissfft</a> by
* by Mark Borgerding.
*/
#include <glib.h>
#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);
}