From: DRC Date: Wed, 28 Jun 2017 20:30:41 +0000 (-0500) Subject: Merge branch 'master' into dev X-Git-Tag: 1.5.90~68 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dedce66eb59968133f4c7e07987317f8ef25c6fe;p=libjpeg-turbo Merge branch 'master' into dev --- dedce66eb59968133f4c7e07987317f8ef25c6fe diff --cc CMakeLists.txt index ee83835,131b437..a2a4573 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@@ -859,118 -516,30 +859,119 @@@ foreach(libtype ${TEST_LIBTYPES} set(suffix -static) endif() if(WITH_TURBOJPEG) - add_test(tjunittest${suffix} tjunittest${suffix}) - add_test(tjunittest${suffix}-alloc tjunittest${suffix} -alloc) - add_test(tjunittest${suffix}-yuv tjunittest${suffix} -yuv) - add_test(tjunittest${suffix}-yuv-alloc tjunittest${suffix} -yuv -alloc) - add_test(tjunittest${suffix}-yuv-nopad tjunittest${suffix} -yuv -noyuvpad) + add_test(tjunittest-${libtype} tjunittest${suffix}) + add_test(tjunittest-${libtype}-alloc tjunittest${suffix} -alloc) + add_test(tjunittest-${libtype}-yuv tjunittest${suffix} -yuv) + add_test(tjunittest-${libtype}-yuv-alloc tjunittest${suffix} -yuv -alloc) + add_test(tjunittest-${libtype}-yuv-nopad tjunittest${suffix} -yuv -noyuvpad) + + set(MD5_PPM_GRAY_TILE 89d3ca21213d9d864b50b4e4e7de4ca6) + set(MD5_PPM_420_8x8_TILE 847fceab15c5b7b911cb986cf0f71de3) + set(MD5_PPM_420_16x16_TILE ca45552a93687e078f7137cc4126a7b0) + set(MD5_PPM_420_32x32_TILE d8676f1d6b68df358353bba9844f4a00) + set(MD5_PPM_420_64x64_TILE 4e4c1a3d7ea4bace4f868bcbe83b7050) + set(MD5_PPM_420_128x128_TILE f24c3429c52265832beab9df72a0ceae) + set(MD5_PPM_420M_8x8_TILE bc25320e1f4c31ce2e610e43e9fd173c) + set(MD5_PPM_420M_TILE 75ffdf14602258c5c189522af57fa605) + set(MD5_PPM_422_8x8_TILE d83dacd9fc73b0a6f10c09acad64eb1e) + set(MD5_PPM_422_16x16_TILE 35077fb610d72dd743b1eb0cbcfe10fb) + set(MD5_PPM_422_32x32_TILE e6902ed8a449ecc0f0d6f2bf945f65f7) + set(MD5_PPM_422_64x64_TILE 2b4502a8f316cedbde1da7bce3d2231e) + set(MD5_PPM_422_128x128_TILE f0b5617d578f5e13c8eee215d64d4877) + set(MD5_PPM_422M_8x8_TILE 828941d7f41cd6283abd6beffb7fd51d) + set(MD5_PPM_422M_TILE e877ae1324c4a280b95376f7f018172f) + set(MD5_PPM_444_TILE 7964e41e67cfb8d0a587c0aa4798f9c3) + + # Test compressing from/decompressing to an arbitrary subregion of a larger + # image buffer + add_test(tjbench-${libtype}-tile-cp + ${CMAKE_COMMAND} -E copy_if_different ${TESTIMAGES}/testorig.ppm + testout_tile.ppm) + add_test(tjbench-${libtype}-tile - tjbench${suffix} testout_tile.ppm 95 -rgb -quiet -tile -benchtime 0.01) ++ tjbench${suffix} testout_tile.ppm 95 -rgb -quiet -tile -benchtime 0.01 ++ -warmup 0) + set_tests_properties(tjbench-${libtype}-tile + PROPERTIES DEPENDS tjbench-${libtype}-tile-cp) + + foreach(tile 8 16 32 64 128) + add_test(tjbench-${libtype}-tile-gray-${tile}x${tile}-cmp + ${MD5CMP} ${MD5_PPM_GRAY_TILE} + testout_tile_GRAY_Q95_${tile}x${tile}.ppm) + foreach(subsamp 420 422) + add_test(tjbench-${libtype}-tile-${subsamp}-${tile}x${tile}-cmp + ${MD5CMP} ${MD5_PPM_${subsamp}_${tile}x${tile}_TILE} + testout_tile_${subsamp}_Q95_${tile}x${tile}.ppm) + endforeach() + add_test(tjbench-${libtype}-tile-444-${tile}x${tile}-cmp + ${MD5CMP} ${MD5_PPM_444_TILE} + testout_tile_444_Q95_${tile}x${tile}.ppm) + foreach(subsamp gray 420 422 444) + set_tests_properties(tjbench-${libtype}-tile-${subsamp}-${tile}x${tile}-cmp + PROPERTIES DEPENDS tjbench-${libtype}-tile) + endforeach() + endforeach() + + add_test(tjbench-${libtype}-tilem-cp + ${CMAKE_COMMAND} -E copy_if_different ${TESTIMAGES}/testorig.ppm + testout_tilem.ppm) + add_test(tjbench-${libtype}-tilem + tjbench${suffix} testout_tilem.ppm 95 -rgb -fastupsample -quiet -tile - -benchtime 0.01) ++ -benchtime 0.01 -warmup 0) + set_tests_properties(tjbench-${libtype}-tilem + PROPERTIES DEPENDS tjbench-${libtype}-tilem-cp) + + add_test(tjbench-${libtype}-tile-420m-8x8-cmp + ${MD5CMP} ${MD5_PPM_420M_8x8_TILE} testout_tilem_420_Q95_8x8.ppm) + add_test(tjbench-${libtype}-tile-422m-8x8-cmp + ${MD5CMP} ${MD5_PPM_422M_8x8_TILE} testout_tilem_422_Q95_8x8.ppm) + foreach(tile 16 32 64 128) + foreach(subsamp 420 422) + add_test(tjbench-${libtype}-tile-${subsamp}m-${tile}x${tile}-cmp + ${MD5CMP} ${MD5_PPM_${subsamp}M_TILE} + testout_tilem_${subsamp}_Q95_${tile}x${tile}.ppm) + endforeach() + endforeach() + foreach(tile 8 16 32 64 128) + foreach(subsamp 420 422) + set_tests_properties(tjbench-${libtype}-tile-${subsamp}m-${tile}x${tile}-cmp + PROPERTIES DEPENDS tjbench-${libtype}-tilem) + endforeach() + endforeach() endif() - # These tests are carefully chosen to provide full coverage of as many of the - # underlying algorithms as possible (including all of the SIMD-accelerated - # ones.) + # These tests are carefully crafted to provide full coverage of as many of + # the underlying algorithms as possible (including all of the + # SIMD-accelerated ones.) + + macro(add_bittest PROG NAME ARGS OUTFILE INFILE MD5SUM) + add_test(${PROG}-${libtype}-${NAME} + ${PROG}${suffix} ${ARGS} -outfile ${OUTFILE} ${INFILE}) + add_test(${PROG}-${libtype}-${NAME}-cmp + ${MD5CMP} ${MD5SUM} ${OUTFILE}) + set_tests_properties(${PROG}-${libtype}-${NAME}-cmp PROPERTIES + DEPENDS ${PROG}-${libtype}-${NAME}) + if(${ARGC} GREATER 6) + set(DEPENDS ${ARGN}) + set_tests_properties(${PROG}-${libtype}-${NAME} PROPERTIES + DEPENDS ${DEPENDS}) + endif() + endmacro() # CC: null SAMP: fullsize FDCT: islow ENT: huff - add_test(cjpeg${suffix}-rgb-islow - ${dir}cjpeg${suffix} -rgb -dct int - -outfile testout_rgb_islow.jpg ${TESTIMAGES}/testorig.ppm) - add_test(cjpeg${suffix}-rgb-islow-cmp - ${MD5CMP} ${MD5_JPEG_RGB_ISLOW} testout_rgb_islow.jpg) + add_bittest(cjpeg rgb-islow "-rgb;-dct;int;-icc;${TESTIMAGES}/test1.icc" + testout_rgb_islow.jpg ${TESTIMAGES}/testorig.ppm + ${MD5_JPEG_RGB_ISLOW}) # CC: null SAMP: fullsize IDCT: islow ENT: huff - add_test(djpeg${suffix}-rgb-islow - ${dir}djpeg${suffix} -dct int -ppm - -outfile testout_rgb_islow.ppm testout_rgb_islow.jpg) - add_test(djpeg${suffix}-rgb-islow-cmp - ${MD5CMP} ${MD5_PPM_RGB_ISLOW} testout_rgb_islow.ppm) + add_bittest(djpeg rgb-islow "-dct;int;-ppm;-icc;testout_rgb_islow.icc" + testout_rgb_islow.ppm testout_rgb_islow.jpg + ${MD5_PPM_RGB_ISLOW} cjpeg-${libtype}-rgb-islow) + + add_test(djpeg-${libtype}-rgb-islow-icc-cmp + ${MD5CMP} b06a39d730129122e85c1363ed1bbc9e testout_rgb_islow.icc) + + add_bittest(jpegtran icc "-copy;all;-icc;${TESTIMAGES}/test2.icc" + testout_rgb_islow2.jpg testout_rgb_islow.jpg ${MD5_JPEG_RGB_ISLOW2}) if(NOT WITH_12BIT) # CC: RGB->RGB565 SAMP: fullsize IDCT: islow ENT: huff diff --cc java/TJBench.java index e76f1a2,5185d65..6f5f335 --- a/java/TJBench.java +++ b/java/TJBench.java @@@ -661,14 -668,12 +670,15 @@@ class TJBench 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("-benchtime = Run each benchmark for at least seconds (default = 5.0)"); - System.out.println("-warmup = Execute each benchmark times to prime the cache before"); - System.out.println(" taking performance measurements (default = 1)"); + System.out.println("-warmup = Run each benchmark for 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("-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.)\n"); + System.out.println(" of performance measurements.)"); + 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("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); @@@ -833,17 -834,16 +843,18 @@@ if (argv[i].equalsIgnoreCase("-nowrite")) write = false; if (argv[i].equalsIgnoreCase("-warmup") && i < argv.length - 1) { - int temp = -1; + double temp = -1; try { - temp = Integer.parseInt(argv[++i]); + temp = Double.parseDouble(argv[++i]); } catch (NumberFormatException e) {} - if (temp >= 0) { + if (temp >= 0.0) { warmup = temp; - System.out.format("Warmup runs = %d\n\n", warmup); - } + System.out.format("Warmup time = %.1f seconds\n\n", warmup); + } else + usage(); } + if (argv[i].equalsIgnoreCase("-stoponwarning")) + flags |= TJ.FLAG_STOPONWARNING; if (argv[i].equalsIgnoreCase("-?")) usage(); } diff --cc tjbench.c index 36ea6cf,21b297c..a5be7d4 --- a/tjbench.c +++ b/tjbench.c @@@ -771,14 -780,12 +786,15 @@@ void usage(char *progname printf("-grayscale = Perform lossless grayscale conversion prior to decompression\n"); printf(" test (can be combined with the other transforms above)\n"); printf("-benchtime = Run each benchmark for at least seconds (default = 5.0)\n"); - printf("-warmup = Execute each benchmark times to prime the cache before\n"); - printf(" taking performance measurements (default = 1)\n"); + printf("-warmup = Run each benchmark for seconds (default = 1.0) prior to\n"); + printf(" starting the timer, in order to prime the caches and thus improve the\n"); + printf(" consistency of the results.\n"); printf("-componly = Stop after running compression tests. Do not test decompression.\n"); printf("-nowrite = Do not write reference or output images (improves consistency of\n"); - printf(" performance measurements.)\n\n"); + printf(" performance measurements.)\n"); + printf("-stoponwarning = Immediately discontinue the current\n"); + printf(" compression/decompression/transform operation if the underlying codec\n"); + printf(" throws a warning (non-fatal error)\n\n"); printf("NOTE: If the quality is specified as a range (e.g. 90-100), a separate\n"); printf("test will be performed for all quality values in the range.\n\n"); exit(1);