DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 1 | # |
| 2 | # Setup |
| 3 | # |
| 4 | |
DRC | ee681aa | 2016-05-01 11:42:15 -0500 | [diff] [blame] | 5 | cmake_minimum_required(VERSION 2.8.11) |
DRC | 9fe22da | 2014-04-16 23:30:38 +0000 | [diff] [blame] | 6 | # Use LINK_INTERFACE_LIBRARIES instead of INTERFACE_LINK_LIBRARIES |
| 7 | if(POLICY CMP0022) |
| 8 | cmake_policy(SET CMP0022 OLD) |
| 9 | endif() |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 10 | |
DRC | 5d6f858 | 2011-02-18 23:08:58 +0000 | [diff] [blame] | 11 | project(libjpeg-turbo C) |
DRC | 9e6c6a1 | 2016-07-06 16:22:27 +0000 | [diff] [blame^] | 12 | set(VERSION 1.5.1) |
DRC | f06cc12 | 2016-05-10 19:36:34 -0500 | [diff] [blame] | 13 | string(REPLACE "." ";" VERSION_TRIPLET ${VERSION}) |
| 14 | list(GET VERSION_TRIPLET 0 VERSION_MAJOR) |
| 15 | list(GET VERSION_TRIPLET 1 VERSION_MINOR) |
| 16 | list(GET VERSION_TRIPLET 2 VERSION_REVISION) |
| 17 | function(pad_number NUMBER OUTPUT_LEN) |
| 18 | string(LENGTH "${${NUMBER}}" INPUT_LEN) |
| 19 | if(INPUT_LEN LESS OUTPUT_LEN) |
| 20 | math(EXPR ZEROES "${OUTPUT_LEN} - ${INPUT_LEN} - 1") |
| 21 | set(NUM ${${NUMBER}}) |
| 22 | foreach(C RANGE ${ZEROES}) |
| 23 | set(NUM "0${NUM}") |
| 24 | endforeach() |
| 25 | set(${NUMBER} ${NUM} PARENT_SCOPE) |
| 26 | endif() |
| 27 | endfunction() |
| 28 | pad_number(VERSION_MINOR 3) |
| 29 | pad_number(VERSION_REVISION 3) |
| 30 | set(LIBJPEG_TURBO_VERSION_NUMBER ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_REVISION}) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 31 | |
DRC | ee681aa | 2016-05-01 11:42:15 -0500 | [diff] [blame] | 32 | if(NOT WIN32) |
DRC | 378da4d | 2010-10-15 19:11:11 +0000 | [diff] [blame] | 33 | message(FATAL_ERROR "Platform not supported by this build system. Use autotools instead.") |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 34 | endif() |
| 35 | |
DRC | ee681aa | 2016-05-01 11:42:15 -0500 | [diff] [blame] | 36 | string(TIMESTAMP BUILD "%Y%m%d") |
| 37 | |
DRC | 2ffcb8e | 2011-04-04 04:56:24 +0000 | [diff] [blame] | 38 | # This does nothing except when using MinGW. CMAKE_BUILD_TYPE has no meaning |
| 39 | # in Visual Studio, and it always defaults to Debug when using NMake. |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 40 | if(NOT CMAKE_BUILD_TYPE) |
| 41 | set(CMAKE_BUILD_TYPE Release) |
| 42 | endif() |
| 43 | |
| 44 | message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}") |
| 45 | |
| 46 | # This only works if building from the command line. There is currently no way |
DRC | 2ffcb8e | 2011-04-04 04:56:24 +0000 | [diff] [blame] | 47 | # to set a variable's value based on the build type when using Visual Studio. |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 48 | if(CMAKE_BUILD_TYPE STREQUAL "Debug") |
| 49 | set(BUILD "${BUILD}d") |
| 50 | endif() |
| 51 | |
DRC | eb2b9d6 | 2010-10-15 04:55:13 +0000 | [diff] [blame] | 52 | message(STATUS "VERSION = ${VERSION}, BUILD = ${BUILD}") |
| 53 | |
DRC | ddcd5a1 | 2011-04-15 00:24:02 +0000 | [diff] [blame] | 54 | option(WITH_SIMD "Include SIMD extensions" TRUE) |
DRC | 5c064de | 2016-05-09 20:00:46 -0500 | [diff] [blame] | 55 | option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE) |
| 56 | option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE) |
DRC | ddcd5a1 | 2011-04-15 00:24:02 +0000 | [diff] [blame] | 57 | option(WITH_JPEG7 "Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)" FALSE) |
| 58 | option(WITH_JPEG8 "Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)" FALSE) |
DRC | ab70623 | 2013-01-18 23:42:31 +0000 | [diff] [blame] | 59 | option(WITH_MEM_SRCDST "Include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI" TRUE) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 60 | option(WITH_TURBOJPEG "Include the TurboJPEG wrapper library and associated test programs" TRUE) |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 61 | option(WITH_JAVA "Build Java wrapper for the TurboJPEG library" FALSE) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 62 | option(WITH_12BIT "Encode/decode JPEG images with 12-bit samples (implies WITH_SIMD=0 WITH_TURBOJPEG=0 WITH_ARITH_ENC=0 WITH_ARITH_DEC=0)" FALSE) |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 63 | option(ENABLE_STATIC "Build static libraries" TRUE) |
| 64 | option(ENABLE_SHARED "Build shared libraries" TRUE) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 65 | |
| 66 | if(WITH_12BIT) |
| 67 | set(WITH_SIMD FALSE) |
| 68 | set(WITH_TURBOJPEG FALSE) |
DRC | ecc5836 | 2015-06-27 07:56:29 +0000 | [diff] [blame] | 69 | set(WITH_JAVA FALSE) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 70 | set(WITH_ARITH_ENC FALSE) |
| 71 | set(WITH_ARITH_DEC FALSE) |
| 72 | set(BITS_IN_JSAMPLE 12) |
| 73 | message(STATUS "12-bit JPEG support enabled") |
| 74 | else() |
| 75 | set(BITS_IN_JSAMPLE 8) |
| 76 | endif() |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 77 | |
DRC | 5c064de | 2016-05-09 20:00:46 -0500 | [diff] [blame] | 78 | if(WITH_JPEG8 OR WITH_JPEG7) |
| 79 | set(WITH_ARITH_ENC 1) |
| 80 | set(WITH_ARITH_DEC 1) |
| 81 | endif() |
| 82 | if(WITH_JPEG8) |
| 83 | set(WITH_MEM_SRCDST 1) |
| 84 | endif() |
| 85 | |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 86 | if(WITH_ARITH_ENC) |
| 87 | set(C_ARITH_CODING_SUPPORTED 1) |
DRC | 990e28d | 2011-01-04 21:40:11 +0000 | [diff] [blame] | 88 | message(STATUS "Arithmetic encoding support enabled") |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 89 | else() |
DRC | 990e28d | 2011-01-04 21:40:11 +0000 | [diff] [blame] | 90 | message(STATUS "Arithmetic encoding support disabled") |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 91 | endif() |
| 92 | |
| 93 | if(WITH_ARITH_DEC) |
| 94 | set(D_ARITH_CODING_SUPPORTED 1) |
DRC | 990e28d | 2011-01-04 21:40:11 +0000 | [diff] [blame] | 95 | message(STATUS "Arithmetic decoding support enabled") |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 96 | else() |
DRC | 990e28d | 2011-01-04 21:40:11 +0000 | [diff] [blame] | 97 | message(STATUS "Arithmetic decoding support disabled") |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 98 | endif() |
| 99 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 100 | if(WITH_TURBOJPEG) |
| 101 | message(STATUS "TurboJPEG C wrapper enabled") |
| 102 | else() |
| 103 | message(STATUS "TurboJPEG C wrapper disabled") |
| 104 | endif() |
| 105 | |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 106 | if(WITH_JAVA) |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 107 | message(STATUS "TurboJPEG Java wrapper enabled") |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 108 | else() |
DRC | 5039d73 | 2013-01-21 23:42:12 +0000 | [diff] [blame] | 109 | message(STATUS "TurboJPEG Java wrapper disabled") |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 110 | endif() |
| 111 | |
DRC | ab70623 | 2013-01-18 23:42:31 +0000 | [diff] [blame] | 112 | set(SO_AGE 0) |
| 113 | if(WITH_MEM_SRCDST) |
| 114 | set(SO_AGE 1) |
| 115 | endif() |
| 116 | |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 117 | set(JPEG_LIB_VERSION 62) |
| 118 | set(DLL_VERSION ${JPEG_LIB_VERSION}) |
DRC | ab70623 | 2013-01-18 23:42:31 +0000 | [diff] [blame] | 119 | set(FULLVERSION ${DLL_VERSION}.${SO_AGE}.0) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 120 | if(WITH_JPEG8) |
| 121 | set(JPEG_LIB_VERSION 80) |
| 122 | set(DLL_VERSION 8) |
DRC | a9d5b25 | 2010-10-15 06:42:45 +0000 | [diff] [blame] | 123 | set(FULLVERSION ${DLL_VERSION}.0.2) |
DRC | f38eee0 | 2011-02-18 07:00:38 +0000 | [diff] [blame] | 124 | message(STATUS "Emulating libjpeg v8 API/ABI") |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 125 | elseif(WITH_JPEG7) |
| 126 | set(JPEG_LIB_VERSION 70) |
| 127 | set(DLL_VERSION 7) |
DRC | ab70623 | 2013-01-18 23:42:31 +0000 | [diff] [blame] | 128 | set(FULLVERSION ${DLL_VERSION}.${SO_AGE}.0) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 129 | message(STATUS "Emulating libjpeg v7 API/ABI") |
| 130 | endif(WITH_JPEG8) |
| 131 | |
DRC | ab70623 | 2013-01-18 23:42:31 +0000 | [diff] [blame] | 132 | if(WITH_MEM_SRCDST) |
| 133 | set(MEM_SRCDST_SUPPORTED 1) |
| 134 | message(STATUS "In-memory source/destination managers enabled") |
| 135 | else() |
| 136 | message(STATUS "In-memory source/destination managers disabled") |
| 137 | endif() |
| 138 | |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 139 | if(MSVC) |
DRC | 89a3f97 | 2015-03-19 19:27:40 +0000 | [diff] [blame] | 140 | option(WITH_CRT_DLL |
| 141 | "Link all libjpeg-turbo libraries and executables with the C run-time DLL (msvcr*.dll) instead of the static C run-time library (libcmt*.lib.) The default is to use the C run-time DLL only with the libraries and executables that need it." |
| 142 | FALSE) |
| 143 | if(NOT WITH_CRT_DLL) |
| 144 | # Use the static C library for all build types |
| 145 | foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE |
| 146 | CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO) |
| 147 | if(${var} MATCHES "/MD") |
| 148 | string(REGEX REPLACE "/MD" "/MT" ${var} "${${var}}") |
| 149 | endif() |
| 150 | endforeach() |
| 151 | endif() |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 152 | add_definitions(-W3 -wd4996) |
| 153 | endif() |
| 154 | |
| 155 | # Detect whether compiler is 64-bit |
| 156 | if(MSVC AND CMAKE_CL_64) |
| 157 | set(SIMD_X86_64 1) |
| 158 | set(64BIT 1) |
| 159 | elseif(CMAKE_SIZEOF_VOID_P MATCHES 8) |
| 160 | set(SIMD_X86_64 1) |
| 161 | set(64BIT 1) |
| 162 | endif() |
| 163 | |
| 164 | if(64BIT) |
| 165 | message(STATUS "64-bit build") |
| 166 | else() |
| 167 | message(STATUS "32-bit build") |
| 168 | endif() |
| 169 | |
DRC | 7175e51 | 2013-04-23 22:29:00 +0000 | [diff] [blame] | 170 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) |
| 171 | if(MSVC) |
| 172 | set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_PROJECT_NAME}) |
| 173 | else() |
| 174 | set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_PROJECT_NAME}-gcc) |
| 175 | endif() |
| 176 | if(64BIT) |
| 177 | set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_INSTALL_PREFIX_DEFAULT}64) |
| 178 | endif() |
| 179 | set(CMAKE_INSTALL_PREFIX "c:/${CMAKE_INSTALL_PREFIX_DEFAULT}" CACHE PATH |
| 180 | "Directory into which to install libjpeg-turbo (default: c:/${CMAKE_INSTALL_PREFIX_DEFAULT})" |
| 181 | FORCE) |
| 182 | endif() |
| 183 | |
| 184 | message(STATUS "Install directory = ${CMAKE_INSTALL_PREFIX}") |
| 185 | |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 186 | configure_file(win/jconfig.h.in jconfig.h) |
DRC | ff6961f | 2014-04-20 09:17:11 +0000 | [diff] [blame] | 187 | configure_file(win/jconfigint.h.in jconfigint.h) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 188 | |
| 189 | include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) |
| 190 | |
DRC | 03841e6 | 2016-02-09 18:27:27 -0600 | [diff] [blame] | 191 | string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC) |
| 192 | |
| 193 | set(EFFECTIVE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UC}}") |
| 194 | message(STATUS "Compiler flags = ${EFFECTIVE_C_FLAGS}") |
| 195 | |
| 196 | set(EFFECTIVE_LD_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE_UC}}") |
| 197 | message(STATUS "Linker flags = ${EFFECTIVE_LD_FLAGS}") |
| 198 | |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 199 | if(WITH_JAVA) |
| 200 | find_package(Java) |
| 201 | find_package(JNI) |
DRC | db42506 | 2011-04-03 06:10:18 +0000 | [diff] [blame] | 202 | if(DEFINED JAVACFLAGS) |
| 203 | message(STATUS "Java compiler flags = ${JAVACFLAGS}") |
| 204 | endif() |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 205 | endif() |
| 206 | |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 207 | |
| 208 | # |
| 209 | # Targets |
| 210 | # |
| 211 | |
DRC | 245cfdf | 2010-11-23 17:11:06 +0000 | [diff] [blame] | 212 | set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c |
| 213 | jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c |
| 214 | jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c |
| 215 | jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c |
| 216 | jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c |
| 217 | jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c |
| 218 | jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c) |
| 219 | |
| 220 | if(WITH_ARITH_ENC OR WITH_ARITH_DEC) |
| 221 | set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c) |
| 222 | endif() |
| 223 | |
| 224 | if(WITH_ARITH_ENC) |
| 225 | set(JPEG_SOURCES ${JPEG_SOURCES} jcarith.c) |
| 226 | endif() |
| 227 | |
| 228 | if(WITH_ARITH_DEC) |
| 229 | set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c) |
| 230 | endif() |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 231 | |
| 232 | if(WITH_SIMD) |
| 233 | add_definitions(-DWITH_SIMD) |
| 234 | add_subdirectory(simd) |
| 235 | if(SIMD_X86_64) |
| 236 | set(JPEG_SOURCES ${JPEG_SOURCES} simd/jsimd_x86_64.c) |
| 237 | else() |
| 238 | set(JPEG_SOURCES ${JPEG_SOURCES} simd/jsimd_i386.c) |
| 239 | endif() |
| 240 | # This tells CMake that the "source" files haven't been generated yet |
| 241 | set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1) |
| 242 | else() |
| 243 | set(JPEG_SOURCES ${JPEG_SOURCES} jsimd_none.c) |
DRC | 6f4ba61 | 2010-10-16 21:27:38 +0000 | [diff] [blame] | 244 | message(STATUS "Not using SIMD acceleration") |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 245 | endif() |
| 246 | |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 247 | if(WITH_JAVA) |
| 248 | add_subdirectory(java) |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 249 | set(ENABLE_SHARED TRUE) |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 250 | endif() |
| 251 | |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 252 | if(ENABLE_SHARED) |
| 253 | add_subdirectory(sharedlib) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 254 | endif() |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 255 | |
| 256 | if(ENABLE_STATIC OR WITH_TURBOJPEG) |
| 257 | add_library(jpeg-static STATIC ${JPEG_SOURCES} ${SIMD_OBJS}) |
| 258 | if(NOT MSVC) |
| 259 | set_target_properties(jpeg-static PROPERTIES OUTPUT_NAME jpeg) |
| 260 | endif() |
| 261 | if(WITH_SIMD) |
| 262 | add_dependencies(jpeg-static simd) |
| 263 | endif() |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 264 | endif() |
| 265 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 266 | if(WITH_TURBOJPEG) |
| 267 | set(TURBOJPEG_SOURCES turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c) |
| 268 | if(WITH_JAVA) |
| 269 | set(TURBOJPEG_SOURCES ${TURBOJPEG_SOURCES} turbojpeg-jni.c) |
| 270 | include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2}) |
| 271 | endif() |
| 272 | |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 273 | if(ENABLE_SHARED) |
| 274 | add_library(turbojpeg SHARED ${TURBOJPEG_SOURCES}) |
| 275 | set_target_properties(turbojpeg PROPERTIES DEFINE_SYMBOL DLLDEFINE) |
| 276 | if(MINGW) |
| 277 | set_target_properties(turbojpeg PROPERTIES LINK_FLAGS -Wl,--kill-at) |
| 278 | endif() |
| 279 | target_link_libraries(turbojpeg jpeg-static) |
| 280 | set_target_properties(turbojpeg PROPERTIES LINK_INTERFACE_LIBRARIES "") |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 281 | |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 282 | add_executable(tjunittest tjunittest.c tjutil.c) |
| 283 | target_link_libraries(tjunittest turbojpeg) |
| 284 | |
| 285 | add_executable(tjbench tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c |
| 286 | wrppm.c) |
| 287 | target_link_libraries(tjbench turbojpeg jpeg-static) |
| 288 | set_property(TARGET tjbench PROPERTY COMPILE_FLAGS |
| 289 | "-DBMP_SUPPORTED -DPPM_SUPPORTED") |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 290 | endif() |
| 291 | |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 292 | if(ENABLE_STATIC) |
| 293 | add_library(turbojpeg-static STATIC ${JPEG_SOURCES} ${SIMD_OBJS} |
| 294 | turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c) |
| 295 | if(NOT MSVC) |
| 296 | set_target_properties(turbojpeg-static PROPERTIES OUTPUT_NAME turbojpeg) |
| 297 | endif() |
| 298 | if(WITH_SIMD) |
| 299 | add_dependencies(turbojpeg-static simd) |
| 300 | endif() |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 301 | |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 302 | add_executable(tjunittest-static tjunittest.c tjutil.c) |
| 303 | target_link_libraries(tjunittest-static turbojpeg-static) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 304 | |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 305 | add_executable(tjbench-static tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c |
| 306 | wrbmp.c wrppm.c) |
| 307 | target_link_libraries(tjbench-static turbojpeg-static jpeg-static) |
| 308 | set_property(TARGET tjbench-static PROPERTY COMPILE_FLAGS |
| 309 | "-DBMP_SUPPORTED -DPPM_SUPPORTED") |
| 310 | endif() |
DRC | 218c0c1 | 2011-02-05 06:01:18 +0000 | [diff] [blame] | 311 | endif() |
| 312 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 313 | if(WITH_12BIT) |
| 314 | set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED -DUSE_SETMODE") |
| 315 | else() |
| 316 | set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE") |
DRC | ecc5836 | 2015-06-27 07:56:29 +0000 | [diff] [blame] | 317 | set(CJPEG_BMP_SOURCES rdbmp.c rdtarga.c) |
| 318 | set(DJPEG_BMP_SOURCES wrbmp.c wrtarga.c) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 319 | endif() |
| 320 | |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 321 | if(ENABLE_STATIC) |
| 322 | add_executable(cjpeg-static cjpeg.c cdjpeg.c rdgif.c rdppm.c rdswitch.c |
| 323 | ${CJPEG_BMP_SOURCES}) |
| 324 | set_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS}) |
| 325 | target_link_libraries(cjpeg-static jpeg-static) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 326 | |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 327 | add_executable(djpeg-static djpeg.c cdjpeg.c rdcolmap.c rdswitch.c wrgif.c |
| 328 | wrppm.c ${DJPEG_BMP_SOURCES}) |
| 329 | set_property(TARGET djpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS}) |
| 330 | target_link_libraries(djpeg-static jpeg-static) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 331 | |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 332 | add_executable(jpegtran-static jpegtran.c cdjpeg.c rdswitch.c transupp.c) |
| 333 | target_link_libraries(jpegtran-static jpeg-static) |
| 334 | set_property(TARGET jpegtran-static PROPERTY COMPILE_FLAGS "-DUSE_SETMODE") |
| 335 | endif() |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 336 | |
| 337 | add_executable(rdjpgcom rdjpgcom.c) |
| 338 | |
DRC | a81f542 | 2014-06-22 20:50:14 +0000 | [diff] [blame] | 339 | add_executable(wrjpgcom wrjpgcom.c) |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 340 | |
| 341 | |
| 342 | # |
| 343 | # Tests |
| 344 | # |
| 345 | |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 346 | add_subdirectory(md5) |
| 347 | |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 348 | if(MSVC_IDE) |
| 349 | set(OBJDIR "\${CTEST_CONFIGURATION_TYPE}/") |
| 350 | else() |
| 351 | set(OBJDIR "") |
| 352 | endif() |
| 353 | |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 354 | enable_testing() |
DRC | 211d1e7 | 2013-01-13 11:25:20 +0000 | [diff] [blame] | 355 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 356 | if(WITH_12BIT) |
| 357 | set(TESTORIG testorig12.jpg) |
| 358 | set(MD5_JPEG_RGB_ISLOW 9620f424569594bb9242b48498ad801f) |
| 359 | set(MD5_PPM_RGB_ISLOW f3301d2219783b8b3d942b7239fa50c0) |
| 360 | set(MD5_JPEG_422_IFAST_OPT 7322e3bd2f127f7de4b40d4480ce60e4) |
| 361 | set(MD5_PPM_422_IFAST 79807fa552899e66a04708f533e16950) |
| 362 | set(MD5_PPM_422M_IFAST 07737bfe8a7c1c87aaa393a0098d16b0) |
| 363 | set(MD5_JPEG_420_IFAST_Q100_PROG a1da220b5604081863a504297ed59e55) |
| 364 | set(MD5_PPM_420_Q100_IFAST 1b3730122709f53d007255e8dfd3305e) |
| 365 | set(MD5_PPM_420M_Q100_IFAST 980a1a3c5bf9510022869d30b7d26566) |
| 366 | set(MD5_JPEG_GRAY_ISLOW 235c90707b16e2e069f37c888b2636d9) |
| 367 | set(MD5_PPM_GRAY_ISLOW 7213c10af507ad467da5578ca5ee1fca) |
| 368 | set(MD5_PPM_GRAY_ISLOW_RGB e96ee81c30a6ed422d466338bd3de65d) |
| 369 | set(MD5_JPEG_420S_IFAST_OPT 7af8e60be4d9c227ec63ac9b6630855e) |
| 370 | set(MD5_JPEG_3x2_FLOAT_PROG a8c17daf77b457725ec929e215b603f8) |
| 371 | set(MD5_PPM_3x2_FLOAT 42876ab9e5c2f76a87d08db5fbd57956) |
| 372 | set(MD5_PPM_420M_ISLOW_2_1 4ca6be2a6f326ff9eaab63e70a8259c0) |
| 373 | set(MD5_PPM_420M_ISLOW_15_8 12aa9f9534c1b3d7ba047322226365eb) |
| 374 | set(MD5_PPM_420M_ISLOW_13_8 f7e22817c7b25e1393e4ec101e9d4e96) |
| 375 | set(MD5_PPM_420M_ISLOW_11_8 800a16f9f4dc9b293197bfe11be10a82) |
| 376 | set(MD5_PPM_420M_ISLOW_9_8 06b7a92a9bc69f4dc36ec40f1937d55c) |
| 377 | set(MD5_PPM_420M_ISLOW_7_8 3ec444a14a4ab4eab88ffc49c48eca43) |
| 378 | set(MD5_PPM_420M_ISLOW_3_4 3e726b7ea872445b19437d1c1d4f0d93) |
| 379 | set(MD5_PPM_420M_ISLOW_5_8 a8a771abdc94301d20ffac119b2caccd) |
| 380 | set(MD5_PPM_420M_ISLOW_1_2 b419124dd5568b085787234866102866) |
| 381 | set(MD5_PPM_420M_ISLOW_3_8 343d19015531b7bbe746124127244fa8) |
| 382 | set(MD5_PPM_420M_ISLOW_1_4 35fd59d866e44659edfa3c18db2a3edb) |
| 383 | set(MD5_PPM_420M_ISLOW_1_8 ccaed48ac0aedefda5d4abe4013f4ad7) |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 384 | set(MD5_PPM_420_ISLOW_SKIP15_31 86664cd9dc956536409e44e244d20a97) |
DRC | 3ab68cf | 2016-02-19 18:32:10 -0600 | [diff] [blame] | 385 | set(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 452a21656115a163029cfba5c04fa76a) |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 386 | set(MD5_PPM_444_ISLOW_SKIP1_6 ef63901f71ef7a75cd78253fc0914f84) |
DRC | 3ab68cf | 2016-02-19 18:32:10 -0600 | [diff] [blame] | 387 | set(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 15b173fb5872d9575572fbcc1b05956f) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 388 | set(MD5_JPEG_CROP cdb35ff4b4519392690ea040c56ea99c) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 389 | else() |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 390 | set(TESTORIG testorig.jpg) |
| 391 | set(MD5_JPEG_RGB_ISLOW 768e970dd57b340ff1b83c9d3d47c77b) |
| 392 | set(MD5_PPM_RGB_ISLOW 00a257f5393fef8821f2b88ac7421291) |
| 393 | set(MD5_BMP_RGB_ISLOW_565 f07d2e75073e4bb10f6c6f4d36e2e3be) |
| 394 | set(MD5_BMP_RGB_ISLOW_565D 4cfa0928ef3e6bb626d7728c924cfda4) |
| 395 | set(MD5_JPEG_422_IFAST_OPT 2540287b79d913f91665e660303ab2c8) |
| 396 | set(MD5_PPM_422_IFAST 35bd6b3f833bad23de82acea847129fa) |
| 397 | set(MD5_PPM_422M_IFAST 8dbc65323d62cca7c91ba02dd1cfa81d) |
| 398 | set(MD5_BMP_422M_IFAST_565 3294bd4d9a1f2b3d08ea6020d0db7065) |
| 399 | set(MD5_BMP_422M_IFAST_565D da98c9c7b6039511be4a79a878a9abc1) |
| 400 | set(MD5_JPEG_420_IFAST_Q100_PROG 990cbe0329c882420a2094da7e5adade) |
| 401 | set(MD5_PPM_420_Q100_IFAST 5a732542015c278ff43635e473a8a294) |
| 402 | set(MD5_PPM_420M_Q100_IFAST ff692ee9323a3b424894862557c092f1) |
| 403 | set(MD5_JPEG_GRAY_ISLOW 72b51f894b8f4a10b3ee3066770aa38d) |
| 404 | set(MD5_PPM_GRAY_ISLOW 8d3596c56eace32f205deccc229aa5ed) |
| 405 | set(MD5_PPM_GRAY_ISLOW_RGB 116424ac07b79e5e801f00508eab48ec) |
| 406 | set(MD5_BMP_GRAY_ISLOW_565 12f78118e56a2f48b966f792fedf23cc) |
| 407 | set(MD5_BMP_GRAY_ISLOW_565D bdbbd616441a24354c98553df5dc82db) |
| 408 | set(MD5_JPEG_420S_IFAST_OPT 388708217ac46273ca33086b22827ed8) |
| 409 | if(WITH_SIMD) |
| 410 | set(MD5_JPEG_3x2_FLOAT_PROG 343e3f8caf8af5986ebaf0bdc13b5c71) |
| 411 | set(MD5_PPM_3x2_FLOAT 1a75f36e5904d6fc3a85a43da9ad89bb) |
| 412 | else() |
| 413 | set(MD5_JPEG_3x2_FLOAT_PROG 9bca803d2042bd1eb03819e2bf92b3e5) |
| 414 | set(MD5_PPM_3x2_FLOAT f6bfab038438ed8f5522fbd33595dcdc) |
| 415 | endif() |
| 416 | set(MD5_JPEG_420_ISLOW_ARI e986fb0a637a8d833d96e8a6d6d84ea1) |
| 417 | set(MD5_JPEG_444_ISLOW_PROGARI 0a8f1c8f66e113c3cf635df0a475a617) |
| 418 | set(MD5_PPM_420M_IFAST_ARI 72b59a99bcf1de24c5b27d151bde2437) |
| 419 | set(MD5_JPEG_420_ISLOW 9a68f56bc76e466aa7e52f415d0f4a5f) |
| 420 | set(MD5_PPM_420M_ISLOW_2_1 9f9de8c0612f8d06869b960b05abf9c9) |
| 421 | set(MD5_PPM_420M_ISLOW_15_8 b6875bc070720b899566cc06459b63b7) |
| 422 | set(MD5_PPM_420M_ISLOW_13_8 bc3452573c8152f6ae552939ee19f82f) |
| 423 | set(MD5_PPM_420M_ISLOW_11_8 d8cc73c0aaacd4556569b59437ba00a5) |
| 424 | set(MD5_PPM_420M_ISLOW_9_8 d25e61bc7eac0002f5b393aa223747b6) |
| 425 | set(MD5_PPM_420M_ISLOW_7_8 ddb564b7c74a09494016d6cd7502a946) |
| 426 | set(MD5_PPM_420M_ISLOW_3_4 8ed8e68808c3fbc4ea764fc9d2968646) |
| 427 | set(MD5_PPM_420M_ISLOW_5_8 a3363274999da2366a024efae6d16c9b) |
| 428 | set(MD5_PPM_420M_ISLOW_1_2 e692a315cea26b988c8e8b29a5dbcd81) |
| 429 | set(MD5_PPM_420M_ISLOW_3_8 79eca9175652ced755155c90e785a996) |
| 430 | set(MD5_PPM_420M_ISLOW_1_4 79cd778f8bf1a117690052cacdd54eca) |
| 431 | set(MD5_PPM_420M_ISLOW_1_8 391b3d4aca640c8567d6f8745eb2142f) |
| 432 | set(MD5_BMP_420_ISLOW_256 4980185e3776e89bd931736e1cddeee6) |
| 433 | set(MD5_BMP_420_ISLOW_565 bf9d13e16c4923b92e1faa604d7922cb) |
| 434 | set(MD5_BMP_420_ISLOW_565D 6bde71526acc44bcff76f696df8638d2) |
| 435 | set(MD5_BMP_420M_ISLOW_565 8dc0185245353cfa32ad97027342216f) |
| 436 | set(MD5_BMP_420M_ISLOW_565D d1be3a3339166255e76fa50a0d70d73e) |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 437 | set(MD5_PPM_420_ISLOW_SKIP15_31 c4c65c1e43d7275cd50328a61e6534f0) |
| 438 | set(MD5_PPM_420_ISLOW_ARI_SKIP16_139 087c6b123db16ac00cb88c5b590bb74a) |
DRC | 3ab68cf | 2016-02-19 18:32:10 -0600 | [diff] [blame] | 439 | set(MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71 26eb36ccc7d1f0cb80cdabb0ac8b5d99) |
| 440 | set(MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4 886c6775af22370257122f8b16207e6d) |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 441 | set(MD5_PPM_444_ISLOW_SKIP1_6 5606f86874cf26b8fcee1117a0a436a6) |
DRC | 3ab68cf | 2016-02-19 18:32:10 -0600 | [diff] [blame] | 442 | set(MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13 db87dc7ce26bcdc7a6b56239ce2b9d6c) |
| 443 | set(MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0 cb57b32bd6d03e35432362f7bf184b6d) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 444 | set(MD5_JPEG_CROP b4197f377e621c4e9b1d20471432610d) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 445 | endif() |
DRC | 211d1e7 | 2013-01-13 11:25:20 +0000 | [diff] [blame] | 446 | |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 447 | if(WITH_JAVA) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 448 | add_test(TJUnitTest |
| 449 | ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar |
| 450 | -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} |
| 451 | TJUnitTest) |
| 452 | add_test(TJUnitTest-yuv |
| 453 | ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar |
| 454 | -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} |
| 455 | TJUnitTest -yuv) |
| 456 | add_test(TJUnitTest-yuv-nopad |
| 457 | ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar |
| 458 | -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} |
| 459 | TJUnitTest -yuv -noyuvpad) |
| 460 | add_test(TJUnitTest-bi |
| 461 | ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar |
| 462 | -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} |
| 463 | TJUnitTest -bi) |
| 464 | add_test(TJUnitTest-bi-yuv |
| 465 | ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar |
| 466 | -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} |
| 467 | TJUnitTest -bi -yuv) |
| 468 | add_test(TJUnitTest-bi-yuv-nopad |
| 469 | ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar |
| 470 | -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} |
| 471 | TJUnitTest -bi -yuv -noyuvpad) |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 472 | endif() |
DRC | 8469703 | 2010-10-15 03:43:24 +0000 | [diff] [blame] | 473 | |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 474 | set(TEST_LIBTYPES "") |
| 475 | if(ENABLE_SHARED) |
| 476 | set(TEST_LIBTYPES ${TEST_LIBTYPES} shared) |
| 477 | endif() |
| 478 | if(ENABLE_STATIC) |
| 479 | set(TEST_LIBTYPES ${TEST_LIBTYPES} static) |
| 480 | endif() |
| 481 | |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 482 | set(TESTIMAGES ${CMAKE_SOURCE_DIR}/testimages) |
| 483 | set(MD5CMP ${CMAKE_CURRENT_BINARY_DIR}/md5/md5cmp) |
| 484 | if(CMAKE_CROSSCOMPILING) |
| 485 | file(RELATIVE_PATH TESTIMAGES ${CMAKE_CURRENT_BINARY_DIR} ${TESTIMAGES}) |
| 486 | file(RELATIVE_PATH MD5CMP ${CMAKE_CURRENT_BINARY_DIR} ${MD5CMP}) |
| 487 | endif() |
| 488 | |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 489 | foreach(libtype ${TEST_LIBTYPES}) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 490 | if(libtype STREQUAL "shared") |
| 491 | set(dir sharedlib/) |
| 492 | else() |
| 493 | set(dir "") |
| 494 | set(suffix -static) |
| 495 | endif() |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 496 | if(WITH_TURBOJPEG) |
| 497 | add_test(tjunittest${suffix} tjunittest${suffix}) |
| 498 | add_test(tjunittest${suffix}-alloc tjunittest${suffix} -alloc) |
| 499 | add_test(tjunittest${suffix}-yuv tjunittest${suffix} -yuv) |
| 500 | add_test(tjunittest${suffix}-yuv-alloc tjunittest${suffix} -yuv -alloc) |
| 501 | add_test(tjunittest${suffix}-yuv-nopad tjunittest${suffix} -yuv -noyuvpad) |
| 502 | endif() |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 503 | |
| 504 | # These tests are carefully chosen to provide full coverage of as many of the |
| 505 | # underlying algorithms as possible (including all of the SIMD-accelerated |
| 506 | # ones.) |
| 507 | |
| 508 | # CC: null SAMP: fullsize FDCT: islow ENT: huff |
| 509 | add_test(cjpeg${suffix}-rgb-islow |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 510 | ${dir}cjpeg${suffix} -rgb -dct int |
| 511 | -outfile testout_rgb_islow.jpg ${TESTIMAGES}/testorig.ppm) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 512 | add_test(cjpeg${suffix}-rgb-islow-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 513 | ${MD5CMP} ${MD5_JPEG_RGB_ISLOW} testout_rgb_islow.jpg) |
| 514 | |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 515 | # CC: null SAMP: fullsize IDCT: islow ENT: huff |
| 516 | add_test(djpeg${suffix}-rgb-islow |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 517 | ${dir}djpeg${suffix} -dct int -ppm |
| 518 | -outfile testout_rgb_islow.ppm testout_rgb_islow.jpg) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 519 | add_test(djpeg${suffix}-rgb-islow-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 520 | ${MD5CMP} ${MD5_PPM_RGB_ISLOW} testout_rgb_islow.ppm) |
| 521 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 522 | if(NOT WITH_12BIT) |
| 523 | # CC: RGB->RGB565 SAMP: fullsize IDCT: islow ENT: huff |
| 524 | add_test(djpeg${suffix}-rgb-islow-565 |
| 525 | ${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp |
| 526 | -outfile testout_rgb_islow_565.bmp testout_rgb_islow.jpg) |
| 527 | add_test(djpeg${suffix}-rgb-islow-565-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 528 | ${MD5CMP} ${MD5_BMP_RGB_ISLOW_565} testout_rgb_islow_565.bmp) |
| 529 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 530 | # CC: RGB->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff |
| 531 | add_test(djpeg${suffix}-rgb-islow-565D |
| 532 | ${dir}djpeg${suffix} -dct int -rgb565 -bmp |
| 533 | -outfile testout_rgb_islow_565D.bmp testout_rgb_islow.jpg) |
| 534 | add_test(djpeg${suffix}-rgb-islow-565D-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 535 | ${MD5CMP} ${MD5_BMP_RGB_ISLOW_565D} testout_rgb_islow_565D.bmp) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 536 | endif() |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 537 | |
| 538 | # CC: RGB->YCC SAMP: fullsize/h2v1 FDCT: ifast ENT: 2-pass huff |
| 539 | add_test(cjpeg${suffix}-422-ifast-opt |
| 540 | ${dir}cjpeg${suffix} -sample 2x1 -dct fast -opt |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 541 | -outfile testout_422_ifast_opt.jpg ${TESTIMAGES}/testorig.ppm) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 542 | add_test(cjpeg${suffix}-422-ifast-opt-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 543 | ${MD5CMP} ${MD5_JPEG_422_IFAST_OPT} testout_422_ifast_opt.jpg) |
| 544 | |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 545 | # CC: YCC->RGB SAMP: fullsize/h2v1 fancy IDCT: ifast ENT: huff |
| 546 | add_test(djpeg${suffix}-422-ifast |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 547 | ${dir}djpeg${suffix} -dct fast |
| 548 | -outfile testout_422_ifast.ppm testout_422_ifast_opt.jpg) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 549 | add_test(djpeg${suffix}-422-ifast-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 550 | ${MD5CMP} ${MD5_PPM_422_IFAST} testout_422_ifast.ppm) |
| 551 | |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 552 | # CC: YCC->RGB SAMP: h2v1 merged IDCT: ifast ENT: huff |
| 553 | add_test(djpeg${suffix}-422m-ifast |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 554 | ${dir}djpeg${suffix} -dct fast -nosmooth |
| 555 | -outfile testout_422m_ifast.ppm testout_422_ifast_opt.jpg) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 556 | add_test(djpeg${suffix}-422m-ifast-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 557 | ${MD5CMP} ${MD5_PPM_422M_IFAST} testout_422m_ifast.ppm) |
| 558 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 559 | if(NOT WITH_12BIT) |
| 560 | # CC: YCC->RGB565 SAMP: h2v1 merged IDCT: ifast ENT: huff |
| 561 | add_test(djpeg${suffix}-422m-ifast-565 |
| 562 | ${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -dither none -bmp |
| 563 | -outfile testout_422m_ifast_565.bmp testout_422_ifast_opt.jpg) |
| 564 | add_test(djpeg${suffix}-422m-ifast-565-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 565 | ${MD5CMP} ${MD5_BMP_422M_IFAST_565} testout_422m_ifast_565.bmp) |
| 566 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 567 | # CC: YCC->RGB565 (dithered) SAMP: h2v1 merged IDCT: ifast ENT: huff |
| 568 | add_test(djpeg${suffix}-422m-ifast-565D |
| 569 | ${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -bmp |
| 570 | -outfile testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg) |
| 571 | add_test(djpeg${suffix}-422m-ifast-565D-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 572 | ${MD5CMP} ${MD5_BMP_422M_IFAST_565D} testout_422m_ifast_565D.bmp) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 573 | endif() |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 574 | |
| 575 | # CC: RGB->YCC SAMP: fullsize/h2v2 FDCT: ifast ENT: prog huff |
| 576 | add_test(cjpeg${suffix}-420-q100-ifast-prog |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 577 | ${dir}cjpeg${suffix} -sample 2x2 -quality 100 -dct fast -prog |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 578 | -outfile testout_420_q100_ifast_prog.jpg ${TESTIMAGES}/testorig.ppm) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 579 | add_test(cjpeg${suffix}-420-q100-ifast-prog-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 580 | ${MD5CMP} ${MD5_JPEG_420_IFAST_Q100_PROG} testout_420_q100_ifast_prog.jpg) |
| 581 | |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 582 | # CC: YCC->RGB SAMP: fullsize/h2v2 fancy IDCT: ifast ENT: prog huff |
| 583 | add_test(djpeg${suffix}-420-q100-ifast-prog |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 584 | ${dir}djpeg${suffix} -dct fast |
| 585 | -outfile testout_420_q100_ifast.ppm testout_420_q100_ifast_prog.jpg) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 586 | add_test(djpeg${suffix}-420-q100-ifast-prog-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 587 | ${MD5CMP} ${MD5_PPM_420_Q100_IFAST} testout_420_q100_ifast.ppm) |
| 588 | |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 589 | # CC: YCC->RGB SAMP: h2v2 merged IDCT: ifast ENT: prog huff |
| 590 | add_test(djpeg${suffix}-420m-q100-ifast-prog |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 591 | ${dir}djpeg${suffix} -dct fast -nosmooth |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 592 | -outfile testout_420m_q100_ifast.ppm testout_420_q100_ifast_prog.jpg) |
| 593 | add_test(djpeg${suffix}-420m-q100-ifast-prog-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 594 | ${MD5CMP} ${MD5_PPM_420M_Q100_IFAST} testout_420m_q100_ifast.ppm) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 595 | |
| 596 | # CC: RGB->Gray SAMP: fullsize FDCT: islow ENT: huff |
| 597 | add_test(cjpeg${suffix}-gray-islow |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 598 | ${dir}cjpeg${suffix} -gray -dct int |
| 599 | -outfile testout_gray_islow.jpg ${TESTIMAGES}/testorig.ppm) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 600 | add_test(cjpeg${suffix}-gray-islow-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 601 | ${MD5CMP} ${MD5_JPEG_GRAY_ISLOW} testout_gray_islow.jpg) |
| 602 | |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 603 | # CC: Gray->Gray SAMP: fullsize IDCT: islow ENT: huff |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 604 | add_test(djpeg${suffix}-gray-islow |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 605 | ${dir}djpeg${suffix} -dct int |
| 606 | -outfile testout_gray_islow.ppm testout_gray_islow.jpg) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 607 | add_test(djpeg${suffix}-gray-islow-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 608 | ${MD5CMP} ${MD5_PPM_GRAY_ISLOW} testout_gray_islow.ppm) |
| 609 | |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 610 | # CC: Gray->RGB SAMP: fullsize IDCT: islow ENT: huff |
| 611 | add_test(djpeg${suffix}-gray-islow-rgb |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 612 | ${dir}djpeg${suffix} -dct int -rgb |
| 613 | -outfile testout_gray_islow_rgb.ppm testout_gray_islow.jpg) |
DRC | 4c773cf | 2014-12-08 23:23:41 +0000 | [diff] [blame] | 614 | add_test(djpeg${suffix}-gray-islow-rgb-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 615 | ${MD5CMP} ${MD5_PPM_GRAY_ISLOW_RGB} testout_gray_islow_rgb.ppm) |
| 616 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 617 | if(NOT WITH_12BIT) |
| 618 | # CC: Gray->RGB565 SAMP: fullsize IDCT: islow ENT: huff |
| 619 | add_test(djpeg${suffix}-gray-islow-565 |
| 620 | ${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp |
| 621 | -outfile testout_gray_islow_565.bmp testout_gray_islow.jpg) |
| 622 | add_test(djpeg${suffix}-gray-islow-565-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 623 | ${MD5CMP} ${MD5_BMP_GRAY_ISLOW_565} testout_gray_islow_565.bmp) |
| 624 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 625 | # CC: Gray->RGB565 (dithered) SAMP: fullsize IDCT: islow ENT: huff |
| 626 | add_test(djpeg${suffix}-gray-islow-565D |
| 627 | ${dir}djpeg${suffix} -dct int -rgb565 -bmp |
| 628 | -outfile testout_gray_islow_565D.bmp testout_gray_islow.jpg) |
| 629 | add_test(djpeg${suffix}-gray-islow-565D-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 630 | ${MD5CMP} ${MD5_BMP_GRAY_ISLOW_565D} testout_gray_islow_565D.bmp) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 631 | endif() |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 632 | |
| 633 | # CC: RGB->YCC SAMP: fullsize smooth/h2v2 smooth FDCT: islow |
| 634 | # ENT: 2-pass huff |
| 635 | add_test(cjpeg${suffix}-420s-ifast-opt |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 636 | ${dir}cjpeg${suffix} -sample 2x2 -smooth 1 -dct int -opt |
| 637 | -outfile testout_420s_ifast_opt.jpg ${TESTIMAGES}/testorig.ppm) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 638 | add_test(cjpeg${suffix}-420s-ifast-opt-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 639 | ${MD5CMP} ${MD5_JPEG_420S_IFAST_OPT} testout_420s_ifast_opt.jpg) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 640 | |
| 641 | # CC: RGB->YCC SAMP: fullsize/int FDCT: float ENT: prog huff |
| 642 | add_test(cjpeg${suffix}-3x2-float-prog |
| 643 | ${dir}cjpeg${suffix} -sample 3x2 -dct float -prog |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 644 | -outfile testout_3x2_float_prog.jpg ${TESTIMAGES}/testorig.ppm) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 645 | add_test(cjpeg${suffix}-3x2-float-prog-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 646 | ${MD5CMP} ${MD5_JPEG_3x2_FLOAT_PROG} testout_3x2_float_prog.jpg) |
| 647 | |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 648 | # CC: YCC->RGB SAMP: fullsize/int IDCT: float ENT: prog huff |
| 649 | add_test(djpeg${suffix}-3x2-float-prog |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 650 | ${dir}djpeg${suffix} -dct float |
| 651 | -outfile testout_3x2_float.ppm testout_3x2_float_prog.jpg) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 652 | add_test(djpeg${suffix}-3x2-float-prog-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 653 | ${MD5CMP} ${MD5_PPM_3x2_FLOAT} testout_3x2_float.ppm) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 654 | |
| 655 | if(WITH_ARITH_ENC) |
| 656 | # CC: YCC->RGB SAMP: fullsize/h2v2 FDCT: islow ENT: arith |
| 657 | add_test(cjpeg${suffix}-420-islow-ari |
| 658 | ${dir}cjpeg${suffix} -dct int -arithmetic |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 659 | -outfile testout_420_islow_ari.jpg ${TESTIMAGES}/testorig.ppm) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 660 | add_test(cjpeg${suffix}-420-islow-ari-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 661 | ${MD5CMP} ${MD5_JPEG_420_ISLOW_ARI} testout_420_islow_ari.jpg) |
| 662 | |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 663 | add_test(jpegtran${suffix}-420-islow-ari |
| 664 | ${dir}jpegtran${suffix} -arithmetic |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 665 | -outfile testout_420_islow_ari.jpg ${TESTIMAGES}/testimgint.jpg) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 666 | add_test(jpegtran${suffix}-420-islow-ari-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 667 | ${MD5CMP} ${MD5_JPEG_420_ISLOW_ARI} testout_420_islow_ari.jpg) |
| 668 | |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 669 | # CC: YCC->RGB SAMP: fullsize FDCT: islow ENT: prog arith |
| 670 | add_test(cjpeg${suffix}-444-islow-progari |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 671 | ${dir}cjpeg${suffix} -sample 1x1 -dct int -prog -arithmetic |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 672 | -outfile testout_444_islow_progari.jpg ${TESTIMAGES}/testorig.ppm) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 673 | add_test(cjpeg${suffix}-444-islow-progari-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 674 | ${MD5CMP} ${MD5_JPEG_444_ISLOW_PROGARI} testout_444_islow_progari.jpg) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 675 | endif() |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 676 | |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 677 | if(WITH_ARITH_DEC) |
| 678 | # CC: RGB->YCC SAMP: h2v2 merged IDCT: ifast ENT: arith |
DRC | 4c773cf | 2014-12-08 23:23:41 +0000 | [diff] [blame] | 679 | add_test(djpeg${suffix}-420m-ifast-ari |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 680 | ${dir}djpeg${suffix} -fast -ppm |
| 681 | -outfile testout_420m_ifast_ari.ppm ${TESTIMAGES}/testimgari.jpg) |
DRC | 4c773cf | 2014-12-08 23:23:41 +0000 | [diff] [blame] | 682 | add_test(djpeg${suffix}-420m-ifast-ari-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 683 | ${MD5CMP} ${MD5_PPM_420M_IFAST_ARI} testout_420m_ifast_ari.ppm) |
| 684 | |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 685 | add_test(jpegtran${suffix}-420-islow |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 686 | ${dir}jpegtran${suffix} |
| 687 | -outfile testout_420_islow.jpg ${TESTIMAGES}/testimgari.jpg) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 688 | add_test(jpegtran${suffix}-420-islow-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 689 | ${MD5CMP} ${MD5_JPEG_420_ISLOW} testout_420_islow.jpg) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 690 | endif() |
| 691 | |
| 692 | # 2/1-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 16x16 islow ENT: huff |
| 693 | # 15/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 15x15 islow ENT: huff |
| 694 | # 13/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 13x13 islow ENT: huff |
| 695 | # 11/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 11x11 islow ENT: huff |
| 696 | # 9/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 9x9 islow ENT: huff |
| 697 | # 7/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 7x7 islow/14x14 islow |
| 698 | # ENT: huff |
| 699 | # 3/4-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 6x6 islow/12x12 islow |
| 700 | # ENT: huff |
| 701 | # 5/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 5x5 islow/10x10 islow |
| 702 | # ENT: huff |
| 703 | # 1/2-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 4x4 islow/8x8 islow |
| 704 | # ENT: huff |
| 705 | # 3/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 3x3 islow/6x6 islow |
| 706 | # ENT: huff |
| 707 | # 1/4-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 2x2 islow/4x4 islow |
| 708 | # ENT: huff |
| 709 | # 1/8-- CC: YCC->RGB SAMP: h2v2 merged IDCT: 1x1 islow/2x2 islow |
| 710 | # ENT: huff |
| 711 | foreach(scale 2_1 15_8 13_8 11_8 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8) |
| 712 | string(REGEX REPLACE "_" "/" scalearg ${scale}) |
| 713 | add_test(djpeg${suffix}-420m-islow-${scale} |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 714 | ${dir}djpeg${suffix} -dct int -scale ${scalearg} -nosmooth -ppm |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 715 | -outfile testout_420m_islow_${scale}.ppm ${TESTIMAGES}/${TESTORIG}) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 716 | add_test(djpeg${suffix}-420m-islow-${scale}-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 717 | ${MD5CMP} ${MD5_PPM_420M_ISLOW_${scale}} testout_420m_islow_${scale}.ppm) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 718 | endforeach() |
| 719 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 720 | if(NOT WITH_12BIT) |
| 721 | # CC: YCC->RGB (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff |
| 722 | add_test(djpeg${suffix}-420-islow-256 |
| 723 | ${dir}djpeg${suffix} -dct int -colors 256 -bmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 724 | -outfile testout_420_islow_256.bmp ${TESTIMAGES}/${TESTORIG}) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 725 | add_test(djpeg${suffix}-420-islow-256-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 726 | ${MD5CMP} ${MD5_BMP_420_ISLOW_256} testout_420_islow_256.bmp) |
| 727 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 728 | # CC: YCC->RGB565 SAMP: h2v2 fancy IDCT: islow ENT: huff |
| 729 | add_test(djpeg${suffix}-420-islow-565 |
| 730 | ${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 731 | -outfile testout_420_islow_565.bmp ${TESTIMAGES}/${TESTORIG}) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 732 | add_test(djpeg${suffix}-420-islow-565-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 733 | ${MD5CMP} ${MD5_BMP_420_ISLOW_565} testout_420_islow_565.bmp) |
| 734 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 735 | # CC: YCC->RGB565 (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff |
| 736 | add_test(djpeg${suffix}-420-islow-565D |
| 737 | ${dir}djpeg${suffix} -dct int -rgb565 -bmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 738 | -outfile testout_420_islow_565D.bmp ${TESTIMAGES}/${TESTORIG}) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 739 | add_test(djpeg${suffix}-420-islow-565D-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 740 | ${MD5CMP} ${MD5_BMP_420_ISLOW_565D} testout_420_islow_565D.bmp) |
| 741 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 742 | # CC: YCC->RGB565 SAMP: h2v2 merged IDCT: islow ENT: huff |
| 743 | add_test(djpeg${suffix}-420m-islow-565 |
| 744 | ${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -dither none -bmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 745 | -outfile testout_420m_islow_565.bmp ${TESTIMAGES}/${TESTORIG}) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 746 | add_test(djpeg${suffix}-420m-islow-565-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 747 | ${MD5CMP} ${MD5_BMP_420M_ISLOW_565} testout_420m_islow_565.bmp) |
| 748 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 749 | # CC: YCC->RGB565 (dithered) SAMP: h2v2 merged IDCT: islow ENT: huff |
| 750 | add_test(djpeg${suffix}-420m-islow-565D |
| 751 | ${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -bmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 752 | -outfile testout_420m_islow_565D.bmp ${TESTIMAGES}/${TESTORIG}) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 753 | add_test(djpeg${suffix}-420m-islow-565D-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 754 | ${MD5CMP} ${MD5_BMP_420M_ISLOW_565D} testout_420m_islow_565D.bmp) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 755 | endif() |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 756 | |
| 757 | # Partial decode tests. These tests are designed to cover all of the |
| 758 | # possible code paths in jpeg_skip_scanlines(). |
| 759 | |
| 760 | # Context rows: Yes Intra-iMCU row: Yes iMCU row prefetch: No ENT: huff |
| 761 | add_test(djpeg${suffix}-420-islow-skip15_31 |
| 762 | ${dir}djpeg${suffix} -dct int -skip 15,31 -ppm |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 763 | -outfile testout_420_islow_skip15,31.ppm ${TESTIMAGES}/${TESTORIG}) |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 764 | add_test(djpeg${suffix}-420-islow-skip15_31-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 765 | ${MD5CMP} ${MD5_PPM_420_ISLOW_SKIP15_31} testout_420_islow_skip15,31.ppm) |
| 766 | |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 767 | # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: Yes ENT: arith |
| 768 | if(WITH_ARITH_DEC) |
| 769 | add_test(djpeg${suffix}-420-islow-ari-skip16_139 |
| 770 | ${dir}djpeg${suffix} -dct int -skip 16,139 -ppm |
| 771 | -outfile testout_420_islow_ari_skip16,139.ppm |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 772 | ${TESTIMAGES}/testimgari.jpg) |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 773 | add_test(djpeg${suffix}-420-islow-ari_skip16_139-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 774 | ${MD5CMP} ${MD5_PPM_420_ISLOW_ARI_SKIP16_139} |
| 775 | testout_420_islow_ari_skip16,139.ppm) |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 776 | endif() |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 777 | |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 778 | # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: prog huff |
| 779 | add_test(cjpeg${suffix}-420-islow-prog |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 780 | ${dir}cjpeg${suffix} -dct int -prog |
| 781 | -outfile testout_420_islow_prog.jpg ${TESTIMAGES}/testorig.ppm) |
DRC | 3ab68cf | 2016-02-19 18:32:10 -0600 | [diff] [blame] | 782 | add_test(djpeg${suffix}-420-islow-prog-crop62x62_71_71 |
| 783 | ${dir}djpeg${suffix} -dct int -crop 62x62+71+71 -ppm |
| 784 | -outfile testout_420_islow_prog_crop62x62,71,71.ppm |
| 785 | testout_420_islow_prog.jpg) |
| 786 | add_test(djpeg${suffix}-420-islow-prog-crop62x62_71_71-cmp |
| 787 | ${MD5CMP} ${MD5_PPM_420_ISLOW_PROG_CROP62x62_71_71} |
| 788 | testout_420_islow_prog_crop62x62,71,71.ppm) |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 789 | |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 790 | # Context rows: Yes Intra-iMCU row: No iMCU row prefetch: No ENT: arith |
| 791 | if(WITH_ARITH_DEC) |
DRC | 3ab68cf | 2016-02-19 18:32:10 -0600 | [diff] [blame] | 792 | add_test(djpeg${suffix}-420-islow-ari-crop53x53_4_4 |
| 793 | ${dir}djpeg${suffix} -dct int -crop 53x53+4+4 -ppm |
| 794 | -outfile testout_420_islow_ari_crop53x53,4,4.ppm |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 795 | ${TESTIMAGES}/testimgari.jpg) |
DRC | 3ab68cf | 2016-02-19 18:32:10 -0600 | [diff] [blame] | 796 | add_test(djpeg${suffix}-420-islow-ari-crop53x53_4_4-cmp |
| 797 | ${MD5CMP} ${MD5_PPM_420_ISLOW_ARI_CROP53x53_4_4} |
| 798 | testout_420_islow_ari_crop53x53,4,4.ppm) |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 799 | endif() |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 800 | |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 801 | # Context rows: No Intra-iMCU row: Yes ENT: huff |
| 802 | add_test(cjpeg${suffix}-444-islow |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 803 | ${dir}cjpeg${suffix} -dct int -sample 1x1 |
| 804 | -outfile testout_444_islow.jpg ${TESTIMAGES}/testorig.ppm) |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 805 | add_test(djpeg${suffix}-444-islow-skip1_6 |
| 806 | ${dir}djpeg${suffix} -dct int -skip 1,6 -ppm |
| 807 | -outfile testout_444_islow_skip1,6.ppm testout_444_islow.jpg) |
| 808 | add_test(djpeg${suffix}-444-islow-skip1_6-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 809 | ${MD5CMP} ${MD5_PPM_444_ISLOW_SKIP1_6} testout_444_islow_skip1,6.ppm) |
| 810 | |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 811 | # Context rows: No Intra-iMCU row: No ENT: prog huff |
| 812 | add_test(cjpeg${suffix}-444-islow-prog |
| 813 | ${dir}cjpeg${suffix} -dct int -prog -sample 1x1 |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 814 | -outfile testout_444_islow_prog.jpg ${TESTIMAGES}/testorig.ppm) |
DRC | 3ab68cf | 2016-02-19 18:32:10 -0600 | [diff] [blame] | 815 | add_test(djpeg${suffix}-444-islow-prog-crop98x98_13_13 |
| 816 | ${dir}djpeg${suffix} -dct int -crop 98x98+13+13 -ppm |
| 817 | -outfile testout_444_islow_prog_crop98x98,13,13.ppm |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 818 | testout_444_islow_prog.jpg) |
DRC | 3ab68cf | 2016-02-19 18:32:10 -0600 | [diff] [blame] | 819 | add_test(djpeg${suffix}-444-islow-prog_crop98x98_13_13-cmp |
| 820 | ${MD5CMP} ${MD5_PPM_444_ISLOW_PROG_CROP98x98_13_13} |
| 821 | testout_444_islow_prog_crop98x98,13,13.ppm) |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 822 | |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 823 | # Context rows: No Intra-iMCU row: No ENT: arith |
| 824 | if(WITH_ARITH_ENC) |
| 825 | add_test(cjpeg${suffix}-444-islow-ari |
| 826 | ${dir}cjpeg${suffix} -dct int -arithmetic -sample 1x1 |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 827 | -outfile testout_444_islow_ari.jpg ${TESTIMAGES}/testorig.ppm) |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 828 | if(WITH_ARITH_DEC) |
DRC | 3ab68cf | 2016-02-19 18:32:10 -0600 | [diff] [blame] | 829 | add_test(djpeg${suffix}-444-islow-ari-crop37x37_0_0 |
| 830 | ${dir}djpeg${suffix} -dct int -crop 37x37+0+0 -ppm |
| 831 | -outfile testout_444_islow_ari_crop37x37,0,0.ppm |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 832 | testout_444_islow_ari.jpg) |
DRC | 3ab68cf | 2016-02-19 18:32:10 -0600 | [diff] [blame] | 833 | add_test(djpeg${suffix}-444-islow-ari-crop37x37_0_0-cmp |
| 834 | ${MD5CMP} ${MD5_PPM_444_ISLOW_ARI_CROP37x37_0_0} |
| 835 | testout_444_islow_ari_crop37x37,0,0.ppm) |
DRC | 7a7da94 | 2015-06-27 08:10:31 +0000 | [diff] [blame] | 836 | endif() |
| 837 | endif() |
| 838 | |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 839 | add_test(jpegtran${suffix}-crop |
| 840 | ${dir}jpegtran${suffix} -crop 120x90+20+50 -transpose -perfect |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 841 | -outfile testout_crop.jpg ${TESTIMAGES}/${TESTORIG}) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 842 | add_test(jpegtran${suffix}-crop-cmp |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 843 | ${MD5CMP} ${MD5_JPEG_CROP} testout_crop.jpg) |
DRC | 35db75e | 2014-05-06 22:44:46 +0000 | [diff] [blame] | 844 | |
DRC | 0af8d67 | 2012-01-31 11:09:11 +0000 | [diff] [blame] | 845 | endforeach() |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 846 | |
DRC | f913438 | 2016-02-06 14:09:20 -0600 | [diff] [blame] | 847 | add_custom_target(testclean COMMAND ${MD5CMP} -P |
DRC | a0f878a | 2011-04-02 04:43:14 +0000 | [diff] [blame] | 848 | ${CMAKE_SOURCE_DIR}/cmakescripts/testclean.cmake) |
| 849 | |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 850 | |
| 851 | # |
| 852 | # Installer |
| 853 | # |
| 854 | |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 855 | if(MSVC) |
| 856 | set(INST_PLATFORM "Visual C++") |
DRC | b94f2de | 2011-03-22 09:31:25 +0000 | [diff] [blame] | 857 | set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-vc) |
DRC | 7175e51 | 2013-04-23 22:29:00 +0000 | [diff] [blame] | 858 | set(INST_REG_NAME ${CMAKE_PROJECT_NAME}) |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 859 | elseif(MINGW) |
| 860 | set(INST_PLATFORM GCC) |
DRC | b94f2de | 2011-03-22 09:31:25 +0000 | [diff] [blame] | 861 | set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-gcc) |
DRC | 7175e51 | 2013-04-23 22:29:00 +0000 | [diff] [blame] | 862 | set(INST_REG_NAME ${CMAKE_PROJECT_NAME}-gcc) |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 863 | set(INST_DEFS -DGCC) |
| 864 | endif() |
| 865 | |
| 866 | if(64BIT) |
| 867 | set(INST_PLATFORM "${INST_PLATFORM} 64-bit") |
| 868 | set(INST_NAME ${INST_NAME}64) |
DRC | 7175e51 | 2013-04-23 22:29:00 +0000 | [diff] [blame] | 869 | set(INST_REG_NAME ${INST_DIR}64) |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 870 | set(INST_DEFS ${INST_DEFS} -DWIN64) |
| 871 | endif() |
| 872 | |
DRC | 957d623 | 2011-04-01 11:13:11 +0000 | [diff] [blame] | 873 | if(WITH_JAVA) |
| 874 | set(INST_DEFS ${INST_DEFS} -DJAVA) |
| 875 | endif() |
| 876 | |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 877 | if(MSVC_IDE) |
DRC | 926e01f | 2011-04-06 06:35:38 +0000 | [diff] [blame] | 878 | set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=${CMAKE_CFG_INTDIR}\\") |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 879 | else() |
| 880 | set(INST_DEFS ${INST_DEFS} "-DBUILDDIR=") |
| 881 | endif() |
| 882 | |
DRC | 9fe22da | 2014-04-16 23:30:38 +0000 | [diff] [blame] | 883 | STRING(REGEX REPLACE "/" "\\\\" INST_DIR ${CMAKE_INSTALL_PREFIX}) |
DRC | 7175e51 | 2013-04-23 22:29:00 +0000 | [diff] [blame] | 884 | |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 885 | configure_file(release/libjpeg-turbo.nsi.in libjpeg-turbo.nsi @ONLY) |
| 886 | |
DRC | 7175e51 | 2013-04-23 22:29:00 +0000 | [diff] [blame] | 887 | if(WITH_JAVA) |
| 888 | set(JAVA_DEPEND java) |
| 889 | endif() |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 890 | add_custom_target(installer |
| 891 | makensis -nocd ${INST_DEFS} libjpeg-turbo.nsi |
DRC | b94f2de | 2011-03-22 09:31:25 +0000 | [diff] [blame] | 892 | DEPENDS jpeg jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom |
DRC | 7175e51 | 2013-04-23 22:29:00 +0000 | [diff] [blame] | 893 | cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND} |
DRC | 2c0a4e1 | 2010-10-16 08:51:43 +0000 | [diff] [blame] | 894 | SOURCES libjpeg-turbo.nsi) |
DRC | 7284c9a | 2010-10-16 21:55:14 +0000 | [diff] [blame] | 895 | |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 896 | if(WITH_TURBOJPEG) |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 897 | if(ENABLE_SHARED) |
| 898 | install(TARGETS turbojpeg tjbench |
| 899 | ARCHIVE DESTINATION lib |
| 900 | LIBRARY DESTINATION lib |
| 901 | RUNTIME DESTINATION bin) |
| 902 | endif() |
| 903 | if(ENABLE_STATIC) |
| 904 | install(TARGETS turbojpeg-static ARCHIVE DESTINATION lib) |
| 905 | if(NOT ENABLE_SHARED) |
| 906 | install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/tjbench-static.exe |
| 907 | DESTINATION bin RENAME tjbench.exe) |
| 908 | endif() |
| 909 | endif() |
| 910 | install(FILES ${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include) |
DRC | aee4f72 | 2014-08-09 23:06:07 +0000 | [diff] [blame] | 911 | endif() |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 912 | |
| 913 | if(ENABLE_STATIC) |
| 914 | install(TARGETS jpeg-static ARCHIVE DESTINATION lib) |
| 915 | if(NOT ENABLE_SHARED) |
| 916 | install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cjpeg-static.exe |
| 917 | DESTINATION bin RENAME cjpeg.exe) |
| 918 | install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/djpeg-static.exe |
| 919 | DESTINATION bin RENAME djpeg.exe) |
| 920 | install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/jpegtran-static.exe |
| 921 | DESTINATION bin RENAME jpegtran.exe) |
| 922 | endif() |
| 923 | endif() |
| 924 | |
| 925 | install(TARGETS rdjpgcom wrjpgcom RUNTIME DESTINATION bin) |
DRC | 7284c9a | 2010-10-16 21:55:14 +0000 | [diff] [blame] | 926 | |
DRC | 7e3acc0 | 2015-10-10 10:25:46 -0500 | [diff] [blame] | 927 | install(FILES ${CMAKE_SOURCE_DIR}/README.ijg ${CMAKE_SOURCE_DIR}/README.md |
DRC | 9fe22da | 2014-04-16 23:30:38 +0000 | [diff] [blame] | 928 | ${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt |
DRC | a1647c8 | 2012-02-10 00:39:05 +0000 | [diff] [blame] | 929 | ${CMAKE_SOURCE_DIR}/structure.txt ${CMAKE_SOURCE_DIR}/usage.txt |
| 930 | ${CMAKE_SOURCE_DIR}/wizard.txt |
DRC | 7284c9a | 2010-10-16 21:55:14 +0000 | [diff] [blame] | 931 | DESTINATION doc) |
DRC | e2befde | 2010-10-17 07:28:08 +0000 | [diff] [blame] | 932 | |
| 933 | install(FILES ${CMAKE_BINARY_DIR}/jconfig.h ${CMAKE_SOURCE_DIR}/jerror.h |
| 934 | ${CMAKE_SOURCE_DIR}/jmorecfg.h ${CMAKE_SOURCE_DIR}/jpeglib.h |
DRC | 665c96e | 2015-05-15 22:08:21 +0000 | [diff] [blame] | 935 | DESTINATION include) |