aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mastering.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-09-29 11:54:45 -0700
committerChris Robinson <[email protected]>2018-09-29 11:54:45 -0700
commit32494e72a55569b5de1d899663f0c76160e85cd9 (patch)
treeee0769e1290cea56ce7fcd0b01f7619b37d4d16f /Alc/mastering.h
parent0396c0ecd2a10ed74cf1f75e58242b1595598b2e (diff)
Don't use a ringbuffer design for the limiter's side chain
Rather than continuously wrapping when used, each update uses it from the front and copies the tail to the front at the end. This allows for more effficient accesses in loops.
Diffstat (limited to 'Alc/mastering.h')
-rw-r--r--Alc/mastering.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/Alc/mastering.h b/Alc/mastering.h
index 206a6c91..67738543 100644
--- a/Alc/mastering.h
+++ b/Alc/mastering.h
@@ -30,30 +30,38 @@ typedef struct SlidingHold
typedef struct Compressor {
ALsizei NumChans;
ALuint SampleRate;
+
struct {
- ALuint Knee:1;
- ALuint Attack:1;
- ALuint Release:1;
- ALuint PostGain:1;
- ALuint Declip:1;
+ 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;
- ALfloat SideChain[2*BUFFERSIZE];
- ALsizei SideChainIndex;
- ALfloat CrestFactor[BUFFERSIZE];
+
+ 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;