gst_plugins_base/gst-libs/gst/fft/gstfft.c
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 15:30:33 +0300
branchRCL_3
changeset 29 567bb019e3e3
parent 0 0e761a78d257
child 30 7e817e7e631c
permissions -rw-r--r--
Revision: 201010 Kit: 201035

/* 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.
 */

#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.
 *
 */
#ifdef __SYMBIAN32__
EXPORT_C
#endif

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);
}