void WaveShaperDSPKernel::processCurve2x(const float* source, float* destination, size_t framesToProcess)
{
    bool isSafe = framesToProcess == RenderingQuantum;
    ASSERT(isSafe);
    if (!isSafe)
        return;

    float* tempP = m_tempBuffer->data();

    m_upSampler->process(source, tempP, framesToProcess);

    // Process at 2x up-sampled rate.
    processCurve(tempP, tempP, framesToProcess * 2);

    m_downSampler->process(tempP, destination, framesToProcess * 2);
}
void WaveShaperDSPKernel::process(const float* source, float* destination, size_t framesToProcess)
{
    switch (waveShaperProcessor()->oversample()) {
    case WaveShaperProcessor::OverSampleNone:
        processCurve(source, destination, framesToProcess);
        break;
    case WaveShaperProcessor::OverSample2x:
        processCurve2x(source, destination, framesToProcess);
        break;
    case WaveShaperProcessor::OverSample4x:
        processCurve4x(source, destination, framesToProcess);
        break;

    default:
        ASSERT_NOT_REACHED();
    }
}
Example #3
0
void WaveShaperDSPKernel::processCurve4x(const float* source,
                                         float* destination,
                                         size_t framesToProcess) {
  bool isSafe = framesToProcess == AudioUtilities::kRenderQuantumFrames;
  DCHECK(isSafe);
  if (!isSafe)
    return;

  float* tempP = m_tempBuffer->data();
  float* tempP2 = m_tempBuffer2->data();

  m_upSampler->process(source, tempP, framesToProcess);
  m_upSampler2->process(tempP, tempP2, framesToProcess * 2);

  // Process at 4x up-sampled rate.
  processCurve(tempP2, tempP2, framesToProcess * 4);

  m_downSampler2->process(tempP2, tempP, framesToProcess * 4);
  m_downSampler->process(tempP, destination, framesToProcess * 2);
}