11#ifndef __AUDACITY_EFFECT_EQUALIZATION48X__
12#define __AUDACITY_EFFECT_EQUALIZATION48X__
14#ifdef EXPERIMENTAL_EQ_SSE_THREADED
24#define __MAXBUFFERCOUNT 8
26#define __MAXBUFFERCOUNT 4
31#define MATH_FUNCTION_ORIGINAL 0
32#define MATH_FUNCTION_BITREVERSE_TABLE 1
33#define MATH_FUNCTION_SIN_COS_TABLE 2
34#define MATH_FUNCTION_THREADED 4
35#define MATH_FUNCTION_SSE 8
36#define MATH_FUNCTION_AVX 16
37#define MATH_FUNCTION_SEGMENTED_CODE 32
40 void operator () (
void*)
const;
42using simd_floats = std::unique_ptr< float[], free_simd >;
55 BufferInfo() { mBufferLength=0; mBufferStatus=BufferEmpty; mContiguousBufferSize=0; };
56 float* mBufferSouce[__MAXBUFFERCOUNT];
57 float* mBufferDest[__MAXBUFFERCOUNT];
59 size_t mFftWindowSize;
60 size_t mFftFilterSize;
61 float* mScratchBuffer;
62 size_t mContiguousBufferSize;
63 EQBufferStatus mBufferStatus;
84class EffectEqualization48x;
86static int EQWorkerCounter=0;
88class EQWorker :
public wxThread {
90 EQWorker():wxThread(wxTHREAD_JOINABLE) {
94 mEffectEqualization48x=NULL;
96 mThreadID=EQWorkerCounter++;
99 void SetData( BufferInfo* bufferInfoList,
int bufferInfoCount, wxMutex *mutex, EffectEqualization48x *effectEqualization48x) {
100 mBufferInfoList=bufferInfoList;
101 mBufferInfoCount=bufferInfoCount;
103 mEffectEqualization48x=effectEqualization48x;
108 void* Entry()
override;
109 BufferInfo* mBufferInfoList;
110 int mBufferInfoCount, mThreadID;
112 EffectEqualization48x *mEffectEqualization48x;
117class EffectEqualization48x {
121 EffectEqualization48x();
122 virtual ~EffectEqualization48x();
124 static MathCaps *GetMathCaps();
125 static void SetMathPath(
int mathPath);
126 static int GetMathPath();
127 static void AddMathPathOption(
int mathPath);
128 static void RemoveMathPathOption(
int mathPath);
136 bool AllocateBuffersWorkers(
int nThreads);
137 bool FreeBuffersWorkers();
141 bool ProcessBuffer(
fft_type *sourceBuffer,
fft_type *destBuffer,
size_t bufferLength);
142 bool ProcessBuffer1x(BufferInfo *bufferInfo);
144 void Filter1x(
size_t len,
float *buffer,
float *scratchBuffer);
146 bool ProcessBuffer4x(BufferInfo *bufferInfo);
149 void Filter4x(
size_t len,
float *buffer,
float *scratchBuffer);
152 bool ProcessBuffer8x(BufferInfo *bufferInfo);
155 void Filter8x(
size_t len,
float *buffer,
float *scratchBuffer);
164 size_t mWorkerDataCount;
165 size_t mBlocksPerBuffer;
166 size_t mScratchBufferSize;
167 size_t mSubBufferSize;
168 simd_floats mBigBuffer;
This simplifies arrays of arrays, each array separately allocated with NEW[] But it might be better t...
An Effect that modifies volume in different frequency bands.
A Track that contains audio waveform data.
Positions or offsets within audio files need a wide type.