summaryrefslogtreecommitdiffstats
path: root/audio/filter/af_drc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-26 15:05:59 +0200
committerwm4 <wm4@nowhere>2013-10-26 15:05:59 +0200
commit7abc1bef40869d4efba88df8c5ad8b1ea4c49c57 (patch)
treeed1ef6c259c01dc119c4b99f84daefef5161bd93 /audio/filter/af_drc.c
parent74e7043cc756e171ea1a7fd4be01019c14e1e265 (diff)
downloadmpv-7abc1bef40869d4efba88df8c5ad8b1ea4c49c57.tar.bz2
mpv-7abc1bef40869d4efba88df8c5ad8b1ea4c49c57.tar.xz
af: replace macros with too generic names
Defining names like min, max etc. in an often used header is not really a good idea. Somewhat similar to MPlayer svn commit 36491, but don't use libavutil, because that typically causes us sorrow.
Diffstat (limited to 'audio/filter/af_drc.c')
-rw-r--r--audio/filter/af_drc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/audio/filter/af_drc.c b/audio/filter/af_drc.c
index c0f7b5beca..9bbbde4831 100644
--- a/audio/filter/af_drc.c
+++ b/audio/filter/af_drc.c
@@ -26,6 +26,7 @@
#include <math.h>
#include <limits.h>
+#include "mpvcore/mp_common.h"
#include "af.h"
// Methods:
@@ -139,14 +140,14 @@ static void method1_int16(af_drc_t *s, struct mp_audio *c)
s->mul = (1.0 - SMOOTH_MUL) * s->mul + SMOOTH_MUL * neededmul;
// clamp the mul coefficient
- s->mul = clamp(s->mul, MUL_MIN, MUL_MAX);
+ s->mul = MPCLAMP(s->mul, MUL_MIN, MUL_MAX);
}
// Scale & clamp the samples
for (i = 0; i < len; i++)
{
tmp = s->mul * data[i];
- tmp = clamp(tmp, SHRT_MIN, SHRT_MAX);
+ tmp = MPCLAMP(tmp, SHRT_MIN, SHRT_MAX);
data[i] = tmp;
}
@@ -180,7 +181,7 @@ static void method1_float(af_drc_t *s, struct mp_audio *c)
s->mul = (1.0 - SMOOTH_MUL) * s->mul + SMOOTH_MUL * neededmul;
// clamp the mul coefficient
- s->mul = clamp(s->mul, MUL_MIN, MUL_MAX);
+ s->mul = MPCLAMP(s->mul, MUL_MIN, MUL_MAX);
}
// Scale & clamp the samples
@@ -223,7 +224,7 @@ static void method2_int16(af_drc_t *s, struct mp_audio *c)
if (avg >= SIL_S16)
{
s->mul = s->mid_s16 / avg;
- s->mul = clamp(s->mul, MUL_MIN, MUL_MAX);
+ s->mul = MPCLAMP(s->mul, MUL_MIN, MUL_MAX);
}
}
@@ -231,7 +232,7 @@ static void method2_int16(af_drc_t *s, struct mp_audio *c)
for (i = 0; i < len; i++)
{
tmp = s->mul * data[i];
- tmp = clamp(tmp, SHRT_MIN, SHRT_MAX);
+ tmp = MPCLAMP(tmp, SHRT_MIN, SHRT_MAX);
data[i] = tmp;
}
@@ -273,7 +274,7 @@ static void method2_float(af_drc_t *s, struct mp_audio *c)
if (avg >= SIL_FLOAT)
{
s->mul = s->mid_float / avg;
- s->mul = clamp(s->mul, MUL_MIN, MUL_MAX);
+ s->mul = MPCLAMP(s->mul, MUL_MIN, MUL_MAX);
}
}