tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

InterpolateShannon.h (2289B)


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