summaryrefslogtreecommitdiff
path: root/libavcodec/jfdctint.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-09-01 20:54:38 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-09-01 20:54:38 +0000
commit004c18ee9ce785c33ffedcbb3b8749f4d63a9a2a (patch)
treef1e3c8914f51245d901ffc9212c2ff4ebd684d88 /libavcodec/jfdctint.c
parent81e0d0b412e7d3d4ee8cc3a9ac940f60a7b1ae3b (diff)
higher accuracy
Originally committed as revision 897 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/jfdctint.c')
-rw-r--r--libavcodec/jfdctint.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/jfdctint.c b/libavcodec/jfdctint.c
index b10419627a..6b0d4cadba 100644
--- a/libavcodec/jfdctint.c
+++ b/libavcodec/jfdctint.c
@@ -30,8 +30,10 @@
#define SHIFT_TEMPS
#define DCTSIZE 8
+#define BITS_IN_JSAMPLE 8
#define GLOBAL(x) x
#define RIGHT_SHIFT(x, n) ((x) >> (n))
+#define MULTIPLY16C16(var,const) ((var)*(const))
#if 1 //def USE_ACCURATE_ROUNDING
#define DESCALE(x,n) RIGHT_SHIFT((x) + (1 << ((n) - 1)), n)
@@ -85,7 +87,7 @@
#if BITS_IN_JSAMPLE == 8
#define CONST_BITS 13
-#define PASS1_BITS 2
+#define PASS1_BITS 4 /* set this to 2 if 16x16 multiplies are faster */
#else
#define CONST_BITS 13
#define PASS1_BITS 1 /* lose a little precision to avoid overflow */
@@ -134,7 +136,7 @@
* For 12-bit samples, a full 32-bit multiplication will be needed.
*/
-#if BITS_IN_JSAMPLE == 8
+#if BITS_IN_JSAMPLE == 8 && CONST_BITS<=13 && PASS1_BITS<=2
#define MULTIPLY(var,const) MULTIPLY16C16(var,const)
#else
#define MULTIPLY(var,const) ((var) * (const))