TimeScale effect improvements, updating to sbsms 2, not including GUI changes (except removing obsolete transient sharpening option). See Bug 485.
This commit is contained in:
parent
aa0738a81a
commit
87fb427603
28
configure.in
28
configure.in
|
@ -48,6 +48,7 @@ dnl if $CFLAGS is blank and it finds GCC
|
||||||
cflags_save="$CFLAGS"
|
cflags_save="$CFLAGS"
|
||||||
cppflags_save="$CPPFLAGS"
|
cppflags_save="$CPPFLAGS"
|
||||||
cxxflags_save="$CXXFLAGS"
|
cxxflags_save="$CXXFLAGS"
|
||||||
|
AX_COMPILER_VENDOR
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_LANG([C++])
|
AC_LANG([C++])
|
||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
|
@ -173,6 +174,10 @@ AC_ARG_WITH(lib-preference,
|
||||||
lib_preference=$withval,
|
lib_preference=$withval,
|
||||||
lib_preference="system local")
|
lib_preference="system local")
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(sse, [AC_HELP_STRING([--enable-sse],[enable SSE optimizations])], enable_sse=$enableval, enable_sse=yes)
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(universal_binary,[ --enable-universal_binary enable universal binary build: (default: disable)],[enable_universal_binary=$enableval],[enable_universal_binary=no])
|
||||||
|
|
||||||
dnl AC_ARG_WITH(wx-version,
|
dnl AC_ARG_WITH(wx-version,
|
||||||
dnl [AS_HELP_STRING([--with-wx-version],
|
dnl [AS_HELP_STRING([--with-wx-version],
|
||||||
dnl [select wxWidgets version (if both installed) [2.8,]])],
|
dnl [select wxWidgets version (if both installed) [2.8,]])],
|
||||||
|
@ -185,6 +190,29 @@ dnl ----------------------------------------------------
|
||||||
dnl If user asked for debug, put debug in compiler flags
|
dnl If user asked for debug, put debug in compiler flags
|
||||||
dnl ----------------------------------------------------
|
dnl ----------------------------------------------------
|
||||||
|
|
||||||
|
if test x$enable_universal_binary = xyes; then
|
||||||
|
case "$target_os" in
|
||||||
|
darwin*)
|
||||||
|
CPPFLAGS="${CPPFLAGS} -mmacosx-version-min=10.4 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test x$enable_sse = xyes; then
|
||||||
|
|
||||||
|
if test "${ax_cv_cxx_compiler_vendor}" = "gnu"; then
|
||||||
|
AX_CHECK_COMPILER_FLAGS(-msse, [SBSMS_CFLAGS="$SBSMS_CFLAGS -msse"],[AC_MSG_ERROR([Need a version of gcc with -msse])])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xmmintrin.h>]], [[__m128 v,w; float p[8]; v = _mm_loadu_ps(p); _mm_storeu_ps(p,v); w = _mm_loadl_pi(w,(const __m64*)p); w = _mm_loadh_pi(w,(const __m64*)p); _mm_storel_pi((__m64 *)p, w); _mm_storeh_pi((__m64 *)p, w); v = _mm_add_ps(v,w); v = _mm_sub_ps(v,w); v = _mm_mul_ps(v,w); v = _mm_shuffle_ps(v,w,_MM_SHUFFLE(0,1,2,3)); w = _mm_set1_ps(0.0f);]])], [sse_ok=yes], [sse_ok=no])
|
||||||
|
|
||||||
|
if test x$sse_ok = xyes; then
|
||||||
|
AC_DEFINE(ENABLE_SSE,1,[Define to enable sse])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if test x"$debug_preference" = "xyes" ; then
|
if test x"$debug_preference" = "xyes" ; then
|
||||||
dnl we want debuging on
|
dnl we want debuging on
|
||||||
AC_MSG_NOTICE([Adding -g for debugging to CFLAGS and CXXFLAGS ...])
|
AC_MSG_NOTICE([Adding -g for debugging to CFLAGS and CXXFLAGS ...])
|
||||||
|
|
|
@ -1,196 +0,0 @@
|
||||||
Version 2.0.2 (15 Aug 2005)
|
|
||||||
|
|
||||||
* packaging changes:
|
|
||||||
- require automake (>= 1.5) for 'make -f Makefile.cvs'
|
|
||||||
(mandatory for 'dist-bzip2' automake option)
|
|
||||||
|
|
||||||
* src/gig.cpp, src/gig.h:
|
|
||||||
- support for gig v3 multi-file format (.gig, .gx01, .gx02, ...),
|
|
||||||
the extension files are read automatically when the samples are
|
|
||||||
loaded
|
|
||||||
- fixed the 24 bit decompression, the result should now be exact
|
|
||||||
instead of an approximation
|
|
||||||
- added VCFCutoffControllerInvert parameter and GetVelocityCutoff
|
|
||||||
function to DimensionRegion
|
|
||||||
|
|
||||||
* src/DLS.cpp, src/DLS.h:
|
|
||||||
- the upper bits of the pool table indices are read (used as
|
|
||||||
extension file numbers for gig v3)
|
|
||||||
|
|
||||||
* src/RIFF.cpp, src/RIFF.h:
|
|
||||||
- the file name is remembered in the RIFF::File object
|
|
||||||
|
|
||||||
Version 2.0.1 (12 Jun 2005)
|
|
||||||
|
|
||||||
* packaging changes:
|
|
||||||
- include debian/ directory on 'make dist'
|
|
||||||
- create a bzip2 tarball on 'make dist'
|
|
||||||
|
|
||||||
* src/gigextract.cpp:
|
|
||||||
- show also version of libsndfile or build version of libaudiofile when
|
|
||||||
using the -v switch
|
|
||||||
- fixed mutual link dependency to libsndfile / libaudiofile
|
|
||||||
|
|
||||||
* src/gig.cpp, src/gig.h:
|
|
||||||
- added DimensionRegion::GetVelocityRelease function
|
|
||||||
|
|
||||||
Version 2.0.0 (9 May 2005)
|
|
||||||
|
|
||||||
* packaging changes:
|
|
||||||
- fixed conditional linkage of either libsndfile or libaudiofile
|
|
||||||
(if none of the two exist, configure script will abort)
|
|
||||||
- man pages are now auto generated with the correct libgig version
|
|
||||||
|
|
||||||
* src/gig.cpp, src/gig.h:
|
|
||||||
- experimental support for Gigasampler v3 format;
|
|
||||||
64 bit file offsets are truncated to 32 bit, 24 bit samples are
|
|
||||||
truncated to 16 bit, up to 8 dimensions are read, additional
|
|
||||||
articulation informations are ignored at the moment
|
|
||||||
(patch by Andreas Persson)
|
|
||||||
- added some file format compatibility checks
|
|
||||||
- fixed vcf_type_lowpassturbo value (vcf_type_lowpassturbo was actually
|
|
||||||
never used, because the necessary check was made before
|
|
||||||
initialization)
|
|
||||||
- fixed crossfade points order (structure for big endian and little
|
|
||||||
endian systems was interchanged)
|
|
||||||
- fixed some memory leaks (patch by 'Gene', a.k.a Anders Alm)
|
|
||||||
- fixed crash which occured when patches did not have a sample assigned
|
|
||||||
to their region or dimension region (patch by Andreas Persson)
|
|
||||||
- support for compressed mono samples
|
|
||||||
- experimental support for compressed 24 bit samples
|
|
||||||
- fixed decompression on big-endian CPUs
|
|
||||||
- fixed decompression bug that truncated the last block of samples
|
|
||||||
- external decompression buffers can now be used for streaming samples
|
|
||||||
to avoid race conditions in case of multiple streaming threads
|
|
||||||
- added pre-calculated sample attenuation parameter
|
|
||||||
- added v3 "random" and "round robin" dimensions
|
|
||||||
- implemented progress indicator callback mechanism for loading
|
|
||||||
instruments and samples
|
|
||||||
- added functions libraryName() and libraryVersion()
|
|
||||||
|
|
||||||
* src/DLS.cpp, src/DLS.h:
|
|
||||||
- fixed File constructor which caused variable File::Instruments always
|
|
||||||
to be zero
|
|
||||||
- added functions libraryName() and libraryVersion()
|
|
||||||
|
|
||||||
* src/RIFF.cpp, src/RIFF.h:
|
|
||||||
- fixed method List::LoadSubChunks() which did not restore the original
|
|
||||||
position within the body of the given list chunk
|
|
||||||
- added functions libraryName() and libraryVersion()
|
|
||||||
|
|
||||||
* src/rifftree.cpp:
|
|
||||||
- added command line switch -v to show rifftree's revision and the used
|
|
||||||
libgig version
|
|
||||||
|
|
||||||
* src/dlsdump.cpp:
|
|
||||||
- added command line switch -v to show dlsdump's revision and the used
|
|
||||||
libgig version
|
|
||||||
|
|
||||||
* src/gigdump.cpp:
|
|
||||||
- added output of UnityNote, FineTune, Gain, SampleStartOffset an
|
|
||||||
LoopPlayCount
|
|
||||||
- added command line switch -v to show gigdump's revision and the used
|
|
||||||
libgig version
|
|
||||||
|
|
||||||
* src/gigextract.cpp:
|
|
||||||
- support for compressed mono samples and compressed 24 bit samples
|
|
||||||
- added command line switch -v to show gigextract's revision and the
|
|
||||||
used libgig version
|
|
||||||
|
|
||||||
Version 1.0.0 (26 Nov 2004)
|
|
||||||
|
|
||||||
* packaging changes:
|
|
||||||
- renamed 'libgig.pc.in' -> 'gig.pc.in' and renamed pkg-config lib name
|
|
||||||
'libgig' -> 'gig' as it's common practice to omit the 'lib' prefix
|
|
||||||
- fixed man pages automake install rule (which didn't work on Mandrake,
|
|
||||||
SuSE and Fedora)
|
|
||||||
- fixed generation of Doxygen API documentation (now also included in
|
|
||||||
RPM and Debian packages)
|
|
||||||
|
|
||||||
* src/gig.cpp, src/gig.h:
|
|
||||||
- fixed / improved accuracy of all three velocity to volume
|
|
||||||
transformation functions a.k.a. 'nonlinear','linear','special'
|
|
||||||
(patch by Andreas Persson)
|
|
||||||
- denormals are filtered from the velocity to volume tables
|
|
||||||
- bugfix for dimension region switching (wrong handling of the release
|
|
||||||
trigger dimension, no bit range check for dimensions of split type
|
|
||||||
'split_type_bit')
|
|
||||||
- fixed panorama value in DimensionRegion (invalid conversion from
|
|
||||||
signed 7 bit to signed 8 bit)
|
|
||||||
- added class attribute 'Layers' to class 'gig::Region'
|
|
||||||
- symbol prototyping of gig::Region (fixes build failure with qsampler)
|
|
||||||
|
|
||||||
* src/gigextract.cpp:
|
|
||||||
- added support for libsndfile (if libaudiofile and libsndfile are
|
|
||||||
available then libsndfile is preferred)
|
|
||||||
|
|
||||||
* src/gigdump.cpp:
|
|
||||||
- added printout for dimension informations (amount, type, bits, zones)
|
|
||||||
- added printout for velocity response curve parameters
|
|
||||||
- added printout for crossfade definitions
|
|
||||||
- added printout for panorama value for each DimensionRegion
|
|
||||||
- replaced printout of DLS Region layer by printout of amount of
|
|
||||||
Gigasampler layers
|
|
||||||
|
|
||||||
Version 0.7.1 (2 Jul 2004)
|
|
||||||
|
|
||||||
* packaging changes:
|
|
||||||
- added libgig.spec and libgig.pc package configurations for generating
|
|
||||||
Redhat packages
|
|
||||||
- header files included on installation.
|
|
||||||
- autotools-generated files removed from CVS repository.
|
|
||||||
- added support for generating Debian packages
|
|
||||||
- version of shared library can be set in configure.in
|
|
||||||
|
|
||||||
Version 0.7.0 (3 May 2004)
|
|
||||||
|
|
||||||
* general changes:
|
|
||||||
- various big endian specific corrections
|
|
||||||
(successfully tested now on PPC)
|
|
||||||
- minor adjustments to avoid compile errors on some systems
|
|
||||||
(using now pow() instead of powl() and --pedantic g++ compiler switch)
|
|
||||||
- libtoolized the library
|
|
||||||
- added man pages for the command line tools
|
|
||||||
(gigextract, gigdump, dlsdump, rifftree)
|
|
||||||
|
|
||||||
* src/gig.cpp, src/gig.h:
|
|
||||||
- fixed bug in decompression algorithm which caused it not to detect
|
|
||||||
the end of a stream
|
|
||||||
- added method GetVelocityAttenuation() to class 'DimensionRegion' which
|
|
||||||
takes the MIDI key velocity value as an argument and returns the
|
|
||||||
appropriate volume factor (0.0 ... 1.0) for the sample to be played
|
|
||||||
back, the velocity curve transformation functions used for this are
|
|
||||||
only an approximation so far
|
|
||||||
- fixed class attributes 'Sample::LoopStart', 'Sample::LoopEnd' and
|
|
||||||
'Sample::LoopSize' which reflected wrong values
|
|
||||||
- class attributes 'Sample::LoopStart' and 'Sample::LoopEnd' are now
|
|
||||||
measured in sample points instead of byte offset
|
|
||||||
- renamed misleading attribute name 'Sample::MIDIPitchFraction' to
|
|
||||||
'Sample::FineTune'
|
|
||||||
- added class attribute 'Sample::LoopSize'
|
|
||||||
- added method GetInstrument(uint index) to class 'File'
|
|
||||||
- added ReadAndLoop() method to class 'Sample' which is an extension to
|
|
||||||
the normal Read() method to honor the sample's looping information
|
|
||||||
while streaming from disk
|
|
||||||
- changed interface for 'attenuation_ctrl_t', 'eg1_ctrl_t' and
|
|
||||||
'eg2_ctrl_t': replaced this huge enumeration by a structure which
|
|
||||||
reflects the MIDI controller number in case of an ordinary control
|
|
||||||
change controller (this saves a huge switch-case block in the
|
|
||||||
application of the library user)
|
|
||||||
- renamed following attributes in class 'DimensionRegion':
|
|
||||||
'AttenuationContol' -> 'AttenuationController',
|
|
||||||
'InvertAttenuationControl' -> 'InvertAttenuationController',
|
|
||||||
'AttenuationControlTreshold' -> 'AttenuationControllerThreshold'
|
|
||||||
- minor fix in API documentation for method GetVelocityAttenuation() in
|
|
||||||
class 'DimensionRegion'
|
|
||||||
|
|
||||||
* src/RIFF.cpp, src/RIFF.h:
|
|
||||||
- added additional API documentation
|
|
||||||
- minor fix in Chunk::Read() method (only a minor efficiency issue)
|
|
||||||
|
|
||||||
* src/gigdump.cpp:
|
|
||||||
- added printout of samples' looping informations
|
|
||||||
|
|
||||||
Version 0.6.0 (3 Nov 2003)
|
|
||||||
|
|
||||||
* initial release
|
|
|
@ -42,6 +42,8 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
|
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
|
||||||
$(top_srcdir)/m4/ac_c99_func_lrintf.m4 \
|
$(top_srcdir)/m4/ac_c99_func_lrintf.m4 \
|
||||||
|
$(top_srcdir)/m4/ax_check_compiler_flags.m4 \
|
||||||
|
$(top_srcdir)/m4/ax_compiler_vendor.m4 \
|
||||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.in
|
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.in
|
||||||
|
|
588
lib-src/sbsms/configure
vendored
588
lib-src/sbsms/configure
vendored
|
@ -1,6 +1,6 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.61 for sbsms 1.5.0.
|
# Generated by GNU Autoconf 2.61 for sbsms 2.0.0.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||||
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||||
|
@ -721,8 +721,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='sbsms'
|
PACKAGE_NAME='sbsms'
|
||||||
PACKAGE_TARNAME='sbsms'
|
PACKAGE_TARNAME='sbsms'
|
||||||
PACKAGE_VERSION='1.5.0'
|
PACKAGE_VERSION='2.0.0'
|
||||||
PACKAGE_STRING='sbsms 1.5.0'
|
PACKAGE_STRING='sbsms 2.0.0'
|
||||||
PACKAGE_BUGREPORT=''
|
PACKAGE_BUGREPORT=''
|
||||||
|
|
||||||
ac_unique_file="src/sbsms.cpp"
|
ac_unique_file="src/sbsms.cpp"
|
||||||
|
@ -1400,7 +1400,7 @@ if test "$ac_init_help" = "long"; then
|
||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures sbsms 1.5.0 to adapt to many kinds of systems.
|
\`configure' configures sbsms 2.0.0 to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
|
@ -1471,7 +1471,7 @@ fi
|
||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of sbsms 1.5.0:";;
|
short | recursive ) echo "Configuration of sbsms 2.0.0:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
|
@ -1483,9 +1483,11 @@ Optional Features:
|
||||||
--enable-fast-install[=PKGS]
|
--enable-fast-install[=PKGS]
|
||||||
optimize for fast installation [default=yes]
|
optimize for fast installation [default=yes]
|
||||||
--disable-libtool-lock avoid locking (might break parallel builds)
|
--disable-libtool-lock avoid locking (might break parallel builds)
|
||||||
--enable-universal_binary enable universal binary build: (default: disable)
|
|
||||||
--enable-static enable static build: (default: disable)
|
--enable-static enable static build: (default: disable)
|
||||||
--enable-debug enable debug build: (default: disable)
|
--enable-debug enable debug build: (default: disable)
|
||||||
|
--enable-multithreaded enable multithreaded build: (default: disable)
|
||||||
|
--enable-sse enable SSE optimizations
|
||||||
|
--enable-universal_binary enable universal binary build: (default: disable)
|
||||||
--disable-dependency-tracking speeds up one-time build
|
--disable-dependency-tracking speeds up one-time build
|
||||||
--enable-dependency-tracking do not reject slow dependency extractors
|
--enable-dependency-tracking do not reject slow dependency extractors
|
||||||
--enable-maintainer-mode enable make rules and dependencies not useful
|
--enable-maintainer-mode enable make rules and dependencies not useful
|
||||||
|
@ -1574,7 +1576,7 @@ fi
|
||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
sbsms configure 1.5.0
|
sbsms configure 2.0.0
|
||||||
generated by GNU Autoconf 2.61
|
generated by GNU Autoconf 2.61
|
||||||
|
|
||||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||||
|
@ -1588,7 +1590,7 @@ cat >config.log <<_ACEOF
|
||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by sbsms $as_me 1.5.0, which was
|
It was created by sbsms $as_me 2.0.0, which was
|
||||||
generated by GNU Autoconf 2.61. Invocation command line was
|
generated by GNU Autoconf 2.61. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
|
@ -1947,8 +1949,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||||
#------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------
|
||||||
# Library's "official" release version:
|
# Library's "official" release version:
|
||||||
|
|
||||||
LIBSBSMS_RELEASE_MAJOR=1
|
LIBSBSMS_RELEASE_MAJOR=2
|
||||||
LIBSBSMS_RELEASE_MINOR=7
|
LIBSBSMS_RELEASE_MINOR=0
|
||||||
LIBSBSMS_RELEASE_BUILD=0
|
LIBSBSMS_RELEASE_BUILD=0
|
||||||
|
|
||||||
ac_aux_dir=
|
ac_aux_dir=
|
||||||
|
@ -2159,7 +2161,7 @@ fi
|
||||||
# 6. If any interfaces have been removed since the last public release, then set age
|
# 6. If any interfaces have been removed since the last public release, then set age
|
||||||
# to 0.
|
# to 0.
|
||||||
|
|
||||||
SHARED_VERSION_INFO="8:0:7"
|
SHARED_VERSION_INFO="10:0:0"
|
||||||
|
|
||||||
case `pwd` in
|
case `pwd` in
|
||||||
*\ * | *\ *)
|
*\ * | *\ *)
|
||||||
|
@ -3758,13 +3760,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
|
||||||
else
|
else
|
||||||
lt_cv_nm_interface="BSD nm"
|
lt_cv_nm_interface="BSD nm"
|
||||||
echo "int some_variable = 0;" > conftest.$ac_ext
|
echo "int some_variable = 0;" > conftest.$ac_ext
|
||||||
(eval echo "\"\$as_me:3761: $ac_compile\"" >&5)
|
(eval echo "\"\$as_me:3763: $ac_compile\"" >&5)
|
||||||
(eval "$ac_compile" 2>conftest.err)
|
(eval "$ac_compile" 2>conftest.err)
|
||||||
cat conftest.err >&5
|
cat conftest.err >&5
|
||||||
(eval echo "\"\$as_me:3764: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
|
(eval echo "\"\$as_me:3766: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
|
||||||
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
|
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
|
||||||
cat conftest.err >&5
|
cat conftest.err >&5
|
||||||
(eval echo "\"\$as_me:3767: output\"" >&5)
|
(eval echo "\"\$as_me:3769: output\"" >&5)
|
||||||
cat conftest.out >&5
|
cat conftest.out >&5
|
||||||
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
|
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
|
||||||
lt_cv_nm_interface="MS dumpbin"
|
lt_cv_nm_interface="MS dumpbin"
|
||||||
|
@ -4986,7 +4988,7 @@ ia64-*-hpux*)
|
||||||
;;
|
;;
|
||||||
*-*-irix6*)
|
*-*-irix6*)
|
||||||
# Find out which ABI we are using.
|
# Find out which ABI we are using.
|
||||||
echo '#line 4989 "configure"' > conftest.$ac_ext
|
echo '#line 4991 "configure"' > conftest.$ac_ext
|
||||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||||
(eval $ac_compile) 2>&5
|
(eval $ac_compile) 2>&5
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
|
@ -6102,7 +6104,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||||
else
|
else
|
||||||
ac_cv_header_stdc=no
|
ac_cv_header_stdc=no
|
||||||
fi
|
fi
|
||||||
rm -f conftest*
|
rm -f -r conftest*
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -6123,7 +6125,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||||
else
|
else
|
||||||
ac_cv_header_stdc=no
|
ac_cv_header_stdc=no
|
||||||
fi
|
fi
|
||||||
rm -f conftest*
|
rm -f -r conftest*
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -6807,11 +6809,11 @@ else
|
||||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||||
-e 's:$: $lt_compiler_flag:'`
|
-e 's:$: $lt_compiler_flag:'`
|
||||||
(eval echo "\"\$as_me:6810: $lt_compile\"" >&5)
|
(eval echo "\"\$as_me:6812: $lt_compile\"" >&5)
|
||||||
(eval "$lt_compile" 2>conftest.err)
|
(eval "$lt_compile" 2>conftest.err)
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
cat conftest.err >&5
|
cat conftest.err >&5
|
||||||
echo "$as_me:6814: \$? = $ac_status" >&5
|
echo "$as_me:6816: \$? = $ac_status" >&5
|
||||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||||
# The compiler can only warn and ignore the option if not recognized
|
# The compiler can only warn and ignore the option if not recognized
|
||||||
# So say no if there are warnings other than the usual output.
|
# So say no if there are warnings other than the usual output.
|
||||||
|
@ -7146,11 +7148,11 @@ else
|
||||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||||
-e 's:$: $lt_compiler_flag:'`
|
-e 's:$: $lt_compiler_flag:'`
|
||||||
(eval echo "\"\$as_me:7149: $lt_compile\"" >&5)
|
(eval echo "\"\$as_me:7151: $lt_compile\"" >&5)
|
||||||
(eval "$lt_compile" 2>conftest.err)
|
(eval "$lt_compile" 2>conftest.err)
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
cat conftest.err >&5
|
cat conftest.err >&5
|
||||||
echo "$as_me:7153: \$? = $ac_status" >&5
|
echo "$as_me:7155: \$? = $ac_status" >&5
|
||||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||||
# The compiler can only warn and ignore the option if not recognized
|
# The compiler can only warn and ignore the option if not recognized
|
||||||
# So say no if there are warnings other than the usual output.
|
# So say no if there are warnings other than the usual output.
|
||||||
|
@ -7251,11 +7253,11 @@ else
|
||||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||||
-e 's:$: $lt_compiler_flag:'`
|
-e 's:$: $lt_compiler_flag:'`
|
||||||
(eval echo "\"\$as_me:7254: $lt_compile\"" >&5)
|
(eval echo "\"\$as_me:7256: $lt_compile\"" >&5)
|
||||||
(eval "$lt_compile" 2>out/conftest.err)
|
(eval "$lt_compile" 2>out/conftest.err)
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
cat out/conftest.err >&5
|
cat out/conftest.err >&5
|
||||||
echo "$as_me:7258: \$? = $ac_status" >&5
|
echo "$as_me:7260: \$? = $ac_status" >&5
|
||||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||||
then
|
then
|
||||||
# The compiler can only warn and ignore the option if not recognized
|
# The compiler can only warn and ignore the option if not recognized
|
||||||
|
@ -7306,11 +7308,11 @@ else
|
||||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||||
-e 's:$: $lt_compiler_flag:'`
|
-e 's:$: $lt_compiler_flag:'`
|
||||||
(eval echo "\"\$as_me:7309: $lt_compile\"" >&5)
|
(eval echo "\"\$as_me:7311: $lt_compile\"" >&5)
|
||||||
(eval "$lt_compile" 2>out/conftest.err)
|
(eval "$lt_compile" 2>out/conftest.err)
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
cat out/conftest.err >&5
|
cat out/conftest.err >&5
|
||||||
echo "$as_me:7313: \$? = $ac_status" >&5
|
echo "$as_me:7315: \$? = $ac_status" >&5
|
||||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||||
then
|
then
|
||||||
# The compiler can only warn and ignore the option if not recognized
|
# The compiler can only warn and ignore the option if not recognized
|
||||||
|
@ -10075,7 +10077,7 @@ else
|
||||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||||
lt_status=$lt_dlunknown
|
lt_status=$lt_dlunknown
|
||||||
cat > conftest.$ac_ext <<_LT_EOF
|
cat > conftest.$ac_ext <<_LT_EOF
|
||||||
#line 10078 "configure"
|
#line 10080 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#if HAVE_DLFCN_H
|
#if HAVE_DLFCN_H
|
||||||
|
@ -10171,7 +10173,7 @@ else
|
||||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||||
lt_status=$lt_dlunknown
|
lt_status=$lt_dlunknown
|
||||||
cat > conftest.$ac_ext <<_LT_EOF
|
cat > conftest.$ac_ext <<_LT_EOF
|
||||||
#line 10174 "configure"
|
#line 10176 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
#if HAVE_DLFCN_H
|
#if HAVE_DLFCN_H
|
||||||
|
@ -13176,11 +13178,11 @@ else
|
||||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||||
-e 's:$: $lt_compiler_flag:'`
|
-e 's:$: $lt_compiler_flag:'`
|
||||||
(eval echo "\"\$as_me:13179: $lt_compile\"" >&5)
|
(eval echo "\"\$as_me:13181: $lt_compile\"" >&5)
|
||||||
(eval "$lt_compile" 2>conftest.err)
|
(eval "$lt_compile" 2>conftest.err)
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
cat conftest.err >&5
|
cat conftest.err >&5
|
||||||
echo "$as_me:13183: \$? = $ac_status" >&5
|
echo "$as_me:13185: \$? = $ac_status" >&5
|
||||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||||
# The compiler can only warn and ignore the option if not recognized
|
# The compiler can only warn and ignore the option if not recognized
|
||||||
# So say no if there are warnings other than the usual output.
|
# So say no if there are warnings other than the usual output.
|
||||||
|
@ -13275,11 +13277,11 @@ else
|
||||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||||
-e 's:$: $lt_compiler_flag:'`
|
-e 's:$: $lt_compiler_flag:'`
|
||||||
(eval echo "\"\$as_me:13278: $lt_compile\"" >&5)
|
(eval echo "\"\$as_me:13280: $lt_compile\"" >&5)
|
||||||
(eval "$lt_compile" 2>out/conftest.err)
|
(eval "$lt_compile" 2>out/conftest.err)
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
cat out/conftest.err >&5
|
cat out/conftest.err >&5
|
||||||
echo "$as_me:13282: \$? = $ac_status" >&5
|
echo "$as_me:13284: \$? = $ac_status" >&5
|
||||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||||
then
|
then
|
||||||
# The compiler can only warn and ignore the option if not recognized
|
# The compiler can only warn and ignore the option if not recognized
|
||||||
|
@ -13327,11 +13329,11 @@ else
|
||||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||||
-e 's:$: $lt_compiler_flag:'`
|
-e 's:$: $lt_compiler_flag:'`
|
||||||
(eval echo "\"\$as_me:13330: $lt_compile\"" >&5)
|
(eval echo "\"\$as_me:13332: $lt_compile\"" >&5)
|
||||||
(eval "$lt_compile" 2>out/conftest.err)
|
(eval "$lt_compile" 2>out/conftest.err)
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
cat out/conftest.err >&5
|
cat out/conftest.err >&5
|
||||||
echo "$as_me:13334: \$? = $ac_status" >&5
|
echo "$as_me:13336: \$? = $ac_status" >&5
|
||||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||||
then
|
then
|
||||||
# The compiler can only warn and ignore the option if not recognized
|
# The compiler can only warn and ignore the option if not recognized
|
||||||
|
@ -14527,281 +14529,72 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||||
|
|
||||||
|
|
||||||
|
{ echo "$as_me:$LINENO: checking for C++ compiler vendor" >&5
|
||||||
|
echo $ECHO_N "checking for C++ compiler vendor... $ECHO_C" >&6; }
|
||||||
|
if test "${ax_cv_cxx_compiler_vendor+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
ax_cv_cxx_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'`")"
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
#if !($vencpp)
|
||||||
|
thisisanerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext
|
||||||
|
if { (ac_try="$ac_compile"
|
||||||
|
case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_compile") 2>conftest.er1
|
||||||
|
ac_status=$?
|
||||||
|
grep -v '^ *+' conftest.er1 >conftest.err
|
||||||
|
rm -f conftest.er1
|
||||||
|
cat conftest.err >&5
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } && {
|
||||||
|
test -z "$ac_cxx_werror_flag" ||
|
||||||
|
test ! -s conftest.err
|
||||||
|
} && test -s conftest.$ac_objext; then
|
||||||
|
ax_cv_cxx_compiler_vendor=`echo $ventest | cut -d: -f1`; break
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
done
|
||||||
|
|
||||||
|
fi
|
||||||
|
{ echo "$as_me:$LINENO: result: $ax_cv_cxx_compiler_vendor" >&5
|
||||||
|
echo "${ECHO_T}$ax_cv_cxx_compiler_vendor" >&6; }
|
||||||
|
|
||||||
# restore those variables back
|
# restore those variables back
|
||||||
CFLAGS="$cflags_save"
|
CFLAGS="$cflags_save"
|
||||||
CPPFLAGS="$cppflags_save"
|
CPPFLAGS="$cppflags_save"
|
||||||
CXXFLAGS="$cxxflags_save"
|
CXXFLAGS="$cxxflags_save"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ac_func in malloc calloc free memcpy memmove
|
|
||||||
do
|
|
||||||
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
|
||||||
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
|
|
||||||
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
|
|
||||||
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
|
|
||||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
|
||||||
else
|
|
||||||
cat >conftest.$ac_ext <<_ACEOF
|
|
||||||
/* confdefs.h. */
|
|
||||||
_ACEOF
|
|
||||||
cat confdefs.h >>conftest.$ac_ext
|
|
||||||
cat >>conftest.$ac_ext <<_ACEOF
|
|
||||||
/* end confdefs.h. */
|
|
||||||
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
|
|
||||||
For example, HP-UX 11i <limits.h> declares gettimeofday. */
|
|
||||||
#define $ac_func innocuous_$ac_func
|
|
||||||
|
|
||||||
/* System header to define __stub macros and hopefully few prototypes,
|
|
||||||
which can conflict with char $ac_func (); below.
|
|
||||||
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|
|
||||||
<limits.h> exists even on freestanding compilers. */
|
|
||||||
|
|
||||||
#ifdef __STDC__
|
|
||||||
# include <limits.h>
|
|
||||||
#else
|
|
||||||
# include <assert.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef $ac_func
|
|
||||||
|
|
||||||
/* Override any GCC internal prototype to avoid an error.
|
|
||||||
Use char because int might match the return type of a GCC
|
|
||||||
builtin and then its argument prototype would still apply. */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C"
|
|
||||||
#endif
|
|
||||||
char $ac_func ();
|
|
||||||
/* The GNU C library defines this for functions which it implements
|
|
||||||
to always fail with ENOSYS. Some functions are actually named
|
|
||||||
something starting with __ and the normal name is an alias. */
|
|
||||||
#if defined __stub_$ac_func || defined __stub___$ac_func
|
|
||||||
choke me
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
|
||||||
main ()
|
|
||||||
{
|
|
||||||
return $ac_func ();
|
|
||||||
;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
_ACEOF
|
|
||||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
|
||||||
if { (ac_try="$ac_link"
|
|
||||||
case "(($ac_try" in
|
|
||||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
|
||||||
*) ac_try_echo=$ac_try;;
|
|
||||||
esac
|
|
||||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
|
||||||
(eval "$ac_link") 2>conftest.er1
|
|
||||||
ac_status=$?
|
|
||||||
grep -v '^ *+' conftest.er1 >conftest.err
|
|
||||||
rm -f conftest.er1
|
|
||||||
cat conftest.err >&5
|
|
||||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
|
||||||
(exit $ac_status); } && {
|
|
||||||
test -z "$ac_cxx_werror_flag" ||
|
|
||||||
test ! -s conftest.err
|
|
||||||
} && test -s conftest$ac_exeext &&
|
|
||||||
$as_test_x conftest$ac_exeext; then
|
|
||||||
eval "$as_ac_var=yes"
|
|
||||||
else
|
|
||||||
echo "$as_me: failed program was:" >&5
|
|
||||||
sed 's/^/| /' conftest.$ac_ext >&5
|
|
||||||
|
|
||||||
eval "$as_ac_var=no"
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
|
||||||
conftest$ac_exeext conftest.$ac_ext
|
|
||||||
fi
|
|
||||||
ac_res=`eval echo '${'$as_ac_var'}'`
|
|
||||||
{ echo "$as_me:$LINENO: result: $ac_res" >&5
|
|
||||||
echo "${ECHO_T}$ac_res" >&6; }
|
|
||||||
if test `eval echo '${'$as_ac_var'}'` = yes; then
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
|
||||||
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
|
||||||
_ACEOF
|
|
||||||
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{ echo "$as_me:$LINENO: checking for floor in -lm" >&5
|
|
||||||
echo $ECHO_N "checking for floor in -lm... $ECHO_C" >&6; }
|
|
||||||
if test "${ac_cv_lib_m_floor+set}" = set; then
|
|
||||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
|
||||||
else
|
|
||||||
ac_check_lib_save_LIBS=$LIBS
|
|
||||||
LIBS="-lm $LIBS"
|
|
||||||
cat >conftest.$ac_ext <<_ACEOF
|
|
||||||
/* confdefs.h. */
|
|
||||||
_ACEOF
|
|
||||||
cat confdefs.h >>conftest.$ac_ext
|
|
||||||
cat >>conftest.$ac_ext <<_ACEOF
|
|
||||||
/* end confdefs.h. */
|
|
||||||
|
|
||||||
/* Override any GCC internal prototype to avoid an error.
|
|
||||||
Use char because int might match the return type of a GCC
|
|
||||||
builtin and then its argument prototype would still apply. */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C"
|
|
||||||
#endif
|
|
||||||
char floor ();
|
|
||||||
int
|
|
||||||
main ()
|
|
||||||
{
|
|
||||||
return floor ();
|
|
||||||
;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
_ACEOF
|
|
||||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
|
||||||
if { (ac_try="$ac_link"
|
|
||||||
case "(($ac_try" in
|
|
||||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
|
||||||
*) ac_try_echo=$ac_try;;
|
|
||||||
esac
|
|
||||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
|
||||||
(eval "$ac_link") 2>conftest.er1
|
|
||||||
ac_status=$?
|
|
||||||
grep -v '^ *+' conftest.er1 >conftest.err
|
|
||||||
rm -f conftest.er1
|
|
||||||
cat conftest.err >&5
|
|
||||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
|
||||||
(exit $ac_status); } && {
|
|
||||||
test -z "$ac_cxx_werror_flag" ||
|
|
||||||
test ! -s conftest.err
|
|
||||||
} && test -s conftest$ac_exeext &&
|
|
||||||
$as_test_x conftest$ac_exeext; then
|
|
||||||
ac_cv_lib_m_floor=yes
|
|
||||||
else
|
|
||||||
echo "$as_me: failed program was:" >&5
|
|
||||||
sed 's/^/| /' conftest.$ac_ext >&5
|
|
||||||
|
|
||||||
ac_cv_lib_m_floor=no
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
|
||||||
conftest$ac_exeext conftest.$ac_ext
|
|
||||||
LIBS=$ac_check_lib_save_LIBS
|
|
||||||
fi
|
|
||||||
{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_floor" >&5
|
|
||||||
echo "${ECHO_T}$ac_cv_lib_m_floor" >&6; }
|
|
||||||
if test $ac_cv_lib_m_floor = yes; then
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
|
||||||
#define HAVE_LIBM 1
|
|
||||||
_ACEOF
|
|
||||||
|
|
||||||
LIBS="-lm $LIBS"
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ac_func in floor sqrt log exp sin cos
|
|
||||||
do
|
|
||||||
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
|
||||||
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
|
|
||||||
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
|
|
||||||
if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
|
|
||||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
|
||||||
else
|
|
||||||
cat >conftest.$ac_ext <<_ACEOF
|
|
||||||
/* confdefs.h. */
|
|
||||||
_ACEOF
|
|
||||||
cat confdefs.h >>conftest.$ac_ext
|
|
||||||
cat >>conftest.$ac_ext <<_ACEOF
|
|
||||||
/* end confdefs.h. */
|
|
||||||
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
|
|
||||||
For example, HP-UX 11i <limits.h> declares gettimeofday. */
|
|
||||||
#define $ac_func innocuous_$ac_func
|
|
||||||
|
|
||||||
/* System header to define __stub macros and hopefully few prototypes,
|
|
||||||
which can conflict with char $ac_func (); below.
|
|
||||||
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|
|
||||||
<limits.h> exists even on freestanding compilers. */
|
|
||||||
|
|
||||||
#ifdef __STDC__
|
|
||||||
# include <limits.h>
|
|
||||||
#else
|
|
||||||
# include <assert.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef $ac_func
|
|
||||||
|
|
||||||
/* Override any GCC internal prototype to avoid an error.
|
|
||||||
Use char because int might match the return type of a GCC
|
|
||||||
builtin and then its argument prototype would still apply. */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C"
|
|
||||||
#endif
|
|
||||||
char $ac_func ();
|
|
||||||
/* The GNU C library defines this for functions which it implements
|
|
||||||
to always fail with ENOSYS. Some functions are actually named
|
|
||||||
something starting with __ and the normal name is an alias. */
|
|
||||||
#if defined __stub_$ac_func || defined __stub___$ac_func
|
|
||||||
choke me
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int
|
|
||||||
main ()
|
|
||||||
{
|
|
||||||
return $ac_func ();
|
|
||||||
;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
_ACEOF
|
|
||||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
|
||||||
if { (ac_try="$ac_link"
|
|
||||||
case "(($ac_try" in
|
|
||||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
|
||||||
*) ac_try_echo=$ac_try;;
|
|
||||||
esac
|
|
||||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
|
||||||
(eval "$ac_link") 2>conftest.er1
|
|
||||||
ac_status=$?
|
|
||||||
grep -v '^ *+' conftest.er1 >conftest.err
|
|
||||||
rm -f conftest.er1
|
|
||||||
cat conftest.err >&5
|
|
||||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
|
||||||
(exit $ac_status); } && {
|
|
||||||
test -z "$ac_cxx_werror_flag" ||
|
|
||||||
test ! -s conftest.err
|
|
||||||
} && test -s conftest$ac_exeext &&
|
|
||||||
$as_test_x conftest$ac_exeext; then
|
|
||||||
eval "$as_ac_var=yes"
|
|
||||||
else
|
|
||||||
echo "$as_me: failed program was:" >&5
|
|
||||||
sed 's/^/| /' conftest.$ac_ext >&5
|
|
||||||
|
|
||||||
eval "$as_ac_var=no"
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
|
||||||
conftest$ac_exeext conftest.$ac_ext
|
|
||||||
fi
|
|
||||||
ac_res=`eval echo '${'$as_ac_var'}'`
|
|
||||||
{ echo "$as_me:$LINENO: result: $ac_res" >&5
|
|
||||||
echo "${ECHO_T}$ac_res" >&6; }
|
|
||||||
if test `eval echo '${'$as_ac_var'}'` = yes; then
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
|
||||||
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
|
||||||
_ACEOF
|
|
||||||
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
{ echo "$as_me:$LINENO: checking for lrint" >&5
|
{ echo "$as_me:$LINENO: checking for lrint" >&5
|
||||||
echo $ECHO_N "checking for lrint... $ECHO_C" >&6; }
|
echo $ECHO_N "checking for lrint... $ECHO_C" >&6; }
|
||||||
if test "${ac_cv_c99_lrint+set}" = set; then
|
if test "${ac_cv_c99_lrint+set}" = set; then
|
||||||
|
@ -14930,14 +14723,6 @@ fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check whether --enable-universal_binary was given.
|
|
||||||
if test "${enable_universal_binary+set}" = set; then
|
|
||||||
enableval=$enable_universal_binary; enable_universal_binary=$enableval
|
|
||||||
else
|
|
||||||
enable_universal_binary=no
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Check whether --enable-static was given.
|
# Check whether --enable-static was given.
|
||||||
if test "${enable_static+set}" = set; then
|
if test "${enable_static+set}" = set; then
|
||||||
enableval=$enable_static; enable_static=$enableval
|
enableval=$enable_static; enable_static=$enableval
|
||||||
|
@ -14954,7 +14739,31 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
SBSMS_CFLAGS="-ffast-math -fstrict-aliasing"
|
# Check whether --enable-multithreaded was given.
|
||||||
|
if test "${enable_multithreaded+set}" = set; then
|
||||||
|
enableval=$enable_multithreaded; enable_multithreaded=$enableval
|
||||||
|
else
|
||||||
|
enable_multithreaded=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Check whether --enable-sse was given.
|
||||||
|
if test "${enable_sse+set}" = set; then
|
||||||
|
enableval=$enable_sse; enable_sse=$enableval
|
||||||
|
else
|
||||||
|
enable_sse=yes
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Check whether --enable-universal_binary was given.
|
||||||
|
if test "${enable_universal_binary+set}" = set; then
|
||||||
|
enableval=$enable_universal_binary; enable_universal_binary=$enableval
|
||||||
|
else
|
||||||
|
enable_universal_binary=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
SBSMS_CFLAGS="-ffast-math -funroll-loops"
|
||||||
|
|
||||||
if test x$enable_static = xno; then
|
if test x$enable_static = xno; then
|
||||||
case "$target_os" in
|
case "$target_os" in
|
||||||
|
@ -14966,6 +14775,141 @@ if test x$enable_static = xno; then
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test x$enable_debug = xyes; then
|
||||||
|
SBSMS_CFLAGS="$SBSMS_CFLAGS -g -O3"
|
||||||
|
else
|
||||||
|
SBSMS_CFLAGS="$SBSMS_CFLAGS -O3 -fomit-frame-pointer"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test x$enable_multithreaded = xyes; then
|
||||||
|
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define MULTITHREADED 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${ax_cv_cxx_compiler_vendor} XXX"
|
||||||
|
|
||||||
|
if test x$enable_sse = xyes; then
|
||||||
|
|
||||||
|
if test "${ax_cv_cxx_compiler_vendor}" = "gnu"; then
|
||||||
|
{ echo "$as_me:$LINENO: checking whether C++ compiler accepts -msse" >&5
|
||||||
|
echo $ECHO_N "checking whether C++ compiler accepts -msse... $ECHO_C" >&6; }
|
||||||
|
if test "${ax_cv_cxx_flags__msse+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
|
||||||
|
ax_save_FLAGS=$CXXFLAGS
|
||||||
|
CXXFLAGS="-msse"
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext
|
||||||
|
if { (ac_try="$ac_compile"
|
||||||
|
case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_compile") 2>conftest.er1
|
||||||
|
ac_status=$?
|
||||||
|
grep -v '^ *+' conftest.er1 >conftest.err
|
||||||
|
rm -f conftest.er1
|
||||||
|
cat conftest.err >&5
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } && {
|
||||||
|
test -z "$ac_cxx_werror_flag" ||
|
||||||
|
test ! -s conftest.err
|
||||||
|
} && test -s conftest.$ac_objext; then
|
||||||
|
ax_cv_cxx_flags__msse=yes
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
ax_cv_cxx_flags__msse=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
CXXFLAGS=$ax_save_FLAGS
|
||||||
|
fi
|
||||||
|
|
||||||
|
eval ax_check_compiler_flags=$ax_cv_cxx_flags__msse
|
||||||
|
{ echo "$as_me:$LINENO: result: $ax_check_compiler_flags" >&5
|
||||||
|
echo "${ECHO_T}$ax_check_compiler_flags" >&6; }
|
||||||
|
if test "x$ax_check_compiler_flags" = xyes; then
|
||||||
|
SBSMS_CFLAGS="$SBSMS_CFLAGS -msse"
|
||||||
|
else
|
||||||
|
{ { echo "$as_me:$LINENO: error: Need a version of gcc with -msse" >&5
|
||||||
|
echo "$as_me: error: Need a version of gcc with -msse" >&2;}
|
||||||
|
{ (exit 1); exit 1; }; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
#include <xmmintrin.h>
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
__m128 v,w; float p[8]; v = _mm_loadu_ps(p); _mm_storeu_ps(p,v); w = _mm_loadl_pi(w,(const __m64*)p); w = _mm_loadh_pi(w,(const __m64*)p); _mm_storel_pi((__m64 *)p, w); _mm_storeh_pi((__m64 *)p, w); v = _mm_add_ps(v,w); v = _mm_sub_ps(v,w); v = _mm_mul_ps(v,w); v = _mm_shuffle_ps(v,w,_MM_SHUFFLE(0,1,2,3)); w = _mm_set1_ps(0.0f);
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext
|
||||||
|
if { (ac_try="$ac_compile"
|
||||||
|
case "(($ac_try" in
|
||||||
|
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||||
|
*) ac_try_echo=$ac_try;;
|
||||||
|
esac
|
||||||
|
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||||
|
(eval "$ac_compile") 2>conftest.er1
|
||||||
|
ac_status=$?
|
||||||
|
grep -v '^ *+' conftest.er1 >conftest.err
|
||||||
|
rm -f conftest.er1
|
||||||
|
cat conftest.err >&5
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } && {
|
||||||
|
test -z "$ac_cxx_werror_flag" ||
|
||||||
|
test ! -s conftest.err
|
||||||
|
} && test -s conftest.$ac_objext; then
|
||||||
|
sse_ok=yes
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
sse_ok=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
|
||||||
|
if test x$sse_ok = xyes; then
|
||||||
|
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define ENABLE_SSE 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if test x$enable_universal_binary = xyes; then
|
if test x$enable_universal_binary = xyes; then
|
||||||
case "$target_os" in
|
case "$target_os" in
|
||||||
darwin*)
|
darwin*)
|
||||||
|
@ -14976,20 +14920,6 @@ if test x$enable_universal_binary = xyes; then
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$target_os" in
|
|
||||||
darwin*)
|
|
||||||
macosx="yes"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
macosx="no"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test x$enable_debug = xyes; then
|
|
||||||
SBSMS_CFLAGS="$SBSMS_CFLAGS -g"
|
|
||||||
else
|
|
||||||
SBSMS_CFLAGS="$SBSMS_CFLAGS -O3"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
am__api_version='1.10'
|
am__api_version='1.10'
|
||||||
|
@ -15360,7 +15290,7 @@ fi
|
||||||
|
|
||||||
# Define the identity of the package.
|
# Define the identity of the package.
|
||||||
PACKAGE='sbsms'
|
PACKAGE='sbsms'
|
||||||
VERSION='1.5.0'
|
VERSION='2.0.0'
|
||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
@ -16172,7 +16102,7 @@ exec 6>&1
|
||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by sbsms $as_me 1.5.0, which was
|
This file was extended by sbsms $as_me 2.0.0, which was
|
||||||
generated by GNU Autoconf 2.61. Invocation command line was
|
generated by GNU Autoconf 2.61. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
|
@ -16225,7 +16155,7 @@ Report bugs to <bug-autoconf@gnu.org>."
|
||||||
_ACEOF
|
_ACEOF
|
||||||
cat >>$CONFIG_STATUS <<_ACEOF
|
cat >>$CONFIG_STATUS <<_ACEOF
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
sbsms config.status 1.5.0
|
sbsms config.status 2.0.0
|
||||||
configured by $0, generated by GNU Autoconf 2.61,
|
configured by $0, generated by GNU Autoconf 2.61,
|
||||||
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
AC_INIT([sbsms],[1.5.0])
|
AC_INIT([sbsms],[2.0.0])
|
||||||
|
|
||||||
dnl Use the m4/ directory to contain libtool macros that will be needed to
|
dnl Use the m4/ directory to contain libtool macros that will be needed to
|
||||||
dnl go with the ltmain.sh script (both will be created/updated via the command
|
dnl go with the ltmain.sh script (both will be created/updated via the command
|
||||||
|
@ -8,8 +8,8 @@ AC_CONFIG_MACRO_DIR([m4])
|
||||||
#------------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------------
|
||||||
# Library's "official" release version:
|
# Library's "official" release version:
|
||||||
|
|
||||||
LIBSBSMS_RELEASE_MAJOR=1
|
LIBSBSMS_RELEASE_MAJOR=2
|
||||||
LIBSBSMS_RELEASE_MINOR=7
|
LIBSBSMS_RELEASE_MINOR=0
|
||||||
LIBSBSMS_RELEASE_BUILD=0
|
LIBSBSMS_RELEASE_BUILD=0
|
||||||
AC_CONFIG_SRCDIR([src/sbsms.cpp])
|
AC_CONFIG_SRCDIR([src/sbsms.cpp])
|
||||||
AC_CANONICAL_TARGET([])
|
AC_CANONICAL_TARGET([])
|
||||||
|
@ -34,7 +34,7 @@ AC_DISABLE_SHARED dnl allows for optimizations
|
||||||
# 6. If any interfaces have been removed since the last public release, then set age
|
# 6. If any interfaces have been removed since the last public release, then set age
|
||||||
# to 0.
|
# to 0.
|
||||||
|
|
||||||
SHARED_VERSION_INFO="8:0:7"
|
SHARED_VERSION_INFO="10:0:0"
|
||||||
|
|
||||||
AC_PROG_LIBTOOL
|
AC_PROG_LIBTOOL
|
||||||
AM_PROG_LIBTOOL
|
AM_PROG_LIBTOOL
|
||||||
|
@ -47,29 +47,29 @@ cxxflags_save="$CXXFLAGS"
|
||||||
AC_LANG([C++])
|
AC_LANG([C++])
|
||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
AC_PROG_CXXCPP
|
AC_PROG_CXXCPP
|
||||||
|
AX_COMPILER_VENDOR
|
||||||
# restore those variables back
|
# restore those variables back
|
||||||
CFLAGS="$cflags_save"
|
CFLAGS="$cflags_save"
|
||||||
CPPFLAGS="$cppflags_save"
|
CPPFLAGS="$cppflags_save"
|
||||||
CXXFLAGS="$cxxflags_save"
|
CXXFLAGS="$cxxflags_save"
|
||||||
|
|
||||||
AC_CHECK_FUNCS(malloc calloc free memcpy memmove)
|
|
||||||
|
|
||||||
AC_CHECK_LIB([m],floor)
|
|
||||||
AC_CHECK_FUNCS(floor sqrt log exp sin cos)
|
|
||||||
|
|
||||||
AC_C99_FUNC_LRINT()
|
AC_C99_FUNC_LRINT()
|
||||||
AC_C99_FUNC_LRINTF()
|
AC_C99_FUNC_LRINTF()
|
||||||
|
|
||||||
AC_SUBST(SHLIB_VERSION_ARG)
|
AC_SUBST(SHLIB_VERSION_ARG)
|
||||||
AC_SUBST(SHARED_VERSION_INFO)
|
AC_SUBST(SHARED_VERSION_INFO)
|
||||||
|
|
||||||
AC_ARG_ENABLE(universal_binary,[ --enable-universal_binary enable universal binary build: (default: disable)],[enable_universal_binary=$enableval],[enable_universal_binary=no])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(static,[ --enable-static enable static build: (default: disable)],[enable_static=$enableval],[enable_static=no])
|
AC_ARG_ENABLE(static,[ --enable-static enable static build: (default: disable)],[enable_static=$enableval],[enable_static=no])
|
||||||
|
|
||||||
AC_ARG_ENABLE(debug,[ --enable-debug enable debug build: (default: disable)],[enable_debug=$enableval],[enable_debug=no])
|
AC_ARG_ENABLE(debug,[ --enable-debug enable debug build: (default: disable)],[enable_debug=$enableval],[enable_debug=no])
|
||||||
|
|
||||||
SBSMS_CFLAGS="-ffast-math -fstrict-aliasing"
|
AC_ARG_ENABLE(multithreaded,[ --enable-multithreaded enable multithreaded build: (default: disable)],[enable_multithreaded=$enableval],[enable_multithreaded=no])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(sse, [AC_HELP_STRING([--enable-sse],[enable SSE optimizations])], enable_sse=$enableval, enable_sse=yes)
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(universal_binary,[ --enable-universal_binary enable universal binary build: (default: disable)],[enable_universal_binary=$enableval],[enable_universal_binary=no])
|
||||||
|
|
||||||
|
SBSMS_CFLAGS="-ffast-math -funroll-loops"
|
||||||
|
|
||||||
if test x$enable_static = xno; then
|
if test x$enable_static = xno; then
|
||||||
case "$target_os" in
|
case "$target_os" in
|
||||||
|
@ -81,35 +81,47 @@ if test x$enable_static = xno; then
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test x$enable_debug = xyes; then
|
||||||
|
SBSMS_CFLAGS="$SBSMS_CFLAGS -g -O3"
|
||||||
|
else
|
||||||
|
SBSMS_CFLAGS="$SBSMS_CFLAGS -O3 -fomit-frame-pointer"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test x$enable_multithreaded = xyes; then
|
||||||
|
AC_DEFINE(MULTITHREADED,1,[Define to compile multithreaded sbsms])
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${ax_cv_cxx_compiler_vendor} XXX"
|
||||||
|
|
||||||
|
if test x$enable_sse = xyes; then
|
||||||
|
|
||||||
|
if test "${ax_cv_cxx_compiler_vendor}" = "gnu"; then
|
||||||
|
AX_CHECK_COMPILER_FLAGS(-msse, [SBSMS_CFLAGS="$SBSMS_CFLAGS -msse"],[AC_MSG_ERROR([Need a version of gcc with -msse])])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xmmintrin.h>]], [[__m128 v,w; float p[8]; v = _mm_loadu_ps(p); _mm_storeu_ps(p,v); w = _mm_loadl_pi(w,(const __m64*)p); w = _mm_loadh_pi(w,(const __m64*)p); _mm_storel_pi((__m64 *)p, w); _mm_storeh_pi((__m64 *)p, w); v = _mm_add_ps(v,w); v = _mm_sub_ps(v,w); v = _mm_mul_ps(v,w); v = _mm_shuffle_ps(v,w,_MM_SHUFFLE(0,1,2,3)); w = _mm_set1_ps(0.0f);]])], [sse_ok=yes], [sse_ok=no])
|
||||||
|
|
||||||
|
if test x$sse_ok = xyes; then
|
||||||
|
AC_DEFINE(ENABLE_SSE,1,[Define to enable sse])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if test x$enable_universal_binary = xyes; then
|
if test x$enable_universal_binary = xyes; then
|
||||||
case "$target_os" in
|
case "$target_os" in
|
||||||
darwin*)
|
darwin*)
|
||||||
SBSMS_CFLAGS="$SBSMS_CFLAGS -mmacosx-version-min=10.4 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
|
SBSMS_CFLAGS="$SBSMS_CFLAGS -mmacosx-version-min=10.4 -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$target_os" in
|
|
||||||
darwin*)
|
|
||||||
macosx="yes"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
macosx="no"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test x$enable_debug = xyes; then
|
|
||||||
SBSMS_CFLAGS="$SBSMS_CFLAGS -g"
|
|
||||||
else
|
|
||||||
SBSMS_CFLAGS="$SBSMS_CFLAGS -O3"
|
|
||||||
fi
|
|
||||||
AC_SUBST(SBSMS_CFLAGS)
|
AC_SUBST(SBSMS_CFLAGS)
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE([])
|
AM_INIT_AUTOMAKE([no-dependencies])
|
||||||
|
|
||||||
AM_MAINTAINER_MODE([enabled])
|
AM_MAINTAINER_MODE([enabled])
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile src/Makefile libsbsms.spec sbsms.pc])
|
AC_CONFIG_FILES([Makefile src/Makefile libsbsms.spec sbsms.pc])
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
|
@ -1,172 +1,177 @@
|
||||||
|
// -*- mode: c++ -*-
|
||||||
#ifndef SBSMS_INCLUDE
|
#ifndef SBSMS_INCLUDE
|
||||||
#define SBSMS_INCLUDE
|
#define SBSMS_INCLUDE
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define SBSMS_REAL_FLOAT 1
|
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
typedef float real;
|
|
||||||
typedef real interleaved[2];
|
|
||||||
typedef interleaved audio;
|
|
||||||
|
|
||||||
struct sbsms_quality {
|
typedef float t_fft[2];
|
||||||
long inframesize;
|
typedef t_fft audio;
|
||||||
long maxoutframesize;
|
typedef long long int SampleCountType;
|
||||||
real minrate;
|
typedef long long int TimeType;
|
||||||
real maxrate;
|
typedef unsigned char TrackIndexType;
|
||||||
int bands;
|
|
||||||
int M_MAX;
|
enum {
|
||||||
int H[5];
|
maxBands = 10,
|
||||||
int N[8];
|
numQualityParams = 52
|
||||||
int S[8];
|
|
||||||
int res[8];
|
|
||||||
real pad[8];
|
|
||||||
real P[8];
|
|
||||||
real Q[8];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const sbsms_quality sbsms_quality_standard;
|
struct SBSMSQualityParams {
|
||||||
extern const sbsms_quality sbsms_quality_fast;
|
int bands;
|
||||||
|
int H;
|
||||||
|
int N[maxBands];
|
||||||
|
int N0[maxBands];
|
||||||
|
int N1[maxBands];
|
||||||
|
int N2[maxBands];
|
||||||
|
int res[maxBands];
|
||||||
|
};
|
||||||
|
|
||||||
struct sbsms_resample_frame {
|
class SBSMSQuality {
|
||||||
real ratio0;
|
public:
|
||||||
real ratio1;
|
SBSMSQuality(const SBSMSQualityParams *params);
|
||||||
audio *in;
|
SBSMSQualityParams params;
|
||||||
|
long getFrameSize();
|
||||||
|
long getMaxPresamples();
|
||||||
|
};
|
||||||
|
|
||||||
|
extern const SBSMSQualityParams SBSMSQualityStandard;
|
||||||
|
|
||||||
|
struct SBSMSFrame {
|
||||||
|
float ratio0;
|
||||||
|
float ratio1;
|
||||||
|
audio *buf;
|
||||||
long size;
|
long size;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef long (*sbsms_cb)(audio *buf, long n, void *data);
|
typedef long (*SBSMSResampleCB)(void *cbData, SBSMSFrame *frame);
|
||||||
typedef real (*sbsms_rate_cb)(long nProcessed, void *data);
|
|
||||||
typedef real (*sbsms_pitch_cb)(long nProcessed, void *data);
|
|
||||||
typedef long (*sbsms_resample_cb)(void *cb_data, sbsms_resample_frame *frame);
|
|
||||||
|
|
||||||
class subband;
|
class SBSMSInterface {
|
||||||
class TrackAllocator;
|
|
||||||
class PeakAllocator;
|
|
||||||
|
|
||||||
struct sbsms {
|
|
||||||
FILE *fp;
|
|
||||||
sbsms_cb getSamplesCB;
|
|
||||||
sbsms_rate_cb getRateCB;
|
|
||||||
sbsms_pitch_cb getPitchCB;
|
|
||||||
subband *top;
|
|
||||||
TrackAllocator *ta;
|
|
||||||
PeakAllocator *pa;
|
|
||||||
long n_prepad, n_postpad, n_prespent, n_processed;
|
|
||||||
bool bWritingComplete;
|
|
||||||
sbsms_quality quality;
|
|
||||||
int channels;
|
|
||||||
audio *ina;
|
|
||||||
void *threadData;
|
|
||||||
};
|
|
||||||
|
|
||||||
class SampleBufBase {
|
|
||||||
public:
|
public:
|
||||||
SampleBufBase() {};
|
virtual ~SBSMSInterface() {}
|
||||||
virtual ~SampleBufBase() {};
|
virtual long samples(audio *buf, long n) { return 0; }
|
||||||
virtual long read(audio *buf, long n)=0;
|
virtual float getStretch(float t)=0;
|
||||||
virtual void advance(long n)=0;
|
virtual float getPitch(float t)=0;
|
||||||
virtual long n_readable()=0;
|
virtual long getPresamples()=0;
|
||||||
|
virtual SampleCountType getSamplesToInput()=0;
|
||||||
|
virtual SampleCountType getSamplesToOutput()=0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class grain;
|
class SBSMSTrackPoint {
|
||||||
|
|
||||||
class SampleBuf {
|
|
||||||
public:
|
public:
|
||||||
//SampleBuf() {};
|
virtual ~SBSMSTrackPoint() {}
|
||||||
SampleBuf(int N);
|
virtual float getF()=0;
|
||||||
SampleBuf(int N, long delay);
|
virtual float getM()=0;
|
||||||
void init(int N, long delay);
|
virtual float getPhase()=0;
|
||||||
void clear();
|
|
||||||
virtual ~SampleBuf();
|
|
||||||
|
|
||||||
void grow(long pos);
|
|
||||||
long write(audio *buf, long n);
|
|
||||||
long write(grain* g, int h);
|
|
||||||
virtual long read(audio *buf, long n);
|
|
||||||
virtual void advance(long n);
|
|
||||||
virtual long n_readable();
|
|
||||||
audio *getReadBuf();
|
|
||||||
|
|
||||||
long readPos, writePos;
|
|
||||||
long delay;
|
|
||||||
|
|
||||||
int N;
|
|
||||||
long length;
|
|
||||||
audio *buf;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class SBSMSTrack {
|
||||||
|
public:
|
||||||
|
virtual ~SBSMSTrack() {}
|
||||||
|
virtual SBSMSTrackPoint *getSBSMSTrackPoint(const TimeType &time)=0;
|
||||||
|
virtual TrackIndexType getIndex()=0;
|
||||||
|
virtual bool isFirst(const TimeType &synthtime)=0;
|
||||||
|
virtual bool isLast(const TimeType &synthtime)=0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class SBSMSRenderer {
|
||||||
|
public:
|
||||||
|
virtual ~SBSMSRenderer() {}
|
||||||
|
virtual void startFrame() {}
|
||||||
|
virtual void startTime(int c, const TimeType &time, int n) {}
|
||||||
|
virtual void render(int c, SBSMSTrack *t) {}
|
||||||
|
virtual void endTime(int c) {}
|
||||||
|
virtual void endFrame() {}
|
||||||
|
virtual void end(const SampleCountType &samples) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
enum SBSMSError {
|
||||||
|
SBSMSErrorNone = 0,
|
||||||
|
SBSMSErrorInvalidRate
|
||||||
|
};
|
||||||
|
|
||||||
|
class SBSMSImp;
|
||||||
|
|
||||||
|
class SBSMS {
|
||||||
|
public:
|
||||||
|
SBSMS(int channels, SBSMSQuality *quality, bool bSynthesize);
|
||||||
|
~SBSMS();
|
||||||
|
|
||||||
|
long read(SBSMSInterface *iface, audio *buf, long n);
|
||||||
|
void addRenderer(SBSMSRenderer *renderer);
|
||||||
|
void removeRenderer(SBSMSRenderer *renderer);
|
||||||
|
long renderFrame(SBSMSInterface *iface);
|
||||||
|
long getInputFrameSize();
|
||||||
|
SBSMSError getError();
|
||||||
|
friend class SBSMSImp;
|
||||||
|
protected:
|
||||||
|
SBSMSImp *imp;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum SlideType {
|
||||||
|
SlideIdentity = 0,
|
||||||
|
SlideConstant,
|
||||||
|
SlideLinearInputRate,
|
||||||
|
SlideLinearOutputRate,
|
||||||
|
SlideLinearInputStretch,
|
||||||
|
SlideLinearOutputStretch,
|
||||||
|
SlideGeometricInput,
|
||||||
|
SlideGeometricOutput
|
||||||
|
};
|
||||||
|
|
||||||
|
class SlideImp;
|
||||||
|
|
||||||
|
class Slide {
|
||||||
|
public:
|
||||||
|
Slide(SlideType slideType, float rate0 = 1.0f, float rate1 = 1.0f, const SampleCountType &n = 0);
|
||||||
|
~Slide();
|
||||||
|
float getTotalStretch();
|
||||||
|
float getStretchedTime(float t);
|
||||||
|
float getRate(float t);
|
||||||
|
float getStretch(float t);
|
||||||
|
float getRate();
|
||||||
|
float getStretch();
|
||||||
|
void step();
|
||||||
|
protected:
|
||||||
|
SlideImp *imp;
|
||||||
|
};
|
||||||
|
|
||||||
|
class SBSMSInterfaceSlidingImp;
|
||||||
|
|
||||||
|
class SBSMSInterfaceSliding : public SBSMSInterface {
|
||||||
|
public:
|
||||||
|
SBSMSInterfaceSliding(Slide *rateSlide,
|
||||||
|
Slide *pitchSlide,
|
||||||
|
bool bPitchReferenceInput,
|
||||||
|
const SampleCountType &samplesToInput,
|
||||||
|
long preSamples,
|
||||||
|
SBSMSQuality *quality);
|
||||||
|
virtual ~SBSMSInterfaceSliding();
|
||||||
|
virtual float getStretch(float t);
|
||||||
|
virtual float getPitch(float t);
|
||||||
|
virtual long getPresamples();
|
||||||
|
virtual SampleCountType getSamplesToInput();
|
||||||
|
virtual SampleCountType getSamplesToOutput();
|
||||||
|
|
||||||
|
friend class SBSMSInterfaceSlidingImp;
|
||||||
|
protected:
|
||||||
|
SBSMSInterfaceSlidingImp *imp;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ResamplerImp;
|
||||||
|
|
||||||
class Resampler {
|
class Resampler {
|
||||||
public:
|
public:
|
||||||
Resampler(sbsms_resample_cb func, void *data);
|
Resampler(SBSMSResampleCB func, void *data, SlideType slideType = SlideConstant);
|
||||||
Resampler(SampleBuf *in, real pitch);
|
|
||||||
~Resampler();
|
~Resampler();
|
||||||
long read(audio *audioOut, long frames);
|
long read(audio *audioOut, long frames);
|
||||||
void writingComplete();
|
|
||||||
void reset();
|
void reset();
|
||||||
void init();
|
|
||||||
long samplesInOutput();
|
long samplesInOutput();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
sbsms_resample_frame frame;
|
ResamplerImp *imp;
|
||||||
long startAbs;
|
|
||||||
long midAbs;
|
|
||||||
real midAbsf;
|
|
||||||
long endAbs;
|
|
||||||
long writePosAbs;
|
|
||||||
bool bInput;
|
|
||||||
SampleBuf *out;
|
|
||||||
sbsms_resample_cb cb;
|
|
||||||
void *data;
|
|
||||||
bool bPull;
|
|
||||||
SampleBuf *in;
|
|
||||||
long inOffset;
|
|
||||||
real sincZeros;
|
|
||||||
bool bWritingComplete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void sbsms_init(int n);
|
|
||||||
void sbsms_reset(sbsms *sbsmser);
|
|
||||||
void sbsms_seek(sbsms *sbsmser, long framePos, long samplePos);
|
|
||||||
sbsms* sbsms_create(sbsms_cb getSamplesCB, sbsms_rate_cb getRateCB, sbsms_pitch_cb getPitchCB, int channels, sbsms_quality *quality, bool bPreAnalyze, bool bSynthesize);
|
|
||||||
sbsms* sbsms_create(FILE *fp, sbsms_rate_cb getRateCB, sbsms_pitch_cb getPitchCB);
|
|
||||||
void sbsms_destroy(sbsms* sbsmser);
|
|
||||||
long sbsms_read_frame(audio *out, void *data, sbsms *sbsmer, real *pitch0, real *pitch1);
|
|
||||||
long sbsms_write_frame(FILE *fp, void *data, sbsms *sbsmser);
|
|
||||||
long sbsms_samples_processed(sbsms *sbsmser);
|
|
||||||
long sbsms_pre_analyze(sbsms_cb getSamplesCB, void *data, sbsms *sbsmser);
|
|
||||||
void sbsms_pre_analyze_complete(sbsms *sbsmser);
|
|
||||||
|
|
||||||
long sbsms_get_samples_queued(sbsms *sbsmser);
|
|
||||||
long sbsms_get_frames_queued(sbsms *sbsmser);
|
|
||||||
long sbsms_get_last_input_frame_size(sbsms *sbsmser);
|
|
||||||
long sbsms_get_frame_pos(sbsms *sbsmser);
|
|
||||||
|
|
||||||
void sbsms_close_write(FILE *fp, sbsms *sbsmser);
|
|
||||||
FILE *sbsms_open_write(const char *fileName, sbsms *sbsmser, long samples_to_process);
|
|
||||||
void sbsms_close_read(FILE *fp);
|
|
||||||
FILE *sbsms_open_read(const char *fileName);
|
|
||||||
long sbsms_get_samples_to_process(FILE *fp);
|
|
||||||
long sbsms_get_frames_to_process(FILE *fp);
|
|
||||||
long sbsms_get_channels(FILE *fp);
|
|
||||||
void sbsms_get_quality(FILE *fp, sbsms_quality *quality);
|
|
||||||
void sbsms_seek_start_data(FILE *fp);
|
|
||||||
|
|
||||||
struct sbsmsInfo {
|
|
||||||
real rate0, rate1;
|
|
||||||
real pitch0, pitch1;
|
|
||||||
long samplesToProcess;
|
|
||||||
long samplesToGenerate;
|
|
||||||
Resampler *rs;
|
|
||||||
};
|
|
||||||
|
|
||||||
long getLinearOutputSamples(sbsmsInfo *si);
|
|
||||||
real rateCBLinear(long nProcessed, void *userData);
|
|
||||||
real rateCBConstant(long nProcessed, void *userData);
|
|
||||||
real pitchCBLinear(long nProcessed, void *userData);
|
|
||||||
real pitchCBConstant(long nProcessed, void *userData);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,4 +4,4 @@ libsbsmsincludedir = $(includedir)
|
||||||
libsbsmsinclude_HEADERS = ../include/sbsms.h
|
libsbsmsinclude_HEADERS = ../include/sbsms.h
|
||||||
|
|
||||||
lib_LTLIBRARIES = libsbsms.la
|
lib_LTLIBRARIES = libsbsms.la
|
||||||
libsbsms_la_SOURCES = peak.cpp sms.cpp track.cpp trackpoint.cpp utils.cpp audio.cpp resample.cpp sbsms.cpp fft.cpp grain.cpp buffer.cpp subband.cpp audio.h buffer.h fft.h utils.h peak.h trackpoint.h grain.h real.h resample.h ../include/sbsms.h sms.h subband.h track.h
|
libsbsms_la_SOURCES = sms.cpp track.cpp trackpoint.cpp resample.cpp sbsms.cpp fft.cpp grain.cpp buffer.cpp dBTable.cpp slide.cpp dBTable.h synthTable.h sse.h subband.cpp buffer.h fft.h utils.h trackpoint.h grain.h real.h resample.h ../include/sbsms.h sms.h subband.h track.h
|
||||||
|
|
|
@ -40,6 +40,8 @@ DIST_COMMON = $(libsbsmsinclude_HEADERS) $(srcdir)/Makefile.am \
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
|
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_c99_func_lrint.m4 \
|
||||||
$(top_srcdir)/m4/ac_c99_func_lrintf.m4 \
|
$(top_srcdir)/m4/ac_c99_func_lrintf.m4 \
|
||||||
|
$(top_srcdir)/m4/ax_check_compiler_flags.m4 \
|
||||||
|
$(top_srcdir)/m4/ax_compiler_vendor.m4 \
|
||||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.in
|
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.in
|
||||||
|
@ -59,9 +61,9 @@ am__installdirs = "$(DESTDIR)$(libdir)" \
|
||||||
libLTLIBRARIES_INSTALL = $(INSTALL)
|
libLTLIBRARIES_INSTALL = $(INSTALL)
|
||||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||||
libsbsms_la_LIBADD =
|
libsbsms_la_LIBADD =
|
||||||
am_libsbsms_la_OBJECTS = peak.lo sms.lo track.lo trackpoint.lo \
|
am_libsbsms_la_OBJECTS = sms.lo track.lo trackpoint.lo resample.lo \
|
||||||
utils.lo audio.lo resample.lo sbsms.lo fft.lo grain.lo \
|
sbsms.lo fft.lo grain.lo buffer.lo subband.lo dBTable.lo \
|
||||||
buffer.lo subband.lo
|
slide.lo
|
||||||
libsbsms_la_OBJECTS = $(am_libsbsms_la_OBJECTS)
|
libsbsms_la_OBJECTS = $(am_libsbsms_la_OBJECTS)
|
||||||
DEFAULT_INCLUDES = -I.@am__isrc@
|
DEFAULT_INCLUDES = -I.@am__isrc@
|
||||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||||
|
@ -213,11 +215,11 @@ target_os = @target_os@
|
||||||
target_vendor = @target_vendor@
|
target_vendor = @target_vendor@
|
||||||
top_builddir = @top_builddir@
|
top_builddir = @top_builddir@
|
||||||
top_srcdir = @top_srcdir@
|
top_srcdir = @top_srcdir@
|
||||||
AM_CXXFLAGS = -I../include @SBSMS_CFLAGS@
|
AM_CXXFLAGS = @SBSMS_CFLAGS@ -I../include
|
||||||
libsbsmsincludedir = $(includedir)
|
libsbsmsincludedir = $(includedir)
|
||||||
libsbsmsinclude_HEADERS = ../include/sbsms.h
|
libsbsmsinclude_HEADERS = ../include/sbsms.h
|
||||||
lib_LTLIBRARIES = libsbsms.la
|
lib_LTLIBRARIES = libsbsms.la
|
||||||
libsbsms_la_SOURCES = peak.cpp sms.cpp track.cpp trackpoint.cpp utils.cpp audio.cpp resample.cpp sbsms.cpp fft.cpp grain.cpp buffer.cpp subband.cpp audio.h buffer.h fft.h utils.h peak.h trackpoint.h grain.h real.h resample.h ../include/sbsms.h sms.h subband.h track.h
|
libsbsms_la_SOURCES = sms.cpp track.cpp trackpoint.cpp resample.cpp sbsms.cpp fft.cpp grain.cpp buffer.cpp subband.cpp dBTable.cpp buffer.h fft.h sse.h utils.h trackpoint.h grain.h real.h synthTable.h dBTable.h sincCoeffs.h ../include/sbsms.h sms.h subband.h track.h slide.cpp
|
||||||
all: config.h
|
all: config.h
|
||||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||||
|
|
||||||
|
@ -305,18 +307,17 @@ mostlyclean-compile:
|
||||||
distclean-compile:
|
distclean-compile:
|
||||||
-rm -f *.tab.c
|
-rm -f *.tab.c
|
||||||
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio.Plo@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Plo@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dBTable.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fft.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fft.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grain.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grain.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peak.Plo@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resample.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resample.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sbsms.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sbsms.Plo@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slide.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sms.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sms.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subband.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subband.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trackpoint.Plo@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trackpoint.Plo@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Plo@am__quote@
|
|
||||||
|
|
||||||
.cpp.o:
|
.cpp.o:
|
||||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||||
|
|
|
@ -9,162 +9,49 @@ using namespace std;
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
#define INIT_SAMPLEBUF_LENGTH 8192
|
template<>
|
||||||
#define INIT_GRAINBUF_LENGTH 128
|
void SampleBuf :: write(grain *g, int h)
|
||||||
#define INIT_TPLBUF_LENGTH 128
|
|
||||||
|
|
||||||
/****************
|
|
||||||
|
|
||||||
SampleBuf
|
|
||||||
|
|
||||||
****************/
|
|
||||||
|
|
||||||
SampleBuf :: SampleBuf(int N)
|
|
||||||
{
|
{
|
||||||
init(N,0);
|
grow(N);
|
||||||
}
|
|
||||||
|
|
||||||
SampleBuf :: SampleBuf(int N, long delay)
|
|
||||||
{
|
|
||||||
init(N,delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SampleBuf :: init(int N, long delay)
|
|
||||||
{
|
|
||||||
this->delay = delay;
|
|
||||||
this->N = N;
|
|
||||||
this->length = INIT_SAMPLEBUF_LENGTH;
|
|
||||||
this->buf = make_audio_buf(2*length);
|
|
||||||
this->readPos = 0;
|
|
||||||
this->writePos = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
SampleBuf :: ~SampleBuf()
|
|
||||||
{
|
|
||||||
free_audio_buf(buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
long SampleBuf :: write(audio *in, long n)
|
|
||||||
{
|
|
||||||
if(n==0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
grow(n);
|
|
||||||
memcpy(buf+writePos,in,n*sizeof(audio));
|
|
||||||
writePos += n;
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SampleBuf :: grow(long n)
|
|
||||||
{
|
|
||||||
long pos = writePos+n;
|
|
||||||
while(pos >= 2*length) {
|
|
||||||
length *= 2;
|
|
||||||
audio *newBuf = make_audio_buf(2*length);
|
|
||||||
memcpy(newBuf,buf+readPos,(length-readPos)*sizeof(audio));
|
|
||||||
free_audio_buf(buf);
|
|
||||||
buf = newBuf;
|
|
||||||
writePos -= readPos;
|
|
||||||
pos -= readPos;
|
|
||||||
readPos = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
long SampleBuf :: write(grain *g, int h)
|
|
||||||
{
|
|
||||||
grow(g->N);
|
|
||||||
g->synthesize();
|
g->synthesize();
|
||||||
real f = 2.6666666666666666666666666f/(real)(N/h);
|
float f = 2.6666666666666666666666666f/(float)(N/h);
|
||||||
|
|
||||||
for(int c=0;c<2;c++) {
|
for(int c=0;c<2;c++) {
|
||||||
int j = 0;
|
int j = 0;
|
||||||
for(int k=writePos; k<writePos+g->N; k++) {
|
int kend = writePos + N;
|
||||||
|
for(int k=writePos; k<kend; k++) {
|
||||||
buf[k][c] += g->x[j++][c] * f;
|
buf[k][c] += g->x[j++][c] * f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writePos += h;
|
writePos += h;
|
||||||
return h;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
long SampleBuf :: read(audio *outBuf, long n)
|
GrainBuf :: GrainBuf(int N, int h, int N2, int type) :
|
||||||
|
grainAllocator(N,N2,type)
|
||||||
{
|
{
|
||||||
if(n==0)
|
this->length = initGrainBufLength;
|
||||||
return 0;
|
|
||||||
assert(writePos < 2*length);
|
|
||||||
n = min(n,n_readable());
|
|
||||||
n = max(n,(long)0);
|
|
||||||
memcpy(outBuf,buf+readPos,n*sizeof(audio));
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
long SampleBuf :: n_readable()
|
|
||||||
{
|
|
||||||
return max(writePos-delay - readPos,(long)0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SampleBuf :: advance(long n) {
|
|
||||||
assert(readPos+n <= writePos);
|
|
||||||
memset(buf+readPos,0,n*sizeof(audio));
|
|
||||||
readPos += n;
|
|
||||||
if(readPos >= length) {
|
|
||||||
long endPos;
|
|
||||||
if(N==0)
|
|
||||||
endPos = 2*length;
|
|
||||||
else
|
|
||||||
endPos = min(2*length,writePos+N);
|
|
||||||
memcpy(buf,buf+readPos,(endPos-readPos)*sizeof(audio));
|
|
||||||
memset(buf+readPos,0,(endPos-readPos)*sizeof(audio));
|
|
||||||
writePos -= readPos;
|
|
||||||
readPos = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
audio *SampleBuf :: getReadBuf()
|
|
||||||
{
|
|
||||||
return (buf+readPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SampleBuf :: clear()
|
|
||||||
{
|
|
||||||
advance(writePos-readPos);
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************
|
|
||||||
|
|
||||||
GrainBuf
|
|
||||||
|
|
||||||
****************/
|
|
||||||
|
|
||||||
GrainBuf :: GrainBuf(int N, int h)
|
|
||||||
{
|
|
||||||
init(N,h,1);
|
|
||||||
}
|
|
||||||
|
|
||||||
GrainBuf :: GrainBuf(int N, int h, real pad)
|
|
||||||
{
|
|
||||||
init(N,h,pad);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GrainBuf :: init(int N, int h, real pad)
|
|
||||||
{
|
|
||||||
this->length = INIT_GRAINBUF_LENGTH;
|
|
||||||
this->buf = (grain**) calloc(2*length,sizeof(grain*));
|
this->buf = (grain**) calloc(2*length,sizeof(grain*));
|
||||||
this->iBuf = (audio*) calloc(N,sizeof(audio));
|
this->iBuf = (audio*) calloc(N2,sizeof(audio));
|
||||||
|
this->N2 = N2;
|
||||||
this->pad = pad;
|
|
||||||
this->N = N;
|
|
||||||
this->h = h;
|
this->h = h;
|
||||||
|
this->overlap = N2 - h;
|
||||||
|
this->xOffset = (N-N2)>>1;
|
||||||
this->iBufWritePos = 0;
|
this->iBufWritePos = 0;
|
||||||
this->readPos = 0;
|
this->readPos = 0;
|
||||||
this->writePos = 0;
|
this->writePos = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GrainBuf :: ~GrainBuf()
|
GrainBuf :: ~GrainBuf()
|
||||||
{
|
{
|
||||||
clear();
|
for(int k=readPos;k<writePos;k++) {
|
||||||
|
grainAllocator.forget(buf[k]);
|
||||||
|
}
|
||||||
free(buf);
|
free(buf);
|
||||||
free_audio_buf(iBuf);
|
free(iBuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
audio *GrainBuf :: getWindowFFT()
|
||||||
|
{
|
||||||
|
return grainAllocator.W;
|
||||||
}
|
}
|
||||||
|
|
||||||
long GrainBuf :: write(audio *buf2, long n)
|
long GrainBuf :: write(audio *buf2, long n)
|
||||||
|
@ -173,48 +60,43 @@ long GrainBuf :: write(audio *buf2, long n)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
long ng = 0;
|
long ng = 0;
|
||||||
int overlap = N - h;
|
|
||||||
long bufReadPos = 0;
|
long bufReadPos = 0;
|
||||||
|
long nToCopy;
|
||||||
while(bufReadPos<n) {
|
while(bufReadPos<n) {
|
||||||
long nToCopy = min((n-bufReadPos),N-iBufWritePos);
|
nToCopy = min((n-bufReadPos),N2-iBufWritePos);
|
||||||
|
if(nToCopy+iBufWritePos == N2) {
|
||||||
|
if(buf2) {
|
||||||
memcpy(iBuf+iBufWritePos, buf2+bufReadPos, nToCopy*sizeof(audio));
|
memcpy(iBuf+iBufWritePos, buf2+bufReadPos, nToCopy*sizeof(audio));
|
||||||
|
} else {
|
||||||
if(nToCopy+iBufWritePos == N) {
|
memset(iBuf+iBufWritePos, 0, nToCopy*sizeof(audio));
|
||||||
convert(iBuf);
|
}
|
||||||
|
grain *g = grainAllocator.create();
|
||||||
|
memcpy(g->x+xOffset,iBuf,N2*sizeof(audio));
|
||||||
|
write(g);
|
||||||
ng++;
|
ng++;
|
||||||
memcpy(iBuf,iBuf+h,overlap*sizeof(audio));
|
memcpy(iBuf,iBuf+h,overlap*sizeof(audio));
|
||||||
iBufWritePos = overlap;
|
iBufWritePos = overlap;
|
||||||
bufReadPos += nToCopy;
|
bufReadPos += nToCopy;
|
||||||
} else break;
|
} else break;
|
||||||
}
|
}
|
||||||
|
nToCopy = min((n-bufReadPos),N2-iBufWritePos);
|
||||||
// copy the remainder to the iBuf
|
if(buf2) {
|
||||||
long nToCopy = min((n-bufReadPos),N-iBufWritePos);
|
|
||||||
memcpy(iBuf+iBufWritePos, buf2+bufReadPos, nToCopy*sizeof(audio));
|
memcpy(iBuf+iBufWritePos, buf2+bufReadPos, nToCopy*sizeof(audio));
|
||||||
|
} else {
|
||||||
|
memset(iBuf+iBufWritePos, 0, nToCopy*sizeof(audio));
|
||||||
|
}
|
||||||
iBufWritePos += nToCopy;
|
iBufWritePos += nToCopy;
|
||||||
|
|
||||||
return ng;
|
return ng;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrainBuf :: convert(audio *timebuf)
|
|
||||||
{
|
|
||||||
grain *g = grain::create(N,pad);
|
|
||||||
memcpy(g->x,timebuf,N*sizeof(audio));
|
|
||||||
g->analyze();
|
|
||||||
g->h = h;
|
|
||||||
write(g);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GrainBuf :: advance(long n)
|
void GrainBuf :: advance(long n)
|
||||||
{
|
{
|
||||||
assert(readPos+n <= writePos);
|
assert(readPos+n <= writePos);
|
||||||
for(int k=readPos;k<readPos+n;k++) {
|
for(int k=readPos;k<readPos+n;k++) {
|
||||||
grain :: forget(buf[k]);
|
grainAllocator.forget(buf[k]);
|
||||||
}
|
}
|
||||||
readPos += n;
|
readPos += n;
|
||||||
|
|
||||||
//grain::count-=n;
|
|
||||||
if(readPos >= length) {
|
if(readPos >= length) {
|
||||||
memcpy(buf,buf+readPos,(writePos-readPos)*sizeof(grain*));
|
memcpy(buf,buf+readPos,(writePos-readPos)*sizeof(grain*));
|
||||||
writePos = writePos - readPos;
|
writePos = writePos - readPos;
|
||||||
|
@ -227,35 +109,43 @@ grain* GrainBuf :: read(long k)
|
||||||
return buf[k];
|
return buf[k];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long GrainBuf :: nReadable()
|
||||||
|
{
|
||||||
|
return writePos - readPos;
|
||||||
|
}
|
||||||
|
|
||||||
void GrainBuf :: write(grain *g)
|
void GrainBuf :: write(grain *g)
|
||||||
{
|
{
|
||||||
if(writePos >= 2*length) {
|
if(writePos >= length<<1) {
|
||||||
length *= 2;
|
length <<= 1;
|
||||||
grain **newBuf = (grain**)calloc(2*length,sizeof(grain*));
|
grain **newBuf = (grain**)calloc((length<<1),sizeof(grain*));
|
||||||
memcpy(newBuf,buf+readPos,(writePos-readPos)*sizeof(grain*));
|
memcpy(newBuf,buf+readPos,(writePos-readPos)*sizeof(grain*));
|
||||||
free(buf);
|
free(buf);
|
||||||
buf = newBuf;
|
buf = newBuf;
|
||||||
writePos -= readPos;
|
writePos -= readPos;
|
||||||
readPos = 0;
|
readPos = 0;
|
||||||
}
|
}
|
||||||
|
grainAllocator.reference(g);
|
||||||
grain :: referenced(g);
|
|
||||||
buf[writePos++] = g;
|
buf[writePos++] = g;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GrainBuf :: reference(grain *g)
|
||||||
|
{
|
||||||
|
grainAllocator.reference(g);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GrainBuf :: forget(grain *g)
|
||||||
|
{
|
||||||
|
grainAllocator.forget(g);
|
||||||
|
}
|
||||||
|
|
||||||
void GrainBuf :: clear()
|
void GrainBuf :: clear()
|
||||||
{
|
{
|
||||||
memset(iBuf,0,N*sizeof(audio));
|
memset(iBuf,0,N2*sizeof(audio));
|
||||||
iBufWritePos = 0;
|
iBufWritePos = 0;
|
||||||
advance(n_readable());
|
advance(writePos-readPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************
|
|
||||||
|
|
||||||
Mixer
|
|
||||||
|
|
||||||
****************/
|
|
||||||
|
|
||||||
Mixer :: Mixer(SampleBufBase *b1, SampleBuf *b2)
|
Mixer :: Mixer(SampleBufBase *b1, SampleBuf *b2)
|
||||||
{
|
{
|
||||||
this->b1 = b1;
|
this->b1 = b1;
|
||||||
|
@ -264,86 +154,16 @@ Mixer :: Mixer(SampleBufBase *b1, SampleBuf *b2)
|
||||||
|
|
||||||
long Mixer :: read(audio *outBuf, long n)
|
long Mixer :: read(audio *outBuf, long n)
|
||||||
{
|
{
|
||||||
if(n==0)
|
if(n==0) return 0;
|
||||||
return 0;
|
n = min(n,b2->nReadable());
|
||||||
n = min(n,n_readable());
|
n = b1->read(outBuf,n);
|
||||||
|
|
||||||
b1->read(outBuf,n);
|
|
||||||
audio *buf2 = b2->getReadBuf();
|
audio *buf2 = b2->getReadBuf();
|
||||||
|
|
||||||
for(int k=0;k<n;k++) {
|
for(int k=0;k<n;k++) {
|
||||||
for(int c=0;c<2;c++)
|
for(int c=0;c<2;c++)
|
||||||
outBuf[k][c] += buf2[k][c];
|
outBuf[k][c] += buf2[k][c];
|
||||||
}
|
}
|
||||||
|
b2->advance(n);
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mixer::advance(long n)
|
|
||||||
{
|
|
||||||
b1->advance(n);
|
|
||||||
b2->advance(n);
|
|
||||||
}
|
|
||||||
|
|
||||||
long Mixer::n_readable()
|
|
||||||
{
|
|
||||||
return min(b1->n_readable(), b2->n_readable());
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************
|
|
||||||
TrackPointListBuffer
|
|
||||||
********************/
|
|
||||||
|
|
||||||
TrackPointListBuffer :: TrackPointListBuffer() {
|
|
||||||
length = INIT_TPLBUF_LENGTH;
|
|
||||||
buf = (tplist**) calloc(2*length,sizeof(tplist*));
|
|
||||||
readPos = 0;
|
|
||||||
writePos = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
TrackPointListBuffer :: ~TrackPointListBuffer() {
|
|
||||||
for(int k=readPos;k<writePos;k++)
|
|
||||||
delete buf[k];
|
|
||||||
free(buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
long TrackPointListBuffer :: write(tplist *tpl)
|
|
||||||
{
|
|
||||||
if(writePos >= 2*length) {
|
|
||||||
length *= 2;
|
|
||||||
tplist **newBuf = (tplist**) calloc(2*length,sizeof(tplist*));
|
|
||||||
memcpy(newBuf,buf+readPos,(writePos-readPos)*sizeof(tplist*));
|
|
||||||
free(buf);
|
|
||||||
buf = newBuf;
|
|
||||||
writePos -= readPos;
|
|
||||||
readPos = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
buf[writePos++] = tpl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
long TrackPointListBuffer :: n_readable()
|
|
||||||
{
|
|
||||||
return writePos-readPos;
|
|
||||||
}
|
|
||||||
|
|
||||||
tplist *TrackPointListBuffer :: read(long k)
|
|
||||||
{
|
|
||||||
return buf[k];
|
|
||||||
}
|
|
||||||
|
|
||||||
void TrackPointListBuffer :: advance(long n)
|
|
||||||
{
|
|
||||||
assert(readPos+n <= writePos);
|
|
||||||
for(int k=readPos;k<readPos+n;k++) {
|
|
||||||
delete buf[k];
|
|
||||||
}
|
|
||||||
readPos += n;
|
|
||||||
if(readPos >= length) {
|
|
||||||
memcpy(buf,buf+readPos,(writePos-readPos)*sizeof(tplist*));
|
|
||||||
writePos = writePos - readPos;
|
|
||||||
readPos = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +1,32 @@
|
||||||
|
// -*- mode: c++ -*-
|
||||||
#ifndef BUFFER_H
|
#ifndef BUFFER_H
|
||||||
#define BUFFER_H
|
#define BUFFER_H
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <cstring>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include "sbsms.h"
|
#include "sbsms.h"
|
||||||
#include "grain.h"
|
#include "grain.h"
|
||||||
#include "trackpoint.h"
|
#include <stdlib.h>
|
||||||
#include <list>
|
#include <list>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
typedef list<trackpoint*> tplist;
|
enum {
|
||||||
|
initSampleBufLength = 8192,
|
||||||
|
initGrainBufLength = 256,
|
||||||
|
initRingBufferLength = 64
|
||||||
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class RingBuffer {
|
class RingBuffer {
|
||||||
public:
|
public:
|
||||||
RingBuffer();
|
RingBuffer();
|
||||||
~RingBuffer();
|
~RingBuffer();
|
||||||
|
|
||||||
long write(T a);
|
long write(T a);
|
||||||
T read(long k);
|
T read(long k);
|
||||||
long n_readable();
|
T read();
|
||||||
|
long nReadable();
|
||||||
void advance(long n);
|
void advance(long n);
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
long readPos;
|
long readPos;
|
||||||
long writePos;
|
long writePos;
|
||||||
protected:
|
protected:
|
||||||
|
@ -33,8 +34,6 @@ class RingBuffer {
|
||||||
long length;
|
long length;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define INIT_RINGBUF_LENGTH 128
|
|
||||||
|
|
||||||
/********************
|
/********************
|
||||||
RingBuffer
|
RingBuffer
|
||||||
********************/
|
********************/
|
||||||
|
@ -42,7 +41,7 @@ class RingBuffer {
|
||||||
template <class T>
|
template <class T>
|
||||||
RingBuffer<T> :: RingBuffer()
|
RingBuffer<T> :: RingBuffer()
|
||||||
{
|
{
|
||||||
length = INIT_RINGBUF_LENGTH;
|
length = initRingBufferLength;
|
||||||
buf = (T*) calloc(2*length,sizeof(T));
|
buf = (T*) calloc(2*length,sizeof(T));
|
||||||
readPos = 0;
|
readPos = 0;
|
||||||
writePos = 0;
|
writePos = 0;
|
||||||
|
@ -77,7 +76,13 @@ T RingBuffer<T> :: read(long k)
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
long RingBuffer<T> :: n_readable()
|
T RingBuffer<T> :: read()
|
||||||
|
{
|
||||||
|
return buf[readPos];
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
long RingBuffer<T> :: nReadable()
|
||||||
{
|
{
|
||||||
return writePos-readPos;
|
return writePos-readPos;
|
||||||
}
|
}
|
||||||
|
@ -85,7 +90,6 @@ long RingBuffer<T> :: n_readable()
|
||||||
template <class T>
|
template <class T>
|
||||||
void RingBuffer<T> :: advance(long n)
|
void RingBuffer<T> :: advance(long n)
|
||||||
{
|
{
|
||||||
assert(readPos+n <= writePos);
|
|
||||||
readPos += n;
|
readPos += n;
|
||||||
if(readPos >= length) {
|
if(readPos >= length) {
|
||||||
memcpy(buf,buf+readPos,(writePos-readPos)*sizeof(T));
|
memcpy(buf,buf+readPos,(writePos-readPos)*sizeof(T));
|
||||||
|
@ -101,64 +105,159 @@ void RingBuffer<T> :: clear()
|
||||||
writePos = 0;
|
writePos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
class TrackPointListBuffer {
|
class SampleBufBase {
|
||||||
public:
|
public:
|
||||||
TrackPointListBuffer();
|
SampleBufBase() {};
|
||||||
~TrackPointListBuffer();
|
virtual ~SampleBufBase() {};
|
||||||
|
virtual long read(audio *buf, long n)=0;
|
||||||
long write(tplist *tpl);
|
|
||||||
tplist *read(long k);
|
|
||||||
long n_readable();
|
|
||||||
void advance(long n);
|
|
||||||
|
|
||||||
long readPos;
|
|
||||||
long writePos;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
tplist **buf;
|
|
||||||
long length;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/****************
|
||||||
|
|
||||||
|
SampleBuf
|
||||||
|
|
||||||
|
****************/
|
||||||
|
|
||||||
|
class grain;
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
class ArrayRingBuffer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ArrayRingBuffer(int N);
|
||||||
|
virtual ~ArrayRingBuffer();
|
||||||
|
void clear();
|
||||||
|
void grow(long pos);
|
||||||
|
void write(T *buf, long n);
|
||||||
|
void write(grain *g, int h);
|
||||||
|
void read(T *buf, long n);
|
||||||
|
void advance(long n);
|
||||||
|
long nReadable();
|
||||||
|
T *getReadBuf();
|
||||||
|
long readPos, writePos;
|
||||||
|
int N;
|
||||||
|
long length;
|
||||||
|
T *buf;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
ArrayRingBuffer<T> :: ArrayRingBuffer(int N)
|
||||||
|
{
|
||||||
|
this->N = N;
|
||||||
|
this->length = initSampleBufLength;
|
||||||
|
this->buf = (T*)calloc(2*length,sizeof(T));
|
||||||
|
this->readPos = 0;
|
||||||
|
this->writePos = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
ArrayRingBuffer<T> :: ~ArrayRingBuffer()
|
||||||
|
{
|
||||||
|
free(buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
void ArrayRingBuffer<T> :: write(T *in, long n)
|
||||||
|
{
|
||||||
|
grow(n);
|
||||||
|
if(in) memcpy(buf+writePos,in,n*sizeof(T));
|
||||||
|
writePos += n;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
void ArrayRingBuffer<T> :: grow(long n)
|
||||||
|
{
|
||||||
|
long pos = writePos+n;
|
||||||
|
while(pos >= 2*length) {
|
||||||
|
length *= 2;
|
||||||
|
T *newBuf = (T*)calloc(2*length,sizeof(T));
|
||||||
|
memcpy(newBuf,buf+readPos,(length-readPos)*sizeof(T));
|
||||||
|
free(buf);
|
||||||
|
buf = newBuf;
|
||||||
|
writePos -= readPos;
|
||||||
|
pos -= readPos;
|
||||||
|
readPos = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
void ArrayRingBuffer<T> :: read(T *outBuf, long n)
|
||||||
|
{
|
||||||
|
n = max(0L,min(n,nReadable()));
|
||||||
|
memcpy(outBuf,buf+readPos,n*sizeof(T));
|
||||||
|
advance(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
long ArrayRingBuffer<T> :: nReadable()
|
||||||
|
{
|
||||||
|
return max(0L,writePos-readPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
void ArrayRingBuffer<T> :: advance(long n) {
|
||||||
|
memset(buf+readPos,0,n*sizeof(T));
|
||||||
|
readPos += n;
|
||||||
|
if(readPos >= length) {
|
||||||
|
long endPos;
|
||||||
|
endPos = writePos+N;
|
||||||
|
memcpy(buf,buf+readPos,(endPos-readPos)*sizeof(T));
|
||||||
|
memset(buf+readPos,0,((length<<1)-readPos)*sizeof(T));
|
||||||
|
writePos -= readPos;
|
||||||
|
readPos = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
T *ArrayRingBuffer<T> :: getReadBuf()
|
||||||
|
{
|
||||||
|
return (buf+readPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
void ArrayRingBuffer<T> :: clear()
|
||||||
|
{
|
||||||
|
advance(writePos-readPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef ArrayRingBuffer<audio> SampleBuf;
|
||||||
|
|
||||||
class GrainBuf {
|
class GrainBuf {
|
||||||
public:
|
public:
|
||||||
GrainBuf(int N, int h);
|
GrainBuf(int N, int h, int N2, int type);
|
||||||
GrainBuf(int N, int h, real pad);
|
|
||||||
~GrainBuf();
|
~GrainBuf();
|
||||||
|
|
||||||
void init(int N, int h, real pad);
|
|
||||||
long write(audio *buf, long n);
|
long write(audio *buf, long n);
|
||||||
void write(grain *g);
|
void write(grain *g);
|
||||||
void advance(long n);
|
void advance(long n);
|
||||||
long n_readable() { return writePos - readPos; }
|
long nReadable();
|
||||||
void clear();
|
void clear();
|
||||||
grain* read(long k);
|
grain* read(long k);
|
||||||
|
void reference(grain *g);
|
||||||
long length;
|
void forget(grain *g);
|
||||||
long readPos, writePos;
|
audio *getWindowFFT();
|
||||||
int N,h;
|
long readPos;
|
||||||
real pad;
|
long writePos;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void convert(audio *buf);
|
|
||||||
audio *iBuf;
|
audio *iBuf;
|
||||||
long iBufWritePos;
|
|
||||||
grain **buf;
|
grain **buf;
|
||||||
|
long length;
|
||||||
|
long N2;
|
||||||
|
long h;
|
||||||
|
long overlap;
|
||||||
|
long xOffset;
|
||||||
|
long iBufWritePos;
|
||||||
|
GrainAllocator grainAllocator;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Mixer : public SampleBufBase {
|
class Mixer : public SampleBufBase {
|
||||||
public:
|
public:
|
||||||
Mixer(SampleBufBase *, SampleBuf *);
|
Mixer(SampleBufBase *, SampleBuf *);
|
||||||
long read(audio *buf, long n);
|
|
||||||
void advance(long n);
|
|
||||||
long n_readable();
|
|
||||||
~Mixer() {}
|
~Mixer() {}
|
||||||
|
virtual long read(audio *buf, long n);
|
||||||
protected:
|
protected:
|
||||||
SampleBuf *buf;
|
|
||||||
SampleBufBase *b1;
|
SampleBufBase *b1;
|
||||||
SampleBuf *b2;
|
SampleBuf *b2;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
/* src/config.h.in. Generated from configure.in by autoheader. */
|
/* src/config.h.in. Generated from configure.in by autoheader. */
|
||||||
|
|
||||||
|
/* Define to enable sse */
|
||||||
|
#undef ENABLE_SSE
|
||||||
|
|
||||||
/* Define to 1 if you have the `calloc' function. */
|
/* Define to 1 if you have the `calloc' function. */
|
||||||
#undef HAVE_CALLOC
|
#undef HAVE_CALLOC
|
||||||
|
|
||||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||||
#undef HAVE_DLFCN_H
|
#undef HAVE_DLFCN_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `floor' function. */
|
|
||||||
#undef HAVE_FLOOR
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `free' function. */
|
/* Define to 1 if you have the `free' function. */
|
||||||
#undef HAVE_FREE
|
#undef HAVE_FREE
|
||||||
|
|
||||||
|
@ -18,18 +18,12 @@
|
||||||
/* Define to 1 if you have the `m' library (-lm). */
|
/* Define to 1 if you have the `m' library (-lm). */
|
||||||
#undef HAVE_LIBM
|
#undef HAVE_LIBM
|
||||||
|
|
||||||
/* Define to 1 if you have the `log' function. */
|
|
||||||
#undef HAVE_LOG
|
|
||||||
|
|
||||||
/* Define if you have C99's lrint function. */
|
/* Define if you have C99's lrint function. */
|
||||||
#undef HAVE_LRINT
|
#undef HAVE_LRINT
|
||||||
|
|
||||||
/* Define if you have C99's lrintf function. */
|
/* Define if you have C99's lrintf function. */
|
||||||
#undef HAVE_LRINTF
|
#undef HAVE_LRINTF
|
||||||
|
|
||||||
/* Define to use libmad */
|
|
||||||
#undef HAVE_MAD
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `malloc' function. */
|
/* Define to 1 if you have the `malloc' function. */
|
||||||
#undef HAVE_MALLOC
|
#undef HAVE_MALLOC
|
||||||
|
|
||||||
|
@ -39,14 +33,8 @@
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
#undef HAVE_MEMORY_H
|
#undef HAVE_MEMORY_H
|
||||||
|
|
||||||
/* Define to use libportaudio */
|
/* Define to 1 if you have the `memset' function. */
|
||||||
#undef HAVE_PORTAUDIO
|
#undef HAVE_MEMSET
|
||||||
|
|
||||||
/* Define to use libsndfile */
|
|
||||||
#undef HAVE_SNDFILE
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `sqrt' function. */
|
|
||||||
#undef HAVE_SQRT
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
#undef HAVE_STDINT_H
|
#undef HAVE_STDINT_H
|
||||||
|
|
|
@ -1,737 +1,35 @@
|
||||||
#include "fft.h"
|
#include "fft.h"
|
||||||
#define _USE_MATH_DEFINES
|
|
||||||
#include <math.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
#define REAL(tr,ti,r,i) (tr*r - ti*i)
|
void fft128(t_fft *x)
|
||||||
#define IMAG(tr,ti,r,i) (tr*i + ti*r)
|
|
||||||
|
|
||||||
t_fft *make_fft_buf(int N)
|
|
||||||
{
|
{
|
||||||
return (t_fft*) malloc(N*sizeof(t_fft));
|
fft<128,1>(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
void free_fft_buf(t_fft *buf)
|
void ifft128(t_fft *x)
|
||||||
{
|
{
|
||||||
free(buf);
|
fft<128,-1>(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
void optimizeFactors(int *f)
|
void fft256(t_fft *x)
|
||||||
{
|
{
|
||||||
int n = 0;
|
fft<256,1>(x);
|
||||||
for(int k=0;;k++) {
|
|
||||||
if(f[k]==0) break;
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
int *g = (int*)calloc(n+1,sizeof(int));
|
|
||||||
for(int k=0;k<n;k++) {
|
|
||||||
g[k] = f[k];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int m = 0;
|
void ifft256(t_fft *x)
|
||||||
for(int k=0;k<n;k++) {
|
|
||||||
int f2 = g[k] * g[k+1];
|
|
||||||
if(f2 == 6) {
|
|
||||||
f[m++] = 6;
|
|
||||||
k++;
|
|
||||||
} else if(f2 == 4) {
|
|
||||||
f[m++] = 4;
|
|
||||||
k++;
|
|
||||||
} else {
|
|
||||||
f[m++] = g[k];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
f[m] = 0;
|
|
||||||
free(g);
|
|
||||||
}
|
|
||||||
|
|
||||||
int *getOrder(int n, int *N1, int *N2)
|
|
||||||
{
|
{
|
||||||
int N = N1[0]*N2[0];
|
fft<256,-1>(x);
|
||||||
int *order = (int*)calloc(N,sizeof(int));
|
|
||||||
for(int k=0;k<N;k++) {
|
|
||||||
int kr = 0;
|
|
||||||
int k0 = k;
|
|
||||||
for(int i=0;i<n;i++) {
|
|
||||||
int k2 = k0%N2[i];
|
|
||||||
k0 /= N2[i];
|
|
||||||
kr += N1[i]*k2;
|
|
||||||
}
|
|
||||||
order[k] = kr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return order;
|
void fft384(t_fft *x)
|
||||||
}
|
|
||||||
|
|
||||||
t_fft **calcTwiddles(int n, int *N1, int *N2, int *order, int sign)
|
|
||||||
{
|
{
|
||||||
t_fft **t = (t_fft**)calloc(n,sizeof(t_fft*));
|
fft<384,1>(x);
|
||||||
|
|
||||||
for(int i=0;i<n;i++) {
|
|
||||||
int Np = N1[i]*N2[i];
|
|
||||||
t[i] = (t_fft*)calloc(Np,sizeof(t_fft));
|
|
||||||
for(int k=0;k<Np;k++) {
|
|
||||||
t[i][k][0] = cos((real)(-sign)*TWOPI*(real)k/(real)Np);
|
|
||||||
t[i][k][1] = sin((real)(-sign)*TWOPI*(real)k/(real)Np);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fft_func *getFuncs(int *f)
|
void fft512(t_fft *x)
|
||||||
{
|
{
|
||||||
int n = 0;
|
fft<512,1>(x);
|
||||||
for(int k=0;;k++) {
|
|
||||||
if(f[k] == 0) break;
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
|
|
||||||
fft_func *func = (fft_func*)calloc(n,sizeof(fft_func));
|
|
||||||
for(int k=0;k<n;k++) {
|
|
||||||
switch(f[k]) {
|
|
||||||
case 2 : func[k] = fft2; break;
|
|
||||||
case 3 : func[k] = fft3; break;
|
|
||||||
case 4 : func[k] = fft4; break;
|
|
||||||
case 5 : func[k] = fft5; break;
|
|
||||||
case 6 : func[k] = fft6; break;
|
|
||||||
case 7 : func[k] = fft7; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return func;
|
|
||||||
}
|
|
||||||
|
|
||||||
int *getN1(int *f, int N)
|
|
||||||
{
|
|
||||||
int n = 0;
|
|
||||||
for(int k=0;;k++) {
|
|
||||||
if(f[k] == 0) break;
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
|
|
||||||
int *N1 = (int*)calloc(n,sizeof(int));
|
|
||||||
for(int k=0;k<n;k++) {
|
|
||||||
N /= f[k];
|
|
||||||
N1[k] = N;
|
|
||||||
}
|
|
||||||
return N1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int getNFactors(int *f)
|
|
||||||
{
|
|
||||||
int n = 0;
|
|
||||||
for(int k=0;;k++) {
|
|
||||||
if(f[k] == 0) break;
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
fftplan *planFFT(int N)
|
|
||||||
{
|
|
||||||
int *factors = factor(N);
|
|
||||||
optimizeFactors(factors);
|
|
||||||
|
|
||||||
fftplan *plan = new fftplan;
|
|
||||||
plan->dir = 1;
|
|
||||||
plan->n = getNFactors(factors);
|
|
||||||
plan->N2 = factors;
|
|
||||||
plan->N1 = getN1(factors,N);
|
|
||||||
plan->order = getOrder(plan->n,plan->N1,plan->N2);
|
|
||||||
plan->reorder = (t_fft*)malloc(N*sizeof(t_fft));
|
|
||||||
plan->t = calcTwiddles(plan->n,plan->N1,plan->N2,plan->order,1);
|
|
||||||
plan->f = getFuncs(factors);
|
|
||||||
plan->N = N;
|
|
||||||
plan->norm = 1.0;
|
|
||||||
return plan;
|
|
||||||
}
|
|
||||||
|
|
||||||
fftplan *planIFFT(int N)
|
|
||||||
{
|
|
||||||
int *factors = factor(N);
|
|
||||||
optimizeFactors(factors);
|
|
||||||
fftplan *plan = new fftplan;
|
|
||||||
plan->dir = -1;
|
|
||||||
plan->n = getNFactors(factors);
|
|
||||||
plan->N2 = factors;
|
|
||||||
plan->N1 = getN1(factors,N);
|
|
||||||
plan->order = getOrder(plan->n,plan->N1,plan->N2);
|
|
||||||
plan->reorder = (t_fft*)malloc(N*sizeof(t_fft));
|
|
||||||
plan->t = calcTwiddles(plan->n,plan->N1,plan->N2,plan->order,-1);
|
|
||||||
plan->f = getFuncs(factors);
|
|
||||||
plan->N = N;
|
|
||||||
plan->norm = 1.0f/(real)N;
|
|
||||||
return plan;
|
|
||||||
}
|
|
||||||
|
|
||||||
void destroy_fftplan(fftplan *plan)
|
|
||||||
{
|
|
||||||
free(plan->reorder);
|
|
||||||
free(plan->order);
|
|
||||||
free(plan->f);
|
|
||||||
for(int i=0;i<plan->n;i++)
|
|
||||||
free(plan->t[i]);
|
|
||||||
free(plan->t);
|
|
||||||
free(plan->N1);
|
|
||||||
free(plan->N2);
|
|
||||||
free(plan);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FFT(fftplan *plan, t_fft *x)
|
|
||||||
{
|
|
||||||
fft(plan,x,0,0);
|
|
||||||
|
|
||||||
for(int k=0;k<plan->N;k++) {
|
|
||||||
plan->reorder[k][0] = x[k][0];
|
|
||||||
plan->reorder[k][1] = x[k][1];
|
|
||||||
}
|
|
||||||
for(int k=0;k<plan->N;k++) {
|
|
||||||
int kr = plan->order[k];
|
|
||||||
if(k != kr) {
|
|
||||||
x[k][0] = plan->reorder[kr][0];
|
|
||||||
x[k][1] = plan->reorder[kr][1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void IFFT(fftplan *plan, t_fft *x)
|
|
||||||
{
|
|
||||||
FFT(plan,x);
|
|
||||||
/*
|
|
||||||
real norm = plan->norm;
|
|
||||||
for(int k=0;k<plan->N;k++) {
|
|
||||||
x[k][0] *= norm;
|
|
||||||
x[k][1] *= norm;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
void fft(fftplan *plan, t_fft *x, int r, int i)
|
|
||||||
{
|
|
||||||
int N1 = plan->N1[i];
|
|
||||||
int N2 = plan->N2[i];
|
|
||||||
for(int n1=0;n1<N1;n1++) {
|
|
||||||
(plan->f[i])(x,n1,N1,r,plan->t[i],plan->dir);
|
|
||||||
}
|
|
||||||
if(N1==1) return;
|
|
||||||
for(int k2=0;k2<N2;k2++) {
|
|
||||||
fft(plan,x,r,i+1);
|
|
||||||
r += N1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void fft2(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
|
|
||||||
{
|
|
||||||
int i = r+n1;
|
|
||||||
real *x0 = x[i]; i+= N1;
|
|
||||||
real *x1 = x[i];
|
|
||||||
|
|
||||||
real y0 = x0[0] - x1[0];
|
|
||||||
real y1 = x0[1] - x1[1];
|
|
||||||
|
|
||||||
x0[0] += x1[0];
|
|
||||||
x0[1] += x1[1];
|
|
||||||
|
|
||||||
real *t1 = t[n1];
|
|
||||||
real t10 = t1[0];
|
|
||||||
real t11 = t1[1];
|
|
||||||
x1[0] = REAL(t10,t11,y0,y1);
|
|
||||||
x1[1] = IMAG(t10,t11,y0,y1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define T300 0.5f
|
|
||||||
#define T301 0.86602540378444f
|
|
||||||
void fft3(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
|
|
||||||
{
|
|
||||||
int i = r+n1;
|
|
||||||
real *x0 = x[i]; i+=N1;
|
|
||||||
real *x1 = x[i]; i+=N1;
|
|
||||||
real *x2 = x[i];
|
|
||||||
|
|
||||||
real z00 = x1[0] + x2[0];
|
|
||||||
real z01 = x1[1] + x2[1];
|
|
||||||
|
|
||||||
real z10 = x0[0] - T300*z00;
|
|
||||||
real z11 = x0[1] - T300*z01;
|
|
||||||
|
|
||||||
real z20;
|
|
||||||
real z21;
|
|
||||||
if(dir==1) {
|
|
||||||
z20 = T301*(x2[0] - x1[0]);
|
|
||||||
z21 = T301*(x2[1] - x1[1]);
|
|
||||||
} else {
|
|
||||||
z20 = T301*(x1[0] - x2[0]);
|
|
||||||
z21 = T301*(x1[1] - x2[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
x0[0] = z00 + x0[0];
|
|
||||||
x0[1] = z01 + x0[1];
|
|
||||||
|
|
||||||
real z30 = z10 - z21;
|
|
||||||
real z31 = z11 + z20;
|
|
||||||
real *t1 = t[n1];
|
|
||||||
real t10 = t1[0];
|
|
||||||
real t11 = t1[1];
|
|
||||||
x1[0] = REAL(t10,t11,z30,z31);
|
|
||||||
x1[1] = IMAG(t10,t11,z30,z31);
|
|
||||||
|
|
||||||
real z40 = z10 + z21;
|
|
||||||
real z41 = z11 - z20;
|
|
||||||
real *t2 = t[n1<<1];
|
|
||||||
real t20 = t2[0];
|
|
||||||
real t21 = t2[1];
|
|
||||||
x2[0] = REAL(t20,t21,z40,z41);
|
|
||||||
x2[1] = IMAG(t20,t21,z40,z41);
|
|
||||||
}
|
|
||||||
|
|
||||||
void fft4(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
|
|
||||||
{
|
|
||||||
int i = r+n1;
|
|
||||||
real *x0 = x[i]; i+=N1;
|
|
||||||
real *x1 = x[i]; i+=N1;
|
|
||||||
real *x2 = x[i]; i+=N1;
|
|
||||||
real *x3 = x[i];
|
|
||||||
|
|
||||||
real z20 = x0[0] - x2[0];
|
|
||||||
real z21 = x0[1] - x2[1];
|
|
||||||
real z00 = x0[0] + x2[0];
|
|
||||||
real z01 = x0[1] + x2[1];
|
|
||||||
|
|
||||||
real z10 = x1[0] + x3[0];
|
|
||||||
real z11 = x1[1] + x3[1];
|
|
||||||
|
|
||||||
x0[0] = z00 + z10;
|
|
||||||
x0[1] = z01 + z11;
|
|
||||||
|
|
||||||
real y20 = z00 - z10;
|
|
||||||
real y21 = z01 - z11;
|
|
||||||
real *t2 = t[n1<<1];
|
|
||||||
real t20 = t2[0];
|
|
||||||
real t21 = t2[1];
|
|
||||||
x2[0] = REAL(t20,t21,y20,y21);
|
|
||||||
x2[1] = IMAG(t20,t21,y20,y21);
|
|
||||||
|
|
||||||
real z30;
|
|
||||||
real z31;
|
|
||||||
if(dir==1) {
|
|
||||||
z30 = (x3[0] - x1[0]);
|
|
||||||
z31 = (x3[1] - x1[1]);
|
|
||||||
} else {
|
|
||||||
z30 = (x1[0] - x3[0]);
|
|
||||||
z31 = (x1[1] - x3[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
real y10 = z20 - z31;
|
|
||||||
real y11 = z21 + z30;
|
|
||||||
real *t1 = t[n1];
|
|
||||||
real t10 = t1[0];
|
|
||||||
real t11 = t1[1];
|
|
||||||
x1[0] = REAL(t10,t11,y10,y11);
|
|
||||||
x1[1] = IMAG(t10,t11,y10,y11);
|
|
||||||
|
|
||||||
real y30 = z20 + z31;
|
|
||||||
real y31 = z21 - z30;
|
|
||||||
real *t3 = t[n1*3];
|
|
||||||
real t30 = t3[0];
|
|
||||||
real t31 = t3[1];
|
|
||||||
x3[0] = REAL(t30,t31,y30,y31);
|
|
||||||
x3[1] = IMAG(t30,t31,y30,y31);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define T500 0.95105651629515f
|
|
||||||
#define T501 0.58778525229247f
|
|
||||||
#define T510 0.55901699437495f
|
|
||||||
#define T511 0.25f
|
|
||||||
|
|
||||||
void fft5(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
|
|
||||||
{
|
|
||||||
int i = r+n1;
|
|
||||||
real *x0 = x[i]; i+=N1;
|
|
||||||
real *x1 = x[i]; i+=N1;
|
|
||||||
real *x2 = x[i]; i+=N1;
|
|
||||||
real *x3 = x[i]; i+=N1;
|
|
||||||
real *x4 = x[i];
|
|
||||||
|
|
||||||
real z00 = x1[0] + x4[0];
|
|
||||||
real z01 = x1[1] + x4[1];
|
|
||||||
|
|
||||||
real z10 = x2[0] + x3[0];
|
|
||||||
real z11 = x2[1] + x3[1];
|
|
||||||
|
|
||||||
real z20 = x1[0] - x4[0];
|
|
||||||
real z21 = x1[1] - x4[1];
|
|
||||||
|
|
||||||
real z30 = x2[0] - x3[0];
|
|
||||||
real z31 = x2[1] - x3[1];
|
|
||||||
|
|
||||||
real z40 = z00 + z10;
|
|
||||||
real z41 = z01 + z11;
|
|
||||||
|
|
||||||
real z50 = T510*(z00 - z10);
|
|
||||||
real z51 = T510*(z01 - z11);
|
|
||||||
|
|
||||||
real z60 = x0[0] - T511*z40;
|
|
||||||
real z61 = x0[1] - T511*z41;
|
|
||||||
|
|
||||||
real z70 = z50 + z60;
|
|
||||||
real z71 = z51 + z61;
|
|
||||||
|
|
||||||
real z80 = z60 - z50;
|
|
||||||
real z81 = z61 - z51;
|
|
||||||
|
|
||||||
real z90;
|
|
||||||
real z91;
|
|
||||||
if(dir==1) {
|
|
||||||
z90 = -(T500*z20 + T501*z30);
|
|
||||||
z91 = -(T500*z21 + T501*z31);
|
|
||||||
} else {
|
|
||||||
z90 = (T500*z20 + T501*z30);
|
|
||||||
z91 = (T500*z21 + T501*z31);
|
|
||||||
}
|
|
||||||
|
|
||||||
real z100;
|
|
||||||
real z101;
|
|
||||||
if(dir==1) {
|
|
||||||
z100 = (T500*z30 - T501*z20);
|
|
||||||
z101 = (T500*z31 - T501*z21);
|
|
||||||
} else {
|
|
||||||
z100 = (T501*z20 - T500*z30);
|
|
||||||
z101 = (T501*z21 - T500*z31);
|
|
||||||
}
|
|
||||||
|
|
||||||
x0[0] = x0[0] + z40;
|
|
||||||
x0[1] = x0[1] + z41;
|
|
||||||
|
|
||||||
real y10 = z70 - z91;
|
|
||||||
real y11 = z71 + z90;
|
|
||||||
real *t1 = t[n1];
|
|
||||||
real t10 = t1[0];
|
|
||||||
real t11 = t1[1];
|
|
||||||
x1[0] = REAL(t10,t11,y10,y11);
|
|
||||||
x1[1] = IMAG(t10,t11,y10,y11);
|
|
||||||
|
|
||||||
real y20 = z80 - z101;
|
|
||||||
real y21 = z81 + z100;
|
|
||||||
real *t2 = t[n1<<1];
|
|
||||||
real t20 = t2[0];
|
|
||||||
real t21 = t2[1];
|
|
||||||
x2[0] = REAL(t20,t21,y20,y21);
|
|
||||||
x2[1] = IMAG(t20,t21,y20,y21);
|
|
||||||
|
|
||||||
real y30 = z80 + z101;
|
|
||||||
real y31 = z81 - z100;
|
|
||||||
real *t3 = t[n1*3];
|
|
||||||
real t30 = t3[0];
|
|
||||||
real t31 = t3[1];
|
|
||||||
x3[0] = REAL(t30,t31,y30,y31);
|
|
||||||
x3[1] = IMAG(t30,t31,y30,y31);
|
|
||||||
|
|
||||||
real y40 = z70 + z91;
|
|
||||||
real y41 = z71 - z90;
|
|
||||||
real *t4 = t[n1<<2];
|
|
||||||
real t40 = t4[0];
|
|
||||||
real t41 = t4[1];
|
|
||||||
x4[0] = REAL(t40,t41,y40,y41);
|
|
||||||
x4[1] = IMAG(t40,t41,y40,y41);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define T600 0.86602540378444f
|
|
||||||
#define T601 0.5f
|
|
||||||
void fft6(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
|
|
||||||
{
|
|
||||||
int i = r+n1;
|
|
||||||
real *x0 = x[i]; i+=N1;
|
|
||||||
real *x1 = x[i]; i+=N1;
|
|
||||||
real *x2 = x[i]; i+=N1;
|
|
||||||
real *x3 = x[i]; i+=N1;
|
|
||||||
real *x4 = x[i]; i+=N1;
|
|
||||||
real *x5 = x[i];
|
|
||||||
|
|
||||||
real za00 = x2[0] + x4[0];
|
|
||||||
real za01 = x2[1] + x4[1];
|
|
||||||
|
|
||||||
real za10 = x0[0] - T601*za00;
|
|
||||||
real za11 = x0[1] - T601*za01;
|
|
||||||
|
|
||||||
real za20;
|
|
||||||
real za21;
|
|
||||||
if(dir==1) {
|
|
||||||
za20 = T600*(x4[0] - x2[0]);
|
|
||||||
za21 = T600*(x4[1] - x2[1]);
|
|
||||||
} else {
|
|
||||||
za20 = T600*(x2[0] - x4[0]);
|
|
||||||
za21 = T600*(x2[1] - x4[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
real a00 = x0[0] + za00;
|
|
||||||
real a01 = x0[1] + za01;
|
|
||||||
|
|
||||||
real a10 = za10 - za21;
|
|
||||||
real a11 = za11 + za20;
|
|
||||||
|
|
||||||
real a20 = za10 + za21;
|
|
||||||
real a21 = za11 - za20;
|
|
||||||
|
|
||||||
real zb00 = x1[0] + x5[0];
|
|
||||||
real zb01 = x1[1] + x5[1];
|
|
||||||
|
|
||||||
real zb10 = x3[0] - T601*zb00;
|
|
||||||
real zb11 = x3[1] - T601*zb01;
|
|
||||||
|
|
||||||
real zb20;
|
|
||||||
real zb21;
|
|
||||||
if(dir==1) {
|
|
||||||
zb20 = T600*(x1[0] - x5[0]);
|
|
||||||
zb21 = T600*(x1[1] - x5[1]);
|
|
||||||
} else {
|
|
||||||
zb20 = T600*(x5[0] - x1[0]);
|
|
||||||
zb21 = T600*(x5[1] - x1[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
real b00 = x3[0] + zb00;
|
|
||||||
real b01 = x3[1] + zb01;
|
|
||||||
|
|
||||||
real b10 = zb10 - zb21;
|
|
||||||
real b11 = zb11 + zb20;
|
|
||||||
|
|
||||||
real b20 = zb10 + zb21;
|
|
||||||
real b21 = zb11 - zb20;
|
|
||||||
|
|
||||||
x0[0] = a00 + b00;
|
|
||||||
x0[1] = a01 + b01;
|
|
||||||
|
|
||||||
real y10 = a10 - b10;
|
|
||||||
real y11 = a11 - b11;
|
|
||||||
real *t1 = t[n1];
|
|
||||||
real t10 = t1[0];
|
|
||||||
real t11 = t1[1];
|
|
||||||
x1[0] = REAL(t10,t11,y10,y11);
|
|
||||||
x1[1] = IMAG(t10,t11,y10,y11);
|
|
||||||
|
|
||||||
real y20 = a20 + b20;
|
|
||||||
real y21 = a21 + b21;
|
|
||||||
real *t2 = t[n1<<1];
|
|
||||||
real t20 = t2[0];
|
|
||||||
real t21 = t2[1];
|
|
||||||
x2[0] = REAL(t20,t21,y20,y21);
|
|
||||||
x2[1] = IMAG(t20,t21,y20,y21);
|
|
||||||
|
|
||||||
real y30 = a00 - b00;
|
|
||||||
real y31 = a01 - b01;
|
|
||||||
real *t3 = t[n1*3];
|
|
||||||
real t30 = t3[0];
|
|
||||||
real t31 = t3[1];
|
|
||||||
x3[0] = REAL(t30,t31,y30,y31);
|
|
||||||
x3[1] = IMAG(t30,t31,y30,y31);
|
|
||||||
|
|
||||||
real y40 = a10 + b10;
|
|
||||||
real y41 = a11 + b11;
|
|
||||||
real *t4 = t[n1<<2];
|
|
||||||
real t40 = t4[0];
|
|
||||||
real t41 = t4[1];
|
|
||||||
x4[0] = REAL(t40,t41,y40,y41);
|
|
||||||
x4[1] = IMAG(t40,t41,y40,y41);
|
|
||||||
|
|
||||||
real y50 = a20 - b20;
|
|
||||||
real y51 = a21 - b21;
|
|
||||||
real *t5 = t[n1*5];
|
|
||||||
real t50 = t5[0];
|
|
||||||
real t51 = t5[1];
|
|
||||||
x5[0] = REAL(t50,t51,y50,y51);
|
|
||||||
x5[1] = IMAG(t50,t51,y50,y51);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define C71 -1.16666666666667f
|
|
||||||
#define C72 0.79015646852540f
|
|
||||||
#define C73 0.05585426728965f
|
|
||||||
#define C74 0.73430220123575f
|
|
||||||
#define C75 0.44095855184410f
|
|
||||||
#define C76 0.34087293062393f
|
|
||||||
#define C77 -0.53396936033773f
|
|
||||||
#define C78 0.87484229096166f
|
|
||||||
|
|
||||||
void fft7(t_fft *x, int n1, int N1, int r, t_fft *t, int dir)
|
|
||||||
{
|
|
||||||
int i = r+n1;
|
|
||||||
real *x0 = x[i]; i+=N1;
|
|
||||||
real *x1 = x[i]; i+=N1;
|
|
||||||
real *x2 = x[i]; i+=N1;
|
|
||||||
real *x3 = x[i]; i+=N1;
|
|
||||||
real *x4 = x[i]; i+=N1;
|
|
||||||
real *x5 = x[i]; i+=N1;
|
|
||||||
real *x6 = x[i];
|
|
||||||
|
|
||||||
real u00 = x1[0] + x6[0];
|
|
||||||
real u01 = x1[1] + x6[1];
|
|
||||||
|
|
||||||
real u10 = x1[0] - x6[0];
|
|
||||||
real u11 = x1[1] - x6[1];
|
|
||||||
|
|
||||||
real u20 = x2[0] + x5[0];
|
|
||||||
real u21 = x2[1] + x5[1];
|
|
||||||
|
|
||||||
real u30 = x2[0] - x5[0];
|
|
||||||
real u31 = x2[1] - x5[1];
|
|
||||||
|
|
||||||
real u40 = x4[0] + x3[0];
|
|
||||||
real u41 = x4[1] + x3[1];
|
|
||||||
|
|
||||||
real u50 = x4[0] - x3[0];
|
|
||||||
real u51 = x4[1] - x3[1];
|
|
||||||
|
|
||||||
real u60 = u20 + u00;
|
|
||||||
real u61 = u21 + u01;
|
|
||||||
|
|
||||||
real u70 = u50 + u30;
|
|
||||||
real u71 = u51 + u31;
|
|
||||||
|
|
||||||
real b00 = x0[0] + u60 + u40;
|
|
||||||
real b01 = x0[1] + u61 + u41;
|
|
||||||
|
|
||||||
real b10 = C71*(u60 + u40);
|
|
||||||
real b11 = C71*(u61 + u41);
|
|
||||||
|
|
||||||
real b20 = C72*(u00 - u40);
|
|
||||||
real b21 = C72*(u01 - u41);
|
|
||||||
|
|
||||||
real b30 = C73*(u40 - u20);
|
|
||||||
real b31 = C73*(u41 - u21);
|
|
||||||
|
|
||||||
real b40 = C74*(u20 - u00);
|
|
||||||
real b41 = C74*(u21 - u01);
|
|
||||||
|
|
||||||
real b50;
|
|
||||||
real b51;
|
|
||||||
if(dir==1) {
|
|
||||||
b50 = C75*(u70 + u10);
|
|
||||||
b51 = C75*(u71 + u11);
|
|
||||||
} else {
|
|
||||||
b50 = -C75*(u70 + u10);
|
|
||||||
b51 = -C75*(u71 + u11);
|
|
||||||
}
|
|
||||||
|
|
||||||
real b60;
|
|
||||||
real b61;
|
|
||||||
if(dir==1) {
|
|
||||||
b60 = C76*(u10 - u50);
|
|
||||||
b61 = C76*(u11 - u51);
|
|
||||||
} else {
|
|
||||||
b60 = C76*(u50 - u10);
|
|
||||||
b61 = C76*(u51 - u11);
|
|
||||||
}
|
|
||||||
|
|
||||||
real b70;
|
|
||||||
real b71;
|
|
||||||
if(dir==1) {
|
|
||||||
b70 = C77*(u50 - u30);
|
|
||||||
b71 = C77*(u51 - u31);
|
|
||||||
} else {
|
|
||||||
b70 = C77*(u30 - u50);
|
|
||||||
b71 = C77*(u31 - u51);
|
|
||||||
}
|
|
||||||
|
|
||||||
real b80;
|
|
||||||
real b81;
|
|
||||||
if(dir==1) {
|
|
||||||
b80 = C78*(u30 - u10);
|
|
||||||
b81 = C78*(u31 - u11);
|
|
||||||
} else {
|
|
||||||
b80 = C78*(u10 - u30);
|
|
||||||
b81 = C78*(u11 - u31);
|
|
||||||
}
|
|
||||||
|
|
||||||
real T00 = b00 + b10;
|
|
||||||
real T01 = b01 + b11;
|
|
||||||
|
|
||||||
real T10 = b20 + b30;
|
|
||||||
real T11 = b21 + b31;
|
|
||||||
|
|
||||||
real T20 = b40 - b30;
|
|
||||||
real T21 = b41 - b31;
|
|
||||||
|
|
||||||
real T30 = -b20 - b40;
|
|
||||||
real T31 = -b21 - b41;
|
|
||||||
|
|
||||||
real T40 = b60 + b70;
|
|
||||||
real T41 = b61 + b71;
|
|
||||||
|
|
||||||
real T50 = b80 - b70;
|
|
||||||
real T51 = b81 - b71;
|
|
||||||
|
|
||||||
real T60 = -b80 - b60;
|
|
||||||
real T61 = -b81 - b61;
|
|
||||||
|
|
||||||
real T70 = T00 + T10;
|
|
||||||
real T71 = T01 + T11;
|
|
||||||
|
|
||||||
real T80 = T00 + T20;
|
|
||||||
real T81 = T01 + T21;
|
|
||||||
|
|
||||||
real T90 = T00 + T30;
|
|
||||||
real T91 = T01 + T31;
|
|
||||||
|
|
||||||
real T100 = T40 + b50;
|
|
||||||
real T101 = T41 + b51;
|
|
||||||
|
|
||||||
real T110 = T50 + b50;
|
|
||||||
real T111 = T51 + b51;
|
|
||||||
|
|
||||||
real T120 = T60 + b50;
|
|
||||||
real T121 = T61 + b51;
|
|
||||||
|
|
||||||
x0[0] = b00;
|
|
||||||
x0[1] = b01;
|
|
||||||
|
|
||||||
real y10 = T70 + T101;
|
|
||||||
real y11 = T71 - T100;
|
|
||||||
real *t1 = t[n1];
|
|
||||||
real t10 = t1[0];
|
|
||||||
real t11 = t1[1];
|
|
||||||
x1[0] = REAL(t10,t11,y10,y11);
|
|
||||||
x1[1] = IMAG(t10,t11,y10,y11);
|
|
||||||
|
|
||||||
real y20 = T90 + T121;
|
|
||||||
real y21 = T91 - T120;
|
|
||||||
real *t2 = t[n1<<1];
|
|
||||||
real t20 = t2[0];
|
|
||||||
real t21 = t2[1];
|
|
||||||
x2[0] = REAL(t20,t21,y20,y21);
|
|
||||||
x2[1] = IMAG(t20,t21,y20,y21);
|
|
||||||
|
|
||||||
real y30 = T80 - T111;
|
|
||||||
real y31 = T81 + T110;
|
|
||||||
real *t3 = t[n1*3];
|
|
||||||
real t30 = t3[0];
|
|
||||||
real t31 = t3[1];
|
|
||||||
x3[0] = REAL(t30,t31,y30,y31);
|
|
||||||
x3[1] = IMAG(t30,t31,y30,y31);
|
|
||||||
|
|
||||||
real y40 = T80 + T111;
|
|
||||||
real y41 = T81 - T110;
|
|
||||||
real *t4 = t[n1<<2];
|
|
||||||
real t40 = t4[0];
|
|
||||||
real t41 = t4[1];
|
|
||||||
x4[0] = REAL(t40,t41,y40,y41);
|
|
||||||
x4[1] = IMAG(t40,t41,y40,y41);
|
|
||||||
|
|
||||||
real y50 = T90 - T121;
|
|
||||||
real y51 = T91 + T120;
|
|
||||||
real *t5 = t[n1*5];
|
|
||||||
real t50 = t5[0];
|
|
||||||
real t51 = t5[1];
|
|
||||||
x5[0] = REAL(t50,t51,y50,y51);
|
|
||||||
x5[1] = IMAG(t50,t51,y50,y51);
|
|
||||||
|
|
||||||
real y60 = T70 - T101;
|
|
||||||
real y61 = T71 + T100;
|
|
||||||
real *t6 = t[n1*6];
|
|
||||||
real t60 = t6[0];
|
|
||||||
real t61 = t6[1];
|
|
||||||
x6[0] = REAL(t60,t61,y60,y61);
|
|
||||||
x6[1] = IMAG(t60,t61,y60,y61);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,51 +1,853 @@
|
||||||
|
// -*- mode: c++ -*-
|
||||||
#ifndef FFT_H
|
#ifndef FFT_H
|
||||||
#define FFT_H
|
#define FFT_H
|
||||||
|
|
||||||
#include "sbsms.h"
|
#include <math.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
|
#if defined(ENABLE_SSE) && !defined(APPLE_PPC)
|
||||||
|
#include "sse.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
typedef real t_fft[2];
|
typedef void (*fftplan)(t_fft *x);
|
||||||
|
void fft128(t_fft *x);
|
||||||
|
void ifft128(t_fft *x);
|
||||||
|
void fft256(t_fft *x);
|
||||||
|
void ifft256(t_fft *x);
|
||||||
|
void fft384(t_fft *x);
|
||||||
|
void fft512(t_fft *x);
|
||||||
|
|
||||||
typedef void (*fft_func)(t_fft *x, int n1, int N1, int r, t_fft *t, int dir);
|
template<int N>
|
||||||
|
class Factor {
|
||||||
struct fftplan {
|
public:
|
||||||
fft_func *f;
|
enum { value = (N%8==0)?8:(N%7==0)?7:(N%4==0)?4:(N%5==0)?5:(N%6==0)?6:(N%3==0)?3:(N%2==0)?2:1 };
|
||||||
int *order;
|
|
||||||
t_fft *reorder;
|
|
||||||
int *N1;
|
|
||||||
int *N2;
|
|
||||||
int N;
|
|
||||||
int n;
|
|
||||||
int dir;
|
|
||||||
real norm;
|
|
||||||
t_fft **t;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
t_fft *make_fft_buf(int N);
|
template<int N>
|
||||||
void free_fft_buf(t_fft *buf);
|
class LastFactor {
|
||||||
fftplan *planFFT(int N);
|
public:
|
||||||
fftplan *planIFFT(int N);
|
enum { radix = Factor<N>::value,
|
||||||
void destroy_fftplan(fftplan *plan);
|
stride = N / radix,
|
||||||
void FFT(fftplan *plan, t_fft *x);
|
value = (stride==1?radix:LastFactor<stride>::value) };
|
||||||
void IFFT(fftplan *plan, t_fft *x);
|
};
|
||||||
|
|
||||||
void fft(fftplan *plan, t_fft *x, int r, int i);
|
template <>
|
||||||
void optimizeFactors(int *f);
|
class LastFactor<1> {
|
||||||
int *getOrder(int n, int *N1, int *N2);
|
public:
|
||||||
t_fft **calcTwiddles(int n, int *N1, int *N2, int dir);
|
enum { value = 1 };
|
||||||
fft_func *getFuncs(int *f);
|
};
|
||||||
int *getN1(int *f, int N);
|
|
||||||
int getNFactors(int *f);
|
|
||||||
|
|
||||||
void fft2(t_fft *x, int n1, int N1, int r, t_fft *t, int dir);
|
template<int istride, int ostride, int radix, int dir>
|
||||||
void fft3(t_fft *x, int n1, int N1, int r, t_fft *t, int dir);
|
class __fft {
|
||||||
void fft4(t_fft *x, int n1, int N1, int r, t_fft *t, int dir);
|
public:
|
||||||
void fft5(t_fft *x, int n1, int N1, int r, t_fft *t, int dir);
|
static inline void execute(t_fft *x, t_fft *y, int step);
|
||||||
void fft6(t_fft *x, int n1, int N1, int r, t_fft *t, int dir);
|
};
|
||||||
void fft7(t_fft *x, int n1, int N1, int r, t_fft *t, int dir);
|
|
||||||
|
template <int N, int dir>
|
||||||
|
class FloatTwiddles {
|
||||||
|
public:
|
||||||
|
float c[N];
|
||||||
|
float s[N];
|
||||||
|
FloatTwiddles() {
|
||||||
|
for(int k=0; k<N; k++) {
|
||||||
|
c[k] = cos(TWOPI * (float)k / (float)N);
|
||||||
|
s[k] = sin(TWOPI * (float)(-dir*k) / (float)N);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <int N, int dir>
|
||||||
|
class FloatTwiddle {
|
||||||
|
public:
|
||||||
|
static const float *c;
|
||||||
|
static const float *s;
|
||||||
|
static const FloatTwiddles<N,dir> t;
|
||||||
|
static inline void twiddle(int k, t_fft *x, float r, float i) {
|
||||||
|
float cc = c[k];
|
||||||
|
float ss = s[k];
|
||||||
|
(*x)[0] = cc * r - ss * i;
|
||||||
|
(*x)[1] = ss * r + cc * i;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <int N, int dir>
|
||||||
|
const FloatTwiddles<N,dir> FloatTwiddle<N,dir>::t;
|
||||||
|
|
||||||
|
template <int N, int dir>
|
||||||
|
const float* FloatTwiddle<N,dir>::c = t.c;
|
||||||
|
|
||||||
|
template <int N, int dir>
|
||||||
|
const float* FloatTwiddle<N,dir>::s = t.s;
|
||||||
|
|
||||||
|
template<int istride, int ostride, int dir>
|
||||||
|
class __fft<istride,ostride,2,dir> {
|
||||||
|
public:
|
||||||
|
enum { i1 = istride, o1 = ostride,
|
||||||
|
ir0 = 0, ii0 = 1, or0 = 0, oi0 = 1,
|
||||||
|
ir1 = i1<<1, ii1 = ir1 + 1, or1 = o1<<1, oi1 = or1 + 1 };
|
||||||
|
static inline void execute(t_fft *_x, t_fft *_y, int step) {
|
||||||
|
float *x = (float*)_x;
|
||||||
|
float *y = (float*)_y;
|
||||||
|
float y0 = x[ir0] - x[ir1]; float y1 = x[ii0] - x[ii1];
|
||||||
|
y[or0] = x[ir0] + x[ir1]; y[oi0] = x[ii0] + x[ii1];
|
||||||
|
y[or1] = y0; y[oi1] = y1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int istride, int ostride, int dir>
|
||||||
|
class __fft<istride,ostride,3,dir> {
|
||||||
|
public:
|
||||||
|
enum { N = istride * 3,
|
||||||
|
i1_ = istride, o1 = ostride,
|
||||||
|
i2_ = istride + istride, o2 = o1 + ostride,
|
||||||
|
i1 = (dir==1?i1_:i2_),
|
||||||
|
i2 = (dir==1?i2_:i1_),
|
||||||
|
ir0 = 0, ii0 = 1, or0 = 0, oi0 = 1,
|
||||||
|
ir1 = i1<<1, ii1 = ir1 + 1, or1 = o1<<1, oi1 = or1 + 1,
|
||||||
|
ir2 = i2<<1, ii2 = ir2 + 1, or2 = o2<<1, oi2 = or2 + 1 };
|
||||||
|
static inline void execute(t_fft *_x, t_fft *_y, int step) {
|
||||||
|
float *x = (float*)_x;
|
||||||
|
float *y = (float*)_y;
|
||||||
|
float z00 = x[ir1] + x[ir2]; float z01 = x[ii1] + x[ii2];
|
||||||
|
float z10 = x[ir0] - 0.5f*z00; float z11 = x[ii0] - 0.5f*z01;
|
||||||
|
float z20 = 0.86602540378444f*(x[ir2] - x[ir1]); float z21 = 0.86602540378444f*(x[ii2] - x[ii1]);
|
||||||
|
y[or0] = x[ir0] + z00; y[oi0] = x[ii0] + z01;
|
||||||
|
if(step) {
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step, _y+o1,z10 - z21,z11 + z20);
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step+step, _y+o2,z10 + z21,z11 - z20);
|
||||||
|
} else {
|
||||||
|
y[or1] = z10 - z21; y[oi1] = z11 + z20;
|
||||||
|
y[or2] = z10 + z21; y[oi2] = z11 - z20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int istride, int ostride, int dir>
|
||||||
|
class __fft<istride,ostride,5,dir> {
|
||||||
|
public:
|
||||||
|
enum { N = istride*5,
|
||||||
|
i0 = 0, o0 = 0,
|
||||||
|
i1_ = i0 + istride, o1 = o0 + ostride,
|
||||||
|
i2_ = i1_ + istride, o2 = o1 + ostride,
|
||||||
|
i3_ = i2_ + istride, o3 = o2 + ostride,
|
||||||
|
i4_ = i3_ + istride, o4 = o3 + ostride,
|
||||||
|
i1 = (dir==1?i4_:i1_),
|
||||||
|
i2 = (dir==1?i3_:i2_),
|
||||||
|
i3 = (dir==1?i2_:i3_),
|
||||||
|
i4 = (dir==1?i1_:i4_),
|
||||||
|
ir0 = i0<<1, ii0 = ir0 + 1, or0 = o0<<1, oi0 = or0 + 1,
|
||||||
|
ir1 = i1<<1, ii1 = ir1 + 1, or1 = o1<<1, oi1 = or1 + 1,
|
||||||
|
ir2 = i2<<1, ii2 = ir2 + 1, or2 = o2<<1, oi2 = or2 + 1,
|
||||||
|
ir3 = i3<<1, ii3 = ir3 + 1, or3 = o3<<1, oi3 = or3 + 1,
|
||||||
|
ir4 = i4<<1, ii4 = ir4 + 1, or4 = o4<<1, oi4 = or4 + 1 };
|
||||||
|
static inline void execute(t_fft *_x, t_fft *_y, int step) {
|
||||||
|
float *x = (float*)_x;
|
||||||
|
float *y = (float*)_y;
|
||||||
|
float z00, z01, z10, z11, z20, z21, z30, z31, z40, z41, z50, z51, z60, z61, z70, z71, z80, z81, z90, z91, z100, z101;
|
||||||
|
z00 = x[ir1] + x[ir4]; z01 = x[ii1] + x[ii4];
|
||||||
|
z10 = x[ir2] + x[ir3]; z11 = x[ii2] + x[ii3];
|
||||||
|
z20 = x[ir1] - x[ir4]; z21 = x[ii1] - x[ii4];
|
||||||
|
z30 = x[ir2] - x[ir3]; z31 = x[ii2] - x[ii3];
|
||||||
|
z40 = z00 + z10; z41 = z01 + z11;
|
||||||
|
z50 = 0.55901699437495f*(z00 - z10); z51 = 0.55901699437495f*(z01 - z11);
|
||||||
|
z60 = x[ir0] - 0.25f*z40; z61 = x[ii0] - 0.25f*z41;
|
||||||
|
z70 = z50 + z60; z71 = z51 + z61;
|
||||||
|
z80 = z60 - z50; z81 = z61 - z51;
|
||||||
|
z90 = 0.95105651629515f*z20 + 0.58778525229247f*z30; z91 = 0.95105651629515f*z21 + 0.58778525229247f*z31;
|
||||||
|
z100 = 0.58778525229247f*z20 - 0.95105651629515f*z30; z101 = 0.58778525229247f*z21 - 0.95105651629515f*z31;
|
||||||
|
y[or0] = x[ir0] + z40; y[oi0] = x[ii0] + z41;
|
||||||
|
if(step) {
|
||||||
|
int step2 = step + step;
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step,_y+o1,z70 - z91,z71 + z90);
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step2,_y+o2,z80 - z101,z81 + z100);
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step2+step,_y+o3,z80 + z101,z81 - z100);
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step2+step2,_y+o4,z70 + z91,z71 - z90);
|
||||||
|
} else {
|
||||||
|
y[or1] = z70 - z91; y[oi1] = z71 + z90;
|
||||||
|
y[or2] = z80 - z101; y[oi2] = z81 + z100;
|
||||||
|
y[or3] = z80 + z101; y[oi3] = z81 - z100;
|
||||||
|
y[or4] = z70 + z91; y[oi4] = z71 - z90;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int istride, int ostride, int dir>
|
||||||
|
class __fft<istride,ostride,6,dir> {
|
||||||
|
public:
|
||||||
|
enum { N = istride*6,
|
||||||
|
i0 = 0, o0 = 0,
|
||||||
|
i1_ = i0 + istride, o1 = o0 + ostride,
|
||||||
|
i2_ = i1_ + istride, o2 = o1 + ostride,
|
||||||
|
i3 = i2_ + istride, o3 = o2 + ostride,
|
||||||
|
i4_ = i3 + istride, o4 = o3 + ostride,
|
||||||
|
i5_ = i4_ + istride, o5 = o4 + ostride,
|
||||||
|
i1 = (dir==1?i1_:i5_),
|
||||||
|
i2 = (dir==1?i2_:i4_),
|
||||||
|
i4 = (dir==1?i4_:i2_),
|
||||||
|
i5 = (dir==1?i5_:i1_),
|
||||||
|
ir0 = i0<<1, ii0 = ir0 + 1, or0 = o0<<1, oi0 = or0 + 1,
|
||||||
|
ir1 = i1<<1, ii1 = ir1 + 1, or1 = o1<<1, oi1 = or1 + 1,
|
||||||
|
ir2 = i2<<1, ii2 = ir2 + 1, or2 = o2<<1, oi2 = or2 + 1,
|
||||||
|
ir3 = i3<<1, ii3 = ir3 + 1, or3 = o3<<1, oi3 = or3 + 1,
|
||||||
|
ir4 = i4<<1, ii4 = ir4 + 1, or4 = o4<<1, oi4 = or4 + 1,
|
||||||
|
ir5 = i5<<1, ii5 = ir5 + 1, or5 = o5<<1, oi5 = or5 + 1 };
|
||||||
|
static inline void execute(t_fft *_x, t_fft *_y, int step) {
|
||||||
|
float *x = (float*)_x;
|
||||||
|
float *y = (float*)_y;
|
||||||
|
float za00, za01, za10, za11, za20, za21;
|
||||||
|
float a00, a01, a10, a11, a20, a21;
|
||||||
|
float zb00, zb01, zb10, zb11, zb20, zb21;
|
||||||
|
float b00, b01, b10, b11, b20, b21;
|
||||||
|
za00 = x[ir2] + x[ir4]; za01 = x[ii2] + x[ii4];
|
||||||
|
za10 = x[ir0] - 0.5f*za00; za11 = x[ii0] - 0.5f*za01;
|
||||||
|
za20 = 0.86602540378444f*(x[ir4] - x[ir2]); za21 = 0.86602540378444f*(x[ii4] - x[ii2]);
|
||||||
|
a00 = x[ir0] + za00; a01 = x[ii0] + za01;
|
||||||
|
a10 = za10 - za21; a11 = za11 + za20;
|
||||||
|
a20 = za10 + za21; a21 = za11 - za20;
|
||||||
|
zb00 = x[ir1] + x[ir5]; zb01 = x[ii1] + x[ii5];
|
||||||
|
zb10 = x[ir3] - 0.5f*zb00; zb11 = x[ii3] - 0.5f*zb01;
|
||||||
|
zb20 = 0.86602540378444f*(x[ir1] - x[ir5]); zb21 = 0.86602540378444f*(x[ii1] - x[ii5]);
|
||||||
|
b00 = x[ir3] + zb00; b01 = x[ii3] + zb01;
|
||||||
|
b10 = zb10 - zb21; b11 = zb11 + zb20;
|
||||||
|
b20 = zb10 + zb21; b21 = zb11 - zb20;
|
||||||
|
y[or0] = a00 + b00; y[oi0] = a01 + b01;
|
||||||
|
if(step) {
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step,_y+o1,a10 - b10,a11 - b11);
|
||||||
|
int step2 = step + step;
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step2,_y+o2,a20 + b20,a21 + b21);
|
||||||
|
int step3 = step2 + step;
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step3,_y+o3,a00 - b00,a01 - b01);
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step2+step2,_y+o4,a10 + b10,a11 + b11);
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step3+step2,_y+o5,a20 - b20,a21 - b21);
|
||||||
|
} else {
|
||||||
|
y[or1] = a10 - b10; y[oi1] = a11 - b11;
|
||||||
|
y[or2] = a20 + b20; y[oi2] = a21 + b21;
|
||||||
|
y[or3] = a00 - b00; y[oi3] = a01 - b01;
|
||||||
|
y[or4] = a10 + b10; y[oi4] = a11 + b11;
|
||||||
|
y[or5] = a20 - b20; y[oi5] = a21 - b21;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int istride, int ostride, int dir>
|
||||||
|
class __fft<istride,ostride,7,dir> {
|
||||||
|
public:
|
||||||
|
enum { N = istride*7,
|
||||||
|
i0 = 0, o0 = 0,
|
||||||
|
i1 = i0 + istride, o1 = o0 + ostride,
|
||||||
|
i2 = i1 + istride, o2 = o1 + ostride,
|
||||||
|
i3 = i2 + istride, o3 = o2 + ostride,
|
||||||
|
i4 = i3 + istride, o4 = o3 + ostride,
|
||||||
|
i5 = i4 + istride, o5 = o4 + ostride,
|
||||||
|
i6 = i5 + istride, o6 = o5 + ostride,
|
||||||
|
ir0 = i0<<1, ii0 = ir0 + 1, or0 = o0<<1, oi0 = or0 + 1,
|
||||||
|
ir1 = i1<<1, ii1 = ir1 + 1, or1 = o1<<1, oi1 = or1 + 1,
|
||||||
|
ir2 = i2<<1, ii2 = ir2 + 1, or2 = o2<<1, oi2 = or2 + 1,
|
||||||
|
ir3 = i3<<1, ii3 = ir3 + 1, or3 = o3<<1, oi3 = or3 + 1,
|
||||||
|
ir4 = i4<<1, ii4 = ir4 + 1, or4 = o4<<1, oi4 = or4 + 1,
|
||||||
|
ir5 = i5<<1, ii5 = ir5 + 1, or5 = o5<<1, oi5 = or5 + 1,
|
||||||
|
ir6 = i6<<1, ii6 = ir6 + 1, or6 = o6<<1, oi6 = or6 + 1 };
|
||||||
|
static inline void execute(t_fft *_x, t_fft *_y, int step) {
|
||||||
|
float *x = (float*)_x;
|
||||||
|
float *y = (float*)_y;
|
||||||
|
float u00, u01, u10, u11, u20, u21, u30, u31, u40, u41, u50, u51, u60, u61, u70, u71;
|
||||||
|
float b00, b01, b10, b11, b20, b21, b30, b31, b40, b41, b50, b51, b60, b61, b70, b71, b80, b81;
|
||||||
|
float T00, T01, T10, T11, T20, T21, T30, T31, T40, T41, T50, T51, T60, T61, T70, T71, T80, T81, T90, T91, T100, T101, T110, T111, T120, T121;
|
||||||
|
u00 = x[ir1] + x[ir6]; u01 = x[ii1] + x[ii6];
|
||||||
|
u10 = x[ir1] - x[ir6]; u11 = x[ii1] - x[ii6];
|
||||||
|
u20 = x[ir2] + x[ir5]; u21 = x[ii2] + x[ii5];
|
||||||
|
u30 = x[ir2] - x[ir5]; u31 = x[ii2] - x[ii5];
|
||||||
|
u40 = x[ir4] + x[ir3]; u41 = x[ii4] + x[ii3];
|
||||||
|
u50 = x[ir4] - x[ir3]; u51 = x[ii4] - x[ii3];
|
||||||
|
u60 = u20 + u00; u61 = u21 + u01;
|
||||||
|
u70 = u50 + u30; u71 = u51 + u31;
|
||||||
|
b00 = x[ir0] + u60 + u40; b01 = x[ii0] + u61 + u41;
|
||||||
|
b10 = -1.16666666666667f*(u60 + u40); b11 = -1.16666666666667f*(u61 + u41);
|
||||||
|
b20 = 0.79015646852540f*(u00 - u40); b21 = 0.79015646852540f*(u01 - u41);
|
||||||
|
b30 = 0.05585426728965f*(u40 - u20); b31 = 0.05585426728965f*(u41 - u21);
|
||||||
|
b40 = 0.73430220123575f*(u20 - u00); b41 = 0.73430220123575f*(u21 - u01);
|
||||||
|
if(dir==1) {
|
||||||
|
b50 = 0.44095855184410f*(u70 + u10);
|
||||||
|
b51 = 0.44095855184410f*(u71 + u11);
|
||||||
|
b60 = 0.34087293062393f*(u10 - u50);
|
||||||
|
b61 = 0.34087293062393f*(u11 - u51);
|
||||||
|
b70 = -0.53396936033773f*(u50 - u30);
|
||||||
|
b71 = -0.53396936033773f*(u51 - u31);
|
||||||
|
b80 = 0.87484229096166f*(u30 - u10);
|
||||||
|
b81 = 0.87484229096166f*(u31 - u11);
|
||||||
|
} else {
|
||||||
|
b50 = -0.44095855184410f*(u70 + u10);
|
||||||
|
b51 = -0.44095855184410f*(u71 + u11);
|
||||||
|
b60 = 0.34087293062393f*(u50 - u10);
|
||||||
|
b61 = 0.34087293062393f*(u51 - u11);
|
||||||
|
b70 = -0.53396936033773f*(u30 - u50);
|
||||||
|
b71 = -0.53396936033773f*(u31 - u51);
|
||||||
|
b80 = 0.87484229096166f*(u10 - u30);
|
||||||
|
b81 = 0.87484229096166f*(u11 - u31);
|
||||||
|
}
|
||||||
|
T00 = b00 + b10; T01 = b01 + b11;
|
||||||
|
T10 = b20 + b30; T11 = b21 + b31;
|
||||||
|
T20 = b40 - b30; T21 = b41 - b31;
|
||||||
|
T30 = -b20 - b40; T31 = -b21 - b41;
|
||||||
|
T40 = b60 + b70; T41 = b61 + b71;
|
||||||
|
T50 = b80 - b70; T51 = b81 - b71;
|
||||||
|
T60 = -b80 - b60; T61 = -b81 - b61;
|
||||||
|
T70 = T00 + T10; T71 = T01 + T11;
|
||||||
|
T80 = T00 + T20; T81 = T01 + T21;
|
||||||
|
T90 = T00 + T30; T91 = T01 + T31;
|
||||||
|
T100 = T40 + b50; T101 = T41 + b51;
|
||||||
|
T110 = T50 + b50; T111 = T51 + b51;
|
||||||
|
T120 = T60 + b50; T121 = T61 + b51;
|
||||||
|
y[or0] = b00; y[oi0] = b01;
|
||||||
|
if(step) {
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step,_y+o1,T70 + T101,T71 - T100);
|
||||||
|
int step2 = step + step;
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step2,_y+o2,T90 + T121,T91 - T120);
|
||||||
|
int step3 = step2 + step;
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step3,_y+o3,T80 - T111,T81 + T110);
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step2+step2,_y+o4,T80 + T111,T81 - T110);
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step3+step2,_y+o5,T90 - T121,T91 + T120);
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step3+step3,_y+o6,T70 - T101,T71 + T100);
|
||||||
|
} else {
|
||||||
|
y[or1] = T70 + T101; y[oi1] = T71 - T100;
|
||||||
|
y[or2] = T90 + T121; y[oi2] = T91 - T120;
|
||||||
|
y[or3] = T80 - T111; y[oi3] = T81 + T110;
|
||||||
|
y[or4] = T80 + T111; y[oi4] = T81 - T110;
|
||||||
|
y[or5] = T90 - T121; y[oi5] = T91 + T120;
|
||||||
|
y[or6] = T70 - T101; y[oi6] = T71 + T100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#if defined(ENABLE_SSE) && !defined(APPLE_PPC)
|
||||||
|
|
||||||
|
template <int N, int dir>
|
||||||
|
class SSETwiddles {
|
||||||
|
public:
|
||||||
|
simd_vector cs[N];
|
||||||
|
SSETwiddles() {
|
||||||
|
for(int k=0; k<N; k++) {
|
||||||
|
float c = cos(TWOPI * (float)k / (float)N);
|
||||||
|
float s = sin(TWOPI * (float)(-dir*k) / (float)N);
|
||||||
|
simd_vector v = {c,s,c,-s};
|
||||||
|
cs[k] = v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <int N, int dir>
|
||||||
|
class SSETwiddle {
|
||||||
|
public:
|
||||||
|
static const SSETwiddles<N,dir> t;
|
||||||
|
static const simd_vector *cs;
|
||||||
|
static inline simd_vector twiddle(int k, const simd_vector &v) {
|
||||||
|
return VMUL(cs[k],v);
|
||||||
|
}
|
||||||
|
static inline void twiddle(int k, t_fft *x, const simd_vector &v) {
|
||||||
|
simd_vector y = twiddle(k,v);
|
||||||
|
simd_vector z = VADD(SHUFFLE(y,y,0,1,0,1),SHUFFLE(y,y,3,2,3,2));
|
||||||
|
STOREL(z,x);
|
||||||
|
}
|
||||||
|
static inline void twiddle2(int k1, int k2, t_fft *x1, t_fft *x2, const simd_vector &y1, const simd_vector &y2) {
|
||||||
|
simd_vector v1 = VMUL(cs[k1],y1);
|
||||||
|
simd_vector v2 = VMUL(cs[k2],y2);
|
||||||
|
simd_vector z = VADD(SHUFFLE(v1,v2,0,1,0,1),SHUFFLE(v1,v2,3,2,3,2));
|
||||||
|
STOREL(z,x1);
|
||||||
|
STOREH(z,x2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <int N, int dir>
|
||||||
|
const SSETwiddles<N,dir> SSETwiddle<N,dir>::t;
|
||||||
|
|
||||||
|
template <int N, int dir>
|
||||||
|
const simd_vector* SSETwiddle<N,dir>::cs = t.cs;
|
||||||
|
|
||||||
|
template<int istride, int ostride, int dir>
|
||||||
|
class __fft<istride,ostride,4,dir> {
|
||||||
|
public:
|
||||||
|
enum { N = istride * 4,
|
||||||
|
ir0 = 0, or0 = 0,
|
||||||
|
_ir1 = ir0 + istride, or1 = or0 + ostride,
|
||||||
|
ir2 = _ir1 + istride, or2 = or1 + ostride,
|
||||||
|
_ir3 = ir2 + istride, or3 = or2 + ostride,
|
||||||
|
ir1 = (dir==1?_ir3:_ir1),
|
||||||
|
ir3 = (dir==1?_ir1:_ir3) };
|
||||||
|
static inline void execute(t_fft *x, t_fft *y, int step) {
|
||||||
|
simd_vector v1;
|
||||||
|
simd_vector v2;
|
||||||
|
simd_vector v3;
|
||||||
|
simd_vector v4;
|
||||||
|
simd_vector v5;
|
||||||
|
v1 = LOADH(LOADL(v1,x+ir0),x+ir1);
|
||||||
|
v2 = LOADH(LOADL(v2,x+ir2),x+ir3);
|
||||||
|
v3 = VADD(v1,v2);
|
||||||
|
v4 = VSUB(v1,v2);
|
||||||
|
v1 = SHUFFLE(v4,v3,0,1,0,1);
|
||||||
|
v2 = SHUFFLE(v4,v3,3,2,2,3);
|
||||||
|
v3 = VADD(v1,v2);
|
||||||
|
STOREH(v3,y+or0);
|
||||||
|
v4 = VSUB(v1,v2);
|
||||||
|
v1 = SHUFFLE(v4,v3,0,0,1,1);
|
||||||
|
v2 = SHUFFLE(v4,v4,2,2,3,3);
|
||||||
|
v5 = SHUFFLE(v3,v4,0,0,1,1);
|
||||||
|
if(step) {
|
||||||
|
v1 = SSETwiddle<N,dir>::twiddle(step,v1);
|
||||||
|
int step2 = step + step;
|
||||||
|
v2 = SSETwiddle<N,dir>::twiddle(step2,v2);
|
||||||
|
v3 = SSETwiddle<N,dir>::twiddle(step2+step,v5);
|
||||||
|
v3 = VADD(v3,SHUFFLE(v3,v3,3,2,1,0));
|
||||||
|
STOREL(v3,y+or3);
|
||||||
|
v5 = VADD(SHUFFLE(v1,v2,0,1,0,1),SHUFFLE(v1,v2,3,2,3,2));
|
||||||
|
STOREL(v5,y+or1);
|
||||||
|
STOREH(v5,y+or2);
|
||||||
|
} else {
|
||||||
|
v5 = SHUFFLE(v5,v5,0,2,0,2);
|
||||||
|
STOREL(v5,y+or3);
|
||||||
|
v3 = SHUFFLE(v1,v2,0,2,0,2);
|
||||||
|
STOREL(v3,y+or1);
|
||||||
|
STOREH(v3,y+or2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int istride, int ostride>
|
||||||
|
class __fft<istride,ostride,8,1> {
|
||||||
|
public:
|
||||||
|
enum { N = istride*8,
|
||||||
|
i0 = 0, o0 = 0,
|
||||||
|
i1 = i0 + istride, o1 = o0 + ostride,
|
||||||
|
i2 = i1 + istride, o2 = o1 + ostride,
|
||||||
|
i3 = i2 + istride, o3 = o2 + ostride,
|
||||||
|
i4 = i3 + istride, o4 = o3 + ostride,
|
||||||
|
i5 = i4 + istride, o5 = o4 + ostride,
|
||||||
|
i6 = i5 + istride, o6 = o5 + ostride,
|
||||||
|
i7 = i6 + istride, o7 = o6 + ostride };
|
||||||
|
static inline void execute(t_fft *x, t_fft *y, int step) {
|
||||||
|
simd_vector v1,v2,v3,v4,v5,v6,v7,v8;
|
||||||
|
simd_vector x02,x37,x15,x17,x53,x46;
|
||||||
|
simd_vector w1, w2, w3, w4;
|
||||||
|
w1 = LOADH(LOADL(w1,x+i0),x+i6);
|
||||||
|
w2 = LOADH(LOADL(w2,x+i4),x+i2);
|
||||||
|
w3 = VADD(w1,w2);
|
||||||
|
w4 = VSUB(w1,w2);
|
||||||
|
v1 = LOADH(LOADL(v1,x+i1),x+i7);
|
||||||
|
v2 = LOADH(LOADL(v2,x+i5),x+i3);
|
||||||
|
v3 = VADD(v1,v2);
|
||||||
|
v4 = VSUB(v1,v2);
|
||||||
|
v5 = SHUFFLE(v3,v4,2,1,0,1); //(z10,z01,z20,z21)
|
||||||
|
v6 = SHUFFLE(v3,v4,0,3,3,2); //(z00,z11,z31,z30)
|
||||||
|
v7 = VADD(v5,v6); // (x1,y30,y11)
|
||||||
|
v8 = VSUB(v5,v6); // (x51,x50,y10,y31)
|
||||||
|
x15 = SHUFFLE(v7,v8,0,1,1,0); //(x1,x5)
|
||||||
|
v2 = SHUFFLE(v8,v8,3,3,3,2); //(-,-,y31,y10)
|
||||||
|
v3 = VADD(v7,v2);
|
||||||
|
v4 = VSUB(v7,v2);
|
||||||
|
v5 = SHUFFLE(v3,v4,2,3,2,3);
|
||||||
|
x37 = VMUL(SET(0.7071067811865475f),v5); //(-x71,x30,-x70,x31)
|
||||||
|
v5 = SHUFFLE(w3,w4,0,1,0,1); //(z00,z01,z20,z21)
|
||||||
|
v6 = SHUFFLE(w3,w4,2,3,3,2); //(z10,z11,z31,z30)
|
||||||
|
v7 = VADD(v5,v6); //(x0,y30,y11)
|
||||||
|
v8 = VSUB(v5,v6); //(x4,y10,y31)
|
||||||
|
v1 = SHUFFLE(v7,v8,0,1,0,1); //(x0,x4)
|
||||||
|
v2 = SHUFFLE(v8,v7,3,2,2,3); //(x61,x20,x60,x21)
|
||||||
|
x02 = VADD(v1,x15);
|
||||||
|
x46 = VSUB(v1,x15);
|
||||||
|
x17 = VADD(v2,x37);
|
||||||
|
x53 = VSUB(v2,x37);
|
||||||
|
STOREL(x02,y+o0);
|
||||||
|
if(step) {
|
||||||
|
simd_vector y1;
|
||||||
|
simd_vector y2;
|
||||||
|
int step2 = step + step;
|
||||||
|
y1 = SHUFFLE(x02,x02,2,2,3,3);
|
||||||
|
SSETwiddle<N,1>::twiddle(step2,y+o2,y1);
|
||||||
|
int step3 = step2 + step;
|
||||||
|
y1 = SHUFFLE(x53,x53,1,1,3,3);
|
||||||
|
y2 = SHUFFLE(x53,x53,2,2,0,0);
|
||||||
|
SSETwiddle<N,1>::twiddle2(step3+step2,step3,y+o5,y+o3,y1,y2);
|
||||||
|
int step4 = step2 + step2;
|
||||||
|
y1 = SHUFFLE(x46,x46,0,0,1,1);
|
||||||
|
y2 = SHUFFLE(x46,x46,2,2,3,3);
|
||||||
|
SSETwiddle<N,1>::twiddle2(step4,step3+step3,y+o4,y+o6,y1,y2);
|
||||||
|
y1 = SHUFFLE(x17,x17,1,1,3,3);
|
||||||
|
y2 = SHUFFLE(x17,x17,2,2,0,0);
|
||||||
|
SSETwiddle<N,1>::twiddle2(step,step4+step3,y+o1,y+o7,y1,y2);
|
||||||
|
} else {
|
||||||
|
simd_vector y1;
|
||||||
|
y1 = SHUFFLE(x02,x02,2,3,3,3);
|
||||||
|
STOREL(y1,y+o2);
|
||||||
|
y1 = SHUFFLE(x53,x53,1,3,2,0);
|
||||||
|
STOREL(y1,y+o5);
|
||||||
|
STOREH(y1,y+o3);
|
||||||
|
STOREL(x46,y+o4);
|
||||||
|
STOREH(x46,y+o6);
|
||||||
|
y1 = SHUFFLE(x17,x17,1,3,2,0);
|
||||||
|
STOREL(y1,y+o1);
|
||||||
|
STOREH(y1,y+o7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int istride, int ostride>
|
||||||
|
class __fft<istride,ostride,8,-1> {
|
||||||
|
public:
|
||||||
|
enum { N = istride*8,
|
||||||
|
i0 = 0, o0 = 0,
|
||||||
|
i1 = i0 + istride, o1 = o0 + ostride,
|
||||||
|
i2 = i1 + istride, o2 = o1 + ostride,
|
||||||
|
i3 = i2 + istride, o3 = o2 + ostride,
|
||||||
|
i4 = i3 + istride, o4 = o3 + ostride,
|
||||||
|
i5 = i4 + istride, o5 = o4 + ostride,
|
||||||
|
i6 = i5 + istride, o6 = o5 + ostride,
|
||||||
|
i7 = i6 + istride, o7 = o6 + ostride };
|
||||||
|
static inline void execute(t_fft *x, t_fft *y, int step) {
|
||||||
|
simd_vector v1,v2,v3,v4,v5,v6,v7,v8;
|
||||||
|
simd_vector x02,x37,x15,x17,x53,x46;
|
||||||
|
simd_vector w1, w2, w3, w4;
|
||||||
|
w1 = LOADH(LOADL(w1,x+i0),x+i2);
|
||||||
|
w2 = LOADH(LOADL(w2,x+i4),x+i6);
|
||||||
|
w3 = VADD(w1,w2);
|
||||||
|
w4 = VSUB(w1,w2);
|
||||||
|
v1 = LOADH(LOADL(v1,x+i1),x+i3);
|
||||||
|
v2 = LOADH(LOADL(v2,x+i5),x+i7);
|
||||||
|
v3 = VADD(v1,v2);
|
||||||
|
v4 = VSUB(v1,v2);
|
||||||
|
v5 = SHUFFLE(v3,v4,0,3,0,1);
|
||||||
|
v6 = SHUFFLE(v3,v4,2,1,3,2);
|
||||||
|
v7 = VADD(v5,v6);
|
||||||
|
v8 = VSUB(v5,v6);
|
||||||
|
x15 = SHUFFLE(v7,v8,0,1,1,0);
|
||||||
|
v2 = SHUFFLE(v8,v8,3,3,3,2);
|
||||||
|
v3 = VADD(v7,v2);
|
||||||
|
v4 = VSUB(v2,v7);
|
||||||
|
v5 = SHUFFLE(v4,v3,2,3,2,3);
|
||||||
|
x37 = VMUL(SET(0.7071067811865475f),v5);
|
||||||
|
v5 = SHUFFLE(w3,w4,0,1,0,1);
|
||||||
|
v6 = SHUFFLE(w3,w4,2,3,3,2);
|
||||||
|
v7 = VADD(v5,v6);
|
||||||
|
v8 = VSUB(v5,v6);
|
||||||
|
v1 = SHUFFLE(v7,v8,0,1,0,1);
|
||||||
|
v2 = SHUFFLE(v8,v7,3,2,2,3);
|
||||||
|
x02 = VADD(v1,x15);
|
||||||
|
x46 = VSUB(v1,x15);
|
||||||
|
x17 = VADD(v2,x37);
|
||||||
|
x53 = VSUB(v2,x37);
|
||||||
|
STOREL(x02,y+o0);
|
||||||
|
if(step) {
|
||||||
|
simd_vector y1;
|
||||||
|
simd_vector y2;
|
||||||
|
int step2 = step + step;
|
||||||
|
y1 = SHUFFLE(x02,x02,2,2,3,3);
|
||||||
|
SSETwiddle<N,-1>::twiddle(step2,y+o2,y1);
|
||||||
|
int step3 = step2 + step;
|
||||||
|
y1 = SHUFFLE(x53,x53,1,1,3,3);
|
||||||
|
y2 = SHUFFLE(x53,x53,2,2,0,0);
|
||||||
|
SSETwiddle<N,-1>::twiddle2(step3+step2,step3,y+o5,y+o3,y1,y2);
|
||||||
|
int step4 = step2 + step2;
|
||||||
|
y1 = SHUFFLE(x46,x46,0,0,1,1);
|
||||||
|
y2 = SHUFFLE(x46,x46,2,2,3,3);
|
||||||
|
SSETwiddle<N,-1>::twiddle2(step4,step3+step3,y+o4,y+o6,y1,y2);
|
||||||
|
y1 = SHUFFLE(x17,x17,1,1,3,3);
|
||||||
|
y2 = SHUFFLE(x17,x17,2,2,0,0);
|
||||||
|
SSETwiddle<N,-1>::twiddle2(step,step4+step3,y+o1,y+o7,y1,y2);
|
||||||
|
} else {
|
||||||
|
simd_vector y1;
|
||||||
|
y1 = SHUFFLE(x02,x02,2,3,3,3);
|
||||||
|
STOREL(y1,y+o2);
|
||||||
|
y1 = SHUFFLE(x53,x53,1,3,2,0);
|
||||||
|
STOREL(y1,y+o5);
|
||||||
|
STOREH(y1,y+o3);
|
||||||
|
STOREL(x46,y+o4);
|
||||||
|
STOREH(x46,y+o6);
|
||||||
|
y1 = SHUFFLE(x17,x17,1,3,2,0);
|
||||||
|
STOREL(y1,y+o1);
|
||||||
|
STOREH(y1,y+o7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#else // !ENABLE_SSE
|
||||||
|
|
||||||
|
template<int istride, int ostride, int dir>
|
||||||
|
class __fft<istride,ostride,4,dir> {
|
||||||
|
public:
|
||||||
|
enum { N = istride*4,
|
||||||
|
i0 = 0, o0 = 0,
|
||||||
|
i1_ = i0 + istride, o1 = o0 + ostride,
|
||||||
|
i2 = i1_ + istride, o2 = o1 + ostride,
|
||||||
|
i3_ = i2 + istride, o3 = o2 + ostride,
|
||||||
|
i1 = (dir==1?i1_:i3_),
|
||||||
|
i3 = (dir==1?i3_:i1_),
|
||||||
|
ir0 = i0<<1, ii0 = ir0 + 1, or0 = o0<<1, oi0 = or0 + 1,
|
||||||
|
ir1 = i1<<1, ii1 = ir1 + 1, or1 = o1<<1, oi1 = or1 + 1,
|
||||||
|
ir2 = i2<<1, ii2 = ir2 + 1, or2 = o2<<1, oi2 = or2 + 1,
|
||||||
|
ir3 = i3<<1, ii3 = ir3 + 1, or3 = o3<<1, oi3 = or3 + 1 };
|
||||||
|
static inline void execute(t_fft *_x, t_fft *_y, int step) {
|
||||||
|
float *x = (float*)_x;
|
||||||
|
float *y = (float*)_y;
|
||||||
|
float z00, z01, z10, z11, z20, z21, z30, z31;
|
||||||
|
z20 = x[ir0] - x[ir2]; z21 = x[ii0] - x[ii2];
|
||||||
|
z00 = x[ir0] + x[ir2]; z01 = x[ii0] + x[ii2];
|
||||||
|
z10 = x[ir1] + x[ir3]; z11 = x[ii1] + x[ii3];
|
||||||
|
y[or0] = z00 + z10; y[oi0] = z01 + z11;
|
||||||
|
z30 = x[ir3] - x[ir1]; z31 = x[ii3] - x[ii1];
|
||||||
|
if(step) {
|
||||||
|
int step2 = step + step;
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step,_y+o1,z20 - z31,z21 + z30);
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step2,_y+o2,z00 - z10,z01 - z11);
|
||||||
|
FloatTwiddle<N,dir>::twiddle(step2+step,_y+o3,z20 + z31,z21 - z30);
|
||||||
|
} else {
|
||||||
|
y[or1] = z20 - z31; y[oi1] = z21 + z30;
|
||||||
|
y[or2] = z00 - z10; y[oi2] = z01 - z11;
|
||||||
|
y[or3] = z20 + z31; y[oi3] = z21 - z30;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int istride, int ostride>
|
||||||
|
class __fft<istride,ostride,8,1> {
|
||||||
|
public:
|
||||||
|
enum { N = istride*8,
|
||||||
|
i0 = 0, o0 = 0,
|
||||||
|
i1 = i0 + istride, o1 = o0 + ostride,
|
||||||
|
i2 = i1 + istride, o2 = o1 + ostride,
|
||||||
|
i3 = i2 + istride, o3 = o2 + ostride,
|
||||||
|
i4 = i3 + istride, o4 = o3 + ostride,
|
||||||
|
i5 = i4 + istride, o5 = o4 + ostride,
|
||||||
|
i6 = i5 + istride, o6 = o5 + ostride,
|
||||||
|
i7 = i6 + istride, o7 = o6 + ostride,
|
||||||
|
ir0 = i0<<1, ii0 = ir0 + 1, or0 = o0<<1, oi0 = or0 + 1,
|
||||||
|
ir1 = i1<<1, ii1 = ir1 + 1, or1 = o1<<1, oi1 = or1 + 1,
|
||||||
|
ir2 = i2<<1, ii2 = ir2 + 1, or2 = o2<<1, oi2 = or2 + 1,
|
||||||
|
ir3 = i3<<1, ii3 = ir3 + 1, or3 = o3<<1, oi3 = or3 + 1,
|
||||||
|
ir4 = i4<<1, ii4 = ir4 + 1, or4 = o4<<1, oi4 = or4 + 1,
|
||||||
|
ir5 = i5<<1, ii5 = ir5 + 1, or5 = o5<<1, oi5 = or5 + 1,
|
||||||
|
ir6 = i6<<1, ii6 = ir6 + 1, or6 = o6<<1, oi6 = or6 + 1,
|
||||||
|
ir7 = i7<<1, ii7 = ir7 + 1, or7 = o7<<1, oi7 = or7 + 1 };
|
||||||
|
static inline void execute(t_fft *_x, t_fft *_y, int step) {
|
||||||
|
float *x = (float*)_x;
|
||||||
|
float *y = (float*)_y;
|
||||||
|
float z00, z01, z10, z11, z20, z21, z30, z31, y10, y11, y30, y31;
|
||||||
|
float yr0, yi0, yr1, yi1, yr2, yi2, yr3, yi3, yr4, yi4, yr5, yi5, yr6, yi6, yr7, yi7;
|
||||||
|
z00 = x[ir1] + x[ir5]; z01 = x[ii1] + x[ii5];
|
||||||
|
z10 = x[ir7] + x[ir3]; z11 = x[ii7] + x[ii3];
|
||||||
|
z20 = x[ir1] - x[ir5]; z21 = x[ii1] - x[ii5];
|
||||||
|
z30 = x[ir7] - x[ir3]; z31 = x[ii7] - x[ii3];
|
||||||
|
y10 = z20 - z31; y11 = z21 + z30;
|
||||||
|
y30 = z20 + z31; y31 = z21 - z30;
|
||||||
|
yr1 = z00 + z10; yi1 = z01 + z11;
|
||||||
|
yr5 = z01 - z11; yi5 = z10 - z00;
|
||||||
|
yr3 = 0.7071067811865475f * (y10 + y11); yi3 = 0.7071067811865475f * (y11 - y10);
|
||||||
|
yr7 = 0.7071067811865475f * (y31 - y30); yi7 = -0.7071067811865475f * (y30 + y31);
|
||||||
|
z20 = x[ir0] - x[ir4]; z21 = x[ii0] - x[ii4];
|
||||||
|
z00 = x[ir0] + x[ir4]; z01 = x[ii0] + x[ii4];
|
||||||
|
z10 = x[ir6] + x[ir2]; z11 = x[ii6] + x[ii2];
|
||||||
|
z30 = x[ir6] - x[ir2]; z31 = x[ii6] - x[ii2];
|
||||||
|
yr0 = z00 + z10; yi0 = z01 + z11;
|
||||||
|
yr4 = z00 - z10; yi4 = z01 - z11;
|
||||||
|
yr2 = z20 - z31; yi2 = z21 + z30;
|
||||||
|
yr6 = z20 + z31; yi6 = z21 - z30;
|
||||||
|
y[or0] = yr0 + yr1; y[oi0] = yi0 + yi1;
|
||||||
|
if(step) {
|
||||||
|
FloatTwiddle<N,1>::twiddle(step,_y+o1,yr2 + yr3, yi2 + yi3);
|
||||||
|
int step2 = step + step;
|
||||||
|
FloatTwiddle<N,1>::twiddle(step2,_y+o2,yr4 + yr5, yi4 + yi5);
|
||||||
|
int step3 = step2 + step;
|
||||||
|
FloatTwiddle<N,1>::twiddle(step3,_y+o3,yr6 + yr7, yi6 + yi7);
|
||||||
|
FloatTwiddle<N,1>::twiddle(step2+step2,_y+o4,yr0 - yr1, yi0 - yi1);
|
||||||
|
FloatTwiddle<N,1>::twiddle(step3+step2,_y+o5,yr2 - yr3, yi2 - yi3);
|
||||||
|
FloatTwiddle<N,1>::twiddle(step3+step3,_y+o6,yr4 - yr5, yi4 - yi5);
|
||||||
|
FloatTwiddle<N,1>::twiddle(step3+step2+step2,_y+o7,yr6 - yr7, yi6 - yi7);
|
||||||
|
} else {
|
||||||
|
y[or1] = yr2 + yr3; y[oi1] = yi2 + yi3;
|
||||||
|
y[or2] = yr4 + yr5; y[oi2] = yi4 + yi5;
|
||||||
|
y[or3] = yr6 + yr7; y[oi3] = yi6 + yi7;
|
||||||
|
y[or4] = yr0 - yr1; y[oi4] = yi0 - yi1;
|
||||||
|
y[or5] = yr2 - yr3; y[oi5] = yi2 - yi3;
|
||||||
|
y[or6] = yr4 - yr5; y[oi6] = yi4 - yi5;
|
||||||
|
y[or7] = yr6 - yr7; y[oi7] = yi6 - yi7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int istride, int ostride>
|
||||||
|
class __fft<istride,ostride,8,-1> {
|
||||||
|
public:
|
||||||
|
enum { N = istride*8,
|
||||||
|
i0 = 0, o0 = 0,
|
||||||
|
i1 = i0 + istride, o1 = o0 + ostride,
|
||||||
|
i2 = i1 + istride, o2 = o1 + ostride,
|
||||||
|
i3 = i2 + istride, o3 = o2 + ostride,
|
||||||
|
i4 = i3 + istride, o4 = o3 + ostride,
|
||||||
|
i5 = i4 + istride, o5 = o4 + ostride,
|
||||||
|
i6 = i5 + istride, o6 = o5 + ostride,
|
||||||
|
i7 = i6 + istride, o7 = o6 + ostride,
|
||||||
|
ir0 = i0<<1, ii0 = ir0 + 1, or0 = o0<<1, oi0 = or0 + 1,
|
||||||
|
ir1 = i1<<1, ii1 = ir1 + 1, or1 = o1<<1, oi1 = or1 + 1,
|
||||||
|
ir2 = i2<<1, ii2 = ir2 + 1, or2 = o2<<1, oi2 = or2 + 1,
|
||||||
|
ir3 = i3<<1, ii3 = ir3 + 1, or3 = o3<<1, oi3 = or3 + 1,
|
||||||
|
ir4 = i4<<1, ii4 = ir4 + 1, or4 = o4<<1, oi4 = or4 + 1,
|
||||||
|
ir5 = i5<<1, ii5 = ir5 + 1, or5 = o5<<1, oi5 = or5 + 1,
|
||||||
|
ir6 = i6<<1, ii6 = ir6 + 1, or6 = o6<<1, oi6 = or6 + 1,
|
||||||
|
ir7 = i7<<1, ii7 = ir7 + 1, or7 = o7<<1, oi7 = or7 + 1 };
|
||||||
|
static inline void execute(t_fft *_x, t_fft *_y, int step) {
|
||||||
|
float *x = (float*)_x;
|
||||||
|
float *y = (float*)_y;
|
||||||
|
float z00, z01, z10, z11, z20, z21, z30, z31, y10, y11, y30, y31;
|
||||||
|
float yr0, yi0, yr1, yi1, yr2, yi2, yr3, yi3, yr4, yi4, yr5, yi5, yr6, yi6, yr7, yi7;
|
||||||
|
z00 = x[ir1] + x[ir5]; z01 = x[ii1] + x[ii5];
|
||||||
|
z10 = x[ir3] + x[ir7]; z11 = x[ii3] + x[ii7];
|
||||||
|
z20 = x[ir1] - x[ir5]; z21 = x[ii1] - x[ii5];
|
||||||
|
z30 = x[ir3] - x[ir7]; z31 = x[ii3] - x[ii7];
|
||||||
|
y10 = z20 - z31; y11 = z21 + z30;
|
||||||
|
y30 = z20 + z31; y31 = z21 - z30;
|
||||||
|
yr1 = z00 + z10; yi1 = z01 + z11;
|
||||||
|
yr5 = z11 - z01; yi5 = z00 - z10;
|
||||||
|
yr3 = 0.7071067811865475f * (y10 - y11); yi3 = 0.7071067811865475f * (y10 + y11);
|
||||||
|
yr7 = -0.7071067811865475f * (y30 + y31); yi7 = 0.7071067811865475f * (y30 - y31);
|
||||||
|
z00 = x[ir0] + x[ir4]; z01 = x[ii0] + x[ii4];
|
||||||
|
z10 = x[ir2] + x[ir6]; z11 = x[ii2] + x[ii6];
|
||||||
|
z20 = x[ir0] - x[ir4]; z21 = x[ii0] - x[ii4];
|
||||||
|
z30 = x[ir2] - x[ir6]; z31 = x[ii2] - x[ii6];
|
||||||
|
yr0 = z00 + z10; yi0 = z01 + z11;
|
||||||
|
yr4 = z00 - z10; yi4 = z01 - z11;
|
||||||
|
yr2 = z20 - z31; yi2 = z21 + z30;
|
||||||
|
yr6 = z20 + z31; yi6 = z21 - z30;
|
||||||
|
y[or0] = yr0 + yr1;
|
||||||
|
y[oi0] = yi0 + yi1;
|
||||||
|
if(step) {
|
||||||
|
FloatTwiddle<N,-1>::twiddle(step,_y+o1,yr2 + yr3, yi2 + yi3);
|
||||||
|
int step2 = step + step;
|
||||||
|
FloatTwiddle<N,-1>::twiddle(step2,_y+o2,yr4 + yr5, yi4 + yi5);
|
||||||
|
int step3 = step2 + step;
|
||||||
|
FloatTwiddle<N,-1>::twiddle(step3,_y+o3,yr6 + yr7, yi6 + yi7);
|
||||||
|
FloatTwiddle<N,-1>::twiddle(step2+step2,_y+o4,yr0 - yr1, yi0 - yi1);
|
||||||
|
FloatTwiddle<N,-1>::twiddle(step3+step2,_y+o5,yr2 - yr3, yi2 - yi3);
|
||||||
|
FloatTwiddle<N,-1>::twiddle(step3+step3,_y+o6,yr4 - yr5, yi4 - yi5);
|
||||||
|
FloatTwiddle<N,-1>::twiddle(step3+step2+step2,_y+o7,yr6 - yr7, yi6 - yi7);
|
||||||
|
} else {
|
||||||
|
y[or1] = yr2 + yr3; y[oi1] = yi2 + yi3;
|
||||||
|
y[or2] = yr4 + yr5; y[oi2] = yi4 + yi5;
|
||||||
|
y[or3] = yr6 + yr7; y[oi3] = yi6 + yi7;
|
||||||
|
y[or4] = yr0 - yr1; y[oi4] = yi0 - yi1;
|
||||||
|
y[or5] = yr2 - yr3; y[oi5] = yi2 - yi3;
|
||||||
|
y[or6] = yr4 - yr5; y[oi6] = yi4 - yi5;
|
||||||
|
y[or7] = yr6 - yr7; y[oi7] = yi6 - yi7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ENABLE_SSE
|
||||||
|
|
||||||
|
template<int k, int stride, int radix, int dir>
|
||||||
|
class _fft {
|
||||||
|
public:
|
||||||
|
enum { N = radix * stride,
|
||||||
|
_radix = Factor<stride>::value,
|
||||||
|
_stride = stride / _radix };
|
||||||
|
static inline void execute(t_fft *x) {
|
||||||
|
for(int step=0; step<stride; step++) {
|
||||||
|
__fft<stride,stride,radix,dir>::execute(x+step,x+step,step);
|
||||||
|
}
|
||||||
|
_fft<N,_stride,_radix,dir>::loop(x+N);
|
||||||
|
}
|
||||||
|
static inline void loop(t_fft *x) {
|
||||||
|
_fft<k-N,stride,radix,dir>::execute(x-N);
|
||||||
|
_fft<k-N,stride,radix,dir>::loop(x-N);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int stride, int radix, int dir>
|
||||||
|
class _fft<0,stride,radix,dir> {
|
||||||
|
public:
|
||||||
|
enum { N = radix * stride,
|
||||||
|
_radix = Factor<stride>::value,
|
||||||
|
_stride = stride / _radix };
|
||||||
|
static inline void execute(t_fft *x) {
|
||||||
|
for(int step=0; step<stride; step++) {
|
||||||
|
__fft<stride,stride,radix,dir>::execute(x+step,x+step,step);
|
||||||
|
}
|
||||||
|
_fft<N,_stride,_radix,dir>::loop(x+N);
|
||||||
|
}
|
||||||
|
static inline void loop(t_fft *x) { }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <int k, int radix, int dir>
|
||||||
|
class _fft<k,1,radix,dir> {
|
||||||
|
public:
|
||||||
|
static inline void execute(t_fft *x) { }
|
||||||
|
static inline void loop(t_fft *x) { }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <int radix, int dir>
|
||||||
|
class _fft<0,1,radix,dir> {
|
||||||
|
public:
|
||||||
|
static inline void execute(t_fft *x) { }
|
||||||
|
static inline void loop(t_fft *x) { }
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int N>
|
||||||
|
class fft_order_ {
|
||||||
|
public:
|
||||||
|
static inline int iterate(int k) {
|
||||||
|
static const int N2 = Factor<N>::value;
|
||||||
|
static const int N1 = N/Factor<N>::value;
|
||||||
|
return (k%N2)*N1 + fft_order_<N1>::iterate(k/N2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
class fft_order_<1> {
|
||||||
|
public:
|
||||||
|
static inline int iterate(int k0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int N>
|
||||||
|
class fft_order {
|
||||||
|
public:
|
||||||
|
fft_order<N>() {
|
||||||
|
for(int k=0;k<N;k++) {
|
||||||
|
int kr = fft_order_<N>::iterate(k);
|
||||||
|
order[kr] = k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int order[N];
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int N, int dir>
|
||||||
|
class fft_reorder {
|
||||||
|
public:
|
||||||
|
enum { radix = LastFactor<N>::value,
|
||||||
|
ostride = N / radix,
|
||||||
|
s = N * sizeof(t_fft) };
|
||||||
|
static const fft_order<N> order;
|
||||||
|
static inline void reorder(t_fft *x) {
|
||||||
|
t_fft y[N];
|
||||||
|
int *o = (int*)order.order;
|
||||||
|
memcpy(y,x,s);
|
||||||
|
for(int r=0; r<N; r+=radix) {
|
||||||
|
__fft<1,ostride,radix,dir>::execute(y+r,x+o[r],0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<int N, int dir>
|
||||||
|
const fft_order<N> fft_reorder<N,dir>::order;
|
||||||
|
|
||||||
|
template<int N, int dir>
|
||||||
|
void fft(t_fft *x) {
|
||||||
|
enum { radix = Factor<N>::value,
|
||||||
|
stride = N / radix };
|
||||||
|
_fft<0,stride,radix,dir>::execute(x);
|
||||||
|
fft_reorder<N,dir>::reorder(x);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -11,136 +11,132 @@ using namespace std;
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
map<int, map<real, real*> > wwMap;
|
GrainAllocator :: GrainAllocator(int N, int N2, int type)
|
||||||
map<int, map<real, audio*> > peakMap;
|
|
||||||
|
|
||||||
map<int, fftplan*> fftPlanMap;
|
|
||||||
map<int, fftplan*> ifftPlanMap;
|
|
||||||
|
|
||||||
grain* grain :: create(int N,real pad)
|
|
||||||
{
|
{
|
||||||
grain *g = new grain(N,pad);
|
this->N = N;
|
||||||
|
this->N2 = N2;
|
||||||
|
this->type = type;
|
||||||
|
|
||||||
|
switch(N) {
|
||||||
|
case 128:
|
||||||
|
fftPlan = &fft128;
|
||||||
|
ifftPlan = &ifft128;
|
||||||
|
break;
|
||||||
|
case 256:
|
||||||
|
fftPlan = &fft256;
|
||||||
|
ifftPlan = &ifft256;
|
||||||
|
break;
|
||||||
|
case 384:
|
||||||
|
fftPlan = &fft384;
|
||||||
|
//ifftPlan = &ifft384;
|
||||||
|
break;
|
||||||
|
case 512:
|
||||||
|
fftPlan = &fft512;
|
||||||
|
//ifftPlan = &ifft512;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
abort();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
int k1 = (N-N2)/2;
|
||||||
|
|
||||||
|
w = (float*)calloc(N,sizeof(float));
|
||||||
|
for(int k=0;k<N2;k++) {
|
||||||
|
if(type == hann) {
|
||||||
|
w[k+k1] = 0.5f*(1.0f - cos((float)k/(float)N2*TWOPI));
|
||||||
|
} else if(type == hannpoisson) {
|
||||||
|
w[k+k1] = 0.5f*(1.0f - cos((float)k/(float)N2*TWOPI)) * exp(-2.0f*fabs((float)(k-N2/2))/(float)N2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
W = (audio*) calloc(N,sizeof(audio));
|
||||||
|
for(int k=0;k<N;k++) {
|
||||||
|
W[k][0] = w[k] * 2.638502561913447f/(float)N2;
|
||||||
|
}
|
||||||
|
|
||||||
|
fftPlan(W);
|
||||||
|
}
|
||||||
|
|
||||||
|
GrainAllocator :: ~GrainAllocator()
|
||||||
|
{
|
||||||
|
free(w);
|
||||||
|
free(W);
|
||||||
|
}
|
||||||
|
|
||||||
|
grain* GrainAllocator :: create()
|
||||||
|
{
|
||||||
|
grain *g = new grain(N,N2);
|
||||||
|
g->refCount = 0;
|
||||||
|
g->fftPlan = fftPlan;
|
||||||
|
g->ifftPlan = ifftPlan;
|
||||||
|
g->w = w;
|
||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
void grain :: referenced(grain *g)
|
void GrainAllocator :: reference(grain *g)
|
||||||
{
|
{
|
||||||
g->refCount++;
|
g->refCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void grain :: forget(grain *g)
|
void GrainAllocator :: forget(grain *g)
|
||||||
{
|
{
|
||||||
g->refCount--;
|
g->refCount--;
|
||||||
if(g->refCount <= 0) {
|
if(g->refCount <= 0) {
|
||||||
destroy(g);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void grain :: destroy(grain *g)
|
|
||||||
{
|
|
||||||
free_audio_buf(g->x);
|
|
||||||
delete g;
|
delete g;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
grain :: grain(int N, real pad)
|
grain :: grain(int N, int N2)
|
||||||
{
|
{
|
||||||
this->N = N;
|
this->N = N;
|
||||||
this->pad = pad;
|
this->synthScale = 1.0f / (float)N2;
|
||||||
calc_plans();
|
x = (audio*) calloc(N,sizeof(audio));
|
||||||
calc_windows();
|
}
|
||||||
refCount = 0;
|
|
||||||
x = (audio*) malloc(N*sizeof(audio));
|
grain :: ~grain()
|
||||||
|
{
|
||||||
|
free(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
void grain :: analyze()
|
void grain :: analyze()
|
||||||
{
|
{
|
||||||
for(int k=0;k<N;k++) {
|
float *x = (float*)this->x;
|
||||||
for(int c=0;c<2;c++) {
|
float *end = x + (N<<1);
|
||||||
x[k][c] *= ww[k];
|
float *w = this->w;
|
||||||
|
while(x != end) {
|
||||||
|
*(x++) *= *w;
|
||||||
|
*(x++) *= *(w++);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
FFT(fftPlan,x);
|
fftPlan(this->x);
|
||||||
}
|
}
|
||||||
|
|
||||||
void grain :: synthesize()
|
void grain :: synthesize()
|
||||||
{
|
{
|
||||||
IFFT(ifftPlan,x);
|
ifftPlan(x);
|
||||||
real f = pad/(real)N;
|
|
||||||
for(int k=0;k<N;k++) {
|
for(int k=0;k<N;k++) {
|
||||||
for(int c=0;c<2;c++) {
|
for(int c=0;c<2;c++) {
|
||||||
x[k][c] *= ww[k] * f;
|
x[k][c] *= w[k] * synthScale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void grain :: calc_plans()
|
void grain :: downsample(grain *g2)
|
||||||
{
|
{
|
||||||
fftPlan = fftPlanMap[N];
|
|
||||||
if(fftPlan == NULL) {
|
|
||||||
fftPlanMap[N] = (fftPlan = planFFT(N));
|
|
||||||
}
|
|
||||||
|
|
||||||
ifftPlan = ifftPlanMap[N];
|
|
||||||
if(ifftPlan == NULL) {
|
|
||||||
ifftPlanMap[N] = (ifftPlan = planIFFT(N));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void grain :: calc_windows()
|
|
||||||
{
|
|
||||||
int N2 = round2int(N/pad);
|
|
||||||
ww = wwMap[N][pad];
|
|
||||||
if(ww == NULL) {
|
|
||||||
wwMap[N][pad] = (ww = (real*)calloc(N,sizeof(real)));
|
|
||||||
for(int k=0;k<N2;k++) {
|
|
||||||
ww[k+(N-N2)/2] = 0.5f*(1.0f - cos((real)k/(real)N2*TWOPI));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
peak = peakMap[N][pad];
|
|
||||||
if(peak == NULL) {
|
|
||||||
peakMap[N][pad] = (peak = (audio*) calloc(N,sizeof(audio)));
|
|
||||||
for(int k=0;k<N;k++) {
|
|
||||||
peak[k][0] = ww[k]/(real)(N2/2);
|
|
||||||
}
|
|
||||||
FFT(fftPlan,peak);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
grain* grain :: upsample()
|
|
||||||
{
|
|
||||||
grain *g2 = grain::create(2*N,pad);
|
|
||||||
grain *g = this;
|
grain *g = this;
|
||||||
|
|
||||||
|
int N2 = N/2;
|
||||||
|
int N4 = N/4;
|
||||||
for(int c=0;c<2;c++) {
|
for(int c=0;c<2;c++) {
|
||||||
for(int k=0;k<=N/2;k++)
|
for(int k=0;k<N4;k++) {
|
||||||
g2->x[k][c] = g->x[k][c];
|
g2->x[k][c] = 0.5f * g->x[k][c];
|
||||||
|
|
||||||
for(int k=N/2+1;k<=N/2+N;k++)
|
|
||||||
g2->x[k][c] = 0;
|
|
||||||
|
|
||||||
for(int k=N/2+N+1;k<2*N;k++)
|
|
||||||
g2->x[k][c] = g->x[k-N][c];
|
|
||||||
}
|
}
|
||||||
return g2;
|
g2->x[N4][c] = 0.25f * (g->x[N4][c] + g->x[N-N4][c]);
|
||||||
|
for(int k=N4+1;k<N2;k++) {
|
||||||
|
g2->x[k][c] = 0.5f * g->x[k+N2][c];
|
||||||
}
|
}
|
||||||
|
|
||||||
grain* grain :: downsample()
|
|
||||||
{
|
|
||||||
grain *g2 = grain::create(N/2,pad);
|
|
||||||
grain *g = this;
|
|
||||||
|
|
||||||
for(int c=0;c<2;c++) {
|
|
||||||
for(int k=0;k<=N/4-1;k++)
|
|
||||||
g2->x[k][c] = g->x[k][c];
|
|
||||||
|
|
||||||
g2->x[N/4][c] = 0.5f*(g->x[N/4][c] + g->x[N-N/4][c] );
|
|
||||||
|
|
||||||
for(int k=N/4+1;k<N/2;k++)
|
|
||||||
g2->x[k][c] = g->x[k+N/2][c];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return g2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,54 @@
|
||||||
|
// -*- mode: c++ -*-
|
||||||
#ifndef GRAIN_H
|
#ifndef GRAIN_H
|
||||||
#define GRAIN_H
|
#define GRAIN_H
|
||||||
|
|
||||||
#include "fft.h"
|
#include "fft.h"
|
||||||
#include "audio.h"
|
|
||||||
#include "sbsms.h"
|
#include "sbsms.h"
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
|
enum windowType {
|
||||||
|
hann,
|
||||||
|
hannpoisson
|
||||||
|
};
|
||||||
|
|
||||||
|
class GrainAllocator;
|
||||||
|
|
||||||
class grain {
|
class grain {
|
||||||
public:
|
public:
|
||||||
static grain* create(int N, real pad);
|
~grain();
|
||||||
static void destroy(grain *g);
|
|
||||||
static void referenced(grain *g);
|
|
||||||
static void forget(grain *g);
|
|
||||||
|
|
||||||
t_fft *x;
|
|
||||||
int N;
|
|
||||||
int h;
|
|
||||||
real pad;
|
|
||||||
int refCount;
|
|
||||||
audio *peak;
|
|
||||||
|
|
||||||
void analyze();
|
void analyze();
|
||||||
void synthesize();
|
void synthesize();
|
||||||
grain* upsample();
|
void downsample(grain *gdown);
|
||||||
grain* downsample();
|
audio *x;
|
||||||
|
friend class GrainAllocator;
|
||||||
protected:
|
protected:
|
||||||
grain(int N,real pad);
|
grain(int N, int N2);
|
||||||
void calc_plans();
|
float *w;
|
||||||
void calc_windows();
|
int N;
|
||||||
real *ww;
|
float synthScale;
|
||||||
fftplan *fftPlan, *ifftPlan;
|
int refCount;
|
||||||
|
fftplan fftPlan;
|
||||||
|
fftplan ifftPlan;
|
||||||
|
};
|
||||||
|
|
||||||
|
class GrainAllocator {
|
||||||
|
public:
|
||||||
|
GrainAllocator(int N, int N2, int type);
|
||||||
|
~GrainAllocator();
|
||||||
|
grain *create();
|
||||||
|
void reference(grain *g);
|
||||||
|
void forget(grain *g);
|
||||||
|
friend class grain;
|
||||||
|
friend class GrainBuf;
|
||||||
|
protected:
|
||||||
|
int N;
|
||||||
|
int N2;
|
||||||
|
int type;
|
||||||
|
float *w;
|
||||||
|
audio *W;
|
||||||
|
fftplan fftPlan;
|
||||||
|
fftplan ifftPlan;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// -*- mode: c++ -*-
|
||||||
/*
|
/*
|
||||||
** Copyright (C) 2001-2003 Erik de Castro Lopo <erikd@mega-nerd.com>
|
** Copyright (C) 2001-2003 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||||
**
|
**
|
||||||
|
@ -203,10 +204,4 @@
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SBSMS_REAL_FLOAT
|
|
||||||
#define round2int(x) lrintf(x)
|
|
||||||
#else
|
|
||||||
#define round2int(x) lrint(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -6,156 +6,192 @@
|
||||||
#include "real.h"
|
#include "real.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include "buffer.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
#define SBSMS_RESAMPLE_CHUNK_SIZE 8192L
|
enum { resampleChunkSize = 8192 };
|
||||||
|
|
||||||
Resampler :: Resampler(sbsms_resample_cb cb, void *data)
|
class ResamplerImp {
|
||||||
|
public:
|
||||||
|
ResamplerImp(SBSMSResampleCB func, void *data, SlideType slideType = SlideConstant);
|
||||||
|
~ResamplerImp();
|
||||||
|
inline long read(audio *audioOut, long frames);
|
||||||
|
inline void writingComplete();
|
||||||
|
inline void reset();
|
||||||
|
inline void init();
|
||||||
|
inline long samplesInOutput();
|
||||||
|
protected:
|
||||||
|
SBSMSFrame frame;
|
||||||
|
SampleCountType startAbs;
|
||||||
|
SampleCountType midAbs;
|
||||||
|
float midAbsf;
|
||||||
|
SampleCountType endAbs;
|
||||||
|
SampleCountType writePosAbs;
|
||||||
|
bool bInput;
|
||||||
|
SampleBuf *out;
|
||||||
|
SBSMSResampleCB cb;
|
||||||
|
void *data;
|
||||||
|
long inOffset;
|
||||||
|
SlideType slideType;
|
||||||
|
Slide *slide;
|
||||||
|
bool bWritingComplete;
|
||||||
|
};
|
||||||
|
|
||||||
|
Resampler :: Resampler(SBSMSResampleCB cb, void *data, SlideType slideType)
|
||||||
|
{
|
||||||
|
imp = new ResamplerImp(cb,data,slideType);
|
||||||
|
}
|
||||||
|
|
||||||
|
ResamplerImp :: ResamplerImp(SBSMSResampleCB cb, void *data, SlideType slideType)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
this->cb = cb;
|
this->cb = cb;
|
||||||
this->data = data;
|
this->data = data;
|
||||||
bPull = true;
|
|
||||||
bInput = true;
|
bInput = true;
|
||||||
|
this->slideType = slideType;
|
||||||
frame.size = 0;
|
frame.size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Resampler :: Resampler(SampleBuf *in, real ratio)
|
void ResamplerImp :: init()
|
||||||
{
|
|
||||||
init();
|
|
||||||
bPull = false;
|
|
||||||
this->in = in;
|
|
||||||
bInput = true;
|
|
||||||
frame.ratio0 = ratio;
|
|
||||||
frame.ratio1 = ratio;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Resampler :: init()
|
|
||||||
{
|
{
|
||||||
inOffset = 0;
|
inOffset = 0;
|
||||||
startAbs = 0;
|
startAbs = 0;
|
||||||
midAbs = 0;
|
midAbs = 0;
|
||||||
endAbs = 0;
|
endAbs = 0;
|
||||||
writePosAbs = 0;
|
writePosAbs = 0;
|
||||||
midAbsf = 0.0;
|
midAbsf = 0.0f;
|
||||||
out = new SampleBuf(0);
|
out = new SampleBuf(0);
|
||||||
|
slide = NULL;
|
||||||
bWritingComplete = false;
|
bWritingComplete = false;
|
||||||
sincZeros = SBSMS_SINC_SAMPLES;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Resampler :: reset()
|
void Resampler :: reset() { imp->reset(); }
|
||||||
|
void ResamplerImp :: reset()
|
||||||
{
|
{
|
||||||
|
if(slide) delete slide;
|
||||||
delete out;
|
delete out;
|
||||||
init();
|
init();
|
||||||
frame.size = 0;
|
frame.size = 0;
|
||||||
bInput = true;
|
bInput = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
long Resampler :: read(audio *audioOut, long samples)
|
Resampler :: ~Resampler() { delete imp; }
|
||||||
|
ResamplerImp :: ~ResamplerImp()
|
||||||
{
|
{
|
||||||
if(!bPull) {
|
if(slide) delete slide;
|
||||||
frame.in = in->getReadBuf();
|
delete out;
|
||||||
frame.size = in->n_readable();
|
|
||||||
if(frame.size) bInput = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
long nRead = out->n_readable();
|
void updateSlide(Slide *slide, float *f, float *scale, int *maxDist, float *ratio)
|
||||||
|
{
|
||||||
|
float stretch = slide->getStretch();
|
||||||
|
slide->step();
|
||||||
|
if(stretch <= 1.0f) {
|
||||||
|
*f = resampleSincRes;
|
||||||
|
*scale = stretch;
|
||||||
|
*maxDist = lrintf(resampleSincSamples);
|
||||||
|
} else {
|
||||||
|
*f = resampleSincRes / stretch;
|
||||||
|
*scale = 1.0f;
|
||||||
|
*maxDist = lrintf(resampleSincSamples * stretch);
|
||||||
|
}
|
||||||
|
*ratio = stretch;
|
||||||
|
}
|
||||||
|
|
||||||
|
long Resampler :: read(audio *audioOut, long samples) { return imp->read(audioOut,samples); }
|
||||||
|
long ResamplerImp :: read(audio *audioOut, long samples)
|
||||||
|
{
|
||||||
|
long nRead = out->nReadable();
|
||||||
while(nRead < samples && bInput) {
|
while(nRead < samples && bInput) {
|
||||||
if(bInput && inOffset == frame.size) {
|
if(bInput && inOffset == frame.size) {
|
||||||
if(!bPull) {
|
|
||||||
in->advance(frame.size);
|
|
||||||
bInput = false;
|
|
||||||
} else {
|
|
||||||
cb(data,&frame);
|
cb(data,&frame);
|
||||||
if(!frame.size)
|
if(frame.size) {
|
||||||
|
if(slide) delete slide;
|
||||||
|
slide = new Slide(slideType,1.0f/frame.ratio0,1.0f/frame.ratio1,frame.size);
|
||||||
|
} else {
|
||||||
bWritingComplete = true;
|
bWritingComplete = true;
|
||||||
}
|
}
|
||||||
if(bWritingComplete) {
|
if(bWritingComplete) {
|
||||||
bInput = false;
|
bInput = false;
|
||||||
out->grow(midAbs - writePosAbs);
|
long n = (long)(midAbs - writePosAbs);
|
||||||
out->writePos += midAbs - writePosAbs;
|
out->grow(n);
|
||||||
out->delay = 0;
|
out->writePos += n;
|
||||||
}
|
}
|
||||||
inOffset = 0;
|
inOffset = 0;
|
||||||
}
|
}
|
||||||
if(frame.size) {
|
if(frame.size) {
|
||||||
real dratio = 1.0f/(real)frame.size*(frame.ratio1-frame.ratio0);
|
if(slideType == SlideIdentity) {
|
||||||
|
out->write(frame.buf,frame.size);
|
||||||
real ratio = frame.ratio0 + (real)inOffset*dratio;
|
inOffset = frame.size;
|
||||||
real ratiorec = ratio<1.0f?1.0f:1.0f/ratio;
|
} else {
|
||||||
real f = ratiorec*SBSMS_SINC_RES;
|
bool bNoSinc = false;
|
||||||
int fi = round2int(f-0.5f);
|
if(fabs(frame.ratio0-1.0f) < 1e-6f &&
|
||||||
real ff = f - fi;
|
fabs((float)(frame.ratio1 - frame.ratio0)/(float)frame.size) < 1e-9f) {
|
||||||
|
bNoSinc = true;
|
||||||
|
}
|
||||||
|
float f;
|
||||||
|
float scale;
|
||||||
|
int maxDist;
|
||||||
|
float ratio;
|
||||||
|
updateSlide(slide,&f,&scale,&maxDist,&ratio);
|
||||||
|
int fi = lrintf(f);
|
||||||
|
float ff = f - fi;
|
||||||
if(ff<0.0f) {
|
if(ff<0.0f) {
|
||||||
ff += 1.0f;
|
ff += 1.0f;
|
||||||
fi--;
|
fi--;
|
||||||
}
|
}
|
||||||
real scale = ratio<1.0f?ratio:1.0f;
|
startAbs = max((SampleCountType)0,midAbs-maxDist);
|
||||||
int maxDist = round2int(sincZeros*ratio-0.5f);
|
long advance = max(0L,(long)(startAbs - maxDist - writePosAbs));
|
||||||
// absolute start position
|
|
||||||
startAbs = max((long)0,midAbs-maxDist);
|
|
||||||
// samples to advance
|
|
||||||
long advance = max((long)0,startAbs - maxDist - writePosAbs);
|
|
||||||
writePosAbs += advance;
|
writePosAbs += advance;
|
||||||
// absolute end position
|
|
||||||
endAbs = midAbs + maxDist;
|
endAbs = midAbs + maxDist;
|
||||||
// starting position in output
|
long start = (long)(startAbs - writePosAbs);
|
||||||
int start = startAbs - writePosAbs;
|
long mid = (long)(midAbs - writePosAbs);
|
||||||
assert(start>=0);
|
long end = (long)(endAbs - writePosAbs);
|
||||||
// zero point in output
|
|
||||||
int mid = midAbs - writePosAbs;
|
|
||||||
// ending position in output
|
|
||||||
int end = endAbs - writePosAbs;
|
|
||||||
// provide extra delay for variable rate ratio
|
|
||||||
out->delay = maxDist<<1;
|
|
||||||
out->writePos += advance;
|
out->writePos += advance;
|
||||||
|
if(bNoSinc) {
|
||||||
if(fabs(ratio-1.0f) < 1e-6f && fabs(dratio) < 1e-8f ) {
|
|
||||||
// how far ahead to write
|
|
||||||
int nAhead = mid+frame.size;
|
int nAhead = mid+frame.size;
|
||||||
out->N = nAhead;
|
out->N = nAhead;
|
||||||
out->grow(nAhead);
|
out->grow(nAhead);
|
||||||
long nWrite = min(SBSMS_RESAMPLE_CHUNK_SIZE,frame.size-inOffset);
|
long nWrite = min((long)resampleChunkSize,frame.size-inOffset);
|
||||||
for(int j=0;j<nWrite;j++) {
|
for(int j=0;j<nWrite;j++) {
|
||||||
out->buf[out->writePos+mid+j][0] += frame.in[j+inOffset][0];
|
out->buf[out->writePos+mid+j][0] += frame.buf[j+inOffset][0];
|
||||||
out->buf[out->writePos+mid+j][1] += frame.in[j+inOffset][1];
|
out->buf[out->writePos+mid+j][1] += frame.buf[j+inOffset][1];
|
||||||
}
|
}
|
||||||
inOffset += nWrite;
|
inOffset += nWrite;
|
||||||
midAbsf += ratio*nWrite;
|
midAbsf += nWrite;
|
||||||
int nWritten = round2int(midAbsf);
|
int nWritten = lrintf(midAbsf);
|
||||||
midAbsf -= nWritten;
|
midAbsf -= nWritten;
|
||||||
midAbs += nWritten;
|
midAbs += nWritten;
|
||||||
} else {
|
} else {
|
||||||
long nWrite = min(SBSMS_RESAMPLE_CHUNK_SIZE,frame.size-inOffset);
|
long nWrite = min((long)resampleChunkSize,frame.size-inOffset);
|
||||||
audio *i = &(frame.in[inOffset]);
|
audio *i = &(frame.buf[inOffset]);
|
||||||
for(int j=0;j<nWrite;j++) {
|
for(int j=0;j<nWrite;j++) {
|
||||||
// how far ahead to write
|
|
||||||
int nAhead = end;
|
int nAhead = end;
|
||||||
out->N = nAhead;
|
out->N = nAhead;
|
||||||
out->grow(nAhead);
|
out->grow(nAhead);
|
||||||
audio *o = &(out->buf[out->writePos+start]);
|
audio *o = &(out->buf[out->writePos+start]);
|
||||||
real d = (start-mid-midAbsf)*f;
|
float d = (start-mid-midAbsf)*f;
|
||||||
int di = round2int(d-0.5f);
|
int di = lrintf(d);
|
||||||
real df = d-di;
|
float df = d-di;
|
||||||
if(df<0.0f) {
|
if(df<0.0f) {
|
||||||
df += 1.0f;
|
df += 1.0f;
|
||||||
di--;
|
di--;
|
||||||
}
|
}
|
||||||
real i0 = (*i)[0];
|
float i0 = (*i)[0];
|
||||||
real i1 = (*i)[1];
|
float i1 = (*i)[1];
|
||||||
for(int k=start;k<end;k++) {
|
for(int k=start;k<end;k++) {
|
||||||
int k0 = (di<0)?-di:di;
|
int k0 = (di<0)?-di:di;
|
||||||
int k1 = (di<0)?k0-1:k0+1;
|
int k1 = (di<0)?k0-1:k0+1;
|
||||||
real sinc;
|
float sinc;
|
||||||
if(k1>=SBSMS_SINC_SIZE) {
|
if(k1>=resampleSincSize) {
|
||||||
if(k0>=SBSMS_SINC_SIZE) {
|
if(k0>=resampleSincSize) {
|
||||||
sinc = 0.0f;
|
sinc = 0.0f;
|
||||||
} else {
|
} else {
|
||||||
sinc = scale*sincTable[k0];
|
sinc = scale*sincTable[k0];
|
||||||
}
|
}
|
||||||
} else if(k0>=SBSMS_SINC_SIZE) {
|
} else if(k0>=resampleSincSize) {
|
||||||
sinc = scale*sincTable[k1];
|
sinc = scale*sincTable[k1];
|
||||||
} else {
|
} else {
|
||||||
sinc = scale*((1.0f-df)*sincTable[k0] + df*sincTable[k1]);
|
sinc = scale*((1.0f-df)*sincTable[k0] + df*sincTable[k1]);
|
||||||
|
@ -171,60 +207,43 @@ long Resampler :: read(audio *audioOut, long samples)
|
||||||
o++;
|
o++;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
midAbsf += ratio;
|
updateSlide(slide,&f,&scale,&maxDist,&ratio);
|
||||||
|
fi = lrintf(f);
|
||||||
if(dratio != 0.0f) {
|
|
||||||
ratio += dratio;
|
|
||||||
ratiorec = ratio<1.0f?1.0f:1.0f/ratio;
|
|
||||||
f = ratiorec*SBSMS_SINC_RES;
|
|
||||||
fi = round2int(f-0.5f);
|
|
||||||
ff = f - fi;
|
ff = f - fi;
|
||||||
if(ff<0.0f) {
|
if(ff<0.0f) {
|
||||||
ff += 1.0f;
|
ff += 1.0f;
|
||||||
fi--;
|
fi--;
|
||||||
}
|
}
|
||||||
scale = ratio<1.0f?ratio:1.0f;
|
midAbsf += ratio;
|
||||||
maxDist = round2int(sincZeros*ratio-0.5f);
|
int nWritten = lrintf(midAbsf);
|
||||||
}
|
|
||||||
|
|
||||||
int nWritten = round2int(midAbsf);
|
|
||||||
midAbsf -= nWritten;
|
midAbsf -= nWritten;
|
||||||
midAbs += nWritten;
|
midAbs += nWritten;
|
||||||
startAbs = max((long)0,midAbs-maxDist);
|
startAbs = max((SampleCountType)0,midAbs-maxDist);
|
||||||
endAbs = midAbs + maxDist;
|
endAbs = midAbs + maxDist;
|
||||||
start = startAbs - writePosAbs;
|
start = (long)(startAbs - writePosAbs);
|
||||||
mid = midAbs - writePosAbs;
|
mid = (long)(midAbs - writePosAbs);
|
||||||
end = endAbs - writePosAbs;
|
end = (long)(endAbs - writePosAbs);
|
||||||
}
|
}
|
||||||
inOffset += nWrite;
|
inOffset += nWrite;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nRead = out->n_readable();
|
nRead = out->nReadable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
out->read(audioOut,samples);
|
||||||
|
return samples;
|
||||||
}
|
}
|
||||||
|
|
||||||
nRead = min(samples,out->n_readable());
|
long Resampler :: samplesInOutput() { return imp->samplesInOutput(); }
|
||||||
if(nRead) {
|
long ResamplerImp :: samplesInOutput()
|
||||||
out->read(audioOut,nRead);
|
|
||||||
out->advance(nRead);
|
|
||||||
}
|
|
||||||
|
|
||||||
return nRead;
|
|
||||||
}
|
|
||||||
|
|
||||||
long Resampler :: samplesInOutput()
|
|
||||||
{
|
{
|
||||||
long samplesFromBuffer = round2int(0.5f*(frame.ratio0+frame.ratio1)*(frame.size-inOffset));
|
long samplesFromBuffer = lrintf(0.5f*(frame.ratio0+frame.ratio1)*(frame.size-inOffset));
|
||||||
return out->writePos + midAbs - writePosAbs - out->readPos + samplesFromBuffer;
|
return (long)(out->writePos + (midAbs - writePosAbs) - out->readPos + samplesFromBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Resampler :: writingComplete()
|
void ResamplerImp :: writingComplete()
|
||||||
{
|
{
|
||||||
bWritingComplete = true;
|
bWritingComplete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Resampler :: ~Resampler()
|
|
||||||
{
|
|
||||||
delete out;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,18 +1,14 @@
|
||||||
#ifndef SBSMS_SINCCOEFFS_H
|
// -*- mode: c++ -*-
|
||||||
#define SBSMS_SINCCOEFFS_H
|
#ifndef SINCCOEFFS_H
|
||||||
|
#define SINCCOEFFS_H
|
||||||
|
|
||||||
#include "sbsms.h"
|
enum {
|
||||||
#define SBSMS_SINC_SIZE 5286
|
resampleSincSize = 5286,
|
||||||
#ifdef SBSMS_REAL_FLOAT
|
resampleSincRes = 128,
|
||||||
#define SBSMS_SINC_RES 128.0f
|
resampleSincSamples = 41 };
|
||||||
#define SBSMS_SINC_SAMPLES 41.0f
|
|
||||||
#else
|
|
||||||
#define SBSMS_SINC_RES 128.0
|
|
||||||
#define SBSMS_SINC_SAMPLES 41.0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
real sincTable[SBSMS_SINC_SIZE] =
|
float sincTable[resampleSincSize] =
|
||||||
{
|
{
|
||||||
0.920381425342433f,
|
0.920381425342433f,
|
||||||
0.920302993473145f,
|
0.920302993473145f,
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,141 +1,196 @@
|
||||||
|
// -*- mode: c++ -*-
|
||||||
#ifndef SMS_H
|
#ifndef SMS_H
|
||||||
#define SMS_H
|
#define SMS_H
|
||||||
|
|
||||||
#include "track.h"
|
|
||||||
#include "grain.h"
|
|
||||||
#include "buffer.h"
|
|
||||||
#include "peak.h"
|
|
||||||
#include "sbsms.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#ifdef MULTITHREADED
|
#ifdef MULTITHREADED
|
||||||
#include "pthread.h"
|
#include "pthread.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "sbsms.h"
|
||||||
|
#include "track.h"
|
||||||
|
#include "grain.h"
|
||||||
|
#include "buffer.h"
|
||||||
|
#include <queue>
|
||||||
#include <list>
|
#include <list>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
class renderer;
|
enum {
|
||||||
class sms : public SampleBufBase {
|
minTrial2Band = 1,
|
||||||
friend class renderer;
|
minTrial1Band = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
class SynthRenderer : public SBSMSRenderer, public SampleBufBase {
|
||||||
public:
|
public:
|
||||||
sms(int N, unsigned short M, unsigned short M_MAX, int res, int latency, real p, real q, real pad, int Nlo, int channels, TrackAllocator *ta, PeakAllocator *pa);
|
SynthRenderer(int channels, int h);
|
||||||
void reset();
|
~SynthRenderer();
|
||||||
void readTrackPointsFromFile(FILE *fp);
|
void startTime(int c, const TimeType &time, int n);
|
||||||
int writeTrackPointsToFile(FILE *fp);
|
void render(int c, SBSMSTrack *t);
|
||||||
void setH(unsigned short h);
|
void endTime(int c);
|
||||||
long addTrackPoints(grain *g0, grain *g1, grain *g2);
|
|
||||||
long assignTrackPoints(long offset, sms *hi, sms *lo, int c);
|
|
||||||
long startNewTracks(long offset, int c);
|
|
||||||
void markDuplicates(long offset, sms *hi, sms *lo, int c);
|
|
||||||
bool connectTrackPoints(trackpoint *tp0, trackpoint *tp1, sms *hi, sms *lo, real dtlo, int c);
|
|
||||||
bool adoptTrack(track *precursor, sms *lender, trackpoint *tp, real m, real dt, int c);
|
|
||||||
void synthTracks(real a, real f0, real f1);
|
|
||||||
void advanceTrackPoints(int c);
|
|
||||||
long nTrackPoints();
|
|
||||||
long read(audio *out, long n);
|
long read(audio *out, long n);
|
||||||
long n_readable();
|
|
||||||
void advance(long n);
|
|
||||||
void zeroPad(long n);
|
|
||||||
void addTrack(int c, track *t);
|
|
||||||
~sms();
|
|
||||||
|
|
||||||
|
|
||||||
bool bPhaseLock;
|
|
||||||
int res;
|
|
||||||
int N;
|
|
||||||
unsigned short M;
|
|
||||||
real m;
|
|
||||||
int Nover2;
|
|
||||||
RingBuffer<unsigned short> hSynth;
|
|
||||||
real h2cum;
|
|
||||||
long samplePos;
|
|
||||||
TrackPointListBuffer* trackPointListBuffer[2];
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef MULTITHREADED
|
|
||||||
pthread_mutex_t dataMutex;
|
|
||||||
pthread_mutex_t tplbMutex[2];
|
|
||||||
pthread_mutex_t bufferMutex;
|
|
||||||
pthread_mutex_t trackMutex[2];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
unsigned short encodeReal(real x, real min, real max);
|
|
||||||
float decodeReal(unsigned short x, real min, real max);
|
|
||||||
unsigned short encodeRealLog(real x);
|
|
||||||
float decodeRealLog(unsigned short x);
|
|
||||||
bool terminal;
|
|
||||||
void markDuplicatesLo(long offset, sms *lo, long offsetlo, int c);
|
|
||||||
long assignTrackPoints_(long offset, sms *hi, sms *lo, real dtlo, long offsetlo, int c);
|
|
||||||
void deleteTrackPoint(trackpoint *tp);
|
|
||||||
void adjustPeaks(list<peak*> &peaks,
|
|
||||||
real *mag0,
|
|
||||||
real *mag1,
|
|
||||||
real *mag2,
|
|
||||||
real *dec,
|
|
||||||
int peakWidth);
|
|
||||||
long assignTrackPoints(long offset, sms *hi, sms *lo, real dtlo, long offsetlo, int c);
|
|
||||||
bool contTrack(track *t, trackpoint *tp, int c);
|
|
||||||
void extractTrackPoints(grain *g, real *mag0, real *mag1, real *mag2, long currtime, TrackPointListBuffer *tplb, unsigned short h1, int c);
|
|
||||||
bool nearestTrackPoint(tplist *tpl, trackpoint *tp0, real m0, real m1, real dt, tplist::iterator *minpos, real *minFx, real maxMerit2, real maxDF2);
|
|
||||||
int prune(trackpoint *tp);
|
|
||||||
real merit(trackpoint *tp0, trackpoint *tp1, real m0, real m1, real dt, real dMCoeff, real *df, real maxDF2);
|
|
||||||
void calcmags(real *mag, grain *g, real q);
|
|
||||||
peak *makePeak(real *mag, real *mag2, int k);
|
|
||||||
|
|
||||||
TrackAllocator *ta;
|
|
||||||
PeakAllocator *pa;
|
|
||||||
char *pData;
|
|
||||||
int datasize;
|
|
||||||
int channels;
|
int channels;
|
||||||
real p,q;
|
float *synthBuf[2];
|
||||||
int peakWidth;
|
int synthBufLength[2];
|
||||||
int maxPrunes;
|
ArrayRingBuffer<float> *sines[2];
|
||||||
real peakThresh;
|
TimeType time[2];
|
||||||
real startThresh;
|
int n[2];
|
||||||
real maxMerit2;
|
#ifdef MULTITHREADED
|
||||||
real maxDF2;
|
pthread_mutex_t bufferMutex;
|
||||||
real dMCoeff;
|
#endif
|
||||||
real maxMerit2Match;
|
};
|
||||||
real maxDF2Match;
|
|
||||||
real dMCoeffMatch;
|
class SMS {
|
||||||
int minNpts;
|
public:
|
||||||
real maxdBIncr;
|
SMS(SMS *lo, int N, int band, int bandMax, int h, int res, int N0, int N1, int N2, int channels, audio *peak2);
|
||||||
real maxdBIncrStitch;
|
~SMS();
|
||||||
real maxFMatch;
|
void render(int c, list<SBSMSRenderer*> &renderers);
|
||||||
real minFMatch;
|
void add(grain *g0, grain *g1, grain *g2, int c);
|
||||||
|
void assignStart(long offset, int c);
|
||||||
|
void assignInit(long offset, int c);
|
||||||
|
void assignFind(long offset, int c);
|
||||||
|
bool assignConnect(long offset, int c, bool bLastDitch);
|
||||||
|
void start(long offset, int c);
|
||||||
|
void splitMerge(int c);
|
||||||
|
void mark(long offset, int c);
|
||||||
|
void advance(int c);
|
||||||
|
void trial2(int c);
|
||||||
|
void trial2Start(int c);
|
||||||
|
void trial2End(int c);
|
||||||
|
void adjust2();
|
||||||
|
void trial1(int c);
|
||||||
|
void trial1Start(int c);
|
||||||
|
void trial1End(int c);
|
||||||
|
void adjust1(float stretch, float pitch0, float pitch1);
|
||||||
|
void adjustInit(ArrayRingBuffer<float> **trialRingBuf,
|
||||||
|
GrainBuf *trialGrainBuf);
|
||||||
|
void adjust(GrainBuf *trialGrainBuf,
|
||||||
|
queue<float*> *magQueue,
|
||||||
|
int minCutSep,
|
||||||
|
float **_mag1,
|
||||||
|
float **_dmag1,
|
||||||
|
audio **x1,
|
||||||
|
const TimeType &time,
|
||||||
|
Slice **slice);
|
||||||
|
void prepad1(audio *buf, long n);
|
||||||
|
void prepad0(audio *buf, long n);
|
||||||
|
int getTrial2Latency();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void connect(TrackPoint *tp0, TrackPoint *tp1, int ilo, int c);
|
||||||
|
void mark(long offset, long offsetlo, int c);
|
||||||
|
TrackPoint *nearestForward(TrackPoint **begin, TrackPoint *tp0, float *minCost2, float maxCost2, float maxDF2, float dMCoeff2, float dNCoeff2 = 0.0f);
|
||||||
|
TrackPoint *nearestReverse(TrackPoint **begin, TrackPoint *tp0, float *minCost2, float maxCost2, float maxDF2, float dMCoeff2, float dNCoeff2 = 0.0f);
|
||||||
|
TrackPoint *nearestForward2(TrackPoint **begin, TrackPoint *tp0, float *minCost2, float maxCost2, float maxDF2, float dMCoeff2, float dNCoeff2 = 0.0f);
|
||||||
|
TrackPoint *nearestReverse2(TrackPoint **begin, TrackPoint *tp0, float *minCost2, float maxCost2, float maxDF2, float dMCoeff2, float dNCoeff2 = 0.0f);
|
||||||
|
float interp2(int k, int ko1, float kf);
|
||||||
|
float findExtremum(float *mag, float *mag2, int k, float *y);
|
||||||
|
void calcmags(float *mag, audio *x);
|
||||||
|
int findCut(float *dmag, int k, int maxK);
|
||||||
|
Track *createTrack(int c, TrackPoint *tp, const TimeType &time, bool bStitch);
|
||||||
|
void returnTrackIndex(int c, Track *t);
|
||||||
|
|
||||||
|
list<TrackPoint*> ended[2];
|
||||||
|
list<TrackPoint*> started[2];
|
||||||
|
int minTrackSize;
|
||||||
|
int peakWidth0;
|
||||||
|
int peakWidth1;
|
||||||
|
int peakWidth2;
|
||||||
|
int minCutSep1;
|
||||||
|
int minCutSep2;
|
||||||
|
int minK;
|
||||||
|
int maxK;
|
||||||
|
float peakThresh;
|
||||||
|
float maxCost2;
|
||||||
|
float maxDF;
|
||||||
|
float dMCoeff2;
|
||||||
|
float dNCoeff2;
|
||||||
|
float maxDFSplitMerge;
|
||||||
|
float maxCost2SplitMerge;
|
||||||
|
float dMCoeff2SplitMerge;
|
||||||
|
float maxCost2Match;
|
||||||
|
float maxDFMatch;
|
||||||
|
float dMCoeff2Match;
|
||||||
|
float maxCost2Stereo;
|
||||||
|
float maxDFStereo;
|
||||||
|
float dMCoeff2Stereo;
|
||||||
|
float maxFMatchM;
|
||||||
|
float minFMatchL;
|
||||||
|
float minFLo;
|
||||||
|
float maxFHi;
|
||||||
|
float minFMid;
|
||||||
|
float maxFMid;
|
||||||
int kStart;
|
int kStart;
|
||||||
int kEnd;
|
int kEnd;
|
||||||
real mNorm;
|
int kLo;
|
||||||
real minPeakTopRatio;
|
int kHi;
|
||||||
real localFavorRatio;
|
float mNorm;
|
||||||
real maxDecRatio;
|
float localFavorRatio;
|
||||||
|
queue<Slice*> adjust2SliceQueue[2];
|
||||||
list<track*> **trax;
|
queue<Slice*> adjust1SliceQueue[2];
|
||||||
long currtime;
|
RingBuffer<Slice*> sliceBuffer[2];
|
||||||
long assigntime[2];
|
Slice* sliceM0[2];
|
||||||
long marktime[2];
|
Slice* sliceL0[2];
|
||||||
long synthtime;
|
Slice* sliceH0[2];
|
||||||
|
Slice* sliceM1[2];
|
||||||
SampleBuf *sines2, *outMixer;
|
Slice* sliceL1[2];
|
||||||
grain* x0[2];
|
Slice* sliceM2[2];
|
||||||
grain* x1[2];
|
Slice* sliceH1[2];
|
||||||
grain* x2[2];
|
audio* x10[2];
|
||||||
|
audio* x11[2];
|
||||||
void c2evenodd(grain *g, grain *, grain *);
|
float* dmag1[2];
|
||||||
|
float* mag11[2];
|
||||||
real* dec;
|
audio* x00[2];
|
||||||
real* dec2;
|
audio* x01[2];
|
||||||
real* mag0[2];
|
float* dmag0[2];
|
||||||
real* mag1[2];
|
float* mag01[2];
|
||||||
real* mag2[2];
|
float *mag2[2];
|
||||||
real *peak1;
|
audio* x2[2];
|
||||||
bool bPeakSet;
|
float* dec2[2];
|
||||||
real sqrtmagmax;
|
float *peak20;
|
||||||
real magmax;
|
float *peak2N;
|
||||||
|
int N;
|
||||||
|
int Nover2;
|
||||||
|
SMS *lo;
|
||||||
|
SMS *hi;
|
||||||
|
queue<TrackIndexType> trackIndex[2];
|
||||||
|
queue<float*> mag1Queue[2];
|
||||||
|
queue<float*> mag0Queue[2];
|
||||||
|
float *trial2Buf[2];
|
||||||
|
ArrayRingBuffer<float> *trial2RingBuf[2];
|
||||||
|
GrainBuf *trial2GrainBuf;
|
||||||
|
float *trial1Buf[2];
|
||||||
|
ArrayRingBuffer<float> *trial1RingBuf[2];
|
||||||
|
GrainBuf *trial1GrainBuf;
|
||||||
|
list<Track*> assignTracks[2];
|
||||||
|
list<Track*> renderTracks[2];
|
||||||
|
TimeType addtime[2];
|
||||||
|
TimeType assigntime[2];
|
||||||
|
TimeType trial2time[2];
|
||||||
|
TimeType adjust2time;
|
||||||
|
TimeType trial1time[2];
|
||||||
|
TimeType adjust1time;
|
||||||
|
TimeType synthtime[2];
|
||||||
|
queue<int> nRender[2];
|
||||||
|
double h2cum;
|
||||||
|
int channels;
|
||||||
|
long res;
|
||||||
|
long resMask;
|
||||||
|
int h;
|
||||||
|
float M;
|
||||||
|
double h1;
|
||||||
|
int band;
|
||||||
|
#ifdef MULTITHREADED
|
||||||
|
pthread_mutex_t sliceMutex[2];
|
||||||
|
pthread_mutex_t magMutex[2];
|
||||||
|
pthread_mutex_t renderMutex[2];
|
||||||
|
pthread_mutex_t trial2Mutex[2];
|
||||||
|
pthread_mutex_t trial1Mutex[2];
|
||||||
|
pthread_mutex_t trackMutex[2];
|
||||||
|
#endif
|
||||||
|
bool bAssignDone[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,9 +1,9 @@
|
||||||
|
// -*- mode: c++ -*-
|
||||||
#ifndef SUBBAND_H
|
#ifndef SUBBAND_H
|
||||||
#define SUBBAND_H
|
#define SUBBAND_H
|
||||||
|
|
||||||
#include "real.h"
|
#include "real.h"
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
#include "audio.h"
|
|
||||||
#include "sms.h"
|
#include "sms.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -13,164 +13,172 @@
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
class renderer;
|
enum {
|
||||||
|
NDownSample = 256,
|
||||||
|
SDownSample = 4,
|
||||||
|
subBufSize = 512,
|
||||||
|
hSub = NDownSample/(2*SDownSample)
|
||||||
|
};
|
||||||
|
|
||||||
class subband {
|
class SubBand {
|
||||||
friend class renderer;
|
|
||||||
public:
|
public:
|
||||||
subband(subband *parent, unsigned short M, int channels, sbsms_quality *quality, int latency, bool bPreAnalysis, TrackAllocator *ta, PeakAllocator *pa);
|
SubBand(SubBand *parent, int band, int channels, SBSMSQuality *quality, bool bSynthesize);
|
||||||
~subband();
|
~SubBand();
|
||||||
|
|
||||||
long write(audio *buf, long n, real a, real ratio);
|
long write(audio *buf, long n, float stretch, float pitch);
|
||||||
void process();
|
long read(audio *buf, long n);
|
||||||
long read(audio *buf, real *ratio0, real *ratio1);
|
long getInputFrameSize();
|
||||||
long n_readable();
|
|
||||||
bool isframe_readable();
|
|
||||||
void writingComplete();
|
|
||||||
long readFromFile(FILE *fp, real a, real ratio);
|
|
||||||
long synth();
|
|
||||||
long getFramesWrittenToFile();
|
|
||||||
long writeToFile(FILE *fp);
|
|
||||||
void init();
|
|
||||||
void reset();
|
|
||||||
void seek(long framePos);
|
|
||||||
long getSamplesQueued();
|
|
||||||
long getFramesQueued();
|
|
||||||
long getFramesAtFront();
|
|
||||||
long getFramesAtBack();
|
|
||||||
long getLastInputFrameSize();
|
|
||||||
long getFramePos();
|
|
||||||
void write_(audio *buf, long n, real a, real ratio);
|
|
||||||
|
|
||||||
void writeFramePositionsToFile(FILE *fp);
|
bool writeInit();
|
||||||
long addInit(bool);
|
long analyzeInit(int,bool,long n=0);
|
||||||
void addTrackPoints();
|
long extractInit(int,bool);
|
||||||
long markInit(bool, int c);
|
long markInit(int,bool);
|
||||||
void markDuplicates(int c);
|
long assignInit(int,bool);
|
||||||
long assignInit(bool,int c);
|
long trial2Init(int,bool);
|
||||||
long assignTrackPoints(int c);
|
long adjust2Init(bool);
|
||||||
void startNewTracks(int c);
|
long trial1Init(int,bool);
|
||||||
void advanceTrackPoints(int c);
|
long adjust1Init(bool);
|
||||||
long synthInit(bool);
|
long renderInit(int,bool);
|
||||||
void synthTracks();
|
long writeFromFileInit(int,bool);
|
||||||
long readInit(bool);
|
long readInit();
|
||||||
long writeTracksToFile(FILE *fp);
|
|
||||||
void readTrackPointsFromFile(FILE *fp);
|
void analyze(int);
|
||||||
long writeTrackPointsToFile(FILE *fp);
|
void extract(int);
|
||||||
void stepAddFrame();
|
void mark(int);
|
||||||
void stepMarkFrame(int c);
|
void assign(int);
|
||||||
void stepAssignFrame(int c);
|
void trial2(int);
|
||||||
void stepSynthFrame();
|
void trial2Start(int);
|
||||||
|
void trial2Trial(int);
|
||||||
|
void trial2End(int);
|
||||||
|
void adjust2();
|
||||||
|
void trial1(int);
|
||||||
|
void trial1Start(int);
|
||||||
|
void trial1Trial(int);
|
||||||
|
void trial1End(int);
|
||||||
|
void adjust1();
|
||||||
|
void advance(int);
|
||||||
|
void render(int);
|
||||||
|
|
||||||
|
void assignStart(int c);
|
||||||
|
void assignInit(int c);
|
||||||
|
void assignFind(int c);
|
||||||
|
bool assignConnect(int c);
|
||||||
|
void assignStep(int c);
|
||||||
|
void splitMerge(int c);
|
||||||
|
void addRenderer(SBSMSRenderer *);
|
||||||
|
void removeRenderer(SBSMSRenderer *);
|
||||||
|
long renderSynchronous();
|
||||||
|
void renderComplete(const SampleCountType &samples);
|
||||||
|
void process(bool);
|
||||||
|
|
||||||
|
void stepAnalyzeFrame(int);
|
||||||
|
void stepExtractFrame(int);
|
||||||
|
void stepMarkFrame(int);
|
||||||
|
void stepAssignFrame(int);
|
||||||
|
void stepTrial2Frame(int);
|
||||||
|
void stepAdjust2Frame();
|
||||||
|
void stepTrial1Frame(int);
|
||||||
|
void stepAdjust1Frame();
|
||||||
|
void stepRenderFrame(int);
|
||||||
void stepReadFrame();
|
void stepReadFrame();
|
||||||
void readSubSamples();
|
|
||||||
void setA(real a);
|
|
||||||
void setAMod(real a);
|
|
||||||
void setAForH(real a);
|
|
||||||
void setH(real ratio);
|
|
||||||
void setF(real f);
|
|
||||||
void setFrameSize(int inputSize, real a, real ratio);
|
|
||||||
void setRatio(real ratio);
|
|
||||||
void setFramesInFile(long frames);
|
|
||||||
long zeroPad();
|
|
||||||
long zeroPad_();
|
|
||||||
|
|
||||||
long preAnalyze(audio *buf, long n, real a, real ratio);
|
|
||||||
void preAnalyzeComplete();
|
|
||||||
|
|
||||||
FILE *fp;
|
|
||||||
|
|
||||||
long getFramesAssigned();
|
|
||||||
long getFramesMarked();
|
|
||||||
|
|
||||||
bool isWriteReady();
|
|
||||||
bool isAddReady();
|
|
||||||
bool isMarkReady();
|
|
||||||
bool isAssignReady();
|
|
||||||
bool isSynthReady();
|
|
||||||
#ifdef MULTITHREADED
|
#ifdef MULTITHREADED
|
||||||
pthread_mutex_t dataMutex;
|
pthread_mutex_t dataMutex;
|
||||||
pthread_mutex_t bufferMutex;
|
pthread_mutex_t grainMutex[3];
|
||||||
#endif
|
#endif
|
||||||
|
friend class SBSMSImp;
|
||||||
long nLatency;
|
|
||||||
long nLatencyOriginal;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
long read(audio *buf, long n);
|
void resetNoRecurse();
|
||||||
void calculateA(long kstart, long kend);
|
|
||||||
real calculateOnset(grain *g1, grain *g2);
|
|
||||||
|
|
||||||
TrackAllocator *ta;
|
long getFramesAtFront(int);
|
||||||
PeakAllocator *pa;
|
void readSubSamples();
|
||||||
|
void setStretch(float stretch);
|
||||||
|
void setPitch(float pitch);
|
||||||
|
|
||||||
RingBuffer<real> aPreAnalysis;
|
int nMarkLatency;
|
||||||
RingBuffer<real> aMod;
|
int nAssignLatency;
|
||||||
RingBuffer<real> aSynth;
|
int nTrial2Latency;
|
||||||
RingBuffer<real> aForH;
|
int nAdjust2Latency;
|
||||||
RingBuffer<real> fSynth;
|
int nTrial1Latency;
|
||||||
RingBuffer<int> inputFrameSize;
|
int nAdjust1Latency;
|
||||||
|
int nRenderLatency;
|
||||||
|
int nWriteSlack;
|
||||||
|
int nExtractSlack;
|
||||||
|
int nAnalyzeSlack;
|
||||||
|
int nMarkSlack;
|
||||||
|
int nAssignSlack;
|
||||||
|
int nTrial2Slack;
|
||||||
|
int nAdjust2Slack;
|
||||||
|
int nTrial1Slack;
|
||||||
|
int nAdjust1Slack;
|
||||||
|
int nRenderSlack;
|
||||||
|
list<SBSMSRenderer*> renderers;
|
||||||
|
RingBuffer<float> stretchRender;
|
||||||
|
RingBuffer<float> pitchRender;
|
||||||
|
int inputFrameSize;
|
||||||
RingBuffer<int> outputFrameSize;
|
RingBuffer<int> outputFrameSize;
|
||||||
RingBuffer<real> frameRatio;
|
float totalSizef;
|
||||||
RingBuffer<int> frameBytes;
|
SBSMSQuality *quality;
|
||||||
RingBuffer<real> onset;
|
|
||||||
grain *gPrev;
|
|
||||||
|
|
||||||
real getOnset(long k);
|
|
||||||
int lastInputFrameSize;
|
|
||||||
int lastOutputFrameSize;
|
|
||||||
real samplesQueued;
|
|
||||||
real lastFrameA;
|
|
||||||
real lastFrameRatio;
|
|
||||||
real totalSizef;
|
|
||||||
bool bPreAnalyze;
|
|
||||||
sbsms_quality *quality;
|
|
||||||
int channels;
|
int channels;
|
||||||
int N;
|
int N;
|
||||||
int h;
|
int h;
|
||||||
unsigned short M;
|
int band;
|
||||||
int s;
|
long nReadFromOutputFrame;
|
||||||
int res;
|
long nToWriteForGrain;
|
||||||
int nGrainsPerFrame;
|
long res;
|
||||||
int resTotal;
|
long resMask;
|
||||||
long nDropped;
|
long nGrainsPerFrame;
|
||||||
long nToDrop;
|
long nToDrop0;
|
||||||
|
long nToDrop1;
|
||||||
|
long nToDrop2;
|
||||||
|
long nToPrepad1;
|
||||||
|
long nToPrepad0;
|
||||||
|
bool bSynthesize;
|
||||||
|
|
||||||
long nTrackPointsToAdd;
|
long nGrainsToAnalyze[3];
|
||||||
long nTrackPointsToMark[2];
|
long nGrainsToExtract[2];
|
||||||
long nTrackPointsToAssign[2];
|
long nGrainsToMark[2];
|
||||||
long nTrackPointsToAdvance[2];
|
long nGrainsToAssign[2];
|
||||||
long nTrackPointsToSynth;
|
long nGrainsToAdvance[2];
|
||||||
|
long nGrainsToTrial2[2];
|
||||||
|
long nGrainsToAdjust2;
|
||||||
|
long nGrainsToTrial1[2];
|
||||||
|
long nGrainsToAdjust1;
|
||||||
|
long nGrainsToRender[2];
|
||||||
|
long nGrainsWritten;
|
||||||
|
long nGrainsMarked[2];
|
||||||
|
long nGrainsAssigned[2];
|
||||||
|
long nGrainsTrialed2[2];
|
||||||
|
long nGrainsAdjusted2;
|
||||||
|
long nGrainsTrialed1[2];
|
||||||
|
long nGrainsAdjusted1;
|
||||||
|
long nGrainsAdvanced[2];
|
||||||
|
long nGrainsRendered[2];
|
||||||
|
long nGrainsRead;
|
||||||
|
|
||||||
long nTrackPointsMarked[2];
|
long nFramesAnalyzed[3];
|
||||||
long nTrackPointsAssigned[2];
|
long nFramesExtracted[2];
|
||||||
long nTrackPointsStarted[2];
|
|
||||||
long nTrackPointsAdvanced[2];
|
|
||||||
long nTrackPointsSynthed;
|
|
||||||
long nTrackPointsRead;
|
|
||||||
long nFramesSkipped;
|
|
||||||
long nFramesWritten;
|
|
||||||
long nFramesAdded;
|
|
||||||
long nFramesMarked[2];
|
long nFramesMarked[2];
|
||||||
long nFramesAssigned[2];
|
long nFramesAssigned[2];
|
||||||
|
long nFramesTrialed2[2];
|
||||||
|
long nFramesAdjusted2;
|
||||||
|
long nFramesTrialed1[2];
|
||||||
|
long nFramesAdjusted1;
|
||||||
|
long nFramesRendered[2];
|
||||||
long nFramesRead;
|
long nFramesRead;
|
||||||
long nFramesSynthed;
|
|
||||||
long nFramesInFile;
|
|
||||||
long nTrackPointsWritten;
|
|
||||||
|
|
||||||
bool bWritingComplete;
|
SubBand *parent;
|
||||||
subband *parent;
|
SubBand *sub;
|
||||||
subband *sub;
|
|
||||||
GrainBuf *in0,*in1,*in2;
|
|
||||||
SampleBufBase *outMixer;
|
SampleBufBase *outMixer;
|
||||||
sms *smser;
|
SynthRenderer *synthRenderer;
|
||||||
SampleBuf *subIn;
|
SMS *sms;
|
||||||
SampleBuf *subOut;
|
SampleBuf *samplesSubIn;
|
||||||
GrainBuf *in;
|
SampleBuf *samplesSubOut;
|
||||||
GrainBuf *inPre;
|
GrainBuf *grains[3];
|
||||||
|
GrainBuf *analyzedGrains[3][2];
|
||||||
grain *x1[2];
|
GrainBuf *grainsIn;
|
||||||
grain *x2[2];
|
GrainAllocator *downSampledGrainAllocator;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,309 +1,345 @@
|
||||||
#include "track.h"
|
#include "track.h"
|
||||||
#include <math.h>
|
|
||||||
#include "utils.h"
|
|
||||||
#include "real.h"
|
#include "real.h"
|
||||||
#include "sbsms.h"
|
#include "dBTable.h"
|
||||||
#include "sms.h"
|
#include "synthTable.h"
|
||||||
#include <vector>
|
#include "utils.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
#define SBSMS_TRACK_BLOCK 2048
|
Track :: Track(float h, TrackIndexType index, TrackPoint *p, const TimeType &time, bool bStitch)
|
||||||
|
|
||||||
TrackAllocator :: TrackAllocator(bool bManageIndex)
|
|
||||||
{
|
{
|
||||||
this-> bManageIndex = bManageIndex;
|
this->h = h;
|
||||||
}
|
jumpThresh = 1.0e-5f * h;
|
||||||
|
this->index = index;
|
||||||
TrackAllocator :: TrackAllocator(bool bManageIndex, unsigned short maxtrackindex)
|
bEnd = false;
|
||||||
{
|
bEnded = false;
|
||||||
this-> bManageIndex = bManageIndex;
|
bRender = false;
|
||||||
gTrack.resize(maxtrackindex);
|
bSplit = false;
|
||||||
init();
|
bMerge = false;
|
||||||
}
|
first = time;
|
||||||
|
start = time;
|
||||||
TrackAllocator :: ~TrackAllocator()
|
if(bStitch) {
|
||||||
{
|
this->bStitch = true;
|
||||||
}
|
|
||||||
|
|
||||||
void TrackAllocator :: init()
|
|
||||||
{
|
|
||||||
for(unsigned short k=0;k<gTrack.size();k++)
|
|
||||||
gTrack[k] = NULL;
|
|
||||||
while(!gTrackIndex.empty())
|
|
||||||
gTrackIndex.pop();
|
|
||||||
#ifdef MULTITHREADED
|
|
||||||
pthread_mutex_init(&taMutex,NULL);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
track *TrackAllocator :: getTrack(unsigned short index)
|
|
||||||
{
|
|
||||||
return gTrack[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
int TrackAllocator :: size()
|
|
||||||
{
|
|
||||||
return gTrack.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
track *TrackAllocator :: create(track *precursor, sms *owner, int res, unsigned short index)
|
|
||||||
{
|
|
||||||
track *t = new track(precursor,owner,res);
|
|
||||||
t->index = index;
|
|
||||||
gTrack[index] = t;
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
track *TrackAllocator :: create(track *precursor, sms *owner, int res)
|
|
||||||
{
|
|
||||||
#ifdef MULTITHREADED
|
|
||||||
pthread_mutex_lock(&taMutex);
|
|
||||||
#endif
|
|
||||||
if(gTrackIndex.empty()) {
|
|
||||||
unsigned short n = gTrack.size();
|
|
||||||
gTrack.resize(n+SBSMS_TRACK_BLOCK);
|
|
||||||
for(int k=n+SBSMS_TRACK_BLOCK-1;k>=n;k--) {
|
|
||||||
gTrackIndex.push(k);
|
|
||||||
gTrack[k] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unsigned short index = gTrackIndex.top();
|
|
||||||
gTrackIndex.pop();
|
|
||||||
#ifdef MULTITHREADED
|
|
||||||
pthread_mutex_unlock(&taMutex);
|
|
||||||
#endif
|
|
||||||
return create(precursor, owner, res, index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TrackAllocator :: destroy(track *t)
|
|
||||||
{
|
|
||||||
#ifdef MULTITHREADED
|
|
||||||
pthread_mutex_lock(&taMutex);
|
|
||||||
#endif
|
|
||||||
gTrack[t->index] = NULL;
|
|
||||||
if(bManageIndex)
|
|
||||||
gTrackIndex.push(t->index);
|
|
||||||
delete t;
|
|
||||||
#ifdef MULTITHREADED
|
|
||||||
pthread_mutex_unlock(&taMutex);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
track :: track(track *precursor, sms *owner, int res)
|
|
||||||
{
|
|
||||||
this->owner = owner;
|
|
||||||
this->res = res;
|
|
||||||
this->descendant = NULL;
|
|
||||||
this->precursor = precursor;
|
|
||||||
this->end = LONG_MAX;
|
|
||||||
this->rise = 0.3f;
|
|
||||||
this->fall = 0.5f;
|
|
||||||
tailEnd = 0;
|
|
||||||
tailStart = 0;
|
|
||||||
m_p = 0.0;
|
|
||||||
currtime = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void track :: endTrack(bool bTail)
|
|
||||||
{
|
|
||||||
end = back()->time;
|
|
||||||
if(bTail) {
|
|
||||||
this->fall = min(1.5f,.25f + back()->y / point[point.size()-2]->y);
|
|
||||||
tailEnd = 1;
|
|
||||||
end++;
|
|
||||||
trackpoint *f = new trackpoint(back());
|
|
||||||
f->time = back()->time + 1;
|
|
||||||
point.push_back(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void track :: synth(SampleBuf *out,
|
|
||||||
long writePos,
|
|
||||||
int c,
|
|
||||||
long synthtime,
|
|
||||||
int steps,
|
|
||||||
real fScale0,
|
|
||||||
real fScale1,
|
|
||||||
real mScale) {
|
|
||||||
if(point.size()==0) return;
|
|
||||||
long k = synthtime - start;
|
|
||||||
if(k>=(long)point.size()-1) return;
|
|
||||||
currtime = synthtime;
|
|
||||||
if(k<0) return;
|
|
||||||
int k1 = k + 1;
|
|
||||||
|
|
||||||
tpoint *tp0 = point[k];
|
|
||||||
tpoint *tp1 = point[k1];
|
|
||||||
|
|
||||||
real w0 = tp0->f;
|
|
||||||
real w1 = tp1->f;
|
|
||||||
real ph0 = tp0->ph;
|
|
||||||
real ph1 = tp1->ph;
|
|
||||||
real h = tp0->h;
|
|
||||||
|
|
||||||
real dp = ph1 - ph0;
|
|
||||||
if(dp>PI) dp-=TWOPI;
|
|
||||||
else if(dp<-PI) dp+=TWOPI;
|
|
||||||
real dp0 = 0.5f*h*(w0 + w1);
|
|
||||||
real dw = canon(dp - dp0)/h;
|
|
||||||
|
|
||||||
if(k==0) {
|
|
||||||
if(precursor) {
|
|
||||||
m_p = precursor->m_pDescendant;
|
|
||||||
} else {
|
} else {
|
||||||
|
this->bStitch = false;
|
||||||
|
if(start > 0) {
|
||||||
|
start--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
point.push_back(p);
|
||||||
|
p->owner = this;
|
||||||
|
p->refCount++;
|
||||||
|
end = time;
|
||||||
|
last = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
Track :: ~Track() {
|
||||||
|
for(vector<TrackPoint*>::iterator i = point.begin();
|
||||||
|
i != point.end();
|
||||||
|
++i) {
|
||||||
|
TrackPoint *tp = (*i);
|
||||||
|
if(tp) tp->destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TrackIndexType Track :: getIndex()
|
||||||
|
{
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Track :: isFirst(const TimeType &time)
|
||||||
|
{
|
||||||
|
return (time == first);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Track :: isLast(const TimeType &time)
|
||||||
|
{
|
||||||
|
return (time == last);
|
||||||
|
}
|
||||||
|
|
||||||
|
TimeType Track :: size()
|
||||||
|
{
|
||||||
|
return point.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
TrackPoint *Track :: back()
|
||||||
|
{
|
||||||
|
return point.back();
|
||||||
|
}
|
||||||
|
|
||||||
|
TrackPoint *Track :: getTrackPoint(const TimeType &time)
|
||||||
|
{
|
||||||
|
return point[time - first];
|
||||||
|
}
|
||||||
|
|
||||||
|
SBSMSTrackPoint *Track :: getSBSMSTrackPoint(const TimeType &time)
|
||||||
|
{
|
||||||
|
return getTrackPoint(time);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Track :: jump(TrackPoint *tp0, TrackPoint *tp1)
|
||||||
|
{
|
||||||
|
if(tp1->m > tp0->m) {
|
||||||
|
float cost = 1.0e-4f * dBApprox(tp0->m,tp1->m);
|
||||||
|
return (cost > jumpThresh);
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TrackPoint *Track :: updateFPH(const TimeType &time, int mode, int n, float f0, float f1)
|
||||||
|
{
|
||||||
|
if(time == start && time < first) {
|
||||||
|
TrackPoint *tp1 = getTrackPoint(time+1);
|
||||||
|
tp1->fSynth1 = max(0.0f,min(6.0f,f1 * tp1->f));
|
||||||
|
tp1->fSynth0 = tp1->fSynth1;
|
||||||
|
tp1->phSynth = tp1->ph;
|
||||||
|
if(mode == synthModeOutput && tp1->dupStereo) {
|
||||||
|
return tp1;
|
||||||
|
}
|
||||||
|
} else if(time == last) {
|
||||||
|
if(last < end) {
|
||||||
|
TrackPoint *tp0 = getTrackPoint(time);
|
||||||
|
tp0->fSynth0 = tp0->fSynth1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
TrackPoint *tp0 = getTrackPoint(time);
|
||||||
|
TrackPoint *tp1 = getTrackPoint(time+1);
|
||||||
|
|
||||||
|
if(mode == synthModeOutput) {
|
||||||
|
if(tp0->dupStereo && tp1->dupStereo && tp0->dupStereo->owner == tp1->dupStereo->owner) {
|
||||||
|
float dp = tp1->ph - tp0->ph;
|
||||||
|
float dp0 = 0.5f*h*(tp0->f + tp1->f);
|
||||||
|
float dw = canonPI(dp - dp0)/h;
|
||||||
|
float dpStereo = tp1->dupStereo->ph - tp0->dupStereo->ph;
|
||||||
|
float dp0Stereo = 0.5f*h*(tp0->dupStereo->f + tp1->dupStereo->f);
|
||||||
|
float dwStereo = canonPI(dpStereo - dp0Stereo)/h;
|
||||||
|
if(dw > .0013f * (tp0->f + tp1->f)) {
|
||||||
|
dw = 0;
|
||||||
|
dwStereo = 0;
|
||||||
|
} else if(dwStereo > .0013f * (tp0->dupStereo->f + tp1->dupStereo->f)) {
|
||||||
|
dwStereo = 0;
|
||||||
|
}
|
||||||
|
float w0 = 0.5f * (tp0->f + tp0->dupStereo->f + dw + dwStereo);
|
||||||
|
float w1 = 0.5f * (tp1->f + tp1->dupStereo->f + dw + dwStereo);
|
||||||
|
float dwSynth = 0.5f * canonPI(dp - dpStereo) / n;
|
||||||
|
if(!(bSplit && time == first)) {
|
||||||
|
tp0->fSynth0 = max(0.0f,min(6.0f,f0 * (w0 + dwSynth)));
|
||||||
|
}
|
||||||
|
if(!(bMerge && time + 1 == last)) {
|
||||||
|
tp1->fSynth1 = max(0.0f,min(6.0f,f1 * (w1 + dwSynth)));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
float dp = tp1->ph - tp0->ph;
|
||||||
|
float dp0 = 0.5f*h*(tp0->f + tp1->f);
|
||||||
|
float dw = canonPI(dp - dp0)/h;
|
||||||
|
if(dw > .0013f * (tp0->f + tp1->f)) {
|
||||||
dw = 0;
|
dw = 0;
|
||||||
}
|
}
|
||||||
|
if(!(bSplit && time == first)) {
|
||||||
|
tp0->fSynth0 = max(0.0f,min(6.0f,f0 * (tp0->f + dw)));
|
||||||
|
}
|
||||||
|
if(!(bMerge && time + 1 == last)) {
|
||||||
|
tp1->fSynth1 = max(0.0f,min(6.0f,f1 * (tp1->f + dw)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
real dt = (real)steps;
|
if(!(tp0->bSplit || tp0->bMerge || tp1->bSplit || tp1->bMerge) && jump(tp0,tp1)) {
|
||||||
w0 = (w0+dw);
|
tp1->bJump = true;
|
||||||
w1 = (w1+dw);
|
if(tp0->dupStereo && tp1->dupStereo) {
|
||||||
w0 = w0*fScale0;
|
if(tp0->dupStereo->owner == tp1->dupStereo->owner) {
|
||||||
w1 = w1*fScale1;
|
tp1->bSyncStereo = !jump(tp0->dupStereo,tp1->dupStereo);
|
||||||
dp = dt*0.5f*(w0 + w1);
|
}
|
||||||
real b = (w1 - w0)/(2.0f*dt);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool bEnd = (k1==(long)point.size()-1);
|
if(!tp0->bSplit) {
|
||||||
bool bStart = (k==0);
|
if(tp0->bJump) {
|
||||||
|
if(tp0->bSyncStereo) {
|
||||||
|
tp0->phSynth = canon2PI(tp0->dupStereo->phSynth + tp0->ph - tp0->dupStereo->ph);
|
||||||
|
} else {
|
||||||
|
tp0->phSynth = tp0->ph;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(bStart && tailStart) {
|
if(!(bMerge && time + 1 == last)) {
|
||||||
if(w0 < PI && w0 > -PI) {
|
float dw = (tp1->fSynth1 - tp0->fSynth0) / n;
|
||||||
real ph = m_p;
|
float w = tp0->fSynth0 + 0.5f * dw;
|
||||||
int rise = round2int(this->rise * (real)steps);
|
float iw = lrintf(w * WScale) / WScale;
|
||||||
real dm = mScale*tp1->y/(real)rise;
|
float idw = lrintf(dw * WScale) / WScale;
|
||||||
real m = mScale*tp1->y - dm;
|
tp1->phSynth = canon2PI(tp0->phSynth + n * iw + ((n * (n - 1)) >> 1) * idw);
|
||||||
for(int i=steps-1;i>=steps-rise+1;i--) {
|
|
||||||
ph -= w0;
|
|
||||||
if(ph<-PI) ph += TWOPI;
|
|
||||||
else if(ph>PI) ph -= TWOPI;
|
|
||||||
out->buf[writePos+i][c] += m * COS(ph);
|
|
||||||
m -= dm;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if(bEnd && tailEnd) {
|
|
||||||
if(w0 < PI && w0 > -PI) {
|
|
||||||
real ph = m_p;
|
|
||||||
int fall = round2int(this->fall * (real)steps);
|
|
||||||
real dm = mScale*tp0->y/(real)fall;
|
|
||||||
real m = mScale*tp0->y;
|
|
||||||
for(int i=0;i<fall;i++) {
|
|
||||||
out->buf[writePos+i][c] += m * COS(ph);
|
|
||||||
ph += w0;
|
|
||||||
if(ph<-PI) ph += TWOPI;
|
|
||||||
else if(ph>PI) ph -= TWOPI;
|
|
||||||
m -= dm;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
real m = mScale*tp0->y;
|
float dp = tp1->ph - tp0->ph;
|
||||||
real dm = mScale*(tp1->y0 - tp0->y)/dt;
|
float dp0 = 0.5f*h*(tp0->f + tp1->f);
|
||||||
real ph = m_p;
|
float dw = canonPI(dp - dp0)/h;
|
||||||
real b2tt1 = b;
|
if(dw > .0013f * (tp0->f + tp1->f)) {
|
||||||
real b2 = 2.0f*b;
|
dw = 0;
|
||||||
real dph;
|
|
||||||
|
|
||||||
audio *o = &(out->buf[writePos]);
|
|
||||||
for(int i=0;i<steps;i++) {
|
|
||||||
dph = w0 + b2tt1;
|
|
||||||
if(dph < PI && dph > -PI) (*o)[c] += m * COS(ph);
|
|
||||||
ph += dph;
|
|
||||||
if(ph<-PI) ph += TWOPI;
|
|
||||||
else if(ph>PI) ph -= TWOPI;
|
|
||||||
b2tt1 += b2;
|
|
||||||
m += dm;
|
|
||||||
o++;
|
|
||||||
}
|
}
|
||||||
|
if(!(bSplit && time == first)) {
|
||||||
|
tp0->fSynth0 = max(0.0f,min(6.0f,f0 * (tp0->f + dw)));
|
||||||
|
tp0->phSynth = tp0->ph;
|
||||||
|
}
|
||||||
|
if(!(bMerge && time + 1 == last)) {
|
||||||
|
tp1->fSynth1 = max(0.0f,min(6.0f,f1 * (tp1->f + dw)));
|
||||||
|
tp1->phSynth = tp1->ph;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bEnd) {
|
void Track :: updateM(const TimeType &time, int mode)
|
||||||
if(descendant && descendant->back()->M < tp0->M) {
|
|
||||||
m_pDescendant = canon(m_p + dp/dt*(real)(descendant->owner->samplePos - owner->samplePos));
|
|
||||||
}
|
|
||||||
} else if(bStart && tailStart) {
|
|
||||||
} else {
|
|
||||||
m_p = canon(m_p + dp);
|
|
||||||
if(descendant && descendant->back()->M > tp0->M && (k1+res==(long)point.size()-1)) {
|
|
||||||
m_pDescendant = canon(m_p + dp/dt*(real)(descendant->owner->samplePos - (owner->samplePos+steps)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool track :: isEnded()
|
|
||||||
{
|
{
|
||||||
return (end!=LONG_MAX);
|
if(mode == synthModeTrial2) {
|
||||||
|
if(time == first && time == start) {
|
||||||
|
TrackPoint *tp0 = getTrackPoint(time);
|
||||||
|
tp0->m = (tp0->m2>0.0f?sqrt(tp0->m2):0.0f);
|
||||||
|
}
|
||||||
|
if(time < last) {
|
||||||
|
TrackPoint *tp1 = getTrackPoint(time+1);
|
||||||
|
tp1->m = (tp1->m2>0.0f?sqrt(tp1->m2):0.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void track :: push_back_tpoint(tpoint *p)
|
void Track :: step(const TimeType &time)
|
||||||
{
|
{
|
||||||
point.push_back(p);
|
if(time > first && time < last) {
|
||||||
|
TrackPoint *tp = point[time-first];
|
||||||
|
tp->destroy();
|
||||||
|
point[time-first] = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void track :: push_back(trackpoint *p)
|
void Track :: push_back(TrackPoint *p)
|
||||||
{
|
{
|
||||||
point.push_back(p);
|
point.push_back(p);
|
||||||
p->owner = this;
|
p->owner = this;
|
||||||
|
p->refCount++;
|
||||||
|
last++;
|
||||||
|
end++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void track :: startTrack(trackpoint *p, bool bTail)
|
void Track :: endTrack(bool bStitch)
|
||||||
{
|
{
|
||||||
push_back(p);
|
if(bStitch) {
|
||||||
start = p->time;
|
this->bStitch = true;
|
||||||
m_pDescendant = p->ph;
|
} else {
|
||||||
if(bTail) {
|
end++;
|
||||||
tailStart = 1;
|
|
||||||
start--;
|
|
||||||
trackpoint *s = new trackpoint(p);
|
|
||||||
s->time = p->time - 1;
|
|
||||||
point.insert(point.begin(),s);
|
|
||||||
m_p = p->ph;
|
|
||||||
}
|
}
|
||||||
currtime = p->time-1;
|
bEnded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
trackpoint *track :: back()
|
void Track :: synth(float *out,
|
||||||
|
const TimeType &time,
|
||||||
|
int n,
|
||||||
|
int mode,
|
||||||
|
int c)
|
||||||
{
|
{
|
||||||
return (trackpoint*)point.back();
|
float m0, m1;
|
||||||
|
float w0, w1;
|
||||||
|
float dw;
|
||||||
|
float ph0, ph1;
|
||||||
|
bool bTailStart;
|
||||||
|
bool bTailEnd;
|
||||||
|
if(time >= end) return;
|
||||||
|
if(time < last) {
|
||||||
|
TrackPoint *tp1 = getTrackPoint(time+1);
|
||||||
|
w1 = tp1->fSynth1;
|
||||||
|
m1 = tp1->m;
|
||||||
|
ph1 = tp1->phSynth;
|
||||||
|
if(bMerge && time + 1 == last) {
|
||||||
|
m1 = 0.0f;
|
||||||
|
}
|
||||||
|
bTailStart = tp1->bJump;
|
||||||
|
bTailEnd = tp1->bJump;
|
||||||
|
} else {
|
||||||
|
bTailStart = false;
|
||||||
|
bTailEnd = (last != end);
|
||||||
|
}
|
||||||
|
if(time >= first) {
|
||||||
|
TrackPoint *tp0 = getTrackPoint(time);
|
||||||
|
w0 = tp0->fSynth0;
|
||||||
|
m0 = tp0->m;
|
||||||
|
ph0 = tp0->phSynth;
|
||||||
|
if(bSplit && time == first) {
|
||||||
|
m0 = 0.0f;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
bTailStart = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
trackpoint *track :: getTrackPoint(long time)
|
if(bTailEnd) {
|
||||||
{
|
int fall = min(n,w0==0.0f?384:min(384,(int)lrintf(PI * 4.0f / w0)));
|
||||||
long k = time-start;
|
float dm = m0 / (float)fall;
|
||||||
if(k<0 || k >= (long)point.size())
|
float w = w0;
|
||||||
return NULL;
|
float *out2 = out;
|
||||||
else
|
float *end = out + fall;
|
||||||
return (trackpoint*)point[k];
|
long iph = lrintf(ph0 * WScale);
|
||||||
|
if(iph>=W2PI) iph -= W2PI;
|
||||||
|
long iw = lrintf(w * WScale);
|
||||||
|
while(out2 != end) {
|
||||||
|
if(iw < WPI) {
|
||||||
|
long f = (iph>>PhShift)&Ph1;
|
||||||
|
long i = iph>>WShift;
|
||||||
|
*out2 += m0 * (float)(synthTable1[i] + f * synthTable2[i]);
|
||||||
|
}
|
||||||
|
out2++;
|
||||||
|
m0 -= dm;
|
||||||
|
iph += iw;
|
||||||
|
iph &= W2PIMask;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool track :: isStart(long synthtime)
|
if(bTailStart) {
|
||||||
{
|
int rise = min(n,w1==0.0f?384:min(384,(int)lrintf(PI * 3.0f / w1)));
|
||||||
return (synthtime == start);
|
float dm = m1 / (float)rise;
|
||||||
|
float w = w1;
|
||||||
|
out += n;
|
||||||
|
float *end = out-rise;
|
||||||
|
long iph = lrintf(ph1 * WScale);
|
||||||
|
iph &= W2PIMask;
|
||||||
|
long iw = lrintf(w * WScale);
|
||||||
|
while(out != end) {
|
||||||
|
out--;
|
||||||
|
m1 -= dm;
|
||||||
|
iph -= iw;
|
||||||
|
if(iph<0) iph += W2PI;
|
||||||
|
if(iw < WPI) {
|
||||||
|
long f = (iph>>PhShift)&Ph1;
|
||||||
|
long i = iph>>WShift;
|
||||||
|
*out += m1 * (float)(synthTable1[i] + f * synthTable2[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool track :: isEnd(long synthtime)
|
if(!(bTailStart || bTailEnd)) {
|
||||||
{
|
float dw = (w1 - w0) / n;
|
||||||
return (synthtime == end);
|
float w = w0 + 0.5f * dw;
|
||||||
}
|
float dm = (m1 - m0) / n;
|
||||||
|
long iph = lrintf(ph0 * WScale);
|
||||||
|
if(iph>=W2PI) iph -= W2PI;
|
||||||
|
long iw = lrintf(w * WScale);
|
||||||
|
long idw = lrintf(dw * WScale);
|
||||||
|
|
||||||
bool track :: isDone()
|
float *end = out + n;
|
||||||
{
|
while(out != end) {
|
||||||
return (currtime-start+1 >= (long)point.size()-1);
|
if(iw < WPI) {
|
||||||
|
long f = (iph>>PhShift)&Ph1;
|
||||||
|
long i = iph>>WShift;
|
||||||
|
*out += m0 * (float)(synthTable1[i] + f * synthTable2[i]);
|
||||||
}
|
}
|
||||||
|
iph += iw;
|
||||||
long track :: size()
|
iw += idw;
|
||||||
{
|
iph &= W2PIMask;
|
||||||
return 1+end-start-tailEnd-tailStart;
|
m0 += dm;
|
||||||
|
out++;
|
||||||
}
|
}
|
||||||
|
|
||||||
track :: ~track() {
|
|
||||||
if(precursor) precursor->descendant = NULL;
|
|
||||||
if(descendant) descendant->precursor = NULL;
|
|
||||||
for(vector<tpoint*>::iterator i = point.begin();
|
|
||||||
i != point.end();
|
|
||||||
i++) {
|
|
||||||
delete (*i);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,90 +1,81 @@
|
||||||
|
// -*- mode: c++ -*-
|
||||||
#ifndef TRACK_H
|
#ifndef TRACK_H
|
||||||
#define TRACK_H
|
#define TRACK_H
|
||||||
|
|
||||||
#include "buffer.h"
|
|
||||||
#include "trackpoint.h"
|
#include "trackpoint.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef MULTITHREADED
|
#ifdef MULTITHREADED
|
||||||
#include "pthread.h"
|
#include "pthread.h"
|
||||||
#endif
|
#endif
|
||||||
#include <stack>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
class sms;
|
enum {
|
||||||
class renderer;
|
trackIndexNone = 0
|
||||||
|
|
||||||
class track {
|
|
||||||
friend class renderer;
|
|
||||||
public:
|
|
||||||
void endTrack(bool bTail);
|
|
||||||
bool isEnded();
|
|
||||||
bool isDone();
|
|
||||||
void startTrack(trackpoint *p, bool bTail);
|
|
||||||
void push_back(trackpoint *p);
|
|
||||||
void push_back_tpoint(tpoint *p);
|
|
||||||
long size();
|
|
||||||
void synth(SampleBuf *out,
|
|
||||||
long writePos,
|
|
||||||
int c,
|
|
||||||
long synthtime,
|
|
||||||
int steps,
|
|
||||||
real fScale0,
|
|
||||||
real fScale1,
|
|
||||||
real mScale);
|
|
||||||
trackpoint *getTrackPoint(long time);
|
|
||||||
bool isStart(long synthtime);
|
|
||||||
bool isEnd(long synthtime);
|
|
||||||
trackpoint *back();
|
|
||||||
|
|
||||||
vector<tpoint*> point;
|
|
||||||
|
|
||||||
unsigned short index;
|
|
||||||
bool bEnd;
|
|
||||||
track *descendant;
|
|
||||||
track *precursor;
|
|
||||||
long tailEnd;
|
|
||||||
long tailStart;
|
|
||||||
long currtime;
|
|
||||||
real rise;
|
|
||||||
real fall;
|
|
||||||
long start;
|
|
||||||
long end;
|
|
||||||
real m_p;
|
|
||||||
real m_pDescendant;
|
|
||||||
int res;
|
|
||||||
sms *owner;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
friend class TrackAllocator;
|
|
||||||
track(track *precursor,sms *owner,int res);
|
|
||||||
~track();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class TrackAllocator {
|
#define PhShift 5
|
||||||
public:
|
#define WShift 21
|
||||||
TrackAllocator(bool bManageIndex);
|
#define Ph1 65535
|
||||||
TrackAllocator(bool bManageIndex, unsigned short maxtrackindex);
|
#define WPI 536870912
|
||||||
void init();
|
#define W2PI 1073741824
|
||||||
int size();
|
#define W2PIMask 1073741823
|
||||||
~TrackAllocator();
|
#define WScale 1.708913188941079e8f
|
||||||
|
#define MScale 4.656683928435187e-10f
|
||||||
|
|
||||||
track *getTrack(unsigned short index);
|
enum SynthMode {
|
||||||
track *create(track *precursor,sms *owner, int res, unsigned short index);
|
synthModeOutput = 0,
|
||||||
track *create(track *precursor,sms *owner, int res);
|
synthModeTrial2,
|
||||||
void destroy(track *t);
|
synthModeTrial1
|
||||||
|
};
|
||||||
|
|
||||||
|
class SMS;
|
||||||
|
|
||||||
|
class Track : public SBSMSTrack {
|
||||||
|
public:
|
||||||
|
Track(float h, TrackIndexType index, TrackPoint *p, const TimeType &time, bool bStitch);
|
||||||
|
~Track();
|
||||||
|
|
||||||
|
SBSMSTrackPoint *getSBSMSTrackPoint(const TimeType &time);
|
||||||
|
TrackIndexType getIndex();
|
||||||
|
bool isFirst(const TimeType &synthtime);
|
||||||
|
bool isLast(const TimeType &synthtime);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
#ifdef MULTITHREADED
|
void push_back(TrackPoint *p);
|
||||||
pthread_mutex_t taMutex;
|
TrackPoint *back();
|
||||||
#endif
|
void endTrack(bool bStitch);
|
||||||
long gIdCount;
|
TrackPoint *getTrackPoint(const TimeType &time);
|
||||||
stack<unsigned short> gTrackIndex;
|
TimeType size();
|
||||||
vector<track*> gTrack;
|
TrackPoint *updateFPH(const TimeType &time, int mode, int n, float f0, float f1);
|
||||||
bool bManageIndex;
|
void updateM(const TimeType &time, int mode);
|
||||||
|
void step(const TimeType &time);
|
||||||
|
void synth(float *out, const TimeType &synthtime, int n, int mode, int c);
|
||||||
|
bool jump(TrackPoint *tp0, TrackPoint *tp1);
|
||||||
|
|
||||||
|
friend class SMS;
|
||||||
|
friend class SynthRenderer;
|
||||||
|
friend class TrackPoint;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
vector<TrackPoint*> point;
|
||||||
|
float h;
|
||||||
|
float jumpThresh;
|
||||||
|
TrackIndexType index;
|
||||||
|
TimeType start;
|
||||||
|
TimeType first;
|
||||||
|
TimeType end;
|
||||||
|
TimeType last;
|
||||||
|
bool bEnd;
|
||||||
|
bool bEnded;
|
||||||
|
bool bRender;
|
||||||
|
bool bStitch;
|
||||||
|
bool bSplit;
|
||||||
|
bool bMerge;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,99 +1,170 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "real.h"
|
#include "real.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "track.h"
|
|
||||||
#include "trackpoint.h"
|
#include "trackpoint.h"
|
||||||
#include "grain.h"
|
#include "track.h"
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
trackpoint :: trackpoint(trackpoint *tp)
|
void TrackPoint :: destroy()
|
||||||
{
|
{
|
||||||
init();
|
refCount--;
|
||||||
f = tp->f;
|
if(refCount <= 0) {
|
||||||
y = tp->y;
|
delete this;
|
||||||
y0 = tp->y0;
|
}
|
||||||
h = tp->h;
|
|
||||||
M = tp->M;
|
|
||||||
ph = tp->ph;
|
|
||||||
owner = tp->owner;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trackpoint :: ~trackpoint()
|
TrackPoint :: TrackPoint(Slice *slice, float *peak, audio *gx, float *mag, float *mag2, int k, int N, int band)
|
||||||
{
|
{
|
||||||
|
refCount = 0;
|
||||||
for(int d=0;d<3;d++) {
|
for(int d=0;d<3;d++) {
|
||||||
if(dup[d]) {
|
|
||||||
dup[d]->dup[2-d] = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
trackpoint :: trackpoint(grain *g, real x, real y, int N, short M, short h, long time)
|
|
||||||
{
|
|
||||||
init();
|
|
||||||
real k = x;
|
|
||||||
int ki = round2int(k);
|
|
||||||
real kf = ki<k?k-ki:ki-k;
|
|
||||||
|
|
||||||
real norm0 = square(g->x[ki][0]) + square(g->x[ki][1]);
|
|
||||||
real ph0;
|
|
||||||
if(norm0 > 0.0f) {
|
|
||||||
ph0 = atan2(g->x[ki][1],g->x[ki][0]);
|
|
||||||
} else {
|
|
||||||
ph0 = 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ki1 = ki<k?ki+1:ki-1;
|
|
||||||
real norm1, ph1;
|
|
||||||
if(ki == N-1) {
|
|
||||||
norm1 = norm0;
|
|
||||||
ph1 = ph0;
|
|
||||||
} else {
|
|
||||||
norm1 = square(g->x[ki1][0]) + square(g->x[ki1][1]);
|
|
||||||
if(norm1 > 0.0f) {
|
|
||||||
ph1 = atan2(g->x[ki1][1],g->x[ki1][0]);
|
|
||||||
} else {
|
|
||||||
ph1 = 0.0f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
real ifreq = TWOPI*k/(real)N;
|
|
||||||
ph0 = ph0 + (real)ki*PI;
|
|
||||||
ph1 = ph1 + (real)ki1*PI;
|
|
||||||
if(kf < 0.5) {
|
|
||||||
real dp = canon(ph1 - ph0);
|
|
||||||
ph1 = ph0 + dp;
|
|
||||||
} else {
|
|
||||||
real dp = canon(ph0 - ph1);
|
|
||||||
ph0 = ph1 + dp;
|
|
||||||
}
|
|
||||||
real ph = ((1.0f-kf)*ph0 + kf*ph1);
|
|
||||||
|
|
||||||
this->time = time;
|
|
||||||
this->y = y;
|
|
||||||
this->y0 = y;
|
|
||||||
this->M = M;
|
|
||||||
this->h = h;
|
|
||||||
this->f = ifreq;
|
|
||||||
this->ph = canon(ph);
|
|
||||||
}
|
|
||||||
|
|
||||||
trackpoint :: trackpoint()
|
|
||||||
{
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
void trackpoint :: init()
|
|
||||||
{
|
|
||||||
for(int d=0;d<3;d++)
|
|
||||||
dup[d] = NULL;
|
dup[d] = NULL;
|
||||||
contF = 1e9;
|
}
|
||||||
cont = NULL;
|
dupStereo = NULL;
|
||||||
dupcont = NULL;
|
bJump = false;
|
||||||
|
y01 = 0.0f;
|
||||||
|
pp = NULL;
|
||||||
|
pn = NULL;
|
||||||
|
bSyncStereo = false;
|
||||||
bConnect = false;
|
bConnect = false;
|
||||||
bConnected = false;
|
bConnected = false;
|
||||||
bDelete = false;
|
bDelete = false;
|
||||||
|
bOwned = false;
|
||||||
|
bMarked = false;
|
||||||
|
bSplit = false;
|
||||||
|
bMerge = false;
|
||||||
owner = NULL;
|
owner = NULL;
|
||||||
|
this->slice = slice;
|
||||||
|
this->peak = peak;
|
||||||
|
float y0 = mag[k-1];
|
||||||
|
float y1 = mag[k];
|
||||||
|
float y2 = mag[k+1];
|
||||||
|
float d = (y0 + y2 - y1 - y1);
|
||||||
|
x = (d==0.0f?k:k + 0.5f * (y0 - y2) / d);
|
||||||
|
int ki = lrintf(x);
|
||||||
|
int ki1;
|
||||||
|
float kf;
|
||||||
|
if(ki<x) {
|
||||||
|
ki1 = ki + 1;
|
||||||
|
kf = x - ki;
|
||||||
|
} else {
|
||||||
|
ki1 = ki - 1;
|
||||||
|
kf = ki - x;
|
||||||
|
}
|
||||||
|
y = ((1.0f-kf)*mag2[ki] + kf*mag2[ki1]);
|
||||||
|
f = TWOPI*x/(float)(N*(1<<band));
|
||||||
|
float norm0 = square(gx[ki][0]) + square(gx[ki][1]);
|
||||||
|
float ph0;
|
||||||
|
if(norm0 > 0.0f) {
|
||||||
|
ph0 = atan2(gx[ki][1],gx[ki][0]);
|
||||||
|
} else {
|
||||||
|
ph0 = 0.0f;
|
||||||
|
}
|
||||||
|
float ph1;
|
||||||
|
float norm1 = square(gx[ki1][0]) + square(gx[ki1][1]);
|
||||||
|
if(norm1 > 0.0f) {
|
||||||
|
ph1 = atan2(gx[ki1][1],gx[ki1][0]);
|
||||||
|
} else {
|
||||||
|
ph1 = 0.0f;
|
||||||
|
}
|
||||||
|
ph0 += (float)(ki&1)*PI;
|
||||||
|
ph1 += (float)(ki1&1)*PI;
|
||||||
|
if(kf < 0.5f) {
|
||||||
|
ph1 = ph0 + canonPI(ph1 - ph0);
|
||||||
|
} else {
|
||||||
|
ph0 = ph1 + canonPI(ph0 - ph1);
|
||||||
|
}
|
||||||
|
ph = canon2PI((1.0f-kf)*ph0 + kf*ph1);
|
||||||
|
phSynth = ph;
|
||||||
|
}
|
||||||
|
|
||||||
|
TrackPoint :: ~TrackPoint()
|
||||||
|
{
|
||||||
|
for(int d=0;d<3;d++) {
|
||||||
|
if(dup[d]) {
|
||||||
|
m2 = 0.0f;
|
||||||
|
dup[d]->dup[2-d] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m2 = 0;
|
||||||
|
if(slice) slice->remove(this);
|
||||||
|
if(pp && pn) {
|
||||||
|
pp->pn = pn;
|
||||||
|
pn->pp = pp;
|
||||||
|
if(!(owner && owner->bRender)) {
|
||||||
|
if(pp->y * peak[lrintf(pp->x - x)] > pn->y * peak[lrintf(pn->x - x)]) {
|
||||||
|
pp->m2 += m2;
|
||||||
|
pp->xtn2 = xtn2;
|
||||||
|
pn->xtp2 = xtn2;
|
||||||
|
} else {
|
||||||
|
pn->m2 += m2;
|
||||||
|
pp->xtn2 = xtp2;
|
||||||
|
pn->xtp2 = xtp2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if(pp) {
|
||||||
|
pp->pn = NULL;
|
||||||
|
if(!(owner && owner->bRender)) {
|
||||||
|
if(y01 == 0.0f || y01 * peak[lrintf(x01 - x)] < pp->y * peak[lrintf(pp->x - x)]) {
|
||||||
|
pp->x01 = x01;
|
||||||
|
pp->y01 = y01;
|
||||||
|
pp->m2 += m2;
|
||||||
|
pp->xtn2 = xtn2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if(pn) {
|
||||||
|
pn->pp = NULL;
|
||||||
|
if(!(owner && owner->bRender)) {
|
||||||
|
if(y01 == 0.0f || y01 * peak[lrintf(x01 - x)] < pn->y * peak[lrintf(pn->x - x)]) {
|
||||||
|
pn->x01 = x01;
|
||||||
|
pn->y01 = y01;
|
||||||
|
pn->m2 += m2;
|
||||||
|
pn->xtp2 = xtp2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float TrackPoint :: getF()
|
||||||
|
{
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
float TrackPoint :: getM()
|
||||||
|
{
|
||||||
|
return y;
|
||||||
|
}
|
||||||
|
|
||||||
|
float TrackPoint :: getPhase()
|
||||||
|
{
|
||||||
|
return ph;
|
||||||
|
}
|
||||||
|
|
||||||
|
Slice :: Slice(int band, const TimeType &time)
|
||||||
|
{
|
||||||
|
this->band = band;
|
||||||
|
this->time = time;
|
||||||
|
bottom = NULL;
|
||||||
|
top = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Slice :: remove(TrackPoint *tp)
|
||||||
|
{
|
||||||
|
if(tp == top) {
|
||||||
|
top = top->pp;
|
||||||
|
}
|
||||||
|
if(tp == bottom) {
|
||||||
|
bottom = bottom->pn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Slice :: ~Slice()
|
||||||
|
{
|
||||||
|
for(TrackPoint *tp = bottom;
|
||||||
|
tp;
|
||||||
|
tp = tp->pn) {
|
||||||
|
tp->slice = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,46 +1,77 @@
|
||||||
|
// -*- mode: c++ -*-
|
||||||
#ifndef TRACKPOINT_H
|
#ifndef TRACKPOINT_H
|
||||||
#define TRACKPOINT_H
|
#define TRACKPOINT_H
|
||||||
|
|
||||||
#include "grain.h"
|
|
||||||
#include "sbsms.h"
|
#include "sbsms.h"
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
class track;
|
enum { TrackPointNoCont = 65535 };
|
||||||
|
|
||||||
class tpoint {
|
class Track;
|
||||||
|
class Slice;
|
||||||
|
|
||||||
|
class TrackPoint : public SBSMSTrackPoint {
|
||||||
public:
|
public:
|
||||||
tpoint() {}
|
TrackPoint(Slice *slice, float *peak, audio *gx, float *mag, float *mag2, int k, int N, int band);
|
||||||
virtual ~tpoint() {}
|
~TrackPoint();
|
||||||
real f;
|
void destroy();
|
||||||
real y;
|
float getF();
|
||||||
real ph;
|
float getM();
|
||||||
short h;
|
float getPhase();
|
||||||
short M;
|
protected:
|
||||||
real y0;
|
TrackPoint *pp;
|
||||||
|
TrackPoint *pn;
|
||||||
|
TrackPoint *dupcont;
|
||||||
|
TrackPoint *dupStereo;
|
||||||
|
TrackPoint *cont;
|
||||||
|
TrackPoint *dup[3];
|
||||||
|
Track *owner;
|
||||||
|
Slice *slice;
|
||||||
|
float *peak;
|
||||||
|
float x01;
|
||||||
|
float y01;
|
||||||
|
float phSynth;
|
||||||
|
union {
|
||||||
|
float fSynth0;
|
||||||
|
float xtp2;
|
||||||
|
};
|
||||||
|
union {
|
||||||
|
float fSynth1;
|
||||||
|
float xtn2;
|
||||||
|
};
|
||||||
|
int refCount;
|
||||||
|
float f;
|
||||||
|
float x;
|
||||||
|
float y;
|
||||||
|
float ph;
|
||||||
|
float contF;
|
||||||
|
float m;
|
||||||
|
float m2;
|
||||||
|
bool bJump;
|
||||||
|
bool bSyncStereo;
|
||||||
|
bool bConnected;
|
||||||
|
bool bConnect;
|
||||||
|
bool bDelete;
|
||||||
|
bool bOwned;
|
||||||
|
bool bMarked;
|
||||||
|
bool bSplit;
|
||||||
|
bool bMerge;
|
||||||
|
|
||||||
|
friend class Slice;
|
||||||
|
friend class SMS;
|
||||||
|
friend class Track;
|
||||||
};
|
};
|
||||||
|
|
||||||
class trackpoint : public tpoint {
|
class Slice {
|
||||||
public:
|
public:
|
||||||
trackpoint();
|
Slice(int band, const TimeType &time);
|
||||||
trackpoint(trackpoint *tp);
|
~Slice();
|
||||||
trackpoint(grain *g, real x, real y, int N, short M, short h, long time);
|
void remove(TrackPoint *tp);
|
||||||
~trackpoint();
|
TrackPoint *bottom;
|
||||||
|
TrackPoint *top;
|
||||||
track *owner;
|
int band;
|
||||||
long time;
|
TimeType time;
|
||||||
|
|
||||||
real contF;
|
|
||||||
bool bConnect;
|
|
||||||
bool bConnected;
|
|
||||||
bool bDelete;
|
|
||||||
|
|
||||||
trackpoint *dupcont;
|
|
||||||
trackpoint *cont;
|
|
||||||
trackpoint *dup[3];
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void init();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
#ifndef FFTUTILS_H
|
// -*- mode: c++ -*-
|
||||||
#define FFTUTILS_H
|
#ifndef UTILS_H
|
||||||
|
#define UTILS_H
|
||||||
|
|
||||||
#include "real.h"
|
#include "real.h"
|
||||||
|
#include "config.h"
|
||||||
#include "sbsms.h"
|
#include "sbsms.h"
|
||||||
#include <math.h>
|
|
||||||
#include <limits.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
namespace _sbsms_ {
|
namespace _sbsms_ {
|
||||||
|
|
||||||
|
@ -13,67 +12,56 @@ namespace _sbsms_ {
|
||||||
#define PI 3.1415926535897932384626433832795f
|
#define PI 3.1415926535897932384626433832795f
|
||||||
#define TWOPI 6.28318530717958647692528676655900576f
|
#define TWOPI 6.28318530717958647692528676655900576f
|
||||||
|
|
||||||
extern int COSSIZE;
|
inline void c2even(audio *eo, audio *even, int N)
|
||||||
extern real COSFACTOR;
|
|
||||||
extern real *COSTABLE;
|
|
||||||
|
|
||||||
void cosinit(int size);
|
|
||||||
void _evenodd2c(audio *eo, audio *even, audio *odd, int N);
|
|
||||||
void _c2evenodd(audio *eo, audio *even, audio *odd, int N);
|
|
||||||
inline real COS(real x);
|
|
||||||
inline real square(real x);
|
|
||||||
void _c2magphase(audio *g, int N);
|
|
||||||
void _magphase2c(audio *g, int N);
|
|
||||||
inline real canon(real ph);
|
|
||||||
inline real norm(audio x);
|
|
||||||
inline real norm2(audio x);
|
|
||||||
inline real sign(real x);
|
|
||||||
inline real dBApprox(real x);
|
|
||||||
int *factor(int n);
|
|
||||||
void factor(int n, int *f, int m);
|
|
||||||
|
|
||||||
inline int ilog2(int x)
|
|
||||||
{
|
{
|
||||||
int n = 0;
|
int Nover2 = N/2;
|
||||||
while(x>1) {
|
even[0][0] = eo[0][0];
|
||||||
x>>=1;
|
even[0][1] = 0.0f;
|
||||||
n++;
|
for(int k=1;k<=Nover2;k++) {
|
||||||
|
int Nk = N-k;
|
||||||
|
even[k][0] = 0.5f*(eo[k][0] + eo[Nk][0]);
|
||||||
|
even[k][1] = 0.5f*(eo[k][1] - eo[Nk][1]);
|
||||||
}
|
}
|
||||||
return n;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline real dBApprox(real x)
|
inline void c2odd(audio *eo, audio *odd, int N)
|
||||||
{
|
{
|
||||||
real u = (x-1.0f)/(x+1.0f);
|
int Nover2 = N/2;
|
||||||
real u2 = u*u;
|
odd[0][0] = eo[0][1];
|
||||||
return 17.37177927613007f*u*(1.0f + u2*(0.333333333333333f + u2*(0.2f + u2*0.14285714285714f)));
|
odd[0][1] = 0.0f;
|
||||||
|
for(int k=1;k<=Nover2;k++) {
|
||||||
|
int Nk = N-k;
|
||||||
|
odd[k][0] = 0.5f*(eo[k][1] + eo[Nk][1]);
|
||||||
|
odd[k][1] = 0.5f*(eo[Nk][0] - eo[k][0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline real canon(real ph)
|
inline float canonPI(float ph)
|
||||||
{
|
{
|
||||||
return ph - TWOPI*(real)round2int(ph*ONEOVERTWOPI);
|
ph -= TWOPI * lrintf(ph * ONEOVERTWOPI);
|
||||||
|
if(ph < -PI) ph += TWOPI;
|
||||||
|
else if(ph >= PI) ph -= TWOPI;
|
||||||
|
return ph;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline real norm2(audio x)
|
inline float canon2PI(float ph)
|
||||||
{
|
{
|
||||||
return square(x[0]) + square(x[1]);
|
ph -= TWOPI * lrintf(ph * ONEOVERTWOPI);
|
||||||
|
if(ph < 0.0f) ph += TWOPI;
|
||||||
|
if(ph >= TWOPI) ph -= TWOPI;
|
||||||
|
return ph;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline real norm(audio x)
|
inline float square(float x)
|
||||||
{
|
|
||||||
return sqrt(norm2(x));
|
|
||||||
}
|
|
||||||
|
|
||||||
inline real COS(real x)
|
|
||||||
{
|
|
||||||
return COSTABLE[round2int(COSFACTOR*fabsf(x))];
|
|
||||||
}
|
|
||||||
|
|
||||||
inline real square(real x)
|
|
||||||
{
|
{
|
||||||
return x*x;
|
return x*x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline float norm2(t_fft x)
|
||||||
|
{
|
||||||
|
return square(x[0]) + square(x[1]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -828,9 +828,7 @@
|
||||||
28884969131B6CF600B59735 /* ro.po in Sources */ = {isa = PBXBuildFile; fileRef = 28884938131B6CF600B59735 /* ro.po */; };
|
28884969131B6CF600B59735 /* ro.po in Sources */ = {isa = PBXBuildFile; fileRef = 28884938131B6CF600B59735 /* ro.po */; };
|
||||||
2888496A131B6CF600B59735 /* ru.po in Sources */ = {isa = PBXBuildFile; fileRef = 28884939131B6CF600B59735 /* ru.po */; };
|
2888496A131B6CF600B59735 /* ru.po in Sources */ = {isa = PBXBuildFile; fileRef = 28884939131B6CF600B59735 /* ru.po */; };
|
||||||
2888496B131B6CF600B59735 /* sk.po in Sources */ = {isa = PBXBuildFile; fileRef = 2888493A131B6CF600B59735 /* sk.po */; };
|
2888496B131B6CF600B59735 /* sk.po in Sources */ = {isa = PBXBuildFile; fileRef = 2888493A131B6CF600B59735 /* sk.po */; };
|
||||||
2888496C131B6CF600B59735 /* sl.po in Sources */ = {isa = PBXBuildFile; fileRef = 2888493B131B6CF600B59735 /* sl.po */; };
|
2888496C131B6CF600B59735 /* sr_RS@latin.po in Sources */ = {isa = PBXBuildFile; fileRef = 2888493B131B6CF600B59735 /* sr_RS@latin.po */; };
|
||||||
2888496D131B6CF600B59735 /* sr_RS.po in Sources */ = {isa = PBXBuildFile; fileRef = 2888493C131B6CF600B59735 /* sr_RS.po */; };
|
|
||||||
2888496D131B6CF600B59735 /* sr_RS@latin.po in Sources */ = {isa = PBXBuildFile; fileRef = 2888493C131B6CF600B59735 /* sr_RS@latin.po */; };
|
|
||||||
2888496D131B6CF600B59735 /* sv.po in Sources */ = {isa = PBXBuildFile; fileRef = 2888493C131B6CF600B59735 /* sv.po */; };
|
2888496D131B6CF600B59735 /* sv.po in Sources */ = {isa = PBXBuildFile; fileRef = 2888493C131B6CF600B59735 /* sv.po */; };
|
||||||
2888496E131B6CF600B59735 /* tg.po in Sources */ = {isa = PBXBuildFile; fileRef = 2888493D131B6CF600B59735 /* tg.po */; };
|
2888496E131B6CF600B59735 /* tg.po in Sources */ = {isa = PBXBuildFile; fileRef = 2888493D131B6CF600B59735 /* tg.po */; };
|
||||||
2888496F131B6CF600B59735 /* tr.po in Sources */ = {isa = PBXBuildFile; fileRef = 2888493E131B6CF600B59735 /* tr.po */; };
|
2888496F131B6CF600B59735 /* tr.po in Sources */ = {isa = PBXBuildFile; fileRef = 2888493E131B6CF600B59735 /* tr.po */; };
|
||||||
|
@ -1151,20 +1149,17 @@
|
||||||
28FE4A080ABF4E960056F5C4 /* mmx_optimized.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28FE4A060ABF4E960056F5C4 /* mmx_optimized.cpp */; };
|
28FE4A080ABF4E960056F5C4 /* mmx_optimized.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28FE4A060ABF4E960056F5C4 /* mmx_optimized.cpp */; };
|
||||||
28FE4A090ABF4E960056F5C4 /* sse_optimized.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28FE4A070ABF4E960056F5C4 /* sse_optimized.cpp */; };
|
28FE4A090ABF4E960056F5C4 /* sse_optimized.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 28FE4A070ABF4E960056F5C4 /* sse_optimized.cpp */; };
|
||||||
28FE4A3A0ABF58360056F5C4 /* soundtouch_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 28FE4A390ABF58360056F5C4 /* soundtouch_config.h */; };
|
28FE4A3A0ABF58360056F5C4 /* soundtouch_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 28FE4A390ABF58360056F5C4 /* soundtouch_config.h */; };
|
||||||
|
82FF185213CF01A600C1B664 /* dBTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 82FF184D13CF01A600C1B664 /* dBTable.cpp */; };
|
||||||
|
82FF185313CF01A600C1B664 /* slide.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 82FF184F13CF01A600C1B664 /* slide.cpp */; };
|
||||||
8406A93812D0F2510011EA01 /* EQDefaultCurves.xml in Resources */ = {isa = PBXBuildFile; fileRef = 8406A93712D0F2510011EA01 /* EQDefaultCurves.xml */; };
|
8406A93812D0F2510011EA01 /* EQDefaultCurves.xml in Resources */ = {isa = PBXBuildFile; fileRef = 8406A93712D0F2510011EA01 /* EQDefaultCurves.xml */; };
|
||||||
8484F31413086237002DF7F0 /* DeviceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8484F31213086237002DF7F0 /* DeviceManager.cpp */; };
|
8484F31413086237002DF7F0 /* DeviceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8484F31213086237002DF7F0 /* DeviceManager.cpp */; };
|
||||||
ED2706FF0EF9C47E007D4FFD /* sbsms.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2706FE0EF9C47E007D4FFD /* sbsms.h */; };
|
ED2706FF0EF9C47E007D4FFD /* sbsms.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2706FE0EF9C47E007D4FFD /* sbsms.h */; };
|
||||||
ED2707240EF9C51D007D4FFD /* audio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED2707020EF9C51D007D4FFD /* audio.cpp */; };
|
|
||||||
ED2707250EF9C51D007D4FFD /* audio.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2707030EF9C51D007D4FFD /* audio.h */; };
|
|
||||||
ED2707260EF9C51D007D4FFD /* buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED2707040EF9C51D007D4FFD /* buffer.cpp */; };
|
ED2707260EF9C51D007D4FFD /* buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED2707040EF9C51D007D4FFD /* buffer.cpp */; };
|
||||||
ED2707270EF9C51D007D4FFD /* buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2707050EF9C51D007D4FFD /* buffer.h */; };
|
ED2707270EF9C51D007D4FFD /* buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2707050EF9C51D007D4FFD /* buffer.h */; };
|
||||||
ED2707280EF9C51D007D4FFD /* defs.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2707060EF9C51D007D4FFD /* defs.h */; };
|
|
||||||
ED2707290EF9C51D007D4FFD /* fft.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED2707070EF9C51D007D4FFD /* fft.cpp */; };
|
ED2707290EF9C51D007D4FFD /* fft.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED2707070EF9C51D007D4FFD /* fft.cpp */; };
|
||||||
ED27072A0EF9C51D007D4FFD /* fft.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2707080EF9C51D007D4FFD /* fft.h */; };
|
ED27072A0EF9C51D007D4FFD /* fft.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2707080EF9C51D007D4FFD /* fft.h */; };
|
||||||
ED27072B0EF9C51D007D4FFD /* grain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED2707090EF9C51D007D4FFD /* grain.cpp */; };
|
ED27072B0EF9C51D007D4FFD /* grain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED2707090EF9C51D007D4FFD /* grain.cpp */; };
|
||||||
ED27072C0EF9C51D007D4FFD /* grain.h in Headers */ = {isa = PBXBuildFile; fileRef = ED27070A0EF9C51D007D4FFD /* grain.h */; };
|
ED27072C0EF9C51D007D4FFD /* grain.h in Headers */ = {isa = PBXBuildFile; fileRef = ED27070A0EF9C51D007D4FFD /* grain.h */; };
|
||||||
ED27072D0EF9C51D007D4FFD /* peak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED27070B0EF9C51D007D4FFD /* peak.cpp */; };
|
|
||||||
ED27072E0EF9C51D007D4FFD /* peak.h in Headers */ = {isa = PBXBuildFile; fileRef = ED27070C0EF9C51D007D4FFD /* peak.h */; };
|
|
||||||
ED2707300EF9C51D007D4FFD /* real.h in Headers */ = {isa = PBXBuildFile; fileRef = ED27070E0EF9C51D007D4FFD /* real.h */; };
|
ED2707300EF9C51D007D4FFD /* real.h in Headers */ = {isa = PBXBuildFile; fileRef = ED27070E0EF9C51D007D4FFD /* real.h */; };
|
||||||
ED2707310EF9C51D007D4FFD /* resample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED27070F0EF9C51D007D4FFD /* resample.cpp */; };
|
ED2707310EF9C51D007D4FFD /* resample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED27070F0EF9C51D007D4FFD /* resample.cpp */; };
|
||||||
ED2707320EF9C51D007D4FFD /* sbsms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED2707100EF9C51D007D4FFD /* sbsms.cpp */; };
|
ED2707320EF9C51D007D4FFD /* sbsms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED2707100EF9C51D007D4FFD /* sbsms.cpp */; };
|
||||||
|
@ -1177,7 +1172,6 @@
|
||||||
ED2707390EF9C51D007D4FFD /* track.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2707170EF9C51D007D4FFD /* track.h */; };
|
ED2707390EF9C51D007D4FFD /* track.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2707170EF9C51D007D4FFD /* track.h */; };
|
||||||
ED27073A0EF9C51D007D4FFD /* trackpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED2707180EF9C51D007D4FFD /* trackpoint.cpp */; };
|
ED27073A0EF9C51D007D4FFD /* trackpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED2707180EF9C51D007D4FFD /* trackpoint.cpp */; };
|
||||||
ED27073B0EF9C51D007D4FFD /* trackpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2707190EF9C51D007D4FFD /* trackpoint.h */; };
|
ED27073B0EF9C51D007D4FFD /* trackpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2707190EF9C51D007D4FFD /* trackpoint.h */; };
|
||||||
ED27073C0EF9C51D007D4FFD /* utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED27071A0EF9C51D007D4FFD /* utils.cpp */; };
|
|
||||||
ED27073D0EF9C51D007D4FFD /* utils.h in Headers */ = {isa = PBXBuildFile; fileRef = ED27071B0EF9C51D007D4FFD /* utils.h */; };
|
ED27073D0EF9C51D007D4FFD /* utils.h in Headers */ = {isa = PBXBuildFile; fileRef = ED27071B0EF9C51D007D4FFD /* utils.h */; };
|
||||||
ED2707460EF9C550007D4FFD /* liblibsbsms.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2706F40EF9C3C6007D4FFD /* liblibsbsms.a */; };
|
ED2707460EF9C550007D4FFD /* liblibsbsms.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2706F40EF9C3C6007D4FFD /* liblibsbsms.a */; };
|
||||||
ED2707500EF9C64F007D4FFD /* SBSMSEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED27074B0EF9C64F007D4FFD /* SBSMSEffect.cpp */; };
|
ED2707500EF9C64F007D4FFD /* SBSMSEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ED27074B0EF9C64F007D4FFD /* SBSMSEffect.cpp */; };
|
||||||
|
@ -2453,8 +2447,6 @@
|
||||||
28884938131B6CF600B59735 /* ro.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = ro.po; path = ../locale/ro.po; sourceTree = SOURCE_ROOT; };
|
28884938131B6CF600B59735 /* ro.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = ro.po; path = ../locale/ro.po; sourceTree = SOURCE_ROOT; };
|
||||||
28884939131B6CF600B59735 /* ru.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = ru.po; path = ../locale/ru.po; sourceTree = SOURCE_ROOT; };
|
28884939131B6CF600B59735 /* ru.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = ru.po; path = ../locale/ru.po; sourceTree = SOURCE_ROOT; };
|
||||||
2888493A131B6CF600B59735 /* sk.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = sk.po; path = ../locale/sk.po; sourceTree = SOURCE_ROOT; };
|
2888493A131B6CF600B59735 /* sk.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = sk.po; path = ../locale/sk.po; sourceTree = SOURCE_ROOT; };
|
||||||
2888493B131B6CF600B59735 /* sl.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = sl.po; path = ../locale/sl.po; sourceTree = SOURCE_ROOT; };
|
|
||||||
2888493B131B6CF600B59735 /* sr_RS.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = sr_RS.po; path = ../locale/sr_RS.po; sourceTree = SOURCE_ROOT; };
|
|
||||||
2888493B131B6CF600B59735 /* sr_RS@latin.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = "sr_RS@latin.po"; path = "../locale/sr_RS@latin.po"; sourceTree = SOURCE_ROOT; };
|
2888493B131B6CF600B59735 /* sr_RS@latin.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = "sr_RS@latin.po"; path = "../locale/sr_RS@latin.po"; sourceTree = SOURCE_ROOT; };
|
||||||
2888493C131B6CF600B59735 /* sv.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = sv.po; path = ../locale/sv.po; sourceTree = SOURCE_ROOT; };
|
2888493C131B6CF600B59735 /* sv.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = sv.po; path = ../locale/sv.po; sourceTree = SOURCE_ROOT; };
|
||||||
2888493D131B6CF600B59735 /* tg.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = tg.po; path = ../locale/tg.po; sourceTree = SOURCE_ROOT; };
|
2888493D131B6CF600B59735 /* tg.po */ = {isa = PBXFileReference; explicitFileType = sourcecode; fileEncoding = 5; name = tg.po; path = ../locale/tg.po; sourceTree = SOURCE_ROOT; };
|
||||||
|
@ -2824,6 +2816,11 @@
|
||||||
28FE4A060ABF4E960056F5C4 /* mmx_optimized.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = mmx_optimized.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
28FE4A060ABF4E960056F5C4 /* mmx_optimized.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = mmx_optimized.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
28FE4A070ABF4E960056F5C4 /* sse_optimized.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = sse_optimized.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
28FE4A070ABF4E960056F5C4 /* sse_optimized.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = sse_optimized.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
28FE4A390ABF58360056F5C4 /* soundtouch_config.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = soundtouch_config.h; path = "../lib-src/soundtouch/include/soundtouch_config.h"; sourceTree = SOURCE_ROOT; tabWidth = 3; };
|
28FE4A390ABF58360056F5C4 /* soundtouch_config.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = soundtouch_config.h; path = "../lib-src/soundtouch/include/soundtouch_config.h"; sourceTree = SOURCE_ROOT; tabWidth = 3; };
|
||||||
|
82FF184D13CF01A600C1B664 /* dBTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dBTable.cpp; path = sbsms/src/dBTable.cpp; sourceTree = "<group>"; };
|
||||||
|
82FF184E13CF01A600C1B664 /* dBTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dBTable.h; path = sbsms/src/dBTable.h; sourceTree = "<group>"; };
|
||||||
|
82FF184F13CF01A600C1B664 /* slide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = slide.cpp; path = sbsms/src/slide.cpp; sourceTree = "<group>"; };
|
||||||
|
82FF185013CF01A600C1B664 /* sse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sse.h; path = sbsms/src/sse.h; sourceTree = "<group>"; };
|
||||||
|
82FF185113CF01A600C1B664 /* synthTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = synthTable.h; path = sbsms/src/synthTable.h; sourceTree = "<group>"; };
|
||||||
8406A93712D0F2510011EA01 /* EQDefaultCurves.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = EQDefaultCurves.xml; path = ../presets/EQDefaultCurves.xml; sourceTree = SOURCE_ROOT; };
|
8406A93712D0F2510011EA01 /* EQDefaultCurves.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = EQDefaultCurves.xml; path = ../presets/EQDefaultCurves.xml; sourceTree = SOURCE_ROOT; };
|
||||||
8484F31213086237002DF7F0 /* DeviceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceManager.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
8484F31213086237002DF7F0 /* DeviceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceManager.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
8484F31313086237002DF7F0 /* DeviceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = DeviceManager.h; sourceTree = "<group>"; tabWidth = 3; };
|
8484F31313086237002DF7F0 /* DeviceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = DeviceManager.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
|
@ -2851,17 +2848,12 @@
|
||||||
ED05D12A0E50AD5700CC4BD3 /* scorealign.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = scorealign.h; sourceTree = "<group>"; tabWidth = 3; };
|
ED05D12A0E50AD5700CC4BD3 /* scorealign.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = scorealign.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED2706F40EF9C3C6007D4FFD /* liblibsbsms.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liblibsbsms.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
ED2706F40EF9C3C6007D4FFD /* liblibsbsms.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liblibsbsms.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
ED2706FE0EF9C47E007D4FFD /* sbsms.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = sbsms.h; sourceTree = "<group>"; tabWidth = 3; };
|
ED2706FE0EF9C47E007D4FFD /* sbsms.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = sbsms.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED2707020EF9C51D007D4FFD /* audio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = audio.cpp; path = sbsms/src/audio.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
|
||||||
ED2707030EF9C51D007D4FFD /* audio.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = audio.h; path = sbsms/src/audio.h; sourceTree = "<group>"; tabWidth = 3; };
|
|
||||||
ED2707040EF9C51D007D4FFD /* buffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = buffer.cpp; path = sbsms/src/buffer.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
ED2707040EF9C51D007D4FFD /* buffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = buffer.cpp; path = sbsms/src/buffer.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED2707050EF9C51D007D4FFD /* buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = buffer.h; path = sbsms/src/buffer.h; sourceTree = "<group>"; tabWidth = 3; };
|
ED2707050EF9C51D007D4FFD /* buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = buffer.h; path = sbsms/src/buffer.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED2707060EF9C51D007D4FFD /* defs.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = defs.h; path = sbsms/src/defs.h; sourceTree = "<group>"; tabWidth = 3; };
|
|
||||||
ED2707070EF9C51D007D4FFD /* fft.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = fft.cpp; path = sbsms/src/fft.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
ED2707070EF9C51D007D4FFD /* fft.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = fft.cpp; path = sbsms/src/fft.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED2707080EF9C51D007D4FFD /* fft.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = fft.h; path = sbsms/src/fft.h; sourceTree = "<group>"; tabWidth = 3; };
|
ED2707080EF9C51D007D4FFD /* fft.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = fft.h; path = sbsms/src/fft.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED2707090EF9C51D007D4FFD /* grain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = grain.cpp; path = sbsms/src/grain.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
ED2707090EF9C51D007D4FFD /* grain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = grain.cpp; path = sbsms/src/grain.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED27070A0EF9C51D007D4FFD /* grain.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = grain.h; path = sbsms/src/grain.h; sourceTree = "<group>"; tabWidth = 3; };
|
ED27070A0EF9C51D007D4FFD /* grain.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = grain.h; path = sbsms/src/grain.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED27070B0EF9C51D007D4FFD /* peak.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = peak.cpp; path = sbsms/src/peak.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
|
||||||
ED27070C0EF9C51D007D4FFD /* peak.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = peak.h; path = sbsms/src/peak.h; sourceTree = "<group>"; tabWidth = 3; };
|
|
||||||
ED27070E0EF9C51D007D4FFD /* real.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = real.h; path = sbsms/src/real.h; sourceTree = "<group>"; tabWidth = 3; };
|
ED27070E0EF9C51D007D4FFD /* real.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = real.h; path = sbsms/src/real.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED27070F0EF9C51D007D4FFD /* resample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = resample.cpp; path = sbsms/src/resample.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
ED27070F0EF9C51D007D4FFD /* resample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = resample.cpp; path = sbsms/src/resample.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED2707100EF9C51D007D4FFD /* sbsms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = sbsms.cpp; path = sbsms/src/sbsms.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
ED2707100EF9C51D007D4FFD /* sbsms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = sbsms.cpp; path = sbsms/src/sbsms.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
|
@ -2874,7 +2866,6 @@
|
||||||
ED2707170EF9C51D007D4FFD /* track.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = track.h; path = sbsms/src/track.h; sourceTree = "<group>"; tabWidth = 3; };
|
ED2707170EF9C51D007D4FFD /* track.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = track.h; path = sbsms/src/track.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED2707180EF9C51D007D4FFD /* trackpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = trackpoint.cpp; path = sbsms/src/trackpoint.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
ED2707180EF9C51D007D4FFD /* trackpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = trackpoint.cpp; path = sbsms/src/trackpoint.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED2707190EF9C51D007D4FFD /* trackpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = trackpoint.h; path = sbsms/src/trackpoint.h; sourceTree = "<group>"; tabWidth = 3; };
|
ED2707190EF9C51D007D4FFD /* trackpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = trackpoint.h; path = sbsms/src/trackpoint.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED27071A0EF9C51D007D4FFD /* utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; name = utils.cpp; path = sbsms/src/utils.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
|
||||||
ED27071B0EF9C51D007D4FFD /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = utils.h; path = sbsms/src/utils.h; sourceTree = "<group>"; tabWidth = 3; };
|
ED27071B0EF9C51D007D4FFD /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = utils.h; path = sbsms/src/utils.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED27074B0EF9C64F007D4FFD /* SBSMSEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = SBSMSEffect.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
ED27074B0EF9C64F007D4FFD /* SBSMSEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = SBSMSEffect.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
ED27074C0EF9C64F007D4FFD /* SBSMSEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = SBSMSEffect.h; sourceTree = "<group>"; tabWidth = 3; };
|
ED27074C0EF9C64F007D4FFD /* SBSMSEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = SBSMSEffect.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||||
|
@ -4845,9 +4836,9 @@
|
||||||
28884938131B6CF600B59735 /* ro.po */,
|
28884938131B6CF600B59735 /* ro.po */,
|
||||||
28884939131B6CF600B59735 /* ru.po */,
|
28884939131B6CF600B59735 /* ru.po */,
|
||||||
2888493A131B6CF600B59735 /* sk.po */,
|
2888493A131B6CF600B59735 /* sk.po */,
|
||||||
2888493B131B6CF600B59735 /* sl.po */,
|
2888493B131B6CF600B59735 /* sr_RS@latin.po */,
|
||||||
2888493C131B6CF600B59735 /* sr_RS.po */,
|
2888493C131B6CF600B59735 /* sv.po */,
|
||||||
2888493C131B6CF600B59735 /* sr_RS@latin.po */,
|
2888493C131B6CF600B59735 /* sv.po */,
|
||||||
2888493C131B6CF600B59735 /* sv.po */,
|
2888493C131B6CF600B59735 /* sv.po */,
|
||||||
2888493D131B6CF600B59735 /* tg.po */,
|
2888493D131B6CF600B59735 /* tg.po */,
|
||||||
2888493E131B6CF600B59735 /* tr.po */,
|
2888493E131B6CF600B59735 /* tr.po */,
|
||||||
|
@ -5227,21 +5218,21 @@
|
||||||
ED2707000EF9C489007D4FFD /* src */ = {
|
ED2707000EF9C489007D4FFD /* src */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
ED2707020EF9C51D007D4FFD /* audio.cpp */,
|
82FF184D13CF01A600C1B664 /* dBTable.cpp */,
|
||||||
ED2707030EF9C51D007D4FFD /* audio.h */,
|
82FF184E13CF01A600C1B664 /* dBTable.h */,
|
||||||
|
82FF184F13CF01A600C1B664 /* slide.cpp */,
|
||||||
|
82FF185013CF01A600C1B664 /* sse.h */,
|
||||||
|
82FF185113CF01A600C1B664 /* synthTable.h */,
|
||||||
|
ED2707110EF9C51D007D4FFD /* sincCoeffs.h */,
|
||||||
ED2707040EF9C51D007D4FFD /* buffer.cpp */,
|
ED2707040EF9C51D007D4FFD /* buffer.cpp */,
|
||||||
ED2707050EF9C51D007D4FFD /* buffer.h */,
|
ED2707050EF9C51D007D4FFD /* buffer.h */,
|
||||||
ED2707060EF9C51D007D4FFD /* defs.h */,
|
|
||||||
ED2707070EF9C51D007D4FFD /* fft.cpp */,
|
ED2707070EF9C51D007D4FFD /* fft.cpp */,
|
||||||
ED2707080EF9C51D007D4FFD /* fft.h */,
|
ED2707080EF9C51D007D4FFD /* fft.h */,
|
||||||
ED2707090EF9C51D007D4FFD /* grain.cpp */,
|
ED2707090EF9C51D007D4FFD /* grain.cpp */,
|
||||||
ED27070A0EF9C51D007D4FFD /* grain.h */,
|
ED27070A0EF9C51D007D4FFD /* grain.h */,
|
||||||
ED27070B0EF9C51D007D4FFD /* peak.cpp */,
|
|
||||||
ED27070C0EF9C51D007D4FFD /* peak.h */,
|
|
||||||
ED27070E0EF9C51D007D4FFD /* real.h */,
|
ED27070E0EF9C51D007D4FFD /* real.h */,
|
||||||
ED27070F0EF9C51D007D4FFD /* resample.cpp */,
|
ED27070F0EF9C51D007D4FFD /* resample.cpp */,
|
||||||
ED2707100EF9C51D007D4FFD /* sbsms.cpp */,
|
ED2707100EF9C51D007D4FFD /* sbsms.cpp */,
|
||||||
ED2707110EF9C51D007D4FFD /* sincCoeffs.h */,
|
|
||||||
ED2707120EF9C51D007D4FFD /* sms.cpp */,
|
ED2707120EF9C51D007D4FFD /* sms.cpp */,
|
||||||
ED2707130EF9C51D007D4FFD /* sms.h */,
|
ED2707130EF9C51D007D4FFD /* sms.h */,
|
||||||
ED2707140EF9C51D007D4FFD /* subband.cpp */,
|
ED2707140EF9C51D007D4FFD /* subband.cpp */,
|
||||||
|
@ -5250,7 +5241,6 @@
|
||||||
ED2707170EF9C51D007D4FFD /* track.h */,
|
ED2707170EF9C51D007D4FFD /* track.h */,
|
||||||
ED2707180EF9C51D007D4FFD /* trackpoint.cpp */,
|
ED2707180EF9C51D007D4FFD /* trackpoint.cpp */,
|
||||||
ED2707190EF9C51D007D4FFD /* trackpoint.h */,
|
ED2707190EF9C51D007D4FFD /* trackpoint.h */,
|
||||||
ED27071A0EF9C51D007D4FFD /* utils.cpp */,
|
|
||||||
ED27071B0EF9C51D007D4FFD /* utils.h */,
|
ED27071B0EF9C51D007D4FFD /* utils.h */,
|
||||||
);
|
);
|
||||||
name = src;
|
name = src;
|
||||||
|
@ -5777,12 +5767,9 @@
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
ED2706FF0EF9C47E007D4FFD /* sbsms.h in Headers */,
|
ED2706FF0EF9C47E007D4FFD /* sbsms.h in Headers */,
|
||||||
ED2707250EF9C51D007D4FFD /* audio.h in Headers */,
|
|
||||||
ED2707270EF9C51D007D4FFD /* buffer.h in Headers */,
|
ED2707270EF9C51D007D4FFD /* buffer.h in Headers */,
|
||||||
ED2707280EF9C51D007D4FFD /* defs.h in Headers */,
|
|
||||||
ED27072A0EF9C51D007D4FFD /* fft.h in Headers */,
|
ED27072A0EF9C51D007D4FFD /* fft.h in Headers */,
|
||||||
ED27072C0EF9C51D007D4FFD /* grain.h in Headers */,
|
ED27072C0EF9C51D007D4FFD /* grain.h in Headers */,
|
||||||
ED27072E0EF9C51D007D4FFD /* peak.h in Headers */,
|
|
||||||
ED2707300EF9C51D007D4FFD /* real.h in Headers */,
|
ED2707300EF9C51D007D4FFD /* real.h in Headers */,
|
||||||
ED2707330EF9C51D007D4FFD /* sincCoeffs.h in Headers */,
|
ED2707330EF9C51D007D4FFD /* sincCoeffs.h in Headers */,
|
||||||
ED2707350EF9C51D007D4FFD /* sms.h in Headers */,
|
ED2707350EF9C51D007D4FFD /* sms.h in Headers */,
|
||||||
|
@ -6203,7 +6190,6 @@
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
buildConfigurationList = 1790ABE409883346008A330A /* Build configuration list for PBXProject "Audacity" */;
|
buildConfigurationList = 1790ABE409883346008A330A /* Build configuration list for PBXProject "Audacity" */;
|
||||||
compatibilityVersion = "Xcode 2.4";
|
compatibilityVersion = "Xcode 2.4";
|
||||||
developmentRegion = English;
|
|
||||||
hasScannedForEncodings = 0;
|
hasScannedForEncodings = 0;
|
||||||
knownRegions = (
|
knownRegions = (
|
||||||
English,
|
English,
|
||||||
|
@ -7132,8 +7118,8 @@
|
||||||
28884969131B6CF600B59735 /* ro.po in Sources */,
|
28884969131B6CF600B59735 /* ro.po in Sources */,
|
||||||
2888496A131B6CF600B59735 /* ru.po in Sources */,
|
2888496A131B6CF600B59735 /* ru.po in Sources */,
|
||||||
2888496B131B6CF600B59735 /* sk.po in Sources */,
|
2888496B131B6CF600B59735 /* sk.po in Sources */,
|
||||||
2888496C131B6CF600B59735 /* sl.po in Sources */,
|
2888496C131B6CF600B59735 /* sr_RS@latin.po in Sources */,
|
||||||
2888496C131B6CF600B59735 /* sr_RS.po in Sources */,
|
2888496C131B6CF600B59735 /* sr_RS@latin.po in Sources */,
|
||||||
2888496C131B6CF600B59735 /* sr_RS@latin.po in Sources */,
|
2888496C131B6CF600B59735 /* sr_RS@latin.po in Sources */,
|
||||||
2888496D131B6CF600B59735 /* sv.po in Sources */,
|
2888496D131B6CF600B59735 /* sv.po in Sources */,
|
||||||
2888496E131B6CF600B59735 /* tg.po in Sources */,
|
2888496E131B6CF600B59735 /* tg.po in Sources */,
|
||||||
|
@ -7142,6 +7128,8 @@
|
||||||
28884971131B6CF600B59735 /* vi.po in Sources */,
|
28884971131B6CF600B59735 /* vi.po in Sources */,
|
||||||
28884972131B6CF600B59735 /* zh_TW.po in Sources */,
|
28884972131B6CF600B59735 /* zh_TW.po in Sources */,
|
||||||
28884973131B6CF600B59735 /* zh.po in Sources */,
|
28884973131B6CF600B59735 /* zh.po in Sources */,
|
||||||
|
82FF185213CF01A600C1B664 /* dBTable.cpp in Sources */,
|
||||||
|
82FF185313CF01A600C1B664 /* slide.cpp in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
@ -7256,18 +7244,15 @@
|
||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
ED2707240EF9C51D007D4FFD /* audio.cpp in Sources */,
|
|
||||||
ED2707260EF9C51D007D4FFD /* buffer.cpp in Sources */,
|
ED2707260EF9C51D007D4FFD /* buffer.cpp in Sources */,
|
||||||
ED2707290EF9C51D007D4FFD /* fft.cpp in Sources */,
|
ED2707290EF9C51D007D4FFD /* fft.cpp in Sources */,
|
||||||
ED27072B0EF9C51D007D4FFD /* grain.cpp in Sources */,
|
ED27072B0EF9C51D007D4FFD /* grain.cpp in Sources */,
|
||||||
ED27072D0EF9C51D007D4FFD /* peak.cpp in Sources */,
|
|
||||||
ED2707310EF9C51D007D4FFD /* resample.cpp in Sources */,
|
ED2707310EF9C51D007D4FFD /* resample.cpp in Sources */,
|
||||||
ED2707320EF9C51D007D4FFD /* sbsms.cpp in Sources */,
|
ED2707320EF9C51D007D4FFD /* sbsms.cpp in Sources */,
|
||||||
ED2707340EF9C51D007D4FFD /* sms.cpp in Sources */,
|
ED2707340EF9C51D007D4FFD /* sms.cpp in Sources */,
|
||||||
ED2707360EF9C51D007D4FFD /* subband.cpp in Sources */,
|
ED2707360EF9C51D007D4FFD /* subband.cpp in Sources */,
|
||||||
ED2707380EF9C51D007D4FFD /* track.cpp in Sources */,
|
ED2707380EF9C51D007D4FFD /* track.cpp in Sources */,
|
||||||
ED27073A0EF9C51D007D4FFD /* trackpoint.cpp in Sources */,
|
ED27073A0EF9C51D007D4FFD /* trackpoint.cpp in Sources */,
|
||||||
ED27073C0EF9C51D007D4FFD /* utils.cpp in Sources */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
@ -7613,6 +7598,7 @@
|
||||||
KEEP_PRIVATE_EXTERNS = YES;
|
KEEP_PRIVATE_EXTERNS = YES;
|
||||||
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
|
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
|
||||||
SDKROOT = macosx10.4;
|
SDKROOT = macosx10.4;
|
||||||
|
SSE_CPPFLAGS = "-Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC";
|
||||||
TOPLEVEL = ..;
|
TOPLEVEL = ..;
|
||||||
WX_CFLAGS = "-I$(WX_PREFIX)/lib/wx/include/mac-unicode-debug-static-$(WX_VER) -I$(WX_PREFIX)/include/wx-$(WX_VER) -D__WXDEBUG__ -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA";
|
WX_CFLAGS = "-I$(WX_PREFIX)/lib/wx/include/mac-unicode-debug-static-$(WX_VER) -I$(WX_PREFIX)/include/wx-$(WX_VER) -D__WXDEBUG__ -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA";
|
||||||
WX_CONFIG = "$(WX_PREFIX)/bin/wx-config";
|
WX_CONFIG = "$(WX_PREFIX)/bin/wx-config";
|
||||||
|
@ -7804,6 +7790,7 @@
|
||||||
KEEP_PRIVATE_EXTERNS = YES;
|
KEEP_PRIVATE_EXTERNS = YES;
|
||||||
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
|
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
|
||||||
SDKROOT = macosx10.4;
|
SDKROOT = macosx10.4;
|
||||||
|
SSE_CPPFLAGS = "-Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC";
|
||||||
TOPLEVEL = ..;
|
TOPLEVEL = ..;
|
||||||
WX_CFLAGS = "-I$(WX_PREFIX)/lib/wx/include/mac-unicode-debug-$(WX_VER) -I$(WX_PREFIX)/include/wx-$(WX_VER) -D__WXDEBUG__ -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA";
|
WX_CFLAGS = "-I$(WX_PREFIX)/lib/wx/include/mac-unicode-debug-$(WX_VER) -I$(WX_PREFIX)/include/wx-$(WX_VER) -D__WXDEBUG__ -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA";
|
||||||
WX_CONFIG = "$(WX_PREFIX)/bin/wx-config";
|
WX_CONFIG = "$(WX_PREFIX)/bin/wx-config";
|
||||||
|
@ -8126,6 +8113,7 @@
|
||||||
KEEP_PRIVATE_EXTERNS = YES;
|
KEEP_PRIVATE_EXTERNS = YES;
|
||||||
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
|
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
|
||||||
SDKROOT = macosx10.4;
|
SDKROOT = macosx10.4;
|
||||||
|
SSE_CPPFLAGS = "-Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC";
|
||||||
TOPLEVEL = ..;
|
TOPLEVEL = ..;
|
||||||
WX_CFLAGS = "-I$(WX_PREFIX)/lib/wx/include/mac-unicode-release-$(WX_VER) -I$(WX_PREFIX)/include/wx-$(WX_VER) -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA";
|
WX_CFLAGS = "-I$(WX_PREFIX)/lib/wx/include/mac-unicode-release-$(WX_VER) -I$(WX_PREFIX)/include/wx-$(WX_VER) -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA";
|
||||||
WX_CONFIG = "$(WX_PREFIX)/bin/wx-config";
|
WX_CONFIG = "$(WX_PREFIX)/bin/wx-config";
|
||||||
|
@ -8747,6 +8735,7 @@
|
||||||
KEEP_PRIVATE_EXTERNS = YES;
|
KEEP_PRIVATE_EXTERNS = YES;
|
||||||
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
|
ONLY_LINK_ESSENTIAL_SYMBOLS = YES;
|
||||||
SDKROOT = macosx10.4;
|
SDKROOT = macosx10.4;
|
||||||
|
SSE_CPPFLAGS = "-Xarch_i386 -DAPPLE_I386 -Xarch_ppc -DAPPLE_PPC";
|
||||||
TOPLEVEL = ..;
|
TOPLEVEL = ..;
|
||||||
WX_CFLAGS = "-I$(WX_PREFIX)/lib/wx/include/mac-unicode-release-static-$(WX_VER) -I$(WX_PREFIX)/include/wx-$(WX_VER) -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA";
|
WX_CFLAGS = "-I$(WX_PREFIX)/lib/wx/include/mac-unicode-release-static-$(WX_VER) -I$(WX_PREFIX)/include/wx-$(WX_VER) -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA";
|
||||||
WX_CONFIG = "$(WX_PREFIX)/bin/wx-config";
|
WX_CONFIG = "$(WX_PREFIX)/bin/wx-config";
|
||||||
|
@ -8793,8 +8782,14 @@
|
||||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||||
GCC_MODEL_TUNING = G5;
|
GCC_MODEL_TUNING = G5;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
|
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
|
||||||
OTHER_CFLAGS = "$(WX_CFLAGS)";
|
OTHER_CFLAGS = (
|
||||||
OTHER_CPLUSPLUSFLAGS = "$(WX_CXXFLAGS)";
|
"$(SSE_CPPFLAGS)",
|
||||||
|
"$(WX_CFLAGS)",
|
||||||
|
);
|
||||||
|
OTHER_CPLUSPLUSFLAGS = (
|
||||||
|
"$(SSE_CPPFLAGS)",
|
||||||
|
"$(WX_CXXFLAGS)",
|
||||||
|
);
|
||||||
PREBINDING = NO;
|
PREBINDING = NO;
|
||||||
PRODUCT_NAME = libsbsms;
|
PRODUCT_NAME = libsbsms;
|
||||||
};
|
};
|
||||||
|
@ -8808,8 +8803,14 @@
|
||||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||||
GCC_MODEL_TUNING = G5;
|
GCC_MODEL_TUNING = G5;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
|
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
|
||||||
OTHER_CFLAGS = "$(WX_CFLAGS)";
|
OTHER_CFLAGS = (
|
||||||
OTHER_CPLUSPLUSFLAGS = "$(WX_CXXFLAGS)";
|
"$(SSE_CPPFLAGS)",
|
||||||
|
"$(WX_CFLAGS)",
|
||||||
|
);
|
||||||
|
OTHER_CPLUSPLUSFLAGS = (
|
||||||
|
"$(SSE_CPPFLAGS)",
|
||||||
|
"$(WX_CXXFLAGS)",
|
||||||
|
);
|
||||||
PREBINDING = NO;
|
PREBINDING = NO;
|
||||||
PRODUCT_NAME = libsbsms;
|
PRODUCT_NAME = libsbsms;
|
||||||
};
|
};
|
||||||
|
@ -8823,8 +8824,14 @@
|
||||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||||
GCC_MODEL_TUNING = G5;
|
GCC_MODEL_TUNING = G5;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
|
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
|
||||||
OTHER_CFLAGS = "$(WX_CFLAGS)";
|
OTHER_CFLAGS = (
|
||||||
OTHER_CPLUSPLUSFLAGS = "$(WX_CXXFLAGS)";
|
"$(SSE_CPPFLAGS)",
|
||||||
|
"$(WX_CFLAGS)",
|
||||||
|
);
|
||||||
|
OTHER_CPLUSPLUSFLAGS = (
|
||||||
|
"$(SSE_CPPFLAGS)",
|
||||||
|
"$(WX_CXXFLAGS)",
|
||||||
|
);
|
||||||
PREBINDING = NO;
|
PREBINDING = NO;
|
||||||
PRODUCT_NAME = libsbsms;
|
PRODUCT_NAME = libsbsms;
|
||||||
};
|
};
|
||||||
|
@ -8838,8 +8845,14 @@
|
||||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||||
GCC_MODEL_TUNING = G5;
|
GCC_MODEL_TUNING = G5;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
|
GCC_PREPROCESSOR_DEFINITIONS = HAVE_CONFIG_H;
|
||||||
OTHER_CFLAGS = "$(WX_CFLAGS)";
|
OTHER_CFLAGS = (
|
||||||
OTHER_CPLUSPLUSFLAGS = "$(WX_CXXFLAGS)";
|
"$(SSE_CPPFLAGS)",
|
||||||
|
"$(WX_CFLAGS)",
|
||||||
|
);
|
||||||
|
OTHER_CPLUSPLUSFLAGS = (
|
||||||
|
"$(SSE_CPPFLAGS)",
|
||||||
|
"$(WX_CXXFLAGS)",
|
||||||
|
);
|
||||||
PREBINDING = NO;
|
PREBINDING = NO;
|
||||||
PRODUCT_NAME = libsbsms;
|
PRODUCT_NAME = libsbsms;
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@ SBSMSEffect.cpp
|
||||||
|
|
||||||
Clayton Otey
|
Clayton Otey
|
||||||
|
|
||||||
This abstract class contains all of the common code for an
|
This class contains all of the common code for an
|
||||||
effect that uses SBSMS to do its processing (TimeScale)
|
effect that uses SBSMS to do its processing (TimeScale)
|
||||||
|
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
@ -22,79 +22,90 @@ effect that uses SBSMS to do its processing (TimeScale)
|
||||||
#include "../Project.h"
|
#include "../Project.h"
|
||||||
#include "TimeWarper.h"
|
#include "TimeWarper.h"
|
||||||
|
|
||||||
class resampleBuf
|
enum {
|
||||||
|
SBSMSOutBlockSize = 512
|
||||||
|
};
|
||||||
|
|
||||||
|
class ResampleBuf
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
resampleBuf()
|
ResampleBuf()
|
||||||
{
|
{
|
||||||
|
processed = 0;
|
||||||
buf = NULL;
|
buf = NULL;
|
||||||
leftBuffer = NULL;
|
leftBuffer = NULL;
|
||||||
rightBuffer = NULL;
|
rightBuffer = NULL;
|
||||||
|
quality = NULL;
|
||||||
|
iface = NULL;
|
||||||
|
sbsms = NULL;
|
||||||
|
|
||||||
sbsmser = NULL;
|
resampler = NULL;
|
||||||
outBuf = NULL;
|
SBSMSBuf = NULL;
|
||||||
outputLeftBuffer = NULL;
|
|
||||||
outputRightBuffer = NULL;
|
|
||||||
outputLeftTrack = NULL;
|
outputLeftTrack = NULL;
|
||||||
outputRightTrack = NULL;
|
outputRightTrack = NULL;
|
||||||
resampler = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~resampleBuf()
|
~ResampleBuf()
|
||||||
{
|
{
|
||||||
if(buf) free(buf);
|
if(buf) free(buf);
|
||||||
if(leftBuffer) free(leftBuffer);
|
if(leftBuffer) free(leftBuffer);
|
||||||
if(rightBuffer) free(rightBuffer);
|
if(rightBuffer) free(rightBuffer);
|
||||||
if(sbsmser) sbsms_destroy(sbsmser);
|
if(SBSMSBuf) free(SBSMSBuf);
|
||||||
if(outBuf) free(outBuf);
|
|
||||||
if(outputLeftBuffer) free(outputLeftBuffer);
|
|
||||||
if(outputRightBuffer) free(outputRightBuffer);
|
|
||||||
if(outputLeftTrack) delete outputLeftTrack;
|
if(outputLeftTrack) delete outputLeftTrack;
|
||||||
if(outputRightTrack) delete outputRightTrack;
|
if(outputRightTrack) delete outputRightTrack;
|
||||||
|
if(quality) delete quality;
|
||||||
|
if(sbsms) delete sbsms;
|
||||||
|
if(iface) delete iface;
|
||||||
if(resampler) delete resampler;
|
if(resampler) delete resampler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool bPitch;
|
||||||
audio *buf;
|
audio *buf;
|
||||||
double ratio;
|
double ratio;
|
||||||
sampleCount block;
|
sampleCount processed;
|
||||||
|
sampleCount blockSize;
|
||||||
|
sampleCount SBSMSBlockSize;
|
||||||
sampleCount offset;
|
sampleCount offset;
|
||||||
sampleCount end;
|
sampleCount end;
|
||||||
float *leftBuffer;
|
float *leftBuffer;
|
||||||
float *rightBuffer;
|
float *rightBuffer;
|
||||||
WaveTrack *leftTrack;
|
WaveTrack *leftTrack;
|
||||||
WaveTrack *rightTrack;
|
WaveTrack *rightTrack;
|
||||||
|
SBSMS *sbsms;
|
||||||
|
SBSMSInterface *iface;
|
||||||
|
audio *SBSMSBuf;
|
||||||
|
|
||||||
// Not required by callbacks, but makes for easier cleanup
|
// Not required by callbacks, but makes for easier cleanup
|
||||||
sbsms *sbsmser;
|
Resampler *resampler;
|
||||||
audio *outBuf;
|
SBSMSQuality *quality;
|
||||||
float *outputLeftBuffer;
|
|
||||||
float *outputRightBuffer;
|
|
||||||
WaveTrack *outputLeftTrack;
|
WaveTrack *outputLeftTrack;
|
||||||
WaveTrack *outputRightTrack;
|
WaveTrack *outputRightTrack;
|
||||||
|
};
|
||||||
|
|
||||||
|
class SBSMSEffectInterface : public SBSMSInterfaceSliding {
|
||||||
|
public:
|
||||||
|
SBSMSEffectInterface(Resampler *resampler,
|
||||||
|
Slide *rateSlide, Slide *pitchSlide,
|
||||||
|
bool bReferenceInput,
|
||||||
|
long samples, long preSamples,
|
||||||
|
SBSMSQuality *quality)
|
||||||
|
: SBSMSInterfaceSliding(rateSlide,pitchSlide,bReferenceInput,samples,preSamples,quality)
|
||||||
|
{
|
||||||
|
this->resampler = resampler;
|
||||||
|
}
|
||||||
|
virtual ~SBSMSEffectInterface() {}
|
||||||
|
|
||||||
|
long samples(audio *buf, long n) {
|
||||||
|
return resampler->read(buf, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
Resampler *resampler;
|
Resampler *resampler;
|
||||||
};
|
};
|
||||||
|
|
||||||
long samplesCB(audio *chdata, long numFrames, void *userData)
|
long resampleCB(void *cb_data, SBSMSFrame *data)
|
||||||
{
|
{
|
||||||
sbsmsInfo *si = (sbsmsInfo*) userData;
|
ResampleBuf *r = (ResampleBuf*) cb_data;
|
||||||
long n_read = si->rs->read(chdata, numFrames);
|
|
||||||
return n_read;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EffectSBSMS :: setParameters(double rateStart, double rateEnd, double pitchStart, double pitchEnd, bool bPreAnalyze)
|
|
||||||
{
|
|
||||||
this->rateStart = rateStart;
|
|
||||||
this->rateEnd = rateEnd;
|
|
||||||
this->pitchStart = pitchStart;
|
|
||||||
this->pitchEnd = pitchEnd;
|
|
||||||
this->bPreAnalyze = bPreAnalyze;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool EffectSBSMS :: bInit = FALSE;
|
|
||||||
|
|
||||||
long resampleCB(void *cb_data, sbsms_resample_frame *data)
|
|
||||||
{
|
|
||||||
resampleBuf *r = (resampleBuf*) cb_data;
|
|
||||||
|
|
||||||
long blockSize = r->leftTrack->GetBestBlockSize(r->offset);
|
long blockSize = r->leftTrack->GetBestBlockSize(r->offset);
|
||||||
|
|
||||||
|
@ -112,29 +123,75 @@ long resampleCB(void *cb_data, sbsms_resample_frame *data)
|
||||||
r->buf[i][1] = r->rightBuffer[i];
|
r->buf[i][1] = r->rightBuffer[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
r->offset += blockSize;
|
data->buf = r->buf;
|
||||||
data->in = r->buf;
|
|
||||||
data->size = blockSize;
|
data->size = blockSize;
|
||||||
|
if(r->bPitch) {
|
||||||
|
float t0 = (float)(r->processed) / r->iface->getSamplesToInput();
|
||||||
|
float t1 = (float)(r->processed + blockSize) / r->iface->getSamplesToInput();
|
||||||
|
data->ratio0 = r->iface->getStretch(t0);
|
||||||
|
data->ratio1 = r->iface->getStretch(t1);
|
||||||
|
} else {
|
||||||
data->ratio0 = r->ratio;
|
data->ratio0 = r->ratio;
|
||||||
data->ratio1 = r->ratio;
|
data->ratio1 = r->ratio;
|
||||||
|
}
|
||||||
|
r->processed += blockSize;
|
||||||
|
r->offset += blockSize;
|
||||||
return blockSize;
|
return blockSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long postResampleCB(void *cb_data, SBSMSFrame *data)
|
||||||
|
{
|
||||||
|
ResampleBuf *r = (ResampleBuf*) cb_data;
|
||||||
|
long sampleCount = r->sbsms->read(r->iface, r->SBSMSBuf, r->SBSMSBlockSize);
|
||||||
|
data->buf = r->SBSMSBuf;
|
||||||
|
data->size = sampleCount;
|
||||||
|
data->ratio0 = 1.0 / r->ratio;
|
||||||
|
data->ratio1 = 1.0 / r->ratio;
|
||||||
|
return sampleCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EffectSBSMS :: setParameters(double rateStart, double rateEnd, double pitchStart, double pitchEnd,
|
||||||
|
SlideType rateSlideType, SlideType pitchSlideType,
|
||||||
|
bool bLinkRatePitch, bool bRateReferenceInput, bool bPitchReferenceInput)
|
||||||
|
{
|
||||||
|
this->rateStart = rateStart;
|
||||||
|
this->rateEnd = rateEnd;
|
||||||
|
this->pitchStart = pitchStart;
|
||||||
|
this->pitchEnd = pitchEnd;
|
||||||
|
this->bLinkRatePitch = bLinkRatePitch;
|
||||||
|
this->rateSlideType = rateSlideType;
|
||||||
|
this->pitchSlideType = pitchSlideType;
|
||||||
|
this->bRateReferenceInput = bRateReferenceInput;
|
||||||
|
this->bPitchReferenceInput = bPitchReferenceInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
TimeWarper *createTimeWarper(double t0, double t1, double duration,
|
||||||
|
double rateStart, double rateEnd, SlideType rateSlideType)
|
||||||
|
{
|
||||||
|
TimeWarper *warper = NULL;
|
||||||
|
if (rateStart == rateEnd || rateSlideType == SlideConstant) {
|
||||||
|
warper = new LinearTimeWarper(t0, t0, t1, t0+duration);
|
||||||
|
} else if(rateSlideType == SlideLinearInputRate) {
|
||||||
|
warper = new LinearInputRateTimeWarper(t0, t1, rateStart, rateEnd);
|
||||||
|
} else if(rateSlideType == SlideLinearOutputRate) {
|
||||||
|
warper = new LinearOutputRateTimeWarper(t0, t1, rateStart, rateEnd);
|
||||||
|
} else if(rateSlideType == SlideLinearInputStretch) {
|
||||||
|
warper = new LinearInputStretchTimeWarper(t0, t1, rateStart, rateEnd);
|
||||||
|
} else if(rateSlideType == SlideLinearOutputStretch) {
|
||||||
|
warper = new LinearOutputStretchTimeWarper(t0, t1, rateStart, rateEnd);
|
||||||
|
} else if(rateSlideType == SlideGeometricInput) {
|
||||||
|
warper = new GeometricInputTimeWarper(t0, t1, rateStart, rateEnd);
|
||||||
|
} else if(rateSlideType == SlideGeometricOutput) {
|
||||||
|
warper = new GeometricOutputTimeWarper(t0, t1, rateStart, rateEnd);
|
||||||
|
}
|
||||||
|
return warper;
|
||||||
|
}
|
||||||
|
|
||||||
// Labels inside the affected region are moved to match the audio; labels after
|
// Labels inside the affected region are moved to match the audio; labels after
|
||||||
// it are shifted along appropriately.
|
// it are shifted along appropriately.
|
||||||
bool EffectSBSMS::ProcessLabelTrack(Track *t)
|
bool EffectSBSMS::ProcessLabelTrack(Track *t)
|
||||||
{
|
{
|
||||||
TimeWarper *warper = NULL;
|
TimeWarper *warper = createTimeWarper(mT0,mT1,(mT1-mT0)*mTotalStretch,rateStart,rateEnd,rateSlideType);
|
||||||
if (rateStart == rateEnd)
|
|
||||||
{
|
|
||||||
warper = new LinearTimeWarper(mT0, mT0,
|
|
||||||
mT1, mT0+(mT1-mT0)*mTotalStretch);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
warper = new LogarithmicTimeWarper(mT0, mT1,
|
|
||||||
rateStart, rateEnd);
|
|
||||||
}
|
|
||||||
SetTimeWarper(new RegionTimeWarper(mT0, mT1, warper));
|
SetTimeWarper(new RegionTimeWarper(mT0, mT1, warper));
|
||||||
LabelTrack *lt = (LabelTrack*)t;
|
LabelTrack *lt = (LabelTrack*)t;
|
||||||
if (lt == NULL) return false;
|
if (lt == NULL) return false;
|
||||||
|
@ -144,16 +201,10 @@ bool EffectSBSMS::ProcessLabelTrack(Track *t)
|
||||||
|
|
||||||
bool EffectSBSMS::Process()
|
bool EffectSBSMS::Process()
|
||||||
{
|
{
|
||||||
if(!bInit) {
|
|
||||||
sbsms_init(8192);
|
|
||||||
bInit = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool bGoodResult = true;
|
bool bGoodResult = true;
|
||||||
|
|
||||||
//Iterate over each track
|
//Iterate over each track
|
||||||
// Track::All is needed because this effect needs to introduce
|
//Track::All is needed because this effect needs to introduce silence in the group tracks to keep sync
|
||||||
// silence in the group tracks to keep sync-lock.
|
|
||||||
this->CopyInputTracks(Track::All); // Set up mOutputTracks.
|
this->CopyInputTracks(Track::All); // Set up mOutputTracks.
|
||||||
TrackListIterator iter(mOutputTracks);
|
TrackListIterator iter(mOutputTracks);
|
||||||
Track* t;
|
Track* t;
|
||||||
|
@ -161,13 +212,11 @@ bool EffectSBSMS::Process()
|
||||||
|
|
||||||
double maxDuration = 0.0;
|
double maxDuration = 0.0;
|
||||||
|
|
||||||
if(rateStart == rateEnd)
|
|
||||||
mTotalStretch = 1.0/rateStart;
|
|
||||||
else
|
|
||||||
mTotalStretch = 1.0/(rateEnd-rateStart)*log(rateEnd/rateStart);
|
|
||||||
|
|
||||||
// Must sync if selection length will change
|
// Must sync if selection length will change
|
||||||
bool mustSync = (mTotalStretch != 1.0);
|
bool mustSync = (rateStart != rateEnd);
|
||||||
|
Slide rateSlide(rateSlideType,rateStart,rateEnd);
|
||||||
|
Slide pitchSlide(pitchSlideType,pitchStart,pitchEnd);
|
||||||
|
mTotalStretch = rateSlide.getTotalStretch();
|
||||||
|
|
||||||
t = iter.First();
|
t = iter.First();
|
||||||
while (t != NULL) {
|
while (t != NULL) {
|
||||||
|
@ -218,131 +267,116 @@ bool EffectSBSMS::Process()
|
||||||
|
|
||||||
mCurTrackNum++; // Increment for rightTrack, too.
|
mCurTrackNum++; // Increment for rightTrack, too.
|
||||||
}
|
}
|
||||||
|
sampleCount trackStart = leftTrack->TimeToLongSamples(leftTrack->GetStartTime());
|
||||||
sampleCount trackEnd = leftTrack->TimeToLongSamples(leftTrack->GetEndTime());
|
sampleCount trackEnd = leftTrack->TimeToLongSamples(leftTrack->GetEndTime());
|
||||||
|
|
||||||
// SBSMS has a fixed sample rate - we just convert to its sample rate and then convert back
|
// SBSMS has a fixed sample rate - we just convert to its sample rate and then convert back
|
||||||
float srIn = leftTrack->GetRate();
|
float srTrack = leftTrack->GetRate();
|
||||||
// mchinen: srSBMS doesn't do the right thing when it was set to fixed 44100. This seems to fix it.
|
float srProcess = bLinkRatePitch?srTrack:44100.0;
|
||||||
float srSBSMS = leftTrack->GetRate();
|
|
||||||
|
|
||||||
// the resampler needs a callback to supply its samples
|
// the resampler needs a callback to supply its samples
|
||||||
resampleBuf rb;
|
ResampleBuf rb;
|
||||||
sampleCount maxBlockSize = leftTrack->GetMaxBlockSize();
|
sampleCount maxBlockSize = leftTrack->GetMaxBlockSize();
|
||||||
rb.block = maxBlockSize;
|
rb.blockSize = maxBlockSize;
|
||||||
rb.buf = (audio*)calloc(rb.block,sizeof(audio));
|
rb.buf = (audio*)calloc(rb.blockSize,sizeof(audio));
|
||||||
rb.leftTrack = leftTrack;
|
rb.leftTrack = leftTrack;
|
||||||
rb.rightTrack = rightTrack?rightTrack:leftTrack;
|
rb.rightTrack = rightTrack?rightTrack:leftTrack;
|
||||||
rb.leftBuffer = (float*)calloc(maxBlockSize,sizeof(float));
|
rb.leftBuffer = (float*)calloc(maxBlockSize,sizeof(float));
|
||||||
rb.rightBuffer = (float*)calloc(maxBlockSize,sizeof(float));
|
rb.rightBuffer = (float*)calloc(maxBlockSize,sizeof(float));
|
||||||
rb.offset = start;
|
|
||||||
rb.end = trackEnd;
|
|
||||||
rb.ratio = srSBSMS/srIn;
|
|
||||||
rb.resampler = new Resampler(resampleCB, &rb);
|
|
||||||
|
|
||||||
// Samples in selection
|
// Samples in selection
|
||||||
sampleCount samplesIn = end-start;
|
sampleCount samplesIn = end-start;
|
||||||
|
|
||||||
// Samples for SBSMS to process after resampling
|
// Samples for SBSMS to process after resampling
|
||||||
sampleCount samplesToProcess = (sampleCount) ((real)samplesIn*(srSBSMS/srIn));
|
sampleCount samplesToProcess = (sampleCount) ((float)samplesIn*(srProcess/srTrack));
|
||||||
|
|
||||||
|
SlideType outSlideType;
|
||||||
|
SBSMSResampleCB outResampleCB;
|
||||||
|
|
||||||
|
sampleCount processPresamples = 0;
|
||||||
|
sampleCount trackPresamples = 0;
|
||||||
|
|
||||||
|
if(bLinkRatePitch) {
|
||||||
|
rb.bPitch = true;
|
||||||
|
outSlideType = rateSlideType;
|
||||||
|
outResampleCB = resampleCB;
|
||||||
|
rb.offset = start;
|
||||||
|
rb.end = end;
|
||||||
|
rb.iface = new SBSMSInterfaceSliding(&rateSlide,&pitchSlide,
|
||||||
|
bPitchReferenceInput,
|
||||||
|
samplesToProcess,0,
|
||||||
|
NULL);
|
||||||
|
} else {
|
||||||
|
rb.bPitch = false;
|
||||||
|
outSlideType = (srProcess==srTrack?SlideIdentity:SlideConstant);
|
||||||
|
outResampleCB = postResampleCB;
|
||||||
|
rb.ratio = srProcess/srTrack;
|
||||||
|
rb.quality = new SBSMSQuality(&SBSMSQualityStandard);
|
||||||
|
rb.resampler = new Resampler(resampleCB, &rb, srProcess==srTrack?SlideIdentity:SlideConstant);
|
||||||
|
rb.sbsms = new SBSMS(rightTrack?2:1,rb.quality,true);
|
||||||
|
rb.SBSMSBlockSize = rb.sbsms->getInputFrameSize();
|
||||||
|
rb.SBSMSBuf = (audio*)calloc(rb.SBSMSBlockSize,sizeof(audio));
|
||||||
|
|
||||||
|
processPresamples = wxMin(rb.quality->getMaxPresamples(),
|
||||||
|
(long)((float)(start-trackStart)*(srProcess/srTrack)));
|
||||||
|
trackPresamples = wxMin(start-trackStart,
|
||||||
|
(long)((float)(processPresamples)*(srTrack/srProcess)));
|
||||||
|
rb.offset = start - trackPresamples;
|
||||||
|
rb.end = trackEnd;
|
||||||
|
rb.iface = new SBSMSEffectInterface(rb.resampler,
|
||||||
|
&rateSlide,&pitchSlide,
|
||||||
|
bPitchReferenceInput,
|
||||||
|
samplesToProcess,processPresamples,
|
||||||
|
rb.quality);
|
||||||
|
}
|
||||||
|
|
||||||
|
Resampler resampler(outResampleCB,&rb,outSlideType);
|
||||||
|
|
||||||
|
audio outBuf[SBSMSOutBlockSize];
|
||||||
|
float outBufLeft[2*SBSMSOutBlockSize];
|
||||||
|
float outBufRight[2*SBSMSOutBlockSize];
|
||||||
|
|
||||||
|
// Samples in output after SBSMS
|
||||||
|
sampleCount samplesToOutput = rb.iface->getSamplesToOutput();
|
||||||
|
|
||||||
// Samples in output after resampling back
|
// Samples in output after resampling back
|
||||||
sampleCount samplesToGenerate = (sampleCount) ((real)samplesToProcess * mTotalStretch);
|
sampleCount samplesOut = (sampleCount) ((float)samplesToOutput * (srTrack/srProcess));
|
||||||
sampleCount samplesOut = (sampleCount) ((real)samplesIn * mTotalStretch);
|
|
||||||
|
// Duration in track time
|
||||||
double duration = (mCurT1-mCurT0) * mTotalStretch;
|
double duration = (mCurT1-mCurT0) * mTotalStretch;
|
||||||
|
|
||||||
if(duration > maxDuration)
|
if(duration > maxDuration)
|
||||||
maxDuration = duration;
|
maxDuration = duration;
|
||||||
|
|
||||||
TimeWarper *warper = NULL;
|
TimeWarper *warper = createTimeWarper(mCurT0,mCurT1,maxDuration,rateStart,rateEnd,rateSlideType);
|
||||||
if (rateStart == rateEnd)
|
|
||||||
{
|
|
||||||
warper = new LinearTimeWarper(mCurT0, mCurT0,
|
|
||||||
mCurT1, mCurT0+maxDuration);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
warper = new LogarithmicTimeWarper(mCurT0, mCurT1,
|
|
||||||
rateStart, rateEnd);
|
|
||||||
}
|
|
||||||
SetTimeWarper(warper);
|
SetTimeWarper(warper);
|
||||||
|
|
||||||
sbsmsInfo si;
|
|
||||||
si.rs = rb.resampler;
|
|
||||||
si.samplesToProcess = samplesToProcess;
|
|
||||||
si.samplesToGenerate = samplesToGenerate;
|
|
||||||
si.rate0 = rateStart;
|
|
||||||
si.rate1 = rateEnd;
|
|
||||||
si.pitch0 = pitchStart;
|
|
||||||
si.pitch1 = pitchEnd;
|
|
||||||
|
|
||||||
sbsms_quality quality = sbsms_quality_fast;
|
|
||||||
rb.sbsmser = sbsms_create(&samplesCB,&rateCBLinear,&pitchCBLinear,rightTrack?2:1,&quality,bPreAnalyze,true);
|
|
||||||
|
|
||||||
rb.outputLeftTrack = mFactory->NewWaveTrack(leftTrack->GetSampleFormat(),
|
rb.outputLeftTrack = mFactory->NewWaveTrack(leftTrack->GetSampleFormat(),
|
||||||
leftTrack->GetRate());
|
leftTrack->GetRate());
|
||||||
if(rightTrack)
|
if(rightTrack)
|
||||||
rb.outputRightTrack = mFactory->NewWaveTrack(rightTrack->GetSampleFormat(),
|
rb.outputRightTrack = mFactory->NewWaveTrack(rightTrack->GetSampleFormat(),
|
||||||
rightTrack->GetRate());
|
rightTrack->GetRate());
|
||||||
|
|
||||||
|
|
||||||
sampleCount blockSize = quality.maxoutframesize;
|
|
||||||
rb.outBuf = (audio*)calloc(blockSize,sizeof(audio));
|
|
||||||
rb.outputLeftBuffer = (float*)calloc(blockSize*2,sizeof(float));
|
|
||||||
if(rightTrack)
|
|
||||||
rb.outputRightBuffer = (float*)calloc(blockSize*2,sizeof(float));
|
|
||||||
|
|
||||||
long pos = 0;
|
long pos = 0;
|
||||||
long outputCount = -1;
|
long outputCount = -1;
|
||||||
|
|
||||||
// pre analysis
|
|
||||||
real fracPre = 0.0f;
|
|
||||||
if(bPreAnalyze) {
|
|
||||||
fracPre = 0.05f;
|
|
||||||
resampleBuf rbPre;
|
|
||||||
rbPre.block = maxBlockSize;
|
|
||||||
rbPre.buf = (audio*)calloc(rb.block,sizeof(audio));
|
|
||||||
rbPre.leftTrack = leftTrack;
|
|
||||||
rbPre.rightTrack = rightTrack?rightTrack:leftTrack;
|
|
||||||
rbPre.leftBuffer = (float*)calloc(maxBlockSize,sizeof(float));
|
|
||||||
rbPre.rightBuffer = (float*)calloc(maxBlockSize,sizeof(float));
|
|
||||||
rbPre.offset = start;
|
|
||||||
rbPre.end = end;
|
|
||||||
rbPre.ratio = srSBSMS/srIn;
|
|
||||||
rbPre.resampler = new Resampler(resampleCB, &rbPre);
|
|
||||||
si.rs = rbPre.resampler;
|
|
||||||
|
|
||||||
long pos = 0;
|
|
||||||
long lastPos = 0;
|
|
||||||
long ret = 0;
|
|
||||||
while(lastPos<samplesToProcess) {
|
|
||||||
ret = sbsms_pre_analyze(&samplesCB,&si,rb.sbsmser);
|
|
||||||
lastPos = pos;
|
|
||||||
pos += ret;
|
|
||||||
real completion = (real)lastPos/(real)samplesToProcess;
|
|
||||||
if (TrackProgress(0,fracPre*completion))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
sbsms_pre_analyze_complete(rb.sbsmser);
|
|
||||||
sbsms_reset(rb.sbsmser);
|
|
||||||
si.rs = rb.resampler;
|
|
||||||
}
|
|
||||||
|
|
||||||
// process
|
// process
|
||||||
while(pos<samplesOut && outputCount) {
|
while(pos<samplesOut && outputCount) {
|
||||||
outputCount = sbsms_read_frame(rb.outBuf, &si, rb.sbsmser, NULL, NULL);
|
long frames;
|
||||||
if(pos+outputCount>samplesOut) {
|
if(pos+SBSMSOutBlockSize>samplesOut) {
|
||||||
outputCount = samplesOut - pos;
|
frames = samplesOut - pos;
|
||||||
|
} else {
|
||||||
|
frames = SBSMSOutBlockSize;
|
||||||
}
|
}
|
||||||
|
outputCount = resampler.read(outBuf,frames);
|
||||||
for(int i = 0; i < outputCount; i++) {
|
for(int i = 0; i < outputCount; i++) {
|
||||||
rb.outputLeftBuffer[i] = rb.outBuf[i][0];
|
outBufLeft[i] = outBuf[i][0];
|
||||||
if(rightTrack)
|
if(rightTrack)
|
||||||
rb.outputRightBuffer[i] = rb.outBuf[i][1];
|
outBufRight[i] = outBuf[i][1];
|
||||||
}
|
}
|
||||||
pos += outputCount;
|
pos += outputCount;
|
||||||
rb.outputLeftTrack->Append((samplePtr)rb.outputLeftBuffer, floatSample, outputCount);
|
rb.outputLeftTrack->Append((samplePtr)outBufLeft, floatSample, outputCount);
|
||||||
if(rightTrack)
|
if(rightTrack)
|
||||||
rb.outputRightTrack->Append((samplePtr)rb.outputRightBuffer, floatSample, outputCount);
|
rb.outputRightTrack->Append((samplePtr)outBufRight, floatSample, outputCount);
|
||||||
|
|
||||||
double frac = (double)pos/(double)samplesOut;
|
double frac = (double)pos/(double)samplesOut;
|
||||||
int nWhichTrack = mCurTrackNum;
|
int nWhichTrack = mCurTrackNum;
|
||||||
|
@ -356,7 +390,7 @@ bool EffectSBSMS::Process()
|
||||||
frac *= 2.0; // Show twice as far for each track, because we're doing 2 at once.
|
frac *= 2.0; // Show twice as far for each track, because we're doing 2 at once.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (TrackProgress(nWhichTrack, fracPre + (1.0-fracPre)*frac))
|
if (TrackProgress(nWhichTrack, frac))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
rb.outputLeftTrack->Flush();
|
rb.outputLeftTrack->Flush();
|
||||||
|
|
|
@ -21,22 +21,23 @@
|
||||||
#include "sbsms.h"
|
#include "sbsms.h"
|
||||||
using namespace _sbsms_;
|
using namespace _sbsms_;
|
||||||
|
|
||||||
class WaveTrack;
|
|
||||||
|
|
||||||
class EffectSBSMS : public Effect {
|
class EffectSBSMS : public Effect {
|
||||||
public:
|
public:
|
||||||
static bool bInit;
|
|
||||||
virtual bool Process();
|
virtual bool Process();
|
||||||
void setParameters(double rateStart, double rateEnd, double pitchStart, double pitchEnd, bool bPreAnalyze);
|
void setParameters(double rateStart, double rateEnd, double pitchStart, double pitchEnd,
|
||||||
|
SlideType rateSlideType, SlideType pitchSlideType,
|
||||||
|
bool bLinkRatePitch, bool bRateReferenceInput, bool bPitchReferenceInput);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool ProcessLabelTrack(Track *track);
|
bool ProcessLabelTrack(Track *track);
|
||||||
double rateStart, rateEnd, pitchStart, pitchEnd;
|
double rateStart, rateEnd, pitchStart, pitchEnd;
|
||||||
bool bPreAnalyze;
|
bool bLinkRatePitch, bRateReferenceInput, bPitchReferenceInput;
|
||||||
|
SlideType rateSlideType;
|
||||||
|
SlideType pitchSlideType;
|
||||||
int mCurTrackNum;
|
int mCurTrackNum;
|
||||||
double mCurT0;
|
double mCurT0;
|
||||||
double mCurT1;
|
double mCurT1;
|
||||||
real mTotalStretch;
|
float mTotalStretch;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#if USE_SBSMS
|
#if USE_SBSMS
|
||||||
|
|
||||||
#include "TimeScale.h"
|
#include "TimeScale.h"
|
||||||
|
#include "sbsms.h"
|
||||||
|
|
||||||
#include "../ShuttleGui.h"
|
#include "../ShuttleGui.h"
|
||||||
|
|
||||||
|
@ -103,12 +104,6 @@ bool EffectTimeScale::TransferParameters( Shuttle & shuttle )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double InvertedPercentChangeToRatio(double percentChange)
|
|
||||||
{
|
|
||||||
//mchinen hack: invert the ratio so it works with the sbsms bug which requires the reciprocal number.
|
|
||||||
return 1.0/(1.0 + percentChange / 100.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline double PercentChangeToRatio(double percentChange)
|
inline double PercentChangeToRatio(double percentChange)
|
||||||
{
|
{
|
||||||
return 1.0 + percentChange / 100.0;
|
return 1.0 + percentChange / 100.0;
|
||||||
|
@ -121,19 +116,16 @@ inline double HalfStepsToPercentChange(double halfSteps)
|
||||||
|
|
||||||
inline double PercentChangeToHalfSteps(double percentChange)
|
inline double PercentChangeToHalfSteps(double percentChange)
|
||||||
{
|
{
|
||||||
// mchinen: hack: take the negative of this so the correct value is displayed
|
|
||||||
// (see the InvertedPercentChangeToRatio hack for why this is needed)
|
|
||||||
return 17.312340490667560888319096172023 * log(PercentChangeToRatio(percentChange));
|
return 17.312340490667560888319096172023 * log(PercentChangeToRatio(percentChange));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EffectTimeScale::Process()
|
bool EffectTimeScale::Process()
|
||||||
{
|
{
|
||||||
// The pitch part of sbsms is backwards, so use an inverted function
|
double pitchStart = PercentChangeToRatio(m_PitchPercentChangeStart);
|
||||||
double pitchStart = InvertedPercentChangeToRatio(m_PitchPercentChangeStart);
|
double pitchEnd = PercentChangeToRatio(m_PitchPercentChangeEnd);
|
||||||
double pitchEnd = InvertedPercentChangeToRatio(m_PitchPercentChangeEnd);
|
|
||||||
double rateStart = PercentChangeToRatio(m_RatePercentChangeStart);
|
double rateStart = PercentChangeToRatio(m_RatePercentChangeStart);
|
||||||
double rateEnd = PercentChangeToRatio(m_RatePercentChangeEnd);
|
double rateEnd = PercentChangeToRatio(m_RatePercentChangeEnd);
|
||||||
this->EffectSBSMS::setParameters(rateStart,rateEnd,pitchStart,pitchEnd,m_PreAnalyze);
|
this->EffectSBSMS::setParameters(rateStart,rateEnd,pitchStart,pitchEnd,SlideLinearOutputRate,SlideLinearOutputRate,false,false,false);
|
||||||
return this->EffectSBSMS::Process();
|
return this->EffectSBSMS::Process();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,21 +291,6 @@ void TimeScaleDialog::PopulateOrExchange(ShuttleGui & S)
|
||||||
S.EndStatic();
|
S.EndStatic();
|
||||||
S.EndMultiColumn();
|
S.EndMultiColumn();
|
||||||
|
|
||||||
S.StartStatic(_("Options"));
|
|
||||||
{
|
|
||||||
S.StartHorizontalLay(wxEXPAND);
|
|
||||||
{
|
|
||||||
S.SetStyle(wxSL_HORIZONTAL);
|
|
||||||
/* i18n-hint: Transients are sounds like the onset of cymbals or drums.
|
|
||||||
They can get 'blurred' by sound stretching. This checkbox option
|
|
||||||
may make them sharper again. */
|
|
||||||
m_pCheckBox_PreAnalyze = S.Id(ID_CHECKBOX_PREANALYZE)
|
|
||||||
.AddCheckBox(_("Dynamic Transient Sharpening"), wxT("false"));
|
|
||||||
}
|
|
||||||
S.EndHorizontalLay();
|
|
||||||
}
|
|
||||||
S.EndStatic();
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
|
|
||||||
\file TimeWarper.cpp
|
\file TimeWarper.cpp
|
||||||
\brief Contains definitions for IdentityTimeWarper, ShiftTimeWarper,
|
\brief Contains definitions for IdentityTimeWarper, ShiftTimeWarper,
|
||||||
LinearTimeWarper, LogarithmicTimeWarper classes
|
LinearTimeWarper, LogarithmicTimeWarper, QuadraticTimeWarper,
|
||||||
|
Geometric TimeWarper classes
|
||||||
|
|
||||||
*//*******************************************************************/
|
*//*******************************************************************/
|
||||||
|
|
||||||
|
@ -33,13 +34,13 @@ double LinearTimeWarper::Warp(double originalTime) const
|
||||||
return originalTime*mScale + mShift;
|
return originalTime*mScale + mShift;
|
||||||
}
|
}
|
||||||
|
|
||||||
double LogarithmicTimeWarper::Warp(double originalTime) const
|
double LinearInputRateTimeWarper::Warp(double originalTime) const
|
||||||
{
|
{
|
||||||
double rate = mRateWarper.Warp(originalTime);
|
double rate = mRateWarper.Warp(originalTime);
|
||||||
return mTStart + mScale*log(rate/mRStart);
|
return mTStart + mScale*log(rate/mRStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogarithmicTimeWarper::LogarithmicTimeWarper(double tStart, double tEnd,
|
LinearInputRateTimeWarper::LinearInputRateTimeWarper(double tStart, double tEnd,
|
||||||
double rStart, double rEnd)
|
double rStart, double rEnd)
|
||||||
: mRateWarper(tStart, rStart, tEnd, rEnd), mRStart(rStart),
|
: mRateWarper(tStart, rStart, tEnd, rEnd), mRStart(rStart),
|
||||||
mTStart(tStart), mScale((tEnd-tStart)/(rEnd-rStart))
|
mTStart(tStart), mScale((tEnd-tStart)/(rEnd-rStart))
|
||||||
|
@ -48,6 +49,91 @@ LogarithmicTimeWarper::LogarithmicTimeWarper(double tStart, double tEnd,
|
||||||
wxASSERT(tStart < tEnd);
|
wxASSERT(tStart < tEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double LinearOutputRateTimeWarper::Warp(double originalTime) const
|
||||||
|
{
|
||||||
|
double scaledTime = mTimeWarper.Warp(originalTime);
|
||||||
|
return mTStart + mScale*(sqrt(mC1 + scaledTime * mC2) - mRStart);
|
||||||
|
}
|
||||||
|
|
||||||
|
LinearOutputRateTimeWarper::LinearOutputRateTimeWarper(double tStart, double tEnd,
|
||||||
|
double rStart, double rEnd)
|
||||||
|
: mTimeWarper(tStart, 0.0, tEnd, 1.0),
|
||||||
|
mRStart(rStart), mTStart(tStart),
|
||||||
|
mScale(2.0*(tEnd-tStart)/(rEnd*rEnd-rStart*rStart)),
|
||||||
|
mC1(rStart*rStart), mC2(rEnd*rEnd-rStart*rStart)
|
||||||
|
{
|
||||||
|
wxASSERT(rStart != rEnd);
|
||||||
|
wxASSERT(rStart > 0.0);
|
||||||
|
wxASSERT(rEnd > 0.0);
|
||||||
|
wxASSERT(tStart < tEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
double LinearInputStretchTimeWarper::Warp(double originalTime) const
|
||||||
|
{
|
||||||
|
double scaledTime = mTimeWarper.Warp(originalTime);
|
||||||
|
return mTStart + mC1 * scaledTime * (1.0 + mC2 * scaledTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
LinearInputStretchTimeWarper::LinearInputStretchTimeWarper(double tStart, double tEnd,
|
||||||
|
double rStart, double rEnd)
|
||||||
|
: mTimeWarper(tStart, 0.0, tEnd, 1.0), mTStart(tStart),
|
||||||
|
mC1((tEnd-tStart)/rStart), mC2(0.5*(rStart/rEnd - 1.0))
|
||||||
|
{
|
||||||
|
wxASSERT(rStart > 0.0);
|
||||||
|
wxASSERT(rEnd > 0.0);
|
||||||
|
wxASSERT(tStart < tEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
double LinearOutputStretchTimeWarper::Warp(double originalTime) const
|
||||||
|
{
|
||||||
|
double scaledTime = mTimeWarper.Warp(originalTime);
|
||||||
|
return mTStart + mC1 * (pow(mC2, scaledTime) - 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
LinearOutputStretchTimeWarper::LinearOutputStretchTimeWarper(double tStart, double tEnd,
|
||||||
|
double rStart, double rEnd)
|
||||||
|
: mTimeWarper(tStart, 0.0, tEnd, 1.0), mTStart(tStart),
|
||||||
|
mC1((tEnd-tStart)/(rStart*log(rStart/rEnd))), mC2(rStart/rEnd)
|
||||||
|
{
|
||||||
|
wxASSERT(rStart != rEnd);
|
||||||
|
wxASSERT(rStart > 0.0);
|
||||||
|
wxASSERT(rEnd > 0.0);
|
||||||
|
wxASSERT(tStart < tEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
double GeometricInputTimeWarper::Warp(double originalTime) const
|
||||||
|
{
|
||||||
|
double scaledTime = mTimeWarper.Warp(originalTime);
|
||||||
|
return mTStart + mScale*(pow(mRatio,scaledTime) - 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
GeometricInputTimeWarper::GeometricInputTimeWarper(double tStart, double tEnd,
|
||||||
|
double rStart, double rEnd)
|
||||||
|
: mTimeWarper(tStart, 0.0, tEnd, 1.0), mTStart(tStart),
|
||||||
|
mScale((tEnd-tStart)/(log(rStart/rEnd)*rStart)), mRatio(rStart/rEnd)
|
||||||
|
{
|
||||||
|
wxASSERT(rStart != rEnd);
|
||||||
|
wxASSERT(rStart > 0.0);
|
||||||
|
wxASSERT(rEnd > 0.0);
|
||||||
|
wxASSERT(tStart < tEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
double GeometricOutputTimeWarper::Warp(double originalTime) const
|
||||||
|
{
|
||||||
|
double scaledTime = mTimeWarper.Warp(originalTime);
|
||||||
|
return mTStart + mScale*log(mC0 * scaledTime + 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
GeometricOutputTimeWarper::GeometricOutputTimeWarper(double tStart, double tEnd,
|
||||||
|
double rStart, double rEnd)
|
||||||
|
: mTimeWarper(tStart, 0.0, tEnd, 1.0), mTStart(tStart),
|
||||||
|
mScale((tEnd-tStart)/(rEnd-rStart)), mC0((rEnd-rStart)/rStart)
|
||||||
|
{
|
||||||
|
wxASSERT(rStart > 0.0);
|
||||||
|
wxASSERT(rEnd > 0.0);
|
||||||
|
wxASSERT(tStart < tEnd);
|
||||||
|
}
|
||||||
|
|
||||||
StepTimeWarper::StepTimeWarper(double tStep, double offset)
|
StepTimeWarper::StepTimeWarper(double tStep, double offset)
|
||||||
: mTStep(tStep), mOffset(offset)
|
: mTStep(tStep), mOffset(offset)
|
||||||
{ }
|
{ }
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
|
|
||||||
\file TimeWarper.h
|
\file TimeWarper.h
|
||||||
\brief Contains declarations for TimeWarper, IdentityTimeWarper,
|
\brief Contains declarations for TimeWarper, IdentityTimeWarper,
|
||||||
ShiftTimeWarper, LinearTimeWarper, LogarithmicTimeWarper classes
|
ShiftTimeWarper, LinearTimeWarper, LinearInputRateSlideTimeWarper,
|
||||||
|
LinearOutputRateSlideTimeWarper, LinearInputInverseRateTimeWarper,
|
||||||
|
GeometricInputRateTimeWarper, GeometricOutputRateTimeWarper classes
|
||||||
|
|
||||||
\class TimeWarper
|
\class TimeWarper
|
||||||
\brief Transforms one point in time to another point. For example, a time
|
\brief Transforms one point in time to another point. For example, a time
|
||||||
|
@ -26,8 +28,20 @@ split points in the input.
|
||||||
\class LinearTimeWarper
|
\class LinearTimeWarper
|
||||||
\brief Linear scaling, initialised by giving two points on the line
|
\brief Linear scaling, initialised by giving two points on the line
|
||||||
|
|
||||||
\class LogarithmicTimeWarper
|
\class LinearInputRateTimeWarper
|
||||||
\brief TimeScale - rate varies linearly, so time changes logarithmically.
|
\brief TimeScale - rate varies linearly with input
|
||||||
|
|
||||||
|
\class LinearOutputRateTimeWarper
|
||||||
|
\brief TimeScale - rate varies linearly with output
|
||||||
|
|
||||||
|
\class LinearInputInverseRateTimeWarper
|
||||||
|
\brief TimeScale - inverse rate varies linearly with input
|
||||||
|
|
||||||
|
\class GeometricInputRateTimeWarper
|
||||||
|
\brief TimeScale - rate varies geometrically with input
|
||||||
|
|
||||||
|
\class GeometricOutputRateTimeWarper
|
||||||
|
\brief TimeScale - rate varies geometrically with output
|
||||||
|
|
||||||
\class StepTimeWarper
|
\class StepTimeWarper
|
||||||
\brief Like identity but with a jump
|
\brief Like identity but with a jump
|
||||||
|
@ -82,7 +96,7 @@ public:
|
||||||
virtual double Warp(double originalTime) const;
|
virtual double Warp(double originalTime) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LogarithmicTimeWarper : public TimeWarper
|
class LinearInputRateTimeWarper : public TimeWarper
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
LinearTimeWarper mRateWarper;
|
LinearTimeWarper mRateWarper;
|
||||||
|
@ -90,7 +104,74 @@ private:
|
||||||
double mTStart;
|
double mTStart;
|
||||||
double mScale;
|
double mScale;
|
||||||
public:
|
public:
|
||||||
LogarithmicTimeWarper(double tStart, double tEnd,
|
LinearInputRateTimeWarper(double tStart, double tEnd,
|
||||||
|
double rStart, double rEnd);
|
||||||
|
virtual double Warp(double originalTime) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
class LinearOutputRateTimeWarper : public TimeWarper
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
LinearTimeWarper mTimeWarper;
|
||||||
|
double mRStart;
|
||||||
|
double mTStart;
|
||||||
|
double mScale;
|
||||||
|
double mC1;
|
||||||
|
double mC2;
|
||||||
|
public:
|
||||||
|
LinearOutputRateTimeWarper(double tStart, double tEnd,
|
||||||
|
double rStart, double rEnd);
|
||||||
|
virtual double Warp(double originalTime) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
class LinearInputStretchTimeWarper : public TimeWarper
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
LinearTimeWarper mTimeWarper;
|
||||||
|
double mTStart;
|
||||||
|
double mC1;
|
||||||
|
double mC2;
|
||||||
|
public:
|
||||||
|
LinearInputStretchTimeWarper(double tStart, double tEnd,
|
||||||
|
double rStart, double rEnd);
|
||||||
|
virtual double Warp(double originalTime) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
class LinearOutputStretchTimeWarper : public TimeWarper
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
LinearTimeWarper mTimeWarper;
|
||||||
|
double mTStart;
|
||||||
|
double mC1;
|
||||||
|
double mC2;
|
||||||
|
public:
|
||||||
|
LinearOutputStretchTimeWarper(double tStart, double tEnd,
|
||||||
|
double rStart, double rEnd);
|
||||||
|
virtual double Warp(double originalTime) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
class GeometricInputTimeWarper : public TimeWarper
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
LinearTimeWarper mTimeWarper;
|
||||||
|
double mTStart;
|
||||||
|
double mScale;
|
||||||
|
double mRatio;
|
||||||
|
public:
|
||||||
|
GeometricInputTimeWarper(double tStart, double tEnd,
|
||||||
|
double rStart, double rEnd);
|
||||||
|
virtual double Warp(double originalTime) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
class GeometricOutputTimeWarper : public TimeWarper
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
LinearTimeWarper mTimeWarper;
|
||||||
|
double mTStart;
|
||||||
|
double mScale;
|
||||||
|
double mC0;
|
||||||
|
public:
|
||||||
|
GeometricOutputTimeWarper(double tStart, double tEnd,
|
||||||
double rStart, double rEnd);
|
double rStart, double rEnd);
|
||||||
virtual double Warp(double originalTime) const;
|
virtual double Warp(double originalTime) const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -2563,7 +2563,7 @@
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
CommandLine="copy /Y "$(InputDir)\$(InputFileName)" "$(OutDir)\$(ParentName)\$(InputFileName)""
|
CommandLine="copy /Y "$(InputDir)\$(InputFileName)" "$(OutDir)\$(ParentName)\$(InputFileName)"
"
|
||||||
Outputs="$(OutDir)\$(ParentName)\$(InputFileName)"
|
Outputs="$(OutDir)\$(ParentName)\$(InputFileName)"
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
|
@ -2572,7 +2572,7 @@
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
CommandLine="copy /Y "$(InputDir)\$(InputFileName)" "$(OutDir)\$(ParentName)\$(InputFileName)""
|
CommandLine="copy /Y "$(InputDir)\$(InputFileName)" "$(OutDir)\$(ParentName)\$(InputFileName)"
"
|
||||||
Outputs="$(OutDir)\$(ParentName)\$(InputFileName)"
|
Outputs="$(OutDir)\$(ParentName)\$(InputFileName)"
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
|
@ -2581,7 +2581,7 @@
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
CommandLine="copy /Y "$(InputDir)\$(InputFileName)" "$(OutDir)\$(ParentName)\$(InputFileName)""
|
CommandLine="copy /Y "$(InputDir)\$(InputFileName)" "$(OutDir)\$(ParentName)\$(InputFileName)"
"
|
||||||
Outputs="$(OutDir)\$(ParentName)\$(InputFileName)"
|
Outputs="$(OutDir)\$(ParentName)\$(InputFileName)"
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
|
@ -2590,7 +2590,7 @@
|
||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCustomBuildTool"
|
Name="VCCustomBuildTool"
|
||||||
CommandLine="copy /Y "$(InputDir)\$(InputFileName)" "$(OutDir)\$(ParentName)\$(InputFileName)""
|
CommandLine="copy /Y "$(InputDir)\$(InputFileName)" "$(OutDir)\$(ParentName)\$(InputFileName)"
"
|
||||||
Outputs="$(OutDir)\$(ParentName)\$(InputFileName)"
|
Outputs="$(OutDir)\$(ParentName)\$(InputFileName)"
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
|
|
|
@ -285,11 +285,11 @@
|
||||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||||
>
|
>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\audio.cpp"
|
RelativePath="..\..\..\lib-src\sbsms\src\buffer.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\buffer.cpp"
|
RelativePath="..\..\..\lib-src\sbsms\src\dBTable.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
@ -300,10 +300,6 @@
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\grain.cpp"
|
RelativePath="..\..\..\lib-src\sbsms\src\grain.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\peak.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\resample.cpp"
|
RelativePath="..\..\..\lib-src\sbsms\src\resample.cpp"
|
||||||
>
|
>
|
||||||
|
@ -312,6 +308,10 @@
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\sbsms.cpp"
|
RelativePath="..\..\..\lib-src\sbsms\src\sbsms.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\lib-src\sbsms\src\slide.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\sms.cpp"
|
RelativePath="..\..\..\lib-src\sbsms\src\sms.cpp"
|
||||||
>
|
>
|
||||||
|
@ -328,10 +328,6 @@
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\trackpoint.cpp"
|
RelativePath="..\..\..\lib-src\sbsms\src\trackpoint.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\utils.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Header Files"
|
Name="Header Files"
|
||||||
|
@ -339,11 +335,11 @@
|
||||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||||
>
|
>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\audio.h"
|
RelativePath="..\..\..\lib-src\sbsms\src\buffer.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\buffer.h"
|
RelativePath="..\..\..\lib-src\sbsms\src\dBTable.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
@ -354,10 +350,6 @@
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\grain.h"
|
RelativePath="..\..\..\lib-src\sbsms\src\grain.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\peak.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\real.h"
|
RelativePath="..\..\..\lib-src\sbsms\src\real.h"
|
||||||
>
|
>
|
||||||
|
@ -370,10 +362,18 @@
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\sms.h"
|
RelativePath="..\..\..\lib-src\sbsms\src\sms.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\lib-src\sbsms\src\sse.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\subband.h"
|
RelativePath="..\..\..\lib-src\sbsms\src\subband.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\lib-src\sbsms\src\synthTable.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\lib-src\sbsms\src\track.h"
|
RelativePath="..\..\..\lib-src\sbsms\src\track.h"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user