Remove benchmarks. They were originally intended as a way of measuring overhead for small compress/decompress operations, but using TJBench with a small image is a better way to accomplish that.

This commit is contained in:
DRC
2014-03-14 04:32:03 +00:00
parent 68a89e0170
commit b0073a2851

View File

@@ -152,10 +152,6 @@ public class TJUnitTest {
return "Unknown"; return "Unknown";
} }
private static double getTime() {
return (double)System.nanoTime() / 1.0e9;
}
private static void initBuf(byte[] buf, int w, int pitch, int h, int pf, private static void initBuf(byte[] buf, int w, int pitch, int h, int pf,
int flags) throws Exception { int flags) throws Exception {
int roffset = TJ.getRedOffset(pf); int roffset = TJ.getRedOffset(pf);
@@ -697,7 +693,6 @@ public class TJUnitTest {
String buStrLong = (flags & TJ.FLAG_BOTTOMUP) != 0 ? String buStrLong = (flags & TJ.FLAG_BOTTOMUP) != 0 ?
"Bottom-Up" : "Top-Down "; "Bottom-Up" : "Top-Down ";
String buStr = (flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD"; String buStr = (flags & TJ.FLAG_BOTTOMUP) != 0 ? "BU" : "TD";
double t;
int size = 0, ps, imgType = pf; int size = 0, ps, imgType = pf;
if (yuv == YUVDECODE) { if (yuv == YUVDECODE) {
@@ -738,7 +733,6 @@ public class TJUnitTest {
} }
Arrays.fill(dstBuf, (byte)0); Arrays.fill(dstBuf, (byte)0);
t = getTime();
tjc.setSubsamp(subsamp); tjc.setSubsamp(subsamp);
tjc.setJPEGQuality(jpegQual); tjc.setJPEGQuality(jpegQual);
tjc.setYUVPad(pad); tjc.setYUVPad(pad);
@@ -758,7 +752,6 @@ public class TJUnitTest {
tjc.compress(dstBuf, flags); tjc.compress(dstBuf, flags);
} }
size = tjc.getCompressedSize(); size = tjc.getCompressedSize();
t = getTime() - t;
if (yuv == YUVENCODE) if (yuv == YUVENCODE)
tempstr = baseName + "_enc_" + pfStr + "_" + buStr + "_" + tempstr = baseName + "_enc_" + pfStr + "_" + buStr + "_" +
@@ -778,8 +771,7 @@ public class TJUnitTest {
} }
} else } else
System.out.print("Done."); System.out.print("Done.");
System.out.format(" %.6f ms\n", t * 1000.); System.out.println("\n Result in " + tempstr);
System.out.println(" Result in " + tempstr);
return size; return size;
} }
@@ -789,7 +781,6 @@ public class TJUnitTest {
String baseName, int subsamp, int flags, String baseName, int subsamp, int flags,
TJScalingFactor sf) throws Exception { TJScalingFactor sf) throws Exception {
String pfStr, tempstr; String pfStr, tempstr;
double t;
int scaledWidth = sf.getScaled(w); int scaledWidth = sf.getScaled(w);
int scaledHeight = sf.getScaled(h); int scaledHeight = sf.getScaled(h);
int temp1, temp2, imgType = pf; int temp1, temp2, imgType = pf;
@@ -821,7 +812,6 @@ public class TJUnitTest {
else else
System.out.print("... "); System.out.print("... ");
t = getTime();
tjd.setJPEGImage(jpegBuf, jpegSize); tjd.setJPEGImage(jpegBuf, jpegSize);
if (tjd.getWidth() != w || tjd.getHeight() != h || if (tjd.getWidth() != w || tjd.getHeight() != h ||
tjd.getSubsamp() != subsamp) tjd.getSubsamp() != subsamp)
@@ -842,7 +832,6 @@ public class TJUnitTest {
else else
dstBuf = tjd.decompress(scaledWidth, 0, scaledHeight, pf, flags); dstBuf = tjd.decompress(scaledWidth, 0, scaledHeight, pf, flags);
} }
t = getTime() - t;
if (bi) { if (bi) {
tempstr = baseName + "_dec_" + pfStr + "_" + tempstr = baseName + "_dec_" + pfStr + "_" +
@@ -871,7 +860,7 @@ public class TJUnitTest {
exitStatus = -1; exitStatus = -1;
} }
} }
System.out.format(" %.6f ms\n", t * 1000.); System.out.print("\n");
} }
private static void decompTest(TJDecompressor tjd, byte[] jpegBuf, private static void decompTest(TJDecompressor tjd, byte[] jpegBuf,