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

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

        // Unfortunately, while the number and configuration of gains for
        // panning adjust according to OUTPUTCHANNELS, the output from the
        // reverb engine is not so scalable.
        SamplesOut[index][FRONT_LEFT] +=
           (State->Early.PanGain[FRONT_LEFT]*early[0] +
            State->Late.PanGain[FRONT_LEFT]*late[0]) * gain;
        SamplesOut[index][FRONT_RIGHT] +=
           (State->Early.PanGain[FRONT_RIGHT]*early[1] +
            State->Late.PanGain[FRONT_RIGHT]*late[1]) * gain;
        SamplesOut[index][FRONT_CENTER] +=
           (State->Early.PanGain[FRONT_CENTER]*early[3] +
            State->Late.PanGain[FRONT_CENTER]*late[3]) * gain;
        SamplesOut[index][SIDE_LEFT] +=
           (State->Early.PanGain[SIDE_LEFT]*early[0] +
            State->Late.PanGain[SIDE_LEFT]*late[0]) * gain;
        SamplesOut[index][SIDE_RIGHT] +=
           (State->Early.PanGain[SIDE_RIGHT]*early[1] +
            State->Late.PanGain[SIDE_RIGHT]*late[1]) * gain;
        SamplesOut[index][BACK_LEFT] +=
           (State->Early.PanGain[BACK_LEFT]*early[0] +
            State->Late.PanGain[BACK_LEFT]*late[0]) * gain;
        SamplesOut[index][BACK_RIGHT] +=
           (State->Early.PanGain[BACK_RIGHT]*early[1] +
            State->Late.PanGain[BACK_RIGHT]*late[1]) * gain;
        SamplesOut[index][BACK_CENTER] +=
           (State->Early.PanGain[BACK_CENTER]*early[2] +
            State->Late.PanGain[BACK_CENTER]*late[2]) * gain;
    }
}
// This processes the EAX reverb state, given the input samples and an output
// buffer.
This processes the EAX reverb state, given the input samples and an output
buffer.
This processes the EAX reverb state given the input samples and an output buffer .
ALvoid EAXVerbProcess(ALeffectState *effect, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[OUTPUTCHANNELS])
{
    ALverbState *State = (ALverbState*)effect;
    ALuint index;
    ALfloat early[4], late[4];
    ALfloat gain = Slot->Gain;
    for(index = 0;index < SamplesToDo;index++)
    {
        ReverbInOut(State, SamplesIn[index], early, late);
        SamplesOut[index][FRONT_LEFT] +=
           (State->Early.PanGain[FRONT_LEFT]*early[0] +
            State->Late.PanGain[FRONT_LEFT]*late[0]) * gain;
        SamplesOut[index][FRONT_RIGHT] +=
           (State->Early.PanGain[FRONT_RIGHT]*early[1] +
            State->Late.PanGain[FRONT_RIGHT]*late[1]) * gain;
        SamplesOut[index][FRONT_CENTER] +=
           (State->Early.PanGain[FRONT_CENTER]*early[3] +
            State->Late.PanGain[FRONT_CENTER]*late[3]) * gain;
        SamplesOut[index][SIDE_LEFT] +=
           (State->Early.PanGain[SIDE_LEFT]*early[0] +
            State->Late.PanGain[SIDE_LEFT]*late[0]) * gain;
        SamplesOut[index][SIDE_RIGHT] +=
           (State->Early.PanGain[SIDE_RIGHT]*early[1] +
            State->Late.PanGain[SIDE_RIGHT]*late[1]) * gain;
        SamplesOut[index][BACK_LEFT] +=
           (State->Early.PanGain[BACK_LEFT]*early[0] +
            State->Late.PanGain[BACK_LEFT]*late[0]) * gain;
        SamplesOut[index][BACK_RIGHT] +=
           (State->Early.PanGain[BACK_RIGHT]*early[1] +
            State->Late.PanGain[BACK_RIGHT]*late[1]) * gain;
        SamplesOut[index][BACK_CENTER] +=
           (State->Early.PanGain[BACK_CENTER]*early[2] +
            State->Late.PanGain[BACK_CENTER]*late[2]) * gain;
    }
}
ALvoid EAXVerbProcess ( ALeffectState * effect , const ALeffectslot * Slot , ALuint SamplesToDo , const ALfloat * SamplesIn , ALfloat ( * SamplesOut ) [ OUTPUTCHANNELS ] ) { ALverbState * State = ( ALverbState * ) effect ; ALuint index ; ALfloat early [ 4 ] , late [ 4 ] ; ALfloat gain = Slot -> Gain ; for ( index = 0 ; index < SamplesToDo ; index ++ ) { ReverbInOut ( State , SamplesIn [ index ] , early , late ) ; SamplesOut [ index ] [ FRONT_LEFT ] += ( State -> Early . PanGain [ FRONT_LEFT ] * early [ 0 ] + State -> Late . PanGain [ FRONT_LEFT ] * late [ 0 ] ) * gain ; SamplesOut [ index ] [ FRONT_RIGHT ] += ( State -> Early . PanGain [ FRONT_RIGHT ] * early [ 1 ] + State -> Late . PanGain [ FRONT_RIGHT ] * late [ 1 ] ) * gain ; SamplesOut [ index ] [ FRONT_CENTER ] += ( State -> Early . PanGain [ FRONT_CENTER ] * early [ 3 ] + State -> Late . PanGain [ FRONT_CENTER ] * late [ 3 ] ) * gain ; SamplesOut [ index ] [ SIDE_LEFT ] += ( State -> Early . PanGain [ SIDE_LEFT ] * early [ 0 ] + State -> Late . PanGain [ SIDE_LEFT ] * late [ 0 ] ) * gain ; SamplesOut [ index ] [ SIDE_RIGHT ] += ( State -> Early . PanGain [ SIDE_RIGHT ] * early [ 1 ] + State -> Late . PanGain [ SIDE_RIGHT ] * late [ 1 ] ) * gain ; SamplesOut [ index ] [ BACK_LEFT ] += ( State -> Early . PanGain [ BACK_LEFT ] * early [ 0 ] + State -> Late . PanGain [ BACK_LEFT ] * late [ 0 ] ) * gain ; SamplesOut [ index ] [ BACK_RIGHT ] += ( State -> Early . PanGain [ BACK_RIGHT ] * early [ 1 ] + State -> Late . PanGain [ BACK_RIGHT ] * late [ 1 ] ) * gain ; SamplesOut [ index ] [ BACK_CENTER ] += ( State -> Early . PanGain [ BACK_CENTER ] * early [ 2 ] + State -> Late . PanGain [ BACK_CENTER ] * late [ 2 ] ) * gain ; } }
This processes the EAX reverb state, given the input samples and an output
buffer.
This processes the EAX reverb state given the input samples and an output buffer .
// Process reverb for this sample. // Unfortunately, while the number and configuration of gains for // panning adjust according to OUTPUTCHANNELS, the output from the // reverb engine is not so scalable.