changeset 27224:f9b5d028f097

Copy macro simplification from imaadpcm to msadpcm
author reimar
date Fri, 11 Jul 2008 18:36:21 +0000
parents ffe50e8b6e1c
children 46bcd3f1b123
files libmpcodecs/ad_msadpcm.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_msadpcm.c	Fri Jul 11 18:14:16 2008 +0000
+++ b/libmpcodecs/ad_msadpcm.c	Fri Jul 11 18:36:21 2008 +0000
@@ -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 @@
 #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