Compare commits

...

34 Commits

Author SHA1 Message Date
Antonin Descampe
8030b4d6df [tag2.1] fixed typo in NEWS 2014-04-29 12:58:10 +00:00
Mathieu Malaterre
bcbca6e8cc [2.1] Add CHANGES file 2014-04-29 07:12:46 +00:00
Mathieu Malaterre
7134a8eb26 [2.1] Create tag for 2.1.0 release 2014-04-29 07:02:13 +00:00
Mathieu Malaterre
cf77ede84c [2.1] Create the 2.1 branch 2014-04-29 06:58:23 +00:00
Antonin Descampe
45313a8dfa [trunk] fixed warning in j2k.c about sign conversion 2014-04-28 09:38:44 +00:00
Mathieu Malaterre
b08135e7c1 [trunk] Finalize API for openjpeg 2.1
public header will only contains minimal information: major, minor and build version
Prefix has been changed from OPENJPEG to OPJ for consistency
SOVERSION has been removed from header (ABI vs API info)
OPJ_VERSION string has been removed, since it is accessible already (PACKAGE_VERSION)
Fixes issue 342
2014-04-28 09:17:31 +00:00
Mathieu Malaterre
4bac8488df [trunk] Properly handle failure to compress (remove file)
Fixes issue 323
2014-04-28 07:54:33 +00:00
Mathieu Malaterre
de04302c15 [trunk] Missing endianess setting
Fixes issue 337
2014-04-28 07:44:39 +00:00
Mathieu Malaterre
997758f91c [trunk] properly handle pkg-config on non-UNIX hosts
Fixes issue 340
2014-04-28 07:34:26 +00:00
Mathieu Malaterre
763214f7c0 [trunk] Provide #ifdef blockers for OpenJPEG Version
Fixes issue 342
2014-04-28 07:32:35 +00:00
Antonin Descampe
77e8dad503 [trunk] fixed typo in NEWS 2014-04-27 21:31:32 +00:00
Antonin Descampe
1758445a75 [trunk] updated NEWS for 2.1.0 2014-04-25 09:22:49 +00:00
Mathieu Malaterre
7a77a8047d [trunk] Make sure OpenJPIP compiles on WIN32 2014-04-24 11:24:56 +00:00
Antonin Descampe
d8767cbcb7 [trunk] fixed reference to opj_stream_set_user_data_v3 in jpip sources. 2014-04-24 08:51:29 +00:00
Antonin Descampe
7924d3a456 [trunk]removed '-x' option for index file as long as it's broken 2014-04-23 15:19:57 +00:00
Antonin Descampe
ec84bafcd8 [trunk]re-formatted help display in executables 2014-04-23 14:09:20 +00:00
Antonin Descampe
08c09b74cf [trunk]formatted some messages. Removed -version option to disambiguate
with -v(erbose) option, added version info in help display
2014-04-23 09:12:30 +00:00
Antonin Descampe
7aece5e8e7 [trunk]Replaced deprecated opj_stream_set_user_data function from API
with its 'v3' version, and removed all other 'v3' suffixes from API.
2014-04-23 07:46:11 +00:00
Antonin Descampe
8d93eae64a [trunk] fixed some warning and errors formatting and add a '-version'
option to opj_compress and opj_decompress binaries
2014-04-22 21:22:49 +00:00
Antonin Descampe
9a3d660d1b [trunk] fixed warning related to r2837 and move new field at the end of
parameters structure.
2014-04-17 09:54:38 +00:00
Antonin Descampe
7199d9b5d3 [trunk] refactoring of rsiz, profiles, and extensions management 2014-04-17 09:31:37 +00:00
Antonin Descampe
d19a4ab676 [trunk] updated copyright and added copyright notice required by ISO, in each file; updated AUTHORS, NEWS 2014-04-03 15:30:57 +00:00
Antonin Descampe
f105cb5471 [trunk] removed debug message in CMakeLists.txt 2014-04-02 16:37:07 +00:00
Antonin Descampe
4db4198722 [trunk] fixed a bug triggering SEGFAULT on debug mode (uninitialized
structure)
2014-04-02 16:25:40 +00:00
Mathieu Malaterre
616a3345c4 [trunk] Properly copy/paste code from the autotools
gcc correctly fails compiling this code, I needed to move the code outside the main function to get the error. This actually match the autotools (incorrect) code. We'll see how they fix this code in future release.
This make the code compatible with previous openjpeg version and remove C99 requirement.
Fixes issue 316
2014-03-27 15:07:58 +00:00
Mathieu Malaterre
1f8d84a562 [trunk] Make sure to use long long (this is not C89). However this should be ok on most compilers nowadays
Update issue 316
2014-03-26 16:20:13 +00:00
Antonin Descampe
a54d757a3e [trunk] fixed warnings triggered on linux related to r2802 2014-03-26 15:17:17 +00:00
Mathieu Malaterre
b5eb374fb9 [trunk] Run test suite on issue 316 dataset
Update issue 316
2014-03-26 15:16:24 +00:00
Antonin Descampe
f1d69068c7 [trunk] add ability in opj_compress to input subsampled images through
'-F' (aka raw option). Let the user input raw images with 444, 422, 420
(etc) subsampling. To be used in conjunction with '-mct 0' option to
compress subsampled YCC images.
2014-03-26 14:26:49 +00:00
Mathieu Malaterre
ee130e2306 [trunk] Add small utilities to extract JP2 files from PDF 2014-03-26 11:52:01 +00:00
Mathieu Malaterre
9ba6bc6042 [trunk] Make sure to test value not pointer
Update issue 302
2014-03-25 16:34:59 +00:00
Antonin Descampe
5e1a0fad08 [trunk] fixed bug related to r2791 2014-03-25 15:35:33 +00:00
Mathieu Malaterre
c05118dc49 [trunk] Add sentinel in case list empty.
I was getting a cmake error `list sub-command REMOVE_ITEM requires list to be present`
2014-03-25 15:29:19 +00:00
Mathieu Malaterre
1adf89d5d2 [trunk] Import change from 2.0 branch 2014-03-25 15:21:53 +00:00
276 changed files with 3409 additions and 989 deletions

View File

@@ -3,10 +3,10 @@ See also the files THANKS and CHANGES
David Janssens designed and implemented the first version of OpenJPEG.
Kaori Hagihara designed and implemented the first version of OpenJPIP.
Jerome Fimes implemented the alpha version of OpenJPEG v2.
Jerome Fimes implemented the alpha version of OpenJPEG 2.0.
Giuseppe Baruffa added the JPWL functionalities.
Micka<EFBFBD>l Savinaud implemented the final OpenJPEG v2 version based on a big merge between 1.5 version and alpha version of v2.
Mathieu Malaterre participate to the OpenJPEG v2 version and release the OpenJPEG 1.5 and 1.5.1 version.
Micka<EFBFBD>l Savinaud implemented the final OpenJPEG 2.0 version based on a big merge between 1.5 version and alpha version of 2.0.
Mathieu Malaterre participated to the OpenJPEG 2.0 version and improved the libraries and utilities.
Yannick Verschueren,
Herve Drolon,
Francois-Olivier Devaux,

1116
CHANGES Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -47,6 +47,7 @@ set(PACKAGE_VERSION
# 1.5 | 5
# 1.5.1 | 5
# 2.0 | 6
# 2.0.1 | 6
# 2.1 | 7
# above is the recommendation by the OPJ team. If you really need to override this default,
# you can specify your own OPENJPEG_SOVERSION at cmake configuration time:
@@ -94,6 +95,8 @@ endif()
# --------------------------------------------------------------------------
# Install directories
# Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
string(TOLOWER ${PROJECT_NAME} projectname)
set(OPENJPEG_INSTALL_SUBDIR "${projectname}-${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}")
@@ -118,6 +121,7 @@ if(NOT OPENJPEG_INSTALL_INCLUDE_DIR)
set(OPENJPEG_INSTALL_INCLUDE_DIR "include/${OPENJPEG_INSTALL_SUBDIR}")
endif()
if(BUILD_DOC)
if(NOT OPENJPEG_INSTALL_MAN_DIR)
set(OPENJPEG_INSTALL_MAN_DIR "share/man/")
endif()
@@ -125,6 +129,7 @@ endif()
if(NOT OPENJPEG_INSTALL_DOC_DIR)
set(OPENJPEG_INSTALL_DOC_DIR "share/doc/${OPENJPEG_INSTALL_SUBDIR}")
endif()
endif()
if(NOT OPENJPEG_INSTALL_JNI_DIR)
if(WIN32)
@@ -264,8 +269,7 @@ configure_file(
)
#-----------------------------------------------------------------------------
# Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
# build documentation in doc subdir:
if(BUILD_DOC)
add_subdirectory(doc)
endif()
@@ -307,16 +311,25 @@ install( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
#-----------------------------------------------------------------------------
# install CHANGES and LICENSE
if(BUILD_DOC)
if(EXISTS ${OPENJPEG_SOURCE_DIR}/CHANGES)
install(FILES CHANGES DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
endif()
install(FILES LICENSE DESTINATION ${OPENJPEG_INSTALL_DOC_DIR})
endif()
include (cmake/OpenJPEGCPack.cmake)
#-----------------------------------------------------------------------------
# pkgconfig support
# enabled by default on Unix, disabled by default on other platforms
if(UNIX)
option(BUILD_PKGCONFIG_FILES "Build and install pkg-config files" ON)
else()
option(BUILD_PKGCONFIG_FILES "Build and install pkg-config files" OFF)
endif()
if(BUILD_PKGCONFIG_FILES)
# install in lib and not share (see multi-arch note above)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/libopenjp2.pc.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc @ONLY)

11
LICENSE
View File

@@ -1,7 +1,12 @@
/*
* Copyright (c) 2002-2012, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2012, Professor Benoit Macq
* Copyright (c) 2003-2012, Antonin Descampe
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2003-2009, Francois-Olivier Devaux
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2002-2003, Yannick Verschueren

40
NEWS
View File

@@ -2,6 +2,46 @@
OpenJPEG NEWS - user visible changes
====================================
Changes from OpenJPEG 2.0.0 to OpenJPEG 2.1.0
----------------------------------------------
New Features:
* Digital Cinema profiles have been fixed and updated
* New option to disable MCT if needed
* extended RAW support: it is now possible to input raw images
with subsampled color components (422, 420, etc)
* New way to deal with profiles
API/ABI modifications: (see abi_compat_report in dev-utils/scripts)
* Removed deprecated functions
- opj_stream_create_default_file_stream(FILE*,...)
- opj_stream_create_file_stream(FILE*,...)
- opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data)
* Added
- opj_stream_create_default_file_stream(char*,...)
- opj_stream_create_file_stream(char*,...)
- opj_stream_destroy(opj_stream_t*)
- opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data,
... opj_stream_free_user_data_fn p_function)
- JPEG 2000 profiles and Part-2 extensions defined through '#define'
* Changed
- 'alpha' field added to 'opj_image_comp' structure
- 'OPJ_CLRSPC_EYCC' added to enum COLOR_SPACE
- 'OPJ_CLRSPC_CMYK' added to enum COLOR_SPACE
- 'OPJ_CODEC_JPP' and 'OPJ_CODEC_JPX' added to CODEC_FORMAT
(not yet used in use)
- 'max_cs_size' and 'rsiz' fields added to opj_cparameters_t
Misc:
* OpenJPEG is now officialy conformant with JPEG 2000 Part-1
and will soon become official reference software at the
JPEG committee.
* Huge amount of bug fixes. See CHANGES for details.
Changes from OpenJPEG 1.5.x to OpenJPEG 2.0.0
----------------------------------------------

View File

@@ -1,10 +1,11 @@
#include <sys/types.h>
/* Cause a compile-time error if off_t is smaller than 64 bits */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];
int main(int argc, char **argv)
{
/* Cause a compile-time error if off_t is smaller than 64 bits */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];
return 0;
}

View File

@@ -1,7 +1,7 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2011, Mickael Savinaud, Communications & Systemes <mickael.savinaud@c-s.fr>
* All rights reserved.
*

View File

@@ -203,9 +203,9 @@ Options usable only if the library has been compiled with \fB-DUSE_JPWL\fR
.B opj_compress -i \fRlena.raw \fB-o \fRlena.j2k \fB-F \fR512,512,3,8,u
.P
.SH AUTHORS
Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
.br
Copyright (c) 2002-2007, Professor Benoit Macq
Copyright (c) 2002-2014, Professor Benoit Macq
.br
Copyright (c) 2001-2003, David Janssens
.br

View File

@@ -91,9 +91,9 @@ Set the maximum number of quality layers to decode. If there are less quality la
.P
'\".SH BUGS
.SH AUTHORS
Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
.br
Copyright (c) 2002-2007, Professor Benoit Macq
Copyright (c) 2002-2014, Professor Benoit Macq
.br
Copyright (c) 2001-2003, David Janssens
.br

View File

@@ -313,9 +313,9 @@ typedef struct opj_cparameters
'\".SH OPTIONS
'\".SH BUGS
.SH AUTHORS
Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
Copyright (c) 2002-2007, Professor Benoit Macq
Copyright (c) 2002-2014, Professor Benoit Macq
Copyright (c) 2001-2003, David Janssens

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*

View File

@@ -1,3 +1,5 @@
#include "opj_config_private.h"
/* create opj_apps_config.h for CMake */
#cmakedefine OPJ_HAVE_LIBPNG @HAVE_LIBPNG@

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 3-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 1987, 1993, 1994
* The Regents of the University of California. All rights reserved.
*

View File

@@ -52,6 +52,7 @@ foreach(exe opj_decompress opj_compress opj_dump)
)
endforeach()
if(BUILD_DOC)
# Install man pages
install(
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_compress.1
@@ -59,3 +60,4 @@ install(
${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_dump.1
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1)
#
endif()

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* All rights reserved.
@@ -2591,6 +2597,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
int has_alpha = 0;
unsigned short tiBps, tiPhoto, tiSf, tiSpp, tiPC;
unsigned int tiWidth, tiHeight;
OPJ_BOOL is_cinema = OPJ_IS_CINEMA(parameters->rsiz);
tif = TIFFOpen(filename, "r");
@@ -2663,7 +2670,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
*/
memset(&cmptparm[0], 0, 4 * sizeof(opj_image_cmptparm_t));
if ((tiPhoto == PHOTOMETRIC_RGB) && (parameters->cp_cinema)) {
if ((tiPhoto == PHOTOMETRIC_RGB) && (is_cinema)) {
fprintf(stdout,"WARNING:\n"
"Input image bitdepth is %d bits\n"
"TIF conversion has automatically rescaled to 12-bits\n"
@@ -2679,7 +2686,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
/*#define USETILEMODE*/
for(j = 0; j < numcomps; j++)
{
if(parameters->cp_cinema)
if(is_cinema)
{
cmptparm[j].prec = 12;
cmptparm[j].bpp = 12;
@@ -2748,7 +2755,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
if(has_alpha)
image->comps[3].data[index] = ( dat8[i+7] << 8 ) | dat8[i+6];
if(parameters->cp_cinema)
if(is_cinema)
{
/* Rounding 16 to 12 bits
*/
@@ -2785,7 +2792,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
image->comps[3].data[index] = dat8[i+3];
#endif
if(parameters->cp_cinema)
if(is_cinema)
{
/* Rounding 8 to 12 bits
*/
@@ -2953,9 +2960,11 @@ static opj_image_t* rawtoimage_common(const char *filename, opj_cparameters_t *p
{
fprintf(stderr,"\nError: invalid raw image parameters\n");
fprintf(stderr,"Please use the Format option -F:\n");
fprintf(stderr,"-F rawWidth,rawHeight,rawComp,rawBitDepth,s/u (Signed/Unsigned)\n");
fprintf(stderr,"Example: -i lena.raw -o lena.j2k -F 512,512,3,8,u\n");
fprintf(stderr,"Aborting\n");
fprintf(stderr,"-F <width>,<height>,<ncomp>,<bitdepth>,{s,u}@<dx1>x<dy1>:...:<dxn>x<dyn>\n");
fprintf(stderr,"If subsampling is omitted, 1x1 is assumed for all components\n");
fprintf(stderr,"Example: -i image.raw -o image.j2k -F 512,512,3,8,u@1x1:2x2:2x2\n");
fprintf(stderr," for raw 512x512 image with 4:2:0 subsampling\n");
fprintf(stderr,"Aborting.\n");
return NULL;
}
@@ -2966,7 +2975,17 @@ static opj_image_t* rawtoimage_common(const char *filename, opj_cparameters_t *p
return NULL;
}
numcomps = raw_cp->rawComp;
color_space = OPJ_CLRSPC_SRGB;
/* FIXME ADE at this point, tcp_mct has not been properly set in calling function */
if (numcomps == 0) {
color_space = OPJ_CLRSPC_GRAY;
} else if ((numcomps >= 3) && (parameters->tcp_mct == 0)) {
color_space = OPJ_CLRSPC_SYCC;
} else if ((numcomps >= 3) && (parameters->tcp_mct != 2)) {
color_space = OPJ_CLRSPC_SRGB;
} else {
color_space = OPJ_CLRSPC_UNKNOWN;
}
w = raw_cp->rawWidth;
h = raw_cp->rawHeight;
cmptparm = (opj_image_cmptparm_t*) malloc((size_t)numcomps * sizeof(opj_image_cmptparm_t));
@@ -2977,8 +2996,8 @@ static opj_image_t* rawtoimage_common(const char *filename, opj_cparameters_t *p
cmptparm[i].prec = (OPJ_UINT32)raw_cp->rawBitDepth;
cmptparm[i].bpp = (OPJ_UINT32)raw_cp->rawBitDepth;
cmptparm[i].sgnd = (OPJ_UINT32)raw_cp->rawSigned;
cmptparm[i].dx = (OPJ_UINT32)subsampling_dx;
cmptparm[i].dy = (OPJ_UINT32)subsampling_dy;
cmptparm[i].dx = (OPJ_UINT32)(subsampling_dx * raw_cp->rawComps[i].dx);
cmptparm[i].dy = (OPJ_UINT32)(subsampling_dy * raw_cp->rawComps[i].dy);
cmptparm[i].w = (OPJ_UINT32)w;
cmptparm[i].h = (OPJ_UINT32)h;
}
@@ -2999,7 +3018,8 @@ static opj_image_t* rawtoimage_common(const char *filename, opj_cparameters_t *p
{
unsigned char value = 0;
for(compno = 0; compno < numcomps; compno++) {
for (i = 0; i < w * h; i++) {
int nloop = (w*h)/(raw_cp->rawComps[compno].dx*raw_cp->rawComps[compno].dx);
for (i = 0; i < nloop; i++) {
if (!fread(&value, 1, 1, f)) {
fprintf(stderr,"Error reading raw file. End of file probably reached.\n");
return NULL;
@@ -3012,7 +3032,8 @@ static opj_image_t* rawtoimage_common(const char *filename, opj_cparameters_t *p
{
unsigned short value;
for(compno = 0; compno < numcomps; compno++) {
for (i = 0; i < w * h; i++) {
int nloop = (w*h)/(raw_cp->rawComps[compno].dx*raw_cp->rawComps[compno].dx);
for (i = 0; i < nloop; i++) {
unsigned char temp1;
unsigned char temp2;
if (!fread(&temp1, 1, 1, f)) {

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*
@@ -31,6 +37,16 @@
#ifndef __J2K_CONVERT_H
#define __J2K_CONVERT_H
/**@name RAW component encoding parameters */
/*@{*/
typedef struct raw_comp_cparameters {
/** subsampling in X direction */
int dx;
/** subsampling in Y direction */
int dy;
/*@}*/
} raw_comp_cparameters_t;
/**@name RAW image encoding parameters */
/*@{*/
typedef struct raw_cparameters {
@@ -38,12 +54,14 @@ typedef struct raw_cparameters {
int rawWidth;
/** height of the raw image */
int rawHeight;
/** components of the raw image */
/** number of components of the raw image */
int rawComp;
/** bit depth of the raw image */
int rawBitDepth;
/** signed/unsigned raw image */
OPJ_BOOL rawSigned;
/** bit depth of the raw image */
int rawBitDepth;
/** signed/unsigned raw image */
OPJ_BOOL rawSigned;
/** raw components parameters */
raw_comp_cparameters_t *rawComps;
/*@}*/
} raw_cparameters_t;

View File

@@ -1,6 +1,11 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* All rights reserved.
*

View File

@@ -1,6 +1,11 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* All rights reserved.
*

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>
@@ -80,25 +86,12 @@ typedef struct img_folder{
}img_fol_t;
static void encode_help_display(void) {
fprintf(stdout,"HELP for opj_compress\n----\n\n");
fprintf(stdout,"- the -h option displays this help information on screen\n\n");
fprintf(stdout,"\nThis is the opj_compress utility from the OpenJPEG project.\n"
"It compresses various image formats with the JPEG 2000 algorithm.\n"
"It has been compiled against openjp2 library v%s.\n\n",opj_version());
/* UniPG>> */
fprintf(stdout,"List of parameters for the JPEG 2000 "
#ifdef USE_JPWL
"+ JPWL "
#endif /* USE_JPWL */
"encoder:\n");
/* <<UniPG */
fprintf(stdout,"\n");
fprintf(stdout,"REMARKS:\n");
fprintf(stdout,"---------\n");
fprintf(stdout,"\n");
fprintf(stdout,"The markers written to the main_header are : SOC SIZ COD QCD COM.\n");
fprintf(stdout,"COD and QCD never appear in the tile_header.\n");
fprintf(stdout,"\n");
fprintf(stdout,"By default:\n");
fprintf(stdout,"------------\n");
fprintf(stdout,"Default encoding options:\n");
fprintf(stdout,"-------------------------\n");
fprintf(stdout,"\n");
fprintf(stdout," * Lossless\n");
fprintf(stdout," * 1 tile\n");
@@ -111,7 +104,9 @@ static void encode_help_display(void) {
fprintf(stdout," * No sub-sampling in x or y direction\n");
fprintf(stdout," * No mode switch activated\n");
fprintf(stdout," * Progression order: LRCP\n");
#ifdef FIXME_INDEX
fprintf(stdout," * No index file\n");
#endif /* FIXME_INDEX */
fprintf(stdout," * No ROI upshifted\n");
fprintf(stdout," * No offset of the origin of the image\n");
fprintf(stdout," * No offset of the origin of the tiles\n");
@@ -122,176 +117,204 @@ static void encode_help_display(void) {
#endif /* USE_JPWL */
/* <<UniPG */
fprintf(stdout,"\n");
fprintf(stdout,"Note:\n");
fprintf(stdout,"-----\n");
fprintf(stdout,"\n");
fprintf(stdout,"The markers written to the main_header are : SOC SIZ COD QCD COM.\n");
fprintf(stdout,"COD and QCD never appear in the tile_header.\n");
fprintf(stdout,"\n");
fprintf(stdout,"Parameters:\n");
fprintf(stdout,"------------\n");
fprintf(stdout,"-----------\n");
fprintf(stdout,"\n");
fprintf(stdout,"Required Parameters (except with -h):\n");
fprintf(stdout,"One of the two options -ImgDir or -i must be used\n");
fprintf(stdout,"\n");
fprintf(stdout,"-ImgDir : Image file Directory path (example ../Images) \n");
fprintf(stdout,"-i <file>\n");
fprintf(stdout," Input file\n");
fprintf(stdout," Known extensions are <PBM|PGM|PPM|PNM|PAM|PGX|PNG|BMP|TIF|RAW|RAWL|TGA>\n");
fprintf(stdout," If used, '-o <file>' must be provided\n");
fprintf(stdout,"-o <compressed file>\n");
fprintf(stdout," Output file (accepted extensions are j2k or jp2).\n");
fprintf(stdout,"-ImgDir <dir>\n");
fprintf(stdout," Image file Directory path (example ../Images) \n");
fprintf(stdout," When using this option -OutFor must be used\n");
fprintf(stdout,"\n");
fprintf(stdout,"-OutFor \n");
fprintf(stdout," REQUIRED only if -ImgDir is used\n");
fprintf(stdout," Need to specify only format without filename <BMP> \n");
fprintf(stdout," Currently accepts PBM, PGM, PPM, PNM, PAM, PGX, PNG, BMP, TIF, RAW (MSB), RAWL (LSB) and TGA formats\n");
fprintf(stdout,"\n");
fprintf(stdout,"-i : source file (-i source.pnm also *pbm, *.pgm, *.ppm, *.pam, *.pgx, *png, *.bmp, *.tif, *.raw, *.tga) \n");
fprintf(stdout," When using this option -o must be used\n");
fprintf(stdout,"\n");
fprintf(stdout,"-o : destination file (-o dest.j2k or .jp2) \n");
fprintf(stdout,"-OutFor <J2K|J2C|JP2>\n");
fprintf(stdout," Output format for compressed files.\n");
fprintf(stdout," Required only if -ImgDir is used\n");
fprintf(stdout,"-F <width>,<height>,<ncomp>,<bitdepth>,{s,u}@<dx1>x<dy1>:...:<dxn>x<dyn>\n");
fprintf(stdout," Characteristics of the raw input image\n");
fprintf(stdout," If subsampling is omitted, 1x1 is assumed for all components\n");
fprintf(stdout," Example: -F 512,512,3,8,u@1x1:2x2:2x2\n");
fprintf(stdout," for raw 512x512 image with 4:2:0 subsampling\n");
fprintf(stdout," Required only if RAW or RAWL input file is provided.\n");
fprintf(stdout,"\n");
fprintf(stdout,"Optional Parameters:\n");
fprintf(stdout,"\n");
fprintf(stdout,"-h : display the help information \n ");
fprintf(stdout,"\n");
fprintf(stdout,"-cinema2K : Digital Cinema 2K profile compliant codestream for 2K resolution.(-CINEMA2K 24 or 48) \n");
fprintf(stdout," Need to specify the frames per second for a 2K resolution. Only 24 or 48 fps is allowed\n");
fprintf(stdout,"\n");
fprintf(stdout,"-cinema4K : Digital Cinema 4K profile compliant codestream for 4K resolution \n");
fprintf(stdout," Frames per second not required. Default value is 24fps\n");
fprintf(stdout,"\n");
fprintf(stdout,"-r : different compression ratios for successive layers (-r 20,10,5)\n ");
fprintf(stdout," - The rate specified for each quality level is the desired \n");
fprintf(stdout," compression factor.\n");
fprintf(stdout," Example: -r 20,10,1 means quality 1: compress 20x, \n");
fprintf(stdout," quality 2: compress 10x and quality 3: compress lossless\n");
fprintf(stdout,"\n");
fprintf(stdout," (options -r and -q cannot be used together)\n ");
fprintf(stdout,"\n");
fprintf(stdout,"-q : different psnr for successive layers (-q 30,40,50) \n ");
fprintf(stdout," (options -r and -q cannot be used together)\n ");
fprintf(stdout,"\n");
fprintf(stdout,"-n : number of resolutions (-n 3) \n");
fprintf(stdout,"\n");
fprintf(stdout,"-b : size of code block (-b 32,32) \n");
fprintf(stdout,"\n");
fprintf(stdout,"-c : size of precinct (-c 128,128) \n");
fprintf(stdout,"\n");
fprintf(stdout,"-t : size of tile (-t 512,512) \n");
fprintf(stdout,"\n");
fprintf(stdout,"-p : progression order (-p LRCP) [LRCP, RLCP, RPCL, PCRL, CPRL] \n");
fprintf(stdout,"\n");
fprintf(stdout,"-s : subsampling factor (-s 2,2) [-s X,Y] \n");
fprintf(stdout," Remark: subsampling bigger than 2 can produce error\n");
fprintf(stdout,"\n");
fprintf(stdout,"-POC : Progression order change (-POC T1=0,0,1,5,3,CPRL/T1=5,0,1,6,3,CPRL) \n");
fprintf(stdout," Example: T1=0,0,1,5,3,CPRL \n");
fprintf(stdout," : Ttilenumber=Resolution num start,Component num start,Layer num end,Resolution num end,Component num end,Progression order\n");
fprintf(stdout,"\n");
fprintf(stdout,"-SOP : write SOP marker before each packet \n");
fprintf(stdout,"\n");
fprintf(stdout,"-EPH : write EPH marker after each header packet \n");
fprintf(stdout,"\n");
fprintf(stdout,"-M : mode switch (-M 3) [1=BYPASS(LAZY) 2=RESET 4=RESTART(TERMALL)\n");
fprintf(stdout," 8=VSC 16=ERTERM(SEGTERM) 32=SEGMARK(SEGSYM)] \n");
fprintf(stdout," Indicate multiple modes by adding their values. \n");
fprintf(stdout," ex: RESTART(4) + RESET(2) + SEGMARK(32) = -M 38\n");
fprintf(stdout,"\n");
fprintf(stdout,"-TP : divide packets of every tile into tile-parts (-TP R) [R, L, C]\n");
fprintf(stdout,"\n");
fprintf(stdout,"-x : create an index file *.Idx (-x index_name.Idx) \n");
fprintf(stdout,"\n");
fprintf(stdout,"-ROI : c=%%d,U=%%d : quantization indices upshifted \n");
fprintf(stdout," for component c=%%d [%%d = 0,1,2]\n");
fprintf(stdout," with a value of U=%%d [0 <= %%d <= 37] (i.e. -ROI c=0,U=25) \n");
fprintf(stdout,"\n");
fprintf(stdout,"-d : offset of the origin of the image (-d 150,300) \n");
fprintf(stdout,"\n");
fprintf(stdout,"-T : offset of the origin of the tiles (-T 100,75) \n");
fprintf(stdout,"\n");
fprintf(stdout,"-I : use the irreversible DWT 9-7 (-I) \n");
fprintf(stdout,"\n");
fprintf(stdout,"-F : characteristics of the raw input image\n");
fprintf(stdout," -F rawWidth,rawHeight,rawComp,rawBitDepth,s/u (Signed/Unsigned)\n");
fprintf(stdout," Example: -i lena.raw -o lena.j2k -F 512,512,3,8,u\n");
fprintf(stdout,"\n");
fprintf(stdout,"-mct {0,1,2} : explicitely specifies if an Multiple Component Transform has to be used.\n");
fprintf(stdout," 0: no MCT ; 1: RGB->YCC conversion ; 2: custom MCT.\n");
fprintf(stdout," If custom MCT, \"-m\" option has to be used (see hereunder).\n");
fprintf(stdout," By default, RGB->YCC conversion is used if there are 3 components or more,\n");
fprintf(stdout," no conversion otherwise.\n");
fprintf(stdout,"-m <file> : use array-based MCT, values are coma separated, line by line\n");
fprintf(stdout," no specific separators between lines, no space allowed between values\n");
fprintf(stdout," If this option is used, it automatically sets \"-mct\" option to 2.\n");
fprintf(stdout,"-jpip : write jpip codestream index box in JP2 output file\n");
fprintf(stdout," NOTICE: currently supports only RPCL order\n");
fprintf(stdout,"\n");
fprintf(stdout,"-h\n");
fprintf(stdout," Display the help information.\n");
fprintf(stdout,"-r <compression ratio>,<compression ratio>,...\n");
fprintf(stdout," Different compression ratios for successive layers.\n");
fprintf(stdout," The rate specified for each quality level is the desired\n");
fprintf(stdout," compression factor.\n");
fprintf(stdout," Decreasing ratios required.\n");
fprintf(stdout," Example: -r 20,10,1 means \n");
fprintf(stdout," quality layer 1: compress 20x, \n");
fprintf(stdout," quality layer 2: compress 10x \n");
fprintf(stdout," quality layer 3: compress lossless\n");
fprintf(stdout," Options -r and -q cannot be used together.\n");
fprintf(stdout,"-q <psnr value>,<psnr value>,<psnr value>,...\n");
fprintf(stdout," Different psnr for successive layers (-q 30,40,50).\n");
fprintf(stdout," Increasing PSNR values required.\n");
fprintf(stdout," Options -r and -q cannot be used together.\n");
fprintf(stdout,"-n <number of resolutions>\n");
fprintf(stdout," Number of resolutions.\n");
fprintf(stdout," It corresponds to the number of DWT decompositions +1. \n");
fprintf(stdout," Default: 6.\n");
fprintf(stdout,"-b <cblk width>,<cblk height>\n");
fprintf(stdout," Code-block size. The dimension must respect the constraint \n");
fprintf(stdout," defined in the JPEG-2000 standard (no dimension smaller than 4 \n");
fprintf(stdout," or greater than 1024, no code-block with more than 4096 coefficients).\n");
fprintf(stdout," The maximum value authorized is 64x64. \n");
fprintf(stdout," Default: 64x64.\n");
fprintf(stdout,"-c [<prec width>,<prec height>],[<prec width>,<prec height>],...\n");
fprintf(stdout," Precinct size. Values specified must be power of 2. \n");
fprintf(stdout," Multiple records may be supplied, in which case the first record refers\n");
fprintf(stdout," to the highest resolution level and subsequent records to lower \n");
fprintf(stdout," resolution levels. The last specified record is right-shifted for each \n");
fprintf(stdout," remaining lower resolution levels.\n");
fprintf(stdout," Default: 215x215 at each resolution.\n");
fprintf(stdout,"-t <tile width>,<tile height>\n");
fprintf(stdout," Tile size.\n");
fprintf(stdout," Default: the dimension of the whole image, thus only one tile.\n");
fprintf(stdout,"-p <LRCP|RLCP|RPCL|PCRL|CPRL>\n");
fprintf(stdout," Progression order.\n");
fprintf(stdout," Default: LRCP.\n");
fprintf(stdout,"-s <subX,subY>\n");
fprintf(stdout," Subsampling factor.\n");
fprintf(stdout," Subsampling bigger than 2 can produce error\n");
fprintf(stdout," Default: no subsampling.\n");
fprintf(stdout,"-POC <progression order change>/<progression order change>/...\n");
fprintf(stdout," Progression order change.\n");
fprintf(stdout," The syntax of a progression order change is the following:\n");
fprintf(stdout," T<tile>=<resStart>,<compStart>,<layerEnd>,<resEnd>,<compEnd>,<progOrder>\n");
fprintf(stdout," Example: -POC T1=0,0,1,5,3,CPRL/T1=5,0,1,6,3,CPRL\n");
fprintf(stdout,"-SOP\n");
fprintf(stdout," Write SOP marker before each packet.\n");
fprintf(stdout,"-EPH\n");
fprintf(stdout," Write EPH marker after each header packet.\n");
fprintf(stdout,"-M <key value>\n");
fprintf(stdout," Mode switch.\n");
fprintf(stdout," [1=BYPASS(LAZY) 2=RESET 4=RESTART(TERMALL)\n");
fprintf(stdout," 8=VSC 16=ERTERM(SEGTERM) 32=SEGMARK(SEGSYM)]\n");
fprintf(stdout," Indicate multiple modes by adding their values.\n");
fprintf(stdout," Example: RESTART(4) + RESET(2) + SEGMARK(32) => -M 38\n");
fprintf(stdout,"-TP <R|L|C>\n");
fprintf(stdout," Divide packets of every tile into tile-parts.\n");
fprintf(stdout," Division is made by grouping Resolutions (R), Layers (L)\n");
fprintf(stdout," or Components (C).\n");
#ifdef FIXME_INDEX
fprintf(stdout,"-x <index file>\n");
fprintf(stdout," Create an index file.\n");
#endif /*FIXME_INDEX*/
fprintf(stdout,"-ROI c=<component index>,U=<upshifting value>\n");
fprintf(stdout," Quantization indices upshifted for a component. \n");
fprintf(stdout," Warning: This option does not implement the usual ROI (Region of Interest).\n");
fprintf(stdout," It should be understood as a 'Component of Interest'. It offers the \n");
fprintf(stdout," possibility to upshift the value of a component during quantization step.\n");
fprintf(stdout," The value after c= is the component number [0, 1, 2, ...] and the value \n");
fprintf(stdout," after U= is the value of upshifting. U must be in the range [0, 37].\n");
fprintf(stdout,"-d <image offset X,image offset Y>\n");
fprintf(stdout," Offset of the origin of the image.\n");
fprintf(stdout,"-T <tile offset X,tile offset Y>\n");
fprintf(stdout," Offset of the origin of the tiles.\n");
fprintf(stdout,"-I\n");
fprintf(stdout," Use the irreversible DWT 9-7.\n");
fprintf(stdout,"-mct <0|1|2>\n");
fprintf(stdout," Explicitely specifies if a Multiple Component Transform has to be used.\n");
fprintf(stdout," 0: no MCT ; 1: RGB->YCC conversion ; 2: custom MCT.\n");
fprintf(stdout," If custom MCT, \"-m\" option has to be used (see hereunder).\n");
fprintf(stdout," By default, RGB->YCC conversion is used if there are 3 components or more,\n");
fprintf(stdout," no conversion otherwise.\n");
fprintf(stdout,"-m <file>\n");
fprintf(stdout," Use array-based MCT, values are coma separated, line by line\n");
fprintf(stdout," No specific separators between lines, no space allowed between values.\n");
fprintf(stdout," If this option is used, it automatically sets \"-mct\" option to 2.\n");
fprintf(stdout,"-cinema2K <24|48>\n");
fprintf(stdout," Digital Cinema 2K profile compliant codestream.\n");
fprintf(stdout," Need to specify the frames per second for a 2K resolution.\n");
fprintf(stdout," Only 24 or 48 fps are currently allowed.\n");
fprintf(stdout,"-cinema4K\n");
fprintf(stdout," Digital Cinema 4K profile compliant codestream.\n");
fprintf(stdout," Frames per second not required. Default value is 24fps.\n");
fprintf(stdout,"-jpip\n");
fprintf(stdout," Write jpip codestream index box in JP2 output file.\n");
fprintf(stdout," Currently supports only RPCL order.\n");
fprintf(stdout,"-C <comment>\n");
fprintf(stdout," Add <comment> in the comment marker segment.\n");
/* UniPG>> */
#ifdef USE_JPWL
fprintf(stdout,"-W : adoption of JPWL (Part 11) capabilities (-W params)\n");
fprintf(stdout," The parameters can be written and repeated in any order:\n");
fprintf(stdout," [h<tilepart><=type>,s<tilepart><=method>,a=<addr>,...\n");
fprintf(stdout," ...,z=<size>,g=<range>,p<tilepart:pack><=type>]\n");
fprintf(stdout,"\n");
fprintf(stdout," h selects the header error protection (EPB): 'type' can be\n");
fprintf(stdout," [0=none 1,absent=predefined 16=CRC-16 32=CRC-32 37-128=RS]\n");
fprintf(stdout," if 'tilepart' is absent, it is for main and tile headers\n");
fprintf(stdout," if 'tilepart' is present, it applies from that tile\n");
fprintf(stdout," onwards, up to the next h<> spec, or to the last tilepart\n");
fprintf(stdout," in the codestream (max. %d specs)\n", JPWL_MAX_NO_TILESPECS);
fprintf(stdout,"\n");
fprintf(stdout," p selects the packet error protection (EEP/UEP with EPBs)\n");
fprintf(stdout," to be applied to raw data: 'type' can be\n");
fprintf(stdout," [0=none 1,absent=predefined 16=CRC-16 32=CRC-32 37-128=RS]\n");
fprintf(stdout," if 'tilepart:pack' is absent, it is from tile 0, packet 0\n");
fprintf(stdout," if 'tilepart:pack' is present, it applies from that tile\n");
fprintf(stdout," and that packet onwards, up to the next packet spec\n");
fprintf(stdout," or to the last packet in the last tilepart in the stream\n");
fprintf(stdout," (max. %d specs)\n", JPWL_MAX_NO_PACKSPECS);
fprintf(stdout,"\n");
fprintf(stdout," s enables sensitivity data insertion (ESD): 'method' can be\n");
fprintf(stdout," [-1=NO ESD 0=RELATIVE ERROR 1=MSE 2=MSE REDUCTION 3=PSNR\n");
fprintf(stdout," 4=PSNR INCREMENT 5=MAXERR 6=TSE 7=RESERVED]\n");
fprintf(stdout," if 'tilepart' is absent, it is for main header only\n");
fprintf(stdout," if 'tilepart' is present, it applies from that tile\n");
fprintf(stdout," onwards, up to the next s<> spec, or to the last tilepart\n");
fprintf(stdout," in the codestream (max. %d specs)\n", JPWL_MAX_NO_TILESPECS);
fprintf(stdout,"\n");
fprintf(stdout," g determines the addressing mode: <range> can be\n");
fprintf(stdout," [0=PACKET 1=BYTE RANGE 2=PACKET RANGE]\n");
fprintf(stdout,"\n");
fprintf(stdout," a determines the size of data addressing: <addr> can be\n");
fprintf(stdout," 2/4 bytes (small/large codestreams). If not set, auto-mode\n");
fprintf(stdout,"\n");
fprintf(stdout," z determines the size of sensitivity values: <size> can be\n");
fprintf(stdout," 1/2 bytes, for the transformed pseudo-floating point value\n");
fprintf(stdout,"\n");
fprintf(stdout," ex.:\n");
fprintf(stdout," h,h0=64,h3=16,h5=32,p0=78,p0:24=56,p1,p3:0=0,p3:20=32,s=0,\n");
fprintf(stdout," s0=6,s3=-1,a=0,g=1,z=1\n");
fprintf(stdout," means\n");
fprintf(stdout," predefined EPB in MH, rs(64,32) from TPH 0 to TPH 2,\n");
fprintf(stdout," CRC-16 in TPH 3 and TPH 4, CRC-32 in remaining TPHs,\n");
fprintf(stdout," UEP rs(78,32) for packets 0 to 23 of tile 0,\n");
fprintf(stdout," UEP rs(56,32) for packs. 24 to the last of tilepart 0,\n");
fprintf(stdout," UEP rs default for packets of tilepart 1,\n");
fprintf(stdout," no UEP for packets 0 to 19 of tilepart 3,\n");
fprintf(stdout," UEP CRC-32 for packs. 20 of tilepart 3 to last tilepart,\n");
fprintf(stdout," relative sensitivity ESD for MH,\n");
fprintf(stdout," TSE ESD from TPH 0 to TPH 2, byte range with automatic\n");
fprintf(stdout," size of addresses and 1 byte for each sensitivity value\n");
fprintf(stdout,"\n");
fprintf(stdout," ex.:\n");
fprintf(stdout," h,s,p\n");
fprintf(stdout," means\n");
fprintf(stdout," default protection to headers (MH and TPHs) as well as\n");
fprintf(stdout," data packets, one ESD in MH\n");
fprintf(stdout,"\n");
fprintf(stdout," N.B.: use the following recommendations when specifying\n");
fprintf(stdout," the JPWL parameters list\n");
fprintf(stdout," - when you use UEP, always pair the 'p' option with 'h'\n");
fprintf(stdout," \n");
fprintf(stdout,"-W <params>\n");
fprintf(stdout," Adoption of JPWL (Part 11) capabilities (-W params)\n");
fprintf(stdout," The <params> field can be written and repeated in any order:\n");
fprintf(stdout," [h<tilepart><=type>,s<tilepart><=method>,a=<addr>,...\n");
fprintf(stdout," ...,z=<size>,g=<range>,p<tilepart:pack><=type>]\n");
fprintf(stdout," h selects the header error protection (EPB): 'type' can be\n");
fprintf(stdout," [0=none 1,absent=predefined 16=CRC-16 32=CRC-32 37-128=RS]\n");
fprintf(stdout," if 'tilepart' is absent, it is for main and tile headers\n");
fprintf(stdout," if 'tilepart' is present, it applies from that tile\n");
fprintf(stdout," onwards, up to the next h<> spec, or to the last tilepart\n");
fprintf(stdout," in the codestream (max. %d specs)\n", JPWL_MAX_NO_TILESPECS);
fprintf(stdout," p selects the packet error protection (EEP/UEP with EPBs)\n");
fprintf(stdout," to be applied to raw data: 'type' can be\n");
fprintf(stdout," [0=none 1,absent=predefined 16=CRC-16 32=CRC-32 37-128=RS]\n");
fprintf(stdout," if 'tilepart:pack' is absent, it is from tile 0, packet 0\n");
fprintf(stdout," if 'tilepart:pack' is present, it applies from that tile\n");
fprintf(stdout," and that packet onwards, up to the next packet spec\n");
fprintf(stdout," or to the last packet in the last tilepart in the stream\n");
fprintf(stdout," (max. %d specs)\n", JPWL_MAX_NO_PACKSPECS);
fprintf(stdout," s enables sensitivity data insertion (ESD): 'method' can be\n");
fprintf(stdout," [-1=NO ESD 0=RELATIVE ERROR 1=MSE 2=MSE REDUCTION 3=PSNR\n");
fprintf(stdout," 4=PSNR INCREMENT 5=MAXERR 6=TSE 7=RESERVED]\n");
fprintf(stdout," if 'tilepart' is absent, it is for main header only\n");
fprintf(stdout," if 'tilepart' is present, it applies from that tile\n");
fprintf(stdout," onwards, up to the next s<> spec, or to the last tilepart\n");
fprintf(stdout," in the codestream (max. %d specs)\n", JPWL_MAX_NO_TILESPECS);
fprintf(stdout," g determines the addressing mode: <range> can be\n");
fprintf(stdout," [0=PACKET 1=BYTE RANGE 2=PACKET RANGE]\n");
fprintf(stdout," a determines the size of data addressing: <addr> can be\n");
fprintf(stdout," 2/4 bytes (small/large codestreams). If not set, auto-mode\n");
fprintf(stdout," z determines the size of sensitivity values: <size> can be\n");
fprintf(stdout," 1/2 bytes, for the transformed pseudo-floating point value\n");
fprintf(stdout," ex.:\n");
fprintf(stdout," h,h0=64,h3=16,h5=32,p0=78,p0:24=56,p1,p3:0=0,p3:20=32,s=0,\n");
fprintf(stdout," s0=6,s3=-1,a=0,g=1,z=1\n");
fprintf(stdout," means\n");
fprintf(stdout," predefined EPB in MH, rs(64,32) from TPH 0 to TPH 2,\n");
fprintf(stdout," CRC-16 in TPH 3 and TPH 4, CRC-32 in remaining TPHs,\n");
fprintf(stdout," UEP rs(78,32) for packets 0 to 23 of tile 0,\n");
fprintf(stdout," UEP rs(56,32) for packs. 24 to the last of tilepart 0,\n");
fprintf(stdout," UEP rs default for packets of tilepart 1,\n");
fprintf(stdout," no UEP for packets 0 to 19 of tilepart 3,\n");
fprintf(stdout," UEP CRC-32 for packs. 20 of tilepart 3 to last tilepart,\n");
fprintf(stdout," relative sensitivity ESD for MH,\n");
fprintf(stdout," TSE ESD from TPH 0 to TPH 2, byte range with automatic\n");
fprintf(stdout," size of addresses and 1 byte for each sensitivity value\n");
fprintf(stdout," ex.:\n");
fprintf(stdout," h,s,p\n");
fprintf(stdout," means\n");
fprintf(stdout," default protection to headers (MH and TPHs) as well as\n");
fprintf(stdout," data packets, one ESD in MH\n");
fprintf(stdout," N.B.: use the following recommendations when specifying\n");
fprintf(stdout," the JPWL parameters list\n");
fprintf(stdout," - when you use UEP, always pair the 'p' option with 'h'\n");
#endif /* USE_JPWL */
/* <<UniPG */
fprintf(stdout,"IMPORTANT:\n");
fprintf(stdout,"-----------\n");
fprintf(stdout,"\n");
fprintf(stdout,"The index file has the structure below:\n");
fprintf(stdout,"---------------------------------------\n");
#ifdef FIXME_INDEX
fprintf(stdout,"Index structure:\n");
fprintf(stdout,"----------------\n");
fprintf(stdout,"\n");
fprintf(stdout,"Image_height Image_width\n");
fprintf(stdout,"progression order\n");
@@ -321,10 +344,9 @@ static void encode_help_display(void) {
fprintf(stdout,"Tpacket_0 Tile layer res. comp. prec. start_pos end_pos disto\n");
fprintf(stdout,"...\n");
fprintf(stdout,"Tpacket_Np '' '' '' '' '' '' '' ''\n");
fprintf(stdout,"MaxDisto\n");
fprintf(stdout,"TotalDisto\n\n");
#endif /*FIXME_INDEX*/
}
static OPJ_PROG_ORDER give_progression(const char progression[4]) {
@@ -496,8 +518,8 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
break;
default:
fprintf(stderr,
"!! Unrecognized format for infile : %s "
"[accept only *.pnm, *.pgm, *.ppm, *.pgx, *png, *.bmp, *.tif, *.raw or *.tga] !!\n\n",
"[ERROR] Unknown input file format: %s \n"
" Known file formats are *.pnm, *.pgm, *.ppm, *.pgx, *png, *.bmp, *.tif, *.raw or *.tga\n",
infile);
return 1;
}
@@ -569,31 +591,82 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
case 'F': /* Raw image format parameters */
{
OPJ_BOOL wrong = OPJ_FALSE;
char *substr1;
char *substr2;
char *sep;
char signo;
char *s = opj_optarg;
if (sscanf(s, "%d,%d,%d,%d,%c", &raw_cp->rawWidth, &raw_cp->rawHeight, &raw_cp->rawComp, &raw_cp->rawBitDepth, &signo) == 5) {
int width,height,bitdepth,ncomp;
OPJ_UINT32 len;
OPJ_BOOL raw_signed;
substr2 = strchr(opj_optarg,'@');
if (substr2 == NULL) {
len = (OPJ_UINT32) strlen(opj_optarg);
} else {
len = (OPJ_UINT32) (substr2 - opj_optarg);
substr2++; /* skip '@' character */
}
substr1 = (char*) malloc((len+1)*sizeof(char));
memcpy(substr1,opj_optarg,len);
substr1[len] = '\0';
if (sscanf(substr1, "%d,%d,%d,%d,%c", &width, &height, &ncomp, &bitdepth, &signo) == 5) {
if (signo == 's') {
raw_cp->rawSigned = OPJ_TRUE;
fprintf(stdout,"\nRaw file parameters: %d,%d,%d,%d Signed\n", raw_cp->rawWidth, raw_cp->rawHeight, raw_cp->rawComp, raw_cp->rawBitDepth);
raw_signed = OPJ_TRUE;
} else if (signo == 'u') {
raw_signed = OPJ_FALSE;
} else {
wrong = OPJ_TRUE;
}
else if (signo == 'u') {
raw_cp->rawSigned = OPJ_FALSE;
fprintf(stdout,"\nRaw file parameters: %d,%d,%d,%d Unsigned\n", raw_cp->rawWidth, raw_cp->rawHeight, raw_cp->rawComp, raw_cp->rawBitDepth);
}
else {
fprintf(stderr,"\nError: invalid raw image parameters: Unknown sign of raw file\n");
fprintf(stderr,"Please use the Format option -F:\n");
fprintf(stderr,"-F rawWidth,rawHeight,rawComp,rawBitDepth,s/u (Signed/Unsigned)\n");
fprintf(stderr,"Example: -i lena.raw -o lena.j2k -F 512,512,3,8,u\n");
fprintf(stderr,"Aborting\n");
} else {
wrong = OPJ_TRUE;
}
if (!wrong) {
int i;
int lastdx = 1;
int lastdy = 1;
raw_cp->rawWidth = width;
raw_cp->rawHeight = height;
raw_cp->rawComp = ncomp;
raw_cp->rawBitDepth = bitdepth;
raw_cp->rawSigned = raw_signed;
raw_cp->rawComps = (raw_comp_cparameters_t*) malloc(((OPJ_UINT32)(ncomp))*sizeof(raw_comp_cparameters_t));
for (i = 0; i < ncomp && !wrong; i++) {
if (substr2 == NULL) {
raw_cp->rawComps[i].dx = lastdx;
raw_cp->rawComps[i].dy = lastdy;
} else {
int dx,dy;
sep = strchr(substr2,':');
if (sep == NULL) {
if (sscanf(substr2, "%dx%d", &dx, &dy) == 2) {
lastdx = dx;
lastdy = dy;
raw_cp->rawComps[i].dx = dx;
raw_cp->rawComps[i].dy = dy;
substr2 = NULL;
} else {
wrong = OPJ_TRUE;
}
} else {
if (sscanf(substr2, "%dx%d:%s", &dx, &dy, substr2) == 3) {
raw_cp->rawComps[i].dx = dx;
raw_cp->rawComps[i].dy = dy;
} else {
wrong = OPJ_TRUE;
}
}
}
}
}
else {
if (substr1) free(substr1);
if (wrong) {
fprintf(stderr,"\nError: invalid raw image parameters\n");
fprintf(stderr,"Please use the Format option -F:\n");
fprintf(stderr,"-F rawWidth,rawHeight,rawComp,rawBitDepth,s/u (Signed/Unsigned)\n");
fprintf(stderr,"Example: -i lena.raw -o lena.j2k -F 512,512,3,8,u\n");
fprintf(stderr,"Aborting\n");
fprintf(stderr,"-F <width>,<height>,<ncomp>,<bitdepth>,{s,u}@<dx1>x<dy1>:...:<dxn>x<dyn>\n");
fprintf(stderr,"If subsampling is omitted, 1x1 is assumed for all components\n");
fprintf(stderr,"Example: -i image.raw -o image.j2k -F 512,512,3,8,u@1x1:2x2:2x2\n");
fprintf(stderr," for raw 512x512 image with 4:2:0 subsampling\n");
fprintf(stderr,"Aborting.\n");
return 1;
}
}
@@ -733,6 +806,11 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
{
char *index = opj_optarg;
strncpy(indexfilename, index, OPJ_PATH_LEN);
/* FIXME ADE INDEX >> */
fprintf(stderr,
"[WARNING] Index file generation is currently broken.\n"
" '-x' option ignored.\n");
/* << FIXME ADE INDEX */
}
break;
@@ -911,9 +989,13 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
int fps=0;
sscanf(opj_optarg,"%d",&fps);
if(fps == 24){
parameters->cp_cinema = OPJ_CINEMA2K_24;
parameters->rsiz = OPJ_PROFILE_CINEMA_2K;
parameters->max_comp_size = OPJ_CINEMA_24_COMP;
parameters->max_cs_size = OPJ_CINEMA_24_CS;
}else if(fps == 48 ){
parameters->cp_cinema = OPJ_CINEMA2K_48;
parameters->rsiz = OPJ_PROFILE_CINEMA_2K;
parameters->max_comp_size = OPJ_CINEMA_48_COMP;
parameters->max_cs_size = OPJ_CINEMA_48_CS;
}else {
fprintf(stderr,"Incorrect value!! must be 24 or 48\n");
return 1;
@@ -928,7 +1010,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
case 'y': /* Digital Cinema 4K profile compliance*/
{
parameters->cp_cinema = OPJ_CINEMA4K_24;
parameters->rsiz = OPJ_PROFILE_CINEMA_4K;
fprintf(stdout,"CINEMA 4K profile activated\n"
"Other options specified could be overriden\n");
}
@@ -1351,37 +1433,38 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
default:
fprintf(stderr, "ERROR -> Command line not valid\n");
return 1;
fprintf(stderr, "[WARNING] An invalid option has been ignored\n");
break;
}
}while(c != -1);
if(img_fol->set_imgdir == 1){
if(!(parameters->infile[0] == 0)){
fprintf(stderr, "Error: options -ImgDir and -i cannot be used together !!\n");
fprintf(stderr, "[ERROR] options -ImgDir and -i cannot be used together !!\n");
return 1;
}
if(img_fol->set_out_format == 0){
fprintf(stderr, "Error: When -ImgDir is used, -OutFor <FORMAT> must be used !!\n");
fprintf(stderr, "[ERROR] When -ImgDir is used, -OutFor <FORMAT> must be used !!\n");
fprintf(stderr, "Only one format allowed! Valid formats are j2k and jp2!!\n");
return 1;
}
if(!((parameters->outfile[0] == 0))){
fprintf(stderr, "Error: options -ImgDir and -o cannot be used together !!\n");
fprintf(stderr, "[ERROR] options -ImgDir and -o cannot be used together !!\n");
fprintf(stderr, "Specify OutputFormat using -OutFor<FORMAT> !!\n");
return 1;
}
}else{
if((parameters->infile[0] == 0) || (parameters->outfile[0] == 0)) {
fprintf(stderr, "Example: %s -i image.ppm -o image.j2k\n",argv[0]);
fprintf(stderr, " Try: %s -h\n",argv[0]);
fprintf(stderr, "[ERROR] Required parameters are missing\n"
"Example: %s -i image.j2k -o image.pgm\n",argv[0]);
fprintf(stderr, " Help: %s -h\n",argv[0]);
return 1;
}
}
if ( (parameters->decod_format == RAW_DFMT && raw_cp->rawWidth == 0)
|| (parameters->decod_format == RAWL_DFMT && raw_cp->rawWidth == 0)) {
fprintf(stderr,"\nError: invalid raw image parameters\n");
fprintf(stderr,"[ERROR] invalid raw image parameters\n");
fprintf(stderr,"Please use the Format option -F:\n");
fprintf(stderr,"-F rawWidth,rawHeight,rawComp,rawBitDepth,s/u (Signed/Unsigned)\n");
fprintf(stderr,"Example: -i lena.raw -o lena.j2k -F 512,512,3,8,u\n");
@@ -1391,7 +1474,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
if ((parameters->cp_disto_alloc || parameters->cp_fixed_alloc || parameters->cp_fixed_quality)
&& (!(parameters->cp_disto_alloc ^ parameters->cp_fixed_alloc ^ parameters->cp_fixed_quality))) {
fprintf(stderr, "Error: options -r -q and -f cannot be used together !!\n");
fprintf(stderr, "[ERROR] options -r -q and -f cannot be used together !!\n");
return 1;
} /* mod fixed_quality */
@@ -1404,7 +1487,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
if((parameters->cp_tx0 > parameters->image_offset_x0) || (parameters->cp_ty0 > parameters->image_offset_y0)) {
fprintf(stderr,
"Error: Tile offset dimension is unnappropriate --> TX0(%d)<=IMG_X0(%d) TYO(%d)<=IMG_Y0(%d) \n",
"[ERROR] Tile offset dimension is unnappropriate --> TX0(%d)<=IMG_X0(%d) TYO(%d)<=IMG_Y0(%d) \n",
parameters->cp_tx0, parameters->image_offset_x0, parameters->cp_ty0, parameters->image_offset_y0);
return 1;
}
@@ -1475,8 +1558,16 @@ int main(int argc, char **argv) {
*indexfilename = 0;
memset(&img_fol,0,sizeof(img_fol_t));
/* raw_cp initialization */
raw_cp.rawBitDepth = 0;
raw_cp.rawComp = 0;
raw_cp.rawComps = 0;
raw_cp.rawHeight = 0;
raw_cp.rawSigned = 0;
raw_cp.rawWidth = 0;
/* parse input and get user encoding parameters */
parameters.tcp_mct = -1; /* This will be set later according to the input image or the provided option */
parameters.tcp_mct = (char) 255; /* This will be set later according to the input image or the provided option */
if(parse_cmdline_encoder(argc, argv, &parameters,&img_fol, &raw_cp, indexfilename) == 1) {
return 1;
}
@@ -1636,8 +1727,8 @@ int main(int argc, char **argv) {
}
/* Decide if MCT should be used */
if (parameters.tcp_mct == -1) { /* mct mode has not been set in commandline */
parameters.tcp_mct = image->numcomps >= 3 ? 1 : 0;
if (parameters.tcp_mct == (char) 255) { /* mct mode has not been set in commandline */
parameters.tcp_mct = (image->numcomps >= 3) ? 1 : 0;
} else { /* mct mode has been set in commandline */
if ((parameters.tcp_mct == 1) && (image->numcomps < 3)){
fprintf(stderr, "RGB->YCC conversion cannot be used:\n");
@@ -1669,7 +1760,7 @@ int main(int argc, char **argv) {
}
default:
fprintf(stderr, "skipping file..\n");
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
continue;
}
@@ -1688,7 +1779,7 @@ int main(int argc, char **argv) {
opj_setup_encoder(l_codec, &parameters, image);
/* open a byte stream for writing and allocate memory for all tiles */
l_stream = opj_stream_create_default_file_stream_v3(parameters.outfile,OPJ_FALSE);
l_stream = opj_stream_create_default_file_stream(parameters.outfile,OPJ_FALSE);
if (! l_stream){
return 1;
}
@@ -1698,7 +1789,7 @@ int main(int argc, char **argv) {
if (!bSuccess) {
fprintf(stderr, "failed to encode image: opj_start_compress\n");
}
if( bUseTiles ) {
if( bSuccess && bUseTiles ) {
OPJ_BYTE *l_data;
OPJ_UINT32 l_data_size = 512*512*3;
l_data = (OPJ_BYTE*) malloc( l_data_size * sizeof(OPJ_BYTE));
@@ -1707,7 +1798,7 @@ int main(int argc, char **argv) {
for (i=0;i<l_nb_tiles;++i) {
if (! opj_write_tile(l_codec,i,l_data,l_data_size,l_stream)) {
fprintf(stderr, "ERROR -> test_tile_encoder: failed to write the tile %d!\n",i);
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(image);
return 1;
@@ -1727,16 +1818,17 @@ int main(int argc, char **argv) {
}
if (!bSuccess) {
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(image);
fprintf(stderr, "failed to encode image\n");
remove(parameters.outfile);
return 1;
}
fprintf(stderr,"Generated outfile %s\n",parameters.outfile);
fprintf(stdout,"[INFO] Generated outfile %s\n",parameters.outfile);
/* close and free the byte stream */
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
/* free remaining compression structures */
opj_destroy_codec(l_codec);
@@ -1749,6 +1841,7 @@ int main(int argc, char **argv) {
/* free user parameters structure */
if(parameters.cp_comment) free(parameters.cp_comment);
if(parameters.cp_matrice) free(parameters.cp_matrice);
if(raw_cp.rawComps) free(raw_cp.rawComps);
return 0;
}

View File

@@ -1,12 +1,18 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*
@@ -100,31 +106,25 @@ int parse_DA_values( char* inArg, unsigned int *DA_x0, unsigned int *DA_y0, unsi
/* -------------------------------------------------------------------------- */
static void decode_help_display(void) {
fprintf(stdout,"HELP for opj_decompress\n----\n\n");
fprintf(stdout,"- the -h option displays this help information on screen\n\n");
fprintf(stdout,"\nThis is the opj_decompress utility from the OpenJPEG project.\n"
"It decompresses JPEG 2000 codestreams to various image formats.\n"
"It has been compiled against openjp2 library v%s.\n\n",opj_version());
/* UniPG>> */
fprintf(stdout,"List of parameters for the JPEG 2000 "
#ifdef USE_JPWL
"+ JPWL "
#endif /* USE_JPWL */
"decoder:\n");
/* <<UniPG */
fprintf(stdout,"Parameters:\n");
fprintf(stdout,"-----------\n");
fprintf(stdout,"\n");
fprintf(stdout,"\n");
fprintf(stdout," -ImgDir \n");
fprintf(stdout," -ImgDir <directory> \n");
fprintf(stdout," Image file Directory path \n");
fprintf(stdout," -OutFor \n");
fprintf(stdout," -OutFor <PBM|PGM|PPM|PNM|PAM|PGX|PNG|BMP|TIF|RAW|RAWL|TGA>\n");
fprintf(stdout," REQUIRED only if -ImgDir is used\n");
fprintf(stdout," Need to specify only format without filename <BMP> \n");
fprintf(stdout," Currently accepts PGM, PPM, PNM, PGX, PNG, BMP, TIF, RAW and TGA formats\n");
fprintf(stdout," Output format for decompressed images.\n");
fprintf(stdout," -i <compressed file>\n");
fprintf(stdout," REQUIRED only if an Input image directory not specified\n");
fprintf(stdout," REQUIRED only if an Input image directory is not specified\n");
fprintf(stdout," Currently accepts J2K-files, JP2-files and JPT-files. The file type\n");
fprintf(stdout," is identified based on its suffix.\n");
fprintf(stdout," -o <decompressed file>\n");
fprintf(stdout," REQUIRED\n");
fprintf(stdout," Currently accepts PGM, PPM, PNM, PGX, PNG, BMP, TIF, RAW and TGA files\n");
fprintf(stdout," Currently accepts formats specified above (see OutFor option)\n");
fprintf(stdout," Binary data is written to the file (not ascii). If a PGX\n");
fprintf(stdout," filename is given, there will be as many output files as there are\n");
fprintf(stdout," components: an indice starting from 0 will then be appended to the\n");
@@ -222,7 +222,7 @@ int get_file_format(const char *filename) {
if (ext == NULL)
return -1;
ext++;
if(ext) {
if(*ext) {
for(i = 0; i < sizeof(format)/sizeof(*format); i++) {
if(strcasecmp(ext, extension[i]) == 0) {
return format[i];
@@ -325,7 +325,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
int totlen, c;
opj_option_t long_option[]={
{"ImgDir",REQ_ARG, NULL ,'y'},
{"OutFor",REQ_ARG, NULL ,'O'},
{"OutFor",REQ_ARG, NULL ,'O'}
};
const char optlist[] = "i:o:r:l:x:d:t:"
@@ -335,7 +335,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
"W:"
#endif /* USE_JPWL */
/* <<UniPG */
"h" ;
"h" ;
totlen=sizeof(long_option);
img_fol->set_out_format = 0;
do {
@@ -361,7 +361,8 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
return 1;
default:
fprintf(stderr,
"!! Unrecognized format for infile: %s [accept only *.j2k, *.jp2, *.jpc or *.jpt] !!\n\n",
"[ERROR] Unknown input file format: %s \n"
" Known file formats are *.j2k, *.jp2, *.jpc or *.jpt\n",
infile);
return 1;
}
@@ -466,10 +467,10 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
decode_help_display();
return 1;
/* ------------------------------------------------------ */
/* ----------------------------------------------------- */
case 'y': /* Image Directory path */
{
{
img_fol->imgdirpath = (char*)malloc(strlen(opj_optarg) + 1);
strcpy(img_fol->imgdirpath,opj_optarg);
img_fol->set_imgdir=1;
@@ -583,31 +584,33 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i
/* ----------------------------------------------------- */
default:
fprintf(stderr,"WARNING -> this option is not valid \"-%c %s\"\n",c, opj_optarg);
break;
default:
fprintf(stderr, "[WARNING] An invalid option has been ignored.\n");
break;
}
}while(c != -1);
/* check for possible errors */
if(img_fol->set_imgdir==1){
if(!(parameters->infile[0]==0)){
fprintf(stderr, "Error: options -ImgDir and -i cannot be used together !!\n");
fprintf(stderr, "[ERROR] options -ImgDir and -i cannot be used together.\n");
return 1;
}
if(img_fol->set_out_format == 0){
fprintf(stderr, "Error: When -ImgDir is used, -OutFor <FORMAT> must be used !!\n");
fprintf(stderr, "Only one format allowed! Valid format PGM, PPM, PNM, PGX, BMP, TIF, RAW and TGA!!\n");
fprintf(stderr, "[ERROR] When -ImgDir is used, -OutFor <FORMAT> must be used.\n");
fprintf(stderr, "Only one format allowed.\n"
"Valid format are PGM, PPM, PNM, PGX, BMP, TIF, RAW and TGA.\n");
return 1;
}
if(!((parameters->outfile[0] == 0))){
fprintf(stderr, "Error: options -ImgDir and -o cannot be used together !!\n");
fprintf(stderr, "[ERROR] options -ImgDir and -o cannot be used together.\n");
return 1;
}
}else{
if((parameters->infile[0] == 0) || (parameters->outfile[0] == 0)) {
fprintf(stderr, "Example: %s -i image.j2k -o image.pgm\n",argv[0]);
fprintf(stderr, " Try: %s -h\n",argv[0]);
fprintf(stderr, "[ERROR] Required parameters are missing\n"
"Example: %s -i image.j2k -o image.pgm\n",argv[0]);
fprintf(stderr, " Help: %s -h\n",argv[0]);
return 1;
}
}
@@ -746,7 +749,7 @@ int main(int argc, char **argv)
/* read the input file and put it in memory */
/* ---------------------------------------- */
l_stream = opj_stream_create_default_file_stream_v3(parameters.infile,1);
l_stream = opj_stream_create_default_file_stream(parameters.infile,1);
if (!l_stream){
fprintf(stderr, "ERROR -> failed to create the stream from the file %s\n", parameters.infile);
return EXIT_FAILURE;
@@ -776,7 +779,7 @@ int main(int argc, char **argv)
}
default:
fprintf(stderr, "skipping file..\n");
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
continue;
}
@@ -788,7 +791,7 @@ int main(int argc, char **argv)
/* Setup the decoder decoding parameters using user parameters */
if ( !opj_setup_decoder(l_codec, &parameters) ){
fprintf(stderr, "ERROR -> opj_compress: failed to setup the decoder\n");
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
return EXIT_FAILURE;
}
@@ -797,7 +800,7 @@ int main(int argc, char **argv)
/* Read the main header of the codestream and if necessary the JP2 boxes*/
if(! opj_read_header(l_stream, l_codec, &image)){
fprintf(stderr, "ERROR -> opj_decompress: failed to read the header\n");
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(image);
return EXIT_FAILURE;
@@ -808,7 +811,7 @@ int main(int argc, char **argv)
if (!opj_set_decode_area(l_codec, image, (OPJ_INT32)parameters.DA_x0,
(OPJ_INT32)parameters.DA_y0, (OPJ_INT32)parameters.DA_x1, (OPJ_INT32)parameters.DA_y1)){
fprintf(stderr, "ERROR -> opj_decompress: failed to set the decoded area\n");
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(image);
return EXIT_FAILURE;
@@ -818,7 +821,7 @@ int main(int argc, char **argv)
if (!(opj_decode(l_codec, l_stream, image) && opj_end_decompress(l_codec, l_stream))) {
fprintf(stderr,"ERROR -> opj_decompress: failed to decode image!\n");
opj_destroy_codec(l_codec);
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
opj_image_destroy(image);
return EXIT_FAILURE;
}
@@ -829,7 +832,7 @@ int main(int argc, char **argv)
/*if (!opj_set_decoded_resolution_factor(l_codec, 5)) {
fprintf(stderr, "ERROR -> opj_decompress: failed to set the resolution factor tile!\n");
opj_destroy_codec(l_codec);
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
opj_image_destroy(image);
return EXIT_FAILURE;
}*/
@@ -837,7 +840,7 @@ int main(int argc, char **argv)
if (!opj_get_decoded_tile(l_codec, l_stream, image, parameters.tile_index)) {
fprintf(stderr, "ERROR -> opj_decompress: failed to decode tile!\n");
opj_destroy_codec(l_codec);
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
opj_image_destroy(image);
return EXIT_FAILURE;
}
@@ -845,7 +848,7 @@ int main(int argc, char **argv)
}
/* Close the byte stream */
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
if(image->color_space == OPJ_CLRSPC_SYCC){
color_sycc_to_rgb(image); /* FIXME */
@@ -871,81 +874,81 @@ int main(int argc, char **argv)
switch (parameters.cod_format) {
case PXM_DFMT: /* PNM PGM PPM */
if (imagetopnm(image, parameters.outfile)) {
fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
fprintf(stderr,"[ERROR] Outfile %s not generated\n",parameters.outfile);
failed = 1;
}
else {
fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
fprintf(stdout,"[INFO] Generated Outfile %s\n",parameters.outfile);
}
break;
case PGX_DFMT: /* PGX */
if(imagetopgx(image, parameters.outfile)){
fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
fprintf(stderr,"[ERROR] Outfile %s not generated\n",parameters.outfile);
failed = 1;
}
else {
fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
fprintf(stdout,"[INFO] Generated Outfile %s\n",parameters.outfile);
}
break;
case BMP_DFMT: /* BMP */
if(imagetobmp(image, parameters.outfile)){
fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
fprintf(stderr,"[ERROR] Outfile %s not generated\n",parameters.outfile);
failed = 1;
}
else {
fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
fprintf(stdout,"[INFO] Generated Outfile %s\n",parameters.outfile);
}
break;
#ifdef OPJ_HAVE_LIBTIFF
case TIF_DFMT: /* TIFF */
if(imagetotif(image, parameters.outfile)){
fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
fprintf(stderr,"[ERROR] Outfile %s not generated\n",parameters.outfile);
failed = 1;
}
else {
fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
fprintf(stdout,"[INFO] Generated Outfile %s\n",parameters.outfile);
}
break;
#endif /* OPJ_HAVE_LIBTIFF */
case RAW_DFMT: /* RAW */
if(imagetoraw(image, parameters.outfile)){
fprintf(stderr,"Error generating raw file. Outfile %s not generated\n",parameters.outfile);
fprintf(stderr,"[ERROR] Error generating raw file. Outfile %s not generated\n",parameters.outfile);
failed = 1;
}
else {
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
fprintf(stdout,"[INFO] Generated Outfile %s\n",parameters.outfile);
}
break;
case RAWL_DFMT: /* RAWL */
if(imagetorawl(image, parameters.outfile)){
fprintf(stderr,"Error generating rawl file. Outfile %s not generated\n",parameters.outfile);
fprintf(stderr,"[ERROR] Error generating rawl file. Outfile %s not generated\n",parameters.outfile);
failed = 1;
}
else {
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
fprintf(stdout,"[INFO] Generated Outfile %s\n",parameters.outfile);
}
break;
case TGA_DFMT: /* TGA */
if(imagetotga(image, parameters.outfile)){
fprintf(stderr,"Error generating tga file. Outfile %s not generated\n",parameters.outfile);
fprintf(stderr,"[ERROR] Error generating tga file. Outfile %s not generated\n",parameters.outfile);
failed = 1;
}
else {
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
fprintf(stdout,"[INFO] Generated Outfile %s\n",parameters.outfile);
}
break;
#ifdef OPJ_HAVE_LIBPNG
case PNG_DFMT: /* PNG */
if(imagetopng(image, parameters.outfile)){
fprintf(stderr,"Error generating png file. Outfile %s not generated\n",parameters.outfile);
fprintf(stderr,"[ERROR] Error generating png file. Outfile %s not generated\n",parameters.outfile);
failed = 1;
}
else {
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
fprintf(stdout,"[INFO] Generated Outfile %s\n",parameters.outfile);
}
break;
#endif /* OPJ_HAVE_LIBPNG */
@@ -953,7 +956,7 @@ int main(int argc, char **argv)
* and OPJ_HAVE_LIBTIF or OPJ_HAVE_LIBPNG is undefined
*/
default:
fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
fprintf(stderr,"[ERROR] Outfile %s not generated\n",parameters.outfile);
failed = 1;
}
@@ -969,6 +972,7 @@ int main(int argc, char **argv)
/* destroy the codestream index */
opj_destroy_cstr_index(&cstr_index);
if(failed) remove(parameters.outfile);
}
return failed ? EXIT_FAILURE : EXIT_SUCCESS;
}

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2010, Mathieu Malaterre, GDCM
* Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2012, CS Systemes d'Information, France
@@ -86,19 +91,14 @@ static int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *param
/* -------------------------------------------------------------------------- */
static void decode_help_display(void) {
fprintf(stdout,"HELP for opj_dump\n----\n\n");
fprintf(stdout,"- the -h option displays this help information on screen\n\n");
fprintf(stdout,"\nThis is the opj_dump utility from the OpenJPEG project.\n"
"It dumps JPEG 2000 codestream info to stdout or a given file.\n"
"It has been compiled against openjp2 library v%s.\n\n",opj_version());
/* UniPG>> */
fprintf(stdout,"List of parameters for the JPEG 2000 "
#ifdef USE_JPWL
"+ JPWL "
#endif /* USE_JPWL */
"decoder:\n");
/* <<UniPG */
fprintf(stdout,"\n");
fprintf(stdout,"\n");
fprintf(stdout," -ImgDir \n");
fprintf(stdout,"Parameters:\n");
fprintf(stdout,"-----------\n");
fprintf(stdout,"\n");
fprintf(stdout," -ImgDir <directory>\n");
fprintf(stdout," Image file Directory path \n");
fprintf(stdout," -i <compressed file>\n");
fprintf(stdout," REQUIRED only if an Input image directory not specified\n");
@@ -108,10 +108,10 @@ static void decode_help_display(void) {
fprintf(stdout," OPTIONAL\n");
fprintf(stdout," Output file where file info will be dump.\n");
fprintf(stdout," By default it will be in the stdout.\n");
fprintf(stdout," -v "); /* FIXME WIP_MSD */
fprintf(stdout," -v "); /* FIXME WIP_MSD */
fprintf(stdout," OPTIONAL\n");
fprintf(stdout," Activate or not the verbose mode (display info and warning message)\n");
fprintf(stdout," By default verbose mode is off.\n");
fprintf(stdout," Enable informative messages\n");
fprintf(stdout," By default verbose mode is off.\n");
fprintf(stdout,"\n");
}
@@ -272,9 +272,9 @@ static int infile_format(const char *fname)
static int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,img_fol_t *img_fol) {
int totlen, c;
opj_option_t long_option[]={
{"ImgDir",REQ_ARG, NULL ,'y'},
{"ImgDir",REQ_ARG, NULL ,'y'}
};
const char optlist[] = "i:o:f:hv";
const char optlist[] = "i:o:f:hv";
totlen=sizeof(long_option);
img_fol->set_out_format = 0;
@@ -293,12 +293,13 @@ static int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *param
case JP2_CFMT:
break;
case JPT_CFMT:
break;
default:
fprintf(stderr,
"!! Unrecognized format for infile : %s [accept only *.j2k, *.jp2, *.jpc or *.jpt] !!\n\n",
infile);
return 1;
break;
default:
fprintf(stderr,
"[ERROR] Unknown input file format: %s \n"
" Known file formats are *.j2k, *.jp2, *.jpc or *.jpt\n",
infile);
return 1;
}
strncpy(parameters->infile, infile, sizeof(parameters->infile)-1);
}
@@ -335,38 +336,40 @@ static int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *param
/* ----------------------------------------------------- */
case 'v': /* Verbose mode */
case 'v': /* Verbose mode */
{
parameters->m_verbose = 1;
parameters->m_verbose = 1;
}
break;
/* ----------------------------------------------------- */
default:
fprintf(stderr,"WARNING -> this option is not valid \"-%c %s\"\n",c, opj_optarg);
break;
}
default:
fprintf(stderr, "[WARNING] An invalid option has been ignored.\n");
break;
}
}while(c != -1);
/* check for possible errors */
if(img_fol->set_imgdir==1){
if(!(parameters->infile[0]==0)){
fprintf(stderr, "Error: options -ImgDir and -i cannot be used together !!\n");
fprintf(stderr, "[ERROR] options -ImgDir and -i cannot be used together.\n");
return 1;
}
if(img_fol->set_out_format == 0){
fprintf(stderr, "Error: When -ImgDir is used, -OutFor <FORMAT> must be used !!\n");
fprintf(stderr, "Only one format allowed! Valid format PGM, PPM, PNM, PGX, BMP, TIF, RAW and TGA!!\n");
fprintf(stderr, "[ERROR] When -ImgDir is used, -OutFor <FORMAT> must be used.\n");
fprintf(stderr, "Only one format allowed.\n"
"Valid format are PGM, PPM, PNM, PGX, BMP, TIF, RAW and TGA.\n");
return 1;
}
if(!(parameters->outfile[0] == 0)){
fprintf(stderr, "Error: options -ImgDir and -o cannot be used together !!\n");
fprintf(stderr, "[ERROR] options -ImgDir and -o cannot be used together\n");
return 1;
}
}else{
if(parameters->infile[0] == 0) {
fprintf(stderr, "[ERROR] Required parameter is missing\n");
fprintf(stderr, "Example: %s -i image.j2k\n",argv[0]);
fprintf(stderr, " Try: %s -h\n",argv[0]);
fprintf(stderr, " Help: %s -h\n",argv[0]);
return 1;
}
}
@@ -492,7 +495,7 @@ int main(int argc, char *argv[])
/* Read the input file and put it in memory */
/* ---------------------------------------- */
l_stream = opj_stream_create_default_file_stream_v3(parameters.infile,1);
l_stream = opj_stream_create_default_file_stream(parameters.infile,1);
if (!l_stream){
fprintf(stderr, "ERROR -> failed to create the stream from the file %s\n",parameters.infile);
return EXIT_FAILURE;
@@ -522,7 +525,7 @@ int main(int argc, char *argv[])
}
default:
fprintf(stderr, "skipping file..\n");
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
continue;
}
@@ -534,7 +537,7 @@ int main(int argc, char *argv[])
/* Setup the decoder decoding parameters using user parameters */
if ( !opj_setup_decoder(l_codec, &parameters) ){
fprintf(stderr, "ERROR -> opj_dump: failed to setup the decoder\n");
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
fclose(fout);
return EXIT_FAILURE;
@@ -543,7 +546,7 @@ int main(int argc, char *argv[])
/* Read the main header of the codestream and if necessary the JP2 boxes*/
if(! opj_read_header(l_stream, l_codec, &image)){
fprintf(stderr, "ERROR -> opj_dump: failed to read the header\n");
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
opj_destroy_codec(l_codec);
opj_image_destroy(image);
fclose(fout);
@@ -557,7 +560,7 @@ int main(int argc, char *argv[])
cstr_index = opj_get_cstr_index(l_codec);
/* close the byte stream */
opj_stream_destroy_v3(l_stream);
opj_stream_destroy(l_stream);
/* free remaining structures */
if (l_codec) {

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2005, Francois Devaux and Antonin Descampe

View File

@@ -1,8 +1,8 @@
/*
* $Id: opj_dec_server.c 54 2011-05-10 13:22:47Z kaori $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id: addXMLinJP2.c 46 2011-02-17 14:50:55Z kaori $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id: test_index.c 46 2011-02-17 14:50:55Z kaori $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id: opj_server.c 53 2011-05-09 16:55:39Z kaori $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* Copyright (c) 2011, Lucian Corlaciu, GSoC
* All rights reserved.

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id$
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* All rights reserved.

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*

View File

@@ -1,6 +1,11 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* All rights reserved.
*

View File

@@ -1,6 +1,11 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* All rights reserved.
*

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* All rights reserved.

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* All rights reserved.

View File

@@ -1,6 +1,11 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* All rights reserved.
*

View File

@@ -1,6 +1,11 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita'<27> degli studi di Perugia (UPG), Italy
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita'<27> degli studi di Perugia (UPG), Italy
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita'<27> degli studi di Perugia (UPG), Italy
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita' degli studi di Perugia (UPG), Italy
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita degli studi di Perugia (UPG), Italy
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universit<69> degli studi di Perugia (UPG), Italy
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita degli studi di Perugia (UPG), Italy
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universit<69> degli studi di Perugia (UPG), Italy
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universita degli studi di Perugia (UPG), Italy
* All rights reserved.
*

View File

@@ -1,5 +1,5 @@
Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
Copyright (c) 2002-2007, Professor Benoit Macq
Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
Copyright (c) 2002-2014, Professor Benoit Macq
Copyright (c) 2001-2003, David Janssens
Copyright (c) 2002-2003, Yannick Verschueren
Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universit<69> degli studi di Perugia (UPG), Italy
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2007, Digital Signal Processing Laboratory, Universit<69> degli studi di Perugia (UPG), Italy
* All rights reserved.
*

View File

@@ -68,10 +68,12 @@ install(FILES openjpeg.h opj_stdint.h
DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers
)
if(BUILD_DOC)
# install man page of the library
install(
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man3/libopenjp2.3
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man3)
endif()
# internal utilities to generate t1_luts.h (part of the jp2 lib)
# no need to install:

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id: cidx_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2003-2004, Yannick Verschueren
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.

View File

@@ -1,8 +1,8 @@
/*
* $Id: cidx_manager.h 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2003-2004, Yannick Verschueren
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.

View File

@@ -1,11 +1,17 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*
@@ -198,11 +204,6 @@ void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream)
}
}
void OPJ_CALLCONV opj_stream_destroy_v3(opj_stream_t* p_stream)
{
opj_stream_destroy(p_stream);
}
void OPJ_CALLCONV opj_stream_set_read_function(opj_stream_t* p_stream, opj_stream_read_fn p_function)
{
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
@@ -246,15 +247,7 @@ void OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream, opj_strea
l_stream->m_skip_fn = p_function;
}
void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream, void * p_data)
{
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
if (!l_stream)
return;
l_stream->m_user_data = p_data;
}
void OPJ_CALLCONV opj_stream_set_user_data_v3(opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function)
void OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function)
{
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
if (!l_stream)

View File

@@ -1,11 +1,17 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*
@@ -43,7 +49,7 @@ The functions in CIO.C have for goal to realize a byte input / output process.
/** @defgroup CIO CIO - byte input-output stream */
/*@{*/
#include "opj_config.h"
#include "opj_config_private.h"
/* ----------------------------------------------------------------------- */

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2007, Jonathan Ballard <dzonatas@dzonux.net>
* Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*

View File

@@ -1,6 +1,11 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*

View File

@@ -1,6 +1,11 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*

View File

@@ -1,8 +1,8 @@
/*
* $Id: indexbox_manager.h 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2003-2004, Yannick Verschueren
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>
* All rights reserved.
*

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>
* Copyright (c) 2006-2007, Parvatha Elangovan
@@ -36,11 +42,6 @@
#include "opj_includes.h"
#define CINEMA_24_CS 1302083 /*Codestream length for 24fps*/
#define CINEMA_48_CS 651041 /*Codestream length for 48fps*/
#define COMP_24_CS 1041666 /*Maximum size per color component for 2K & 4K @ 24fps*/
#define COMP_48_CS 520833 /*Maximum size per color component for 2K @ 48fps*/
/** @defgroup J2K J2K - JPEG-2000 codestream reader/writer */
/*@{*/
@@ -1166,7 +1167,7 @@ static int opj_j2k_initialise_4K_poc(opj_poc_t *POC, int numres);
static void opj_j2k_set_cinema_parameters(opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager);
static OPJ_BOOL opj_j2k_is_cinema_compliant(opj_image_t *image, OPJ_CINEMA_MODE cinema_mode, opj_event_mgr_t *p_manager);
static OPJ_BOOL opj_j2k_is_cinema_compliant(opj_image_t *image, OPJ_UINT16 rsiz, opj_event_mgr_t *p_manager);
/*@}*/
@@ -1939,7 +1940,7 @@ static OPJ_BOOL opj_j2k_read_siz(opj_j2k_t *p_j2k,
opj_read_bytes(p_header_data,&l_tmp ,2); /* Rsiz (capabilities) */
p_header_data+=2;
l_cp->rsiz = (OPJ_RSIZ_CAPABILITIES) l_tmp;
l_cp->rsiz = (OPJ_UINT16) l_tmp;
opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->x1, 4); /* Xsiz */
p_header_data+=4;
opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->y1, 4); /* Ysiz */
@@ -3096,7 +3097,7 @@ OPJ_UINT32 opj_j2k_get_specific_header_sizes(opj_j2k_t *p_j2k)
l_nb_comps = p_j2k->m_private_image->numcomps - 1;
l_nb_bytes += opj_j2k_get_max_toc_size(p_j2k);
if (p_j2k->m_cp.m_specific_param.m_enc.m_cinema == 0) {
if (!(OPJ_IS_CINEMA(p_j2k->m_cp.rsiz))) {
l_coc_bytes = opj_j2k_get_max_coc_size(p_j2k);
l_nb_bytes += l_nb_comps * l_coc_bytes;
@@ -4716,7 +4717,7 @@ OPJ_BOOL opj_j2k_update_rates( opj_j2k_t *p_j2k,
return OPJ_FALSE;
}
if (l_cp->m_specific_param.m_enc.m_cinema) {
if (OPJ_IS_CINEMA(l_cp->rsiz)) {
p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer =
(OPJ_BYTE *) opj_malloc(5*p_j2k->m_specific_param.m_encoder.m_total_tile_parts);
if (! p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer) {
@@ -5908,24 +5909,8 @@ int opj_j2k_initialise_4K_poc(opj_poc_t *POC, int numres){
void opj_j2k_set_cinema_parameters(opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager)
{
/* Configure cinema parameters */
OPJ_FLOAT32 max_rate = 0;
OPJ_FLOAT32 temp_rate = 0;
int i;
/* profile (Rsiz) */
switch (parameters->cp_cinema){
case OPJ_CINEMA2K_24:
case OPJ_CINEMA2K_48:
parameters->cp_rsiz = OPJ_CINEMA2K;
break;
case OPJ_CINEMA4K_24:
parameters->cp_rsiz = OPJ_CINEMA4K;
break;
case OPJ_OFF:
assert(0);
break;
}
/* No tiling */
parameters->tile_size_on = OPJ_FALSE;
parameters->cp_tdx=1;
@@ -5963,15 +5948,16 @@ void opj_j2k_set_cinema_parameters(opj_cparameters_t *parameters, opj_image_t *i
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Profile-3 and 4 (2k/4k dc profile) requires:\n"
"1 single quality layer"
"-> Number of layers forced to 1 (rather than %d)\n",
parameters->tcp_numlayers);
"-> Number of layers forced to 1 (rather than %d)\n"
"-> Rate of the last layer (%3.1f) will be used",
parameters->tcp_numlayers, parameters->tcp_rates[parameters->tcp_numlayers-1]);
parameters->tcp_rates[0] = parameters->tcp_rates[parameters->tcp_numlayers-1];
parameters->tcp_numlayers = 1;
}
/* Resolution levels */
switch (parameters->cp_cinema){
case OPJ_CINEMA2K_24:
case OPJ_CINEMA2K_48:
switch (parameters->rsiz){
case OPJ_PROFILE_CINEMA_2K:
if(parameters->numresolution > 6){
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Profile-3 (2k dc profile) requires:\n"
@@ -5981,7 +5967,7 @@ void opj_j2k_set_cinema_parameters(opj_cparameters_t *parameters, opj_image_t *i
parameters->numresolution = 6;
}
break;
case OPJ_CINEMA4K_24:
case OPJ_PROFILE_CINEMA_4K:
if(parameters->numresolution < 2){
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Profile-4 (4k dc profile) requires:\n"
@@ -6014,7 +6000,7 @@ void opj_j2k_set_cinema_parameters(opj_cparameters_t *parameters, opj_image_t *i
parameters->prog_order = OPJ_CPRL;
/* Progression order changes for 4K, disallowed for 2K */
if (parameters->cp_cinema == OPJ_CINEMA4K_24) {
if (parameters->rsiz == OPJ_PROFILE_CINEMA_4K) {
parameters->numpocs = (OPJ_UINT32)opj_j2k_initialise_4K_poc(parameters->POC,parameters->numresolution);
} else {
parameters->numpocs = 0;
@@ -6022,62 +6008,42 @@ void opj_j2k_set_cinema_parameters(opj_cparameters_t *parameters, opj_image_t *i
/* Limited bit-rate */
parameters->cp_disto_alloc = 1;
switch (parameters->cp_cinema){
case OPJ_CINEMA2K_24:
case OPJ_CINEMA4K_24:
max_rate = (OPJ_FLOAT32) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)/
(OPJ_FLOAT32)(CINEMA_24_CS * 8 * image->comps[0].dx * image->comps[0].dy);
if (parameters->tcp_rates[0] == 0){
parameters->tcp_rates[0] = max_rate;
}else{
temp_rate =(OPJ_FLOAT32)(image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)/
(parameters->tcp_rates[0] * 8 * (OPJ_FLOAT32)image->comps[0].dx * (OPJ_FLOAT32)image->comps[0].dy);
if (temp_rate > CINEMA_24_CS ){
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Profile-3 and 4 (2k/4k dc profile) requires:\n"
"Maximum 1302083 compressed bytes @ 24fps\n"
"-> Specified rate (%3.1f) exceeds this limit. Rate will be forced to %3.1f.\n",
parameters->tcp_rates[0], max_rate);
parameters->tcp_rates[0]= max_rate;
}else{
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Profile-3 and 4 (2k/4k dc profile):\n"
"INFO : Specified rate (%3.1f) is below the 2k/4k limit @ 24fps.\n",
parameters->tcp_rates[0]);
}
}
parameters->max_comp_size = COMP_24_CS;
break;
case OPJ_CINEMA2K_48:
max_rate = ((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))/
(float)(CINEMA_48_CS * 8 * image->comps[0].dx * image->comps[0].dy);
if (parameters->tcp_rates[0] == 0){
parameters->tcp_rates[0] = max_rate;
}else{
temp_rate =((float) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec))/
(parameters->tcp_rates[0] * 8 * (float)image->comps[0].dx * (float)image->comps[0].dy);
if (temp_rate > CINEMA_48_CS ){
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Profile-3 (2k dc profile) requires:\n"
"Maximum 651041 compressed bytes @ 48fps\n"
"-> Specified rate (%3.1f) exceeds this limit. Rate will be forced to %3.1f.\n",
parameters->tcp_rates[0], max_rate);
parameters->tcp_rates[0]= max_rate;
}else{
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Profile-3 (2k dc profile):\n"
"INFO : Specified rate (%3.1f) is below the 2k limit @ 48 fps.\n",
parameters->tcp_rates[0]);
}
}
parameters->max_comp_size = COMP_48_CS;
break;
default:
break;
if (parameters->max_cs_size <= 0) {
/* No rate has been introduced, 24 fps is assumed */
parameters->max_cs_size = OPJ_CINEMA_24_CS;
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Profile-3 and 4 (2k/4k dc profile) requires:\n"
"Maximum 1302083 compressed bytes @ 24fps\n"
"As no rate has been given, this limit will be used.\n");
} else if (parameters->max_cs_size > OPJ_CINEMA_24_CS) {
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Profile-3 and 4 (2k/4k dc profile) requires:\n"
"Maximum 1302083 compressed bytes @ 24fps\n"
"-> Specified rate exceeds this limit. Rate will be forced to 1302083 bytes.\n");
parameters->max_cs_size = OPJ_CINEMA_24_CS;
}
if (parameters->max_comp_size <= 0) {
/* No rate has been introduced, 24 fps is assumed */
parameters->max_comp_size = OPJ_CINEMA_24_COMP;
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Profile-3 and 4 (2k/4k dc profile) requires:\n"
"Maximum 1041666 compressed bytes @ 24fps\n"
"As no rate has been given, this limit will be used.\n");
} else if (parameters->max_comp_size > OPJ_CINEMA_24_COMP) {
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Profile-3 and 4 (2k/4k dc profile) requires:\n"
"Maximum 1041666 compressed bytes @ 24fps\n"
"-> Specified rate exceeds this limit. Rate will be forced to 1041666 bytes.\n");
parameters->max_comp_size = OPJ_CINEMA_24_COMP;
}
parameters->tcp_rates[0] = (OPJ_FLOAT32) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)/
(OPJ_FLOAT32)(((OPJ_UINT32)parameters->max_cs_size) * 8 * image->comps[0].dx * image->comps[0].dy);
}
OPJ_BOOL opj_j2k_is_cinema_compliant(opj_image_t *image, OPJ_CINEMA_MODE cinema_mode, opj_event_mgr_t *p_manager)
OPJ_BOOL opj_j2k_is_cinema_compliant(opj_image_t *image, OPJ_UINT16 rsiz, opj_event_mgr_t *p_manager)
{
OPJ_UINT32 i;
@@ -6109,9 +6075,8 @@ OPJ_BOOL opj_j2k_is_cinema_compliant(opj_image_t *image, OPJ_CINEMA_MODE cinema_
}
/* Image size */
switch (cinema_mode){
case OPJ_CINEMA2K_24:
case OPJ_CINEMA2K_48:
switch (rsiz){
case OPJ_PROFILE_CINEMA_2K:
if (((image->comps[0].w > 2048) | (image->comps[0].h > 1080))){
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Profile-3 (2k dc profile) requires:\n"
@@ -6122,7 +6087,7 @@ OPJ_BOOL opj_j2k_is_cinema_compliant(opj_image_t *image, OPJ_CINEMA_MODE cinema_
return OPJ_FALSE;
}
break;
case OPJ_CINEMA4K_24:
case OPJ_PROFILE_CINEMA_4K:
if (((image->comps[0].w > 4096) | (image->comps[0].h > 2160))){
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Profile-4 (4k dc profile) requires:\n"
@@ -6159,20 +6124,130 @@ void opj_j2k_setup_encoder( opj_j2k_t *p_j2k,
cp->tw = 1;
cp->th = 1;
/* FIXME ADE: to be removed once deprecated cp_cinema and cp_rsiz have been removed */
if (parameters->rsiz == OPJ_PROFILE_NONE) { /* consider deprecated fields only if RSIZ has not been set */
OPJ_BOOL deprecated_used = OPJ_FALSE;
switch (parameters->cp_cinema){
case OPJ_CINEMA2K_24:
parameters->rsiz = OPJ_PROFILE_CINEMA_2K;
parameters->max_cs_size = OPJ_CINEMA_24_CS;
parameters->max_comp_size = OPJ_CINEMA_24_COMP;
deprecated_used = OPJ_TRUE;
break;
case OPJ_CINEMA2K_48:
parameters->rsiz = OPJ_PROFILE_CINEMA_2K;
parameters->max_cs_size = OPJ_CINEMA_48_CS;
parameters->max_comp_size = OPJ_CINEMA_48_COMP;
deprecated_used = OPJ_TRUE;
break;
case OPJ_CINEMA4K_24:
parameters->rsiz = OPJ_PROFILE_CINEMA_4K;
parameters->max_cs_size = OPJ_CINEMA_24_CS;
parameters->max_comp_size = OPJ_CINEMA_24_COMP;
deprecated_used = OPJ_TRUE;
break;
case OPJ_OFF:
default:
break;
}
switch (parameters->cp_rsiz){
case OPJ_CINEMA2K:
parameters->rsiz = OPJ_PROFILE_CINEMA_2K;
deprecated_used = OPJ_TRUE;
break;
case OPJ_CINEMA4K:
parameters->rsiz = OPJ_PROFILE_CINEMA_4K;
deprecated_used = OPJ_TRUE;
break;
case OPJ_MCT:
parameters->rsiz = OPJ_PROFILE_PART2 | OPJ_EXTENSION_MCT;
deprecated_used = OPJ_TRUE;
case OPJ_STD_RSIZ:
default:
break;
}
if (deprecated_used) {
opj_event_msg(p_manager, EVT_WARNING,
"Deprecated fields cp_cinema or cp_rsiz are used\n"
"Please consider using only the rsiz field\n"
"See openjpeg.h documentation for more details\n");
}
}
/* see if max_codestream_size does limit input rate */
if (parameters->max_cs_size <= 0) {
if (parameters->tcp_rates[parameters->tcp_numlayers-1] > 0) {
OPJ_FLOAT32 temp_size;
temp_size =(OPJ_FLOAT32)(image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)/
(parameters->tcp_rates[parameters->tcp_numlayers-1] * 8 * (OPJ_FLOAT32)image->comps[0].dx * (OPJ_FLOAT32)image->comps[0].dy);
parameters->max_cs_size = (int) floor(temp_size);
} else {
parameters->max_cs_size = 0;
}
} else {
OPJ_FLOAT32 temp_rate;
OPJ_BOOL cap = OPJ_FALSE;
temp_rate = (OPJ_FLOAT32) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)/
(OPJ_FLOAT32)(((OPJ_UINT32)parameters->max_cs_size) * 8 * image->comps[0].dx * image->comps[0].dy);
for (i = 0; i < (OPJ_UINT32) parameters->tcp_numlayers; i++) {
if (parameters->tcp_rates[i] < temp_rate) {
parameters->tcp_rates[i] = temp_rate;
cap = OPJ_TRUE;
}
}
if (cap) {
opj_event_msg(p_manager, EVT_WARNING,
"The desired maximum codestream size has limited\n"
"at least one of the desired quality layers\n");
}
}
/* Manage profiles and applications and set RSIZ */
/* set cinema parameters if required */
if (parameters->cp_cinema){
opj_j2k_set_cinema_parameters(parameters,image,p_manager);
if (!opj_j2k_is_cinema_compliant(image,parameters->cp_cinema,p_manager)) {
parameters->cp_rsiz = OPJ_STD_RSIZ;
if (OPJ_IS_CINEMA(parameters->rsiz)){
if ((parameters->rsiz == OPJ_PROFILE_CINEMA_S2K)
|| (parameters->rsiz == OPJ_PROFILE_CINEMA_S4K)){
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Scalable Digital Cinema profiles not yet supported\n");
parameters->rsiz = OPJ_PROFILE_NONE;
} else {
opj_j2k_set_cinema_parameters(parameters,image,p_manager);
if (!opj_j2k_is_cinema_compliant(image,parameters->rsiz,p_manager)) {
parameters->rsiz = OPJ_PROFILE_NONE;
}
}
} else if (OPJ_IS_STORAGE(parameters->rsiz)) {
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Long Term Storage profile not yet supported\n");
parameters->rsiz = OPJ_PROFILE_NONE;
} else if (OPJ_IS_BROADCAST(parameters->rsiz)) {
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Broadcast profiles not yet supported\n");
parameters->rsiz = OPJ_PROFILE_NONE;
} else if (OPJ_IS_IMF(parameters->rsiz)) {
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 IMF profiles not yet supported\n");
parameters->rsiz = OPJ_PROFILE_NONE;
} else if (OPJ_IS_PART2(parameters->rsiz)) {
if (parameters->rsiz == ((OPJ_PROFILE_PART2) | (OPJ_EXTENSION_NONE))) {
opj_event_msg(p_manager, EVT_WARNING,
"JPEG 2000 Part-2 profile defined\n"
"but no Part-2 extension enabled.\n"
"Profile set to NONE.\n");
parameters->rsiz = OPJ_PROFILE_NONE;
} else if (parameters->rsiz != ((OPJ_PROFILE_PART2) | (OPJ_EXTENSION_MCT))) {
opj_event_msg(p_manager, EVT_WARNING,
"Unsupported Part-2 extension enabled\n"
"Profile set to NONE.\n");
parameters->rsiz = OPJ_PROFILE_NONE;
}
}
/*
copy user encoding parameters
*/
cp->m_specific_param.m_enc.m_cinema = parameters->cp_cinema;
cp->m_specific_param.m_enc.m_max_comp_size = (OPJ_UINT32)parameters->max_comp_size;
cp->rsiz = parameters->cp_rsiz;
cp->rsiz = parameters->rsiz;
cp->m_specific_param.m_enc.m_disto_alloc = (OPJ_UINT32)parameters->cp_disto_alloc & 1u;
cp->m_specific_param.m_enc.m_fixed_alloc = (OPJ_UINT32)parameters->cp_fixed_alloc & 1u;
cp->m_specific_param.m_enc.m_fixed_quality = (OPJ_UINT32)parameters->cp_fixed_quality & 1u;
@@ -6287,7 +6362,7 @@ void opj_j2k_setup_encoder( opj_j2k_t *p_j2k,
tcp->numlayers = (OPJ_UINT32)parameters->tcp_numlayers;
for (j = 0; j < tcp->numlayers; j++) {
if(cp->m_specific_param.m_enc.m_cinema){
if(OPJ_IS_CINEMA(cp->rsiz)){
if (cp->m_specific_param.m_enc.m_fixed_quality) {
tcp->distoratio[j] = parameters->tcp_distoratio[j];
}
@@ -9792,7 +9867,7 @@ void opj_j2k_setup_end_compress (opj_j2k_t *p_j2k)
/* DEVELOPER CORNER, insert your custom procedures */
opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_eoc );
if (p_j2k->m_cp.m_specific_param.m_enc.m_cinema) {
if (OPJ_IS_CINEMA(p_j2k->m_cp.rsiz)) {
opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_updated_tlm);
}
@@ -9824,14 +9899,14 @@ void opj_j2k_setup_header_writing (opj_j2k_t *p_j2k)
opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_cod );
opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_qcd );
if (p_j2k->m_cp.m_specific_param.m_enc.m_cinema) {
if (OPJ_IS_CINEMA(p_j2k->m_cp.rsiz)) {
/* No need for COC or QCC, QCD and COD are used
opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_all_coc );
opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_all_qcc );
*/
opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_tlm );
if (p_j2k->m_cp.m_specific_param.m_enc.m_cinema == OPJ_CINEMA4K_24) {
if (p_j2k->m_cp.rsiz == OPJ_PROFILE_CINEMA_4K) {
opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_poc );
}
}
@@ -9843,7 +9918,7 @@ void opj_j2k_setup_header_writing (opj_j2k_t *p_j2k)
}
/* DEVELOPER CORNER, insert your custom procedures */
if (p_j2k->m_cp.rsiz & OPJ_MCT) {
if (p_j2k->m_cp.rsiz & OPJ_EXTENSION_MCT) {
opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_mct_data_group );
}
/* End of Developer Corner */
@@ -9892,7 +9967,7 @@ OPJ_BOOL opj_j2k_write_first_tile_part (opj_j2k_t *p_j2k,
p_data += l_current_nb_bytes_written;
p_total_data_size -= l_current_nb_bytes_written;
if (l_cp->m_specific_param.m_enc.m_cinema == 0) {
if (!OPJ_IS_CINEMA(l_cp->rsiz)) {
#if 0
for (compno = 1; compno < p_j2k->m_private_image->numcomps; compno++) {
l_current_nb_bytes_written = 0;
@@ -9929,7 +10004,7 @@ OPJ_BOOL opj_j2k_write_first_tile_part (opj_j2k_t *p_j2k,
/* Writing Psot in SOT marker */
opj_write_bytes(l_begin_data + 6,l_nb_bytes_written,4); /* PSOT */
if (l_cp->m_specific_param.m_enc.m_cinema){
if (OPJ_IS_CINEMA(l_cp->rsiz)){
opj_j2k_update_tlm(p_j2k,l_nb_bytes_written);
}
@@ -9993,7 +10068,7 @@ OPJ_BOOL opj_j2k_write_all_tile_parts( opj_j2k_t *p_j2k,
/* Writing Psot in SOT marker */
opj_write_bytes(l_begin_data + 6,l_part_tile_size,4); /* PSOT */
if (l_cp->m_specific_param.m_enc.m_cinema) {
if (OPJ_IS_CINEMA(l_cp->rsiz)) {
opj_j2k_update_tlm(p_j2k,l_part_tile_size);
}
@@ -10034,7 +10109,7 @@ OPJ_BOOL opj_j2k_write_all_tile_parts( opj_j2k_t *p_j2k,
/* Writing Psot in SOT marker */
opj_write_bytes(l_begin_data + 6,l_part_tile_size,4); /* PSOT */
if (l_cp->m_specific_param.m_enc.m_cinema) {
if (OPJ_IS_CINEMA(l_cp->rsiz)) {
opj_j2k_update_tlm(p_j2k,l_part_tile_size);
}

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>
@@ -298,8 +304,6 @@ typedef struct opj_tcp
typedef struct opj_encoding_param
{
/** Digital cinema profile*/
OPJ_CINEMA_MODE m_cinema;
/** Maximum rate for each component. If == 0, component size limitation is not considered */
OPJ_UINT32 m_max_comp_size;
/** Position of tile part flag in progression order*/
@@ -337,7 +341,7 @@ typedef struct opj_cp
/** Size of the image in bits*/
/*int img_size;*/
/** Rsiz*/
OPJ_RSIZ_CAPABILITIES rsiz;
OPJ_UINT16 rsiz;
/** XTOsiz */
OPJ_UINT32 tx0; /* MSD see norm */
/** YTOsiz */

View File

@@ -1,12 +1,18 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2010-2011, Kaori Hagihara
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*

View File

@@ -1,9 +1,14 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*

View File

@@ -1,11 +1,17 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*

View File

@@ -1,11 +1,17 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>
* All rights reserved.

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>
* All rights reserved.

View File

@@ -1,6 +1,11 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*
@@ -634,10 +639,11 @@ void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *paramete
if(parameters) {
memset(parameters, 0, sizeof(opj_cparameters_t));
/* default coding parameters */
parameters->cp_cinema = OPJ_OFF;
parameters->cp_cinema = OPJ_OFF; /* DEPRECATED */
parameters->rsiz = OPJ_PROFILE_NONE;
parameters->max_comp_size = 0;
parameters->numresolution = 6;
parameters->cp_rsiz = OPJ_STD_RSIZ;
parameters->cp_rsiz = OPJ_STD_RSIZ; /* DEPRECATED */
parameters->cblockw_init = 64;
parameters->cblockh_init = 64;
parameters->prog_order = OPJ_LRCP;
@@ -788,8 +794,11 @@ OPJ_BOOL OPJ_CALLCONV opj_set_MCT(opj_cparameters_t *parameters,
OPJ_UINT32 l_mct_total_size = l_matrix_size + l_dc_shift_size;
/* add MCT capability */
OPJ_INT32 rsiz = (OPJ_INT32)parameters->cp_rsiz | (OPJ_INT32)OPJ_MCT;
parameters->cp_rsiz = (OPJ_RSIZ_CAPABILITIES)rsiz;
if (OPJ_IS_PART2(parameters->rsiz)) {
parameters->rsiz |= OPJ_EXTENSION_MCT;
} else {
parameters->rsiz = ((OPJ_PROFILE_PART2) | (OPJ_EXTENSION_MCT));
}
parameters->irreversible = 1;
/* use array based MCT */
@@ -912,12 +921,12 @@ void OPJ_CALLCONV opj_destroy_cstr_index(opj_codestream_index_t **p_cstr_index)
}
}
opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream_v3 (const char *fname, OPJ_BOOL p_is_read_stream)
opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream (const char *fname, OPJ_BOOL p_is_read_stream)
{
return opj_stream_create_file_stream_v3(fname, OPJ_J2K_STREAM_CHUNK_SIZE, p_is_read_stream);
return opj_stream_create_file_stream(fname, OPJ_J2K_STREAM_CHUNK_SIZE, p_is_read_stream);
}
opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream_v3 (
opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream (
const char *fname,
OPJ_SIZE_T p_size,
OPJ_BOOL p_is_read_stream)
@@ -944,7 +953,7 @@ opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream_v3 (
return NULL;
}
opj_stream_set_user_data_v3(l_stream, p_file, (opj_stream_free_user_data_fn) fclose);
opj_stream_set_user_data(l_stream, p_file, (opj_stream_free_user_data_fn) fclose);
opj_stream_set_user_data_length(l_stream, opj_get_data_length_from_file(p_file));
opj_stream_set_read_function(l_stream, (opj_stream_read_fn) opj_read_from_file);
opj_stream_set_write_function(l_stream, (opj_stream_write_fn) opj_write_from_file);

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>
@@ -167,30 +173,88 @@ typedef size_t OPJ_SIZE_T;
#define OPJ_JP2_INFO 128 /**< JP2 file information */
#define OPJ_JP2_IND 256 /**< JP2 file index */
/**
* JPEG 2000 Profiles, see Table A.10 from 15444-1 (updated in various AMD)
* These values help chosing the RSIZ value for the J2K codestream.
* The RSIZ value triggers various encoding options, as detailed in Table A.10.
* If OPJ_PROFILE_PART2 is chosen, it has to be combined with one or more extensions
* described hereunder.
* Example: rsiz = OPJ_PROFILE_PART2 | OPJ_EXTENSION_MCT;
* For broadcast profiles, the OPJ_PROFILE value has to be combined with the targeted
* mainlevel (3-0 LSB, value between 0 and 11):
* Example: rsiz = OPJ_PROFILE_BC_MULTI | 0x0005; (here mainlevel 5)
* For IMF profiles, the OPJ_PROFILE value has to be combined with the targeted mainlevel
* (3-0 LSB, value between 0 and 11) and sublevel (7-4 LSB, value between 0 and 9):
* Example: rsiz = OPJ_PROFILE_IMF_2K | 0x0040 | 0x0005; (here main 5 and sublevel 4)
* */
#define OPJ_PROFILE_NONE 0x0000 /** no profile, conform to 15444-1 */
#define OPJ_PROFILE_0 0x0001 /** Profile 0 as described in 15444-1,Table A.45 */
#define OPJ_PROFILE_1 0x0002 /** Profile 1 as described in 15444-1,Table A.45 */
#define OPJ_PROFILE_PART2 0x8000 /** At least 1 extension defined in 15444-2 (Part-2) */
#define OPJ_PROFILE_CINEMA_2K 0x0003 /** 2K cinema profile defined in 15444-1 AMD1 */
#define OPJ_PROFILE_CINEMA_4K 0x0004 /** 4K cinema profile defined in 15444-1 AMD1 */
#define OPJ_PROFILE_CINEMA_S2K 0x0005 /** Scalable 2K cinema profile defined in 15444-1 AMD2 */
#define OPJ_PROFILE_CINEMA_S4K 0x0006 /** Scalable 4K cinema profile defined in 15444-1 AMD2 */
#define OPJ_PROFILE_CINEMA_LTS 0x0007 /** Long term storage cinema profile defined in 15444-1 AMD2 */
#define OPJ_PROFILE_BC_SINGLE 0x0100 /** Single Tile Broadcast profile defined in 15444-1 AMD3 */
#define OPJ_PROFILE_BC_MULTI 0x0200 /** Multi Tile Broadcast profile defined in 15444-1 AMD3 */
#define OPJ_PROFILE_BC_MULTI_R 0x0300 /** Multi Tile Reversible Broadcast profile defined in 15444-1 AMD3 */
#define OPJ_PROFILE_IMF_2K 0x0400 /** 2K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */
#define OPJ_PROFILE_IMF_4K 0x0401 /** 4K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */
#define OPJ_PROFILE_IMF_8K 0x0402 /** 8K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */
#define OPJ_PROFILE_IMF_2K_R 0x0403 /** 2K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */
#define OPJ_PROFILE_IMF_4K_R 0x0800 /** 4K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */
#define OPJ_PROFILE_IMF_8K_R 0x0801 /** 8K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */
/**
* JPEG 2000 Part-2 extensions
* */
#define OPJ_EXTENSION_NONE 0x0000 /** No Part-2 extension */
#define OPJ_EXTENSION_MCT 0x0100 /** Custom MCT support */
/**
* JPEG 2000 profile macros
* */
#define OPJ_IS_CINEMA(v) (((v) >= OPJ_PROFILE_CINEMA_2K)&&((v) <= OPJ_PROFILE_CINEMA_S4K))
#define OPJ_IS_STORAGE(v) ((v) == OPJ_PROFILE_CINEMA_LTS)
#define OPJ_IS_BROADCAST(v) (((v) >= OPJ_PROFILE_BC_SINGLE)&&((v) <= ((OPJ_PROFILE_BC_MULTI_R) | (0x000b))))
#define OPJ_IS_IMF(v) (((v) >= OPJ_PROFILE_IMF_2K)&&((v) <= ((OPJ_PROFILE_IMF_8K_R) | (0x009b))))
#define OPJ_IS_PART2(v) ((v) & OPJ_PROFILE_PART2)
/**
* JPEG 2000 codestream and component size limits in cinema profiles
* */
#define OPJ_CINEMA_24_CS 1302083 /** Maximum codestream length for 24fps */
#define OPJ_CINEMA_48_CS 651041 /** Maximum codestream length for 48fps */
#define OPJ_CINEMA_24_COMP 1041666 /** Maximum size per color component for 2K & 4K @ 24fps */
#define OPJ_CINEMA_48_COMP 520833 /** Maximum size per color component for 2K @ 48fps */
/*
==========================================================
enum definitions
==========================================================
*/
/**
/**
* DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead
* Rsiz Capabilities
* */
typedef enum RSIZ_CAPABILITIES {
OPJ_STD_RSIZ = 0, /** Standard JPEG2000 profile*/
OPJ_CINEMA2K = 3, /** Profile name for a 2K image*/
OPJ_CINEMA4K = 4, /** Profile name for a 4K image*/
OPJ_MCT = 0x8100
OPJ_STD_RSIZ = 0, /** Standard JPEG2000 profile*/
OPJ_CINEMA2K = 3, /** Profile name for a 2K image*/
OPJ_CINEMA4K = 4, /** Profile name for a 4K image*/
OPJ_MCT = 0x8100
} OPJ_RSIZ_CAPABILITIES;
/**
/**
* DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead
* Digital cinema operation mode
* */
typedef enum CINEMA_MODE {
OPJ_OFF = 0, /** Not Digital Cinema*/
OPJ_CINEMA2K_24 = 1, /** 2K Digital Cinema at 24 fps*/
OPJ_CINEMA2K_48 = 2, /** 2K Digital Cinema at 48 fps*/
OPJ_CINEMA4K_24 = 3 /** 4K Digital Cinema at 24 fps*/
OPJ_OFF = 0, /** Not Digital Cinema*/
OPJ_CINEMA2K_24 = 1, /** 2K Digital Cinema at 24 fps*/
OPJ_CINEMA2K_48 = 2, /** 2K Digital Cinema at 48 fps*/
OPJ_CINEMA4K_24 = 3 /** 4K Digital Cinema at 24 fps*/
}OPJ_CINEMA_MODE;
/**
@@ -209,12 +273,13 @@ typedef enum PROG_ORDER {
* Supported image color spaces
*/
typedef enum COLOR_SPACE {
OPJ_CLRSPC_UNKNOWN = -1, /**< not supported by the library */
OPJ_CLRSPC_UNSPECIFIED = 0, /**< not specified in the codestream */
OPJ_CLRSPC_SRGB = 1, /**< sRGB */
OPJ_CLRSPC_GRAY = 2, /**< grayscale */
OPJ_CLRSPC_SYCC = 3, /**< YUV */
OPJ_CLRSPC_EYCC = 4 /**< e-YCC */
OPJ_CLRSPC_UNKNOWN = -1, /**< not supported by the library */
OPJ_CLRSPC_UNSPECIFIED = 0, /**< not specified in the codestream */
OPJ_CLRSPC_SRGB = 1, /**< sRGB */
OPJ_CLRSPC_GRAY = 2, /**< grayscale */
OPJ_CLRSPC_SYCC = 3, /**< YUV */
OPJ_CLRSPC_EYCC = 4, /**< e-YCC */
OPJ_CLRSPC_CMYK = 5 /**< CMYK */
} OPJ_COLOR_SPACE;
/**
@@ -224,7 +289,9 @@ typedef enum CODEC_FORMAT {
OPJ_CODEC_UNKNOWN = -1, /**< place-holder */
OPJ_CODEC_J2K = 0, /**< JPEG-2000 codestream : read/write */
OPJ_CODEC_JPT = 1, /**< JPT-stream (JPEG 2000, JPIP) : read only */
OPJ_CODEC_JP2 = 2 /**< JPEG-2000 file format : read/write */
OPJ_CODEC_JP2 = 2, /**< JP2 file format : read/write */
OPJ_CODEC_JPP = 3, /**< JPP-stream (JPEG 2000, JPIP) : to be coded */
OPJ_CODEC_JPX = 4 /**< JPX file format (JPEG 2000 Part-2) : to be coded */
} OPJ_CODEC_FORMAT;
@@ -310,7 +377,7 @@ typedef struct opj_cparameters {
OPJ_UINT32 numpocs;
/** number of layers */
int tcp_numlayers;
/** rates of layers */
/** rates of layers - might be subsequently limited by the max_cs_size field */
float tcp_rates[100];
/** different psnr for successive layers */
float tcp_distoratio[100];
@@ -391,12 +458,21 @@ typedef struct opj_cparameters {
/*@}*/
/* <<UniPG */
/** Digital Cinema compliance 0-not compliant, 1-compliant*/
OPJ_CINEMA_MODE cp_cinema;
/** Maximum rate for each component. If == 0, component size limitation is not considered */
/**
* DEPRECATED: use RSIZ, OPJ_PROFILE_* and MAX_COMP_SIZE instead
* Digital Cinema compliance 0-not compliant, 1-compliant
* */
OPJ_CINEMA_MODE cp_cinema;
/**
* Maximum size (in bytes) for each component.
* If == 0, component size limitation is not considered
* */
int max_comp_size;
/** Profile name*/
OPJ_RSIZ_CAPABILITIES cp_rsiz;
/**
* DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead
* Profile name
* */
OPJ_RSIZ_CAPABILITIES cp_rsiz;
/** Tile part generation*/
char tp_on;
/** Flag for Tile part generation*/
@@ -408,6 +484,16 @@ typedef struct opj_cparameters {
/** Naive implementation of MCT restricted to a single reversible array based
encoding without offset concerning all the components. */
void * mct_data;
/**
* Maximum size (in bytes) for the whole codestream.
* If == 0, codestream size limitation is not considered
* If it does not comply with tcp_rates, max_cs_size prevails
* and a warning is issued.
* */
int max_cs_size;
/** RSIZ value
To be used to combine OPJ_PROFILE_*, OPJ_EXTENSION_* and (sub)levels values. */
OPJ_UINT16 rsiz;
} opj_cparameters_t;
#define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG 0x0001
@@ -1030,14 +1116,6 @@ OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_SIZE_T p_buffer_size, O
* @param p_stream the stream to destroy.
*/
OPJ_API void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream);
/**
* Destroys a stream created by opj_create_stream. This function does NOT close the abstract stream.
* If needed the user must close its own implementation of the stream.
*
* @param p_stream the stream to destroy.
*/
OPJ_API void OPJ_CALLCONV opj_stream_destroy_v3(opj_stream_t* p_stream);
/**
* Sets the given function to be used as a read function.
@@ -1067,21 +1145,13 @@ OPJ_API void OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream, o
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_seek_function(opj_stream_t* p_stream, opj_stream_seek_fn p_function);
/**
* Sets the given data to be used as a user data for the stream.
* @param p_stream the stream to modify
* @param p_data the data to set.
* @warning depending on your source object p_stream this function may leak, use opj_stream_set_user_data_v3
*/
OPJ_DEPRECATED(OPJ_API void OPJ_CALLCONV opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data));
/**
* Sets the given data to be used as a user data for the stream.
* @param p_stream the stream to modify
* @param p_data the data to set.
* @param p_function the function to free p_data when opj_stream_destroy() is called.
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_v3 (opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function);
OPJ_API void OPJ_CALLCONV opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function);
/**
* Sets the length of the user data for the stream.
@@ -1096,14 +1166,14 @@ OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length(opj_stream_t* p_stream
* @param fname the filename of the file to stream
* @param p_is_read_stream whether the stream is a read stream (true) or not (false)
*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream_v3 (const char *fname, OPJ_BOOL p_is_read_stream);
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream (const char *fname, OPJ_BOOL p_is_read_stream);
/** Create a stream from a file identified with its filename with a specific buffer size
* @param fname the filename of the file to stream
* @param p_buffer_size size of the chunk used to stream
* @param p_is_read_stream whether the stream is a read stream (true) or not (false)
*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream_v3 (const char *fname,
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream (const char *fname,
OPJ_SIZE_T p_buffer_size,
OPJ_BOOL p_is_read_stream);

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*

View File

@@ -1,6 +1,11 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@@ -1,2 +1,10 @@
/* create opj_config.h for CMake */
#cmakedefine OPJ_HAVE_STDINT_H @OPJ_HAVE_STDINT_H@
/*--------------------------------------------------------------------------*/
/* OpenJPEG Versioning */
/* Version number. */
#define OPJ_VERSION_MAJOR @OPENJPEG_VERSION_MAJOR@
#define OPJ_VERSION_MINOR @OPENJPEG_VERSION_MINOR@
#define OPJ_VERSION_BUILD @OPENJPEG_VERSION_BUILD@

View File

@@ -1,6 +1,11 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2008;2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*

View File

@@ -1,9 +1,15 @@
/*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2014, Professor Benoit Macq
* Copyright (c) 2001-2003, David Janssens
* Copyright (c) 2002-2003, Yannick Verschueren
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2003-2007, Francois-Olivier Devaux
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2012, Mathieu Malaterre <mathieu.malaterre@gmail.com>
* All rights reserved.
*

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>
* All rights reserved.

View File

@@ -1,4 +1,9 @@
/*
* The copyright in this software is being made available under the 2-clauses
* BSD License, included below. This software may be subject to other third
* party and contributor rights, including patent rights, and no such rights
* are granted under this license.
*
* Copyright (c) 2012, Mathieu Malaterre <mathieu.malaterre@gmail.com>
* All rights reserved.
*

Some files were not shown because too many files have changed in this diff Show More