Merge branch 'main' into dev
This commit is contained in:
@@ -971,8 +971,9 @@ final class TJBench {
|
||||
|
||||
if ((sf.getNum() != 1 || sf.getDenom() != 1) && doTile) {
|
||||
System.out.println("Disabling tiled compression/decompression tests, because those tests do not");
|
||||
System.out.println("work when scaled decompression is enabled.");
|
||||
System.out.println("work when scaled decompression is enabled.\n");
|
||||
doTile = false;
|
||||
xformOpt &= (~TJTransform.OPT_CROP);
|
||||
}
|
||||
|
||||
if (!decompOnly) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011-2012, 2014-2015, 2017-2018, 2022 D. R. Commander.
|
||||
* Copyright (C)2011-2012, 2014-2015, 2017-2018, 2022-2023 D. R. Commander.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -136,14 +136,11 @@ class TJExample implements TJCustomFilter {
|
||||
System.out.println("-display = Display output image (Output filename need not be specified in this");
|
||||
System.out.println(" case.)\n");
|
||||
|
||||
System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available in");
|
||||
System.out.println(" the underlying codec.\n");
|
||||
System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available\n");
|
||||
|
||||
System.out.println("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying");
|
||||
System.out.println(" codec.\n");
|
||||
System.out.println("-fastdct = Use the fastest DCT/IDCT algorithm available\n");
|
||||
|
||||
System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the");
|
||||
System.out.println(" underlying codec.\n");
|
||||
System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithm available\n");
|
||||
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
@@ -380,13 +380,15 @@ implements java.io.Closeable</pre>
|
||||
the JPEG or YUV image should be compressed/encoded</dd><dd><code>y</code> - y offset (in pixels) of the region in the source image from which
|
||||
the JPEG or YUV image should be compressed/encoded</dd><dd><code>width</code> - width (in pixels) of the region in the source image from
|
||||
which the JPEG or YUV image should be compressed/encoded</dd><dd><code>pitch</code> - bytes per row in the source image. Normally this should be
|
||||
<code>width * TJ.pixelSize(pixelFormat)</code>, if the source image is
|
||||
unpadded. However, you can use this parameter to, for instance, specify
|
||||
that the rows in the source image are padded to the nearest multiple of 4
|
||||
bytes or to compress/encode a JPEG or YUV image from a region of a larger
|
||||
source image. You can also be clever and use this parameter to skip rows,
|
||||
etc. Setting this parameter to 0 is the equivalent of setting it to
|
||||
<code>width * TJ.pixelSize(pixelFormat)</code>.</dd><dd><code>height</code> - height (in pixels) of the region in the source image from
|
||||
<code>width *
|
||||
</code><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a><code>(pixelFormat)</code>,
|
||||
if the source image is unpadded. However, you can use this parameter to,
|
||||
for instance, specify that the rows in the source image are padded to the
|
||||
nearest multiple of 4 bytes or to compress/encode a JPEG or YUV image from
|
||||
a region of a larger source image. You can also be clever and use this
|
||||
parameter to skip rows, etc. Setting this parameter to 0 is the
|
||||
equivalent of setting it to <code>width *
|
||||
</code><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a><code>(pixelFormat)</code>.</dd><dd><code>height</code> - height (in pixels) of the region in the source image from
|
||||
which the JPEG or YUV image should be compressed/encoded</dd><dd><code>pixelFormat</code> - pixel format of the source image (one of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
|
||||
@@ -819,17 +819,19 @@ implements java.io.Closeable</pre>
|
||||
it to the width of the JPEG image. (In other words, the width will not be
|
||||
considered when determining the scaled image size.) This parameter is
|
||||
ignored if the source image is a YUV image.</dd><dd><code>pitch</code> - bytes per row in the destination image. Normally this should
|
||||
be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code>, if the
|
||||
destination image will be unpadded. However, you can use this to, for
|
||||
instance, pad each row of the destination image to the nearest multiple of
|
||||
4 bytes or to decompress/decode the source image into a region of a larger
|
||||
image. NOTE: if the source image is a JPEG image, then
|
||||
be set to <code>scaledWidth *
|
||||
</code><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a><code>(pixelFormat)</code>,
|
||||
if the destination image will be unpadded. However, you can use this to,
|
||||
for instance, pad each row of the destination image to the nearest
|
||||
multiple of 4 bytes or to decompress/decode the source image into a region
|
||||
of a larger image. NOTE: if the source image is a JPEG image, then
|
||||
<code>scaledWidth</code> can be determined by calling
|
||||
<code>scalingFactor.</code><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><code>getScaled</code></a><code>(jpegWidth)</code>
|
||||
or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)"><code>getScaledWidth(int, int)</code></a>. If the source image is a YUV
|
||||
image, then <code>scaledWidth</code> is the width of the YUV image.
|
||||
Setting this parameter to 0 is the equivalent of setting it to
|
||||
<code>scaledWidth * TJ.pixelSize(pixelFormat)</code>.</dd><dd><code>desiredHeight</code> - If the source image is a JPEG image, then this
|
||||
<code>scaledWidth *
|
||||
</code><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a><code>(pixelFormat)</code>.</dd><dd><code>desiredHeight</code> - If the source image is a JPEG image, then this
|
||||
specifies the desired height (in pixels) of the decompressed image (or
|
||||
image region.) If the desired destination image dimensions are different
|
||||
than the source image dimensions, then TurboJPEG will use scaling in the
|
||||
|
||||
@@ -116,13 +116,15 @@ public class TJCompressor implements Closeable {
|
||||
* which the JPEG or YUV image should be compressed/encoded
|
||||
*
|
||||
* @param pitch bytes per row in the source image. Normally this should be
|
||||
* <code>width * TJ.pixelSize(pixelFormat)</code>, if the source image is
|
||||
* unpadded. However, you can use this parameter to, for instance, specify
|
||||
* that the rows in the source image are padded to the nearest multiple of 4
|
||||
* bytes or to compress/encode a JPEG or YUV image from a region of a larger
|
||||
* source image. You can also be clever and use this parameter to skip rows,
|
||||
* etc. Setting this parameter to 0 is the equivalent of setting it to
|
||||
* <code>width * TJ.pixelSize(pixelFormat)</code>.
|
||||
* <code>width *
|
||||
* </code>{@link TJ#getPixelSize TJ.getPixelSize}<code>(pixelFormat)</code>,
|
||||
* if the source image is unpadded. However, you can use this parameter to,
|
||||
* for instance, specify that the rows in the source image are padded to the
|
||||
* nearest multiple of 4 bytes or to compress/encode a JPEG or YUV image from
|
||||
* a region of a larger source image. You can also be clever and use this
|
||||
* parameter to skip rows, etc. Setting this parameter to 0 is the
|
||||
* equivalent of setting it to <code>width *
|
||||
* </code>{@link TJ#getPixelSize TJ.getPixelSize}<code>(pixelFormat)</code>.
|
||||
*
|
||||
* @param height height (in pixels) of the region in the source image from
|
||||
* which the JPEG or YUV image should be compressed/encoded
|
||||
|
||||
@@ -366,17 +366,19 @@ public class TJDecompressor implements Closeable {
|
||||
* ignored if the source image is a YUV image.
|
||||
*
|
||||
* @param pitch bytes per row in the destination image. Normally this should
|
||||
* be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code>, if the
|
||||
* destination image will be unpadded. However, you can use this to, for
|
||||
* instance, pad each row of the destination image to the nearest multiple of
|
||||
* 4 bytes or to decompress/decode the source image into a region of a larger
|
||||
* image. NOTE: if the source image is a JPEG image, then
|
||||
* be set to <code>scaledWidth *
|
||||
* </code>{@link TJ#getPixelSize TJ.getPixelSize}<code>(pixelFormat)</code>,
|
||||
* if the destination image will be unpadded. However, you can use this to,
|
||||
* for instance, pad each row of the destination image to the nearest
|
||||
* multiple of 4 bytes or to decompress/decode the source image into a region
|
||||
* of a larger image. NOTE: if the source image is a JPEG image, then
|
||||
* <code>scaledWidth</code> can be determined by calling
|
||||
* <code>scalingFactor.</code>{@link TJScalingFactor#getScaled getScaled}<code>(jpegWidth)</code>
|
||||
* or by calling {@link #getScaledWidth}. If the source image is a YUV
|
||||
* image, then <code>scaledWidth</code> is the width of the YUV image.
|
||||
* Setting this parameter to 0 is the equivalent of setting it to
|
||||
* <code>scaledWidth * TJ.pixelSize(pixelFormat)</code>.
|
||||
* <code>scaledWidth *
|
||||
* </code>{@link TJ#getPixelSize TJ.getPixelSize}<code>(pixelFormat)</code>.
|
||||
*
|
||||
* @param desiredHeight If the source image is a JPEG image, then this
|
||||
* specifies the desired height (in pixels) of the decompressed image (or
|
||||
|
||||
@@ -995,14 +995,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
if ((sf.num != 1 || sf.denom != 1) && doTile) {
|
||||
printf("Disabling tiled compression/decompression tests, because those tests do not\n");
|
||||
printf("work when scaled decompression is enabled.\n");
|
||||
doTile = 0;
|
||||
printf("work when scaled decompression is enabled.\n\n");
|
||||
doTile = 0; xformOpt &= (~TJXOPT_CROP);
|
||||
}
|
||||
|
||||
if ((flags & TJFLAG_NOREALLOC) == 0 && doTile) {
|
||||
printf("Disabling tiled compression/decompression tests, because those tests do not\n");
|
||||
printf("work when dynamic JPEG buffer allocation is enabled.\n\n");
|
||||
doTile = 0;
|
||||
doTile = 0; xformOpt &= (~TJXOPT_CROP);
|
||||
}
|
||||
|
||||
if (!decompOnly) {
|
||||
|
||||
11
tjexample.c
11
tjexample.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2011-2012, 2014-2015, 2017, 2019, 2021-2022
|
||||
* Copyright (C)2011-2012, 2014-2015, 2017, 2019, 2021-2023
|
||||
* D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -149,14 +149,11 @@ static void usage(char *programName)
|
||||
printf("General Options\n");
|
||||
printf("---------------\n\n");
|
||||
|
||||
printf("-fastupsample = Use the fastest chrominance upsampling algorithm available in\n");
|
||||
printf(" the underlying codec.\n\n");
|
||||
printf("-fastupsample = Use the fastest chrominance upsampling algorithm available\n\n");
|
||||
|
||||
printf("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying\n");
|
||||
printf(" codec.\n\n");
|
||||
printf("-fastdct = Use the fastest DCT/IDCT algorithm available\n\n");
|
||||
|
||||
printf("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the\n");
|
||||
printf(" underlying codec.\n\n");
|
||||
printf("-accuratedct = Use the most accurate DCT/IDCT algorithm available\n\n");
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user