aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mastering.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/mastering.c')
-rw-r--r--Alc/mastering.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/Alc/mastering.c b/Alc/mastering.c
index 9de5fd5f..91267d83 100644
--- a/Alc/mastering.c
+++ b/Alc/mastering.c
@@ -2,37 +2,19 @@
#include <math.h>
+#include "mastering.h"
#include "alu.h"
#include "almalloc.h"
+
+extern inline ALuint GetCompressorSampleRate(const Compressor *Comp);
+
#define RMS_WINDOW_SIZE (1<<7)
#define RMS_WINDOW_MASK (RMS_WINDOW_SIZE-1)
#define RMS_VALUE_MAX (1<<24)
-#define LOOKAHEAD_SIZE (1<<13)
-#define LOOKAHEAD_MASK (LOOKAHEAD_SIZE-1)
-
static_assert(RMS_VALUE_MAX < (UINT_MAX / RMS_WINDOW_SIZE), "RMS_VALUE_MAX is too big");
-typedef struct Compressor {
- ALfloat PreGain;
- ALfloat PostGain;
- ALboolean SummedLink;
- ALfloat AttackMin;
- ALfloat AttackMax;
- ALfloat ReleaseMin;
- ALfloat ReleaseMax;
- ALfloat Ratio;
- ALfloat Threshold;
- ALfloat Knee;
- ALuint SampleRate;
-
- ALuint RmsSum;
- ALuint *RmsWindow;
- ALsizei RmsIndex;
- ALfloat Envelope[BUFFERSIZE];
- ALfloat EnvLast;
-} Compressor;
/* Multichannel compression is linked via one of two modes:
*
@@ -209,11 +191,6 @@ Compressor *CompressorInit(const ALfloat PreGainDb, const ALfloat PostGainDb,
return Comp;
}
-ALuint GetCompressorSampleRate(const Compressor *Comp)
-{
- return Comp->SampleRate;
-}
-
void ApplyCompression(Compressor *Comp, const ALsizei NumChans, const ALsizei SamplesToDo,
ALfloat (*restrict OutBuffer)[BUFFERSIZE])
{