vlc_linux/vlc-3.0.16/modules/audio_filter/spatializer/revmodel.cpp
/*****************************************************************************
 *  Transforms the audio stream
 * /param float *inputL     input buffer
 * /param float *outputL   output buffer
 * /param long numsamples  number of samples to be processed
 * /param int skip             number of channels in the audio stream
 *****************************************************************************/
Transforms the audio stream
/param float *inputL     input buffer
/param float *outputL   output buffer
/param long numsamples  number of samples to be processed
/param int skip             number of channels in the audio stream
Transforms the audio stream / param float * inputL input buffer / param float * outputL output buffer / param long numsamples number of samples to be processed / param int skip number of channels in the audio stream
void revmodel::processreplace(float *inputL, float *outputL, long , int skip)
{
    float outL,outR,input;
    float inputR;
    int i;
    outL = outR = 0;
        if (skip > 1)
           inputR = inputL[1];
        else
           inputR = inputL[0];
        input = (inputL[0] + inputR) * gain;
        for(i=0; i<numcombs; i++)
        {
            outL += combL[i].process(input);
            outR += combR[i].process(input);
        }
        for(i=0; i<numallpasses; i++)
        {
            outL = allpassL[i].process(outL);
            outR = allpassR[i].process(outR);
        }
        outputL[0] = (outL*wet1 + outR*wet2 + inputR*dry);
           if (skip > 1)
        outputL[1] = (outR*wet1 + outL*wet2 + inputR*dry);
}
void revmodel :: processreplace ( float * inputL , float * outputL , long , int skip ) { float outL , outR , input ; float inputR ; int i ; outL = outR = 0 ; if ( skip > 1 ) inputR = inputL [ 1 ] ; else inputR = inputL [ 0 ] ; input = ( inputL [ 0 ] + inputR ) * gain ; for ( i = 0 ; i < numcombs ; i ++ ) { outL += combL [ i ] . process ( input ) ; outR += combR [ i ] . process ( input ) ; } for ( i = 0 ; i < numallpasses ; i ++ ) { outL = allpassL [ i ] . process ( outL ) ; outR = allpassR [ i ] . process ( outR ) ; } outputL [ 0 ] = ( outL * wet1 + outR * wet2 + inputR * dry ) ; if ( skip > 1 ) outputL [ 1 ] = ( outR * wet1 + outL * wet2 + inputR * dry ) ; }
Transforms the audio stream
 /param float *inputL     input buffer
 /param float *outputL   output buffer
 /param long numsamples  number of samples to be processed
 /param int skip             number of channels in the audio stream
Transforms the audio stream / param float * inputL input buffer / param float * outputL output buffer / param long numsamples number of samples to be processed / param int skip number of channels in the audio stream
/* numsamples */ /* TODO this module supports only 2 audio channels, let's improve this */ // Accumulate comb filters in parallel // Feed through allpasses in series // Calculate output REPLACING anything already there