summaryrefslogtreecommitdiffstats
path: root/xbmc/utils/rfft.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
committermanuel <manuel@mausz.at>2020-10-19 00:52:24 +0200
commitbe933ef2241d79558f91796cc5b3a161f72ebf9c (patch)
treefe3ab2f130e20c99001f2d7a81d610c78c96a3f4 /xbmc/utils/rfft.h
parent5f8335c1e49ce108ef3481863833c98efa00411b (diff)
downloadkodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.gz
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.tar.bz2
kodi-pvr-build-be933ef2241d79558f91796cc5b3a161f72ebf9c.zip
sync with upstream
Diffstat (limited to 'xbmc/utils/rfft.h')
-rw-r--r--xbmc/utils/rfft.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/xbmc/utils/rfft.h b/xbmc/utils/rfft.h
new file mode 100644
index 0000000..0ec151d
--- /dev/null
+++ b/xbmc/utils/rfft.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2015-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#pragma once
10
11#include "contrib/kissfft/kiss_fftr.h"
12
13#include <vector>
14
15//! \brief Class performing a RFFT of interleaved stereo data.
16class RFFT
17{
18public:
19 //! \brief The constructor creates a RFFT plan.
20 //! \brief size Length of time data for a single channel.
21 //! \brief windowed Whether or not to apply a Hann window to data.
22 RFFT(int size, bool windowed=false);
23
24 //! \brief Free the RFFT plan
25 ~RFFT();
26
27 //! \brief Calculate FFTs
28 //! \param input Input data of size 2*m_size
29 //! \param output Output data of size m_size.
30 void calc(const float* input, float* output);
31protected:
32 //! \brief Apply a Hann window to a buffer.
33 //! \param data Vector with data to apply window to.
34 static void hann(std::vector<kiss_fft_scalar>& data);
35
36 size_t m_size; //!< Size for a single channel.
37 bool m_windowed; //!< Whether or not a Hann window is applied.
38 kiss_fftr_cfg m_cfg; //!< FFT plan
39};