summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormayeut <mayeut@users.noreply.github.com>2015-09-17 02:12:27 +0200
committermayeut <mayeut@users.noreply.github.com>2015-09-17 02:12:27 +0200
commit4bb5e24d234dbf239119524edae4e23f39de7ee4 (patch)
tree4f354880eb794d70ed20edde5ebba693f48092aa
parent66d890bf225a4edc49658803b4aa6a65031479e4 (diff)
parent6cb56b36f627194fdfb13e306d27925b956af63f (diff)
Merge branch 'master' into coc-qcc
-rw-r--r--.travis.yml24
-rw-r--r--doc/man/man1/opj_compress.12
-rw-r--r--doc/man/man1/opj_decompress.114
-rw-r--r--doc/man/man1/opj_dump.12
-rw-r--r--src/bin/common/color.c12
-rw-r--r--src/bin/common/color.h2
-rw-r--r--src/bin/jp2/opj_decompress.c2
-rw-r--r--src/lib/openjp2/tcd.c2
-rw-r--r--tests/compare_images.c4
-rw-r--r--tests/nonregression/CMakeLists.txt20
-rw-r--r--tests/nonregression/test_suite.ctest.in3
11 files changed, 64 insertions, 23 deletions
diff --git a/.travis.yml b/.travis.yml
index 1f7966f4..a7f975ee 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,14 +6,24 @@ before_install:
- cmake --version
- git clone --depth=1 --branch=master git://github.com/uclouvain/openjpeg-data.git data
- wget -qO - https://github.com/openpreserve/jpylyzer/archive/1.14.2.tar.gz | tar -xvz
+# When OPJ_NONCOMMERCIAL=1, kakadu trial binaries are used for testing. Here's the copyright notice from kakadu:
+# Copyright is owned by NewSouth Innovations Pty Limited, commercial arm of the UNSW Australia in Sydney.
+# You are free to trial these executables and even to re-distribute them,
+# so long as such use or re-distribution is accompanied with this copyright notice and is not for commercial gain.
+# Note: Binaries can only be used for non-commercial purposes.
+ - if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ]; then wget -q http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_Linux-x86-64_150710.zip; fi
install:
- chmod +x jpylyzer-1.14.2/jpylyzer/jpylyzer.py
+ - if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ]; then cmake -E tar -xf KDU77_Demo_Apps_for_Linux-x86-64_150710.zip; fi
+ - export LD_LIBRARY_PATH=${PWD}/KDU77_Demo_Apps_for_Linux-x86-64_150710:${LD_LIBRARY_PATH}
+ - export PATH=${PWD}/KDU77_Demo_Apps_for_Linux-x86-64_150710:${PATH}
script:
- - mkdir build
- - cd build
- - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_CODEC=ON -DBUILD_THIRDPARTY=ON -DBUILD_TESTING=ON -DOPJ_DATA_ROOT=${PWD}/../data -DJPYLYZER_EXECUTABLE=${PWD}/../jpylyzer-1.14.2/jpylyzer/jpylyzer.py -DSITE=travis-ci.org -DBUILDNAME=${TRAVIS_OS_NAME}-${CC}$(${CC} -dumpversion)-x86_64-${TRAVIS_BRANCH}$( [[ "${TRAVIS_PULL_REQUEST}" != "false" ]] && echo "-pr${TRAVIS_PULL_REQUEST}" )-Release-3rdP ..
- - ctest -D ExperimentalStart
- - ctest -D ExperimentalBuild -V
- - ctest -D ExperimentalTest -j2 || true
- - ctest -D ExperimentalSubmit || true
+ - if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ]; then echo -e "\nTesting will use Kakadu trial binaries. Here's the copyright notice from kakadu:\nCopyright is owned by NewSouth Innovations Pty Limited, commercial arm of the UNSW Australia in Sydney.\nYou are free to trial these executables and even to re-distribute them,\nso long as such use or re-distribution is accompanied with this copyright notice and is not for commercial gain.\nNote:\ Binaries can only be used for non-commercial purposes.\n"; fi
+ - mkdir build
+ - cd build
+ - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_CODEC=ON -DBUILD_THIRDPARTY=ON -DBUILD_TESTING=ON -DOPJ_DATA_ROOT=${PWD}/../data -DJPYLYZER_EXECUTABLE=${PWD}/../jpylyzer-1.14.2/jpylyzer/jpylyzer.py -DSITE=travis-ci.org -DBUILDNAME=${TRAVIS_OS_NAME}-${CC}$(${CC} -dumpversion)-x86_64-${TRAVIS_BRANCH}$( [[ "${TRAVIS_PULL_REQUEST}" != "false" ]] && echo "-pr${TRAVIS_PULL_REQUEST}" )-Release-3rdP ..
+ - ctest -D ExperimentalStart
+ - ctest -D ExperimentalBuild -V
+ - ctest -D ExperimentalTest -j2 || true
+ - ctest -D ExperimentalSubmit || true
diff --git a/doc/man/man1/opj_compress.1 b/doc/man/man1/opj_compress.1
index 51e5b1a5..cb37a427 100644
--- a/doc/man/man1/opj_compress.1
+++ b/doc/man/man1/opj_compress.1
@@ -29,7 +29,7 @@
.SP
.fi
..
-.TH opj_compress 1 "Version 1.4.0" "opj_compress" "converts to jpeg2000 files"
+.TH opj_compress 1 "Version 2.1.1" "opj_compress" "converts to jpeg2000 files"
.P
.SH NAME
opj_compress -
diff --git a/doc/man/man1/opj_decompress.1 b/doc/man/man1/opj_decompress.1
index 470fd3c1..1e7b6c54 100644
--- a/doc/man/man1/opj_decompress.1
+++ b/doc/man/man1/opj_decompress.1
@@ -29,7 +29,7 @@
.SP
.fi
..
-.TH opj_decompress 1 "Version 1.4.0" "opj_decompress" "converts jpeg2000 files"
+.TH opj_decompress 1 "Version 2.1.1" "opj_decompress" "converts jpeg2000 files"
.P
.SH NAME
opj_decompress -
@@ -73,9 +73,19 @@ n is the maximum number of quality layers to decode. See LAYERS below)
.B \-\^OutFor "ext"
(extension for output files)
.P
+.SH JPIP OPTIONS
+Options usable only if the library has been compiled with
+.B BUILD_JPIP
+.TP
+.B -jpip
+Embed index table box into the output JP2 file (compulsory for JPIP)
+.TP
+.B -TP R
+Partition a tile into tile parts of different resolution levels (compulsory for JPT-stream)
+.P
.SH JPWL OPTIONS
Options usable only if the library has been compiled with
-.B -DUSE_JPWL
+.B BUILD_JPWL
.TP
.B -W c\fR[=Nc] (Nc is the number of expected components in the codestream; default:3)
.TP
diff --git a/doc/man/man1/opj_dump.1 b/doc/man/man1/opj_dump.1
index a6033c61..160af63a 100644
--- a/doc/man/man1/opj_dump.1
+++ b/doc/man/man1/opj_dump.1
@@ -29,7 +29,7 @@
.SP
.fi
..
-.TH opj_dump 1 "Version 1.4.0" "opj_dump" "dumps jpeg2000 files"
+.TH opj_dump 1 "Version 2.1.1" "opj_dump" "dumps jpeg2000 files"
.P
.SH NAME
opj_dump -
diff --git a/src/bin/common/color.c b/src/bin/common/color.c
index 98a4cec8..3b0eb97b 100644
--- a/src/bin/common/color.c
+++ b/src/bin/common/color.c
@@ -562,7 +562,7 @@ fprintf(stderr,"%s:%d:color_apply_icc_profile\n\tcmsCreateTransform failed. "
#endif
}/* color_apply_icc_profile() */
-void color_apply_conversion(opj_image_t *image)
+void color_cielab_to_rgb(opj_image_t *image)
{
int *row;
int enumcs, numcomps;
@@ -581,7 +581,7 @@ void color_apply_conversion(opj_image_t *image)
row = (int*)image->icc_profile_buf;
enumcs = row[0];
- if(enumcs == 14)// CIELab
+ if(enumcs == 14) /* CIELab */
{
int *L, *a, *b, *red, *green, *blue;
int *src0, *src1, *src2, *dst0, *dst1, *dst2;
@@ -599,13 +599,13 @@ void color_apply_conversion(opj_image_t *image)
transform = cmsCreateTransform(in, TYPE_Lab_DBL, out, TYPE_RGB_16, INTENT_PERCEPTUAL, 0);
-#ifdef HAVE_LIBLCMS2
+#ifdef OPJ_HAVE_LIBLCMS2
cmsCloseProfile(in);
cmsCloseProfile(out);
#endif
if(transform == NULL)
{
-#ifdef HAVE_LIBLCMS1
+#ifdef OPJ_HAVE_LIBLCMS1
cmsCloseProfile(in);
cmsCloseProfile(out);
#endif
@@ -662,7 +662,7 @@ void color_apply_conversion(opj_image_t *image)
*blue++ = RGB[2];
}
cmsDeleteTransform(transform);
-#ifdef HAVE_LIBLCMS1
+#ifdef OPJ_HAVE_LIBLCMS1
cmsCloseProfile(in);
cmsCloseProfile(out);
#endif
@@ -681,7 +681,7 @@ void color_apply_conversion(opj_image_t *image)
fprintf(stderr,"%s:%d:\n\tenumCS %d not handled. Ignoring.\n", __FILE__,__LINE__, enumcs);
}// color_apply_conversion()
-#endif // HAVE_LIBLCMS2 || HAVE_LIBLCMS1
+#endif // OPJ_HAVE_LIBLCMS2 || OPJ_HAVE_LIBLCMS1
void color_cmyk_to_rgb(opj_image_t *image)
{
diff --git a/src/bin/common/color.h b/src/bin/common/color.h
index c329f87f..0cd78e89 100644
--- a/src/bin/common/color.h
+++ b/src/bin/common/color.h
@@ -40,7 +40,7 @@
extern void color_sycc_to_rgb(opj_image_t *img);
extern void color_apply_icc_profile(opj_image_t *image);
-extern void color_apply_conversion(opj_image_t *image);
+extern void color_cielab_to_rgb(opj_image_t *image);
extern void color_cmyk_to_rgb(opj_image_t *image);
extern void color_esycc_to_rgb(opj_image_t *image);
diff --git a/src/bin/jp2/opj_decompress.c b/src/bin/jp2/opj_decompress.c
index ac17b69d..da566ac2 100644
--- a/src/bin/jp2/opj_decompress.c
+++ b/src/bin/jp2/opj_decompress.c
@@ -1371,7 +1371,7 @@ int main(int argc, char **argv)
if(image->icc_profile_len)
color_apply_icc_profile(image);
else
- color_apply_conversion(image);
+ color_cielab_to_rgb(image);
#endif
free(image->icc_profile_buf);
image->icc_profile_buf = NULL; image->icc_profile_len = 0;
diff --git a/src/lib/openjp2/tcd.c b/src/lib/openjp2/tcd.c
index 8f1c9410..2fccff1c 100644
--- a/src/lib/openjp2/tcd.c
+++ b/src/lib/openjp2/tcd.c
@@ -268,7 +268,7 @@ void opj_tcd_makelayer( opj_tcd_t *tcd,
n = passno + 1;
continue;
}
- if (dd / dr >= thresh)
+ if (thresh - (dd / dr) < DBL_EPSILON) /* do not rely on float equality, check with DBL_EPSILON margin */
n = passno + 1;
}
diff --git a/tests/compare_images.c b/tests/compare_images.c
index cb1b1301..b28d4957 100644
--- a/tests/compare_images.c
+++ b/tests/compare_images.c
@@ -85,7 +85,7 @@ static void compare_images_help_display(void)
fprintf(stdout,"\n");
fprintf(stdout," -b \t REQUIRED \t filename to the reference/baseline PGX/TIF/PNM image \n");
fprintf(stdout," -t \t REQUIRED \t filename to the test PGX/TIF/PNM image\n");
- fprintf(stdout," -n \t REQUIRED \t number of component of the image (used to generate correct filename)\n");
+ fprintf(stdout," -n \t REQUIRED \t number of component of the image (used to generate correct filename, not used when both input files are TIF)\n");
fprintf(stdout," -m \t OPTIONAL \t list of MSE tolerances, separated by : (size must correspond to the number of component) of \n");
fprintf(stdout," -p \t OPTIONAL \t list of PEAK tolerances, separated by : (size must correspond to the number of component) \n");
fprintf(stdout," -s \t OPTIONAL \t 1 or 2 filename separator to take into account PGX/PNM image with different components, "
@@ -279,8 +279,6 @@ static opj_image_t* readImageFromFileTIF(const char* filename, int nbFilenamePGX
return NULL;
}
- /* \postconditions */
- assert( image_read->numcomps == 1 || image_read->numcomps == 3 );
return image_read;
}
diff --git a/tests/nonregression/CMakeLists.txt b/tests/nonregression/CMakeLists.txt
index 2527f8cb..5ce37c81 100644
--- a/tests/nonregression/CMakeLists.txt
+++ b/tests/nonregression/CMakeLists.txt
@@ -353,6 +353,26 @@ foreach(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
)
endif()
endif(JPYLYZER_EXECUTABLE)
+
+ # If lossless compression (simple test is 4 arguments), decompress & compare
+ list(LENGTH CMD_ARG_LIST_2 ARG_COUNT)
+ if (ARG_COUNT EQUAL 4)
+ # can we compare with the input image ?
+ if (${INPUT_FILENAME_NAME} MATCHES "\\.tif$")
+ add_test(NAME NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-lossless-decode
+ COMMAND opj_decompress -i ${OUTPUT_FILENAME} -o ${OUTPUT_FILENAME}.lossless.tif
+ )
+ set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-lossless-decode PROPERTIES
+ DEPENDS NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-encode
+ )
+ add_test(NAME NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-lossless-compare
+ COMMAND compare_images -b ${INPUT_FILENAME} -t ${OUTPUT_FILENAME}.lossless.tif -n 1 -d
+ )
+ set_tests_properties(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-lossless-compare PROPERTIES
+ DEPENDS NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-lossless-decode
+ )
+ endif()
+ endif()
endif()
# DECODER TEST SUITE
diff --git a/tests/nonregression/test_suite.ctest.in b/tests/nonregression/test_suite.ctest.in
index 6f9bba83..7e3a35a8 100644
--- a/tests/nonregression/test_suite.ctest.in
+++ b/tests/nonregression/test_suite.ctest.in
@@ -134,6 +134,9 @@ opj_compress -i @INPUT_NR_PATH@/pngsuite/ftp0n2c08.png -o @TEMP_PATH@/ftp0n2c08.
opj_compress -i @INPUT_NR_PATH@/pngsuite/ftp0n3p08.png -o @TEMP_PATH@/ftp0n3p08.png.jp2
opj_compress -i @INPUT_NR_PATH@/pngsuite/ftp1n3p08.png -o @TEMP_PATH@/ftp1n3p08.png.jp2
+# issue 571 Lossless is not lossless on linux x86
+opj_compress -i @INPUT_NR_PATH@/issue571.tif -o @TEMP_PATH@/issue571.tif.j2k
+
# DECODER TEST SUITE
opj_decompress -i @INPUT_NR_PATH@/Bretagne2.j2k -o @TEMP_PATH@/Bretagne2.j2k.pgx
opj_decompress -i @INPUT_NR_PATH@/_00042.j2k -o @TEMP_PATH@/_00042.j2k.pgx