5. Introduced a new flag in the TurboJPEG C and Java APIs (`TJFLAG_PROGRESSIVE`
and `TJ.FLAG_PROGRESSIVE`, respectively) that causes the library to use
progressive entropy coding in JPEG images generated by compression and
-transform operations.
+transform operations. Additionally, a new transform option
+(`TJXOPT_PROGRESSIVE` in the C API and `TJTransform.OPT_PROGRESSIVE` in the
+Java API) has been introduced, allowing progressive entropy coding to be
+enabled for selected transforms in a multi-transform operation.
+
+6. Introduced a new transform option in the TurboJPEG API (`TJXOPT_COPYNONE` in
+the C API and `TJTransform.OPT_COPYNONE` in the Java API) that allows the
+copying of markers (including EXIF and ICC profile data) to be disabled for a
+particular transform.
1.5.2
<tr class="memitem:gafbf992bbf6e006705886333703ffab31"><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#gafbf992bbf6e006705886333703ffab31">TJXOPT_NOOUTPUT</a></td></tr>
<tr class="memdesc:gafbf992bbf6e006705886333703ffab31"><td class="mdescLeft"> </td><td class="mdescRight">This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> from outputting a JPEG image for this particular transform (this can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.) <a href="#gafbf992bbf6e006705886333703ffab31">More...</a><br/></td></tr>
<tr class="separator:gafbf992bbf6e006705886333703ffab31"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:gad2371c80674584ecc1a7d75e564cf026"><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#gad2371c80674584ecc1a7d75e564cf026">TJXOPT_PROGRESSIVE</a></td></tr>
+<tr class="memdesc:gad2371c80674584ecc1a7d75e564cf026"><td class="mdescLeft"> </td><td class="mdescRight">This option will enable progressive entropy coding in the output image generated by this particular transform. <a href="#gad2371c80674584ecc1a7d75e564cf026">More...</a><br/></td></tr>
+<tr class="separator:gad2371c80674584ecc1a7d75e564cf026"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ga153b468cfb905d0de61706c838986fe8"><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#ga153b468cfb905d0de61706c838986fe8">TJXOPT_COPYNONE</a></td></tr>
+<tr class="memdesc:ga153b468cfb905d0de61706c838986fe8"><td class="mdescLeft"> </td><td class="mdescRight">This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> from copying any extra markers (including EXIF and ICC profile data) from the source image to the output image. <a href="#ga153b468cfb905d0de61706c838986fe8">More...</a><br/></td></tr>
+<tr class="separator:ga153b468cfb905d0de61706c838986fe8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga0aba955473315e405295d978f0c16511"><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#ga0aba955473315e405295d978f0c16511">TJPAD</a>(width)</td></tr>
<tr class="memdesc:ga0aba955473315e405295d978f0c16511"><td class="mdescLeft"> </td><td class="mdescRight">Pad the given width to the nearest 32-bit boundary. <a href="#ga0aba955473315e405295d978f0c16511">More...</a><br/></td></tr>
<tr class="separator:ga0aba955473315e405295d978f0c16511"><td class="memSeparator" colspan="2"> </td></tr>
<p>Compute the scaled value of <code>dimension</code> using the given scaling factor. </p>
<p>This macro performs the integer equivalent of <code>ceil(dimension * scalingFactor)</code>. </p>
+</div>
+</div>
+<a class="anchor" id="ga153b468cfb905d0de61706c838986fe8"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">#define TJXOPT_COPYNONE</td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> from copying any extra markers (including EXIF and ICC profile data) from the source image to the output image. </p>
+
</div>
</div>
<a class="anchor" id="ga9c771a757fc1294add611906b89ab2d2"></a>
<p>This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> to return an error if the transform is not perfect. </p>
<p>Lossless transforms operate on MCU blocks, whose size depends on the level of chrominance subsampling used (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a> and <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>.) If the image's width or height is not evenly divisible by the MCU block size, then there will be partial MCU blocks on the right and/or bottom edges. It is not possible to move these partial MCU blocks to the top or left of the image, so any transform that would require that is "imperfect." If this option is not specified, then any partial MCU blocks that cannot be transformed will be left in place, which will create odd-looking strips on the right or bottom edge of the image. </p>
+</div>
+</div>
+<a class="anchor" id="gad2371c80674584ecc1a7d75e564cf026"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">#define TJXOPT_PROGRESSIVE</td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>This option will enable progressive entropy coding in the output image generated by this particular transform. </p>
+<p>Progressive entropy coding will generally improve compression relative to baseline entropy coding (the default), but it will reduce compression and decompression performance considerably. </p>
+
</div>
</div>
<a class="anchor" id="ga319826b7eb1583c0595bbe7b95428709"></a>
['tjsamp_5fgray',['TJSAMP_GRAY',['../group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248',1,'turbojpeg.h']]],
['tjscaled',['TJSCALED',['../group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df',1,'turbojpeg.h']]],
['tjscalingfactor',['tjscalingfactor',['../structtjscalingfactor.html',1,'']]],
- ['tjtransform',['tjtransform',['../structtjtransform.html',1,'tjtransform'],['../group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a',1,'tjTransform(tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, int n, unsigned char **dstBufs, unsigned long *dstSizes, tjtransform *transforms, int flags): turbojpeg.h'],['../group___turbo_j_p_e_g.html#gaa29f3189c41be12ec5dee7caec318a31',1,'tjtransform(): turbojpeg.h']]],
+ ['tjtransform',['tjtransform',['../structtjtransform.html',1,'tjtransform'],['../group___turbo_j_p_e_g.html#gaa29f3189c41be12ec5dee7caec318a31',1,'tjtransform(): turbojpeg.h'],['../group___turbo_j_p_e_g.html#gad02cd42b69f193a0623a9c801788df3a',1,'tjTransform(tjhandle handle, const unsigned char *jpegBuf, unsigned long jpegSize, int n, unsigned char **dstBufs, unsigned long *dstSizes, tjtransform *transforms, int flags): turbojpeg.h']]],
['tjxop',['TJXOP',['../group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866',1,'turbojpeg.h']]],
['tjxop_5fhflip',['TJXOP_HFLIP',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce',1,'turbojpeg.h']]],
['tjxop_5fnone',['TJXOP_NONE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27',1,'turbojpeg.h']]],
['tjxop_5ftranspose',['TJXOP_TRANSPOSE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d',1,'turbojpeg.h']]],
['tjxop_5ftransverse',['TJXOP_TRANSVERSE',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4',1,'turbojpeg.h']]],
['tjxop_5fvflip',['TJXOP_VFLIP',['../group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d',1,'turbojpeg.h']]],
+ ['tjxopt_5fcopynone',['TJXOPT_COPYNONE',['../group___turbo_j_p_e_g.html#ga153b468cfb905d0de61706c838986fe8',1,'turbojpeg.h']]],
['tjxopt_5fcrop',['TJXOPT_CROP',['../group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2',1,'turbojpeg.h']]],
['tjxopt_5fgray',['TJXOPT_GRAY',['../group___turbo_j_p_e_g.html#ga3acee7b48ade1b99e5588736007c2589',1,'turbojpeg.h']]],
['tjxopt_5fnooutput',['TJXOPT_NOOUTPUT',['../group___turbo_j_p_e_g.html#gafbf992bbf6e006705886333703ffab31',1,'turbojpeg.h']]],
['tjxopt_5fperfect',['TJXOPT_PERFECT',['../group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00',1,'turbojpeg.h']]],
+ ['tjxopt_5fprogressive',['TJXOPT_PROGRESSIVE',['../group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026',1,'turbojpeg.h']]],
['tjxopt_5ftrim',['TJXOPT_TRIM',['../group___turbo_j_p_e_g.html#ga319826b7eb1583c0595bbe7b95428709',1,'turbojpeg.h']]],
['turbojpeg',['TurboJPEG',['../group___turbo_j_p_e_g.html',1,'']]]
];
System.out.println(" decompression (these options are mutually exclusive)");
System.out.println("-grayscale = Perform lossless grayscale conversion prior to decompression");
System.out.println(" test (can be combined with the other transforms above)");
+ System.out.println("-copynone = Do not copy any extra markers (including EXIF and ICC profile data)");
+ System.out.println(" when transforming the image.");
System.out.println("-benchtime <t> = Run each benchmark for at least <t> seconds (default = 5.0)");
System.out.println("-warmup <t> = Run each benchmark for <t> seconds (default = 1.0) prior to");
System.out.println(" starting the timer, in order to prime the caches and thus improve the");
xformOpt |= TJTransform.OPT_GRAY;
if (argv[i].equalsIgnoreCase("-nooutput"))
xformOpt |= TJTransform.OPT_NOOUTPUT;
+ if (argv[i].equalsIgnoreCase("-copynone"))
+ xformOpt |= TJTransform.OPT_COPYNONE;
if (argv[i].equalsIgnoreCase("-benchtime") && i < argv.length - 1) {
double temp = -1;
try {
<td class="colLast"><code>2</code></td>
</tr>
<tr class="rowColor">
+<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_COPYNONE">
+<!-- -->
+</a><code>public static final int</code></td>
+<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_COPYNONE">OPT_COPYNONE</a></code></td>
+<td class="colLast"><code>64</code></td>
+</tr>
+<tr class="altColor">
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_CROP">
<!-- -->
</a><code>public static final int</code></td>
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP">OPT_CROP</a></code></td>
<td class="colLast"><code>4</code></td>
</tr>
-<tr class="altColor">
+<tr class="rowColor">
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_GRAY">
<!-- -->
</a><code>public static final int</code></td>
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY">OPT_GRAY</a></code></td>
<td class="colLast"><code>8</code></td>
</tr>
-<tr class="rowColor">
+<tr class="altColor">
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_NOOUTPUT">
<!-- -->
</a><code>public static final int</code></td>
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT">OPT_NOOUTPUT</a></code></td>
<td class="colLast"><code>16</code></td>
</tr>
-<tr class="altColor">
+<tr class="rowColor">
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_PERFECT">
<!-- -->
</a><code>public static final int</code></td>
<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT">OPT_PERFECT</a></code></td>
<td class="colLast"><code>1</code></td>
</tr>
+<tr class="altColor">
+<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_PROGRESSIVE">
+<!-- -->
+</a><code>public static final int</code></td>
+<td><code><a href="org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PROGRESSIVE">OPT_PROGRESSIVE</a></code></td>
+<td class="colLast"><code>32</code></td>
+</tr>
<tr class="rowColor">
<td class="colFirst"><a name="org.libjpegturbo.turbojpeg.TJTransform.OPT_TRIM">
<!-- -->
<dd>
<div class="block">Flip (mirror) image vertically.</div>
</dd>
+<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_COPYNONE">OPT_COPYNONE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
+<dd>
+<div class="block">This option will prevent <a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> from copying any extra markers (including EXIF
+ and ICC profile data) from the source image to the output image.</div>
+</dd>
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP">OPT_CROP</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
<dd>
<div class="block">This option will enable lossless cropping.</div>
<div class="block">This option will cause <a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
perfect.</div>
</dd>
+<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PROGRESSIVE">OPT_PROGRESSIVE</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
+<dd>
+<div class="block">This option will enable progressive entropy coding in the output image
+ generated by this particular transform.</div>
+</dd>
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM">OPT_TRIM</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
<dd>
<div class="block">This option will discard any partial MCU blocks that cannot be
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
+<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_COPYNONE">OPT_COPYNONE</a></strong></code>
+<div class="block">This option will prevent <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> from copying any extra markers (including EXIF
+ and ICC profile data) from the source image to the output image.</div>
+</td>
+</tr>
+<tr class="altColor">
+<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_CROP">OPT_CROP</a></strong></code>
<div class="block">This option will enable lossless cropping.</div>
</td>
</tr>
-<tr class="altColor">
+<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_GRAY">OPT_GRAY</a></strong></code>
<div class="block">This option will discard the color data in the input image and produce
a grayscale output image.</div>
</td>
</tr>
-<tr class="rowColor">
+<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT">OPT_NOOUTPUT</a></strong></code>
<div class="block">This option will prevent <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this
particular transform.</div>
</td>
</tr>
-<tr class="altColor">
+<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT">OPT_PERFECT</a></strong></code>
<div class="block">This option will cause <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
perfect.</div>
</td>
</tr>
+<tr class="altColor">
+<td class="colFirst"><code>static int</code></td>
+<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PROGRESSIVE">OPT_PROGRESSIVE</a></strong></code>
+<div class="block">This option will enable progressive entropy coding in the output image
+ generated by this particular transform.</div>
+</td>
+</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM">OPT_TRIM</a></strong></code>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_NOOUTPUT">Constant Field Values</a></dd></dl>
</li>
</ul>
+<a name="OPT_PROGRESSIVE">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>OPT_PROGRESSIVE</h4>
+<pre>public static final int OPT_PROGRESSIVE</pre>
+<div class="block">This option will enable progressive entropy coding in the output image
+ generated by this particular transform. Progressive entropy coding will
+ generally improve compression relative to baseline entropy coding (the
+ default), but it will reduce compression and decompression performance
+ considerably.</div>
+<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_PROGRESSIVE">Constant Field Values</a></dd></dl>
+</li>
+</ul>
+<a name="OPT_COPYNONE">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>OPT_COPYNONE</h4>
+<pre>public static final int OPT_COPYNONE</pre>
+<div class="block">This option will prevent <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> from copying any extra markers (including EXIF
+ and ICC profile data) from the source image to the output image.</div>
+<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../constant-values.html#org.libjpegturbo.turbojpeg.TJTransform.OPT_COPYNONE">Constant Field Values</a></dd></dl>
+</li>
+</ul>
<a name="op">
<!-- -->
</a>
* partial MCU blocks that cannot be transformed will be left in place, which
* will create odd-looking strips on the right or bottom edge of the image.
*/
- public static final int OPT_PERFECT = 1;
+ public static final int OPT_PERFECT = 1;
/**
* This option will discard any partial MCU blocks that cannot be
* transformed.
*/
- public static final int OPT_TRIM = 2;
+ public static final int OPT_TRIM = 2;
/**
* This option will enable lossless cropping.
*/
- public static final int OPT_CROP = 4;
+ public static final int OPT_CROP = 4;
/**
* This option will discard the color data in the input image and produce
* a grayscale output image.
*/
- public static final int OPT_GRAY = 8;
+ public static final int OPT_GRAY = 8;
/**
* This option will prevent {@link TJTransformer#transform
* TJTransformer.transform()} from outputting a JPEG image for this
* filter to capture the transformed DCT coefficients without transcoding
* them.
*/
- public static final int OPT_NOOUTPUT = 16;
+ public static final int OPT_NOOUTPUT = 16;
+ /**
+ * This option will enable progressive entropy coding in the output image
+ * generated by this particular transform. Progressive entropy coding will
+ * generally improve compression relative to baseline entropy coding (the
+ * default), but it will reduce compression and decompression performance
+ * considerably.
+ */
+ public static final int OPT_PROGRESSIVE = 32;
+ /**
+ * This option will prevent {@link TJTransformer#transform
+ * TJTransformer.transform()} from copying any extra markers (including EXIF
+ * and ICC profile data) from the source image to the output image.
+ */
+ public static final int OPT_COPYNONE = 64;
/**
printf(" decompression (these options are mutually exclusive)\n");
printf("-grayscale = Perform lossless grayscale conversion prior to decompression\n");
printf(" test (can be combined with the other transforms above)\n");
+ printf("-copynone = Do not copy any extra markers (including EXIF and ICC profile data)\n");
+ printf(" when transforming the image.\n");
printf("-benchtime <t> = Run each benchmark for at least <t> seconds (default = 5.0)\n");
printf("-warmup <t> = Run each benchmark for <t> seconds (default = 1.0) prior to\n");
printf(" starting the timer, in order to prime the caches and thus improve the\n");
if(!strcasecmp(argv[i], "-grayscale")) xformopt|=TJXOPT_GRAY;
if(!strcasecmp(argv[i], "-custom")) customFilter=dummyDCTFilter;
if(!strcasecmp(argv[i], "-nooutput")) xformopt|=TJXOPT_NOOUTPUT;
+ if(!strcasecmp(argv[i], "-copynone")) xformopt|=TJXOPT_COPYNONE;
if(!strcasecmp(argv[i], "-benchtime") && i<argc-1)
{
double temp=atof(argv[++i]);
{
jpeg_transform_info *xinfo=NULL;
jvirt_barray_ptr *srccoefs, *dstcoefs;
- int retval=0, i, jpegSubsamp;
+ int retval=0, i, jpegSubsamp, saveMarkers=0;
getinstance(handle);
this->jerr.stopOnWarning=(flags & TJFLAG_STOPONWARNING) ? TRUE : FALSE;
}
else xinfo[i].crop_height=JCROP_UNSET;
}
+ if(!(t[i].options&TJXOPT_COPYNONE)) saveMarkers=1;
}
- jcopy_markers_setup(dinfo, JCOPYOPT_ALL);
+ jcopy_markers_setup(dinfo, saveMarkers ? JCOPYOPT_ALL:JCOPYOPT_NONE);
jpeg_read_header(dinfo, TRUE);
jpegSubsamp=getSubsamp(dinfo);
if(jpegSubsamp<0)
jpeg_copy_critical_parameters(dinfo, cinfo);
dstcoefs=jtransform_adjust_parameters(dinfo, cinfo, srccoefs,
&xinfo[i]);
- if(flags&TJFLAG_PROGRESSIVE)
+ if(flags&TJFLAG_PROGRESSIVE || t[i].options&TJXOPT_PROGRESSIVE)
jpeg_simple_progression(cinfo);
if(!(t[i].options&TJXOPT_NOOUTPUT))
{
jpeg_write_coefficients(cinfo, dstcoefs);
- jcopy_markers_execute(dinfo, cinfo, JCOPYOPT_ALL);
+ jcopy_markers_execute(dinfo, cinfo,
+ t[i].options&TJXOPT_COPYNONE ? JCOPYOPT_NONE:JCOPYOPT_ALL);
}
else jinit_c_master_control(cinfo, TRUE);
jtransform_execute_transformation(dinfo, cinfo, srccoefs,
* that cannot be transformed will be left in place, which will create
* odd-looking strips on the right or bottom edge of the image.
*/
-#define TJXOPT_PERFECT 1
+#define TJXOPT_PERFECT 1
/**
* This option will cause #tjTransform() to discard any partial MCU blocks that
* cannot be transformed.
*/
-#define TJXOPT_TRIM 2
+#define TJXOPT_TRIM 2
/**
* This option will enable lossless cropping. See #tjTransform() for more
* information.
*/
-#define TJXOPT_CROP 4
+#define TJXOPT_CROP 4
/**
* This option will discard the color data in the input image and produce
* a grayscale output image.
*/
-#define TJXOPT_GRAY 8
+#define TJXOPT_GRAY 8
/**
* This option will prevent #tjTransform() from outputting a JPEG image for
* this particular transform (this can be used in conjunction with a custom
* filter to capture the transformed DCT coefficients without transcoding
* them.)
*/
-#define TJXOPT_NOOUTPUT 16
+#define TJXOPT_NOOUTPUT 16
+/**
+ * This option will enable progressive entropy coding in the output image
+ * generated by this particular transform. Progressive entropy coding will
+ * generally improve compression relative to baseline entropy coding (the
+ * default), but it will reduce compression and decompression performance
+ * considerably.
+ */
+#define TJXOPT_PROGRESSIVE 32
+/**
+ * This option will prevent #tjTransform() from copying any extra markers
+ * (including EXIF and ICC profile data) from the source image to the output
+ * image.
+ */
+#define TJXOPT_COPYNONE 64
/**