Add 4:1:1 subsampling support in the TurboJPEG Java API

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1017 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2013-08-18 11:04:21 +00:00
parent af914fe8f6
commit 7bd1cf2566
6 changed files with 76 additions and 17 deletions

View File

@@ -45,11 +45,11 @@ class TJBench {
};
static final String[] subNameLong = {
"4:4:4", "4:2:2", "4:2:0", "GRAY", "4:4:0"
"4:4:4", "4:2:2", "4:2:0", "GRAY", "4:4:0", "4:1:1"
};
static final String[] subName = {
"444", "422", "420", "GRAY", "440"
"444", "422", "420", "GRAY", "440", "411"
};
static TJScalingFactor sf;
@@ -601,6 +601,7 @@ class TJBench {
System.out.println("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the");
System.out.println(" underlying codec");
System.out.println("-440 = Test 4:4:0 chrominance subsampling instead of 4:2:2");
System.out.println("-411 = Test 4:1:1 chrominance subsampling instead of 4:2:0");
System.out.println("-quiet = Output results in tabular rather than verbose format");
System.out.println("-yuvencode = Encode RGB input as planar YUV rather than compressing as JPEG");
System.out.println("-yuvdecode = Decode JPEG image to planar YUV rather than RGB");
@@ -637,7 +638,7 @@ class TJBench {
byte[] srcBuf = null; int w = 0, h = 0;
int minQual = -1, maxQual = -1;
int minArg = 1; int retval = 0;
boolean do440 = false;
boolean do440 = false, do411 = false;
try {
@@ -717,6 +718,8 @@ class TJBench {
}
if (argv[i].equals("-440"))
do440 = true;
if (argv[i].equals("-411"))
do411 = true;
if (argv[i].equalsIgnoreCase("-rgb"))
pf = TJ.PF_RGB;
if (argv[i].equalsIgnoreCase("-rgbx"))
@@ -834,7 +837,7 @@ class TJBench {
System.out.println("");
System.gc();
for (int i = maxQual; i >= minQual; i--)
doTest(srcBuf, w, h, TJ.SAMP_420, i, argv[0]);
doTest(srcBuf, w, h, do411 ? TJ.SAMP_411 : TJ.SAMP_420, i, argv[0]);
System.out.println("");
System.gc();
for (int i = maxQual; i >= minQual; i--)