From 4446c24e07779daa2a74700ddc8cef8933fa25f5 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Tue, 7 Nov 2017 13:38:04 +0100 Subject: [PATCH] [DEBUG] build is back --- audio/algo/chunkware/Limiter.cpp | 1 - test/main.cpp | 65 ++++++++++++++++---------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/audio/algo/chunkware/Limiter.cpp b/audio/algo/chunkware/Limiter.cpp index d1684fd..d7e3091 100644 --- a/audio/algo/chunkware/Limiter.cpp +++ b/audio/algo/chunkware/Limiter.cpp @@ -74,7 +74,6 @@ void audio::algo::chunkware::Limiter::init(int8_t _nbChannel) { m_outputBuffer.resize(_nbChannel); for (int8_t iii=0; iii<_nbChannel; ++iii) { m_outputBuffer[iii].resize(BUFFER_SIZE, 0.0); - m_outputBuffer[iii].assign(BUFFER_SIZE, 0.0); } m_isConfigured = true; } diff --git a/test/main.cpp b/test/main.cpp index bdc3e27..ee93a90 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -12,6 +12,7 @@ #include #include #include +#include @@ -41,14 +42,14 @@ class Performance { private: echrono::Steady m_timeStart; echrono::Steady m_timeStop; - echrono::nanoseconds m_totalTimeProcessing; - echrono::nanoseconds m_minProcessing; - echrono::nanoseconds m_maxProcessing; + echrono::Duration m_totalTimeProcessing; + echrono::Duration m_minProcessing; + echrono::Duration m_maxProcessing; int32_t m_totalIteration; public: Performance() : m_totalTimeProcessing(0), - m_minProcessing(99999999999999LL), + m_minProcessing(int64_t(99999999999999LL)), m_maxProcessing(0), m_totalIteration(0) { @@ -58,7 +59,7 @@ class Performance { } void toc() { m_timeStop = echrono::Steady::now(); - echrono::nanoseconds time = m_timeStop - m_timeStart; + echrono::Duration time = m_timeStop - m_timeStart; m_minProcessing = etk::min(m_minProcessing, time); m_maxProcessing = etk::max(m_maxProcessing, time); m_totalTimeProcessing += time; @@ -66,13 +67,13 @@ class Performance { } - echrono::nanoseconds getTotalTimeProcessing() { + echrono::Duration getTotalTimeProcessing() { return m_totalTimeProcessing; } - echrono::nanoseconds getMinProcessing() { + echrono::Duration getMinProcessing() { return m_minProcessing; } - echrono::nanoseconds getMaxProcessing() { + echrono::Duration getMaxProcessing() { return m_maxProcessing; } int32_t getTotalIteration() { @@ -112,12 +113,12 @@ void performanceCompressor() { } TEST_PRINT("Performance Compressor (double): "); TEST_PRINT(" blockSize=" << input.size() << " sample"); - TEST_PRINT(" min < avg < max =" << perfo.getMinProcessing().count() << "ns < " - << perfo.getTotalTimeProcessing().count()/perfo.getTotalIteration() << "ns < " - << perfo.getMaxProcessing().count() << "ns "); - TEST_PRINT(" min < avg < max= " << (float((perfo.getMinProcessing().count()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < " - << (float(((perfo.getTotalTimeProcessing().count()/perfo.getTotalIteration())*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < " - << (float((perfo.getMaxProcessing().count()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "%"); + TEST_PRINT(" min < avg < max =" << perfo.getMinProcessing() << " < " + << perfo.getTotalTimeProcessing().get()/perfo.getTotalIteration() << "ns < " + << perfo.getMaxProcessing()); + TEST_PRINT(" min < avg < max= " << (float((perfo.getMinProcessing().get()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < " + << (float(((perfo.getTotalTimeProcessing().get()/perfo.getTotalIteration())*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < " + << (float((perfo.getMaxProcessing().get()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "%"); } void performanceLimiter() { @@ -153,12 +154,12 @@ void performanceLimiter() { } TEST_PRINT("Performance Limiter (double): "); TEST_PRINT(" blockSize=" << input.size() << " sample"); - TEST_PRINT(" min < avg < max =" << perfo.getMinProcessing().count() << "ns < " - << perfo.getTotalTimeProcessing().count()/perfo.getTotalIteration() << "ns < " - << perfo.getMaxProcessing().count() << "ns "); - TEST_PRINT(" min < avg < max = " << (float((perfo.getMinProcessing().count()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < " - << (float(((perfo.getTotalTimeProcessing().count()/perfo.getTotalIteration())*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < " - << (float((perfo.getMaxProcessing().count()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "%"); + TEST_PRINT(" min < avg < max =" << perfo.getMinProcessing() << " < " + << perfo.getTotalTimeProcessing().get()/perfo.getTotalIteration() << "ns < " + << perfo.getMaxProcessing()); + TEST_PRINT(" min < avg < max = " << (float((perfo.getMinProcessing().get()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < " + << (float(((perfo.getTotalTimeProcessing().get()/perfo.getTotalIteration())*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < " + << (float((perfo.getMaxProcessing().get()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "%"); } void performanceGate() { @@ -194,12 +195,12 @@ void performanceGate() { } TEST_PRINT("Performance Gate (double): "); TEST_PRINT(" blockSize=" << input.size() << " sample"); - TEST_PRINT(" min < avg < max =" << perfo.getMinProcessing().count() << "ns < " - << perfo.getTotalTimeProcessing().count()/perfo.getTotalIteration() << "ns < " - << perfo.getMaxProcessing().count() << "ns "); - TEST_PRINT(" min < avg < max = " << (float((perfo.getMinProcessing().count()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < " - << (float(((perfo.getTotalTimeProcessing().count()/perfo.getTotalIteration())*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < " - << (float((perfo.getMaxProcessing().count()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "%"); + TEST_PRINT(" min < avg < max =" << perfo.getMinProcessing() << " < " + << perfo.getTotalTimeProcessing().get()/perfo.getTotalIteration() << "ns < " + << perfo.getMaxProcessing()); + TEST_PRINT(" min < avg < max = " << (float((perfo.getMinProcessing().get()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < " + << (float(((perfo.getTotalTimeProcessing().get()/perfo.getTotalIteration())*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "% < " + << (float((perfo.getMaxProcessing().get()*sampleRate)/double(input.size()))/1000000000.0)*100.0 << "%"); } @@ -301,13 +302,13 @@ int main(int _argc, const char** _argv) { if (perf == true) { TEST_INFO("Performance Result: "); TEST_INFO(" blockSize=" << blockSize << " sample"); - TEST_INFO(" min=" << perfo.getMinProcessing().count() << " ns"); - TEST_INFO(" max=" << perfo.getMaxProcessing().count() << " ns"); - TEST_INFO(" avg=" << perfo.getTotalTimeProcessing().count()/perfo.getTotalIteration() << " ns"); + TEST_INFO(" min=" << perfo.getMinProcessing()); + TEST_INFO(" max=" << perfo.getMaxProcessing()); + TEST_INFO(" avg=" << perfo.getTotalTimeProcessing().get()/perfo.getTotalIteration() << " ns"); - TEST_INFO(" min=" << (float((perfo.getMinProcessing().count()*sampleRate)/blockSize)/1000000000.0)*100.0 << " %"); - TEST_INFO(" max=" << (float((perfo.getMaxProcessing().count()*sampleRate)/blockSize)/1000000000.0)*100.0 << " %"); - TEST_INFO(" avg=" << (float(((perfo.getTotalTimeProcessing().count()/perfo.getTotalIteration())*sampleRate)/blockSize)/1000000000.0)*100.0 << " %"); + TEST_INFO(" min=" << (float((perfo.getMinProcessing().get()*sampleRate)/blockSize)/1000000000.0)*100.0 << " %"); + TEST_INFO(" max=" << (float((perfo.getMaxProcessing().get()*sampleRate)/blockSize)/1000000000.0)*100.0 << " %"); + TEST_INFO(" avg=" << (float(((perfo.getTotalTimeProcessing().get()/perfo.getTotalIteration())*sampleRate)/blockSize)/1000000000.0)*100.0 << " %"); } etk::FSNodeWriteAllDataType("output.raw", convert(output));