From ee572c5482d9aacbf2cfaf3a6b717c32ba1b5ac5 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 20 Apr 2005 10:05:15 +0000 Subject: [PATCH] remove duplicate clip to 8bit function Originally committed as revision 4143 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/common.h | 2 -- libavcodec/mpegvideo.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/common.h b/libavcodec/common.h index 4d72d88500..5a47c4a3c8 100644 --- a/libavcodec/common.h +++ b/libavcodec/common.h @@ -501,8 +501,6 @@ tend= rdtsc();\ #define STOP_TIMER(id) {} #endif -#define CLAMP_TO_8BIT(d) ((d > 0xff) ? 0xff : (d < 0) ? 0 : d) - /* avoid usage of various functions */ #define malloc please_use_av_malloc #define free please_use_av_free diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 336cf141ae..cbd70106cd 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -5367,7 +5367,7 @@ static void encode_picture(MpegEncContext *s, int picture_number) for(i=1;i<64;i++){ int j= s->dsp.idct_permutation[i]; - s->intra_matrix[j] = CLAMP_TO_8BIT((ff_mpeg1_default_intra_matrix[i] * s->qscale) >> 3); + s->intra_matrix[j] = clip_uint8((ff_mpeg1_default_intra_matrix[i] * s->qscale) >> 3); } convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16, s->intra_matrix, s->intra_quant_bias, 8, 8, 1);