summaryrefslogtreecommitdiff
path: root/libavcodec/i386
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-09-01 16:52:33 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-09-01 16:52:33 +0000
commitad324c93515ca4acb43f5973ba67861213ff584d (patch)
treea542e7b37f7a8a4283a28959258b68196b38c783 /libavcodec/i386
parent6b791538b90b95624e4d7b30743b409f3ee64997 (diff)
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
Diffstat (limited to 'libavcodec/i386')
-rw-r--r--libavcodec/i386/fdct_mmx.c2
-rw-r--r--libavcodec/i386/mpegvideo_mmx_template.c6
2 files changed, 4 insertions, 4 deletions
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;