28 static inline float f_max(
float x,
float a)
48 virtual float peak(
float* buf,
unsigned n,
float current) {
49 for (
unsigned i = 0; i < n; ++i)
50 current = f_max(current, fabsf(buf[i]));
54 for (
unsigned i = 0; i < n; ++i)
57 virtual void mixWithGain(
float* dst,
float* src,
unsigned n,
float gain) {
58 for (
unsigned i = 0; i < n; ++i)
59 dst[i] += src[i] * gain;
61 virtual void mix(
float* dst,
float* src,
unsigned n) {
62 for (
unsigned i = 0; i < n; ++i)
65 virtual void cpy(
float* dst,
float* src,
unsigned n) {
66 #if defined(ARCH_X86) || defined(ARCH_X86_64) 67 register unsigned long int dummy;
68 __asm__ __volatile__ (
"rep; movsl" :
"=&D"(dst),
"=&S"(src),
"=&c"(dummy) :
"0" (to),
"1" (from),
"2" (n) :
"memory");
70 memcpy(dst, src,
sizeof(
float) * n);
virtual void cpy(float *dst, float *src, unsigned n)
Definition: dsp.h:65
virtual ~Dsp()
Definition: dsp.h:46
Dsp * dsp
Definition: dsp.cpp:15
virtual float peak(float *buf, unsigned n, float current)
Definition: dsp.h:48
virtual void mixWithGain(float *dst, float *src, unsigned n, float gain)
Definition: dsp.h:57
Definition: aeolus.cpp:26
virtual void mix(float *dst, float *src, unsigned n)
Definition: dsp.h:61
virtual void applyGainToBuffer(float *buf, unsigned n, float gain)
Definition: dsp.h:53
void initDsp()
Definition: dsp.cpp:79
Dsp()
Definition: dsp.h:45