summaryrefslogtreecommitdiff
path: root/libavcodec/adx.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2007-08-11 22:48:55 +0000
committerAurelien Jacobs <aurel@gnuage.org>2007-08-11 22:48:55 +0000
commitaee481cebe8f95ce3789bdead6fb8ddfb142c37f (patch)
treebaa5eb5fc18cea91d0a68918b12b233910c902ca /libavcodec/adx.c
parent160ab30fcccea5697b2c065e7647c370e321cca6 (diff)
use av_clip_int16() where it makes sense
Originally committed as revision 10078 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/adx.c')
-rw-r--r--libavcodec/adx.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/adx.c b/libavcodec/adx.c
index 4ea8929bc1..7185a32ce0 100644
--- a/libavcodec/adx.c
+++ b/libavcodec/adx.c
@@ -46,8 +46,6 @@ typedef struct {
#define SCALE1 0x7298
#define SCALE2 0x3350
-#define CLIP(s) if (s>32767) s=32767; else if (s<-32768) s=-32768
-
/* 18 bytes <-> 32 samples */
#ifdef CONFIG_ENCODERS
@@ -110,7 +108,7 @@ static void adx_decode(short *out,const unsigned char *in,PREV *prev)
// d>>=4; if (d&8) d-=16;
d = ((signed char)d >> 4);
s0 = (BASEVOL*d*scale + SCALE1*s1 - SCALE2*s2)>>14;
- CLIP(s0);
+ s0 = av_clip_int16(s0);
*out++=s0;
s2 = s1;
s1 = s0;
@@ -119,7 +117,7 @@ static void adx_decode(short *out,const unsigned char *in,PREV *prev)
//d&=15; if (d&8) d-=16;
d = ((signed char)(d<<4) >> 4);
s0 = (BASEVOL*d*scale + SCALE1*s1 - SCALE2*s2)>>14;
- CLIP(s0);
+ s0 = av_clip_int16(s0);
*out++=s0;
s2 = s1;
s1 = s0;