Reorder args to with_gain functions to match bqvec; docs; build fixes
This commit is contained in:
@@ -67,7 +67,7 @@ public:
|
|||||||
int getSize() const;
|
int getSize() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a new ring buffer (allocated with "new" -- called must
|
* Return a new ring buffer (allocated with "new" -- caller must
|
||||||
* delete when no longer needed) of the given size, containing the
|
* delete when no longer needed) of the given size, containing the
|
||||||
* same data as this one. If another thread reads from or writes
|
* same data as this one. If another thread reads from or writes
|
||||||
* to this buffer during the call, the results may be incomplete
|
* to this buffer during the call, the results may be incomplete
|
||||||
@@ -89,8 +89,7 @@ public:
|
|||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the amount of data available for reading by reader R, in
|
* Return the amount of data available for reading, in samples.
|
||||||
* samples.
|
|
||||||
*/
|
*/
|
||||||
int getReadSpace() const;
|
int getReadSpace() const;
|
||||||
|
|
||||||
@@ -100,9 +99,9 @@ public:
|
|||||||
int getWriteSpace() const;
|
int getWriteSpace() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read n samples from the buffer, for reader R. If fewer than n
|
* Read n samples from the buffer. If fewer than n are available,
|
||||||
* are available, the remainder will be zeroed out. Returns the
|
* the remainder will be zeroed out. Returns the number of
|
||||||
* number of samples actually read.
|
* samples actually read.
|
||||||
*
|
*
|
||||||
* This is a template function, taking an argument S for the target
|
* This is a template function, taking an argument S for the target
|
||||||
* sample type, which is permitted to differ from T if the two
|
* sample type, which is permitted to differ from T if the two
|
||||||
@@ -112,10 +111,9 @@ public:
|
|||||||
int read(S *const R__ destination, int n);
|
int read(S *const R__ destination, int n);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read n samples from the buffer, for reader R, adding them to
|
* Read n samples from the buffer, adding them to the destination.
|
||||||
* the destination. If fewer than n are available, the remainder
|
* If fewer than n are available, the remainder will be left
|
||||||
* will be left alone. Returns the number of samples actually
|
* alone. Returns the number of samples actually read.
|
||||||
* read.
|
|
||||||
*
|
*
|
||||||
* This is a template function, taking an argument S for the target
|
* This is a template function, taking an argument S for the target
|
||||||
* sample type, which is permitted to differ from T if the two
|
* sample type, which is permitted to differ from T if the two
|
||||||
@@ -125,20 +123,19 @@ public:
|
|||||||
int readAdding(S *const R__ destination, int n);
|
int readAdding(S *const R__ destination, int n);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read one sample from the buffer, for reader R. If no sample is
|
* Read one sample from the buffer. If no sample is available,
|
||||||
* available, this will silently return zero. Calling this
|
* this will silently return zero. Calling this repeatedly is
|
||||||
* repeatedly is obviously slower than calling read once, but it
|
* obviously slower than calling read once, but it may be good
|
||||||
* may be good enough if you don't want to allocate a buffer to
|
* enough if you don't want to allocate a buffer to read into.
|
||||||
* read into.
|
|
||||||
*/
|
*/
|
||||||
T readOne();
|
T readOne();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read n samples from the buffer, if available, for reader R,
|
* Read n samples from the buffer, if available, without advancing
|
||||||
* without advancing the read pointer -- i.e. a subsequent read()
|
* the read pointer -- i.e. a subsequent read() or skip() will be
|
||||||
* or skip() will be necessary to empty the buffer. If fewer than
|
* necessary to empty the buffer. If fewer than n are available,
|
||||||
* n are available, the remainder will be zeroed out. Returns the
|
* the remainder will be zeroed out. Returns the number of
|
||||||
* number of samples actually read.
|
* samples actually read.
|
||||||
*/
|
*/
|
||||||
int peek(T *const R__ destination, int n) const;
|
int peek(T *const R__ destination, int n) const;
|
||||||
|
|
||||||
@@ -151,10 +148,9 @@ public:
|
|||||||
T peekOne() const;
|
T peekOne() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pretend to read n samples from the buffer, for reader R,
|
* Pretend to read n samples from the buffer, without actually
|
||||||
* without actually returning them (i.e. discard the next n
|
* returning them (i.e. discard the next n samples). Returns the
|
||||||
* samples). Returns the number of samples actually available for
|
* number of samples actually available for discarding.
|
||||||
* discarding.
|
|
||||||
*/
|
*/
|
||||||
int skip(int n);
|
int skip(int n);
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_VDSP
|
#ifdef HAVE_VDSP
|
||||||
#include <vecLib/vDSP.h>
|
#include <Accelerate/Accelerate.h>
|
||||||
#include <vecLib/vForce.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_MEDIALIB
|
#ifdef HAVE_MEDIALIB
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void add(T *const R__ dst, T scale) const {
|
inline void add(T *const R__ dst, T scale) const {
|
||||||
v_add_with_gain(dst, m_cache, m_size, scale);
|
v_add_with_gain(dst, m_cache, scale, m_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline T getArea() const { return m_area; }
|
inline T getArea() const { return m_area; }
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void add(T *const R__ dst, T scale) const {
|
inline void add(T *const R__ dst, T scale) const {
|
||||||
v_add_with_gain(dst, m_cache, m_size, scale);
|
v_add_with_gain(dst, m_cache, scale, m_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline T getRMS() const {
|
inline T getRMS() const {
|
||||||
|
|||||||
@@ -289,8 +289,8 @@ inline void v_add_channels(T *const R__ *const R__ dst,
|
|||||||
template<typename T, typename G>
|
template<typename T, typename G>
|
||||||
inline void v_add_with_gain(T *const R__ dst,
|
inline void v_add_with_gain(T *const R__ dst,
|
||||||
const T *const R__ src,
|
const T *const R__ src,
|
||||||
const int count,
|
const G gain,
|
||||||
const G gain)
|
const int count)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
dst[i] += src[i] * gain;
|
dst[i] += src[i] * gain;
|
||||||
@@ -300,12 +300,12 @@ inline void v_add_with_gain(T *const R__ dst,
|
|||||||
template<typename T, typename G>
|
template<typename T, typename G>
|
||||||
inline void v_add_channels_with_gain(T *const R__ *const R__ dst,
|
inline void v_add_channels_with_gain(T *const R__ *const R__ dst,
|
||||||
const T *const R__ *const R__ src,
|
const T *const R__ *const R__ src,
|
||||||
|
const G gain,
|
||||||
const int channels,
|
const int channels,
|
||||||
const int count,
|
const int count)
|
||||||
const G gain)
|
|
||||||
{
|
{
|
||||||
for (int c = 0; c < channels; ++c) {
|
for (int c = 0; c < channels; ++c) {
|
||||||
v_add_with_gain(dst[c], src[c], count, gain);
|
v_add_with_gain(dst[c], src[c], gain, count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_VDSP
|
#ifdef HAVE_VDSP
|
||||||
#include <vecLib/vDSP.h>
|
#include <Accelerate/Accelerate.h>
|
||||||
#include <fenv.h>
|
#include <fenv.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
#define uint32_t unsigned __int32
|
#define uint32_t unsigned __int32
|
||||||
#elif defined(__MSVC__)
|
#elif defined(__MSVC__)
|
||||||
#define ssize_t long
|
#define ssize_t long
|
||||||
|
#include <stdint.h>
|
||||||
#else
|
#else
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user