]> granicus.if.org Git - libjpeg-turbo/commitdiff
Merge branch 'master' into dev
authorDRC <information@libjpeg-turbo.org>
Wed, 28 Jun 2017 20:30:41 +0000 (15:30 -0500)
committerDRC <information@libjpeg-turbo.org>
Wed, 28 Jun 2017 20:30:41 +0000 (15:30 -0500)
1  2 
CMakeLists.txt
ChangeLog.md
doc/html/group___turbo_j_p_e_g.html
java/TJBench.java
tjbench.c
turbojpeg.h

diff --cc CMakeLists.txt
index ee838358992603ef1b5db898cdd824c5dc5b64ad,131b437574912c673c6ee745d0d807e316258f12..a2a45731463bd3c271759621957d812856f9201f
@@@ -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 ChangeLog.md
Simple merge
Simple merge
index e76f1a226bc8d386d4c8c872275722481a829269,5185d6585d2351dc40e95b517480e5fea2f3a6f8..6f5f3355921da9bbd4f342414167419e3028ca17
@@@ -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 <t> = Run each benchmark for at least <t> seconds (default = 5.0)");
-     System.out.println("-warmup <w> = Execute each benchmark <w> times to prime the cache before");
-     System.out.println("     taking performance measurements (default = 1)");
+     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("-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);
            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 36ea6cf21e9e3db33af93d399a9a38b36ed9d350,21b297c62897576b5c4b44557f6620caf5314bb9..a5be7d420148e99e55a0ef0343cd02165748e0d7
+++ 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 <t> = Run each benchmark for at least <t> seconds (default = 5.0)\n");
-       printf("-warmup <w> = Execute each benchmark <w> times to prime the cache before\n");
-       printf("     taking performance measurements (default = 1)\n");
+       printf("-warmup <t> = Run each benchmark for <t> 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);
diff --cc turbojpeg.h
Simple merge