From ad324c93515ca4acb43f5973ba67861213ff584d Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 1 Sep 2002 16:52:33 +0000 Subject: dct cleanup more accurate mmx dct (dont discard bits for fun) fixing mmx quantizer bug for qscale%2==1 (bias was slightly wrong) Originally committed as revision 895 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/i386/fdct_mmx.c | 2 +- libavcodec/i386/mpegvideo_mmx_template.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'libavcodec/i386') diff --git a/libavcodec/i386/fdct_mmx.c b/libavcodec/i386/fdct_mmx.c index 8c30818485..e43871b5cd 100644 --- a/libavcodec/i386/fdct_mmx.c +++ b/libavcodec/i386/fdct_mmx.c @@ -25,7 +25,7 @@ #define BITS_FRW_ACC 3 //; 2 or 3 for accuracy #define SHIFT_FRW_COL BITS_FRW_ACC -#define SHIFT_FRW_ROW (BITS_FRW_ACC + 17) +#define SHIFT_FRW_ROW (BITS_FRW_ACC + 17 - 3) //#define RND_FRW_ROW (262144 * (BITS_FRW_ACC - 1)) //; 1 << (SHIFT_FRW_ROW-1) #define RND_FRW_ROW (1 << (SHIFT_FRW_ROW-1)) //#define RND_FRW_COL (2 * (BITS_FRW_ACC - 1)) //; 1 << (SHIFT_FRW_COL-1) diff --git a/libavcodec/i386/mpegvideo_mmx_template.c b/libavcodec/i386/mpegvideo_mmx_template.c index 6c3e52ea5f..185baaa420 100644 --- a/libavcodec/i386/mpegvideo_mmx_template.c +++ b/libavcodec/i386/mpegvideo_mmx_template.c @@ -46,9 +46,9 @@ static int RENAME(dct_quantize)(MpegEncContext *s, if (s->mb_intra) { int dummy; if (n < 4) - q = s->y_dc_scale; + q = s->y_dc_scale<<3; else - q = s->c_dc_scale; + q = s->c_dc_scale<<3; /* note: block[0] is assumed to be positive */ if (!s->h263_aic) { #if 1 @@ -70,7 +70,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s, #endif } else /* For AIC we skip quant/dequant of INTRADC */ - level = block[0]; + level = block[0]>>3; block[0]=0; //avoid fake overflow // temp_block[0] = (block[0] + (q >> 1)) / q; -- cgit v1.2.3