Mercurial > hg > qm-dsp
diff dsp/keydetection/GetKeyMode.h @ 461:9414df58fd0e
Fix an issue is a mutithreading context
The global profile buffers where used concurrently by different threads
leading to wrong detection results. This is fixed by using a local copy
of the buffers. In addition, this commit also includes some minor
performance improvements.
author | Daniel Schürmann <daschuer@mixxx.org> |
---|---|
date | Fri, 24 May 2019 21:40:47 +0200 |
parents | 02cb97d2dee8 |
children | 64fc3009d0a3 |
line wrap: on
line diff
--- a/dsp/keydetection/GetKeyMode.h Fri May 24 21:06:47 2019 +0200 +++ b/dsp/keydetection/GetKeyMode.h Fri May 24 21:40:47 2019 +0200 @@ -27,7 +27,8 @@ int process( double* PCMData ); - double krumCorr( double* pData1, double* pData2, unsigned int length ); + double krumCorr( const double *pDataNorm, const double *pProfileNorm, + int shiftProfile, unsigned int length ); unsigned int getBlockSize() { return m_ChromaFrameSize*m_DecimationFactor; } unsigned int getHopSize() { return m_ChromaHopSize*m_DecimationFactor; } @@ -77,6 +78,8 @@ double* m_ChromaBuffer; double* m_MeanHPCP; + double* m_MajProfileNorm; + double* m_MinProfileNorm; double* m_MajCorr; double* m_MinCorr; int* m_MedianFilterBuffer;