Merge branch 'main' into dev

This commit is contained in:
DRC
2023-01-20 14:09:25 -06:00
13 changed files with 144 additions and 137 deletions

View File

@@ -534,7 +534,7 @@ final class TJBench {
if (quiet == 1) {
System.out.println("All performance values in Mpixels/sec\n");
System.out.format("Bitmap JPEG JPEG %s %s Xform Comp Decomp ",
System.out.format("Pixel JPEG JPEG %s %s Xform Comp Decomp ",
(doTile ? "Tile " : "Image"),
(doTile ? "Tile " : "Image"));
if (doYUV)
@@ -705,42 +705,37 @@ final class TJBench {
String className = new TJBench().getClass().getName();
System.out.println("\nUSAGE: java " + className);
System.out.println(" <Inputfile (BMP)> <Quality> [options]\n");
System.out.println(" <Inputimage (BMP)> <Quality> [options]\n");
System.out.println(" java " + className);
System.out.println(" <Inputfile (JPG)> [options]\n");
System.out.println(" <Inputimage (JPG)> [options]\n");
System.out.println("Options:\n");
System.out.println("-alloc = Dynamically allocate JPEG image buffers");
System.out.println("-bottomup = Test bottom-up compression/decompression");
System.out.println("-tile = Test performance of the codec when the image is encoded as separate");
System.out.println(" tiles of varying sizes.");
System.out.println("-bottomup = Use bottom-up row order for packed-pixel source/destination buffers");
System.out.println("-tile = Compress/transform the input image into separate JPEG tiles of varying");
System.out.println(" sizes (useful for measuring JPEG overhead)");
System.out.println("-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb =");
System.out.println(" Test the specified color conversion path in the codec (default = BGR)");
System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available in");
System.out.println(" the underlying codec");
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.out.println(" Use the specified pixel format for packed-pixel source/destination buffers");
System.out.println(" [default = BGR]");
System.out.println("-fastupsample = Use the fastest chrominance upsampling algorithm available");
System.out.println("-fastdct = Use the fastest DCT/IDCT algorithm available");
System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithm available");
System.out.println("-progressive = Use progressive entropy coding in JPEG images generated by");
System.out.println(" compression and transform operations. (Can be combined with -arithmetic.)");
System.out.println(" compression and transform operations (can be combined with -arithmetic)");
System.out.println("-arithmetic = Use arithmetic entropy coding in JPEG images generated by");
System.out.println(" compression and transform operations. (Can be combined with");
System.out.println(" -progressive.)");
System.out.println("-lossless = Generate lossless JPEG images (implies -subsamp 444). When");
System.out.println(" generating lossless JPEG images, Quality is psv * 10 + Pt, where psv is");
System.out.println(" the predictor selection value (1-7) and Pt is the point transform (0-7).");
System.out.println(" A point transform value of 0 is necessary in order to create a fully");
System.out.println(" lossless JPEG image.");
System.out.println("-subsamp <s> = When testing JPEG compression, this option specifies the level");
System.out.println(" of chrominance subsampling to use (<s> = 444, 422, 440, 420, 411, or");
System.out.println(" GRAY). The default is to test Grayscale, 4:2:0, 4:2:2, and 4:4:4 in");
System.out.println(" sequence.");
System.out.println(" compression and transform operations (can be combined with -progressive)");
System.out.println("-lossless = Generate lossless JPEG images when compressing (implies");
System.out.println(" -subsamp 444). When generating lossless JPEG images, Quality is");
System.out.println(" psv * 10 + Pt, where psv is the predictor selection value (1-7) and Pt is");
System.out.println(" the point transform (0-7). A point transform value of 0 is necessary in");
System.out.println(" order to create a fully lossless JPEG image.");
System.out.println("-subsamp <s> = When compressing, use the specified level of chrominance");
System.out.println(" subsampling (<s> = 444, 422, 440, 420, 411, or GRAY) [default = test");
System.out.println(" Grayscale, 4:2:0, 4:2:2, and 4:4:4 in sequence]");
System.out.println("-quiet = Output results in tabular rather than verbose format");
System.out.println("-yuv = Test YUV encoding/decoding functions");
System.out.println("-yuvpad <p> = If testing YUV encoding/decoding, this specifies the number of");
System.out.println(" bytes by which each row of each plane in the intermediate YUV image is");
System.out.println(" evenly divisible (default = 1)");
System.out.println("-scale M/N = Scale down the width/height of the decompressed JPEG image by a");
System.out.println("-yuv = Compress from/decompress to intermediate planar YUV images");
System.out.println("-yuvpad <p> = The number of bytes by which each row in each plane of an");
System.out.println(" intermediate YUV image is evenly divisible (must be a power of 2)");
System.out.println(" [default = 1]");
System.out.println("-scale M/N = When decompressing, scale the width/height of the JPEG image by a");
System.out.print(" factor of M/N (M/N = ");
for (i = 0; i < nsf; i++) {
System.out.format("%d/%d", scalingFactors[i].getNum(),
@@ -758,24 +753,24 @@ final class TJBench {
}
System.out.println(")");
System.out.println("-hflip, -vflip, -transpose, -transverse, -rot90, -rot180, -rot270 =");
System.out.println(" Perform the corresponding lossless transform prior to");
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(" Perform the specified lossless transform operation on the input image");
System.out.println(" prior to decompression (these operations are mutually exclusive)");
System.out.println("-grayscale = Transform the input image into a grayscale JPEG image prior to");
System.out.println(" decompression (can be combined with the other transform operations 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(" when transforming the input 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");
System.out.println(" consistency of the results.");
System.out.println(" consistency of the benchmark results");
System.out.println("-componly = Stop after running compression tests. Do not test decompression.");
System.out.println("-nowrite = Do not write reference or output images (improves consistency");
System.out.println(" of performance measurements.)");
System.out.println("-nowrite = Do not write reference or output images (improves consistency of");
System.out.println(" benchmark results)");
System.out.println("-limitscans = Refuse to decompress or transform progressive JPEG images that");
System.out.println(" have an unreasonably large number of scans");
System.out.println("-stoponwarning = Immediately discontinue the current");
System.out.println(" compression/decompression/transform operation if the underlying codec");
System.out.println(" throws a warning (non-fatal error)\n");
System.out.println(" compression/decompression/transform operation if a warning (non-fatal");
System.out.println(" error) occurs\n");
System.out.println("NOTE: If the quality is specified as a range (e.g. 90-100), a separate");
System.out.println("test will be performed for all quality values in the range.\n");
System.exit(1);
@@ -803,18 +798,18 @@ final class TJBench {
minArg = 2;
if (argv.length < minArg)
usage();
String[] quals = argv[1].split("-", 2);
try {
minQual = Integer.parseInt(argv[1]);
minQual = Integer.parseInt(quals[0]);
} catch (NumberFormatException e) {}
if (minQual < 1 || minQual > 100)
throw new Exception("Quality must be between 1 and 100.");
int dashIndex = argv[1].indexOf('-');
if (dashIndex > 0 && argv[1].length() > dashIndex + 1) {
if (quals.length > 1) {
try {
maxQual = Integer.parseInt(argv[1].substring(dashIndex + 1));
maxQual = Integer.parseInt(quals[1]);
} catch (NumberFormatException e) {}
}
if (maxQual < 1 || maxQual > 100)
if (maxQual < 1 || maxQual > 100 || maxQual < minQual)
maxQual = minQual;
}
@@ -823,7 +818,7 @@ final class TJBench {
if (argv[i].equalsIgnoreCase("-tile")) {
doTile = true; xformOpt |= TJTransform.OPT_CROP;
} else if (argv[i].equalsIgnoreCase("-fastupsample")) {
System.out.println("Using fast upsampling code\n");
System.out.println("Using fastest upsampling algorithm\n");
flags |= TJ.FLAG_FASTUPSAMPLE;
} else if (argv[i].equalsIgnoreCase("-fastdct")) {
System.out.println("Using fastest DCT/IDCT algorithm\n");
@@ -834,9 +829,11 @@ final class TJBench {
} else if (argv[i].equalsIgnoreCase("-progressive")) {
System.out.println("Using progressive entropy coding\n");
flags |= TJ.FLAG_PROGRESSIVE;
xformOpt |= TJTransform.OPT_PROGRESSIVE;
} else if (argv[i].equalsIgnoreCase("-arithmetic")) {
System.out.println("Using arithmetic entropy coding\n");
flags |= TJ.FLAG_ARITHMETIC;
xformOpt |= TJTransform.OPT_ARITHMETIC;
} else if (argv[i].equalsIgnoreCase("-lossless")) {
System.out.println("Using lossless JPEG\n\n");
flags |= TJ.FLAG_LOSSLESS;
@@ -936,8 +933,10 @@ final class TJBench {
try {
temp = Integer.parseInt(argv[++i]);
} catch (NumberFormatException e) {}
if (temp >= 1)
if (temp >= 1 && (temp & (temp - 1)) == 0)
yuvAlign = temp;
else
usage();
} else if (argv[i].equalsIgnoreCase("-subsamp") &&
i < argv.length - 1) {
i++;
@@ -953,6 +952,8 @@ final class TJBench {
subsamp = TJ.SAMP_420;
else if (argv[i].equals("411"))
subsamp = TJ.SAMP_411;
else
usage();
} else if (argv[i].equalsIgnoreCase("-componly"))
compOnly = true;
else if (argv[i].equalsIgnoreCase("-nowrite"))
@@ -986,7 +987,7 @@ final class TJBench {
if (quiet == 1 && !decompOnly) {
System.out.println("All performance values in Mpixels/sec\n");
System.out.format("Bitmap JPEG JPEG %s %s ",
System.out.format("Pixel JPEG JPEG %s %s ",
(doTile ? "Tile " : "Image"),
(doTile ? "Tile " : "Image"));
if (doYUV)