veclib implementation of find_peaks().

git-svn-id: svn://localhost/ardour2/trunk@1590 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Taybin Rutkin
2007-03-14 21:33:44 +00:00
parent c309e2a323
commit f74981874f
4 changed files with 11 additions and 21 deletions

View File

@@ -36,7 +36,7 @@ extern "C" {
void x86_sse_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nframes_t nframes);
}
float x86_sse_find_peaks (ARDOUR::Sample *buf, nframes_t nsamples, float *min, float *max);
void x86_sse_find_peaks (ARDOUR::Sample *buf, nframes_t nsamples, float *min, float *max);
/* debug wrappers for SSE functions */
@@ -54,7 +54,7 @@ void debug_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src, nfra
float veclib_compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current);
float veclib_find_peaks (ARDOUR::Sample *buf, nframes_t nsamples, float *min, float *max);
void veclib_find_peaks (ARDOUR::Sample *buf, nframes_t nsamples, float *min, float *max);
void veclib_apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain);
@@ -68,7 +68,7 @@ void veclib_mix_buffers_no_gain (ARDOUR::Sample *dst, ARDOUR::Sample *src
float compute_peak (ARDOUR::Sample *buf, nframes_t nsamples, float current);
float find_peaks (ARDOUR::Sample *buf, nframes_t nsamples, float *min, float *max);
void find_peaks (ARDOUR::Sample *buf, nframes_t nsamples, float *min, float *max);
void apply_gain_to_buffer (ARDOUR::Sample *buf, nframes_t nframes, float gain);

View File

@@ -906,7 +906,7 @@ class Session : public PBD::StatefulDestructible
float opt);
typedef float (*compute_peak_t) (Sample *, nframes_t, float);
typedef float (*find_peaks_t) (Sample *, nframes_t, float *, float*);
typedef void (*find_peaks_t) (Sample *, nframes_t, float *, float*);
typedef void (*apply_gain_to_buffer_t) (Sample *, nframes_t, float);
typedef void (*mix_buffers_with_gain_t) (Sample *, Sample *, nframes_t, float);
typedef void (*mix_buffers_no_gain_t) (Sample *, Sample *, nframes_t);

View File

@@ -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)
{

View File

@@ -533,6 +533,7 @@
4FADC24808B4156D00ABE55E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
"$(NATIVE_ARCH)",
ppc,
@@ -557,6 +558,7 @@
69C9AF150B97A83A0097DE90 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(NATIVE_ARCH)";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = stabs;