17 #ifndef SRCTOOLS_FIR_RESAMPLER_H 18 #define SRCTOOLS_FIR_RESAMPLER_H 20 #include "ResamplerStage.h" 24 typedef FloatSample FIRCoefficient;
26 static const unsigned int FIR_INTERPOLATOR_CHANNEL_COUNT = 2;
30 FIRResampler(
const unsigned int upsampleFactor,
const double downsampleFactor,
const FIRCoefficient kernel[],
const unsigned int kernelLength);
33 void process(
const FloatSample *&inSamples,
unsigned int &inLength, FloatSample *&outSamples,
unsigned int &outLength);
37 const struct Constants {
39 const FIRCoefficient *taps;
41 bool usePhaseInterpolation;
43 unsigned int numberOfTaps;
45 unsigned int numberOfPhases;
47 double phaseIncrement;
49 unsigned int delayLineMask;
51 FloatSample(*ringBuffer)[FIR_INTERPOLATOR_CHANNEL_COUNT];
53 Constants(
const unsigned int upsampleFactor,
const double downsampleFactor,
const FIRCoefficient kernel[],
const unsigned int kernelLength);
56 unsigned int ringBufferPosition;
60 bool needNextInSample()
const;
61 void addInSamples(
const FloatSample *&inSamples);
62 void getOutSamplesStereo(FloatSample *&outSamples);
67 #endif // SRCTOOLS_FIR_RESAMPLER_H