Fix veclib_find_peaks interface
vDSP_maxv, vDSP_minv set the return value to -INFINITY or INFINITY respectively before starting to process. Ardour expect the value to be input values to be part of the set. https://developer.apple.com/documentation/accelerate/1450621-vdsp_maxv?language=objc https://developer.apple.com/documentation/accelerate/1450267-vdsp_minv?language=objc
This commit is contained in:
parent
ef7b7f4c89
commit
32be8aa96a
@ -159,8 +159,12 @@ veclib_compute_peak (const ARDOUR::Sample * buf, pframes_t nsamples, float curre
|
|||||||
void
|
void
|
||||||
veclib_find_peaks (const ARDOUR::Sample * buf, pframes_t nframes, float *min, float *max)
|
veclib_find_peaks (const ARDOUR::Sample * buf, pframes_t nframes, float *min, float *max)
|
||||||
{
|
{
|
||||||
|
const float _min = *min;
|
||||||
|
const float _max = *max;
|
||||||
vDSP_maxv (const_cast<ARDOUR::Sample*>(buf), 1, max, nframes);
|
vDSP_maxv (const_cast<ARDOUR::Sample*>(buf), 1, max, nframes);
|
||||||
vDSP_minv (const_cast<ARDOUR::Sample*>(buf), 1, min, nframes);
|
vDSP_minv (const_cast<ARDOUR::Sample*>(buf), 1, min, nframes);
|
||||||
|
*min = std::min (*min, _min);
|
||||||
|
*max = std::max (*max, _max);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user