Mercurial > hg > qm-dsp
comparison 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 |
comparison
equal
deleted
inserted
replaced
460:02cb97d2dee8 | 461:9414df58fd0e |
---|---|
25 | 25 |
26 virtual ~GetKeyMode(); | 26 virtual ~GetKeyMode(); |
27 | 27 |
28 int process( double* PCMData ); | 28 int process( double* PCMData ); |
29 | 29 |
30 double krumCorr( double* pData1, double* pData2, unsigned int length ); | 30 double krumCorr( const double *pDataNorm, const double *pProfileNorm, |
31 int shiftProfile, unsigned int length ); | |
31 | 32 |
32 unsigned int getBlockSize() { return m_ChromaFrameSize*m_DecimationFactor; } | 33 unsigned int getBlockSize() { return m_ChromaFrameSize*m_DecimationFactor; } |
33 unsigned int getHopSize() { return m_ChromaHopSize*m_DecimationFactor; } | 34 unsigned int getHopSize() { return m_ChromaHopSize*m_DecimationFactor; } |
34 | 35 |
35 double* getChroma() { return m_ChrPointer; } | 36 double* getChroma() { return m_ChrPointer; } |
75 | 76 |
76 double* m_DecimatedBuffer; | 77 double* m_DecimatedBuffer; |
77 double* m_ChromaBuffer; | 78 double* m_ChromaBuffer; |
78 double* m_MeanHPCP; | 79 double* m_MeanHPCP; |
79 | 80 |
81 double* m_MajProfileNorm; | |
82 double* m_MinProfileNorm; | |
80 double* m_MajCorr; | 83 double* m_MajCorr; |
81 double* m_MinCorr; | 84 double* m_MinCorr; |
82 int* m_MedianFilterBuffer; | 85 int* m_MedianFilterBuffer; |
83 int* m_SortedBuffer; | 86 int* m_SortedBuffer; |
84 | 87 |