InterpolateCubic.h 2.0 KB

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