CMakeLists.txt 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  1. # CONFORMANCE TESTS AND NON-REGRESSION ON THIS DATASET
  2. file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Temporary)
  3. set(TEMP ${CMAKE_CURRENT_BINARY_DIR}/Temporary)
  4. set(BASELINE_CONF ${OPJ_DATA_ROOT}/baseline/conformance)
  5. set(BASELINE_NR ${OPJ_DATA_ROOT}/baseline/nonregression)
  6. set(INPUT_CONF ${OPJ_DATA_ROOT}/input/conformance)
  7. # List of components by file (normally p0_13.j2k have 257 components but for this
  8. #set of test we consider only 4)
  9. set( CP0_nbC_list "not_used;1;1;1;3;4;4;3;3;1;3;1;1;4;3;1;1")
  10. set( CP1_nbC_list "not_used;1;3;4;1;3;3;2")
  11. set(COMMENTCODEVAR FALSE)
  12. ##--------------------------------------------------------------------------
  13. ## Tests about class 0 profile 0
  14. ## try to decode
  15. ## compare to ref file provided by the Executable Test Suite
  16. ## non regression comparison
  17. ## Parameters and tolerances given by Table C.1
  18. #set( C0P0_ResFactor_list "not_used;0;0;0;3;3;3;0;5;2;0;0;0;0;2;0;0")
  19. #set( C0P0_PEAK_list "not_used;0;0;0;33;54;109;10;7;4;10;0;0;0;0;0;0")
  20. #set( C0P0_MSE_list "not_used;0;0;0;55.8;68;743;0.34;6.72;1.47;2.84;0;0;0;0;0;0")
  21. #foreach(numFileC0P0 RANGE 1 16)
  22. # # Build filenames
  23. # if(${numFileC0P0} LESS 10)
  24. # set( filenameInput p0_0${numFileC0P0}.j2k )
  25. # set( filenameRef c0p0_0${numFileC0P0}.pgx )
  26. # else()
  27. # set( filenameInput p0_${numFileC0P0}.j2k )
  28. # set( filenameRef c0p0_${numFileC0P0}.pgx )
  29. # endif()
  30. # # Get corresponding tests parameters
  31. # list(GET C0P0_ResFactor_list ${numFileC0P0} ResFactor)
  32. # #For Class-0 testing, we always focus on the first component only
  33. # #list(GET CP0_nbC_list ${numFileC0P0} nbComponents)
  34. # set( nbComponents "1")
  35. # list(GET C0P0_PEAK_list ${numFileC0P0} PEAK_limit)
  36. # list(GET C0P0_MSE_list ${numFileC0P0} MSE_limit)
  37. # # Manage cases which need to try different resolution reduction
  38. # if (numFileC0P0 EQUAL 3 OR numFileC0P0 EQUAL 15)
  39. # get_filename_component(filenameRefSub ${filenameRef} NAME_WE)
  40. # #r = 0
  41. # add_test(ETS-C0P0-${filenameInput}-r0-decode
  42. # ${EXECUTABLE_OUTPUT_PATH}/opj_decompress
  43. # -i ${INPUT_CONF}/${filenameInput}
  44. # -o ${TEMP}/c0${filenameInput}-r0.pgx
  45. # -r 0
  46. # )
  47. # add_test(ETS-C0P0-${filenameInput}-r0-compare2ref
  48. # ${EXECUTABLE_OUTPUT_PATH}/compare_images
  49. # -b ${BASELINE_CONF}/${filenameRefSub}r0.pgx
  50. # -t ${TEMP}/c0${filenameInput}-r0.pgx
  51. # -n ${nbComponents}
  52. # -p ${PEAK_limit}
  53. # -m ${MSE_limit}
  54. # -s t_
  55. # )
  56. # set_tests_properties(ETS-C0P0-${filenameInput}-r0-compare2ref
  57. # PROPERTIES DEPENDS
  58. # ETS-C0P0-${filenameInput}-r0-decode)
  59. # add_test(NR-C0P0-${filenameInput}-r0-compare2base
  60. # ${EXECUTABLE_OUTPUT_PATH}/compare_images
  61. # -b ${BASELINE_NR}/opj_${filenameRefSub}-r0.pgx
  62. # -t ${TEMP}/c0${filenameInput}-r0.pgx
  63. # -n ${nbComponents}
  64. # -d
  65. # -s b_t_
  66. # )
  67. # set_tests_properties(NR-C0P0-${filenameInput}-r0-compare2base
  68. # PROPERTIES DEPENDS
  69. # ETS-C0P0-${filenameInput}-r0-decode)
  70. # #r = 1
  71. # add_test(ETS-C0P0-${filenameInput}-r1-decode
  72. # ${EXECUTABLE_OUTPUT_PATH}/opj_decompress
  73. # -i ${INPUT_CONF}/${filenameInput}
  74. # -o ${TEMP}/c0${filenameInput}-r1.pgx
  75. # -r 1
  76. # )
  77. # add_test(ETS-C0P0-${filenameInput}-r1-compare2ref
  78. # ${EXECUTABLE_OUTPUT_PATH}/compare_images
  79. # -b ${BASELINE_CONF}/${filenameRefSub}r1.pgx
  80. # -t ${TEMP}/c0${filenameInput}-r1.pgx
  81. # -n ${nbComponents}
  82. # -p ${PEAK_limit}
  83. # -m ${MSE_limit}
  84. # -s t_
  85. # )
  86. # set_tests_properties(ETS-C0P0-${filenameInput}-r1-compare2ref
  87. # PROPERTIES DEPENDS
  88. # ETS-C0P0-${filenameInput}-r1-decode)
  89. # add_test(NR-C0P0-${filenameInput}-r1-compare2base
  90. # ${EXECUTABLE_OUTPUT_PATH}/compare_images
  91. # -b ${BASELINE_NR}/opj_${filenameRefSub}-r1.pgx
  92. # -t ${TEMP}/c0${filenameInput}-r1.pgx
  93. # -n ${nbComponents}
  94. # -d
  95. # -s b_t_
  96. # )
  97. # set_tests_properties(NR-C0P0-${filenameInput}-r1-compare2base
  98. # PROPERTIES DEPENDS
  99. # ETS-C0P0-${filenameInput}-r1-decode)
  100. # else()
  101. # add_test(ETS-C0P0-${filenameInput}-decode
  102. # ${EXECUTABLE_OUTPUT_PATH}/opj_decompress
  103. # -i ${INPUT_CONF}/${filenameInput}
  104. # -o ${TEMP}/c0${filenameInput}.pgx
  105. # -r ${ResFactor}
  106. # )
  107. # add_test(ETS-C0P0-${filenameInput}-compare2ref
  108. # ${EXECUTABLE_OUTPUT_PATH}/compare_images
  109. # -b ${BASELINE_CONF}/${filenameRef}
  110. # -t ${TEMP}/c0${filenameInput}.pgx
  111. # -n ${nbComponents}
  112. # -p ${PEAK_limit}
  113. # -m ${MSE_limit}
  114. # -s t_
  115. # )
  116. # set_tests_properties(ETS-C0P0-${filenameInput}-compare2ref
  117. # PROPERTIES DEPENDS
  118. # ETS-C0P0-${filenameInput}-decode)
  119. # add_test(NR-C0P0-${filenameInput}-compare2base
  120. # ${EXECUTABLE_OUTPUT_PATH}/compare_images
  121. # -b ${BASELINE_NR}/opj_${filenameRef}
  122. # -t ${TEMP}/c0${filenameInput}.pgx
  123. # -n ${nbComponents}
  124. # -d
  125. # -s b_t_
  126. # )
  127. # set_tests_properties(NR-C0P0-${filenameInput}-compare2base
  128. # PROPERTIES DEPENDS
  129. # ETS-C0P0-${filenameInput}-decode)
  130. # endif()
  131. #endforeach()
  132. ##--------------------------------------------------------------------------
  133. ## Tests about class 0 profile 1
  134. ## try to decode
  135. ## compare to ref file
  136. ## non regression comparison
  137. ## Parameters and tolerances given by Table C.4
  138. #set( C0P1_ResFactor_list "not_used;0;3;3;0;4;1;0")
  139. #set( C0P1_PEAK_list "not_used;0;35;28;2;128;128;0")
  140. #set( C0P1_MSE_list "not_used;0;74;18.8;0.550;16384;16384;0")
  141. #foreach(numFileC0P1 RANGE 1 7)
  142. # # Build filenames
  143. # set( filenameInput p1_0${numFileC0P1}.j2k )
  144. # set( filenameRef c0p1_0${numFileC0P1}.pgx )
  145. # # Get corresponding tests parameters
  146. # list(GET C0P1_ResFactor_list ${numFileC0P1} ResFactor)
  147. # #For Class-0 testing, we always focus on the first component only
  148. # #list(GET CP0_nbC_list ${numFileC0P0} nbComponents)
  149. # set( nbComponents "1")
  150. # list(GET C0P1_PEAK_list ${numFileC0P1} PEAK_limit)
  151. # list(GET C0P1_MSE_list ${numFileC0P1} MSE_limit)
  152. # # Manage cases which need to try different resolution reduction
  153. # if (numFileC0P1 EQUAL 4 )
  154. # get_filename_component(filenameRefSub ${filenameRef} NAME_WE)
  155. # #r = 0
  156. # add_test(ETS-C0P1-${filenameInput}-r0-decode
  157. # ${EXECUTABLE_OUTPUT_PATH}/opj_decompress
  158. # -i ${INPUT_CONF}/${filenameInput}
  159. # -o ${TEMP}/c0${filenameInput}-r0.pgx
  160. # -r 0
  161. # )
  162. # add_test(ETS-C0P1-${filenameInput}-r0-compare2ref
  163. # ${EXECUTABLE_OUTPUT_PATH}/compare_images
  164. # -b ${BASELINE_CONF}/${filenameRefSub}r0.pgx
  165. # -t ${TEMP}/c0${filenameInput}-r0.pgx
  166. # -n ${nbComponents}
  167. # -p ${PEAK_limit}
  168. # -m ${MSE_limit}
  169. # -s t_
  170. # )
  171. # set_tests_properties(ETS-C0P1-${filenameInput}-r0-compare2ref
  172. # PROPERTIES DEPENDS
  173. # ETS-C0P1-${filenameInput}-r0-decode)
  174. # add_test(NR-C0P1-${filenameInput}-r0-compare2base
  175. # ${EXECUTABLE_OUTPUT_PATH}/compare_images
  176. # -b ${BASELINE_NR}/opj_${filenameRefSub}-r0.pgx
  177. # -t ${TEMP}/c0${filenameInput}-r0.pgx
  178. # -n ${nbComponents}
  179. # -d
  180. # -s b_t_
  181. # )
  182. # set_tests_properties(NR-C0P1-${filenameInput}-r0-compare2base
  183. # PROPERTIES DEPENDS
  184. # ETS-C0P1-${filenameInput}-r0-decode)
  185. # #r = 3
  186. # add_test(ETS-C0P1-${filenameInput}-r3-decode
  187. # ${EXECUTABLE_OUTPUT_PATH}/opj_decompress
  188. # -i ${INPUT_CONF}/${filenameInput}
  189. # -o ${TEMP}/c0${filenameInput}-r3.pgx
  190. # -r 3
  191. # )
  192. # add_test(ETS-C0P1-${filenameInput}-r3-compare2ref
  193. # ${EXECUTABLE_OUTPUT_PATH}/compare_images
  194. # -b ${BASELINE_CONF}/${filenameRefSub}r3.pgx
  195. # -t ${TEMP}/c0${filenameInput}-r3.pgx
  196. # -n ${nbComponents}
  197. # -p ${PEAK_limit}
  198. # -m ${MSE_limit}
  199. # -s t_
  200. # )
  201. # set_tests_properties(ETS-C0P1-${filenameInput}-r3-compare2ref
  202. # PROPERTIES DEPENDS
  203. # ETS-C0P1-${filenameInput}-r3-decode)
  204. # add_test(NR-C0P1-${filenameInput}-r3-compare2base
  205. # ${EXECUTABLE_OUTPUT_PATH}/compare_images
  206. # -b ${BASELINE_NR}/opj_${filenameRefSub}-r3.pgx
  207. # -t ${TEMP}/c0${filenameInput}-r3.pgx
  208. # -n ${nbComponents}
  209. # -d
  210. # -s b_t_
  211. # )
  212. # set_tests_properties(NR-C0P1-${filenameInput}-r3-compare2base
  213. # PROPERTIES DEPENDS
  214. # ETS-C0P1-${filenameInput}-r3-decode)
  215. # else()
  216. # add_test(ETS-C0P1-${filenameInput}-decode
  217. # ${EXECUTABLE_OUTPUT_PATH}/opj_decompress
  218. # -i ${INPUT_CONF}/${filenameInput}
  219. # -o ${TEMP}/c0${filenameInput}.pgx
  220. # -r ${ResFactor}
  221. # )
  222. # add_test(ETS-C0P1-${filenameInput}-compare2ref
  223. # ${EXECUTABLE_OUTPUT_PATH}/compare_images
  224. # -b ${BASELINE_CONF}/${filenameRef}
  225. # -t ${TEMP}/c0${filenameInput}.pgx
  226. # -n ${nbComponents}
  227. # -p ${PEAK_limit}
  228. # -m ${MSE_limit}
  229. # -s t_
  230. # )
  231. # set_tests_properties(ETS-C0P1-${filenameInput}-compare2ref
  232. # PROPERTIES DEPENDS
  233. # ETS-C0P1-${filenameInput}-decode)
  234. # add_test(NR-C0P1-${filenameInput}-compare2base
  235. # ${EXECUTABLE_OUTPUT_PATH}/compare_images
  236. # -b ${BASELINE_NR}/opj_${filenameRef}
  237. # -t ${TEMP}/c0${filenameInput}.pgx
  238. # -n ${nbComponents}
  239. # -d
  240. # -s b_t_
  241. # )
  242. # set_tests_properties(NR-C0P1-${filenameInput}-compare2base
  243. # PROPERTIES DEPENDS
  244. # ETS-C0P1-${filenameInput}-decode)
  245. # endif()
  246. #endforeach()
  247. #--------------------------------------------------------------------------
  248. # Tests about class 1 profile 0
  249. # try to decode
  250. # compare to ref file
  251. # non regression comparison
  252. # Parameters and tolerances given by Table C.6
  253. set( C1P0_ResFactor_list "not_used;0;0;0;0;0;0;0;1;0;0;0;0;0;0;0;0")
  254. set( C1P0_PEAK_list "not_used;0;0;0;5:4:6;2:2:2:0;635:403:378:0;0:0:0;0:0:0;0;0:0:0;0;0;0:0:0:0;0:0:0;0;0")
  255. set( C1P0_MSE_list "not_used;0;0;0;0.776:0.626:1.070;0.302:0.307:0.269:0;11287:6124:3968:0;0:0:0;0:0:0;0;0:0:0;0;0;0:0:0:0;0:0:0;0;0")
  256. foreach(numFileC1P0 RANGE 1 16)
  257. # Build filenames
  258. if(${numFileC1P0} LESS 10)
  259. set( filenameInput p0_0${numFileC1P0}.j2k )
  260. set( filenameRef c1p0_0${numFileC1P0}.pgx )
  261. else()
  262. set( filenameInput p0_${numFileC1P0}.j2k )
  263. set( filenameRef c1p0_${numFileC1P0}.pgx )
  264. endif()
  265. # Get corresponding tests parameters
  266. list(GET CP0_nbC_list ${numFileC1P0} nbComponents)
  267. list(GET C1P0_ResFactor_list ${numFileC1P0} ResFactor)
  268. list(GET C1P0_PEAK_list ${numFileC1P0} PEAK_limit)
  269. list(GET C1P0_MSE_list ${numFileC1P0} MSE_limit)
  270. add_test(NAME ETS-C1P0-${filenameInput}-decode
  271. COMMAND opj_decompress
  272. -i ${INPUT_CONF}/${filenameInput}
  273. -o ${TEMP}/c1${filenameInput}.pgx
  274. -r ${ResFactor}
  275. )
  276. add_test(NAME ETS-C1P0-${filenameInput}-compare2ref
  277. COMMAND compare_images
  278. -b ${BASELINE_CONF}/${filenameRef}
  279. -t ${TEMP}/c1${filenameInput}.pgx
  280. -n ${nbComponents}
  281. -p ${PEAK_limit}
  282. -m ${MSE_limit}
  283. -s b_t_
  284. )
  285. set_tests_properties(ETS-C1P0-${filenameInput}-compare2ref
  286. PROPERTIES DEPENDS
  287. ETS-C1P0-${filenameInput}-decode)
  288. add_test(NAME NR-C1P0-${filenameInput}-compare2base
  289. COMMAND compare_images
  290. -b ${BASELINE_NR}/opj_${filenameRef}
  291. -t ${TEMP}/c1${filenameInput}.pgx
  292. -n ${nbComponents}
  293. -d
  294. -s b_t_
  295. )
  296. set_tests_properties(NR-C1P0-${filenameInput}-compare2base
  297. PROPERTIES DEPENDS
  298. ETS-C1P0-${filenameInput}-decode)
  299. endforeach()
  300. #--------------------------------------------------------------------------
  301. # Tests about class 1 profile 1
  302. # try to decode
  303. # compare to ref file
  304. # non regression comparison
  305. # Parameters and tolerances given by Table C.7
  306. set( C1P1_PEAK_list "not_used;0;5:4:6;2:2:1:0;624;40:40:40;2:2:2;0:0")
  307. set( C1P1_MSE_list "not_used;0;0.765:0.616:1.051;0.3:0.210:0.200:0;3080;8.458:9.816:10.154;0.6:0.6:0.6;0:0")
  308. foreach(numFileC1P1 RANGE 1 7)
  309. # Build filenames
  310. set( filenameInput p1_0${numFileC1P1}.j2k )
  311. set( filenameRef c1p1_0${numFileC1P1}.pgx )
  312. # Get corresponding tests parameters
  313. list(GET CP1_nbC_list ${numFileC1P1} nbComponents)
  314. list(GET C1P1_PEAK_list ${numFileC1P1} PEAK_limit)
  315. list(GET C1P1_MSE_list ${numFileC1P1} MSE_limit)
  316. add_test(NAME ETS-C1P1-${filenameInput}-decode
  317. COMMAND opj_decompress
  318. -i ${INPUT_CONF}/${filenameInput}
  319. -o ${TEMP}/c1${filenameInput}.pgx
  320. -r 0
  321. )
  322. add_test(NAME ETS-C1P1-${filenameInput}-compare2ref
  323. COMMAND compare_images
  324. -b ${BASELINE_CONF}/${filenameRef}
  325. -t ${TEMP}/c1${filenameInput}.pgx
  326. -n ${nbComponents}
  327. -p ${PEAK_limit}
  328. -m ${MSE_limit}
  329. -s b_t_
  330. )
  331. set_tests_properties(ETS-C1P1-${filenameInput}-compare2ref
  332. PROPERTIES DEPENDS
  333. ETS-C1P1-${filenameInput}-decode)
  334. add_test(NAME NR-C1P1-${filenameInput}-compare2base
  335. COMMAND compare_images
  336. -b ${BASELINE_NR}/opj_${filenameRef}
  337. -t ${TEMP}/c1${filenameInput}.pgx
  338. -n ${nbComponents}
  339. -d
  340. -s b_t_
  341. )
  342. set_tests_properties(NR-C1P1-${filenameInput}-compare2base
  343. PROPERTIES DEPENDS
  344. ETS-C1P1-${filenameInput}-decode)
  345. endforeach()
  346. #--------------------------------------------------------------------------
  347. # Tests about JP2 file
  348. # try to decode
  349. # compare to ref file
  350. # non regression comparison
  351. # Tolerances given by Part 4 - Table G.1
  352. # Peak is set to 4 only
  353. foreach(numFileJP2 RANGE 1 9)
  354. # Build filenames
  355. set( filenameInput "file${numFileJP2}.jp2" )
  356. set( filenameRef jp2_${numFileJP2}.tif )
  357. add_test(NAME ETS-JP2-${filenameInput}-decode
  358. COMMAND opj_decompress
  359. -i ${INPUT_CONF}/${filenameInput}
  360. -o ${TEMP}/${filenameInput}.tif
  361. -p 8S
  362. -force-rgb
  363. )
  364. add_test(NAME ETS-JP2-${filenameInput}-compare2ref
  365. COMMAND compare_images
  366. -b ${BASELINE_CONF}/${filenameRef}
  367. -t ${TEMP}/${filenameInput}.tif
  368. -n 3
  369. -p 4:4:4
  370. -m 1:1:1
  371. -s b_t_
  372. )
  373. set_tests_properties(ETS-JP2-${filenameInput}-compare2ref
  374. PROPERTIES DEPENDS
  375. ETS-JP2-${filenameInput}-decode)
  376. add_test(NAME NR-JP2-${filenameInput}-compare2base
  377. COMMAND compare_images
  378. -b ${BASELINE_NR}/opj_${filenameRef}
  379. -t ${TEMP}/${filenameInput}.tif
  380. -n 3
  381. -d
  382. -s b_t_
  383. )
  384. set_tests_properties(NR-JP2-${filenameInput}-compare2base
  385. PROPERTIES DEPENDS
  386. ETS-JP2-${filenameInput}-decode)
  387. endforeach()
  388. #--------------------------------------------------------------------------
  389. # Tests about Kakadu/J2K file
  390. # try to decode
  391. # compare to ref file
  392. # non regression comparison
  393. # Tolerances given by ???
  394. set(kdu_j2k_conf_files
  395. a1_mono
  396. a2_colr
  397. a3_mono
  398. a4_colr
  399. a5_mono
  400. a6_mono_colr
  401. b1_mono
  402. b2_mono
  403. b3_mono
  404. c1_mono
  405. c2_mono
  406. d1_colr
  407. d2_colr
  408. e1_colr
  409. e2_colr
  410. f1_mono
  411. f2_mono
  412. g1_colr
  413. g2_colr
  414. g3_colr
  415. g4_colr
  416. )
  417. foreach(kdu_file ${kdu_j2k_conf_files})
  418. # Build filenames
  419. set( filenameInput "${kdu_file}.j2c" )
  420. set( filenameRef "${kdu_file}.ppm" )
  421. if("${kdu_file}" STREQUAL "a6_mono_colr")
  422. set(kdu_test_args -upsample -split-pnm )
  423. else()
  424. set(kdu_test_args -upsample )
  425. endif()
  426. add_test(NAME ETS-KDU-${filenameInput}-decode
  427. COMMAND opj_decompress
  428. -i ${INPUT_CONF}/${filenameInput}
  429. -o ${TEMP}/${filenameInput}.ppm
  430. ${kdu_test_args}
  431. )
  432. if("${kdu_file}" STREQUAL "a6_mono_colr")
  433. set(kdu_test_args -n 4 -s b_t_ )
  434. set(kdu_test_args_tol -p 4:4:4:4 -m 1:1:1:1)
  435. else()
  436. set(kdu_test_args -n 1 )
  437. set(kdu_test_args_tol -p 4:4:4 -m 1:1:1)
  438. endif()
  439. add_test(NAME ETS-KDU-${filenameInput}-compare2ref
  440. COMMAND compare_images
  441. -b ${BASELINE_CONF}/${filenameRef}
  442. -t ${TEMP}/${filenameInput}.ppm
  443. ${kdu_test_args}
  444. ${kdu_test_args_tol}
  445. )
  446. set_tests_properties(ETS-KDU-${filenameInput}-compare2ref
  447. PROPERTIES DEPENDS
  448. ETS-KDU-${filenameInput}-decode)
  449. add_test(NAME NR-KDU-${filenameInput}-compare2base
  450. COMMAND compare_images
  451. -b ${BASELINE_NR}/opj_${filenameRef}
  452. -t ${TEMP}/${filenameInput}.ppm
  453. ${kdu_test_args}
  454. -d
  455. )
  456. set_tests_properties(NR-KDU-${filenameInput}-compare2base
  457. PROPERTIES DEPENDS
  458. ETS-KDU-${filenameInput}-decode)
  459. endforeach()
  460. #--------------------------------------------------------------------------
  461. # Tests about Richter/J2K file
  462. # try to decode
  463. # compare to ref file
  464. # non regression comparison
  465. # Tolerances given by ???
  466. set(richter_jp2_conf_files
  467. subsampling_1
  468. subsampling_2
  469. zoo1
  470. zoo2
  471. )
  472. foreach(r_file ${richter_jp2_conf_files})
  473. # Build filenames
  474. set( filenameInput "${r_file}.jp2" )
  475. set( filenameRef "${r_file}.ppm" )
  476. add_test(NAME ETS-RIC-${filenameInput}-decode
  477. COMMAND opj_decompress
  478. -i ${INPUT_CONF}/${filenameInput}
  479. -o ${TEMP}/${filenameInput}.ppm
  480. )
  481. set(ric_test_args -n 1)
  482. add_test(NAME ETS-RIC-${filenameInput}-compare2ref
  483. COMMAND compare_images
  484. -b ${BASELINE_CONF}/${filenameRef}
  485. -t ${TEMP}/${filenameInput}.ppm
  486. ${ric_test_args}
  487. -p 4:4:4
  488. -m 2:2:2
  489. )
  490. set_tests_properties(ETS-RIC-${filenameInput}-compare2ref
  491. PROPERTIES DEPENDS
  492. ETS-RIC-${filenameInput}-decode)
  493. add_test(NAME NR-RIC-${filenameInput}-compare2base
  494. COMMAND compare_images
  495. -b ${BASELINE_NR}/opj_${filenameRef}
  496. -t ${TEMP}/${filenameInput}.ppm
  497. ${ric_test_args}
  498. -d
  499. )
  500. set_tests_properties(NR-RIC-${filenameInput}-compare2base
  501. PROPERTIES DEPENDS
  502. ETS-RIC-${filenameInput}-decode)
  503. endforeach()
  504. #--------------------------------------------------------------------------#
  505. #--------------------------------------------------------------------------#
  506. #--------------------------------------------------------------------------#
  507. #--------------------------------------------------------------------------
  508. # Tests about dump of profile 0 file
  509. # try to dump image and codestream information into a file
  510. # non regression comparison this file to the baseline
  511. foreach(numFileP0 RANGE 1 16)
  512. # Build filenames
  513. if(${numFileP0} LESS 10)
  514. set( filenameInput p0_0${numFileP0}.j2k )
  515. else()
  516. set( filenameInput p0_${numFileP0}.j2k )
  517. endif()
  518. get_filename_component(filenameRefSub ${filenameInput} NAME_WE)
  519. add_test(NAME NR-${filenameInput}-dump
  520. COMMAND opj_dump
  521. -i ${INPUT_CONF}/${filenameInput}
  522. -o ${TEMP}/${filenameInput}.txt
  523. )
  524. add_test(NAME NR-${filenameInput}-compare_dump2base
  525. COMMAND compare_dump_files
  526. -b ${BASELINE_NR}/opj_v2_${filenameRefSub}.txt
  527. -t ${TEMP}/${filenameInput}.txt
  528. )
  529. set_tests_properties(NR-${filenameInput}-compare_dump2base
  530. PROPERTIES DEPENDS
  531. NR-${filenameInput}-dump)
  532. endforeach()
  533. #--------------------------------------------------------------------------
  534. # Tests about dump of profile 1 file
  535. # try to dump image and codestream information into a file
  536. # non regression comparison this file to the baseline
  537. foreach(numFileP1 RANGE 1 7)
  538. # Build filenames
  539. set( filenameInput p1_0${numFileP1}.j2k )
  540. get_filename_component(filenameInputSub ${filenameInput} NAME_WE)
  541. add_test(NAME NR-${filenameInput}-dump
  542. COMMAND opj_dump
  543. -i ${INPUT_CONF}/${filenameInput}
  544. -o ${TEMP}/${filenameInput}.txt
  545. )
  546. add_test(NAME NR-${filenameInput}-compare_dump2base
  547. COMMAND compare_dump_files
  548. -b ${BASELINE_NR}/opj_v2_${filenameInputSub}.txt
  549. -t ${TEMP}/${filenameInput}.txt
  550. )
  551. set_tests_properties(NR-${filenameInput}-compare_dump2base
  552. PROPERTIES DEPENDS
  553. NR-${filenameInput}-dump)
  554. endforeach()
  555. #--------------------------------------------------------------------------
  556. # Tests about dump of JP2 file
  557. # try to dump image and codestream information into a file
  558. # non regression comparison this file to the baseline
  559. foreach(numFileJP2 RANGE 1 9)
  560. # Build filenames
  561. set( filenameInput "file${numFileJP2}.jp2" )
  562. get_filename_component(filenameInputSub ${filenameInput} NAME_WE)
  563. add_test(NAME NR-${filenameInput}-dump
  564. COMMAND opj_dump
  565. -i ${INPUT_CONF}/${filenameInput}
  566. -o ${TEMP}/${filenameInput}.txt
  567. )
  568. add_test(NAME NR-${filenameInput}-compare_dump2base
  569. COMMAND compare_dump_files
  570. -b ${BASELINE_NR}/opj_v2_${filenameInputSub}.txt
  571. -t ${TEMP}/${filenameInput}.txt
  572. )
  573. set_tests_properties(NR-${filenameInput}-compare_dump2base
  574. PROPERTIES DEPENDS
  575. NR-${filenameInput}-dump)
  576. endforeach()