Index: jfdctfst.c |
diff --git a/jfdctfst.c b/jfdctfst.c |
index ccb378a3b45339e05167514a038cc2db616e8fe7..82b2515a272a09313a772d4f69a2e240c66b1506 100644 |
--- a/jfdctfst.c |
+++ b/jfdctfst.c |
@@ -1,9 +1,12 @@ |
/* |
* jfdctfst.c |
* |
+ * This file was part of the Independent JPEG Group's software: |
* Copyright (C) 1994-1996, 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. |
+ * libjpeg-turbo Modifications: |
+ * Copyright (C) 2015, D. R. Commander |
+ * For conditions of distribution and use, see the accompanying README.ijg |
+ * file. |
* |
* This file contains a fast, not so accurate integer implementation of the |
* forward DCT (Discrete Cosine Transform). |
@@ -15,8 +18,8 @@ |
* This implementation is based on Arai, Agui, and Nakajima's algorithm for |
* scaled DCT. Their original paper (Trans. IEICE E-71(11):1095) is in |
* Japanese, but the algorithm is described in the Pennebaker & Mitchell |
- * JPEG textbook (see REFERENCES section in file README). The following code |
- * is based directly on figure 4-8 in P&M. |
+ * JPEG textbook (see REFERENCES section in file README.ijg). The following |
+ * code is based directly on figure 4-8 in P&M. |
* While an 8-point DCT cannot be done in less than 11 multiplies, it is |
* possible to arrange the computation so that many of the multiplies are |
* simple scalings of the final outputs. These multiplies can then be |
@@ -33,7 +36,7 @@ |
#define JPEG_INTERNALS |
#include "jinclude.h" |
#include "jpeglib.h" |
-#include "jdct.h" /* Private declarations for DCT subsystem */ |
+#include "jdct.h" /* Private declarations for DCT subsystem */ |
#ifdef DCT_IFAST_SUPPORTED |
@@ -76,10 +79,10 @@ |
*/ |
#if CONST_BITS == 8 |
-#define FIX_0_382683433 ((INT32) 98) /* FIX(0.382683433) */ |
-#define FIX_0_541196100 ((INT32) 139) /* FIX(0.541196100) */ |
-#define FIX_0_707106781 ((INT32) 181) /* FIX(0.707106781) */ |
-#define FIX_1_306562965 ((INT32) 334) /* FIX(1.306562965) */ |
+#define FIX_0_382683433 ((JLONG) 98) /* FIX(0.382683433) */ |
+#define FIX_0_541196100 ((JLONG) 139) /* FIX(0.541196100) */ |
+#define FIX_0_707106781 ((JLONG) 181) /* FIX(0.707106781) */ |
+#define FIX_1_306562965 ((JLONG) 334) /* FIX(1.306562965) */ |
#else |
#define FIX_0_382683433 FIX(0.382683433) |
#define FIX_0_541196100 FIX(0.541196100) |
@@ -99,7 +102,7 @@ |
#endif |
-/* Multiply a DCTELEM variable by an INT32 constant, and immediately |
+/* Multiply a DCTELEM variable by an JLONG constant, and immediately |
* descale to yield a DCTELEM result. |
*/ |
@@ -111,7 +114,7 @@ |
*/ |
GLOBAL(void) |
-jpeg_fdct_ifast (DCTELEM * data) |
+jpeg_fdct_ifast (DCTELEM *data) |
{ |
DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; |
DCTELEM tmp10, tmp11, tmp12, tmp13; |
@@ -132,24 +135,24 @@ jpeg_fdct_ifast (DCTELEM * data) |
tmp5 = dataptr[2] - dataptr[5]; |
tmp3 = dataptr[3] + dataptr[4]; |
tmp4 = dataptr[3] - dataptr[4]; |
- |
+ |
/* Even part */ |
- |
- tmp10 = tmp0 + tmp3; /* phase 2 */ |
+ |
+ tmp10 = tmp0 + tmp3; /* phase 2 */ |
tmp13 = tmp0 - tmp3; |
tmp11 = tmp1 + tmp2; |
tmp12 = tmp1 - tmp2; |
- |
+ |
dataptr[0] = tmp10 + tmp11; /* phase 3 */ |
dataptr[4] = tmp10 - tmp11; |
- |
+ |
z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ |
- dataptr[2] = tmp13 + z1; /* phase 5 */ |
+ dataptr[2] = tmp13 + z1; /* phase 5 */ |
dataptr[6] = tmp13 - z1; |
- |
+ |
/* Odd part */ |
- tmp10 = tmp4 + tmp5; /* phase 2 */ |
+ tmp10 = tmp4 + tmp5; /* phase 2 */ |
tmp11 = tmp5 + tmp6; |
tmp12 = tmp6 + tmp7; |
@@ -159,15 +162,15 @@ jpeg_fdct_ifast (DCTELEM * data) |
z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ |
z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ |
- z11 = tmp7 + z3; /* phase 5 */ |
+ z11 = tmp7 + z3; /* phase 5 */ |
z13 = tmp7 - z3; |
- dataptr[5] = z13 + z2; /* phase 6 */ |
+ dataptr[5] = z13 + z2; /* phase 6 */ |
dataptr[3] = z13 - z2; |
dataptr[1] = z11 + z4; |
dataptr[7] = z11 - z4; |
- dataptr += DCTSIZE; /* advance pointer to next row */ |
+ dataptr += DCTSIZE; /* advance pointer to next row */ |
} |
/* Pass 2: process columns. */ |
@@ -182,24 +185,24 @@ jpeg_fdct_ifast (DCTELEM * data) |
tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5]; |
tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4]; |
tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4]; |
- |
+ |
/* Even part */ |
- |
- tmp10 = tmp0 + tmp3; /* phase 2 */ |
+ |
+ tmp10 = tmp0 + tmp3; /* phase 2 */ |
tmp13 = tmp0 - tmp3; |
tmp11 = tmp1 + tmp2; |
tmp12 = tmp1 - tmp2; |
- |
+ |
dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */ |
dataptr[DCTSIZE*4] = tmp10 - tmp11; |
- |
+ |
z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */ |
dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */ |
dataptr[DCTSIZE*6] = tmp13 - z1; |
- |
+ |
/* Odd part */ |
- tmp10 = tmp4 + tmp5; /* phase 2 */ |
+ tmp10 = tmp4 + tmp5; /* phase 2 */ |
tmp11 = tmp5 + tmp6; |
tmp12 = tmp6 + tmp7; |
@@ -209,7 +212,7 @@ jpeg_fdct_ifast (DCTELEM * data) |
z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */ |
z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */ |
- z11 = tmp7 + z3; /* phase 5 */ |
+ z11 = tmp7 + z3; /* phase 5 */ |
z13 = tmp7 - z3; |
dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */ |
@@ -217,7 +220,7 @@ jpeg_fdct_ifast (DCTELEM * data) |
dataptr[DCTSIZE*1] = z11 + z4; |
dataptr[DCTSIZE*7] = z11 - z4; |
- dataptr++; /* advance pointer to next column */ |
+ dataptr++; /* advance pointer to next column */ |
} |
} |