aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dct-test.c
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/dct-test.c
parent6b791538b90b95624e4d7b30743b409f3ee64997 (diff)
downloadffmpeg-ad324c93515ca4acb43f5973ba67861213ff584d.tar.gz
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/dct-test.c')
-rw-r--r--libavcodec/dct-test.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index e03e1e6436..a46223ed27 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -101,8 +101,12 @@ void dct_error(const char *name, int is_idct,
case 0:
for(i=0;i<64;i++)
block1[i] = (random() % 512) -256;
- if (is_idct)
+ if (is_idct){
fdct(block1);
+
+ for(i=0;i<64;i++)
+ block1[i]>>=3;
+ }
break;
case 1:{
int num= (random()%10)+1;
@@ -153,17 +157,11 @@ void dct_error(const char *name, int is_idct,
if (fdct_func == fdct_ifast) {
for(i=0; i<64; i++) {
- scale = (1 << (AANSCALE_BITS + 11)) / aanscales[i];
+ scale = 8*(1 << (AANSCALE_BITS + 11)) / aanscales[i];
block[i] = (block[i] * scale /*+ (1<<(AANSCALE_BITS-1))*/) >> AANSCALE_BITS;
}
}
- if (fdct_func == ff_jpeg_fdct_islow) {
- for(i=0; i<64; i++) {
- block[i] = (block[i]+3)>>3;
- }
- }
-
fdct_ref(block1);
blockSumErr=0;
@@ -212,8 +210,12 @@ void dct_error(const char *name, int is_idct,
case 0:
for(i=0;i<64;i++)
block1[i] = (random() % 512) -256;
- if (is_idct)
+ if (is_idct){
fdct(block1);
+
+ for(i=0;i<64;i++)
+ block1[i]>>=3;
+ }
break;
case 1:{
case 2: