summaryrefslogtreecommitdiff
path: root/libavcodec/faandct.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-10-23 09:11:56 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-10-23 09:11:56 +0000
commitb4c3816cfaee19638f0d8b71a31fced84c34236c (patch)
tree10e449e29a1902d2328051628d2f94ef38f019c7 /libavcodec/faandct.c
parent10becaaf12a5ae7860a62f330a2120d7da3e5c40 (diff)
optionally merge postscale into quantization table for the float aan dct
Originally committed as revision 2420 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/faandct.c')
-rw-r--r--libavcodec/faandct.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/libavcodec/faandct.c b/libavcodec/faandct.c
index 4dcb9dafa7..a0de180607 100644
--- a/libavcodec/faandct.c
+++ b/libavcodec/faandct.c
@@ -32,6 +32,11 @@
#include "faandct.h"
#define FLOAT float
+#ifdef FAAN_POSTSCALE
+# define SCALE(x) postscale[x]
+#else
+# define SCALE(x) 1
+#endif
//numbers generated by simple c code (not as accurate as they could be)
/*
@@ -130,12 +135,12 @@ void ff_faandct(DCTELEM * data)
tmp11= tmp1 + tmp2;
tmp12= tmp1 - tmp2;
- data[8*0 + i]= lrint(postscale[8*0 + i] * (tmp10 + tmp11));
- data[8*4 + i]= lrint(postscale[8*4 + i] * (tmp10 - tmp11));
+ data[8*0 + i]= lrint(SCALE(8*0 + i) * (tmp10 + tmp11));
+ data[8*4 + i]= lrint(SCALE(8*4 + i) * (tmp10 - tmp11));
z1= (tmp12 + tmp13)* A1;
- data[8*2 + i]= lrint(postscale[8*2 + i] * (tmp13 + z1));
- data[8*6 + i]= lrint(postscale[8*6 + i] * (tmp13 - z1));
+ data[8*2 + i]= lrint(SCALE(8*2 + i) * (tmp13 + z1));
+ data[8*6 + i]= lrint(SCALE(8*6 + i) * (tmp13 - z1));
tmp10= tmp4 + tmp5;
tmp11= tmp5 + tmp6;
@@ -149,9 +154,9 @@ void ff_faandct(DCTELEM * data)
z11= tmp7 + z3;
z13= tmp7 - z3;
- data[8*5 + i]= lrint(postscale[8*5 + i] * (z13 + z2));
- data[8*3 + i]= lrint(postscale[8*3 + i] * (z13 - z2));
- data[8*1 + i]= lrint(postscale[8*1 + i] * (z11 + z4));
- data[8*7 + i]= lrint(postscale[8*7 + i] * (z11 - z4));
+ data[8*5 + i]= lrint(SCALE(8*5 + i) * (z13 + z2));
+ data[8*3 + i]= lrint(SCALE(8*3 + i) * (z13 - z2));
+ data[8*1 + i]= lrint(SCALE(8*1 + i) * (z11 + z4));
+ data[8*7 + i]= lrint(SCALE(8*7 + i) * (z11 - z4));
}
}