Merge branch 'master' into coc-qcc

This commit is contained in:
mayeut 2015-09-17 02:12:27 +02:00
commit 4bb5e24d23
11 changed files with 64 additions and 23 deletions

View File

@ -6,10 +6,20 @@ 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:
- 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 ..

View File

@ -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 -

View File

@ -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

View File

@ -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 -

View File

@ -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)
{

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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

View File

@ -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