diff options
author | Taybin Rutkin <taybin@taybin.com> | 2007-03-14 21:33:44 +0000 |
---|---|---|
committer | Taybin Rutkin <taybin@taybin.com> | 2007-03-14 21:33:44 +0000 |
commit | f74981874f578ce5b698be7542a185d4d06b8873 (patch) | |
tree | eddeb21af4ed22bb4982b0ba1443aafb900b8342 /libs/ardour/mix.cc | |
parent | c309e2a323ffbb95945b4aa177fa93c3cc74bb8f (diff) |
veclib implementation of find_peaks().
git-svn-id: svn://localhost/ardour2/trunk@1590 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/mix.cc')
-rw-r--r-- | libs/ardour/mix.cc | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/libs/ardour/mix.cc b/libs/ardour/mix.cc index e2096178dd..a32c274b7c 100644 --- a/libs/ardour/mix.cc +++ b/libs/ardour/mix.cc @@ -89,7 +89,7 @@ compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current) return current; } -float +void find_peaks (ARDOUR::Sample *buf, nframes_t nframes, float *min, float *max) { long i; @@ -142,25 +142,13 @@ veclib_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current) return f_max(current, tmpmax); } -float +void veclib_find_peaks (ARDOUR::Sample *buf, nframes_t nframes, float *min, float *max) { - // TODO: someone with veclib skills needs to write this one - long i; - float a, b; - - a = *max; - b = *min; - - for (i = 0; i < nframes; i++) - { - a = fmax (buf[i], a); - b = fmin (buf[i], b); - } - - *max = a; - *min = b; + vDSP_maxv (buf, 1, max, nframes); + vDSP_minv (buf, 1, min, nframes); } + void veclib_apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain) { |