summaryrefslogtreecommitdiff
path: root/libavcodec/dsputil.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-01-23 11:08:18 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-01-23 11:08:18 +0000
commit91c56db64eef17782973a4abce660fe32d31fc30 (patch)
tree0f4ea6907b7b1287c2db63633564419d38417008 /libavcodec/dsputil.c
parentf2196640711ec564932b7a27e05874fc3a41d765 (diff)
use clip_uint8()
Originally committed as revision 3867 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r--libavcodec/dsputil.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index eb39c50177..0fd76a66bd 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -2374,13 +2374,8 @@ H264_MC(avg_, 16)
#undef op2_put
#endif
-static inline uint8_t clip1(int x){
- if(x > 255) return 255;
- if(x < 0) return 0;
- return x;
-}
-#define op_scale1(x) block[x] = clip1( (block[x]*weight + offset) >> log2_denom )
-#define op_scale2(x) dst[x] = clip( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1), 0, 255 )
+#define op_scale1(x) block[x] = clip_uint8( (block[x]*weight + offset) >> log2_denom )
+#define op_scale2(x) dst[x] = clip_uint8( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1))
#define H264_WEIGHT(W,H) \
static void weight_h264_pixels ## W ## x ## H ## _c(uint8_t *block, int stride, int log2_denom, int weight, int offset){ \
int x, y; \