diff options
author | Chris Robinson <[email protected]> | 2018-09-30 12:08:01 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-09-30 12:08:01 -0700 |
commit | 1860b2ec8a1927ce98e516f498dbdf19419ae0a6 (patch) | |
tree | 85dab3bee6298b9c20cd6f1ca003b43fd56801cb /Alc/mastering.h | |
parent | 7ad4f753a42a4ff9c4ce2be0a848f8aaccb86454 (diff) |
Make the Compressor struct opaque
Diffstat (limited to 'Alc/mastering.h')
-rw-r--r-- | Alc/mastering.h | 71 |
1 files changed, 3 insertions, 68 deletions
diff --git a/Alc/mastering.h b/Alc/mastering.h index 67738543..b68b0de1 100644 --- a/Alc/mastering.h +++ b/Alc/mastering.h @@ -6,68 +6,7 @@ /* For BUFFERSIZE. */ #include "alMain.h" -/* These structures assume BUFFERSIZE is a power of 2. - */ -typedef struct SlidingHold -{ - ALfloat Values[BUFFERSIZE]; - ALsizei Expiries[BUFFERSIZE]; - ALsizei LowerIndex; - ALsizei UpperIndex; - ALsizei Length; -} SlidingHold; - -/* General topology and basic automation was based on the following paper: - * - * D. Giannoulis, M. Massberg and J. D. Reiss, - * "Parameter Automation in a Dynamic Range Compressor," - * Journal of the Audio Engineering Society, v61 (10), Oct. 2013 - * - * Available (along with supplemental reading) at: - * - * http://c4dm.eecs.qmul.ac.uk/audioengineering/compressors/ - */ -typedef struct Compressor { - ALsizei NumChans; - ALuint SampleRate; - - struct { - ALuint Knee : 1; - ALuint Attack : 1; - ALuint Release : 1; - ALuint PostGain : 1; - ALuint Declip : 1; - } Auto; - - ALsizei LookAhead; - - ALfloat PreGain; - ALfloat PostGain; - - ALfloat Threshold; - ALfloat Slope; - ALfloat Knee; - - ALfloat Attack; - ALfloat Release; - - alignas(16) ALfloat SideChain[2*BUFFERSIZE]; - alignas(16) ALfloat CrestFactor[BUFFERSIZE]; - - SlidingHold *Hold; - ALfloat (*Delay)[BUFFERSIZE]; - ALsizei DelayIndex; - - ALfloat CrestCoeff; - ALfloat GainEstimate; - ALfloat AdaptCoeff; - - ALfloat LastPeakSq; - ALfloat LastRmsSq; - ALfloat LastRelease; - ALfloat LastAttack; - ALfloat LastGainDev; -} Compressor; +struct Compressor; /* The compressor is initialized with the following settings: * @@ -93,7 +32,7 @@ typedef struct Compressor { * ReleaseTimeMin - Release time (in seconds). Acts as a maximum when * automating release time. */ -Compressor* CompressorInit(const ALuint NumChans, const ALuint SampleRate, +struct Compressor* CompressorInit(const ALsizei NumChans, const ALuint SampleRate, const ALboolean AutoKnee, const ALboolean AutoAttack, const ALboolean AutoRelease, const ALboolean AutoPostGain, const ALboolean AutoDeclip, const ALfloat LookAheadTime, @@ -105,10 +44,6 @@ Compressor* CompressorInit(const ALuint NumChans, const ALuint SampleRate, void ApplyCompression(struct Compressor *Comp, const ALsizei SamplesToDo, ALfloat (*restrict OutBuffer)[BUFFERSIZE]); -inline ALsizei GetCompressorChannelCount(const Compressor *Comp) -{ return Comp->NumChans; } - -inline ALuint GetCompressorSampleRate(const Compressor *Comp) -{ return Comp->SampleRate; } +ALsizei GetCompressorLookAhead(const struct Compressor *Comp); #endif /* MASTERING_H */ |