zenilib
0.5.3.0
|
Go to the source code of this file.
Macros | |
#define | AIRABSORBGAINHF (0.99426f) /* -0.05dB */ |
#define | F_PI (3.14159265358979323846f) /* pi */ |
#define | F_PI_2 (1.57079632679489661923f) /* pi/2 */ |
#define | FLT_EPSILON (1.19209290e-07f) |
#define | FRACTIONBITS (14) |
#define | FRACTIONMASK (FRACTIONONE-1) |
#define | FRACTIONONE (1<<FRACTIONBITS) |
#define | SPEEDOFSOUNDMETRESPERSEC (343.3f) |
Typedefs | |
typedef ALvoid(* | DryMixerFunc )(const struct DirectParams *params, const ALfloat *RESTRICT data, ALuint srcchan, ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize) |
typedef void(* | ResamplerFunc )(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *RESTRICT dst, ALuint dstlen) |
typedef ALvoid(* | WetMixerFunc )(const struct SendParams *params, const ALfloat *RESTRICT data, ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize) |
Functions | |
ALvoid | aluHandleDisconnect (ALCdevice *device) |
ALvoid | aluInitPanning (ALCdevice *Device) |
ALvoid | aluMixData (ALCdevice *device, ALvoid *buffer, ALsizei size) |
ALvoid | CalcNonAttnSourceParams (struct ALsource *ALSource, const ALCcontext *ALContext) |
ALvoid | CalcSourceParams (struct ALsource *ALSource, const ALCcontext *ALContext) |
static __inline ALfloat | clampf (ALfloat val, ALfloat min, ALfloat max) |
static __inline ALint | clampi (ALint val, ALint min, ALint max) |
static __inline ALint64 | clampi64 (ALint64 val, ALint64 min, ALint64 max) |
static __inline ALuint | clampu (ALuint val, ALuint min, ALuint max) |
static __inline ALuint64 | clampu64 (ALuint64 val, ALuint64 min, ALuint64 max) |
ALvoid | ComputeAngleGains (const ALCdevice *device, ALfloat angle, ALfloat hwidth, ALfloat ingain, ALfloat *gains) |
static __inline ALfloat | cubic (ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, ALfloat mu) |
static __inline ALfloat | lerp (ALfloat val1, ALfloat val2, ALfloat mu) |
static __inline ALfloat | maxf (ALfloat a, ALfloat b) |
static __inline ALint | maxi (ALint a, ALint b) |
static __inline ALint64 | maxi64 (ALint64 a, ALint64 b) |
static __inline ALuint | maxu (ALuint a, ALuint b) |
static __inline ALuint64 | maxu64 (ALuint64 a, ALuint64 b) |
static __inline ALfloat | minf (ALfloat a, ALfloat b) |
static __inline ALint | mini (ALint a, ALint b) |
static __inline ALint64 | mini64 (ALint64 a, ALint64 b) |
static __inline ALuint | minu (ALuint a, ALuint b) |
static __inline ALuint64 | minu64 (ALuint64 a, ALuint64 b) |
ALvoid | MixSource (struct ALsource *Source, ALCdevice *Device, ALuint SamplesToDo) |
Variables | |
ALfloat | ConeScale |
ALfloat | ZScale |
#define AIRABSORBGAINHF (0.99426f) /* -0.05dB */ |
Definition at line 47 of file alu.h.
Referenced by CalcSourceParams().
#define F_PI (3.14159265358979323846f) /* pi */ |
Definition at line 16 of file alu.h.
Referenced by aluInitPanning(), CalcAzIndices(), CalcEvIndices(), CalcHrtfDelta(), CalcI3DL2HFreq(), CalcNonAttnSourceParams(), CalcSourceParams(), ComputeAngleGains(), EAXModulation(), EchoUpdate(), ModulatorUpdate(), SetSpeakerArrangement(), Sin(), and Update3DPanning().
#define F_PI_2 (1.57079632679489661923f) /* pi/2 */ |
Definition at line 17 of file alu.h.
Referenced by CalcEvIndices().
#define FLT_EPSILON (1.19209290e-07f) |
Definition at line 20 of file alu.h.
Referenced by CalcSourceParams().
#define FRACTIONBITS (14) |
Definition at line 49 of file alu.h.
Referenced by CalcNonAttnSourceParams(), CalcSourceParams(), GetSourceOffset(), GetSourceSecOffset(), and MixSource().
#define FRACTIONMASK (FRACTIONONE-1) |
Definition at line 51 of file alu.h.
Referenced by MixSource().
#define FRACTIONONE (1<<FRACTIONBITS) |
Definition at line 50 of file alu.h.
Referenced by CalcNonAttnSourceParams(), CalcSourceParams(), cubic32(), GetSourceSecOffset(), lerp32(), MixSource(), Resample_copy32_C(), and SelectResampler().
#define SPEEDOFSOUNDMETRESPERSEC (343.3f) |
Definition at line 46 of file alu.h.
Referenced by CalcLimitedHfRatio(), CalcSourceParams(), and InitContext().
Definition at line 1176 of file ALu.c.
References ALCcontext_struct::ActiveSourceCount, ALCcontext_struct::ActiveSources, AL_PLAYING, AL_STOPPED, ALC_FALSE, ALCdevice_struct::Connected, ALCdevice_struct::ContextList, and ALCcontext_struct::next.
Referenced by alcCreateContext(), alsa_available_samples(), alsa_capture_samples(), alsa_start_capture(), ALSANoMMapProc(), ALSAProc(), DSoundAvailableSamples(), DSoundPlaybackProc(), DSoundStartCapture(), DSoundStopCapture(), MMDevApiProc(), OSSCaptureProc(), OSSProc(), sndio_proc(), SolarisProc(), and WaveProc().
Definition at line 343 of file panning.c.
References BackCenter, BackLeft, BackRight, DevFmtMono, DevFmtQuad, DevFmtStereo, DevFmtX51, DevFmtX51Side, DevFmtX61, DevFmtX71, F_PI, ALCdevice_struct::FmtChans, FrontCenter, FrontLeft, FrontRight, Loopback, NULL, ALCdevice_struct::NumChan, SetSpeakerArrangement(), SideLeft, SideRight, ALCdevice_struct::Speaker2Chan, ALCdevice_struct::SpeakerAngle, and ALCdevice_struct::Type.
Referenced by UpdateDeviceParams().
Definition at line 970 of file ALu.c.
References ALCcontext_struct::ActiveEffectSlotCount, ALCcontext_struct::ActiveEffectSlots, ALCcontext_struct::ActiveSourceCount, ALCcontext_struct::ActiveSources, AL_FALSE, AL_PLAYING, ALCdevice_Lock, ALCdevice_Unlock, ALeffectState_Process, ALeffectState_Update, ALsource_Update, ALCdevice_struct::Bs2b, bs2b_cross_feed(), BUFFERSIZE, CalcListenerParams(), ALeffectslot::ClickRemoval, ALCdevice_struct::ContextList, ALCdevice_struct::DefaultSlot, ALCcontext_struct::DeferUpdates, DevFmtByte, DevFmtFloat, DevFmtInt, DevFmtMono, DevFmtShort, DevFmtStereo, DevFmtUByte, DevFmtUInt, DevFmtUShort, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, FrontCenter, FrontLeft, FrontRight, i, ALCcontext_struct::Listener, MaxChannels, memset, minu(), MixSource(), ALCcontext_struct::next, NULL, RestoreFPUMode(), SetMixerFPUMode(), and ALCcontext_struct::UpdateSources.
Referenced by alcRenderSamplesSOFT(), ALSANoMMapProc(), ALSAProc(), ca_callback(), DSoundPlaybackProc(), MMDevApiProc(), NullProc(), opensl_callback(), OSSProc(), pa_callback(), PlaybackThreadProc(), sndio_proc(), SolarisProc(), and WaveProc().
ALvoid CalcNonAttnSourceParams | ( | struct ALsource * | ALSource, |
const ALCcontext * | ALContext | ||
) |
Definition at line 193 of file ALu.c.
References AL_EFFECT_NULL, AL_FALSE, BackCenter, BackLeft, BackRight, ALbufferlistitem::buffer, BUFFERSIZE, clampf(), DirectParams::ClickRemoval, FILTER::coeff, ComputeAngleGains(), HrtfState::Counter, ALCdevice_struct::DefaultSlot, HrtfParams::Delay, DevFmtStereo, ALCcontext_struct::Device, DEVICE_WIDE_STEREO, ALsource::Direct, ALsource::DirectChannels, ALsource::DirectGain, ALsource::DirectGainHF, ALsource::DryMix, ALeffectslot::effect, F_PI, fastf2i(), ALCdevice_struct::Flags, ALbuffer::FmtChannels, ALCdevice_struct::FmtChans, FmtMono, FmtQuad, FmtRear, FmtStereo, FmtX51, FmtX61, FmtX71, FRACTIONBITS, FRACTIONONE, ALbuffer::Frequency, ALCdevice_struct::Frequency, FrontCenter, FrontLeft, FrontRight, ALlistener::Gain, ALsource::Gain, ALsource::GainHF, DirectParams::Gains, GetHrtfIrSize(), GetLerpedHrtfCoeffs(), HRIR_LENGTH, DirectParams::Hrtf, ALsource::Hrtf, ALCdevice_struct::Hrtf, i, DirectParams::iirFilter, HrtfParams::IrSize, lerp(), LFE, ALCcontext_struct::Listener, LOWPASSFREQREF, lpCoeffCalc(), MAX_SENDS, MaxChannels, ALsource::MaxGain, ALsource::MinGain, mini(), ALbufferlistitem::next, NULL, ALCdevice_struct::NumAuxSends, ALCdevice_struct::NumChan, DirectParams::OutBuffer, DirectParams::Params, ALsource::Params, DirectParams::PendingClicks, ALsource::Pitch, ALsource::queue, ALsource::Resample, ALsource::Resampler, ResamplerPadding, ResamplerPrePadding, SelectDirectMixer(), SelectHrtfMixer(), SelectResampler(), SelectSendMixer(), ALsource::Send, SideLeft, SideRight, ALsource::Slot, ALCdevice_struct::Speaker2Chan, DirectParams::State, ALsource::Step, ALeffect::type, and ALsource::WetMix.
Referenced by alSourceQueueBuffers(), and SetSourceiv().
ALvoid CalcSourceParams | ( | struct ALsource * | ALSource, |
const ALCcontext * | ALContext | ||
) |
Definition at line 470 of file ALu.c.
References AIRABSORBGAINHF, ALsource::AirAbsorptionFactor, ALeffect::AirAbsorptionGainHF, AL_EFFECT_NULL, AL_FALSE, AL_TRUE, aluDotproduct(), aluMatrixVector(), aluNormalize(), ALeffectslot::AuxSendAuto, ALbufferlistitem::buffer, BUFFERSIZE, CalcHrtfDelta(), clampf(), DirectParams::ClickRemoval, FILTER::coeff, ComputeAngleGains(), ConeScale, HrtfState::Counter, ALeffect::DecayTime, ALCdevice_struct::DefaultSlot, HrtfParams::Delay, HrtfParams::DelayStep, ALCcontext_struct::Device, HrtfParams::Dir, ALsource::Direct, ALsource::DirectGain, ALsource::DirectGainHF, DisableDistance, ALsource::DistanceModel, ALCcontext_struct::DistanceModel, ALsource::DopplerFactor, ALCcontext_struct::DopplerFactor, ALCcontext_struct::DopplerVelocity, ALsource::DryGainHFAuto, ALsource::DryMix, ALeffectslot::effect, ExponentDistance, ExponentDistanceClamped, F_PI, fastf2i(), FLT_EPSILON, FRACTIONBITS, FRACTIONONE, ALbuffer::Frequency, ALCdevice_struct::Frequency, ALlistener::Gain, HrtfParams::Gain, ALsource::Gain, ALsource::GainHF, DirectParams::Gains, GetHrtfIrSize(), GetLerpedHrtfCoeffs(), GetMovingHrtfCoeffs(), ALsource::HeadRelative, DirectParams::Hrtf, ALsource::Hrtf, ALCdevice_struct::Hrtf, i, DirectParams::iirFilter, ALsource::InnerAngle, InverseDistance, InverseDistanceClamped, HrtfParams::IrSize, IsReverbEffect(), j, lerp(), LinearDistance, LinearDistanceClamped, ALCcontext_struct::Listener, LOWPASSFREQREF, lpCoeffCalc(), ALlistener::Matrix, MAX_SENDS, MaxChannels, ALsource::MaxDistance, maxf(), ALsource::MaxGain, ALlistener::MetersPerUnit, ALsource::MinGain, mini(), HrtfState::Moving, ALbufferlistitem::next, NULL, ALCdevice_struct::NumAuxSends, ALCdevice_struct::NumChan, ALsource::Orientation, DirectParams::OutBuffer, ALsource::OuterAngle, ALsource::OuterGain, ALsource::OuterGainHF, ALlistener::Params, DirectParams::Params, ALsource::Params, DirectParams::PendingClicks, ALsource::Pitch, ALsource::Position, ALsource::queue, ALsource::RefDistance, ALsource::Resample, ALsource::Resampler, ResamplerPadding, ResamplerPrePadding, ALeffect::Reverb, ALsource::RollOffFactor, ALeffect::RoomRolloffFactor, ALsource::RoomRolloffFactor, SelectDirectMixer(), SelectHrtfMixer(), SelectResampler(), SelectSendMixer(), ALsource::Send, ALsource::Slot, ALCcontext_struct::SourceDistanceModel, ALCdevice_struct::Speaker2Chan, ALCcontext_struct::SpeedOfSound, SPEEDOFSOUNDMETRESPERSEC, DirectParams::State, ALsource::Step, ALeffect::type, ALlistener::Velocity, ALsource::Velocity, ALsource::WetGainAuto, ALsource::WetGainHFAuto, ALsource::WetMix, and ZScale.
Referenced by alSourceQueueBuffers(), and SetSourceiv().
Definition at line 58 of file alu.h.
References maxf(), and minf().
Referenced by CalcLimitedHfRatio(), CalcNonAttnSourceParams(), and CalcSourceParams().
Definition at line 72 of file alu.h.
References maxi(), and mini().
Referenced by DecodeIMA4Block(), and EncodeIMA4Block().
|
static |
|
static |
ALvoid ComputeAngleGains | ( | const ALCdevice * | device, |
ALfloat | angle, | ||
ALfloat | hwidth, | ||
ALfloat | ingain, | ||
ALfloat * | gains | ||
) |
ComputeAngleGains
Sets channel gains based on a given source's angle and its half-width. The angle and hwidth parameters are in radians.
Definition at line 149 of file panning.c.
References F_PI, i, lerp(), MaxChannels, ALCdevice_struct::NumChan, ALCdevice_struct::Speaker2Chan, and ALCdevice_struct::SpeakerAngle.
Referenced by CalcNonAttnSourceParams(), CalcSourceParams(), DedicatedUpdate(), EchoUpdate(), and Update3DPanning().
Definition at line 90 of file alu.h.
Referenced by CalcNonAttnSourceParams(), CalcSourceParams(), ComputeAngleGains(), EAXEcho(), EAXModulation(), LateLowPassInOut(), lerp32(), MixDirect_Hrtf(), and Update3DPanning().
Definition at line 56 of file alu.h.
Referenced by CalcHrtfDelta(), CalcSourceParams(), clampf(), GetMovingHrtfCoeffs(), and lpCoeffCalc().
Definition at line 70 of file alu.h.
Referenced by clampi(), EncodeALaw(), and EncodeMuLaw().
|
static |
Definition at line 77 of file alu.h.
Referenced by alsa_get_latency(), and clampi64().
Definition at line 63 of file alu.h.
Referenced by alcOpenDevice(), alsa_open_capture(), clampu(), DSoundOpenCapture(), MixDirect_Hrtf(), MixSource(), UpdateDeviceParams(), and UpdateModulator().
|
static |
Definition at line 84 of file alu.h.
Referenced by clampu64().
Definition at line 54 of file alu.h.
Referenced by CalcDampingCoeff(), CalcHrtfDelta(), clampf(), and Update3DPanning().
Definition at line 68 of file alu.h.
Referenced by CalcNonAttnSourceParams(), CalcSourceParams(), clampi(), EncodeALaw(), EncodeIMA4Block(), and EncodeMuLaw().
|
static |
Definition at line 75 of file alu.h.
Referenced by clampi64(), and MixSource().
Definition at line 61 of file alu.h.
Referenced by alsa_open_capture(), aluMixData(), CalcEvIndices(), clampu(), LoadHrtf(), MixSource(), and UpdateDeviceParams().
|
static |
Definition at line 82 of file alu.h.
Referenced by clampu64(), and GetSourceOffset().
Definition at line 97 of file mixer.c.
References AL_FALSE, AL_PLAYING, AL_STATIC, AL_STOPPED, ALbufferlistitem::buffer, ALsource::BuffersInQueue, BUFFERSIZE, ALsource::BuffersPlayed, HrtfState::Counter, ALbuffer::data, ALsource::Direct, ALsource::DryMix, Filter2P(), ALbuffer::FmtType, FRACTIONBITS, FRACTIONMASK, FRACTIONONE, ALsource::Hrtf, DirectParams::iirFilter, SendParams::iirFilter, j, LoadData(), ALbuffer::LoopEnd, ALsource::Looping, ALbuffer::LoopStart, maxu(), mini64(), minu(), HrtfState::Moving, ALbufferlistitem::next, NULL, ALCdevice_struct::NumAuxSends, ALsource::NumChannels, HrtfState::Offset, ALsource::Params, PointResampler, ALsource::position, ALsource::position_fraction, ALbufferlistitem::prev, ALsource::queue, ALsource::Resample, ALsource::Resampler, ResamplerPadding, ResamplerPrePadding, ALbuffer::SampleLen, ALsource::SampleSize, ALsource::Send, SilenceData(), SendParams::Slot, ALsource::SourceType, ALsource::state, ALsource::Step, and ALsource::WetMix.
Referenced by aluMixData().
ALfloat ConeScale |
Definition at line 46 of file ALu.c.
Referenced by alc_init(), and CalcSourceParams().
ALfloat ZScale |
Definition at line 49 of file ALu.c.
Referenced by alc_init(), and CalcSourceParams().