aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-07-11 18:36:21 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-07-11 18:36:21 +0000
commit05deb158cf85d7fc7894685a91d067e78110e082 (patch)
tree5bdb0286505e8f4bf6f43c43b085c65e34829309
parent796e4a53cacd6ed6b4a02c3f300d1fadd0687844 (diff)
Copy macro simplification from imaadpcm to msadpcm
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27256 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libmpcodecs/ad_msadpcm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libmpcodecs/ad_msadpcm.c b/libmpcodecs/ad_msadpcm.c
index 5313f65b8a..1ebf646845 100644
--- a/libmpcodecs/ad_msadpcm.c
+++ b/libmpcodecs/ad_msadpcm.c
@@ -12,6 +12,7 @@
#include <unistd.h>
#include "config.h"
+#include "libavutil/common.h"
#include "mpbswap.h"
#include "ad_internal.h"
@@ -47,10 +48,9 @@ static const int ms_adapt_coeff2[] =
#define LE_16(x) ((x)[0]+(256*((x)[1])))
// clamp a number between 0 and 88
-#define CLAMP_0_TO_88(x) if (x < 0) x = 0; else if (x > 88) x = 88;
+#define CLAMP_0_TO_88(x) x = av_clip(x, 0, 88);
// clamp a number within a signed 16-bit range
-#define CLAMP_S16(x) if (x < -32768) x = -32768; \
- else if (x > 32767) x = 32767;
+#define CLAMP_S16(x) x = av_clip_int16(x);
// clamp a number above 16
#define CLAMP_ABOVE_16(x) if (x < 16) x = 16;
// sign extend a 16-bit value