Added flags to the TurboJPEG API that allow the caller to force the use of either the fast or the accurate DCT/IDCT algorithms in the underlying codec.
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.2.x@849 632fc199-4ca6-4c93-a231-07263d6284db
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 09a150a..2f1242a 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -41,6 +41,9 @@
4.3 on OS X platforms would cause NASM to return numerous errors of the form
"'%define' expects a macro identifier".
+[9] Added flags to the TurboJPEG API that allow the caller to force the use of
+either the fast or the accurate DCT/IDCT algorithms in the underlying codec.
+
1.2.0
=====
diff --git a/doc/html/annotated.html b/doc/html/annotated.html
index b7d3b54..f96b48d 100644
--- a/doc/html/annotated.html
+++ b/doc/html/annotated.html
@@ -81,7 +81,7 @@
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 14:21:06 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
diff --git a/doc/html/classes.html b/doc/html/classes.html
index e3c582f..3ad40dd 100644
--- a/doc/html/classes.html
+++ b/doc/html/classes.html
@@ -80,7 +80,7 @@
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 14:21:06 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
diff --git a/doc/html/functions.html b/doc/html/functions.html
index a0e9d85..0dba6d5 100644
--- a/doc/html/functions.html
+++ b/doc/html/functions.html
@@ -113,7 +113,7 @@
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 14:21:06 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
diff --git a/doc/html/functions_vars.html b/doc/html/functions_vars.html
index f808a68..10d7269 100644
--- a/doc/html/functions_vars.html
+++ b/doc/html/functions_vars.html
@@ -113,7 +113,7 @@
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 14:21:06 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
diff --git a/doc/html/group___turbo_j_p_e_g.html b/doc/html/group___turbo_j_p_e_g.html
index 0c48317..cc85ced 100644
--- a/doc/html/group___turbo_j_p_e_g.html
+++ b/doc/html/group___turbo_j_p_e_g.html
@@ -82,17 +82,21 @@
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">TJFLAG_BOTTOMUP</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The uncompressed source/destination image is stored in bottom-up (Windows, OpenGL) order, not top-down (X11) order. <a href="#ga72ecf4ebe6eb702d3c6f5ca27455e1ec"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga4e872f11c82f241736fa8297920f24e5">TJFLAG_FORCEMMX</a></td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use MMX code (IPP and 32-bit libjpeg-turbo versions only.) <a href="#ga4e872f11c82f241736fa8297920f24e5"></a><br/></td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use MMX code (if the underlying codec supports it.) <a href="#ga4e872f11c82f241736fa8297920f24e5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gae17e63189e8cd730feed3efbd2454f38">TJFLAG_FORCESSE</a></td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use SSE code (32-bit IPP and 32-bit libjpeg-turbo versions only) <a href="#gae17e63189e8cd730feed3efbd2454f38"></a><br/></td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use SSE code (if the underlying codec supports it.) <a href="#gae17e63189e8cd730feed3efbd2454f38"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga8cf0bca96ea4d472563f4b0ebf8c48e7">TJFLAG_FORCESSE2</a></td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use SSE2 code (32-bit IPP and 32-bit libjpeg-turbo versions only) <a href="#ga8cf0bca96ea4d472563f4b0ebf8c48e7"></a><br/></td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use SSE2 code (if the underlying codec supports it.) <a href="#ga8cf0bca96ea4d472563f4b0ebf8c48e7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaf9d49066633404da4386d70820295dd2">TJFLAG_FORCESSE3</a></td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use SSE3 code (64-bit IPP version only) <a href="#gaf9d49066633404da4386d70820295dd2"></a><br/></td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Turn off CPU auto-detection and force TurboJPEG to use SSE3 code (if the underlying codec supports it.) <a href="#gaf9d49066633404da4386d70820295dd2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga4ee4506c81177a06f77e2504a22efd2d">TJFLAG_FASTUPSAMPLE</a></td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Use fast, inaccurate chrominance upsampling routines in the JPEG decompressor (libjpeg and libjpeg-turbo versions only) <a href="#ga4ee4506c81177a06f77e2504a22efd2d"></a><br/></td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">When decompressing, use the fastest chrominance upsampling algorithm available in the underlying codec. <a href="#ga4ee4506c81177a06f77e2504a22efd2d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963">TJFLAG_NOREALLOC</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Disable buffer (re)allocation. <a href="#ga8808d403c68b62aaa58a4c1e58e98963"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaabce235db80d3f698b27f36cbd453da2">TJFLAG_FASTDCT</a></td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Use the fastest DCT/IDCT algorithm available in the underlying codec. <a href="#gaabce235db80d3f698b27f36cbd453da2"></a><br/></td></tr>
+<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">TJFLAG_ACCURATEDCT</a></td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Use the most accurate DCT/IDCT algorithm available in the underlying codec. <a href="#gacb233cfd722d66d1ccbf48a7de81f0e0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0f6dbd18adf38b7d46ac547f0f4d562c">TJ_NUMXOP</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Number of transform operations. <a href="#ga0f6dbd18adf38b7d46ac547f0f4d562c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00">TJXOPT_PERFECT</a></td></tr>
@@ -255,6 +259,22 @@
</div>
</div>
+<a class="anchor" id="gacb233cfd722d66d1ccbf48a7de81f0e0"></a><!-- doxytag: member="turbojpeg.h::TJFLAG_ACCURATEDCT" ref="gacb233cfd722d66d1ccbf48a7de81f0e0" args="" -->
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">#define TJFLAG_ACCURATEDCT</td>
+ </tr>
+ </table>
+</div>
+<div class="memdoc">
+
+<p>Use the most accurate DCT/IDCT algorithm available in the underlying codec. </p>
+<p>The default if this flag is not specified is implementation-specific. The libjpeg implementation, for example, uses the fast algorithm by default when compressing, because this has been shown to have only a very slight effect on accuracy, but it uses the accurate algorithm when decompressing, because this has been shown to have a larger effect. </p>
+
+</div>
+</div>
<a class="anchor" id="ga72ecf4ebe6eb702d3c6f5ca27455e1ec"></a><!-- doxytag: member="turbojpeg.h::TJFLAG_BOTTOMUP" ref="ga72ecf4ebe6eb702d3c6f5ca27455e1ec" args="" -->
<div class="memitem">
<div class="memproto">
@@ -270,6 +290,22 @@
</div>
</div>
+<a class="anchor" id="gaabce235db80d3f698b27f36cbd453da2"></a><!-- doxytag: member="turbojpeg.h::TJFLAG_FASTDCT" ref="gaabce235db80d3f698b27f36cbd453da2" args="" -->
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">#define TJFLAG_FASTDCT</td>
+ </tr>
+ </table>
+</div>
+<div class="memdoc">
+
+<p>Use the fastest DCT/IDCT algorithm available in the underlying codec. </p>
+<p>The default if this flag is not specified is implementation-specific. The libjpeg implementation, for example, uses the fast algorithm by default when compressing, because this has been shown to have only a very slight effect on accuracy, but it uses the accurate algorithm when decompressing, because this has been shown to have a larger effect. </p>
+
+</div>
+</div>
<a class="anchor" id="ga4ee4506c81177a06f77e2504a22efd2d"></a><!-- doxytag: member="turbojpeg.h::TJFLAG_FASTUPSAMPLE" ref="ga4ee4506c81177a06f77e2504a22efd2d" args="" -->
<div class="memitem">
<div class="memproto">
@@ -281,7 +317,8 @@
</div>
<div class="memdoc">
-<p>Use fast, inaccurate chrominance upsampling routines in the JPEG decompressor (libjpeg and libjpeg-turbo versions only) </p>
+<p>When decompressing, use the fastest chrominance upsampling algorithm available in the underlying codec. </p>
+<p>The default is to use smooth upsampling, which creates a smooth transition between neighboring chrominance components in order to reduce upsampling artifacts in the decompressed image. </p>
</div>
</div>
@@ -296,7 +333,7 @@
</div>
<div class="memdoc">
-<p>Turn off CPU auto-detection and force TurboJPEG to use MMX code (IPP and 32-bit libjpeg-turbo versions only.) </p>
+<p>Turn off CPU auto-detection and force TurboJPEG to use MMX code (if the underlying codec supports it.) </p>
</div>
</div>
@@ -311,7 +348,7 @@
</div>
<div class="memdoc">
-<p>Turn off CPU auto-detection and force TurboJPEG to use SSE code (32-bit IPP and 32-bit libjpeg-turbo versions only) </p>
+<p>Turn off CPU auto-detection and force TurboJPEG to use SSE code (if the underlying codec supports it.) </p>
</div>
</div>
@@ -326,7 +363,7 @@
</div>
<div class="memdoc">
-<p>Turn off CPU auto-detection and force TurboJPEG to use SSE2 code (32-bit IPP and 32-bit libjpeg-turbo versions only) </p>
+<p>Turn off CPU auto-detection and force TurboJPEG to use SSE2 code (if the underlying codec supports it.) </p>
</div>
</div>
@@ -341,7 +378,7 @@
</div>
<div class="memdoc">
-<p>Turn off CPU auto-detection and force TurboJPEG to use SSE3 code (64-bit IPP version only) </p>
+<p>Turn off CPU auto-detection and force TurboJPEG to use SSE3 code (if the underlying codec supports it.) </p>
</div>
</div>
@@ -1557,7 +1594,7 @@
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 14:21:06 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
diff --git a/doc/html/index.html b/doc/html/index.html
index be0e810..4a8db79 100644
--- a/doc/html/index.html
+++ b/doc/html/index.html
@@ -69,7 +69,7 @@
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 14:21:06 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
diff --git a/doc/html/modules.html b/doc/html/modules.html
index 5277997..194a099 100644
--- a/doc/html/modules.html
+++ b/doc/html/modules.html
@@ -72,7 +72,7 @@
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 14:21:06 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
diff --git a/doc/html/structtjregion.html b/doc/html/structtjregion.html
index fd293fa..3b9ff6c 100644
--- a/doc/html/structtjregion.html
+++ b/doc/html/structtjregion.html
@@ -165,7 +165,7 @@
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 14:21:06 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
diff --git a/doc/html/structtjscalingfactor.html b/doc/html/structtjscalingfactor.html
index 33f7c05..048b106 100644
--- a/doc/html/structtjscalingfactor.html
+++ b/doc/html/structtjscalingfactor.html
@@ -127,7 +127,7 @@
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 14:21:06 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
diff --git a/doc/html/structtjtransform.html b/doc/html/structtjtransform.html
index 39f9e47..f0e5932 100644
--- a/doc/html/structtjtransform.html
+++ b/doc/html/structtjtransform.html
@@ -191,7 +191,7 @@
</iframe>
</div>
-<hr class="footer"/><address class="footer"><small>Generated on Sun Dec 18 2011 20:09:47 for TurboJPEG by 
+<hr class="footer"/><address class="footer"><small>Generated on Fri Jun 29 2012 14:21:06 for TurboJPEG by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
diff --git a/doxygen.config b/doxygen.config
index 5fb34b3..5a0b5a7 100644
--- a/doxygen.config
+++ b/doxygen.config
@@ -1,5 +1,5 @@
PROJECT_NAME = TurboJPEG
-PROJECT_NUMBER = 1.2
+PROJECT_NUMBER = 1.2.1
OUTPUT_DIRECTORY = doc/
USE_WINDOWS_ENCODING = NO
OPTIMIZE_OUTPUT_FOR_C = YES
diff --git a/java/TJExample.java b/java/TJExample.java
index 36c1a8f..fc5d53a 100644
--- a/java/TJExample.java
+++ b/java/TJExample.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C)2011 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2011-2012 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -80,7 +80,13 @@
System.out.println(" compressed using no subsampling or grayscale, or 16x8 for 4:2:2 or 16x16");
System.out.println(" for 4:2:0.)\n");
System.out.println("-display = Display output image (Output file need not be specified in this");
- System.out.println(" case.)\n");
+ System.out.println(" case.)");
+ System.out.println("-fastupsample = Use fast, inaccurate upsampling code to perform 4:2:2 and 4:2:0");
+ System.out.println(" YUV decoding");
+ System.out.println("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying");
+ System.out.println(" codec");
+ System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the");
+ System.out.println(" underlying codec");
System.exit(1);
}
@@ -92,6 +98,7 @@
BufferedImage img = null; byte[] bmpBuf = null;
TJTransform xform = new TJTransform();
+ int flags = 0;
try {
@@ -187,6 +194,18 @@
}
if(argv[i].substring(0, 2).equalsIgnoreCase("-d"))
display = true;
+ if(argv[i].equalsIgnoreCase("-fastupsample")) {
+ System.out.println("Using fast upsampling code");
+ flags |= TJ.FLAG_FASTUPSAMPLE;
+ }
+ if(argv[i].equalsIgnoreCase("-fastdct")) {
+ System.out.println("Using fastest DCT/IDCT algorithm");
+ flags |= TJ.FLAG_FASTDCT;
+ }
+ if(argv[i].equalsIgnoreCase("-accuratedct")) {
+ System.out.println("Using most accurate DCT/IDCT algorithm");
+ flags |= TJ.FLAG_ACCURATEDCT;
+ }
}
}
String[] inFileTokens = argv[0].split("\\.");
@@ -247,8 +266,9 @@
height = scaleFactor.getScaled(height);
if(!outFormat.equalsIgnoreCase("jpg"))
- img = tjd.decompress(width, height, BufferedImage.TYPE_INT_RGB, 0);
- else bmpBuf = tjd.decompress(width, 0, height, TJ.PF_BGRX, 0);
+ img = tjd.decompress(width, height, BufferedImage.TYPE_INT_RGB,
+ flags);
+ else bmpBuf = tjd.decompress(width, 0, height, TJ.PF_BGRX, flags);
tjd.close();
}
else {
@@ -282,10 +302,10 @@
tjc.setSubsamp(outSubsamp);
tjc.setJPEGQuality(outQual);
if(img != null)
- jpegBuf = tjc.compress(img, 0);
+ jpegBuf = tjc.compress(img, flags);
else {
tjc.setSourceImage(bmpBuf, width, 0, height, TJ.PF_BGRX);
- jpegBuf = tjc.compress(0);
+ jpegBuf = tjc.compress(flags);
}
jpegSize = tjc.getCompressedSize();
tjc.close();
diff --git a/java/doc/allclasses-frame.html b/java/doc/allclasses-frame.html
index a2b0499..4860d29 100644
--- a/java/doc/allclasses-frame.html
+++ b/java/doc/allclasses-frame.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
All Classes
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
diff --git a/java/doc/allclasses-noframe.html b/java/doc/allclasses-noframe.html
index e3c96ca..accfa3f 100644
--- a/java/doc/allclasses-noframe.html
+++ b/java/doc/allclasses-noframe.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
All Classes
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
diff --git a/java/doc/constant-values.html b/java/doc/constant-values.html
index 667e3ef..26d6d95 100644
--- a/java/doc/constant-values.html
+++ b/java/doc/constant-values.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
Constant Field Values
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
@@ -101,12 +101,24 @@
<TH ALIGN="left" COLSPAN="3">org.libjpegturbo.turbojpeg.<A HREF="org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
+<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_ACCURATEDCT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
+<CODE>public static final int</CODE></FONT></TD>
+<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT">FLAG_ACCURATEDCT</A></CODE></TD>
+<TD ALIGN="right"><CODE>4096</CODE></TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_BOTTOMUP"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public static final int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP">FLAG_BOTTOMUP</A></CODE></TD>
<TD ALIGN="right"><CODE>2</CODE></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
+<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTDCT"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
+<CODE>public static final int</CODE></FONT></TD>
+<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT">FLAG_FASTDCT</A></CODE></TD>
+<TD ALIGN="right"><CODE>2048</CODE></TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
<A NAME="org.libjpegturbo.turbojpeg.TJ.FLAG_FASTUPSAMPLE"><!-- --></A><TD ALIGN="right"><FONT SIZE="-1">
<CODE>public static final int</CODE></FONT></TD>
<TD ALIGN="left"><CODE><A HREF="org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE">FLAG_FASTUPSAMPLE</A></CODE></TD>
diff --git a/java/doc/deprecated-list.html b/java/doc/deprecated-list.html
index 8654476..27f6caf 100644
--- a/java/doc/deprecated-list.html
+++ b/java/doc/deprecated-list.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
Deprecated List
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
diff --git a/java/doc/help-doc.html b/java/doc/help-doc.html
index 9d609c3..8724af8 100644
--- a/java/doc/help-doc.html
+++ b/java/doc/help-doc.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
API Help
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
diff --git a/java/doc/index-all.html b/java/doc/index-all.html
index 1589d6d..5213541 100644
--- a/java/doc/index-all.html
+++ b/java/doc/index-all.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
Index
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="./stylesheet.css" TITLE="Style">
@@ -191,30 +191,37 @@
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()"><B>finalize()</B></A> -
Method in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</A>
<DD>
+<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT"><B>FLAG_ACCURATEDCT</B></A> -
+Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
+<DD>Use the most accurate DCT/IDCT algorithm available in the underlying
+ codec.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><B>FLAG_BOTTOMUP</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>The uncompressed source/destination image is stored in bottom-up (Windows,
OpenGL) order, not top-down (X11) order.
+<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT"><B>FLAG_FASTDCT</B></A> -
+Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
+<DD>Use the fastest DCT/IDCT algorithm available in the underlying codec.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE"><B>FLAG_FASTUPSAMPLE</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
-<DD>Use fast, inaccurate chrominance upsampling routines in the JPEG
- decompressor (libjpeg and libjpeg-turbo versions only.)
+<DD>When decompressing, use the fastest chrominance upsampling algorithm
+ available in the underlying codec.
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCEMMX"><B>FLAG_FORCEMMX</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>Turn off CPU auto-detection and force TurboJPEG to use MMX code
- (IPP and 32-bit libjpeg-turbo versions only.)
+ (if the underlying codec supports it.)
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE"><B>FLAG_FORCESSE</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE code
- (32-bit IPP and 32-bit libjpeg-turbo versions only.)
+ (if the underlying codec supports it.)
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE2"><B>FLAG_FORCESSE2</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE2 code
- (32-bit IPP and 32-bit libjpeg-turbo versions only.)
+ (if the underlying codec supports it.)
<DT><A HREF="./org/libjpegturbo/turbojpeg/TJ.html#FLAG_FORCESSE3"><B>FLAG_FORCESSE3</B></A> -
Static variable in class org.libjpegturbo.turbojpeg.<A HREF="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</A>
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE3 code
-(64-bit IPP version only.)
+ (if the underlying codec supports it.)
</DL>
<HR>
<A NAME="_G_"><!-- --></A><H2>
diff --git a/java/doc/index.html b/java/doc/index.html
index 8e6f370..93c50af 100644
--- a/java/doc/index.html
+++ b/java/doc/index.html
@@ -2,7 +2,7 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc on Sun Dec 18 20:09:44 CST 2011-->
+<!-- Generated by javadoc on Fri Jun 29 14:29:14 CDT 2012-->
<TITLE>
Generated Documentation (Untitled)
</TITLE>
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJ.html b/java/doc/org/libjpegturbo/turbojpeg/TJ.html
index b3300e2..326b22f 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJ.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJ.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJ
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
@@ -117,6 +117,15 @@
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_ACCURATEDCT">FLAG_ACCURATEDCT</A></B></CODE>
+
+<BR>
+ Use the most accurate DCT/IDCT algorithm available in the underlying
+ codec.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP">FLAG_BOTTOMUP</A></B></CODE>
<BR>
@@ -126,11 +135,19 @@
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTDCT">FLAG_FASTDCT</A></B></CODE>
+
+<BR>
+ Use the fastest DCT/IDCT algorithm available in the underlying codec.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_FASTUPSAMPLE">FLAG_FASTUPSAMPLE</A></B></CODE>
<BR>
- Use fast, inaccurate chrominance upsampling routines in the JPEG
- decompressor (libjpeg and libjpeg-turbo versions only.)</TD>
+ When decompressing, use the fastest chrominance upsampling algorithm
+ available in the underlying codec.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -139,7 +156,7 @@
<BR>
Turn off CPU auto-detection and force TurboJPEG to use MMX code
- (IPP and 32-bit libjpeg-turbo versions only.)</TD>
+ (if the underlying codec supports it.)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -148,7 +165,7 @@
<BR>
Turn off CPU auto-detection and force TurboJPEG to use SSE code
- (32-bit IPP and 32-bit libjpeg-turbo versions only.)</TD>
+ (if the underlying codec supports it.)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -157,7 +174,7 @@
<BR>
Turn off CPU auto-detection and force TurboJPEG to use SSE2 code
- (32-bit IPP and 32-bit libjpeg-turbo versions only.)</TD>
+ (if the underlying codec supports it.)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -166,7 +183,7 @@
<BR>
Turn off CPU auto-detection and force TurboJPEG to use SSE3 code
-(64-bit IPP version only.)</TD>
+ (if the underlying codec supports it.)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -711,7 +728,7 @@
public static final int <B>FLAG_FORCEMMX</B></PRE>
<DL>
<DD>Turn off CPU auto-detection and force TurboJPEG to use MMX code
- (IPP and 32-bit libjpeg-turbo versions only.)
+ (if the underlying codec supports it.)
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCEMMX">Constant Field Values</A></DL>
@@ -724,7 +741,7 @@
public static final int <B>FLAG_FORCESSE</B></PRE>
<DL>
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE code
- (32-bit IPP and 32-bit libjpeg-turbo versions only.)
+ (if the underlying codec supports it.)
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE">Constant Field Values</A></DL>
@@ -737,7 +754,7 @@
public static final int <B>FLAG_FORCESSE2</B></PRE>
<DL>
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE2 code
- (32-bit IPP and 32-bit libjpeg-turbo versions only.)
+ (if the underlying codec supports it.)
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE2">Constant Field Values</A></DL>
@@ -750,7 +767,7 @@
public static final int <B>FLAG_FORCESSE3</B></PRE>
<DL>
<DD>Turn off CPU auto-detection and force TurboJPEG to use SSE3 code
-(64-bit IPP version only.)
+ (if the underlying codec supports it.)
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FORCESSE3">Constant Field Values</A></DL>
@@ -762,12 +779,50 @@
<PRE>
public static final int <B>FLAG_FASTUPSAMPLE</B></PRE>
<DL>
-<DD>Use fast, inaccurate chrominance upsampling routines in the JPEG
- decompressor (libjpeg and libjpeg-turbo versions only.)
+<DD>When decompressing, use the fastest chrominance upsampling algorithm
+ available in the underlying codec. The default is to use smooth
+ upsampling, which creates a smooth transition between neighboring
+ chrominance components in order to reduce upsampling artifacts in the
+ decompressed image.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FASTUPSAMPLE">Constant Field Values</A></DL>
</DL>
+<HR>
+
+<A NAME="FLAG_FASTDCT"><!-- --></A><H3>
+FLAG_FASTDCT</H3>
+<PRE>
+public static final int <B>FLAG_FASTDCT</B></PRE>
+<DL>
+<DD>Use the fastest DCT/IDCT algorithm available in the underlying codec. The
+ default if this flag is not specified is implementation-specific. The
+ libjpeg implementation, for example, uses the fast algorithm by default
+ when compressing, because this has been shown to have only a very slight
+ effect on accuracy, but it uses the accurate algorithm when decompressing,
+ because this has been shown to have a larger effect.
+<P>
+<DL>
+<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_FASTDCT">Constant Field Values</A></DL>
+</DL>
+<HR>
+
+<A NAME="FLAG_ACCURATEDCT"><!-- --></A><H3>
+FLAG_ACCURATEDCT</H3>
+<PRE>
+public static final int <B>FLAG_ACCURATEDCT</B></PRE>
+<DL>
+<DD>Use the most accurate DCT/IDCT algorithm available in the underlying
+ codec. The default if this flag is not specified is
+ implementation-specific. The libjpeg implementation, for example, uses
+ the fast algorithm by default when compressing, because this has been
+ shown to have only a very slight effect on accuracy, but it uses the
+ accurate algorithm when decompressing, because this has been shown to have
+ a larger effect.
+<P>
+<DL>
+<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJ.FLAG_ACCURATEDCT">Constant Field Values</A></DL>
+</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
index ba5b1da..1c7088a 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJCompressor
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html b/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html
index 5a93ded..9a3b56e 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJCustomFilter.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJCustomFilter
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html
index 8eabb59..2505470 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJDecompressor.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJDecompressor
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html b/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html
index decf430..4964a29 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJScalingFactor.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJScalingFactor
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html b/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html
index b207637..ebb9644 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJTransform.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJTransform
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html
index 9e74a6e..df81c9c 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/TJTransformer.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
TJTransformer
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/package-frame.html b/java/doc/org/libjpegturbo/turbojpeg/package-frame.html
index 50ede9f..562e570 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/package-frame.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/package-frame.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
org.libjpegturbo.turbojpeg
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/package-summary.html b/java/doc/org/libjpegturbo/turbojpeg/package-summary.html
index d98f285..600546c 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/package-summary.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/package-summary.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
org.libjpegturbo.turbojpeg
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
diff --git a/java/doc/org/libjpegturbo/turbojpeg/package-tree.html b/java/doc/org/libjpegturbo/turbojpeg/package-tree.html
index 319c1eb..e33355b 100644
--- a/java/doc/org/libjpegturbo/turbojpeg/package-tree.html
+++ b/java/doc/org/libjpegturbo/turbojpeg/package-tree.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:13 CDT 2012 -->
<TITLE>
org.libjpegturbo.turbojpeg Class Hierarchy
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
diff --git a/java/doc/overview-tree.html b/java/doc/overview-tree.html
index e3839ee..fc5467a 100644
--- a/java/doc/overview-tree.html
+++ b/java/doc/overview-tree.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
Class Hierarchy
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
diff --git a/java/doc/serialized-form.html b/java/doc/serialized-form.html
index 39ec91f..8c7e089 100644
--- a/java/doc/serialized-form.html
+++ b/java/doc/serialized-form.html
@@ -2,12 +2,12 @@
<!--NewPage-->
<HTML>
<HEAD>
-<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 18 20:09:44 CST 2011 -->
+<!-- Generated by javadoc (build 1.6.0_33) on Fri Jun 29 14:29:14 CDT 2012 -->
<TITLE>
Serialized Form
</TITLE>
-<META NAME="date" CONTENT="2011-12-18">
+<META NAME="date" CONTENT="2012-06-29">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
diff --git a/java/org/libjpegturbo/turbojpeg/TJ.java b/java/org/libjpegturbo/turbojpeg/TJ.java
index 5e0c0b7..78a72f6 100644
--- a/java/org/libjpegturbo/turbojpeg/TJ.java
+++ b/java/org/libjpegturbo/turbojpeg/TJ.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C)2011 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2011-2012 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -272,29 +272,51 @@
final public static int FLAG_BOTTOMUP = 2;
/**
* Turn off CPU auto-detection and force TurboJPEG to use MMX code
- * (IPP and 32-bit libjpeg-turbo versions only.)
+ * (if the underlying codec supports it.)
*/
final public static int FLAG_FORCEMMX = 8;
/**
* Turn off CPU auto-detection and force TurboJPEG to use SSE code
- * (32-bit IPP and 32-bit libjpeg-turbo versions only.)
+ * (if the underlying codec supports it.)
*/
final public static int FLAG_FORCESSE = 16;
/**
* Turn off CPU auto-detection and force TurboJPEG to use SSE2 code
- * (32-bit IPP and 32-bit libjpeg-turbo versions only.)
+ * (if the underlying codec supports it.)
*/
final public static int FLAG_FORCESSE2 = 32;
/**
* Turn off CPU auto-detection and force TurboJPEG to use SSE3 code
- *(64-bit IPP version only.)
+ * (if the underlying codec supports it.)
*/
final public static int FLAG_FORCESSE3 = 128;
/**
- * Use fast, inaccurate chrominance upsampling routines in the JPEG
- * decompressor (libjpeg and libjpeg-turbo versions only.)
+ * When decompressing, use the fastest chrominance upsampling algorithm
+ * available in the underlying codec. The default is to use smooth
+ * upsampling, which creates a smooth transition between neighboring
+ * chrominance components in order to reduce upsampling artifacts in the
+ * decompressed image.
*/
final public static int FLAG_FASTUPSAMPLE = 256;
+ /**
+ * Use the fastest DCT/IDCT algorithm available in the underlying codec. The
+ * default if this flag is not specified is implementation-specific. The
+ * libjpeg implementation, for example, uses the fast algorithm by default
+ * when compressing, because this has been shown to have only a very slight
+ * effect on accuracy, but it uses the accurate algorithm when decompressing,
+ * because this has been shown to have a larger effect.
+ */
+ final public static int FLAG_FASTDCT = 2048;
+ /**
+ * Use the most accurate DCT/IDCT algorithm available in the underlying
+ * codec. The default if this flag is not specified is
+ * implementation-specific. The libjpeg implementation, for example, uses
+ * the fast algorithm by default when compressing, because this has been
+ * shown to have only a very slight effect on accuracy, but it uses the
+ * accurate algorithm when decompressing, because this has been shown to have
+ * a larger effect.
+ */
+ final public static int FLAG_ACCURATEDCT = 4096;
/**
diff --git a/tjbench.c b/tjbench.c
index 5f5b9e9..a56eb3b 100644
--- a/tjbench.c
+++ b/tjbench.c
@@ -667,7 +667,7 @@
{
int i;
printf("USAGE: %s\n", progname);
- printf(" <Inputfile (BMP|PPM)> <%% Quality> [options]\n\n");
+ printf(" <Inputfile (BMP|PPM)> <Quality> [options]\n\n");
printf(" %s\n", progname);
printf(" <Inputfile (JPG)> [options]\n\n");
printf("Options:\n\n");
@@ -682,6 +682,10 @@
printf(" Test the specified color conversion path in the codec (default: BGR)\n");
printf("-fastupsample = Use fast, inaccurate upsampling code to perform 4:2:2 and 4:2:0\n");
printf(" YUV decoding\n");
+ printf("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying\n");
+ printf(" codec\n");
+ printf("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the\n");
+ printf(" underlying codec\n");
printf("-quiet = Output results in tabular rather than verbose format\n");
printf("-yuvencode = Encode RGB input as planar YUV rather than compressing as JPEG\n");
printf("-yuvdecode = Decode JPEG image to planar YUV rather than RGB\n");
@@ -795,6 +799,16 @@
printf("Using fast upsampling code\n\n");
flags|=TJFLAG_FASTUPSAMPLE;
}
+ if(!strcasecmp(argv[i], "-fastdct"))
+ {
+ printf("Using fastest DCT/IDCT algorithm\n\n");
+ flags|=TJFLAG_FASTDCT;
+ }
+ if(!strcasecmp(argv[i], "-accuratedct"))
+ {
+ printf("Using most accurate DCT/IDCT algorithm\n\n");
+ flags|=TJFLAG_ACCURATEDCT;
+ }
if(!strcasecmp(argv[i], "-rgb")) pf=TJPF_RGB;
if(!strcasecmp(argv[i], "-rgbx")) pf=TJPF_RGBX;
if(!strcasecmp(argv[i], "-bgr")) pf=TJPF_BGR;
diff --git a/tjbenchtest.in b/tjbenchtest.in
index 0e8f963..bea12f1 100755
--- a/tjbenchtest.in
+++ b/tjbenchtest.in
@@ -39,63 +39,80 @@
cp $IMGDIR/$image $OUTDIR
basename=`basename $image .${EXT}`
- $EXEDIR/cjpeg -quality 95 -dct fast -grayscale $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_GRAY_cjpeg.jpg
- $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_420_cjpeg.jpg
- $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_422_cjpeg.jpg
- $EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_444_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct fast -grayscale $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_GRAY_fast_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_420_fast_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_422_fast_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_444_fast_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct int -grayscale $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_GRAY_accurate_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct int -sample 2x2 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_420_accurate_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct int -sample 2x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_422_accurate_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct int -sample 1x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_444_accurate_cjpeg.jpg
for samp in GRAY 420 422 444; do
- $EXEDIR/djpeg -rgb $BMPARG $OUTDIR/${basename}_${samp}_cjpeg.jpg >$OUTDIR/${basename}_${samp}_djpeg.${EXT}
+ $EXEDIR/djpeg -rgb $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_djpeg.${EXT}
+ $EXEDIR/djpeg -dct fast -rgb $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_djpeg.${EXT}
+ $EXEDIR/djpeg -dct int -rgb $BMPARG $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_djpeg.${EXT}
done
for samp in 420 422; do
- $EXEDIR/djpeg -nosmooth $BMPARG $OUTDIR/${basename}_${samp}_cjpeg.jpg >$OUTDIR/${basename}_${samp}_djpeg_nosmooth.${EXT}
+ $EXEDIR/djpeg -nosmooth $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_nosmooth_djpeg.${EXT}
+ $EXEDIR/djpeg -dct fast -nosmooth $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_nosmooth_djpeg.${EXT}
+ $EXEDIR/djpeg -dct int -nosmooth $BMPARG $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_nosmooth_djpeg.${EXT}
done
# Compression
- runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -quiet -benchtime 0.01
- for s in GRAY 420 422 444; do
- runme cmp $OUTDIR/${basename}_${s}_Q95.jpg $OUTDIR/${basename}_${s}_cjpeg.jpg
- done
-
- # Tiled compression & decompression
- runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01
- for samp in GRAY 444; do
- for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
- $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
- runme cmp $i $OUTDIR/${basename}_${samp}_djpeg.${EXT}
- rm $i
- done
- done
- runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -fastupsample
- for samp in 420 422; do
- for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
- $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
- runme cmp $i $OUTDIR/${basename}_${samp}_djpeg_nosmooth.${EXT}
- rm $i
+ for dct in accurate fast; do
+ runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -quiet -benchtime 0.01 -${dct}dct
+ for samp in GRAY 420 422 444; do
+ runme cmp $OUTDIR/${basename}_${samp}_Q95.jpg $OUTDIR/${basename}_${samp}_${dct}_cjpeg.jpg
done
done
- # Tiled decompression
- for samp in GRAY 444; do
- runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01
- for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
- $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
- runme cmp $i $OUTDIR/${basename}_${samp}_djpeg.${EXT}
- rm $i
+ for dct in fast accurate default; do
+ dctarg=-${dct}dct
+ if [ "${dct}" = "default" ]; then
+ dctarg=
+ fi
+
+ # Tiled compression & decompression
+ runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 ${dctarg}
+ for samp in GRAY 444; do
+ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
+ $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
+ runme cmp $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT}
+ rm $i
+ done
done
- done
- for samp in 420 422; do
- runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 -fastupsample
- for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
- $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
- runme cmp $i $OUTDIR/${basename}_${samp}_djpeg_nosmooth.${EXT}
- rm $i
+ runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -fastupsample ${dctarg}
+ for samp in 420 422; do
+ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
+ $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
+ runme cmp $i $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT}
+ rm $i
+ done
+ done
+
+ # Tiled decompression
+ for samp in GRAY 444; do
+ runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 ${dctarg}
+ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
+ $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
+ runme cmp $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT}
+ rm $i
+ done
+ done
+ for samp in 420 422; do
+ runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 -fastupsample ${dctarg}
+ for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
+ $OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
+ runme cmp $i $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT}
+ rm $i
+ done
done
done
# Scaled decompression
for scale in 2 4 8; do
for samp in GRAY 420 422 444; do
- $EXEDIR/djpeg -rgb -scale 1/${scale} $BMPARG $OUTDIR/${basename}_${samp}_cjpeg.jpg >$OUTDIR/${basename}_${samp}_1_${scale}_djpeg.${EXT}
+ $EXEDIR/djpeg -rgb -scale 1/${scale} $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_1_${scale}_djpeg.${EXT}
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -scale 1/${scale} -quiet -benchtime 0.01
runme cmp $OUTDIR/${basename}_${samp}_Q95_1_${scale}.${EXT} $OUTDIR/${basename}_${samp}_1_${scale}_djpeg.${EXT}
rm $OUTDIR/${basename}_${samp}_Q95_1_${scale}.${EXT}
diff --git a/tjexampletest.in b/tjexampletest.in
index 35105b9..430088e 100755
--- a/tjexampletest.in
+++ b/tjexampletest.in
@@ -36,32 +36,58 @@
cp $IMGDIR/$image $OUTDIR
basename=`basename $image .bmp`
- $EXEDIR/cjpeg -quality 95 -dct fast -grayscale $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_GRAY_cjpeg.jpg
- $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_420_cjpeg.jpg
- $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_422_cjpeg.jpg
- $EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_444_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct fast -grayscale $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_GRAY_fast_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_420_fast_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_422_fast_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_444_fast_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct int -grayscale $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_GRAY_accurate_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct int -sample 2x2 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_420_accurate_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct int -sample 2x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_422_accurate_cjpeg.jpg
+ $EXEDIR/cjpeg -quality 95 -dct int -sample 1x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_444_accurate_cjpeg.jpg
for samp in GRAY 420 422 444; do
- $EXEDIR/djpeg -rgb -bmp $OUTDIR/${basename}_${samp}_cjpeg.jpg >$OUTDIR/${basename}_${samp}_djpeg.bmp
+ $EXEDIR/djpeg -rgb -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_djpeg.bmp
+ $EXEDIR/djpeg -dct fast -rgb -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_djpeg.bmp
+ $EXEDIR/djpeg -dct int -rgb -bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_djpeg.bmp
+ done
+ for samp in 420 422; do
+ $EXEDIR/djpeg -nosmooth -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_nosmooth_djpeg.bmp
+ $EXEDIR/djpeg -dct fast -nosmooth -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_nosmooth_djpeg.bmp
+ $EXEDIR/djpeg -dct int -nosmooth -bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_nosmooth_djpeg.bmp
done
# Compression
- for samp in GRAY 420 422 444; do
- runme $JAVA TJExample $OUTDIR/$image $OUTDIR/${basename}_${samp}.jpg -q 95 -samp ${samp}
- runme cmp $OUTDIR/${basename}_${samp}.jpg $OUTDIR/${basename}_${samp}_cjpeg.jpg
+ for dct in fast accurate; do
+ for samp in GRAY 420 422 444; do
+ runme $JAVA TJExample $OUTDIR/$image $OUTDIR/${basename}_${samp}_${dct}.jpg -q 95 -samp ${samp} -${dct}dct
+ runme cmp $OUTDIR/${basename}_${samp}_${dct}.jpg $OUTDIR/${basename}_${samp}_${dct}_cjpeg.jpg
+ done
done
# Decompression
- for samp in 420 GRAY 420 422 444; do
- runme $JAVA TJExample $OUTDIR/${basename}_${samp}.jpg $OUTDIR/${basename}_${samp}.bmp
- runme cmp -i 54:54 $OUTDIR/${basename}_${samp}.bmp $OUTDIR/${basename}_${samp}_djpeg.bmp
- rm $OUTDIR/${basename}_${samp}.bmp
+ for dct in fast accurate default; do
+ srcdct=${dct}
+ dctarg=-${dct}dct
+ if [ "${dct}" = "default" ]; then
+ srcdct=fast
+ dctarg=
+ fi
+ for samp in GRAY 420 422 444; do
+ runme $JAVA TJExample $OUTDIR/${basename}_${samp}_${srcdct}.jpg $OUTDIR/${basename}_${samp}_${dct}.bmp ${dctarg}
+ runme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${dct}.bmp $OUTDIR/${basename}_${samp}_${dct}_djpeg.bmp
+ rm $OUTDIR/${basename}_${samp}_${dct}.bmp
+ done
+ for samp in 420 422; do
+ runme $JAVA TJExample $OUTDIR/${basename}_${samp}_${srcdct}.jpg $OUTDIR/${basename}_${samp}_${dct}_nosmooth.bmp -fastupsample ${dctarg}
+ runme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${dct}_nosmooth.bmp $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.bmp
+ rm $OUTDIR/${basename}_${samp}_${dct}_nosmooth.bmp
+ done
done
# Scaled decompression
for scale in 2 4 8; do
for samp in GRAY 420 422 444; do
- $EXEDIR/djpeg -rgb -bmp -scale 1/${scale} $OUTDIR/${basename}_${samp}_cjpeg.jpg >$OUTDIR/${basename}_${samp}_1_${scale}_djpeg.bmp
- runme $JAVA TJExample $OUTDIR/${basename}_${samp}.jpg $OUTDIR/${basename}_${samp}_1_${scale}.bmp -scale 1/${scale}
+ $EXEDIR/djpeg -rgb -bmp -scale 1/${scale} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_1_${scale}_djpeg.bmp
+ runme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_1_${scale}.bmp -scale 1/${scale}
runme cmp -i 54:54 $OUTDIR/${basename}_${samp}_1_${scale}.bmp $OUTDIR/${basename}_${samp}_1_${scale}_djpeg.bmp
rm $OUTDIR/${basename}_${samp}_1_${scale}.bmp
done
@@ -69,20 +95,26 @@
# Transforms
for samp in GRAY 420 422 444; do
- $EXEDIR/jpegtran -crop 70x60+16+16 -flip horizontal -trim $OUTDIR/${basename}_${samp}.jpg >$OUTDIR/${basename}_${samp}_hflip_jpegtran.jpg
- $EXEDIR/jpegtran -crop 70x60+16+16 -flip vertical -trim $OUTDIR/${basename}_${samp}.jpg >$OUTDIR/${basename}_${samp}_vflip_jpegtran.jpg
- $EXEDIR/jpegtran -crop 70x60+16+16 -transpose -trim $OUTDIR/${basename}_${samp}.jpg >$OUTDIR/${basename}_${samp}_transpose_jpegtran.jpg
- $EXEDIR/jpegtran -crop 70x60+16+16 -transverse -trim $OUTDIR/${basename}_${samp}.jpg >$OUTDIR/${basename}_${samp}_transverse_jpegtran.jpg
- $EXEDIR/jpegtran -crop 70x60+16+16 -rotate 90 -trim $OUTDIR/${basename}_${samp}.jpg >$OUTDIR/${basename}_${samp}_rot90_jpegtran.jpg
- $EXEDIR/jpegtran -crop 70x60+16+16 -rotate 180 -trim $OUTDIR/${basename}_${samp}.jpg >$OUTDIR/${basename}_${samp}_rot180_jpegtran.jpg
- $EXEDIR/jpegtran -crop 70x60+16+16 -rotate 270 -trim $OUTDIR/${basename}_${samp}.jpg >$OUTDIR/${basename}_${samp}_rot270_jpegtran.jpg
+ $EXEDIR/jpegtran -crop 70x60+16+16 -flip horizontal -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_hflip_jpegtran.jpg
+ $EXEDIR/jpegtran -crop 70x60+16+16 -flip vertical -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_vflip_jpegtran.jpg
+ $EXEDIR/jpegtran -crop 70x60+16+16 -transpose -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_transpose_jpegtran.jpg
+ $EXEDIR/jpegtran -crop 70x60+16+16 -transverse -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_transverse_jpegtran.jpg
+ $EXEDIR/jpegtran -crop 70x60+16+16 -rotate 90 -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_rot90_jpegtran.jpg
+ $EXEDIR/jpegtran -crop 70x60+16+16 -rotate 180 -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_rot180_jpegtran.jpg
+ $EXEDIR/jpegtran -crop 70x60+16+16 -rotate 270 -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_rot270_jpegtran.jpg
done
for xform in hflip vflip transpose transverse rot90 rot180 rot270; do
for samp in GRAY 420 422 444; do
- runme $JAVA TJExample $OUTDIR/${basename}_${samp}.jpg $OUTDIR/${basename}_${samp}_${xform}.jpg -$xform -crop 16,16,70x60
+ runme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.jpg -$xform -crop 16,16,70x60
runme cmp $OUTDIR/${basename}_${samp}_${xform}.jpg $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg
$EXEDIR/djpeg -rgb -bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp
- runme $JAVA TJExample $OUTDIR/${basename}_${samp}.jpg $OUTDIR/${basename}_${samp}_${xform}.bmp -$xform -crop 16,16,70x60
+ runme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.bmp -$xform -crop 16,16,70x60
+ runme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${xform}.bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp
+ rm $OUTDIR/${basename}_${samp}_${xform}.bmp
+ done
+ for samp in 420 422; do
+ $EXEDIR/djpeg -nosmooth -rgb -bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp
+ runme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.bmp -$xform -crop 16,16,70x60 -fastupsample
runme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${xform}.bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp
rm $OUTDIR/${basename}_${samp}_${xform}.bmp
done
@@ -91,9 +123,9 @@
# Grayscale transform
for xform in hflip vflip transpose transverse rot90 rot180 rot270; do
for samp in GRAY 444 422 420; do
- runme $JAVA TJExample $OUTDIR/${basename}_${samp}.jpg $OUTDIR/${basename}_${samp}_${xform}.jpg -$xform -grayscale -crop 16,16,70x60
+ runme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.jpg -$xform -grayscale -crop 16,16,70x60
runme cmp $OUTDIR/${basename}_${samp}_${xform}.jpg $OUTDIR/${basename}_GRAY_${xform}_jpegtran.jpg
- runme $JAVA TJExample $OUTDIR/${basename}_${samp}.jpg $OUTDIR/${basename}_${samp}_${xform}.bmp -$xform -grayscale -crop 16,16,70x60
+ runme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.bmp -$xform -grayscale -crop 16,16,70x60
runme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${xform}.bmp $OUTDIR/${basename}_GRAY_${xform}_jpegtran.bmp
rm $OUTDIR/${basename}_${samp}_${xform}.bmp
done
@@ -104,7 +136,7 @@
for samp in GRAY 444 422 420; do
for scale in 2 4 8; do
$EXEDIR/djpeg -rgb -bmp -scale 1/${scale} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_1_${scale}_jpegtran.bmp
- runme $JAVA TJExample $OUTDIR/${basename}_${samp}.jpg $OUTDIR/${basename}_${samp}_${xform}_1_${scale}.bmp -$xform -scale 1/${scale} -crop 16,16,70x60
+ runme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}_1_${scale}.bmp -$xform -scale 1/${scale} -crop 16,16,70x60
runme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${xform}_1_${scale}.bmp $OUTDIR/${basename}_${samp}_${xform}_1_${scale}_jpegtran.bmp
rm $OUTDIR/${basename}_${samp}_${xform}_1_${scale}.bmp
done
diff --git a/turbojpeg.c b/turbojpeg.c
index e08c767..f2485eb 100644
--- a/turbojpeg.c
+++ b/turbojpeg.c
@@ -133,7 +133,7 @@
}
static int setCompDefaults(struct jpeg_compress_struct *cinfo,
- int pixelFormat, int subsamp, int jpegQual)
+ int pixelFormat, int subsamp, int jpegQual, int flags)
{
int retval=0;
@@ -174,7 +174,7 @@
if(jpegQual>=0)
{
jpeg_set_quality(cinfo, jpegQual, TRUE);
- if(jpegQual>=96) cinfo->dct_method=JDCT_ISLOW;
+ if(jpegQual>=96 || flags&TJFLAG_ACCURATEDCT) cinfo->dct_method=JDCT_ISLOW;
else cinfo->dct_method=JDCT_FASTEST;
}
if(subsamp==TJSAMP_GRAY)
@@ -196,7 +196,7 @@
}
static int setDecompDefaults(struct jpeg_decompress_struct *dinfo,
- int pixelFormat)
+ int pixelFormat, int flags)
{
int retval=0;
@@ -238,6 +238,8 @@
_throw("Unsupported pixel format");
}
+ if(flags&TJFLAG_FASTDCT) dinfo->dct_method=JDCT_FASTEST;
+
bailout:
return retval;
}
@@ -442,7 +444,7 @@
alloc=0; *jpegSize=tjBufSize(width, height, jpegSubsamp);
}
jpeg_mem_dest_tj(cinfo, jpegBuf, jpegSize, alloc);
- if(setCompDefaults(cinfo, pixelFormat, jpegSubsamp, jpegQual)==-1)
+ if(setCompDefaults(cinfo, pixelFormat, jpegSubsamp, jpegQual, flags)==-1)
return -1;
jpeg_start_compress(cinfo, TRUE);
@@ -534,7 +536,7 @@
yuvsize=tjBufSizeYUV(width, height, subsamp);
jpeg_mem_dest_tj(cinfo, &dstBuf, &yuvsize, 0);
- if(setCompDefaults(cinfo, pixelFormat, subsamp, -1)==-1) return -1;
+ if(setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags)==-1) return -1;
jpeg_start_compress(cinfo, TRUE);
pw=PAD(width, cinfo->max_h_samp_factor);
@@ -756,7 +758,7 @@
jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
jpeg_read_header(dinfo, TRUE);
- if(setDecompDefaults(dinfo, pixelFormat)==-1)
+ if(setDecompDefaults(dinfo, pixelFormat, flags)==-1)
{
retval=-1; goto bailout;
}
diff --git a/turbojpeg.h b/turbojpeg.h
index 343788a..7610221 100644
--- a/turbojpeg.h
+++ b/turbojpeg.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C)2009-2011 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2009-2012 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -226,28 +226,30 @@
*/
#define TJFLAG_BOTTOMUP 2
/**
- * Turn off CPU auto-detection and force TurboJPEG to use MMX code (IPP and
- * 32-bit libjpeg-turbo versions only.)
+ * Turn off CPU auto-detection and force TurboJPEG to use MMX code (if the
+ * underlying codec supports it.)
*/
#define TJFLAG_FORCEMMX 8
/**
- * Turn off CPU auto-detection and force TurboJPEG to use SSE code (32-bit IPP
- * and 32-bit libjpeg-turbo versions only)
+ * Turn off CPU auto-detection and force TurboJPEG to use SSE code (if the
+ * underlying codec supports it.)
*/
#define TJFLAG_FORCESSE 16
/**
- * Turn off CPU auto-detection and force TurboJPEG to use SSE2 code (32-bit IPP
- * and 32-bit libjpeg-turbo versions only)
+ * Turn off CPU auto-detection and force TurboJPEG to use SSE2 code (if the
+ * underlying codec supports it.)
*/
#define TJFLAG_FORCESSE2 32
/**
- * Turn off CPU auto-detection and force TurboJPEG to use SSE3 code (64-bit IPP
- * version only)
+ * Turn off CPU auto-detection and force TurboJPEG to use SSE3 code (if the
+ * underlying codec supports it.)
*/
#define TJFLAG_FORCESSE3 128
/**
- * Use fast, inaccurate chrominance upsampling routines in the JPEG
- * decompressor (libjpeg and libjpeg-turbo versions only)
+ * When decompressing, use the fastest chrominance upsampling algorithm
+ * available in the underlying codec. The default is to use smooth upsampling,
+ * which creates a smooth transition between neighboring chrominance components
+ * in order to reduce upsampling artifacts in the decompressed image.
*/
#define TJFLAG_FASTUPSAMPLE 256
/**
@@ -258,6 +260,24 @@
* versions of TurboJPEG.
*/
#define TJFLAG_NOREALLOC 1024
+/**
+ * Use the fastest DCT/IDCT algorithm available in the underlying codec. The
+ * default if this flag is not specified is implementation-specific. The
+ * libjpeg implementation, for example, uses the fast algorithm by default when
+ * compressing, because this has been shown to have only a very slight effect
+ * on accuracy, but it uses the accurate algorithm when decompressing, because
+ * this has been shown to have a larger effect.
+ */
+#define TJFLAG_FASTDCT 2048
+/**
+ * Use the most accurate DCT/IDCT algorithm available in the underlying codec.
+ * The default if this flag is not specified is implementation-specific. The
+ * libjpeg implementation, for example, uses the fast algorithm by default when
+ * compressing, because this has been shown to have only a very slight effect
+ * on accuracy, but it uses the accurate algorithm when decompressing, because
+ * this has been shown to have a larger effect.
+ */
+#define TJFLAG_ACCURATEDCT 4096
/**