summaryrefslogtreecommitdiff
path: root/jidctfst.c
diff options
context:
space:
mode:
authorThomas G. Lane <tgl@netcom.com>1995-08-02 00:00:00 +0000
committerDRC <information@libjpeg-turbo.org>2015-07-29 15:31:30 -0500
commitbc79e0680a45d1ca330d690dae0340c8e17ab5e3 (patch)
treea72d3996a6a70824338566ef36c2fe8acb00fba0 /jidctfst.c
parenta8b67c4fbbfde9b4b4e03f2dea8f4f0b1900fc33 (diff)
The Independent JPEG Group's JPEG software v6
Diffstat (limited to 'jidctfst.c')
-rw-r--r--jidctfst.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/jidctfst.c b/jidctfst.c
index f13d14d..5736817 100644
--- a/jidctfst.c
+++ b/jidctfst.c
@@ -1,7 +1,7 @@
/*
* jidctfst.c
*
- * Copyright (C) 1994, Thomas G. Lane.
+ * Copyright (C) 1994-1995, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -139,10 +139,15 @@
#ifdef RIGHT_SHIFT_IS_UNSIGNED
#define ISHIFT_TEMPS DCTELEM ishift_temp;
+#if BITS_IN_JSAMPLE == 8
+#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */
+#else
+#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */
+#endif
#define IRIGHT_SHIFT(x,shft) \
- ((ishift_temp = (x)) < 0 ? \
- (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (32-(shft))) : \
- (ishift_temp >> (shft)))
+ ((ishift_temp = (x)) < 0 ? \
+ (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \
+ (ishift_temp >> (shft)))
#else
#define ISHIFT_TEMPS
#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))