mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-06 23:20:03 +01:00
Modify 'maxnorm' value insider critical section when using OpenMP with integer samples
This commit is contained in:
parent
5d9bc2fdf3
commit
6f82bdebdb
@ -911,7 +911,12 @@ double TDStretch::calcCrossCorr(const short *mixingPos, const short *compare, do
|
||||
|
||||
if (lnorm > maxnorm)
|
||||
{
|
||||
maxnorm = lnorm;
|
||||
// modify 'maxnorm' inside critical section to avoid multi-access conflict if in OpenMP mode
|
||||
#pragma omp critical
|
||||
if (lnorm > maxnorm)
|
||||
{
|
||||
maxnorm = lnorm;
|
||||
}
|
||||
}
|
||||
// Normalize result by dividing by sqrt(norm) - this step is easiest
|
||||
// done using floating point operation
|
||||
|
||||
@ -125,7 +125,12 @@ double TDStretchMMX::calcCrossCorr(const short *pV1, const short *pV2, double &d
|
||||
|
||||
if (norm > (long)maxnorm)
|
||||
{
|
||||
maxnorm = norm;
|
||||
// modify 'maxnorm' inside critical section to avoid multi-access conflict if in OpenMP mode
|
||||
#pragma omp critical
|
||||
if (norm > (long)maxnorm)
|
||||
{
|
||||
maxnorm = norm;
|
||||
}
|
||||
}
|
||||
|
||||
// Normalize result by dividing by sqrt(norm) - this step is easiest
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user