thirdparty/openal-soft-1.10.622/Alc/alcReverb.c
ALvoid VerbProcess(ALeffectState *effect, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[OUTPUTCHANNELS])
{
    ALverbState *State = (ALverbState*)effect;
    ALuint index;
    ALfloat early[4], late[4], out[4];
    ALfloat gain = Slot->Gain;

    for(index = 0;index < SamplesToDo;index++)
    {
        // Process reverb for this sample.
        ReverbInOut(State, SamplesIn[index], early, late);

        // Mix early reflections and late reverb.
        out[0] = (early[0] + late[0]) * gain;
        out[1] = (early[1] + late[1]) * gain;
        out[2] = (early[2] + late[2]) * gain;
        out[3] = (early[3] + late[3]) * gain;

        // Output the results.
        SamplesOut[index][FRONT_LEFT]   += out[0];
        SamplesOut[index][FRONT_RIGHT]  += out[1];
        SamplesOut[index][FRONT_CENTER] += out[3];
        SamplesOut[index][SIDE_LEFT]    += out[0];
        SamplesOut[index][SIDE_RIGHT]   += out[1];
        SamplesOut[index][BACK_LEFT]    += out[0];
        SamplesOut[index][BACK_RIGHT]   += out[1];
        SamplesOut[index][BACK_CENTER]  += out[2];
    }
}
// This processes the reverb state, given the input samples and an output
// buffer.
This processes the reverb state, given the input samples and an output
buffer.
This processes the reverb state given the input samples and an output buffer .
ALvoid VerbProcess(ALeffectState *effect, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[OUTPUTCHANNELS])
{
    ALverbState *State = (ALverbState*)effect;
    ALuint index;
    ALfloat early[4], late[4], out[4];
    ALfloat gain = Slot->Gain;
    for(index = 0;index < SamplesToDo;index++)
    {
        ReverbInOut(State, SamplesIn[index], early, late);
        out[0] = (early[0] + late[0]) * gain;
        out[1] = (early[1] + late[1]) * gain;
        out[2] = (early[2] + late[2]) * gain;
        out[3] = (early[3] + late[3]) * gain;
        SamplesOut[index][FRONT_LEFT]   += out[0];
        SamplesOut[index][FRONT_RIGHT]  += out[1];
        SamplesOut[index][FRONT_CENTER] += out[3];
        SamplesOut[index][SIDE_LEFT]    += out[0];
        SamplesOut[index][SIDE_RIGHT]   += out[1];
        SamplesOut[index][BACK_LEFT]    += out[0];
        SamplesOut[index][BACK_RIGHT]   += out[1];
        SamplesOut[index][BACK_CENTER]  += out[2];
    }
}
ALvoid VerbProcess ( ALeffectState * effect , const ALeffectslot * Slot , ALuint SamplesToDo , const ALfloat * SamplesIn , ALfloat ( * SamplesOut ) [ OUTPUTCHANNELS ] ) { ALverbState * State = ( ALverbState * ) effect ; ALuint index ; ALfloat early [ 4 ] , late [ 4 ] , out [ 4 ] ; ALfloat gain = Slot -> Gain ; for ( index = 0 ; index < SamplesToDo ; index ++ ) { ReverbInOut ( State , SamplesIn [ index ] , early , late ) ; out [ 0 ] = ( early [ 0 ] + late [ 0 ] ) * gain ; out [ 1 ] = ( early [ 1 ] + late [ 1 ] ) * gain ; out [ 2 ] = ( early [ 2 ] + late [ 2 ] ) * gain ; out [ 3 ] = ( early [ 3 ] + late [ 3 ] ) * gain ; SamplesOut [ index ] [ FRONT_LEFT ] += out [ 0 ] ; SamplesOut [ index ] [ FRONT_RIGHT ] += out [ 1 ] ; SamplesOut [ index ] [ FRONT_CENTER ] += out [ 3 ] ; SamplesOut [ index ] [ SIDE_LEFT ] += out [ 0 ] ; SamplesOut [ index ] [ SIDE_RIGHT ] += out [ 1 ] ; SamplesOut [ index ] [ BACK_LEFT ] += out [ 0 ] ; SamplesOut [ index ] [ BACK_RIGHT ] += out [ 1 ] ; SamplesOut [ index ] [ BACK_CENTER ] += out [ 2 ] ; } }
This processes the reverb state, given the input samples and an output
buffer.
This processes the reverb state given the input samples and an output buffer .
// Process reverb for this sample. // Mix early reflections and late reverb. // Output the results.