28 static forcedinline
float valueAtOffset (
const float*
const inputs,
const float offset) noexcept
35 auto halfY0 = 0.5f * y0;
36 auto halfY3 = 0.5f * y3;
38 return y1 + offset * ((0.5f * y2 - halfY0)
39 + (offset * (((y0 + 2.0f * y2) - (halfY3 + 2.5f * y1))
40 + (offset * ((halfY3 + 1.5f * y1) - (halfY0 + 1.5f * y2))))));
44 CatmullRomInterpolator::CatmullRomInterpolator() noexcept { reset(); }
45 CatmullRomInterpolator::~CatmullRomInterpolator() noexcept {}
51 for (
auto& s : lastInputSamples)
57 return interpolate<CatmullRomAlgorithm> (lastInputSamples, subSamplePos, actualRatio, in, out, numOut, available, wrap);
62 return interpolate<CatmullRomAlgorithm> (lastInputSamples, subSamplePos, actualRatio, in, out, numOut);
67 return interpolateAdding<CatmullRomAlgorithm> (lastInputSamples, subSamplePos, actualRatio, in, out, numOut, available, wrap, gain);
72 return interpolateAdding<CatmullRomAlgorithm> (lastInputSamples, subSamplePos, actualRatio, in, out, numOut, gain);
int process(double speedRatio, const float *inputSamples, float *outputSamples, int numOutputSamplesToProduce) noexcept
Resamples a stream of samples.
void reset() noexcept
Resets the state of the interpolator.
int processAdding(double speedRatio, const float *inputSamples, float *outputSamples, int numOutputSamplesToProduce, float gain) noexcept
Resamples a stream of samples, adding the results to the output data with a gain. ...