diff options
-rw-r--r-- | muse/CMakeLists.txt | 6 | ||||
-rw-r--r-- | muse/al/CMakeLists.txt | 13 | ||||
-rw-r--r-- | muse/al/dsp.cpp | 19 | ||||
-rw-r--r-- | muse/muse/audiotrack.cpp | 2 | ||||
-rw-r--r-- | muse/muse/muse.cpp | 3 |
5 files changed, 26 insertions, 17 deletions
diff --git a/muse/CMakeLists.txt b/muse/CMakeLists.txt index 7e48ce5c..9ace7471 100644 --- a/muse/CMakeLists.txt +++ b/muse/CMakeLists.txt @@ -26,14 +26,14 @@ if (NOT CMAKE_INSTALL_LIBDIR) SET(CMAKE_INSTALL_LIBDIR "lib") endif (NOT CMAKE_INSTALL_LIBDIR) -set(CMAKE_BUILD_TYPE debug) -# set(CMAKE_BUILD_TYPE release) +# set(CMAKE_BUILD_TYPE debug) +set(CMAKE_BUILD_TYPE release) # for debugging the make system uncomment next line: # set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_CXX_FLAGS "-Wall -Wextra -Winvalid-pch -fno-exceptions") -set(CMAKE_CXX_FLAGS_RELEASE "-O2") +set(CMAKE_CXX_FLAGS_RELEASE "-O2 -fomit-frame-pointer -ffast-math -fstrength-reduce") set(CMAKE_CXX_FLAGS_DEBUG "-g -DQT_DEBUG") set(CMAKE_INCLUDE_CURRENT_DIR TRUE) diff --git a/muse/al/CMakeLists.txt b/muse/al/CMakeLists.txt index ae3b6b6a..b5726f8c 100644 --- a/muse/al/CMakeLists.txt +++ b/muse/al/CMakeLists.txt @@ -3,11 +3,17 @@ # # -add_library(al STATIC +set (al_src al.cpp marker.cpp pos.cpp sig.cpp tempo.cpp xml.cpp dsp.cpp - dspSSE.cpp - dspXMM.cpp + ) + +if (USE_SSE) + set(al_src ${al_src} dspSSE.cpp dspXMM.cpp) +endif (USE_SSE) + +add_library(al STATIC + ${al_src} ) set_source_files_properties( @@ -17,7 +23,6 @@ set_source_files_properties( PROPERTIES COMPILE_FLAGS "-msse2 -fPIC -include ${PROJECT_SOURCE_DIR}/all.h" ) - set_source_files_properties( dspSSE.cpp PROPERTIES COMPILE_FLAGS "-x assembler" ) diff --git a/muse/al/dsp.cpp b/muse/al/dsp.cpp index b840de92..b9032443 100644 --- a/muse/al/dsp.cpp +++ b/muse/al/dsp.cpp @@ -44,20 +44,25 @@ class DspSSE86 : public Dsp { virtual ~DspSSE86() {} virtual float peak(float* buf, unsigned n, float current) { - if ( ((intptr_t)buf % 16) != 0) - fprintf(stderr, "peak(): buffer unaligned!\n"); + if ( ((intptr_t)buf % 16) != 0) { + fprintf(stderr, "peak(): buffer unaligned! (%p)\n", buf); + return Dsp::peak(buf, n, current); + } return x86_sse_compute_peak(buf, n, current); } virtual void applyGainToBuffer(float* buf, unsigned n, float gain) { - if ( ((intptr_t)buf % 16) != 0) - fprintf(stderr, "applyGainToBuffer(): buffer unaligned!\n"); - x86_sse_apply_gain_to_buffer(buf, n, gain); + if ( ((intptr_t)buf % 16) != 0) { + fprintf(stderr, "applyGainToBuffer(): buffer unaligned! (%p)\n", buf); + Dsp::applyGainToBuffer(buf, n, gain); + } + else + x86_sse_apply_gain_to_buffer(buf, n, gain); } virtual void mixWithGain(float* dst, float* src, unsigned n, float gain) { if ( ((intptr_t)dst & 15) != 0) - fprintf(stderr, "mixWithGainain(): dst unaligned!\n"); + fprintf(stderr, "mixWithGainain(): dst unaligned! (%p)\n", dst); if (((intptr_t)dst & 15) != ((intptr_t)src & 15) ) { fprintf(stderr, "mixWithGain(): dst & src don't have the same alignment!\n"); Dsp::mixWithGain(dst, src,n, gain); @@ -67,7 +72,7 @@ class DspSSE86 : public Dsp { } virtual void mix(float* dst, float* src, unsigned n) { if ( ((intptr_t)dst & 15) != 0) - fprintf(stderr, "mix_buffers_no_gain(): dst unaligned!\n"); + fprintf(stderr, "mix_buffers_no_gain(): dst unaligned! %p\n", dst); if ( ((intptr_t)dst & 15) != ((intptr_t)src & 15) ) { fprintf(stderr, "mix_buffers_no_gain(): dst & src don't have the same alignment!\n"); Dsp::mix(dst, src, n); diff --git a/muse/muse/audiotrack.cpp b/muse/muse/audiotrack.cpp index 358d4f1f..3f933c8a 100644 --- a/muse/muse/audiotrack.cpp +++ b/muse/muse/audiotrack.cpp @@ -62,7 +62,7 @@ AudioTrack::AudioTrack() addController(c); for (int i = 0; i < MAX_CHANNELS; ++i) - buffer[i] = new float[segmentSize]; + posix_memalign((void**)&buffer[i], 16, sizeof(float) * segmentSize); } //--------------------------------------------------------- diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp index 94f6b298..759f1354 100644 --- a/muse/muse/muse.cpp +++ b/muse/muse/muse.cpp @@ -2805,8 +2805,6 @@ void MusE::setGlobalTempo(int val) int main(int argc, char* argv[]) { - AL::initDsp(); - char c; QString opts("mvdDiosP:p"); @@ -2839,6 +2837,7 @@ int main(int argc, char* argv[]) loadPlugins = false; loadVST = false; } + AL::initDsp(); museUser = QString(getenv("MUSEHOME")); if (museUser.isEmpty()) |