Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | //////////////////////////////////////////////////////////////////////////////// |
michael@0 | 2 | /// |
michael@0 | 3 | /// Sample interpolation routine using 8-tap band-limited Shannon interpolation |
michael@0 | 4 | /// with kaiser window. |
michael@0 | 5 | /// |
michael@0 | 6 | /// Notice. This algorithm is remarkably much heavier than linear or cubic |
michael@0 | 7 | /// interpolation, and not remarkably better than cubic algorithm. Thus mostly |
michael@0 | 8 | /// for experimental purposes |
michael@0 | 9 | /// |
michael@0 | 10 | /// Author : Copyright (c) Olli Parviainen |
michael@0 | 11 | /// Author e-mail : oparviai 'at' iki.fi |
michael@0 | 12 | /// SoundTouch WWW: http://www.surina.net/soundtouch |
michael@0 | 13 | /// |
michael@0 | 14 | //////////////////////////////////////////////////////////////////////////////// |
michael@0 | 15 | // |
michael@0 | 16 | // $Id: InterpolateShannon.h 179 2014-01-06 18:41:42Z oparviai $ |
michael@0 | 17 | // |
michael@0 | 18 | //////////////////////////////////////////////////////////////////////////////// |
michael@0 | 19 | // |
michael@0 | 20 | // License : |
michael@0 | 21 | // |
michael@0 | 22 | // SoundTouch audio processing library |
michael@0 | 23 | // Copyright (c) Olli Parviainen |
michael@0 | 24 | // |
michael@0 | 25 | // This library is free software; you can redistribute it and/or |
michael@0 | 26 | // modify it under the terms of the GNU Lesser General Public |
michael@0 | 27 | // License as published by the Free Software Foundation; either |
michael@0 | 28 | // version 2.1 of the License, or (at your option) any later version. |
michael@0 | 29 | // |
michael@0 | 30 | // This library is distributed in the hope that it will be useful, |
michael@0 | 31 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
michael@0 | 32 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
michael@0 | 33 | // Lesser General Public License for more details. |
michael@0 | 34 | // |
michael@0 | 35 | // You should have received a copy of the GNU Lesser General Public |
michael@0 | 36 | // License along with this library; if not, write to the Free Software |
michael@0 | 37 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
michael@0 | 38 | // |
michael@0 | 39 | //////////////////////////////////////////////////////////////////////////////// |
michael@0 | 40 | |
michael@0 | 41 | #ifndef _InterpolateShannon_H_ |
michael@0 | 42 | #define _InterpolateShannon_H_ |
michael@0 | 43 | |
michael@0 | 44 | #include "RateTransposer.h" |
michael@0 | 45 | #include "STTypes.h" |
michael@0 | 46 | |
michael@0 | 47 | namespace soundtouch |
michael@0 | 48 | { |
michael@0 | 49 | |
michael@0 | 50 | class InterpolateShannon : public TransposerBase |
michael@0 | 51 | { |
michael@0 | 52 | protected: |
michael@0 | 53 | void resetRegisters(); |
michael@0 | 54 | int transposeMono(SAMPLETYPE *dest, |
michael@0 | 55 | const SAMPLETYPE *src, |
michael@0 | 56 | int &srcSamples); |
michael@0 | 57 | int transposeStereo(SAMPLETYPE *dest, |
michael@0 | 58 | const SAMPLETYPE *src, |
michael@0 | 59 | int &srcSamples); |
michael@0 | 60 | int transposeMulti(SAMPLETYPE *dest, |
michael@0 | 61 | const SAMPLETYPE *src, |
michael@0 | 62 | int &srcSamples); |
michael@0 | 63 | |
michael@0 | 64 | float fract; |
michael@0 | 65 | |
michael@0 | 66 | public: |
michael@0 | 67 | InterpolateShannon(); |
michael@0 | 68 | }; |
michael@0 | 69 | |
michael@0 | 70 | } |
michael@0 | 71 | |
michael@0 | 72 | #endif |