From c4ef7399f84f4085ceb77f9897f9c9502d2cfd0d Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 27 May 2017 03:36:34 -0700 Subject: Add a new compressor/limiter This is just for the output limiter right now, but in the future can be used for the compressor EFX effect. The parameters are also hardcoded, but can be made configurable after 1.18. --- OpenAL32/Include/alu.h | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'OpenAL32/Include/alu.h') diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 8a56ddb2..0b3799c0 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -300,28 +300,6 @@ typedef struct ALvoice { void DeinitVoice(ALvoice *voice); -#define LIMITER_WINDOW_SIZE (1<<7) /* 128 */ -#define LIMITER_WINDOW_MASK (LIMITER_WINDOW_SIZE-1) -#define LIMITER_VALUE_MAX (1<<24) /* 16777216 */ -struct OutputLimiter { - /* RMS detection window, sum of values in the window, and the next write - * pos. Values are 16.16 fixed-point. - */ - ALuint Window[LIMITER_WINDOW_SIZE]; - ALuint SquaredSum; - ALsizei Pos; - - /* In milliseconds. */ - ALfloat AttackRate; - ALfloat ReleaseRate; - - /* The gain last used for limiting. */ - ALfloat Gain; -}; - -struct OutputLimiter *alloc_limiter(void); - - typedef void (*MixerFunc)(const ALfloat *data, ALsizei OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALfloat *CurrentGains, const ALfloat *TargetGains, ALsizei Counter, ALsizei OutPos, -- cgit v1.2.3