changeset 2448:bfa9192a22ce libavcodec

use clip_uint8()
author michael
date Sun, 23 Jan 2005 11:08:18 +0000
parents 0237bb5ca0f0
children 6f719184e2b9
files dsputil.c
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/dsputil.c	Sun Jan 23 03:49:36 2005 +0000
+++ b/dsputil.c	Sun Jan 23 11:08:18 2005 +0000
@@ -2374,13 +2374,8 @@
 #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; \