From c64adba3086b241ed65d2af1f83b02877302da5f Mon Sep 17 00:00:00 2001 From: "clayton.otey" Date: Tue, 17 Apr 2012 01:04:16 +0000 Subject: [PATCH] Associated with r11696 / patch for bug 485. Just forgot to add/delete these files associated with the patch. --- lib-src/sbsms/m4/ax_check_compiler_flags.m4 | 40 + lib-src/sbsms/m4/ax_compiler_vendor.m4 | 30 + lib-src/sbsms/src/audio.cpp | 41 - lib-src/sbsms/src/audio.h | 16 - lib-src/sbsms/src/dBTable.cpp | 4105 +++++++++++++++++++ lib-src/sbsms/src/dBTable.h | 26 + lib-src/sbsms/src/peak.cpp | 47 - lib-src/sbsms/src/peak.h | 41 - lib-src/sbsms/src/slide.cpp | 476 +++ lib-src/sbsms/src/sse.h | 32 + lib-src/sbsms/src/synthTable.h | 1041 +++++ lib-src/sbsms/src/utils.cpp | 89 - m4/ax_check_compiler_flags.m4 | 40 + m4/ax_compiler_vendor.m4 | 30 + 14 files changed, 5820 insertions(+), 234 deletions(-) create mode 100644 lib-src/sbsms/m4/ax_check_compiler_flags.m4 create mode 100644 lib-src/sbsms/m4/ax_compiler_vendor.m4 delete mode 100644 lib-src/sbsms/src/audio.cpp delete mode 100644 lib-src/sbsms/src/audio.h create mode 100644 lib-src/sbsms/src/dBTable.cpp create mode 100644 lib-src/sbsms/src/dBTable.h delete mode 100644 lib-src/sbsms/src/peak.cpp delete mode 100644 lib-src/sbsms/src/peak.h create mode 100644 lib-src/sbsms/src/slide.cpp create mode 100644 lib-src/sbsms/src/sse.h create mode 100644 lib-src/sbsms/src/synthTable.h delete mode 100644 lib-src/sbsms/src/utils.cpp create mode 100644 m4/ax_check_compiler_flags.m4 create mode 100644 m4/ax_compiler_vendor.m4 diff --git a/lib-src/sbsms/m4/ax_check_compiler_flags.m4 b/lib-src/sbsms/m4/ax_check_compiler_flags.m4 new file mode 100644 index 000000000..86eaf15ef --- /dev/null +++ b/lib-src/sbsms/m4/ax_check_compiler_flags.m4 @@ -0,0 +1,40 @@ +dnl @synopsis AX_CHECK_COMPILER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE]) +dnl @summary check whether FLAGS are accepted by the compiler +dnl @category Misc +dnl +dnl Check whether the given compiler FLAGS work with the current language's +dnl compiler, or whether they give an error. (Warnings, however, are +dnl ignored.) +dnl +dnl ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +dnl success/failure. +dnl +dnl @version 2005-05-30 +dnl @license GPLWithACException +dnl @author Steven G. Johnson and Matteo Frigo. +AC_DEFUN([AX_CHECK_COMPILER_FLAGS], +[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX +AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1]) +dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: +AS_LITERAL_IF([$1], + [AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1), [ + ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=yes, + AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=no) + _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])], + [ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=yes, + eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=no) + _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS]) +eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1) +AC_MSG_RESULT($ax_check_compiler_flags) +if test "x$ax_check_compiler_flags" = xyes; then + m4_default([$2], :) +else + m4_default([$3], :) +fi +])dnl AX_CHECK_COMPILER_FLAGS diff --git a/lib-src/sbsms/m4/ax_compiler_vendor.m4 b/lib-src/sbsms/m4/ax_compiler_vendor.m4 new file mode 100644 index 000000000..642b41fd6 --- /dev/null +++ b/lib-src/sbsms/m4/ax_compiler_vendor.m4 @@ -0,0 +1,30 @@ +dnl @synopsis AX_COMPILER_VENDOR +dnl @summary find the vendor (gnu, intel, etc.) of the C/C++ compiler +dnl @category C +dnl @category C++ +dnl +dnl Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, +dnl sun, hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, +dnl microsoft, watcom, etc. The vendor is returned in the cache variable +dnl $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++. +dnl +dnl @version 2007-08-01 +dnl @license GPLWithACException +dnl @author Steven G. Johnson with Matteo Frigo + +AC_DEFUN([AX_COMPILER_VENDOR], +[ +AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, + [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown + # note: don't check for gcc first since some other compilers define __GNUC__ + for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do + vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ +#if !($vencpp) + thisisanerror; +#endif +])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break]) + done + ]) +]) + diff --git a/lib-src/sbsms/src/audio.cpp b/lib-src/sbsms/src/audio.cpp deleted file mode 100644 index f72d9f3aa..000000000 --- a/lib-src/sbsms/src/audio.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include -#include "audio.h" - -namespace _sbsms_ { - -audio *make_audio_buf(long n) { - return (audio*)calloc(n,sizeof(audio)); -} - -void free_audio_buf(audio *buf) { - free(buf); -} - -long copy_audio_buf(audio *to, long off1, audio *from, long off2, long n) -{ - memcpy(to+off1,from+off2,n*sizeof(audio)); - return n; -} - -long audio_convert_from(float *to, long off1, audio *from, long off2, long n) -{ - for(int k=0;k -#include - -namespace _sbsms_ { - -PeakAllocator :: PeakAllocator() -{ - size = 0; - count = 0; - peaks = NULL; -} - -PeakAllocator :: ~PeakAllocator() -{ - if(peaks) free(peaks); -} - -peak *PeakAllocator :: create() -{ - if(count >= size) { - if(size == 0) - size = 1024; - else - size *= 2; - - peak *newpeaks = (peak*)malloc(size*sizeof(peak)); - if(peaks) { - memcpy(newpeaks,peaks,count*sizeof(peak)); - free(peaks); - } - peaks = newpeaks; - } - return peaks+(count++); -} - -void PeakAllocator :: destroy(peak *p) -{ - count--; -} - -void PeakAllocator :: destroyAll() -{ - count = 0; -} - -} diff --git a/lib-src/sbsms/src/peak.h b/lib-src/sbsms/src/peak.h deleted file mode 100644 index 872745169..000000000 --- a/lib-src/sbsms/src/peak.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef PEAK_H -#define PEAK_H - -/* -Semantics are such that if destroy(p) or destroyAll() is called then all peaks create()'d after p are invalid. It is OK to create() a peak, destroy it before calling create() again, then create() another, or to create() a set of peaks, then destroy them ALL in any order, and repeat. - */ - -#include "sbsms.h" - -namespace _sbsms_ { - -class peak { - public: - peak *tp; - peak *tn; - peak *tp2; - peak *tn2; - real x; - real y; - real y2; - int k; - real m; -}; - -class PeakAllocator { - public: - PeakAllocator(); - ~PeakAllocator(); - peak *create(); - void destroy(peak *p); - void destroyAll(); - - protected: - long count; - long size; - peak *peaks; - -}; -} - -#endif diff --git a/lib-src/sbsms/src/slide.cpp b/lib-src/sbsms/src/slide.cpp new file mode 100644 index 000000000..ce11b18f9 --- /dev/null +++ b/lib-src/sbsms/src/slide.cpp @@ -0,0 +1,476 @@ +#include "sbsms.h" +#include "real.h" +#include +#include +using namespace std; + +namespace _sbsms_ { + +class SlideImp { +public: + virtual ~SlideImp() {} + virtual float getTotalStretch()=0; + virtual float getStretchedTime(float t)=0; + virtual float getRate(float t)=0; + virtual float getStretch(float t)=0; + virtual float getRate()=0; + virtual float getStretch()=0; + virtual void step()=0; +}; + +class IdentitySlide : public SlideImp { +public: + IdentitySlide() { + } + float getTotalStretch() { + return 1.0f; + } + float getStretchedTime(float t) { + return t; + } + float getRate(float t) { + return 1.0f; + } + float getStretch(float t) { + return 1.0f; + } + float getRate() { + return 1.0f; + } + float getStretch() { + return 1.0f; + } + void step() { + } +}; + +class ConstantSlide : public SlideImp { +public: + ConstantSlide(float rate) { + this->rate = rate; + } + float getTotalStretch() { + return 1.0f / rate; + } + float getStretchedTime(float t) { + return t / rate; + } + float getRate(float t) { + return rate; + } + float getStretch(float t) { + return 1.0f / rate; + } + float getRate() { + return rate; + } + float getStretch() { + return 1.0f / rate; + } + void step() { + } +protected: + float rate; +}; + +class LinearInputRateSlide : public SlideImp { +public: + LinearInputRateSlide(float rate0, float rate1, const SampleCountType &n) { + this->rate0 = rate0; + this->rate1 = rate1; + if(n) { + val = rate0; + inc = (rate1 - rate0) / (double)n; + } + } + float getTotalStretch() { + return log(rate1 / rate0) / (rate1 - rate0); + } + float getStretchedTime(float t) { + float ratet = getRate(t); + return log(ratet / rate0) / (rate1 - rate0); + } + float getRate(float t) { + return rate0 + (rate1 - rate0) * t; + } + float getStretch(float t) { + return 1.0f / getRate(t); + } + float getRate() { + return (float)val; + } + float getStretch() { + return (float)(1.0 / val); + } + void step() { + val += inc; + } +protected: + float rate0, rate1; + double val, inc; +}; + +class LinearOutputRateSlide : public SlideImp { +public: + LinearOutputRateSlide(float rate0, float rate1, const SampleCountType &n) { + this->rate0 = rate0; + this->rate1 = rate1; + if(n) { + val = 0.0; + inc = 1.0 / (double)n; + } + } + float getTotalStretch() { + return 2.0f / (rate0 + rate1); + } + float getStretchedTime(float t) { + return (sqrt(rate0 * rate0 + (rate1 * rate1 - rate0 * rate0) * t) - rate0) * 2.0f / (rate1 * rate1 - rate0 * rate0); + } + float getRate(float t) { + return rate0 + (sqrt(rate0 * rate0 + (rate1 * rate1 - rate0 * rate0) * t) - rate0); + } + float getStretch(float t) { + return 1.0f / getRate(t); + } + float getRate() { + return getRate((float)val); + } + float getStretch() { + return getStretch((float)val); + } + void step() { + val += inc; + } +protected: + float rate0, rate1; + double val, inc; +}; + +class LinearInputStretchSlide : public SlideImp { +public: + LinearInputStretchSlide(float rate0, float rate1, const SampleCountType &n) { + this->rate0 = rate0; + this->rate1 = rate1; + if(n) { + val = 1.0 / rate0; + inc = (1.0 / rate1 - 1.0 / rate0) / (double)n; + } + } + float getTotalStretch() { + return 0.5f / rate0 + 0.5f / rate1; + } + float getStretchedTime(float t) { + return t / rate0 * (1.0f + 0.5f * t * (rate0 / rate1 - 1.0f)); + } + float getRate(float t) { + return 1.0f / getStretch(t); + } + float getStretch(float t) { + return (1.0f / rate0 + (1.0f / rate1 - 1.0f / rate0) * t); + } + float getRate() { + return (float)(1.0 / val); + } + float getStretch() { + return (float)val; + } + void step() { + val += inc; + } +protected: + float rate0, rate1; + double val, inc; +}; + +class LinearOutputStretchSlide : public SlideImp { +public: + LinearOutputStretchSlide(float rate0, float rate1, const SampleCountType &n) { + this->rate0 = rate0; + this->rate1 = rate1; + c0 = rate0 / rate1; + c1 = 1.0f / (rate0 * log(c0)); + if(n) { + val = 0.0; + inc = 1.0 / (double)n; + } + } + float getTotalStretch() { + return c1 * (c0 - 1.0f); + } + float getStretchedTime(float t) { + return c1 * (pow(c0, t) - 1.0f); + } + float getRate(float t) { + return rate0 * pow(c0, -t); + } + float getStretch(float t) { + return pow(c0, t) / rate0; + } + float getRate() { + return getRate((float)val); + } + float getStretch() { + return getStretch((float)val); + } + void step() { + val += inc; + } +protected: + float rate0, rate1; + double val, inc; + float c0, c1; +}; + +class GeometricInputSlide : public SlideImp { +public: + GeometricInputSlide(float rate0, float rate1, const SampleCountType &n) { + this->rate0 = rate0; + this->rate1 = rate1; + if(n) { + val = rate0; + inc = pow((double)rate1 / rate0, 1.0 / (double)n); + } + } + float getTotalStretch() { + return (rate1 - rate0) / (log(rate1 / rate0) * (rate0 * rate1)); + } + float getStretchedTime(float t) { + return (float)(pow(rate0 / rate1, t) - 1.0) / (rate0 * log(rate0 / rate1)); + } + float getRate(float t) { + return rate0 * pow(rate1 / rate0, t); + } + float getStretch(float t) { + return 1.0f / getRate(t); + } + float getRate() { + return (float)val; + } + float getStretch() { + return (float)(1.0 / val); + } + void step() { + val *= inc; + } +protected: + float rate0, rate1; + double val, inc; +}; + +class GeometricOutputSlide : public SlideImp { +public: + GeometricOutputSlide(float rate0, float rate1, const SampleCountType &n) { + this->rate0 = rate0; + this->rate1 = rate1; + log10 = log(rate1 / rate0); + r10 = rate1 - rate0; + totalStretch = getTotalStretch(); + if(n) { + val = 0.0; + inc = 1.0 / (double)n; + } + } + float getTotalStretch() { + return log(rate1 / rate0) / (rate1 - rate0); + } + float getStretchedTime(float t) { + return log(r10 / rate0 * t + 1.0f) / r10; + } + float getRate(float t) { + float t1 = getStretchedTime(t) / totalStretch; + return rate0 * pow(rate1 / rate0, t1); + } + float getStretch(float t) { + return 1.0f / getRate(t); + } + float getRate() { + return getRate((float)val); + } + float getStretch() { + return getStretch((float)val); + } + void step() { + val += inc; + } +protected: + float rate0, rate1; + float log10, r10, totalStretch; + double val, inc; +}; + + +Slide :: Slide(SlideType slideType, float rate0, float rate1, const SampleCountType &n) +{ + if(slideType == SlideIdentity) { + imp = new IdentitySlide(); + } else if(slideType == SlideConstant || rate0 == rate1) { + imp = new ConstantSlide(rate0); + } else if(slideType == SlideLinearInputRate) { + imp = new LinearInputRateSlide(rate0,rate1,n); + } else if(slideType == SlideLinearOutputRate) { + imp = new LinearOutputRateSlide(rate0,rate1,n); + } else if(slideType == SlideLinearInputStretch) { + imp = new LinearInputStretchSlide(rate0,rate1,n); + } else if(slideType == SlideLinearOutputStretch) { + imp = new LinearOutputStretchSlide(rate0,rate1,n); + } else if(slideType == SlideGeometricInput) { + imp = new GeometricInputSlide(rate0,rate1,n); + } else if(slideType == SlideGeometricOutput) { + imp = new GeometricOutputSlide(rate0,rate1,n); + } +} + +Slide :: ~Slide() +{ + delete imp; +} + +float Slide :: getTotalStretch() +{ + return imp->getTotalStretch(); +} + +float Slide :: getRate(float t) +{ + if(t > 1.0f) t = 1.0f; + return imp->getRate(t); +} + +float Slide :: getStretch(float t) +{ + if(t > 1.0f) t = 1.0f; + return imp->getStretch(t); +} + +float Slide :: getStretchedTime(float t) +{ + if(t > 1.0f) t = 1.0f; + return imp->getStretchedTime(t); +} + +float Slide :: getRate() +{ + return imp->getRate(); +} + +float Slide :: getStretch() +{ + return imp->getStretch(); +} + +void Slide :: step() +{ + imp->step(); +} + +class SBSMSInterfaceSlidingImp { +public: + friend class SBSMSInterfaceSliding; + SBSMSInterfaceSlidingImp(Slide *rateSlide, + Slide *pitchSlide, + bool bPitchReferenceInput, + const SampleCountType &samplesToInput, + long preSamples, + SBSMSQuality *quality); + ~SBSMSInterfaceSlidingImp() {} + inline float getStretch(float t); + inline float getPitch(float t); + inline long getPresamples(); + SampleCountType getSamplesToInput(); + SampleCountType getSamplesToOutput(); +protected: + Slide *stretchSlide; + Slide *pitchSlide; + bool bPitchReferenceInput; + float totalStretch; + float stretchScale; + long preSamples; + SampleCountType samplesToInput; + SampleCountType samplesToOutput; +}; + + +SBSMSInterfaceSlidingImp :: SBSMSInterfaceSlidingImp(Slide *stretchSlide, + Slide *pitchSlide, + bool bPitchReferenceInput, + const SampleCountType &samplesToInput, + long preSamples, + SBSMSQuality *quality) +{ + this->stretchSlide = stretchSlide; + this->pitchSlide = pitchSlide; + this->bPitchReferenceInput = bPitchReferenceInput; + this->samplesToInput = samplesToInput; + this->preSamples = preSamples; + this->totalStretch = stretchSlide->getTotalStretch(); + this->samplesToOutput = (SampleCountType)((float)samplesToInput * totalStretch); + stretchScale = 1.0f; + + if(quality) { + SampleCountType samplesIn = 0; + SampleCountType samplesOut = 0; + float outFrameSizefloat = 0.0f; + float stretch = 1.0f; + int inFrameSize = quality->getFrameSize(); + while(samplesIn < samplesToInput) { + float t = (float)samplesIn / (float)samplesToInput; + stretch = stretchSlide->getStretch(t); + outFrameSizefloat += stretch * inFrameSize; + int outFrameSize = (int) outFrameSizefloat; + outFrameSizefloat -= (float) outFrameSize; + samplesIn += inFrameSize; + samplesOut += outFrameSize; + } + SampleCountType samplesOutputed = samplesOut - lrintf(stretch * (samplesIn - samplesToInput)); + stretchScale = (float)samplesToOutput / (float)samplesOutputed; + } +} + +float SBSMSInterfaceSliding :: getStretch(float t) { return imp->getStretch(t); } +float SBSMSInterfaceSlidingImp :: getStretch(float t) +{ + return stretchScale * stretchSlide->getStretch(t); +} + +float SBSMSInterfaceSliding :: getPitch(float t) { return imp->getPitch(t); } +float SBSMSInterfaceSlidingImp :: getPitch(float t) +{ + if(bPitchReferenceInput) return pitchSlide->getRate(t); + else return pitchSlide->getRate(min(1.0f,stretchSlide->getStretchedTime(t) / totalStretch)); +} + +long SBSMSInterfaceSliding :: getPresamples() { return imp->getPresamples(); } +long SBSMSInterfaceSlidingImp :: getPresamples() +{ + return preSamples; +} + +SampleCountType SBSMSInterfaceSliding :: getSamplesToInput() { return imp->getSamplesToInput(); } +SampleCountType SBSMSInterfaceSlidingImp :: getSamplesToInput() +{ + return samplesToInput; +} + +SampleCountType SBSMSInterfaceSliding :: getSamplesToOutput() { return imp->getSamplesToOutput(); } +SampleCountType SBSMSInterfaceSlidingImp :: getSamplesToOutput() +{ + return samplesToOutput; +} + +SBSMSInterfaceSliding :: SBSMSInterfaceSliding(Slide *stretchSlide, + Slide *pitchSlide, + bool bPitchReferenceInput, + const SampleCountType &samplesToInput, + long preSamples, + SBSMSQuality *quality) +{ + imp = new SBSMSInterfaceSlidingImp(stretchSlide, pitchSlide, bPitchReferenceInput, + samplesToInput, preSamples, quality); +} + +SBSMSInterfaceSliding :: ~SBSMSInterfaceSliding() +{ + delete imp; +} + +} diff --git a/lib-src/sbsms/src/sse.h b/lib-src/sbsms/src/sse.h new file mode 100644 index 000000000..9c38f4333 --- /dev/null +++ b/lib-src/sbsms/src/sse.h @@ -0,0 +1,32 @@ +// -*- mode: c++ -*- +#ifndef SSE_H +#define SSE_H + +#include "config.h" + +#if defined(ENABLE_SSE) && !defined(APPLE_PPC) + +#include + +namespace _sbsms_ { + +typedef __m128 simd_vector; +#define LOAD(p) _mm_loadu_ps((float*)(p)) +#define STORE(v,p) _mm_storeu_ps((float*)(p),v) +#define LOAD16(p) _mm_load_ps((float*)(p)) +#define STORE16(v,p) _mm_store_ps((float*)(p),v) +#define LOADL(v,p) _mm_loadl_pi(v,(const __m64*)(p)) +#define LOADH(v,p) _mm_loadh_pi(v,(const __m64*)(p)) +#define STOREL(v,p) _mm_storel_pi((__m64 *)(p), v) +#define STOREH(v,p) _mm_storeh_pi((__m64 *)(p), v) +#define VADD(v1,v2) _mm_add_ps(v1,v2) +#define VSUB(v1,v2) _mm_sub_ps(v1,v2) +#define VMUL(v1,v2) _mm_mul_ps(v1,v2) +#define SHUFFLE(a,b,w,x,y,z) _mm_shuffle_ps(a,b,_MM_SHUFFLE(z,y,x,w)) +#define SET(f) _mm_set1_ps(f) + +} + +#endif + +#endif diff --git a/lib-src/sbsms/src/synthTable.h b/lib-src/sbsms/src/synthTable.h new file mode 100644 index 000000000..5b575b1f0 --- /dev/null +++ b/lib-src/sbsms/src/synthTable.h @@ -0,0 +1,1041 @@ +// -*- mode: c++ -*- +#ifndef SYNTHTABLE_H +#define SYNTHTABLE_H +#include "utils.h" + +namespace _sbsms_ { + +long synthTable1[512] = +{ +2147450880, +2147319810, +2146795530, +2146009110, +2144895015, +2143387710, +2141618265, +2139521145, +2137096350, +2134343880, +2131329270, +2127921450, +2124185955, +2120188320, +2115863010, +2111144490, +2106163830, +2100921030, +2095285020, +2089321335, +2083095510, +2076542010, +2069660835, +2062451985, +2054980995, +2047182330, +2039055990, +2030667510, +2021951355, +2012907525, +2003536020, +1993902375, +1984006590, +1973783130, +1963231995, +1952418720, +1941277770, +1929874680, +1918143915, +1906151010, +1893895965, +1881313245, +1868468385, +1855361385, +1841926710, +1828229895, +1814270940, +1800049845, +1785566610, +1770755700, +1755748185, +1740412995, +1724881200, +1709021730, +1692965655, +1676581905, +1660001550, +1643159055, +1626054420, +1608753180, +1591124265, +1573364280, +1555276620, +1536992355, +1518445950, +1499702940, +1480763325, +1461561570, +1442163210, +1422502710, +1402645605, +1382591895, +1362341580, +1341829125, +1321185600, +1300279935, +1279243200, +1257944325, +1236514380, +1214887830, +1193064675, +1171044915, +1148894085, +1126546650, +1104002610, +1081327500, +1058455785, +1035453000, +1012319145, +988988685, +965527155, +941934555, +918145350, +894290610, +870239265, +846056850, +821808900, +797364345, +772854255, +748213095, +723440865, +698603100, +673634265, +648534360, +623368920, +598137945, +572775900, +547282785, +521789670, +496165485, +470541300, +444786045, +418965255, +393078930, +367127070, +341109675, +315092280, +289009350, +262860885, +236712420, +210498420, +184218885, +158004885, +131659815, +105380280, +79035210, +52690140, +26345070, +0, +-26345070, +-52690140, +-79035210, +-105380280, +-131659815, +-158004885, +-184218885, +-210498420, +-236712420, +-262860885, +-289009350, +-315092280, +-341109675, +-367127070, +-393078930, +-418965255, +-444786045, +-470541300, +-496165485, +-521789670, +-547282785, +-572775900, +-598137945, +-623368920, +-648534360, +-673634265, +-698603100, +-723440865, +-748213095, +-772854255, +-797364345, +-821808900, +-846056850, +-870239265, +-894290610, +-918145350, +-941934555, +-965527155, +-988988685, +-1012319145, +-1035453000, +-1058455785, +-1081327500, +-1104002610, +-1126546650, +-1148894085, +-1171044915, +-1193064675, +-1214887830, +-1236514380, +-1257944325, +-1279243200, +-1300279935, +-1321185600, +-1341829125, +-1362341580, +-1382591895, +-1402645605, +-1422502710, +-1442163210, +-1461561570, +-1480763325, +-1499702940, +-1518445950, +-1536992355, +-1555276620, +-1573364280, +-1591124265, +-1608753180, +-1626054420, +-1643159055, +-1660001550, +-1676581905, +-1692965655, +-1709021730, +-1724881200, +-1740412995, +-1755748185, +-1770755700, +-1785566610, +-1800049845, +-1814270940, +-1828229895, +-1841926710, +-1855361385, +-1868468385, +-1881313245, +-1893895965, +-1906151010, +-1918143915, +-1929874680, +-1941277770, +-1952418720, +-1963231995, +-1973783130, +-1984006590, +-1993902375, +-2003536020, +-2012907525, +-2021951355, +-2030667510, +-2039055990, +-2047182330, +-2054980995, +-2062451985, +-2069660835, +-2076542010, +-2083095510, +-2089321335, +-2095285020, +-2100921030, +-2106163830, +-2111144490, +-2115863010, +-2120188320, +-2124185955, +-2127921450, +-2131329270, +-2134343880, +-2137096350, +-2139521145, +-2141618265, +-2143387710, +-2144895015, +-2146009110, +-2146795530, +-2147319810, +-2147450880, +-2147319810, +-2146795530, +-2146009110, +-2144895015, +-2143387710, +-2141618265, +-2139521145, +-2137096350, +-2134343880, +-2131329270, +-2127921450, +-2124185955, +-2120188320, +-2115863010, +-2111144490, +-2106163830, +-2100921030, +-2095285020, +-2089321335, +-2083095510, +-2076542010, +-2069660835, +-2062451985, +-2054980995, +-2047182330, +-2039055990, +-2030667510, +-2021951355, +-2012907525, +-2003536020, +-1993902375, +-1984006590, +-1973783130, +-1963231995, +-1952418720, +-1941277770, +-1929874680, +-1918143915, +-1906151010, +-1893895965, +-1881313245, +-1868468385, +-1855361385, +-1841926710, +-1828229895, +-1814270940, +-1800049845, +-1785566610, +-1770755700, +-1755748185, +-1740412995, +-1724881200, +-1709021730, +-1692965655, +-1676581905, +-1660001550, +-1643159055, +-1626054420, +-1608753180, +-1591124265, +-1573364280, +-1555276620, +-1536992355, +-1518445950, +-1499702940, +-1480763325, +-1461561570, +-1442163210, +-1422502710, +-1402645605, +-1382591895, +-1362341580, +-1341829125, +-1321185600, +-1300279935, +-1279243200, +-1257944325, +-1236514380, +-1214887830, +-1193064675, +-1171044915, +-1148894085, +-1126546650, +-1104002610, +-1081327500, +-1058455785, +-1035453000, +-1012319145, +-988988685, +-965527155, +-941934555, +-918145350, +-894290610, +-870239265, +-846056850, +-821808900, +-797364345, +-772854255, +-748213095, +-723440865, +-698603100, +-673634265, +-648534360, +-623368920, +-598137945, +-572775900, +-547282785, +-521789670, +-496165485, +-470541300, +-444786045, +-418965255, +-393078930, +-367127070, +-341109675, +-315092280, +-289009350, +-262860885, +-236712420, +-210498420, +-184218885, +-158004885, +-131659815, +-105380280, +-79035210, +-52690140, +-26345070, +0, +26345070, +52690140, +79035210, +105380280, +131659815, +158004885, +184218885, +210498420, +236712420, +262860885, +289009350, +315092280, +341109675, +367127070, +393078930, +418965255, +444786045, +470541300, +496165485, +521789670, +547282785, +572775900, +598137945, +623368920, +648534360, +673634265, +698603100, +723440865, +748213095, +772854255, +797364345, +821808900, +846056850, +870239265, +894290610, +918145350, +941934555, +965527155, +988988685, +1012319145, +1035453000, +1058455785, +1081327500, +1104002610, +1126546650, +1148894085, +1171044915, +1193064675, +1214887830, +1236514380, +1257944325, +1279243200, +1300279935, +1321185600, +1341829125, +1362341580, +1382591895, +1402645605, +1422502710, +1442163210, +1461561570, +1480763325, +1499702940, +1518445950, +1536992355, +1555276620, +1573364280, +1591124265, +1608753180, +1626054420, +1643159055, +1660001550, +1676581905, +1692965655, +1709021730, +1724881200, +1740412995, +1755748185, +1770755700, +1785566610, +1800049845, +1814270940, +1828229895, +1841926710, +1855361385, +1868468385, +1881313245, +1893895965, +1906151010, +1918143915, +1929874680, +1941277770, +1952418720, +1963231995, +1973783130, +1984006590, +1993902375, +2003536020, +2012907525, +2021951355, +2030667510, +2039055990, +2047182330, +2054980995, +2062451985, +2069660835, +2076542010, +2083095510, +2089321335, +2095285020, +2100921030, +2106163830, +2111144490, +2115863010, +2120188320, +2124185955, +2127921450, +2131329270, +2134343880, +2137096350, +2139521145, +2141618265, +2143387710, +2144895015, +2146009110, +2146795530, +2147319810 +}; + +long synthTable2[512] = { +-2, +-8, +-12, +-17, +-23, +-27, +-32, +-37, +-42, +-46, +-52, +-57, +-61, +-66, +-72, +-76, +-80, +-86, +-91, +-95, +-100, +-105, +-110, +-114, +-119, +-124, +-128, +-133, +-138, +-143, +-147, +-151, +-156, +-161, +-165, +-170, +-174, +-179, +-183, +-187, +-192, +-196, +-200, +-205, +-209, +-213, +-217, +-221, +-226, +-229, +-234, +-237, +-242, +-245, +-250, +-253, +-257, +-261, +-264, +-269, +-271, +-276, +-279, +-283, +-286, +-289, +-293, +-296, +-300, +-303, +-306, +-309, +-313, +-315, +-319, +-321, +-325, +-327, +-330, +-333, +-336, +-338, +-341, +-344, +-346, +-349, +-351, +-353, +-356, +-358, +-360, +-363, +-364, +-367, +-369, +-370, +-373, +-374, +-376, +-378, +-379, +-381, +-383, +-384, +-385, +-387, +-389, +-389, +-391, +-391, +-393, +-394, +-395, +-396, +-397, +-397, +-398, +-399, +-399, +-400, +-401, +-400, +-402, +-401, +-402, +-402, +-402, +-402, +-402, +-402, +-402, +-402, +-401, +-402, +-400, +-401, +-400, +-399, +-399, +-398, +-397, +-397, +-396, +-395, +-394, +-393, +-391, +-391, +-389, +-389, +-387, +-385, +-384, +-383, +-381, +-379, +-378, +-376, +-374, +-373, +-370, +-369, +-367, +-364, +-363, +-360, +-358, +-356, +-353, +-351, +-349, +-346, +-344, +-341, +-338, +-336, +-333, +-330, +-327, +-325, +-321, +-319, +-315, +-313, +-309, +-306, +-303, +-300, +-296, +-293, +-289, +-286, +-283, +-279, +-276, +-271, +-269, +-264, +-261, +-257, +-253, +-250, +-245, +-242, +-237, +-234, +-229, +-226, +-221, +-217, +-213, +-209, +-205, +-200, +-196, +-192, +-187, +-183, +-179, +-174, +-170, +-165, +-161, +-156, +-151, +-147, +-143, +-138, +-133, +-128, +-124, +-119, +-114, +-110, +-105, +-100, +-95, +-91, +-86, +-80, +-76, +-72, +-66, +-61, +-57, +-52, +-46, +-42, +-37, +-32, +-27, +-23, +-17, +-12, +-8, +-2, +2, +8, +12, +17, +23, +27, +32, +37, +42, +46, +52, +57, +61, +66, +72, +76, +80, +86, +91, +95, +100, +105, +110, +114, +119, +124, +128, +133, +138, +143, +147, +151, +156, +161, +165, +170, +174, +179, +183, +187, +192, +196, +200, +205, +209, +213, +217, +221, +226, +229, +234, +237, +242, +245, +250, +253, +257, +261, +264, +269, +271, +276, +279, +283, +286, +289, +293, +296, +300, +303, +306, +309, +313, +315, +319, +321, +325, +327, +330, +333, +336, +338, +341, +344, +346, +349, +351, +353, +356, +358, +360, +363, +364, +367, +369, +370, +373, +374, +376, +378, +379, +381, +383, +384, +385, +387, +389, +389, +391, +391, +393, +394, +395, +396, +397, +397, +398, +399, +399, +400, +401, +400, +402, +401, +402, +402, +402, +402, +402, +402, +402, +402, +401, +402, +400, +401, +400, +399, +399, +398, +397, +397, +396, +395, +394, +393, +391, +391, +389, +389, +387, +385, +384, +383, +381, +379, +378, +376, +374, +373, +370, +369, +367, +364, +363, +360, +358, +356, +353, +351, +349, +346, +344, +341, +338, +336, +333, +330, +327, +325, +321, +319, +315, +313, +309, +306, +303, +300, +296, +293, +289, +286, +283, +279, +276, +271, +269, +264, +261, +257, +253, +250, +245, +242, +237, +234, +229, +226, +221, +217, +213, +209, +205, +200, +196, +192, +187, +183, +179, +174, +170, +165, +161, +156, +151, +147, +143, +138, +133, +128, +124, +119, +114, +110, +105, +100, +95, +91, +86, +80, +76, +72, +66, +61, +57, +52, +46, +42, +37, +32, +27, +23, +17, +12, +8, +2 +}; + +} + +#endif diff --git a/lib-src/sbsms/src/utils.cpp b/lib-src/sbsms/src/utils.cpp deleted file mode 100644 index ec1146cce..000000000 --- a/lib-src/sbsms/src/utils.cpp +++ /dev/null @@ -1,89 +0,0 @@ -#include -#include "utils.h" -#include "real.h" - -namespace _sbsms_ { -int COSSIZE; -real *COSTABLE = NULL; -real COSFACTOR; - -int *factor(int n) -{ - int *f = (int*)calloc(ilog2(n)+1,sizeof(int)); - factor(n,f,0); - return f; -} - -void factor(int n, int *f, int m) -{ - for(int k=2;k<=n;k++) { - if(n%k==0) { - f[m++] = k; - n /= k; - break; - } - } - if(n>1) - factor(n,f,m); -} - -void _evenodd2c(audio *eo, audio *even, audio *odd, int N) -{ - for(int k=0;k and Matteo Frigo. +AC_DEFUN([AX_CHECK_COMPILER_FLAGS], +[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX +AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1]) +dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: +AS_LITERAL_IF([$1], + [AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1), [ + ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=yes, + AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=no) + _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])], + [ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=yes, + eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1)=no) + _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS]) +eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_$1) +AC_MSG_RESULT($ax_check_compiler_flags) +if test "x$ax_check_compiler_flags" = xyes; then + m4_default([$2], :) +else + m4_default([$3], :) +fi +])dnl AX_CHECK_COMPILER_FLAGS diff --git a/m4/ax_compiler_vendor.m4 b/m4/ax_compiler_vendor.m4 new file mode 100644 index 000000000..642b41fd6 --- /dev/null +++ b/m4/ax_compiler_vendor.m4 @@ -0,0 +1,30 @@ +dnl @synopsis AX_COMPILER_VENDOR +dnl @summary find the vendor (gnu, intel, etc.) of the C/C++ compiler +dnl @category C +dnl @category C++ +dnl +dnl Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, +dnl sun, hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, +dnl microsoft, watcom, etc. The vendor is returned in the cache variable +dnl $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++. +dnl +dnl @version 2007-08-01 +dnl @license GPLWithACException +dnl @author Steven G. Johnson with Matteo Frigo + +AC_DEFUN([AX_COMPILER_VENDOR], +[ +AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, + [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown + # note: don't check for gcc first since some other compilers define __GNUC__ + for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do + vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ +#if !($vencpp) + thisisanerror; +#endif +])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break]) + done + ]) +]) +