1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libsoundtouch/src/InterpolateShannon.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,72 @@ 1.4 +//////////////////////////////////////////////////////////////////////////////// 1.5 +/// 1.6 +/// Sample interpolation routine using 8-tap band-limited Shannon interpolation 1.7 +/// with kaiser window. 1.8 +/// 1.9 +/// Notice. This algorithm is remarkably much heavier than linear or cubic 1.10 +/// interpolation, and not remarkably better than cubic algorithm. Thus mostly 1.11 +/// for experimental purposes 1.12 +/// 1.13 +/// Author : Copyright (c) Olli Parviainen 1.14 +/// Author e-mail : oparviai 'at' iki.fi 1.15 +/// SoundTouch WWW: http://www.surina.net/soundtouch 1.16 +/// 1.17 +//////////////////////////////////////////////////////////////////////////////// 1.18 +// 1.19 +// $Id: InterpolateShannon.h 179 2014-01-06 18:41:42Z oparviai $ 1.20 +// 1.21 +//////////////////////////////////////////////////////////////////////////////// 1.22 +// 1.23 +// License : 1.24 +// 1.25 +// SoundTouch audio processing library 1.26 +// Copyright (c) Olli Parviainen 1.27 +// 1.28 +// This library is free software; you can redistribute it and/or 1.29 +// modify it under the terms of the GNU Lesser General Public 1.30 +// License as published by the Free Software Foundation; either 1.31 +// version 2.1 of the License, or (at your option) any later version. 1.32 +// 1.33 +// This library is distributed in the hope that it will be useful, 1.34 +// but WITHOUT ANY WARRANTY; without even the implied warranty of 1.35 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1.36 +// Lesser General Public License for more details. 1.37 +// 1.38 +// You should have received a copy of the GNU Lesser General Public 1.39 +// License along with this library; if not, write to the Free Software 1.40 +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 1.41 +// 1.42 +//////////////////////////////////////////////////////////////////////////////// 1.43 + 1.44 +#ifndef _InterpolateShannon_H_ 1.45 +#define _InterpolateShannon_H_ 1.46 + 1.47 +#include "RateTransposer.h" 1.48 +#include "STTypes.h" 1.49 + 1.50 +namespace soundtouch 1.51 +{ 1.52 + 1.53 +class InterpolateShannon : public TransposerBase 1.54 +{ 1.55 +protected: 1.56 + void resetRegisters(); 1.57 + int transposeMono(SAMPLETYPE *dest, 1.58 + const SAMPLETYPE *src, 1.59 + int &srcSamples); 1.60 + int transposeStereo(SAMPLETYPE *dest, 1.61 + const SAMPLETYPE *src, 1.62 + int &srcSamples); 1.63 + int transposeMulti(SAMPLETYPE *dest, 1.64 + const SAMPLETYPE *src, 1.65 + int &srcSamples); 1.66 + 1.67 + float fract; 1.68 + 1.69 +public: 1.70 + InterpolateShannon(); 1.71 +}; 1.72 + 1.73 +} 1.74 + 1.75 +#endif