Merge pull request #926 from rouault/reformat_h_files

Reformat: apply reformattin on .h files (#128)
This commit is contained in:
Even Rouault 2017-05-15 13:08:03 +02:00 committed by GitHub
commit f7a126af61
129 changed files with 7459 additions and 7139 deletions

View File

@ -47,7 +47,7 @@ set -e
# determine changed files
MODIFIED=$(git status --porcelain| ${GP}sed -ne "s/^ *[MA] *//p" | sort -u)
#MODIFIED=$(find src -name "*.c")
#MODIFIED=$(find src -name "*.h")
if [ -z "$MODIFIED" ]; then
echo nothing was modified

View File

@ -3,13 +3,12 @@
#ifndef _GETOPT_H_
#define _GETOPT_H_
typedef struct opj_option
{
typedef struct opj_option {
const char *name;
int has_arg;
int *flag;
int val;
}opj_option_t;
} opj_option_t;
#define NO_ARG 0
#define REQ_ARG 1

View File

@ -71,14 +71,18 @@ void clip_component(opj_image_comp_t* component, OPJ_UINT32 precision);
void scale_component(opj_image_comp_t* component, OPJ_UINT32 precision);
/* planar / interleaved conversions */
typedef void (* convert_32s_CXPX)(const OPJ_INT32* pSrc, OPJ_INT32* const* pDst, OPJ_SIZE_T length);
typedef void (* convert_32s_CXPX)(const OPJ_INT32* pSrc, OPJ_INT32* const* pDst,
OPJ_SIZE_T length);
extern const convert_32s_CXPX convert_32s_CXPX_LUT[5];
typedef void (* convert_32s_PXCX)(OPJ_INT32 const* const* pSrc, OPJ_INT32* pDst, OPJ_SIZE_T length, OPJ_INT32 adjust);
typedef void (* convert_32s_PXCX)(OPJ_INT32 const* const* pSrc, OPJ_INT32* pDst,
OPJ_SIZE_T length, OPJ_INT32 adjust);
extern const convert_32s_PXCX convert_32s_PXCX_LUT[5];
/* bit depth conversions */
typedef void (* convert_XXx32s_C1R)(const OPJ_BYTE* pSrc, OPJ_INT32* pDst, OPJ_SIZE_T length);
typedef void (* convert_XXx32s_C1R)(const OPJ_BYTE* pSrc, OPJ_INT32* pDst,
OPJ_SIZE_T length);
extern const convert_XXx32s_C1R convert_XXu32s_C1R_LUT[9]; /* up to 8bpp */
typedef void (* convert_32sXXx_C1R)(const OPJ_INT32* pSrc, OPJ_BYTE* pDst, OPJ_SIZE_T length);
typedef void (* convert_32sXXx_C1R)(const OPJ_INT32* pSrc, OPJ_BYTE* pDst,
OPJ_SIZE_T length);
extern const convert_32sXXx_C1R convert_32sXXu_C1R_LUT[9]; /* up to 8bpp */
@ -108,12 +112,15 @@ int imagetopnm(opj_image_t *image, const char *outfile, int force_split);
/* RAW conversion */
int imagetoraw(opj_image_t * image, const char *outfile);
int imagetorawl(opj_image_t * image, const char *outfile);
opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp);
opj_image_t* rawltoimage(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp);
opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters,
raw_cparameters_t *raw_cp);
opj_image_t* rawltoimage(const char *filename, opj_cparameters_t *parameters,
raw_cparameters_t *raw_cp);
/* PNG conversion*/
extern int imagetopng(opj_image_t *image, const char *write_idf);
extern opj_image_t* pngtoimage(const char *filename, opj_cparameters_t *parameters);
extern opj_image_t* pngtoimage(const char *filename,
opj_cparameters_t *parameters);
#endif /* __J2K_CONVERT_H */

View File

@ -106,14 +106,14 @@
*/
#if !defined(HAVE_DIRENT_H) && !defined(HAVE_DIRECT_H) && !defined(HAVE_SYS_DIR_H) && !defined(HAVE_NDIR_H) && !defined(HAVE_SYS_NDIR_H) && !defined(HAVE_DIR_H)
# if defined(_MSC_VER) /* Microsoft C/C++ */
/* no dirent.h */
/* no dirent.h */
# elif defined(__MINGW32__) /* MinGW */
/* no dirent.h */
/* no dirent.h */
# elif defined(__BORLANDC__) /* Borland C/C++ */
# define HAVE_DIRENT_H
# define VOID_CLOSEDIR
# elif defined(__TURBOC__) /* Borland Turbo C */
/* no dirent.h */
/* no dirent.h */
# elif defined(__WATCOMC__) /* Watcom C/C++ */
# define HAVE_DIRECT_H
# elif defined(__apollo) /* Apollo */
@ -172,7 +172,7 @@
#elif defined(MSDOS) || defined(WIN32)
/* figure out type of underlaying directory interface to be used */
/* figure out type of underlaying directory interface to be used */
# if defined(WIN32)
# define DIRENT_WIN32_INTERFACE
# elif defined(MSDOS)
@ -181,7 +181,7 @@
# error "missing native dirent interface"
# endif
/*** WIN32 specifics ***/
/*** WIN32 specifics ***/
# if defined(DIRENT_WIN32_INTERFACE)
# include <windows.h>
# if !defined(DIRENT_MAXNAMLEN)
@ -189,11 +189,11 @@
# endif
/*** MS-DOS specifics ***/
/*** MS-DOS specifics ***/
# elif defined(DIRENT_MSDOS_INTERFACE)
# include <dos.h>
/* Borland defines file length macros in dir.h */
/* Borland defines file length macros in dir.h */
# if defined(__BORLANDC__)
# include <dir.h>
# if !defined(DIRENT_MAXNAMLEN)
@ -203,7 +203,7 @@
# define _find_t find_t
# endif
/* Turbo C defines ffblk structure in dir.h */
/* Turbo C defines ffblk structure in dir.h */
# elif defined(__TURBOC__)
# include <dir.h>
# if !defined(DIRENT_MAXNAMLEN)
@ -211,13 +211,13 @@
# endif
# define DIRENT_USE_FFBLK
/* MSVC */
/* MSVC */
# elif defined(_MSC_VER)
# if !defined(DIRENT_MAXNAMLEN)
# define DIRENT_MAXNAMLEN (12)
# endif
/* Watcom */
/* Watcom */
# elif defined(__WATCOMC__)
# if !defined(DIRENT_MAXNAMLEN)
# if defined(__OS2__) || defined(__NT__)
@ -230,7 +230,7 @@
# endif
# endif
/*** generic MS-DOS and MS-Windows stuff ***/
/*** generic MS-DOS and MS-Windows stuff ***/
# if !defined(NAME_MAX) && defined(DIRENT_MAXNAMLEN)
# define NAME_MAX DIRENT_MAXNAMLEN
# endif
@ -239,7 +239,7 @@
# endif
/*
/*
* Substitute for real dirent structure. Note that `d_name' field is a
* true character array although we have it copied in the implementation
* dependent data. We could save some memory if we had declared `d_name'
@ -248,7 +248,7 @@
* something other than four. Besides, directory entries are typically so
* small that it takes virtually no time to copy them from place to place.
*/
typedef struct dirent {
typedef struct dirent {
char d_name[NAME_MAX + 1];
/*** Operating system specific part ***/
@ -261,11 +261,11 @@
struct _find_t data;
# endif
# endif
} dirent;
} dirent;
/* DIR substitute structure containing directory name. The name is
/* DIR substitute structure containing directory name. The name is
* essential for the operation of ``rewinndir'' function. */
typedef struct DIR {
typedef struct DIR {
char *dirname; /* directory being scanned */
dirent current; /* current entry */
int dirent_filled; /* is current un-processed? */
@ -275,17 +275,17 @@
HANDLE search_handle;
# elif defined(DIRENT_MSDOS_INTERFACE)
# endif
} DIR;
} DIR;
# ifdef __cplusplus
extern "C" {
# endif
/* supply prototypes for dirent functions */
static DIR *opendir (const char *dirname);
static struct dirent *readdir (DIR *dirp);
static int closedir (DIR *dirp);
static void rewinddir (DIR *dirp);
static DIR *opendir(const char *dirname);
static struct dirent *readdir(DIR *dirp);
static int closedir(DIR *dirp);
static void rewinddir(DIR *dirp);
/*
* Implement dirent interface as static functions so that the user does not
@ -312,9 +312,9 @@ static void rewinddir (DIR *dirp);
# define _dos_findfirst(name,flags,dest) findfirst(name,dest,flags)
#endif
static int _initdir (DIR *p);
static const char *_getdirname (const struct dirent *dp);
static void _setdirname (struct DIR *dirp);
static int _initdir(DIR *p);
static const char *_getdirname(const struct dirent *dp);
static void _setdirname(struct DIR *dirp);
/*
* <function name="opendir">
@ -345,41 +345,40 @@ static void _setdirname (struct DIR *dirp);
static DIR *opendir(const char *dirname)
{
DIR *dirp;
assert (dirname != NULL);
assert(dirname != NULL);
dirp = (DIR*)malloc (sizeof (struct DIR));
dirp = (DIR*)malloc(sizeof(struct DIR));
if (dirp != NULL) {
char *p;
/* allocate room for directory name */
dirp->dirname = (char*) malloc (strlen (dirname) + 1 + strlen ("\\*.*"));
dirp->dirname = (char*) malloc(strlen(dirname) + 1 + strlen("\\*.*"));
if (dirp->dirname == NULL) {
/* failed to duplicate directory name. errno set by malloc() */
free (dirp);
free(dirp);
return NULL;
}
/* Copy directory name while appending directory separator and "*.*".
* Directory separator is not appended if the name already ends with
* drive or directory separator. Directory separator is assumed to be
* '/' or '\' and drive separator is assumed to be ':'. */
strcpy (dirp->dirname, dirname);
p = strchr (dirp->dirname, '\0');
strcpy(dirp->dirname, dirname);
p = strchr(dirp->dirname, '\0');
if (dirp->dirname < p &&
*(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':')
{
strcpy (p++, "\\");
*(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':') {
strcpy(p++, "\\");
}
# ifdef DIRENT_WIN32_INTERFACE
strcpy (p, "*"); /*scan files with and without extension in win32*/
strcpy(p, "*"); /*scan files with and without extension in win32*/
# else
strcpy (p, "*.*"); /*scan files with and without extension in DOS*/
strcpy(p, "*.*"); /*scan files with and without extension in DOS*/
# endif
/* open stream */
if (_initdir (dirp) == 0) {
if (_initdir(dirp) == 0) {
/* initialization failed */
free (dirp->dirname);
free (dirp);
free(dirp->dirname);
free(dirp);
return NULL;
}
}
@ -434,7 +433,7 @@ static DIR *opendir(const char *dirname)
* </function>
*/
static struct dirent *
readdir (DIR *dirp)
readdir(DIR *dirp)
{
assert(dirp != NULL);
if (dirp == NULL) {
@ -465,24 +464,24 @@ readdir (DIR *dirp)
} else {
/* fill in entry and return that */
#if defined(DIRENT_WIN32_INTERFACE)
if (FindNextFile (dirp->search_handle, &dirp->current.data) == FALSE) {
if (FindNextFile(dirp->search_handle, &dirp->current.data) == FALSE) {
/* Last file has been processed or an error occurred */
FindClose (dirp->search_handle);
FindClose(dirp->search_handle);
dirp->search_handle = INVALID_HANDLE_VALUE;
errno = ENOENT;
return NULL;
}
# elif defined(DIRENT_MSDOS_INTERFACE)
if (_dos_findnext (&dirp->current.data) != 0) {
if (_dos_findnext(&dirp->current.data) != 0) {
/* _dos_findnext and findnext will set errno to ENOENT when no
* more entries could be retrieved. */
return NULL;
}
# endif
_setdirname (dirp);
assert (dirp->dirent_filled == 0);
_setdirname(dirp);
assert(dirp->dirent_filled == 0);
}
return &dirp->current;
}
@ -508,23 +507,25 @@ readdir (DIR *dirp)
* </function>
*/
static int
closedir (DIR *dirp)
closedir(DIR *dirp)
{
int retcode = 0;
/* make sure that dirp points to legal structure */
assert (dirp != NULL);
assert(dirp != NULL);
if (dirp == NULL) {
errno = EBADF;
return -1;
}
/* free directory name and search handles */
if (dirp->dirname != NULL) free (dirp->dirname);
if (dirp->dirname != NULL) {
free(dirp->dirname);
}
#if defined(DIRENT_WIN32_INTERFACE)
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
if (FindClose (dirp->search_handle) == FALSE) {
if (FindClose(dirp->search_handle) == FALSE) {
/* Unknown error */
retcode = -1;
errno = EBADF;
@ -533,12 +534,12 @@ closedir (DIR *dirp)
#endif
/* clear dirp structure to make sure that it cannot be used anymore*/
memset (dirp, 0, sizeof (*dirp));
memset(dirp, 0, sizeof(*dirp));
# if defined(DIRENT_WIN32_INTERFACE)
dirp->search_handle = INVALID_HANDLE_VALUE;
# endif
free (dirp);
free(dirp);
return retcode;
}
@ -565,20 +566,20 @@ closedir (DIR *dirp)
* notice it later when you try to retrieve the first directory entry.
*/
static void
rewinddir (DIR *dirp)
rewinddir(DIR *dirp)
{
/* make sure that dirp is legal */
assert (dirp != NULL);
assert(dirp != NULL);
if (dirp == NULL) {
errno = EBADF;
return;
}
assert (dirp->dirname != NULL);
assert(dirp->dirname != NULL);
/* close previous stream */
#if defined(DIRENT_WIN32_INTERFACE)
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
if (FindClose (dirp->search_handle) == FALSE) {
if (FindClose(dirp->search_handle) == FALSE) {
/* Unknown error */
errno = EBADF;
}
@ -586,7 +587,7 @@ rewinddir (DIR *dirp)
#endif
/* re-open previous stream */
if (_initdir (dirp) == 0) {
if (_initdir(dirp) == 0) {
/* initialization failed but we cannot deal with error. User will notice
* error later when she tries to retrieve first directory enty. */
/*EMPTY*/;
@ -599,15 +600,15 @@ rewinddir (DIR *dirp)
* Be sure to close previous stream before opening new one.
*/
static int
_initdir (DIR *dirp)
_initdir(DIR *dirp)
{
assert (dirp != NULL);
assert (dirp->dirname != NULL);
assert(dirp != NULL);
assert(dirp->dirname != NULL);
dirp->dirent_filled = 0;
# if defined(DIRENT_WIN32_INTERFACE)
/* Open stream and retrieve first file */
dirp->search_handle = FindFirstFile (dirp->dirname, &dirp->current.data);
dirp->search_handle = FindFirstFile(dirp->dirname, &dirp->current.data);
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
/* something went wrong but we don't know what. GetLastError() could
* give us more information about the error, but then we should map
@ -617,10 +618,9 @@ _initdir (DIR *dirp)
}
# elif defined(DIRENT_MSDOS_INTERFACE)
if (_dos_findfirst (dirp->dirname,
if (_dos_findfirst(dirp->dirname,
_A_SUBDIR | _A_RDONLY | _A_ARCH | _A_SYSTEM | _A_HIDDEN,
&dirp->current.data) != 0)
{
&dirp->current.data) != 0) {
/* _dos_findfirst and findfirst will set errno to ENOENT when no
* more entries could be retrieved. */
return 0;
@ -628,7 +628,7 @@ _initdir (DIR *dirp)
# endif
/* initialize DIR and it's first entry */
_setdirname (dirp);
_setdirname(dirp);
dirp->dirent_filled = 1;
return 1;
}
@ -638,7 +638,7 @@ _initdir (DIR *dirp)
* Return implementation dependent name of the current directory entry.
*/
static const char *
_getdirname (const struct dirent *dp)
_getdirname(const struct dirent *dp)
{
#if defined(DIRENT_WIN32_INTERFACE)
return dp->data.cFileName;
@ -656,12 +656,13 @@ _getdirname (const struct dirent *dp)
* Copy name of implementation dependent directory entry to the d_name field.
*/
static void
_setdirname (struct DIR *dirp) {
_setdirname(struct DIR *dirp)
{
/* make sure that d_name is long enough */
assert (strlen (_getdirname (&dirp->current)) <= NAME_MAX);
assert(strlen(_getdirname(&dirp->current)) <= NAME_MAX);
strncpy (dirp->current.d_name,
_getdirname (&dirp->current),
strncpy(dirp->current.d_name,
_getdirname(&dirp->current),
NAME_MAX);
dirp->current.d_name[NAME_MAX] = '\0'; /*char d_name[NAME_MAX+1]*/
}

3
src/bin/jp3d/convert.h Executable file → Normal file
View File

@ -41,7 +41,8 @@ opj_volume_t* pgxtovolume(char *filename, opj_cparameters_t *parameters);
int volumetopgx(opj_volume_t *volume, char *outfile);
opj_volume_t* bintovolume(char *filename,char *fileimg, opj_cparameters_t *parameters);
opj_volume_t* bintovolume(char *filename, char *fileimg,
opj_cparameters_t *parameters);
int volumetobin(opj_volume_t *volume, char *outfile);

0
src/bin/jp3d/getopt.h Executable file → Normal file
View File

View File

@ -105,14 +105,14 @@
*/
#if !defined(HAVE_DIRENT_H) && !defined(HAVE_DIRECT_H) && !defined(HAVE_SYS_DIR_H) && !defined(HAVE_NDIR_H) && !defined(HAVE_SYS_NDIR_H) && !defined(HAVE_DIR_H)
# if defined(_MSC_VER) /* Microsoft C/C++ */
/* no dirent.h */
/* no dirent.h */
# elif defined(__MINGW32__) /* MinGW */
/* no dirent.h */
/* no dirent.h */
# elif defined(__BORLANDC__) /* Borland C/C++ */
# define HAVE_DIRENT_H
# define VOID_CLOSEDIR
# elif defined(__TURBOC__) /* Borland Turbo C */
/* no dirent.h */
/* no dirent.h */
# elif defined(__WATCOMC__) /* Watcom C/C++ */
# define HAVE_DIRECT_H
# elif defined(__apollo) /* Apollo */
@ -171,7 +171,7 @@
#elif defined(MSDOS) || defined(WIN32)
/* figure out type of underlaying directory interface to be used */
/* figure out type of underlaying directory interface to be used */
# if defined(WIN32)
# define DIRENT_WIN32_INTERFACE
# elif defined(MSDOS)
@ -180,7 +180,7 @@
# error "missing native dirent interface"
# endif
/*** WIN32 specifics ***/
/*** WIN32 specifics ***/
# if defined(DIRENT_WIN32_INTERFACE)
# include <windows.h>
# if !defined(DIRENT_MAXNAMLEN)
@ -188,11 +188,11 @@
# endif
/*** MS-DOS specifics ***/
/*** MS-DOS specifics ***/
# elif defined(DIRENT_MSDOS_INTERFACE)
# include <dos.h>
/* Borland defines file length macros in dir.h */
/* Borland defines file length macros in dir.h */
# if defined(__BORLANDC__)
# include <dir.h>
# if !defined(DIRENT_MAXNAMLEN)
@ -202,7 +202,7 @@
# define _find_t find_t
# endif
/* Turbo C defines ffblk structure in dir.h */
/* Turbo C defines ffblk structure in dir.h */
# elif defined(__TURBOC__)
# include <dir.h>
# if !defined(DIRENT_MAXNAMLEN)
@ -210,13 +210,13 @@
# endif
# define DIRENT_USE_FFBLK
/* MSVC */
/* MSVC */
# elif defined(_MSC_VER)
# if !defined(DIRENT_MAXNAMLEN)
# define DIRENT_MAXNAMLEN (12)
# endif
/* Watcom */
/* Watcom */
# elif defined(__WATCOMC__)
# if !defined(DIRENT_MAXNAMLEN)
# if defined(__OS2__) || defined(__NT__)
@ -229,7 +229,7 @@
# endif
# endif
/*** generic MS-DOS and MS-Windows stuff ***/
/*** generic MS-DOS and MS-Windows stuff ***/
# if !defined(NAME_MAX) && defined(DIRENT_MAXNAMLEN)
# define NAME_MAX DIRENT_MAXNAMLEN
# endif
@ -238,7 +238,7 @@
# endif
/*
/*
* Substitute for real dirent structure. Note that `d_name' field is a
* true character array although we have it copied in the implementation
* dependent data. We could save some memory if we had declared `d_name'
@ -247,7 +247,7 @@
* something other than four. Besides, directory entries are typically so
* small that it takes virtually no time to copy them from place to place.
*/
typedef struct dirent {
typedef struct dirent {
char d_name[NAME_MAX + 1];
/*** Operating system specific part ***/
@ -260,11 +260,11 @@
struct _find_t data;
# endif
# endif
} dirent;
} dirent;
/* DIR substitute structure containing directory name. The name is
/* DIR substitute structure containing directory name. The name is
* essential for the operation of ``rewinndir'' function. */
typedef struct DIR {
typedef struct DIR {
char *dirname; /* directory being scanned */
dirent current; /* current entry */
int dirent_filled; /* is current un-processed? */
@ -274,17 +274,17 @@
HANDLE search_handle;
# elif defined(DIRENT_MSDOS_INTERFACE)
# endif
} DIR;
} DIR;
# ifdef __cplusplus
extern "C" {
# endif
/* supply prototypes for dirent functions */
static DIR *opendir (const char *dirname);
static struct dirent *readdir (DIR *dirp);
static int closedir (DIR *dirp);
static void rewinddir (DIR *dirp);
static DIR *opendir(const char *dirname);
static struct dirent *readdir(DIR *dirp);
static int closedir(DIR *dirp);
static void rewinddir(DIR *dirp);
/*
* Implement dirent interface as static functions so that the user does not
@ -311,9 +311,9 @@ static void rewinddir (DIR *dirp);
# define _dos_findfirst(name,flags,dest) findfirst(name,dest,flags)
#endif
static int _initdir (DIR *p);
static const char *_getdirname (const struct dirent *dp);
static void _setdirname (struct DIR *dirp);
static int _initdir(DIR *p);
static const char *_getdirname(const struct dirent *dp);
static void _setdirname(struct DIR *dirp);
/*
* <function name="opendir">
@ -344,41 +344,40 @@ static void _setdirname (struct DIR *dirp);
static DIR *opendir(const char *dirname)
{
DIR *dirp;
assert (dirname != NULL);
assert(dirname != NULL);
dirp = (DIR*)malloc (sizeof (struct DIR));
dirp = (DIR*)malloc(sizeof(struct DIR));
if (dirp != NULL) {
char *p;
/* allocate room for directory name */
dirp->dirname = (char*) malloc (strlen (dirname) + 1 + strlen ("\\*.*"));
dirp->dirname = (char*) malloc(strlen(dirname) + 1 + strlen("\\*.*"));
if (dirp->dirname == NULL) {
/* failed to duplicate directory name. errno set by malloc() */
free (dirp);
free(dirp);
return NULL;
}
/* Copy directory name while appending directory separator and "*.*".
* Directory separator is not appended if the name already ends with
* drive or directory separator. Directory separator is assumed to be
* '/' or '\' and drive separator is assumed to be ':'. */
strcpy (dirp->dirname, dirname);
p = strchr (dirp->dirname, '\0');
strcpy(dirp->dirname, dirname);
p = strchr(dirp->dirname, '\0');
if (dirp->dirname < p &&
*(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':')
{
strcpy (p++, "\\");
*(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':') {
strcpy(p++, "\\");
}
# ifdef DIRENT_WIN32_INTERFACE
strcpy (p, "*"); /*scan files with and without extension in win32*/
strcpy(p, "*"); /*scan files with and without extension in win32*/
# else
strcpy (p, "*.*"); /*scan files with and without extension in DOS*/
strcpy(p, "*.*"); /*scan files with and without extension in DOS*/
# endif
/* open stream */
if (_initdir (dirp) == 0) {
if (_initdir(dirp) == 0) {
/* initialization failed */
free (dirp->dirname);
free (dirp);
free(dirp->dirname);
free(dirp);
return NULL;
}
}
@ -433,7 +432,7 @@ static DIR *opendir(const char *dirname)
* </function>
*/
static struct dirent *
readdir (DIR *dirp)
readdir(DIR *dirp)
{
assert(dirp != NULL);
if (dirp == NULL) {
@ -464,24 +463,24 @@ readdir (DIR *dirp)
} else {
/* fill in entry and return that */
#if defined(DIRENT_WIN32_INTERFACE)
if (FindNextFile (dirp->search_handle, &dirp->current.data) == FALSE) {
if (FindNextFile(dirp->search_handle, &dirp->current.data) == FALSE) {
/* Last file has been processed or an error occurred */
FindClose (dirp->search_handle);
FindClose(dirp->search_handle);
dirp->search_handle = INVALID_HANDLE_VALUE;
errno = ENOENT;
return NULL;
}
# elif defined(DIRENT_MSDOS_INTERFACE)
if (_dos_findnext (&dirp->current.data) != 0) {
if (_dos_findnext(&dirp->current.data) != 0) {
/* _dos_findnext and findnext will set errno to ENOENT when no
* more entries could be retrieved. */
return NULL;
}
# endif
_setdirname (dirp);
assert (dirp->dirent_filled == 0);
_setdirname(dirp);
assert(dirp->dirent_filled == 0);
}
return &dirp->current;
}
@ -507,23 +506,25 @@ readdir (DIR *dirp)
* </function>
*/
static int
closedir (DIR *dirp)
closedir(DIR *dirp)
{
int retcode = 0;
/* make sure that dirp points to legal structure */
assert (dirp != NULL);
assert(dirp != NULL);
if (dirp == NULL) {
errno = EBADF;
return -1;
}
/* free directory name and search handles */
if (dirp->dirname != NULL) free (dirp->dirname);
if (dirp->dirname != NULL) {
free(dirp->dirname);
}
#if defined(DIRENT_WIN32_INTERFACE)
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
if (FindClose (dirp->search_handle) == FALSE) {
if (FindClose(dirp->search_handle) == FALSE) {
/* Unknown error */
retcode = -1;
errno = EBADF;
@ -532,12 +533,12 @@ closedir (DIR *dirp)
#endif
/* clear dirp structure to make sure that it cannot be used anymore*/
memset (dirp, 0, sizeof (*dirp));
memset(dirp, 0, sizeof(*dirp));
# if defined(DIRENT_WIN32_INTERFACE)
dirp->search_handle = INVALID_HANDLE_VALUE;
# endif
free (dirp);
free(dirp);
return retcode;
}
@ -564,20 +565,20 @@ closedir (DIR *dirp)
* notice it later when you try to retrieve the first directory entry.
*/
static void
rewinddir (DIR *dirp)
rewinddir(DIR *dirp)
{
/* make sure that dirp is legal */
assert (dirp != NULL);
assert(dirp != NULL);
if (dirp == NULL) {
errno = EBADF;
return;
}
assert (dirp->dirname != NULL);
assert(dirp->dirname != NULL);
/* close previous stream */
#if defined(DIRENT_WIN32_INTERFACE)
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
if (FindClose (dirp->search_handle) == FALSE) {
if (FindClose(dirp->search_handle) == FALSE) {
/* Unknown error */
errno = EBADF;
}
@ -585,7 +586,7 @@ rewinddir (DIR *dirp)
#endif
/* re-open previous stream */
if (_initdir (dirp) == 0) {
if (_initdir(dirp) == 0) {
/* initialization failed but we cannot deal with error. User will notice
* error later when she tries to retrieve first directory enty. */
/*EMPTY*/;
@ -598,15 +599,15 @@ rewinddir (DIR *dirp)
* Be sure to close previous stream before opening new one.
*/
static int
_initdir (DIR *dirp)
_initdir(DIR *dirp)
{
assert (dirp != NULL);
assert (dirp->dirname != NULL);
assert(dirp != NULL);
assert(dirp->dirname != NULL);
dirp->dirent_filled = 0;
# if defined(DIRENT_WIN32_INTERFACE)
/* Open stream and retrieve first file */
dirp->search_handle = FindFirstFile (dirp->dirname, &dirp->current.data);
dirp->search_handle = FindFirstFile(dirp->dirname, &dirp->current.data);
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
/* something went wrong but we don't know what. GetLastError() could
* give us more information about the error, but then we should map
@ -616,10 +617,9 @@ _initdir (DIR *dirp)
}
# elif defined(DIRENT_MSDOS_INTERFACE)
if (_dos_findfirst (dirp->dirname,
if (_dos_findfirst(dirp->dirname,
_A_SUBDIR | _A_RDONLY | _A_ARCH | _A_SYSTEM | _A_HIDDEN,
&dirp->current.data) != 0)
{
&dirp->current.data) != 0) {
/* _dos_findfirst and findfirst will set errno to ENOENT when no
* more entries could be retrieved. */
return 0;
@ -627,7 +627,7 @@ _initdir (DIR *dirp)
# endif
/* initialize DIR and it's first entry */
_setdirname (dirp);
_setdirname(dirp);
dirp->dirent_filled = 1;
return 1;
}
@ -637,7 +637,7 @@ _initdir (DIR *dirp)
* Return implementation dependent name of the current directory entry.
*/
static const char *
_getdirname (const struct dirent *dp)
_getdirname(const struct dirent *dp)
{
#if defined(DIRENT_WIN32_INTERFACE)
return dp->data.cFileName;
@ -655,12 +655,13 @@ _getdirname (const struct dirent *dp)
* Copy name of implementation dependent directory entry to the d_name field.
*/
static void
_setdirname (struct DIR *dirp) {
_setdirname(struct DIR *dirp)
{
/* make sure that d_name is long enough */
assert (strlen (_getdirname (&dirp->current)) <= NAME_MAX);
assert(strlen(_getdirname(&dirp->current)) <= NAME_MAX);
strncpy (dirp->current.d_name,
_getdirname (&dirp->current),
strncpy(dirp->current.d_name,
_getdirname(&dirp->current),
NAME_MAX);
dirp->current.d_name[NAME_MAX] = '\0'; /*char d_name[NAME_MAX+1]*/
}

View File

@ -78,11 +78,13 @@ int imagetopnm(opj_image_t *image, const char *outfile);
/* RAW conversion */
int imagetoraw(opj_image_t * image, const char *outfile);
opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp);
opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters,
raw_cparameters_t *raw_cp);
/* PNG conversion*/
extern int imagetopng(opj_image_t *image, const char *write_idf);
extern opj_image_t* pngtoimage(const char *filename, opj_cparameters_t *parameters);
extern opj_image_t* pngtoimage(const char *filename,
opj_cparameters_t *parameters);
#endif /* __J2K_CONVERT_H */

View File

@ -106,14 +106,14 @@
*/
#if !defined(HAVE_DIRENT_H) && !defined(HAVE_DIRECT_H) && !defined(HAVE_SYS_DIR_H) && !defined(HAVE_NDIR_H) && !defined(HAVE_SYS_NDIR_H) && !defined(HAVE_DIR_H)
# if defined(_MSC_VER) /* Microsoft C/C++ */
/* no dirent.h */
/* no dirent.h */
# elif defined(__MINGW32__) /* MinGW */
/* no dirent.h */
/* no dirent.h */
# elif defined(__BORLANDC__) /* Borland C/C++ */
# define HAVE_DIRENT_H
# define VOID_CLOSEDIR
# elif defined(__TURBOC__) /* Borland Turbo C */
/* no dirent.h */
/* no dirent.h */
# elif defined(__WATCOMC__) /* Watcom C/C++ */
# define HAVE_DIRECT_H
# elif defined(__apollo) /* Apollo */
@ -172,7 +172,7 @@
#elif defined(MSDOS) || defined(WIN32)
/* figure out type of underlaying directory interface to be used */
/* figure out type of underlaying directory interface to be used */
# if defined(WIN32)
# define DIRENT_WIN32_INTERFACE
# elif defined(MSDOS)
@ -181,7 +181,7 @@
# error "missing native dirent interface"
# endif
/*** WIN32 specifics ***/
/*** WIN32 specifics ***/
# if defined(DIRENT_WIN32_INTERFACE)
# include <windows.h>
# if !defined(DIRENT_MAXNAMLEN)
@ -189,11 +189,11 @@
# endif
/*** MS-DOS specifics ***/
/*** MS-DOS specifics ***/
# elif defined(DIRENT_MSDOS_INTERFACE)
# include <dos.h>
/* Borland defines file length macros in dir.h */
/* Borland defines file length macros in dir.h */
# if defined(__BORLANDC__)
# include <dir.h>
# if !defined(DIRENT_MAXNAMLEN)
@ -203,7 +203,7 @@
# define _find_t find_t
# endif
/* Turbo C defines ffblk structure in dir.h */
/* Turbo C defines ffblk structure in dir.h */
# elif defined(__TURBOC__)
# include <dir.h>
# if !defined(DIRENT_MAXNAMLEN)
@ -211,13 +211,13 @@
# endif
# define DIRENT_USE_FFBLK
/* MSVC */
/* MSVC */
# elif defined(_MSC_VER)
# if !defined(DIRENT_MAXNAMLEN)
# define DIRENT_MAXNAMLEN (12)
# endif
/* Watcom */
/* Watcom */
# elif defined(__WATCOMC__)
# if !defined(DIRENT_MAXNAMLEN)
# if defined(__OS2__) || defined(__NT__)
@ -230,7 +230,7 @@
# endif
# endif
/*** generic MS-DOS and MS-Windows stuff ***/
/*** generic MS-DOS and MS-Windows stuff ***/
# if !defined(NAME_MAX) && defined(DIRENT_MAXNAMLEN)
# define NAME_MAX DIRENT_MAXNAMLEN
# endif
@ -239,7 +239,7 @@
# endif
/*
/*
* Substitute for real dirent structure. Note that `d_name' field is a
* true character array although we have it copied in the implementation
* dependent data. We could save some memory if we had declared `d_name'
@ -248,7 +248,7 @@
* something other than four. Besides, directory entries are typically so
* small that it takes virtually no time to copy them from place to place.
*/
typedef struct dirent {
typedef struct dirent {
char d_name[NAME_MAX + 1];
/*** Operating system specific part ***/
@ -261,11 +261,11 @@
struct _find_t data;
# endif
# endif
} dirent;
} dirent;
/* DIR substitute structure containing directory name. The name is
/* DIR substitute structure containing directory name. The name is
* essential for the operation of ``rewinndir'' function. */
typedef struct DIR {
typedef struct DIR {
char *dirname; /* directory being scanned */
dirent current; /* current entry */
int dirent_filled; /* is current un-processed? */
@ -275,17 +275,17 @@
HANDLE search_handle;
# elif defined(DIRENT_MSDOS_INTERFACE)
# endif
} DIR;
} DIR;
# ifdef __cplusplus
extern "C" {
# endif
/* supply prototypes for dirent functions */
static DIR *opendir (const char *dirname);
static struct dirent *readdir (DIR *dirp);
static int closedir (DIR *dirp);
static void rewinddir (DIR *dirp);
static DIR *opendir(const char *dirname);
static struct dirent *readdir(DIR *dirp);
static int closedir(DIR *dirp);
static void rewinddir(DIR *dirp);
/*
* Implement dirent interface as static functions so that the user does not
@ -312,9 +312,9 @@ static void rewinddir (DIR *dirp);
# define _dos_findfirst(name,flags,dest) findfirst(name,dest,flags)
#endif
static int _initdir (DIR *p);
static const char *_getdirname (const struct dirent *dp);
static void _setdirname (struct DIR *dirp);
static int _initdir(DIR *p);
static const char *_getdirname(const struct dirent *dp);
static void _setdirname(struct DIR *dirp);
/*
* <function name="opendir">
@ -345,41 +345,40 @@ static void _setdirname (struct DIR *dirp);
static DIR *opendir(const char *dirname)
{
DIR *dirp;
assert (dirname != NULL);
assert(dirname != NULL);
dirp = (DIR*)malloc (sizeof (struct DIR));
dirp = (DIR*)malloc(sizeof(struct DIR));
if (dirp != NULL) {
char *p;
/* allocate room for directory name */
dirp->dirname = (char*) malloc (strlen (dirname) + 1 + strlen ("\\*.*"));
dirp->dirname = (char*) malloc(strlen(dirname) + 1 + strlen("\\*.*"));
if (dirp->dirname == NULL) {
/* failed to duplicate directory name. errno set by malloc() */
free (dirp);
free(dirp);
return NULL;
}
/* Copy directory name while appending directory separator and "*.*".
* Directory separator is not appended if the name already ends with
* drive or directory separator. Directory separator is assumed to be
* '/' or '\' and drive separator is assumed to be ':'. */
strcpy (dirp->dirname, dirname);
p = strchr (dirp->dirname, '\0');
strcpy(dirp->dirname, dirname);
p = strchr(dirp->dirname, '\0');
if (dirp->dirname < p &&
*(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':')
{
strcpy (p++, "\\");
*(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':') {
strcpy(p++, "\\");
}
# ifdef DIRENT_WIN32_INTERFACE
strcpy (p, "*"); /*scan files with and without extension in win32*/
strcpy(p, "*"); /*scan files with and without extension in win32*/
# else
strcpy (p, "*.*"); /*scan files with and without extension in DOS*/
strcpy(p, "*.*"); /*scan files with and without extension in DOS*/
# endif
/* open stream */
if (_initdir (dirp) == 0) {
if (_initdir(dirp) == 0) {
/* initialization failed */
free (dirp->dirname);
free (dirp);
free(dirp->dirname);
free(dirp);
return NULL;
}
}
@ -434,7 +433,7 @@ static DIR *opendir(const char *dirname)
* </function>
*/
static struct dirent *
readdir (DIR *dirp)
readdir(DIR *dirp)
{
assert(dirp != NULL);
if (dirp == NULL) {
@ -465,24 +464,24 @@ readdir (DIR *dirp)
} else {
/* fill in entry and return that */
#if defined(DIRENT_WIN32_INTERFACE)
if (FindNextFile (dirp->search_handle, &dirp->current.data) == FALSE) {
if (FindNextFile(dirp->search_handle, &dirp->current.data) == FALSE) {
/* Last file has been processed or an error occurred */
FindClose (dirp->search_handle);
FindClose(dirp->search_handle);
dirp->search_handle = INVALID_HANDLE_VALUE;
errno = ENOENT;
return NULL;
}
# elif defined(DIRENT_MSDOS_INTERFACE)
if (_dos_findnext (&dirp->current.data) != 0) {
if (_dos_findnext(&dirp->current.data) != 0) {
/* _dos_findnext and findnext will set errno to ENOENT when no
* more entries could be retrieved. */
return NULL;
}
# endif
_setdirname (dirp);
assert (dirp->dirent_filled == 0);
_setdirname(dirp);
assert(dirp->dirent_filled == 0);
}
return &dirp->current;
}
@ -508,23 +507,25 @@ readdir (DIR *dirp)
* </function>
*/
static int
closedir (DIR *dirp)
closedir(DIR *dirp)
{
int retcode = 0;
/* make sure that dirp points to legal structure */
assert (dirp != NULL);
assert(dirp != NULL);
if (dirp == NULL) {
errno = EBADF;
return -1;
}
/* free directory name and search handles */
if (dirp->dirname != NULL) free (dirp->dirname);
if (dirp->dirname != NULL) {
free(dirp->dirname);
}
#if defined(DIRENT_WIN32_INTERFACE)
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
if (FindClose (dirp->search_handle) == FALSE) {
if (FindClose(dirp->search_handle) == FALSE) {
/* Unknown error */
retcode = -1;
errno = EBADF;
@ -533,12 +534,12 @@ closedir (DIR *dirp)
#endif
/* clear dirp structure to make sure that it cannot be used anymore*/
memset (dirp, 0, sizeof (*dirp));
memset(dirp, 0, sizeof(*dirp));
# if defined(DIRENT_WIN32_INTERFACE)
dirp->search_handle = INVALID_HANDLE_VALUE;
# endif
free (dirp);
free(dirp);
return retcode;
}
@ -565,20 +566,20 @@ closedir (DIR *dirp)
* notice it later when you try to retrieve the first directory entry.
*/
static void
rewinddir (DIR *dirp)
rewinddir(DIR *dirp)
{
/* make sure that dirp is legal */
assert (dirp != NULL);
assert(dirp != NULL);
if (dirp == NULL) {
errno = EBADF;
return;
}
assert (dirp->dirname != NULL);
assert(dirp->dirname != NULL);
/* close previous stream */
#if defined(DIRENT_WIN32_INTERFACE)
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
if (FindClose (dirp->search_handle) == FALSE) {
if (FindClose(dirp->search_handle) == FALSE) {
/* Unknown error */
errno = EBADF;
}
@ -586,7 +587,7 @@ rewinddir (DIR *dirp)
#endif
/* re-open previous stream */
if (_initdir (dirp) == 0) {
if (_initdir(dirp) == 0) {
/* initialization failed but we cannot deal with error. User will notice
* error later when she tries to retrieve first directory enty. */
/*EMPTY*/;
@ -599,15 +600,15 @@ rewinddir (DIR *dirp)
* Be sure to close previous stream before opening new one.
*/
static int
_initdir (DIR *dirp)
_initdir(DIR *dirp)
{
assert (dirp != NULL);
assert (dirp->dirname != NULL);
assert(dirp != NULL);
assert(dirp->dirname != NULL);
dirp->dirent_filled = 0;
# if defined(DIRENT_WIN32_INTERFACE)
/* Open stream and retrieve first file */
dirp->search_handle = FindFirstFile (dirp->dirname, &dirp->current.data);
dirp->search_handle = FindFirstFile(dirp->dirname, &dirp->current.data);
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
/* something went wrong but we don't know what. GetLastError() could
* give us more information about the error, but then we should map
@ -617,10 +618,9 @@ _initdir (DIR *dirp)
}
# elif defined(DIRENT_MSDOS_INTERFACE)
if (_dos_findfirst (dirp->dirname,
if (_dos_findfirst(dirp->dirname,
_A_SUBDIR | _A_RDONLY | _A_ARCH | _A_SYSTEM | _A_HIDDEN,
&dirp->current.data) != 0)
{
&dirp->current.data) != 0) {
/* _dos_findfirst and findfirst will set errno to ENOENT when no
* more entries could be retrieved. */
return 0;
@ -628,7 +628,7 @@ _initdir (DIR *dirp)
# endif
/* initialize DIR and it's first entry */
_setdirname (dirp);
_setdirname(dirp);
dirp->dirent_filled = 1;
return 1;
}
@ -638,7 +638,7 @@ _initdir (DIR *dirp)
* Return implementation dependent name of the current directory entry.
*/
static const char *
_getdirname (const struct dirent *dp)
_getdirname(const struct dirent *dp)
{
#if defined(DIRENT_WIN32_INTERFACE)
return dp->data.cFileName;
@ -656,12 +656,13 @@ _getdirname (const struct dirent *dp)
* Copy name of implementation dependent directory entry to the d_name field.
*/
static void
_setdirname (struct DIR *dirp) {
_setdirname(struct DIR *dirp)
{
/* make sure that d_name is long enough */
assert (strlen (_getdirname (&dirp->current)) <= NAME_MAX);
assert(strlen(_getdirname(&dirp->current)) <= NAME_MAX);
strncpy (dirp->current.d_name,
_getdirname (&dirp->current),
strncpy(dirp->current.d_name,
_getdirname(&dirp->current),
NAME_MAX);
dirp->current.d_name[NAME_MAX] = '\0'; /*char d_name[NAME_MAX+1]*/
}

View File

@ -9,5 +9,6 @@
void xml_write_init(BOOL n, BOOL t, BOOL r, BOOL d);
int xml_write_struct(FILE *file, FILE *xmlout, opj_mj2_t * movie, unsigned int sampleframe, char* stringDTD, opj_event_mgr_t *event_mgr);
int xml_write_struct(FILE *file, FILE *xmlout, opj_mj2_t * movie,
unsigned int sampleframe, char* stringDTD, opj_event_mgr_t *event_mgr);

View File

@ -181,16 +181,26 @@ class OPJChildFrame;
class OPJViewerApp: public wxApp
{
// public methods and variables
public:
public:
// class constructor
OPJViewerApp() { m_showImages = true; m_showButtons = false; }
OPJViewerApp()
{
m_showImages = true;
m_showButtons = false;
}
// other methods
bool OnInit(void);
int OnExit(void);
void SetShowImages(bool show) { m_showImages = show; }
bool ShowImages() const { return m_showImages; }
void SetShowImages(bool show)
{
m_showImages = show;
}
bool ShowImages() const
{
return m_showImages;
}
void ShowCmdLine(const wxCmdLineParser& parser);
// all the threads currently alive - as soon as the thread terminates, it's
@ -205,7 +215,8 @@ class OPJViewerApp: public wxApp
// the last exiting thread should post to m_semAllDone if this is true
// (protected by the same m_critsect)
bool m_deco_waitingUntilAllDone, m_parse_waitingUntilAllDone, m_enco_waitingUntilAllDone;
bool m_deco_waitingUntilAllDone, m_parse_waitingUntilAllDone,
m_enco_waitingUntilAllDone;
// the list of all filenames written in the command line
wxArrayString m_filelist;
@ -225,8 +236,10 @@ class OPJViewerApp: public wxApp
// encoding engine parameters
wxString m_subsampling, m_origin, m_rates, m_comment, m_index, m_quality;
wxString m_cbsize, m_prsize, m_tsize, m_torigin, m_poc;
bool m_enablecomm, m_enableidx, m_multicomp, m_irreversible, m_enablesop, m_enableeph;
bool m_enablebypass, m_enablereset, m_enablerestart, m_enablevsc, m_enableerterm;
bool m_enablecomm, m_enableidx, m_multicomp, m_irreversible, m_enablesop,
m_enableeph;
bool m_enablebypass, m_enablereset, m_enablerestart, m_enablevsc,
m_enableerterm;
bool m_enablesegmark, m_enablepoc;
bool m_enablequality;
int m_resolutions, m_progression;
@ -245,7 +258,7 @@ class OPJViewerApp: public wxApp
wxConfig *OPJconfig;
// private methods and variables
private:
private:
bool m_showImages, m_showButtons;
};
@ -258,14 +271,16 @@ DECLARE_APP(OPJViewerApp)
class OPJCanvas: public wxScrolledWindow
{
// public methods and variables
public:
public:
// class constructor
OPJCanvas(wxFileName fname, wxWindow *parent, const wxPoint& pos, const wxSize& size);
OPJCanvas(wxFileName fname, wxWindow *parent, const wxPoint& pos,
const wxSize& size);
virtual void OnDraw(wxDC& dc);
void OnEvent(wxMouseEvent& event);
void WriteText(const wxString& text) {
void WriteText(const wxString& text)
{
#ifndef __WXGTK__
wxMutexGuiEnter();
#endif //__WXGTK__
@ -296,19 +311,31 @@ class OPJCanvas: public wxScrolledWindow
class OPJMarkerData : public wxTreeItemData
{
// public methods and variables
public:
public:
// class constructor
OPJMarkerData(const wxString& desc, const wxString& fname = wxT(""), wxFileOffset start = 0, wxFileOffset length = 0) : m_desc(desc), m_filestring(fname) { m_start = start; m_length = length; }
OPJMarkerData(const wxString& desc, const wxString& fname = wxT(""),
wxFileOffset start = 0, wxFileOffset length = 0) : m_desc(desc),
m_filestring(fname)
{
m_start = start;
m_length = length;
}
void ShowInfo(wxTreeCtrl *tree);
const wxChar *GetDesc1() const { return m_desc.c_str(); }
const wxChar *GetDesc2() const { return m_filestring.c_str(); }
const wxChar *GetDesc1() const
{
return m_desc.c_str();
}
const wxChar *GetDesc2() const
{
return m_filestring.c_str();
}
wxFileOffset m_start, m_length;
wxString m_desc;
// private methods and variables
private:
private:
wxString m_filestring;
};
@ -316,8 +343,7 @@ class OPJMarkerData : public wxTreeItemData
class OPJMarkerTree : public wxTreeCtrl
{
public:
enum
{
enum {
TreeCtrlIcon_File,
TreeCtrlIcon_FileSelected,
TreeCtrlIcon_Folder,
@ -326,12 +352,19 @@ public:
};
OPJMarkerTree() { };
OPJMarkerTree(wxWindow *parent, OPJChildFrame *subframe, wxFileName fname, wxString name, const wxWindowID id,
OPJMarkerTree(wxWindow *parent, OPJChildFrame *subframe, wxFileName fname,
wxString name, const wxWindowID id,
const wxPoint& pos, const wxSize& size,
long style);
virtual ~OPJMarkerTree(){};
OPJParseThread *CreateParseThread(wxTreeItemId parentid = 0x00, OPJChildFrame *subframe = NULL);
void WriteText(const wxString& text) { wxMutexGuiEnter(); wxLogMessage(text); wxMutexGuiLeave(); }
virtual ~OPJMarkerTree() {};
OPJParseThread *CreateParseThread(wxTreeItemId parentid = 0x00,
OPJChildFrame *subframe = NULL);
void WriteText(const wxString& text)
{
wxMutexGuiEnter();
wxLogMessage(text);
wxMutexGuiLeave();
}
wxFileName m_fname;
wxTextCtrl *m_peektextCtrl;
@ -372,9 +405,15 @@ public:
/*void DoToggleIcon(const wxTreeItemId& item);*/
/*void ShowMenu(wxTreeItemId id, const wxPoint& pt);*/
int ImageSize(void) const { return m_imageSize; }
int ImageSize(void) const
{
return m_imageSize;
}
void SetLastItem(wxTreeItemId id) { m_lastItem = id; }
void SetLastItem(wxTreeItemId id)
{
m_lastItem = id;
}
protected:
/*virtual int OnCompareItems(const wxTreeItemId& i1, const wxTreeItemId& i2);*/
@ -408,17 +447,20 @@ private:
};
// this hash map stores all the trees of currently opened images, with an integer key
WX_DECLARE_HASH_MAP(int, OPJMarkerTree*, wxIntegerHash, wxIntegerEqual, OPJMarkerTreeHash);
WX_DECLARE_HASH_MAP(int, OPJMarkerTree*, wxIntegerHash, wxIntegerEqual,
OPJMarkerTreeHash);
// this hash map stores all the children of currently opened images, with an integer key
WX_DECLARE_HASH_MAP(int, OPJChildFrame*, wxIntegerHash, wxIntegerEqual, OPJChildFrameHash);
WX_DECLARE_HASH_MAP(int, OPJChildFrame*, wxIntegerHash, wxIntegerEqual,
OPJChildFrameHash);
// Define a new frame
class OPJFrame: public wxMDIParentFrame
{
public:
public:
OPJFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
OPJFrame(wxWindow *parent, const wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, const long style);
~OPJFrame(void);
void OnSize(wxSizeEvent& WXUNUSED(event));
@ -465,7 +507,7 @@ class OPJFrame: public wxMDIParentFrame
wxNotebook *m_bookCtrlbottom;
wxTextCtrl *m_textCtrlbrowse;
private:
private:
void TogStyle(int id, long flag);
void DoSort(bool reverse = false);
@ -479,14 +521,16 @@ protected:
wxSashLayoutWindow* m_topWindow;
wxSashLayoutWindow* m_leftWindow2;
DECLARE_EVENT_TABLE()
DECLARE_EVENT_TABLE()
};
class OPJChildFrame: public wxMDIChildFrame
{
public:
public:
OPJCanvas *m_canvas;
OPJChildFrame(OPJFrame *parent, wxFileName fname, int winnumber, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
OPJChildFrame(OPJFrame *parent, wxFileName fname, int winnumber,
const wxString& title, const wxPoint& pos, const wxSize& size,
const long style);
~OPJChildFrame(void);
void OnActivate(wxActivateEvent& event);
/*void OnQuit(wxCommandEvent& WXUNUSED(event));*/
@ -541,8 +585,7 @@ enum {
// menu and control ids
enum
{
enum {
TreeTest_Quit = wxID_EXIT,
TreeTest_About = wxID_ABOUT,
TreeTest_TogButtons = wxID_HIGHEST,
@ -646,17 +689,21 @@ public:
// write something to the text control
void WriteText(const wxString& text);
void LoadFile(wxFileName fname);
void ParseJ2KFile(wxFile *m_file, wxFileOffset offset, wxFileOffset length, wxTreeItemId parentid);
void ParseJP2File(wxFile *fileid, wxFileOffset filepoint, wxFileOffset filelimit, wxTreeItemId parentid);
void ParseJ2KFile(wxFile *m_file, wxFileOffset offset, wxFileOffset length,
wxTreeItemId parentid);
void ParseJP2File(wxFile *fileid, wxFileOffset filepoint,
wxFileOffset filelimit, wxTreeItemId parentid);
unsigned m_count;
OPJMarkerTree *m_tree;
wxTreeItemId m_parentid;
private:
int jpeg2000parse(wxFile *fileid, wxFileOffset filepoint, wxFileOffset filelimit,
int jpeg2000parse(wxFile *fileid, wxFileOffset filepoint,
wxFileOffset filelimit,
wxTreeItemId parentid, int level, char *scansign, unsigned long int *scanpoint);
int box_handler_function(int boxtype, wxFile *fileid, wxFileOffset filepoint, wxFileOffset filelimit,
int box_handler_function(int boxtype, wxFile *fileid, wxFileOffset filepoint,
wxFileOffset filelimit,
wxTreeItemId parentid, int level, char *scansign, unsigned long int *scanpoint);
};
@ -666,7 +713,10 @@ private:
class OPJDnDFile: public wxFileDropTarget
{
public:
OPJDnDFile(OPJFrame *pOwner) { m_pOwner = pOwner; }
OPJDnDFile(OPJFrame *pOwner)
{
m_pOwner = pOwner;
}
virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames);
private:
@ -678,7 +728,7 @@ private:
// Property sheet dialog: encoder
class OPJEncoderDialog: public wxPropertySheetDialog
{
DECLARE_CLASS(OPJEncoderDialog)
DECLARE_CLASS(OPJEncoderDialog)
public:
OPJEncoderDialog(wxWindow* parent, int dialogType);
~OPJEncoderDialog();
@ -688,7 +738,7 @@ public:
wxPanel* CreateMainSettingsPage(wxWindow* parent);
wxPanel* CreatePart1_1SettingsPage(wxWindow* parent);
wxPanel* CreatePart1_2SettingsPage(wxWindow* parent);
/* wxPanel* CreatePart3SettingsPage(wxWindow* parent);*/
/* wxPanel* CreatePart3SettingsPage(wxWindow* parent);*/
void OnEnableComm(wxCommandEvent& event);
void OnEnableIdx(wxCommandEvent& event);
void OnEnablePoc(wxCommandEvent& event);
@ -711,12 +761,14 @@ public:
wxTextCtrl *m_subsamplingCtrl, *m_originCtrl, *m_rateCtrl, *m_commentCtrl;
wxRadioButton *m_rateRadio, *m_qualityRadio;
wxTextCtrl *m_indexCtrl, *m_qualityCtrl, *m_cbsizeCtrl, *m_prsizeCtrl, *m_pocCtrl;
wxTextCtrl *m_indexCtrl, *m_qualityCtrl, *m_cbsizeCtrl, *m_prsizeCtrl,
*m_pocCtrl;
wxTextCtrl *m_tsizeCtrl, *m_toriginCtrl;
wxRadioBox *progressionBox;
wxCheckBox *m_enablecommCheck, *m_enableidxCheck, *m_mctCheck, *m_irrevCheck;
wxCheckBox *m_sopCheck, *m_ephCheck, *m_enablebypassCheck, *m_enableresetCheck,
*m_enablerestartCheck, *m_enablevscCheck, *m_enableertermCheck, *m_enablesegmarkCheck;
*m_enablerestartCheck, *m_enablevscCheck, *m_enableertermCheck,
*m_enablesegmarkCheck;
wxCheckBox *m_enablepocCheck, *m_enablejpwlCheck;
wxSpinCtrl *m_resolutionsCtrl;
@ -763,13 +815,13 @@ protected:
OPJENCO_STILE
};
DECLARE_EVENT_TABLE()
DECLARE_EVENT_TABLE()
};
// Property sheet dialog: decoder
class OPJDecoderDialog: public wxPropertySheetDialog
{
DECLARE_CLASS(OPJDecoderDialog)
DECLARE_CLASS(OPJDecoderDialog)
public:
OPJDecoderDialog(wxWindow* parent, int dialogType);
~OPJDecoderDialog();
@ -808,7 +860,7 @@ protected:
OPJDECO_FRAMENUM
};
DECLARE_EVENT_TABLE()
DECLARE_EVENT_TABLE()
};
#endif //__OPJ_VIEWER_H__

View File

@ -1,54 +1,56 @@
wxString htmlaboutpage = wxT(
"<html>"
"<body bgcolor=#FFFFFF>"
"<table cellspacing=7 cellpadding=1 border=0 width=100%>"
"<tr>"
"<td rowspan=3 valign=top align=center width=70>"
"<img src=\"memory:opj_logo.xpm\"><br><br>"
"</td>"
"<td align=center>"
"<font size=+0 color=#000000><b>"
OPJ_APPLICATION " " OPJ_APPLICATION_VERSION
"</b></font><br>"
"<font size=-1 color=#000000><b>A JPEG 2000 image viewer</b></font><br>"
"<font size=-2 color=#000000><b>" OPJ_APPLICATION_PLATFORM " version</b></font>"
"</td>"
"</tr>"
"<tr height=3 valign=center>"
"<td valign=center bgcolor=#cc3300></td>"
"</tr>"
"<tr>"
"<td align=justify>"
"<center><font size=+0 color=#000000><a href=\"http://www.openjpeg.org/\">OpenJPEG</a></font></center>"
"<p><font size=-1 color=#000000>The OpenJPEG library is an open-source JPEG 2000 codec written in C language. "
"In addition to the basic codec, various other features are under development.</font></p><br>"
"<font size=-2 color=red>* Build: ")
"<html>"
"<body bgcolor=#FFFFFF>"
"<table cellspacing=7 cellpadding=1 border=0 width=100%>"
"<tr>"
"<td rowspan=3 valign=top align=center width=70>"
"<img src=\"memory:opj_logo.xpm\"><br><br>"
"</td>"
"<td align=center>"
"<font size=+0 color=#000000><b>"
OPJ_APPLICATION " " OPJ_APPLICATION_VERSION
"</b></font><br>"
"<font size=-1 color=#000000><b>A JPEG 2000 image viewer</b></font><br>"
"<font size=-2 color=#000000><b>" OPJ_APPLICATION_PLATFORM " version</b></font>"
"</td>"
"</tr>"
"<tr height=3 valign=center>"
"<td valign=center bgcolor=#cc3300></td>"
"</tr>"
"<tr>"
"<td align=justify>"
"<center><font size=+0 color=#000000><a href=\"http://www.openjpeg.org/\">OpenJPEG</a></font></center>"
"<p><font size=-1 color=#000000>The OpenJPEG library is an open-source JPEG 2000 codec written in C language. "
"In addition to the basic codec, various other features are under development.</font></p><br>"
"<font size=-2 color=red>* Build: ")
#include "build.h"
wxT(", " __DATE__ ", " __TIME__ "</font><br>")
wxT("<font size=-2 color=red>* " wxVERSION_STRING "</font><br>")
wxT("<font size=-2 color=red>* OpenJPEG " OPENJPEG_VERSION " (")
wxT(", " __DATE__ ", " __TIME__ "</font><br>")
wxT("<font size=-2 color=red>* " wxVERSION_STRING "</font><br>")
wxT("<font size=-2 color=red>* OpenJPEG " OPENJPEG_VERSION " (")
#ifdef USE_JPWL
wxT("<font size=-2 color=green>JPWL</font> ")
wxT("<font size=-2 color=green>JPWL</font> ")
#endif // USE_JPWL
#ifdef USE_JPSEC
wxT("<font size=-2 color=green>JPSEC</font> ")
wxT("<font size=-2 color=green>JPSEC</font> ")
#endif // USE_JPSEC
wxT(")</font><br>")
wxT(")</font><br>")
#ifdef USE_MXF
wxT("<font size=-2 color=red>* MXFLib " MXFLIB_VERSION_MAJOR "." MXFLIB_VERSION_MINOR "." MXFLIB_VERSION_TWEAK " (" MXFLIB_VERSION_BUILD ")</font><br>")
wxT("<font size=-2 color=red>* MXFLib " MXFLIB_VERSION_MAJOR "."
MXFLIB_VERSION_MINOR "." MXFLIB_VERSION_TWEAK " (" MXFLIB_VERSION_BUILD
")</font><br>")
#endif // USE_MXF
wxT("</td>"
"</tr>"
"<tr>"
"<td colspan=2 bgcolor=#CC3300 height=3 valign=center></td>"
"</tr>"
"<tr>"
"<td colspan=2>"
"<font size=-2 color=#444444>OpenJPEG is &copy; 2002-2008 <a href=\"http://www.tele.ucl.ac.be/\">TELE</a> - <a href=\"http://www.uclouvain.be/\">Universite' Catholique de Louvain</a></font><br>"
"<font size=-2 color=#444444>OPJViewer is &copy; 2007-2008 <a href=\"http://dsplab.diei.unipg.it/\">DSPLab</a> - <a href=\"http://www.unipg.it/\">Universita' degli studi di Perugia</a></font>"
"</td>"
"</tr>"
"</table>"
"</body>"
"</html>"
);
wxT("</td>"
"</tr>"
"<tr>"
"<td colspan=2 bgcolor=#CC3300 height=3 valign=center></td>"
"</tr>"
"<tr>"
"<td colspan=2>"
"<font size=-2 color=#444444>OpenJPEG is &copy; 2002-2008 <a href=\"http://www.tele.ucl.ac.be/\">TELE</a> - <a href=\"http://www.uclouvain.be/\">Universite' Catholique de Louvain</a></font><br>"
"<font size=-2 color=#444444>OPJViewer is &copy; 2007-2008 <a href=\"http://dsplab.diei.unipg.it/\">DSPLab</a> - <a href=\"http://www.unipg.it/\">Universita' degli studi di Perugia</a></font>"
"</td>"
"</tr>"
"</table>"
"</body>"
"</html>"
);

View File

@ -165,8 +165,10 @@ public:
wxString m_poc;
#if wxUSE_STREAMS
virtual bool LoadFile(wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1);
virtual bool SaveFile(wxImage *image, wxOutputStream& stream, bool verbose=true);
virtual bool LoadFile(wxImage *image, wxInputStream& stream,
bool verbose = true, int index = -1);
virtual bool SaveFile(wxImage *image, wxOutputStream& stream,
bool verbose = true);
protected:
virtual bool DoCanRead(wxInputStream& stream);
#endif

View File

@ -86,10 +86,12 @@ public:
#endif // USE_JPWL
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 );
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true );
virtual bool LoadFile(wxImage *image, wxInputStream& stream,
bool verbose = true, int index = -1);
virtual bool SaveFile(wxImage *image, wxOutputStream& stream,
bool verbose = true);
protected:
virtual bool DoCanRead( wxInputStream& stream );
virtual bool DoCanRead(wxInputStream& stream);
#endif
private:

View File

@ -50,8 +50,9 @@
* @param[in] j2klen length of j2k codestream
* @return length of cidx box
*/
int opj_write_cidx( int offset, opj_stream_private_t *cio, opj_codestream_info_t cstr_info, int j2klen,
opj_event_mgr_t * p_manager );
int opj_write_cidx(int offset, opj_stream_private_t *cio,
opj_codestream_info_t cstr_info, int j2klen,
opj_event_mgr_t * p_manager);
/*
* Check if EPH option is used
@ -62,7 +63,8 @@ int opj_write_cidx( int offset, opj_stream_private_t *cio, opj_codestream_info_t
* @param[in] cio file output handle
* @return true if EPH is used
*/
OPJ_BOOL opj_check_EPHuse( int coff, opj_marker_info_t *markers, int marknum, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager );
OPJ_BOOL opj_check_EPHuse(int coff, opj_marker_info_t *markers, int marknum,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
#endif /* !CIDX_MANAGER_H_ */

View File

@ -54,19 +54,19 @@ The functions in CIO.C have for goal to realize a byte input / output process.
/* ----------------------------------------------------------------------- */
#if defined(OPJ_BIG_ENDIAN)
#define opj_write_bytes opj_write_bytes_BE
#define opj_read_bytes opj_read_bytes_BE
#define opj_write_double opj_write_double_BE
#define opj_read_double opj_read_double_BE
#define opj_write_float opj_write_float_BE
#define opj_read_float opj_read_float_BE
#define opj_write_bytes opj_write_bytes_BE
#define opj_read_bytes opj_read_bytes_BE
#define opj_write_double opj_write_double_BE
#define opj_read_double opj_read_double_BE
#define opj_write_float opj_write_float_BE
#define opj_read_float opj_read_float_BE
#else
#define opj_write_bytes opj_write_bytes_LE
#define opj_read_bytes opj_read_bytes_LE
#define opj_write_double opj_write_double_LE
#define opj_read_double opj_read_double_LE
#define opj_write_float opj_write_float_LE
#define opj_read_float opj_read_float_LE
#define opj_write_bytes opj_write_bytes_LE
#define opj_read_bytes opj_read_bytes_LE
#define opj_write_double opj_write_double_LE
#define opj_read_double opj_read_double_LE
#define opj_write_float opj_write_float_LE
#define opj_read_float opj_read_float_LE
#endif
@ -78,8 +78,7 @@ The functions in CIO.C have for goal to realize a byte input / output process.
/**
Byte input-output stream.
*/
typedef struct opj_stream_private
{
typedef struct opj_stream_private {
/**
* User data, be it files, ... The actual data depends on the type of the stream.
*/
@ -132,12 +131,14 @@ typedef struct opj_stream_private
/**
* FIXME DOC.
*/
OPJ_OFF_T (* m_opj_skip)(struct opj_stream_private * ,OPJ_OFF_T , struct opj_event_mgr *);
OPJ_OFF_T(* m_opj_skip)(struct opj_stream_private *, OPJ_OFF_T,
struct opj_event_mgr *);
/**
* FIXME DOC.
*/
OPJ_BOOL (* m_opj_seek) (struct opj_stream_private * , OPJ_OFF_T , struct opj_event_mgr *);
OPJ_BOOL(* m_opj_seek)(struct opj_stream_private *, OPJ_OFF_T,
struct opj_event_mgr *);
/**
* number of bytes containing in the buffer.
@ -172,7 +173,8 @@ opj_stream_private_t;
* @param p_value the value to write
* @param p_nb_bytes the number of bytes to write
*/
void opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes);
void opj_write_bytes_BE(OPJ_BYTE * p_buffer, OPJ_UINT32 p_value,
OPJ_UINT32 p_nb_bytes);
/**
* Reads some bytes from the given data buffer, this function is used in Big Endian cpus.
@ -181,7 +183,8 @@ void opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_n
* @param p_nb_bytes the nb bytes to read.
* @return the number of bytes read or -1 if an error occurred.
*/
void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes);
void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value,
OPJ_UINT32 p_nb_bytes);
/**
* Write some bytes to the given data buffer, this function is used in Little Endian cpus.
@ -190,7 +193,8 @@ void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT
* @param p_nb_bytes the number of bytes to write
* @return the number of bytes written or -1 if an error occurred
*/
void opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes);
void opj_write_bytes_LE(OPJ_BYTE * p_buffer, OPJ_UINT32 p_value,
OPJ_UINT32 p_nb_bytes);
/**
* Reads some bytes from the given data buffer, this function is used in Little Endian cpus.
@ -199,7 +203,8 @@ void opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_n
* @param p_nb_bytes the nb bytes to read.
* @return the number of bytes read or -1 if an error occurred.
*/
void opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes);
void opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value,
OPJ_UINT32 p_nb_bytes);
/**
@ -266,7 +271,8 @@ void opj_write_float_BE(OPJ_BYTE * p_buffer, OPJ_FLOAT32 p_value);
* @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes read, or -1 if an error occurred or if the stream is at the end.
*/
OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_SIZE_T opj_stream_read_data(opj_stream_private_t * p_stream,
OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr);
/**
* Writes some bytes to the stream.
@ -276,7 +282,9 @@ OPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_bu
* @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes writtent, or -1 if an error occurred.
*/
OPJ_SIZE_T opj_stream_write_data (opj_stream_private_t * p_stream,const OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_SIZE_T opj_stream_write_data(opj_stream_private_t * p_stream,
const OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size,
struct opj_event_mgr * p_event_mgr);
/**
* Writes the content of the stream buffer to the stream.
@ -284,7 +292,8 @@ OPJ_SIZE_T opj_stream_write_data (opj_stream_private_t * p_stream,const OPJ_BYTE
* @param p_event_mgr the user event manager to be notified of special events.
* @return true if the data could be flushed, false else.
*/
OPJ_BOOL opj_stream_flush (opj_stream_private_t * p_stream, struct opj_event_mgr * p_event_mgr);
OPJ_BOOL opj_stream_flush(opj_stream_private_t * p_stream,
struct opj_event_mgr * p_event_mgr);
/**
* Skips a number of bytes from the stream.
@ -293,7 +302,8 @@ OPJ_BOOL opj_stream_flush (opj_stream_private_t * p_stream, struct opj_event_mgr
* @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes skipped, or -1 if an error occurred.
*/
OPJ_OFF_T opj_stream_skip (opj_stream_private_t * p_stream,OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_OFF_T opj_stream_skip(opj_stream_private_t * p_stream, OPJ_OFF_T p_size,
struct opj_event_mgr * p_event_mgr);
/**
* Tells the byte offset on the stream (similar to ftell).
@ -302,7 +312,7 @@ OPJ_OFF_T opj_stream_skip (opj_stream_private_t * p_stream,OPJ_OFF_T p_size, str
*
* @return the current position o fthe stream.
*/
OPJ_OFF_T opj_stream_tell (const opj_stream_private_t * p_stream);
OPJ_OFF_T opj_stream_tell(const opj_stream_private_t * p_stream);
/**
@ -312,7 +322,8 @@ OPJ_OFF_T opj_stream_tell (const opj_stream_private_t * p_stream);
*
* @return Number of bytes left before the end of the stream.
*/
OPJ_OFF_T opj_stream_get_number_byte_left (const opj_stream_private_t * p_stream);
OPJ_OFF_T opj_stream_get_number_byte_left(const opj_stream_private_t *
p_stream);
/**
* Skips a number of bytes from the stream.
@ -321,7 +332,8 @@ OPJ_OFF_T opj_stream_get_number_byte_left (const opj_stream_private_t * p_stream
* @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes skipped, or -1 if an error occurred.
*/
OPJ_OFF_T opj_stream_write_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_OFF_T opj_stream_write_skip(opj_stream_private_t * p_stream,
OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
/**
* Skips a number of bytes from the stream.
@ -330,7 +342,8 @@ OPJ_OFF_T opj_stream_write_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_si
* @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes skipped, or -1 if an error occurred.
*/
OPJ_OFF_T opj_stream_read_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_OFF_T opj_stream_read_skip(opj_stream_private_t * p_stream,
OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
/**
* Skips a number of bytes from the stream.
@ -339,7 +352,8 @@ OPJ_OFF_T opj_stream_read_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_siz
* @param p_event_mgr the user event manager to be notified of special events.
* @return OPJ_TRUE if success, or OPJ_FALSE if an error occurred.
*/
OPJ_BOOL opj_stream_read_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_BOOL opj_stream_read_seek(opj_stream_private_t * p_stream, OPJ_OFF_T p_size,
struct opj_event_mgr * p_event_mgr);
/**
* Skips a number of bytes from the stream.
@ -348,7 +362,8 @@ OPJ_BOOL opj_stream_read_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size
* @param p_event_mgr the user event manager to be notified of special events.
* @return the number of bytes skipped, or -1 if an error occurred.
*/
OPJ_BOOL opj_stream_write_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_BOOL opj_stream_write_seek(opj_stream_private_t * p_stream,
OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
/**
* Seeks a number of bytes from the stream.
@ -357,32 +372,35 @@ OPJ_BOOL opj_stream_write_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_siz
* @param p_event_mgr the user event manager to be notified of special events.
* @return true if the stream is seekable.
*/
OPJ_BOOL opj_stream_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);
OPJ_BOOL opj_stream_seek(opj_stream_private_t * p_stream, OPJ_OFF_T p_size,
struct opj_event_mgr * p_event_mgr);
/**
* Tells if the given stream is seekable.
*/
OPJ_BOOL opj_stream_has_seek (const opj_stream_private_t * p_stream);
OPJ_BOOL opj_stream_has_seek(const opj_stream_private_t * p_stream);
/**
* FIXME DOC.
*/
OPJ_SIZE_T opj_stream_default_read (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data);
OPJ_SIZE_T opj_stream_default_read(void * p_buffer, OPJ_SIZE_T p_nb_bytes,
void * p_user_data);
/**
* FIXME DOC.
*/
OPJ_SIZE_T opj_stream_default_write (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data);
OPJ_SIZE_T opj_stream_default_write(void * p_buffer, OPJ_SIZE_T p_nb_bytes,
void * p_user_data);
/**
* FIXME DOC.
*/
OPJ_OFF_T opj_stream_default_skip (OPJ_OFF_T p_nb_bytes, void * p_user_data);
OPJ_OFF_T opj_stream_default_skip(OPJ_OFF_T p_nb_bytes, void * p_user_data);
/**
* FIXME DOC.
*/
OPJ_BOOL opj_stream_default_seek (OPJ_OFF_T p_nb_bytes, void * p_user_data);
OPJ_BOOL opj_stream_default_seek(OPJ_OFF_T p_nb_bytes, void * p_user_data);
/* ----------------------------------------------------------------------- */
/*@}*/

View File

@ -67,7 +67,8 @@ Apply a reversible inverse DWT transform to a component of an image.
@param tilec Tile component information (current tile)
@param numres Number of resolution levels to decode
*/
OPJ_BOOL opj_dwt_decode(opj_thread_pool_t* tp, opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres);
OPJ_BOOL opj_dwt_decode(opj_thread_pool_t* tp, opj_tcd_tilecomp_t* tilec,
OPJ_UINT32 numres);
/**
Get the gain of a subband for the reversible 5-3 DWT.
@ -94,7 +95,8 @@ Apply an irreversible inverse DWT transform to a component of an image.
@param tilec Tile component information (current tile)
@param numres Number of resolution levels to decode
*/
OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* OPJ_RESTRICT tilec, OPJ_UINT32 numres);
OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* OPJ_RESTRICT tilec,
OPJ_UINT32 numres);
/**
Get the gain of a subband for the irreversible 9-7 DWT.

View File

@ -47,8 +47,7 @@ used for
<li>Debugging messages
</ul>
*/
typedef struct opj_event_mgr
{
typedef struct opj_event_mgr {
/** Data to call the event manager upon */
void * m_error_data;
/** Data to call the event manager upon */
@ -87,7 +86,8 @@ typedef struct opj_event_mgr
*
* @return Returns true if successful, returns false otherwise
*/
OPJ_BOOL opj_event_msg(opj_event_mgr_t* event_mgr, OPJ_INT32 event_type, const char *fmt, ...);
OPJ_BOOL opj_event_msg(opj_event_mgr_t* event_mgr, OPJ_INT32 event_type,
const char *fmt, ...);
/* ----------------------------------------------------------------------- */
/**

View File

@ -54,8 +54,7 @@ typedef void (*opj_procedure)(void);
/**
* A list of procedures.
*/
typedef struct opj_procedure_list
{
typedef struct opj_procedure_list {
/**
* The number of validation procedures.
*/
@ -95,7 +94,8 @@ void opj_procedure_list_destroy(opj_procedure_list_t * p_list);
*
* @return OPJ_TRUE if the procedure could be added.
*/
OPJ_BOOL opj_procedure_list_add_procedure (opj_procedure_list_t * p_validation_list, opj_procedure p_procedure, opj_event_mgr_t* p_manager);
OPJ_BOOL opj_procedure_list_add_procedure(opj_procedure_list_t *
p_validation_list, opj_procedure p_procedure, opj_event_mgr_t* p_manager);
/**
* Gets the number of validation procedures.
@ -104,7 +104,8 @@ OPJ_BOOL opj_procedure_list_add_procedure (opj_procedure_list_t * p_validation_l
*
* @return the number of validation procedures.
*/
OPJ_UINT32 opj_procedure_list_get_nb_procedures (opj_procedure_list_t * p_validation_list);
OPJ_UINT32 opj_procedure_list_get_nb_procedures(opj_procedure_list_t *
p_validation_list);
/**
* Gets the pointer on the first validation procedure. This function is similar to the C++
@ -115,7 +116,8 @@ OPJ_UINT32 opj_procedure_list_get_nb_procedures (opj_procedure_list_t * p_valida
*
* @return a pointer to the first procedure.
*/
opj_procedure* opj_procedure_list_get_first_procedure (opj_procedure_list_t * p_validation_list);
opj_procedure* opj_procedure_list_get_first_procedure(opj_procedure_list_t *
p_validation_list);
/**
@ -124,7 +126,7 @@ opj_procedure* opj_procedure_list_get_first_procedure (opj_procedure_list_t * p_
* @param p_validation_list the list of procedure to clear.
*
*/
void opj_procedure_list_clear (opj_procedure_list_t * p_validation_list);
void opj_procedure_list_clear(opj_procedure_list_t * p_validation_list);
/*@}*/
#endif /* __FUNCTION_LIST_H */

View File

@ -58,9 +58,11 @@ opj_image_t* opj_image_create0(void);
* @param p_image_header the image header to update.
* @param p_cp the coding parameters from which to update the image.
*/
void opj_image_comp_header_update(opj_image_t * p_image, const struct opj_cp* p_cp);
void opj_image_comp_header_update(opj_image_t * p_image,
const struct opj_cp* p_cp);
void opj_copy_image_header(const opj_image_t* p_image_src, opj_image_t* p_image_dest);
void opj_copy_image_header(const opj_image_t* p_image_src,
opj_image_t* p_image_dest);
/*@}*/

View File

@ -65,8 +65,9 @@
* @param[in] cio file output handle
* @return length of tpix box
*/
int opj_write_tpix( int coff, opj_codestream_info_t cstr_info, int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager );
int opj_write_tpix(int coff, opj_codestream_info_t cstr_info, int j2klen,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
/*
@ -77,7 +78,8 @@ int opj_write_tpix( int coff, opj_codestream_info_t cstr_info, int j2klen, opj_s
* @param[in] cio file output handle
* @return length of thix box
*/
int opj_write_thix( int coff, opj_codestream_info_t cstr_info, opj_stream_private_t *cio, opj_event_mgr_t * p_manager );
int opj_write_thix(int coff, opj_codestream_info_t cstr_info,
opj_stream_private_t *cio, opj_event_mgr_t * p_manager);
/*
@ -90,8 +92,9 @@ int opj_write_thix( int coff, opj_codestream_info_t cstr_info, opj_stream_privat
* @param[in] cio file output handle
* @return length of ppix box
*/
int opj_write_ppix( int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager );
int opj_write_ppix(int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused,
int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
/*
@ -104,8 +107,9 @@ int opj_write_ppix( int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused,
* @param[in] cio file output handle
* @return length of ppix box
*/
int opj_write_phix( int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager );
int opj_write_phix(int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused,
int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
/*
* Write manifest box (box)
@ -120,7 +124,7 @@ void opj_write_manf(int second,
int v,
opj_jp2_box_t *box,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager );
opj_event_mgr_t * p_manager);
/*
* Write main header index table (box)
@ -130,19 +134,24 @@ void opj_write_manf(int second,
* @param[in] cio file output handle
* @return length of mainmhix box
*/
int opj_write_mainmhix( int coff, opj_codestream_info_t cstr_info, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager );
int opj_write_mainmhix(int coff, opj_codestream_info_t cstr_info,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
int opj_write_phixfaix( int coff, int compno, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager );
int opj_write_phixfaix(int coff, int compno, opj_codestream_info_t cstr_info,
OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
int opj_write_ppixfaix( int coff, int compno, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager );
int opj_write_ppixfaix(int coff, int compno, opj_codestream_info_t cstr_info,
OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
int opj_write_tilemhix( int coff, opj_codestream_info_t cstr_info, int tileno, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager );
int opj_write_tilemhix(int coff, opj_codestream_info_t cstr_info, int tileno,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
int opj_write_tpixfaix( int coff, int compno, opj_codestream_info_t cstr_info, int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager );
int opj_write_tpixfaix(int coff, int compno, opj_codestream_info_t cstr_info,
int j2klen, opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
#endif /* !INDEXBOX_MANAGER_H_ */

View File

@ -132,8 +132,7 @@ typedef enum J2K_STATUS {
/**
* Type of elements storing in the MCT data
*/
typedef enum MCT_ELEMENT_TYPE
{
typedef enum MCT_ELEMENT_TYPE {
MCT_TYPE_INT16 = 0, /** MCT data is stored as signed shorts*/
MCT_TYPE_INT32 = 1, /** MCT data is stored as signed integers*/
MCT_TYPE_FLOAT = 2, /** MCT data is stored as floats*/
@ -143,8 +142,7 @@ typedef enum MCT_ELEMENT_TYPE
/**
* Type of MCT array
*/
typedef enum MCT_ARRAY_TYPE
{
typedef enum MCT_ARRAY_TYPE {
MCT_TYPE_DEPENDENCY = 0,
MCT_TYPE_DECORRELATION = 1,
MCT_TYPE_OFFSET = 2
@ -158,7 +156,7 @@ T2 encoding mode
typedef enum T2_MODE {
THRESH_CALC = 0, /** Function called in Rate allocation process*/
FINAL_PASS = 1 /** Function called in Tier 2 process*/
}J2K_T2_MODE;
} J2K_T2_MODE;
/**
* Quantization stepsize
@ -173,8 +171,7 @@ typedef struct opj_stepsize {
/**
Tile-component coding parameters
*/
typedef struct opj_tccp
{
typedef struct opj_tccp {
/** coding style */
OPJ_UINT32 csty;
/** number of resolutions */
@ -209,8 +206,7 @@ opj_tccp_t;
/**
* FIXME DOC
*/
typedef struct opj_mct_data
{
typedef struct opj_mct_data {
J2K_MCT_ELEMENT_TYPE m_element_type;
J2K_MCT_ARRAY_TYPE m_array_type;
OPJ_UINT32 m_index;
@ -222,8 +218,7 @@ opj_mct_data_t;
/**
* FIXME DOC
*/
typedef struct opj_simple_mcc_decorrelation_data
{
typedef struct opj_simple_mcc_decorrelation_data {
OPJ_UINT32 m_index;
OPJ_UINT32 m_nb_comps;
opj_mct_data_t * m_decorrelation_array;
@ -232,8 +227,7 @@ typedef struct opj_simple_mcc_decorrelation_data
}
opj_simple_mcc_decorrelation_data_t;
typedef struct opj_ppx_struct
{
typedef struct opj_ppx_struct {
OPJ_BYTE* m_data; /* m_data == NULL => Zppx not read yet */
OPJ_UINT32 m_data_size;
} opj_ppx;
@ -243,8 +237,7 @@ Tile coding parameters :
this structure is used to store coding/decoding parameters common to all
tiles (information like COD, COC in main header)
*/
typedef struct opj_tcp
{
typedef struct opj_tcp {
/** coding style */
OPJ_UINT32 csty;
/** progression order */
@ -316,8 +309,7 @@ typedef struct opj_tcp
typedef struct opj_encoding_param
{
typedef struct opj_encoding_param {
/** 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,8 +329,7 @@ typedef struct opj_encoding_param
}
opj_encoding_param_t;
typedef struct opj_decoding_param
{
typedef struct opj_decoding_param {
/** if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, image is decoded to the full resolution */
OPJ_UINT32 m_reduce;
/** if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers are decoded */
@ -350,8 +341,7 @@ opj_decoding_param_t;
/**
* Coding parameters
*/
typedef struct opj_cp
{
typedef struct opj_cp {
/** Size of the image in bits*/
/*int img_size;*/
/** Rsiz*/
@ -399,15 +389,14 @@ typedef struct opj_cp
/** tile coding parameters */
opj_tcp_t *tcps;
union
{
union {
opj_decoding_param_t m_dec;
opj_encoding_param_t m_enc;
}
m_specific_param;
/* UniPG>> */
/* UniPG>> */
#ifdef USE_JPWL
/** enables writing of EPC in MH, thus activating JPWL */
OPJ_BOOL epc_on;
@ -456,12 +445,11 @@ typedef struct opj_cp
OPJ_BITFIELD ppm : 1;
/** tells if the parameter is a coding or decoding one */
OPJ_BITFIELD m_is_decoder : 1;
/* <<UniPG */
/* <<UniPG */
} opj_cp_t;
typedef struct opj_j2k_dec
{
typedef struct opj_j2k_dec {
/** locate in which part of the codestream the decoder is (main header, tile header, end) */
OPJ_UINT32 m_state;
/**
@ -506,8 +494,7 @@ typedef struct opj_j2k_dec
} opj_j2k_dec_t;
typedef struct opj_j2k_enc
{
typedef struct opj_j2k_enc {
/** Tile part number, regardless of poc, for each new poc, tp is reset to 1*/
OPJ_UINT32 m_current_poc_tile_part_number; /* tp_num */
@ -553,14 +540,12 @@ struct opj_tcd;
/**
JPEG-2000 codestream reader/writer
*/
typedef struct opj_j2k
{
typedef struct opj_j2k {
/* J2K codestream is decoded*/
OPJ_BOOL m_is_decoder;
/* FIXME DOC*/
union
{
union {
opj_j2k_dec_t m_decoder;
opj_j2k_enc_t m_encoder;
}
@ -623,7 +608,7 @@ OPJ_BOOL opj_j2k_set_threads(opj_j2k_t *j2k, OPJ_UINT32 num_threads);
opj_j2k_t* opj_j2k_create_compress(void);
OPJ_BOOL opj_j2k_setup_encoder( opj_j2k_t *p_j2k,
OPJ_BOOL opj_j2k_setup_encoder(opj_j2k_t *p_j2k,
opj_cparameters_t *parameters,
opj_image_t *image,
opj_event_mgr_t * p_manager);
@ -656,10 +641,10 @@ OPJ_BOOL opj_j2k_end_decompress(opj_j2k_t *j2k,
*
* @return true if the box is valid.
*/
OPJ_BOOL opj_j2k_read_header( opj_stream_private_t *p_stream,
OPJ_BOOL opj_j2k_read_header(opj_stream_private_t *p_stream,
opj_j2k_t* p_j2k,
opj_image_t** p_image,
opj_event_mgr_t* p_manager );
opj_event_mgr_t* p_manager);
/**
@ -667,14 +652,14 @@ OPJ_BOOL opj_j2k_read_header( opj_stream_private_t *p_stream,
*
* @param p_j2k the jpeg20000 structure to destroy.
*/
void opj_j2k_destroy (opj_j2k_t *p_j2k);
void opj_j2k_destroy(opj_j2k_t *p_j2k);
/**
* Destroys a codestream index structure.
*
* @param p_cstr_ind the codestream index parameter to destroy.
*/
void j2k_destroy_cstr_index (opj_codestream_index_t *p_cstr_ind);
void j2k_destroy_cstr_index(opj_codestream_index_t *p_cstr_ind);
/**
* Decode tile data.
@ -685,12 +670,12 @@ void j2k_destroy_cstr_index (opj_codestream_index_t *p_cstr_ind);
* @param p_stream the stream to write data to.
* @param p_manager the user event manager.
*/
OPJ_BOOL opj_j2k_decode_tile ( opj_j2k_t * p_j2k,
OPJ_BOOL opj_j2k_decode_tile(opj_j2k_t * p_j2k,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager );
opj_event_mgr_t * p_manager);
/**
* Reads a tile header.
@ -706,7 +691,7 @@ OPJ_BOOL opj_j2k_decode_tile ( opj_j2k_t * p_j2k,
* @param p_stream the stream to write data to.
* @param p_manager the user event manager.
*/
OPJ_BOOL opj_j2k_read_tile_header ( opj_j2k_t * p_j2k,
OPJ_BOOL opj_j2k_read_tile_header(opj_j2k_t * p_j2k,
OPJ_UINT32 * p_tile_index,
OPJ_UINT32 * p_data_size,
OPJ_INT32 * p_tile_x0,
@ -716,7 +701,7 @@ OPJ_BOOL opj_j2k_read_tile_header ( opj_j2k_t * p_j2k,
OPJ_UINT32 * p_nb_comps,
OPJ_BOOL * p_go_on,
opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager );
opj_event_mgr_t * p_manager);
/**
@ -732,11 +717,11 @@ OPJ_BOOL opj_j2k_read_tile_header ( opj_j2k_t * p_j2k,
*
* @return true if the area could be set.
*/
OPJ_BOOL opj_j2k_set_decode_area( opj_j2k_t *p_j2k,
OPJ_BOOL opj_j2k_set_decode_area(opj_j2k_t *p_j2k,
opj_image_t* p_image,
OPJ_INT32 p_start_x, OPJ_INT32 p_start_y,
OPJ_INT32 p_end_x, OPJ_INT32 p_end_y,
opj_event_mgr_t * p_manager );
opj_event_mgr_t * p_manager);
/**
* Creates a J2K decompression structure.
@ -754,7 +739,7 @@ opj_j2k_t* opj_j2k_create_decompress(void);
*@param out_stream output stream where dump the elements.
*
*/
void j2k_dump (opj_j2k_t* p_j2k, OPJ_INT32 flag, FILE* out_stream);
void j2k_dump(opj_j2k_t* p_j2k, OPJ_INT32 flag, FILE* out_stream);
@ -765,7 +750,8 @@ void j2k_dump (opj_j2k_t* p_j2k, OPJ_INT32 flag, FILE* out_stream);
*@param dev_dump_flag flag to describe if we are in the case of this function is use outside j2k_dump function
*@param out_stream output stream where dump the elements.
*/
void j2k_dump_image_header(opj_image_t* image, OPJ_BOOL dev_dump_flag, FILE* out_stream);
void j2k_dump_image_header(opj_image_t* image, OPJ_BOOL dev_dump_flag,
FILE* out_stream);
/**
* Dump a component image header structure.
@ -774,7 +760,8 @@ void j2k_dump_image_header(opj_image_t* image, OPJ_BOOL dev_dump_flag, FILE* out
*@param dev_dump_flag flag to describe if we are in the case of this function is use outside j2k_dump function
*@param out_stream output stream where dump the elements.
*/
void j2k_dump_image_comp_header(opj_image_comp_t* comp, OPJ_BOOL dev_dump_flag, FILE* out_stream);
void j2k_dump_image_comp_header(opj_image_comp_t* comp, OPJ_BOOL dev_dump_flag,
FILE* out_stream);
/**
* Get the codestream info from a JPEG2000 codec.
@ -808,11 +795,11 @@ OPJ_BOOL opj_j2k_decode(opj_j2k_t *j2k,
opj_event_mgr_t *p_manager);
OPJ_BOOL opj_j2k_get_tile( opj_j2k_t *p_j2k,
OPJ_BOOL opj_j2k_get_tile(opj_j2k_t *p_j2k,
opj_stream_private_t *p_stream,
opj_image_t* p_image,
opj_event_mgr_t * p_manager,
OPJ_UINT32 tile_index );
OPJ_UINT32 tile_index);
OPJ_BOOL opj_j2k_set_decoded_resolution_factor(opj_j2k_t *p_j2k,
OPJ_UINT32 res_factor,
@ -828,19 +815,19 @@ OPJ_BOOL opj_j2k_set_decoded_resolution_factor(opj_j2k_t *p_j2k,
* @param p_stream the stream to write data to.
* @param p_manager the user event manager.
*/
OPJ_BOOL opj_j2k_write_tile ( opj_j2k_t * p_j2k,
OPJ_BOOL opj_j2k_write_tile(opj_j2k_t * p_j2k,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager );
opj_event_mgr_t * p_manager);
/**
* Encodes an image into a JPEG-2000 codestream
*/
OPJ_BOOL opj_j2k_encode( opj_j2k_t * p_j2k,
OPJ_BOOL opj_j2k_encode(opj_j2k_t * p_j2k,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager );
opj_event_mgr_t * p_manager);
/**
* Starts a compression scheme, i.e. validates the codec parameters, writes the header.
@ -861,11 +848,11 @@ OPJ_BOOL opj_j2k_start_compress(opj_j2k_t *p_j2k,
* Ends the compression procedures and possibiliy add data to be read after the
* codestream.
*/
OPJ_BOOL opj_j2k_end_compress( opj_j2k_t *p_j2k,
OPJ_BOOL opj_j2k_end_compress(opj_j2k_t *p_j2k,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
OPJ_BOOL opj_j2k_setup_mct_encoding (opj_tcp_t * p_tcp, opj_image_t * p_image);
OPJ_BOOL opj_j2k_setup_mct_encoding(opj_tcp_t * p_tcp, opj_image_t * p_image);
#endif /* __J2K_H */

View File

@ -70,8 +70,7 @@
/* ----------------------------------------------------------------------- */
typedef enum
{
typedef enum {
JP2_STATE_NONE = 0x0,
JP2_STATE_SIGNATURE = 0x1,
JP2_STATE_FILE_TYPE = 0x2,
@ -82,8 +81,7 @@ typedef enum
}
JP2_STATE;
typedef enum
{
typedef enum {
JP2_IMG_STATE_NONE = 0x0,
JP2_IMG_STATE_UNKNOWN = 0x7fffffff
}
@ -92,16 +90,14 @@ JP2_IMG_STATE;
/**
Channel description: channel index, type, association
*/
typedef struct opj_jp2_cdef_info
{
typedef struct opj_jp2_cdef_info {
OPJ_UINT16 cn, typ, asoc;
} opj_jp2_cdef_info_t;
/**
Channel descriptions and number of descriptions
*/
typedef struct opj_jp2_cdef
{
typedef struct opj_jp2_cdef {
opj_jp2_cdef_info_t *info;
OPJ_UINT16 n;
} opj_jp2_cdef_t;
@ -109,8 +105,7 @@ typedef struct opj_jp2_cdef
/**
Component mappings: channel index, mapping type, palette index
*/
typedef struct opj_jp2_cmap_comp
{
typedef struct opj_jp2_cmap_comp {
OPJ_UINT16 cmp;
OPJ_BYTE mtyp, pcol;
} opj_jp2_cmap_comp_t;
@ -118,8 +113,7 @@ typedef struct opj_jp2_cmap_comp
/**
Palette data: table entries, palette columns
*/
typedef struct opj_jp2_pclr
{
typedef struct opj_jp2_pclr {
OPJ_UINT32 *entries;
OPJ_BYTE *channel_sign;
OPJ_BYTE *channel_size;
@ -131,8 +125,7 @@ typedef struct opj_jp2_pclr
/**
Collector for ICC profile, palette, component mapping, channel description
*/
typedef struct opj_jp2_color
{
typedef struct opj_jp2_color {
OPJ_BYTE *icc_profile_buf;
OPJ_UINT32 icc_profile_len;
@ -153,8 +146,7 @@ typedef struct opj_jp2_comps {
/**
JPEG-2000 file format reader/writer
*/
typedef struct opj_jp2
{
typedef struct opj_jp2 {
/** handle to the J2K codec */
opj_j2k_t *j2k;
/** list of validation procedures */
@ -207,12 +199,11 @@ typedef struct opj_jp2_box {
OPJ_INT32 init_pos;
} opj_jp2_box_t;
typedef struct opj_jp2_header_handler
{
typedef struct opj_jp2_header_handler {
/* marker value */
OPJ_UINT32 id;
/* action linked to the marker */
OPJ_BOOL (*handler) ( opj_jp2_t *jp2,
OPJ_BOOL(*handler)(opj_jp2_t *jp2,
OPJ_BYTE *p_header_data,
OPJ_UINT32 p_header_size,
opj_event_mgr_t * p_manager);
@ -220,10 +211,9 @@ typedef struct opj_jp2_header_handler
opj_jp2_header_handler_t;
typedef struct opj_jp2_img_header_writer_handler
{
typedef struct opj_jp2_img_header_writer_handler {
/* action to perform */
OPJ_BYTE* (*handler) (opj_jp2_t *jp2, OPJ_UINT32 * p_data_size);
OPJ_BYTE* (*handler)(opj_jp2_t *jp2, OPJ_UINT32 * p_data_size);
/* result of the action : data */
OPJ_BYTE* m_data;
/* size of data */
@ -269,7 +259,7 @@ OPJ_BOOL opj_jp2_decode(opj_jp2_t *jp2,
* @param p_manager FIXME DOC
* @return OPJ_TRUE if successful, OPJ_FALSE otherwise
*/
OPJ_BOOL opj_jp2_setup_encoder( opj_jp2_t *jp2,
OPJ_BOOL opj_jp2_setup_encoder(opj_jp2_t *jp2,
opj_cparameters_t *parameters,
opj_image_t *image,
opj_event_mgr_t * p_manager);
@ -281,7 +271,7 @@ Encode an image into a JPEG-2000 file stream
@param p_manager event manager
@return Returns true if successful, returns false otherwise
*/
OPJ_BOOL opj_jp2_encode( opj_jp2_t *jp2,
OPJ_BOOL opj_jp2_encode(opj_jp2_t *jp2,
opj_stream_private_t *stream,
opj_event_mgr_t * p_manager);
@ -306,7 +296,7 @@ OPJ_BOOL opj_jp2_start_compress(opj_jp2_t *jp2,
* Ends the compression procedures and possibiliy add data to be read after the
* codestream.
*/
OPJ_BOOL opj_jp2_end_compress( opj_jp2_t *jp2,
OPJ_BOOL opj_jp2_end_compress(opj_jp2_t *jp2,
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager);
@ -330,10 +320,10 @@ OPJ_BOOL opj_jp2_end_decompress(opj_jp2_t *jp2,
*
* @return true if the box is valid.
*/
OPJ_BOOL opj_jp2_read_header( opj_stream_private_t *p_stream,
OPJ_BOOL opj_jp2_read_header(opj_stream_private_t *p_stream,
opj_jp2_t *jp2,
opj_image_t ** p_image,
opj_event_mgr_t * p_manager );
opj_event_mgr_t * p_manager);
/**
* Reads a tile header.
@ -349,7 +339,7 @@ OPJ_BOOL opj_jp2_read_header( opj_stream_private_t *p_stream,
* @param p_stream the stream to write data to.
* @param p_manager the user event manager.
*/
OPJ_BOOL opj_jp2_read_tile_header ( opj_jp2_t * p_jp2,
OPJ_BOOL opj_jp2_read_tile_header(opj_jp2_t * p_jp2,
OPJ_UINT32 * p_tile_index,
OPJ_UINT32 * p_data_size,
OPJ_INT32 * p_tile_x0,
@ -359,7 +349,7 @@ OPJ_BOOL opj_jp2_read_tile_header ( opj_jp2_t * p_jp2,
OPJ_UINT32 * p_nb_comps,
OPJ_BOOL * p_go_on,
opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager );
opj_event_mgr_t * p_manager);
/**
* Writes a tile.
@ -371,12 +361,12 @@ OPJ_BOOL opj_jp2_read_tile_header ( opj_jp2_t * p_jp2,
* @param p_stream the stream to write data to.
* @param p_manager the user event manager.
*/
OPJ_BOOL opj_jp2_write_tile ( opj_jp2_t *p_jp2,
OPJ_BOOL opj_jp2_write_tile(opj_jp2_t *p_jp2,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager );
opj_event_mgr_t * p_manager);
/**
* Decode tile data.
@ -389,19 +379,19 @@ OPJ_BOOL opj_jp2_write_tile ( opj_jp2_t *p_jp2,
*
* @return FIXME DOC
*/
OPJ_BOOL opj_jp2_decode_tile ( opj_jp2_t * p_jp2,
OPJ_BOOL opj_jp2_decode_tile(opj_jp2_t * p_jp2,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager );
opj_event_mgr_t * p_manager);
/**
* Creates a jpeg2000 file decompressor.
*
* @return an empty jpeg2000 file codec.
*/
opj_jp2_t* opj_jp2_create (OPJ_BOOL p_is_decoder);
opj_jp2_t* opj_jp2_create(OPJ_BOOL p_is_decoder);
/**
Destroy a JP2 decompressor handle
@ -423,20 +413,20 @@ void opj_jp2_destroy(opj_jp2_t *jp2);
*
* @return true if the area could be set.
*/
OPJ_BOOL opj_jp2_set_decode_area( opj_jp2_t *p_jp2,
OPJ_BOOL opj_jp2_set_decode_area(opj_jp2_t *p_jp2,
opj_image_t* p_image,
OPJ_INT32 p_start_x, OPJ_INT32 p_start_y,
OPJ_INT32 p_end_x, OPJ_INT32 p_end_y,
opj_event_mgr_t * p_manager );
opj_event_mgr_t * p_manager);
/**
*
*/
OPJ_BOOL opj_jp2_get_tile( opj_jp2_t *p_jp2,
/**
*
*/
OPJ_BOOL opj_jp2_get_tile(opj_jp2_t *p_jp2,
opj_stream_private_t *p_stream,
opj_image_t* p_image,
opj_event_mgr_t * p_manager,
OPJ_UINT32 tile_index );
OPJ_UINT32 tile_index);
/**
@ -456,7 +446,7 @@ OPJ_BOOL opj_jp2_set_decoded_resolution_factor(opj_jp2_t *p_jp2,
*@param out_stream output stream where dump the elements.
*
*/
void jp2_dump (opj_jp2_t* p_jp2, OPJ_INT32 flag, FILE* out_stream);
void jp2_dump(opj_jp2_t* p_jp2, OPJ_INT32 flag, FILE* out_stream);
/**
* Get the codestream info from a JPEG2000 codec.

View File

@ -60,7 +60,8 @@ Apply a reversible multi-component transform to an image
@param c2 Samples blue component
@param n Number of samples for each component
*/
void opj_mct_encode(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1, OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
void opj_mct_encode(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1,
OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
/**
Apply a reversible multi-component inverse transform to an image
@param c0 Samples for luminance component
@ -68,7 +69,8 @@ Apply a reversible multi-component inverse transform to an image
@param c2 Samples for blue chrominance component
@param n Number of samples for each component
*/
void opj_mct_decode(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1, OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
void opj_mct_decode(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1,
OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
/**
Get norm of the basis function used for the reversible multi-component transform
@param compno Number of the component (0->Y, 1->U, 2->V)
@ -83,7 +85,8 @@ Apply an irreversible multi-component transform to an image
@param c2 Samples blue component
@param n Number of samples for each component
*/
void opj_mct_encode_real(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1, OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
void opj_mct_encode_real(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1,
OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
/**
Apply an irreversible multi-component inverse transform to an image
@param c0 Samples for luminance component
@ -91,7 +94,8 @@ Apply an irreversible multi-component inverse transform to an image
@param c2 Samples for blue chrominance component
@param n Number of samples for each component
*/
void opj_mct_decode_real(OPJ_FLOAT32* OPJ_RESTRICT c0, OPJ_FLOAT32* OPJ_RESTRICT c1, OPJ_FLOAT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
void opj_mct_decode_real(OPJ_FLOAT32* OPJ_RESTRICT c0,
OPJ_FLOAT32* OPJ_RESTRICT c1, OPJ_FLOAT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
/**
Get norm of the basis function used for the irreversible multi-component transform
@param compno Number of the component (0->Y, 1->U, 2->V)
@ -136,17 +140,17 @@ FIXME DOC
@param pMatrix components
@return
*/
void opj_calculate_norms( OPJ_FLOAT64 * pNorms,
void opj_calculate_norms(OPJ_FLOAT64 * pNorms,
OPJ_UINT32 p_nb_comps,
OPJ_FLOAT32 * pMatrix);
/**
FIXME DOC
*/
const OPJ_FLOAT64 * opj_mct_get_mct_norms (void);
const OPJ_FLOAT64 * opj_mct_get_mct_norms(void);
/**
FIXME DOC
*/
const OPJ_FLOAT64 * opj_mct_get_mct_norms_real (void);
const OPJ_FLOAT64 * opj_mct_get_mct_norms_real(void);
/* ----------------------------------------------------------------------- */
/*@}*/

View File

@ -117,7 +117,8 @@ Set the state of a particular context
@param msb The MSB of the new state of the context
@param prob Number that identifies the probability of the symbols for the new state of the context
*/
void opj_mqc_setstate(opj_mqc_t *mqc, OPJ_UINT32 ctxno, OPJ_UINT32 msb, OPJ_INT32 prob);
void opj_mqc_setstate(opj_mqc_t *mqc, OPJ_UINT32 ctxno, OPJ_UINT32 msb,
OPJ_INT32 prob);
/**
Initialize the encoder
@param mqc MQC handle

View File

@ -43,7 +43,8 @@ FIXME DOC
@param mqc MQC handle
@return
*/
static INLINE OPJ_INT32 opj_mqc_mpsexchange(opj_mqc_t *const mqc) {
static INLINE OPJ_INT32 opj_mqc_mpsexchange(opj_mqc_t *const mqc)
{
OPJ_INT32 d;
if (mqc->a < (*mqc->curctx)->qeval) {
d = (OPJ_INT32)(1 - (*mqc->curctx)->mps);
@ -61,7 +62,8 @@ FIXME DOC
@param mqc MQC handle
@return
*/
static INLINE OPJ_INT32 opj_mqc_lpsexchange(opj_mqc_t *const mqc) {
static INLINE OPJ_INT32 opj_mqc_lpsexchange(opj_mqc_t *const mqc)
{
OPJ_INT32 d;
if (mqc->a < (*mqc->curctx)->qeval) {
mqc->a = (*mqc->curctx)->qeval;
@ -81,14 +83,16 @@ Input a byte
@param mqc MQC handle
*/
#ifdef MQC_PERF_OPT
static INLINE void opj_mqc_bytein(opj_mqc_t *const mqc) {
static INLINE void opj_mqc_bytein(opj_mqc_t *const mqc)
{
unsigned int i = *((unsigned int *) mqc->bp);
mqc->c += i & 0xffff00;
mqc->ct = i & 0x0f;
mqc->bp += (i >> 2) & 0x04;
}
#else
static INLINE void opj_mqc_bytein(opj_mqc_t *const mqc) {
static INLINE void opj_mqc_bytein(opj_mqc_t *const mqc)
{
if (mqc->bp != mqc->end) {
OPJ_UINT32 c;
if (mqc->bp + 1 != mqc->end) {
@ -121,7 +125,8 @@ static INLINE void opj_mqc_bytein(opj_mqc_t *const mqc) {
Renormalize mqc->a and mqc->c while decoding
@param mqc MQC handle
*/
static INLINE void opj_mqc_renormd(opj_mqc_t *const mqc) {
static INLINE void opj_mqc_renormd(opj_mqc_t *const mqc)
{
do {
if (mqc->ct == 0) {
opj_mqc_bytein(mqc);
@ -137,7 +142,8 @@ Decode a symbol
@param mqc MQC handle
@return Returns the decoded symbol (0 or 1)
*/
static INLINE OPJ_INT32 opj_mqc_decode(opj_mqc_t *const mqc) {
static INLINE OPJ_INT32 opj_mqc_decode(opj_mqc_t *const mqc)
{
OPJ_INT32 d;
mqc->a -= (*mqc->curctx)->qeval;
if ((mqc->c >> 16) < (*mqc->curctx)->qeval) {

View File

@ -1,44 +1,44 @@
/*
* 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
* 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>
* Copyright (c) 2010-2011, Kaori Hagihara
* Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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
* 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>
* Copyright (c) 2010-2011, Kaori Hagihara
* Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France
* Copyright (c) 2012, CS Systemes d'Information, France
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef OPENJPEG_H
#define OPENJPEG_H
@ -54,26 +54,26 @@ The inline keyword is supported by C99 but not by C90.
Most compilers implement their own version of this keyword ...
*/
#ifndef INLINE
#if defined(_MSC_VER)
#define INLINE __forceinline
#elif defined(__GNUC__)
#define INLINE __inline__
#elif defined(__MWERKS__)
#define INLINE inline
#else
/* add other compilers here ... */
#define INLINE
#endif /* defined(<Compiler>) */
#if defined(_MSC_VER)
#define INLINE __forceinline
#elif defined(__GNUC__)
#define INLINE __inline__
#elif defined(__MWERKS__)
#define INLINE inline
#else
/* add other compilers here ... */
#define INLINE
#endif /* defined(<Compiler>) */
#endif /* INLINE */
/* deprecated attribute */
#ifdef __GNUC__
#define OPJ_DEPRECATED(func) func __attribute__ ((deprecated))
#define OPJ_DEPRECATED(func) func __attribute__ ((deprecated))
#elif defined(_MSC_VER)
#define OPJ_DEPRECATED(func) __declspec(deprecated) func
#define OPJ_DEPRECATED(func) __declspec(deprecated) func
#else
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
#define OPJ_DEPRECATED(func) func
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
#define OPJ_DEPRECATED(func) func
#endif
#if defined(OPJ_STATIC) || !defined(_WIN32)
@ -259,7 +259,7 @@ typedef enum CINEMA_MODE {
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;
} OPJ_CINEMA_MODE;
/**
* Progression order
@ -310,7 +310,7 @@ typedef enum CODEC_FORMAT {
* @param msg Event message
* @param client_data Client object where will be return the event message
* */
typedef void (*opj_msg_callback) (const char *msg, void *client_data);
typedef void (*opj_msg_callback)(const char *msg, void *client_data);
/*
==========================================================
@ -330,21 +330,21 @@ typedef struct opj_poc {
/** Layer num start,Precinct num start, Precinct num end */
OPJ_UINT32 layno0, precno0, precno1;
/** Progression order enum*/
OPJ_PROG_ORDER prg1,prg;
OPJ_PROG_ORDER prg1, prg;
/** Progression order string*/
OPJ_CHAR progorder[5];
/** Tile number */
OPJ_UINT32 tile;
/** Start and end values for Tile width and height*/
OPJ_INT32 tx0,tx1,ty0,ty1;
OPJ_INT32 tx0, tx1, ty0, ty1;
/** Start value, initialised in pi_initialise_encode*/
OPJ_UINT32 layS, resS, compS, prcS;
/** End value, initialised in pi_initialise_encode */
OPJ_UINT32 layE, resE, compE, prcE;
/** Start and end values of Tile width and height, initialised in pi_initialise_encode*/
OPJ_UINT32 txS,txE,tyS,tyE,dx,dy;
OPJ_UINT32 txS, txE, tyS, tyE, dx, dy;
/** Temporary values for Tile parts, initialised in pi_create_encode */
OPJ_UINT32 lay_t, res_t, comp_t, prc_t,tx0_t,ty0_t;
OPJ_UINT32 lay_t, res_t, comp_t, prc_t, tx0_t, ty0_t;
} opj_poc_t;
/**
@ -430,7 +430,7 @@ typedef struct opj_cparameters {
int cod_format;
/*@}*/
/* UniPG>> */ /* NOT YET USED IN THE V2 VERSION OF OPENJPEG */
/* UniPG>> */ /* NOT YET USED IN THE V2 VERSION OF OPENJPEG */
/**@name JPWL encoding parameters */
/*@{*/
/** enables writing of EPC in MH, thus activating JPWL */
@ -460,7 +460,7 @@ typedef struct opj_cparameters {
/** sensitivity methods for TPHs (-1=no,0-7) */
int jpwl_sens_TPH[JPWL_MAX_NO_TILESPECS];
/*@}*/
/* <<UniPG */
/* <<UniPG */
/**
* DEPRECATED: use RSIZ, OPJ_PROFILE_* and MAX_COMP_SIZE instead
@ -551,7 +551,7 @@ typedef struct opj_dparameters {
/*@}*/
/* UniPG>> */ /* NOT YET USED IN THE V2 VERSION OF OPENJPEG */
/* UniPG>> */ /* NOT YET USED IN THE V2 VERSION OF OPENJPEG */
/**@name JPWL decoding parameters */
/*@{*/
/** activates the JPWL correction capabilities */
@ -561,7 +561,7 @@ typedef struct opj_dparameters {
/** maximum number of tiles */
int jpwl_max_tiles;
/*@}*/
/* <<UniPG */
/* <<UniPG */
unsigned int flags;
@ -590,27 +590,31 @@ typedef void * opj_codec_t;
/*
* Callback function prototype for read function
*/
typedef OPJ_SIZE_T (* opj_stream_read_fn) (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data) ;
typedef OPJ_SIZE_T(* opj_stream_read_fn)(void * p_buffer, OPJ_SIZE_T p_nb_bytes,
void * p_user_data) ;
/*
* Callback function prototype for write function
*/
typedef OPJ_SIZE_T (* opj_stream_write_fn) (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data) ;
typedef OPJ_SIZE_T(* opj_stream_write_fn)(void * p_buffer,
OPJ_SIZE_T p_nb_bytes, void * p_user_data) ;
/*
* Callback function prototype for skip function
*/
typedef OPJ_OFF_T (* opj_stream_skip_fn) (OPJ_OFF_T p_nb_bytes, void * p_user_data) ;
typedef OPJ_OFF_T(* opj_stream_skip_fn)(OPJ_OFF_T p_nb_bytes,
void * p_user_data) ;
/*
* Callback function prototype for seek function
*/
typedef OPJ_BOOL (* opj_stream_seek_fn) (OPJ_OFF_T p_nb_bytes, void * p_user_data) ;
typedef OPJ_BOOL(* opj_stream_seek_fn)(OPJ_OFF_T p_nb_bytes,
void * p_user_data) ;
/*
* Callback function prototype for free user data function
*/
typedef void (* opj_stream_free_user_data_fn) (void * p_user_data) ;
typedef void (* opj_stream_free_user_data_fn)(void * p_user_data) ;
/*
* JPEG2000 Stream.
@ -831,14 +835,14 @@ typedef struct opj_codestream_info {
int numlayers;
/** number of decomposition for each component */
int *numdecompos;
/* UniPG>> */
/* UniPG>> */
/** number of markers */
int marknum;
/** list of markers */
opj_marker_info_t *marker;
/** actual size of markers array */
int maxmarknum;
/* <<UniPG */
/* <<UniPG */
/** main header position */
int main_head_start;
/** main header position */
@ -855,8 +859,7 @@ typedef struct opj_codestream_info {
/**
* Tile-component coding parameters information
*/
typedef struct opj_tccp_info
{
typedef struct opj_tccp_info {
/** component index */
OPJ_UINT32 compno;
/** coding style */
@ -996,21 +999,21 @@ typedef struct opj_codestream_index {
/** codestream's size */
OPJ_UINT64 codestream_size;
/* UniPG>> */ /* NOT USED FOR THE MOMENT IN THE V2 VERSION */
/* UniPG>> */ /* NOT USED FOR THE MOMENT IN THE V2 VERSION */
/** number of markers */
OPJ_UINT32 marknum;
/** list of markers */
opj_marker_info_t *marker;
/** actual size of markers array */
OPJ_UINT32 maxmarknum;
/* <<UniPG */
/* <<UniPG */
/** */
OPJ_UINT32 nb_of_tiles;
/** */
opj_tile_index_t *tile_index; /* FIXME not used for the moment */
}opj_codestream_index_t;
} opj_codestream_index_t;
/* -----------------------------------------------------------> */
/*
@ -1068,7 +1071,8 @@ OPJ_API const char * OPJ_CALLCONV opj_version(void);
* @param clrspc image color space
* @return returns a new image structure if successful, returns NULL otherwise
* */
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts,
opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
/**
* Deallocate any resources associated with an image
@ -1086,7 +1090,8 @@ OPJ_API void OPJ_CALLCONV opj_image_destroy(opj_image_t *image);
*
* @return a new image structure if successful, NULL otherwise.
*/
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts,
opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
/*
==========================================================
@ -1101,7 +1106,8 @@ OPJ_API opj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts, opj
*
* @return a stream object.
*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_default_create(OPJ_BOOL p_is_input);
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_default_create(
OPJ_BOOL p_is_input);
/**
* Creates an abstract stream. This function does nothing except allocating memory and initializing the abstract stream.
@ -1111,7 +1117,8 @@ OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_default_create(OPJ_BOOL p_is_input
*
* @return a stream object.
*/
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_SIZE_T p_buffer_size, OPJ_BOOL p_is_input);
OPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_SIZE_T p_buffer_size,
OPJ_BOOL p_is_input);
/**
* Destroys a stream created by opj_create_stream. This function does NOT close the abstract stream. If needed the user must
@ -1126,28 +1133,32 @@ OPJ_API void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream);
* @param p_stream the stream to modify
* @param p_function the function to use a read function.
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_read_function(opj_stream_t* p_stream, opj_stream_read_fn p_function);
OPJ_API void OPJ_CALLCONV opj_stream_set_read_function(opj_stream_t* p_stream,
opj_stream_read_fn p_function);
/**
* Sets the given function to be used as a write function.
* @param p_stream the stream to modify
* @param p_function the function to use a write function.
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_write_function(opj_stream_t* p_stream, opj_stream_write_fn p_function);
OPJ_API void OPJ_CALLCONV opj_stream_set_write_function(opj_stream_t* p_stream,
opj_stream_write_fn p_function);
/**
* Sets the given function to be used as a skip function.
* @param p_stream the stream to modify
* @param p_function the function to use a skip function.
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream, opj_stream_skip_fn p_function);
OPJ_API void OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream,
opj_stream_skip_fn p_function);
/**
* Sets the given function to be used as a seek function, the stream is then seekable.
* @param p_stream the stream to modify
* @param p_function the function to use a skip function.
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_seek_function(opj_stream_t* p_stream, opj_stream_seek_fn p_function);
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.
@ -1155,7 +1166,8 @@ OPJ_API void OPJ_CALLCONV opj_stream_set_seek_function(opj_stream_t* p_stream, o
* @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 (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.
@ -1163,21 +1175,24 @@ OPJ_API void OPJ_CALLCONV opj_stream_set_user_data (opj_stream_t* p_stream, void
* @param p_stream the stream to modify
* @param data_length length of the user_data.
*/
OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length(opj_stream_t* p_stream, OPJ_UINT64 data_length);
OPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length(
opj_stream_t* p_stream, OPJ_UINT64 data_length);
/**
* Create a stream from a file identified with its filename with default parameters (helper function)
* @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 (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 (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);
@ -1226,7 +1241,8 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_error_handler(opj_codec_t * p_codec,
*
* @return Returns a handle to a decompressor if successful, returns NULL otherwise
* */
OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format);
OPJ_API opj_codec_t* OPJ_CALLCONV opj_create_decompress(
OPJ_CODEC_FORMAT format);
/**
* Destroy a decompressor handle
@ -1240,7 +1256,7 @@ OPJ_API void OPJ_CALLCONV opj_destroy_codec(opj_codec_t * p_codec);
* @param p_codec the JPEG2000 codec to read.
* @param p_stream the JPEG2000 stream.
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_decompress ( opj_codec_t *p_codec,
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_decompress(opj_codec_t *p_codec,
opj_stream_t *p_stream);
@ -1248,7 +1264,8 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_decompress ( opj_codec_t *p_codec,
* Set decoding parameters to default values
* @param parameters Decompression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(
opj_dparameters_t *parameters);
/**
* Setup the decoder with decompression parameters provided by the user and with the message handler
@ -1260,7 +1277,7 @@ OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *
* @return true if the decoder is correctly set
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_setup_decoder(opj_codec_t *p_codec,
opj_dparameters_t *parameters );
opj_dparameters_t *parameters);
/**
* Allocates worker threads for the compressor/decompressor.
@ -1290,7 +1307,7 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_codec_set_threads(opj_codec_t *p_codec,
*
* @return true if the main header of the codestream and the JP2 header is correctly read.
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_header ( opj_stream_t *p_stream,
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_header(opj_stream_t *p_stream,
opj_codec_t *p_codec,
opj_image_t **p_image);
@ -1306,10 +1323,10 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_header ( opj_stream_t *p_stream,
*
* @return true if the area could be set.
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decode_area( opj_codec_t *p_codec,
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decode_area(opj_codec_t *p_codec,
opj_image_t* p_image,
OPJ_INT32 p_start_x, OPJ_INT32 p_start_y,
OPJ_INT32 p_end_x, OPJ_INT32 p_end_y );
OPJ_INT32 p_end_x, OPJ_INT32 p_end_y);
/**
* Decode an image from a JPEG-2000 codestream
@ -1319,7 +1336,7 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decode_area( opj_codec_t *p_codec,
* @param p_image the decoded image
* @return true if success, otherwise false
* */
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode( opj_codec_t *p_decompressor,
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode(opj_codec_t *p_decompressor,
opj_stream_t *p_stream,
opj_image_t *p_image);
@ -1333,7 +1350,7 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode( opj_codec_t *p_decompressor,
*
* @return true if success, otherwise false
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_get_decoded_tile( opj_codec_t *p_codec,
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_get_decoded_tile(opj_codec_t *p_codec,
opj_stream_t *p_stream,
opj_image_t *p_image,
OPJ_UINT32 tile_index);
@ -1345,7 +1362,8 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_get_decoded_tile( opj_codec_t *p_codec,
*
* @return true if success, otherwise false
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor(opj_codec_t *p_codec, OPJ_UINT32 res_factor);
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor(
opj_codec_t *p_codec, OPJ_UINT32 res_factor);
/**
* Writes a tile with the given data.
@ -1359,11 +1377,11 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor(opj_codec_t *p_c
*
* @return true if the data could be written.
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_write_tile ( opj_codec_t *p_codec,
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_write_tile(opj_codec_t *p_codec,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
opj_stream_t *p_stream );
opj_stream_t *p_stream);
/**
* Reads a tile header. This function is compulsory and allows one to know the size of the tile that will be decoded.
@ -1386,14 +1404,14 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_write_tile ( opj_codec_t *p_codec,
* @return true if the tile header could be decoded. In case the decoding should end, the returned value is still true.
* returning false may be the result of a shortage of memory or an internal error.
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_tile_header( opj_codec_t *p_codec,
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_tile_header(opj_codec_t *p_codec,
opj_stream_t * p_stream,
OPJ_UINT32 * p_tile_index,
OPJ_UINT32 * p_data_size,
OPJ_INT32 * p_tile_x0, OPJ_INT32 * p_tile_y0,
OPJ_INT32 * p_tile_x1, OPJ_INT32 * p_tile_y1,
OPJ_UINT32 * p_nb_comps,
OPJ_BOOL * p_should_go_on );
OPJ_BOOL * p_should_go_on);
/**
* Reads a tile data. This function is compulsory and allows one to decode tile data. opj_read_tile_header should be called before.
@ -1407,11 +1425,11 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_tile_header( opj_codec_t *p_codec,
*
* @return true if the data could be decoded.
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode_tile_data( opj_codec_t *p_codec,
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode_tile_data(opj_codec_t *p_codec,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
opj_stream_t *p_stream );
opj_stream_t *p_stream);
/* COMPRESSION FUNCTIONS*/
@ -1443,7 +1461,8 @@ Set encoding parameters to default values, that means :
</ul>
@param parameters Compression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(
opj_cparameters_t *parameters);
/**
* Setup the encoder parameters using the current image and using user parameters.
@ -1461,7 +1480,7 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_setup_encoder(opj_codec_t *p_codec,
* @param image Input filled image
* @param p_stream Input stgream
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_start_compress ( opj_codec_t *p_codec,
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_start_compress(opj_codec_t *p_codec,
opj_image_t * p_image,
opj_stream_t *p_stream);
@ -1470,7 +1489,7 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_start_compress ( opj_codec_t *p_codec,
* @param p_codec Compressor handle
* @param p_stream Input stgream
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_compress (opj_codec_t *p_codec,
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_compress(opj_codec_t *p_codec,
opj_stream_t *p_stream);
/**
@ -1493,7 +1512,8 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV opj_encode(opj_codec_t *p_codec,
Destroy Codestream information after compression or decompression
@param cstr_info Codestream information structure
*/
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_v2_t **cstr_info);
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_v2_t
**cstr_info);
/**
@ -1504,7 +1524,7 @@ OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_v2_t **cstr_
* @param output_stream output stream where dump the informations get from the codec.
*
*/
OPJ_API void OPJ_CALLCONV opj_dump_codec( opj_codec_t *p_codec,
OPJ_API void OPJ_CALLCONV opj_dump_codec(opj_codec_t *p_codec,
OPJ_INT32 info_flag,
FILE* output_stream);
@ -1516,7 +1536,8 @@ OPJ_API void OPJ_CALLCONV opj_dump_codec( opj_codec_t *p_codec,
* @return a pointer to a codestream information structure.
*
*/
OPJ_API opj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info(opj_codec_t *p_codec);
OPJ_API opj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info(
opj_codec_t *p_codec);
/**
* Get the codestream index from the codec
@ -1526,9 +1547,11 @@ OPJ_API opj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info(opj_codec_t *p_
* @return a pointer to a codestream index structure.
*
*/
OPJ_API opj_codestream_index_t * OPJ_CALLCONV opj_get_cstr_index(opj_codec_t *p_codec);
OPJ_API opj_codestream_index_t * OPJ_CALLCONV opj_get_cstr_index(
opj_codec_t *p_codec);
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_index(opj_codestream_index_t **p_cstr_index);
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_index(opj_codestream_index_t
**p_cstr_index);
/**
@ -1539,7 +1562,8 @@ OPJ_API void OPJ_CALLCONV opj_destroy_cstr_index(opj_codestream_index_t **p_cstr
* @return a pointer to a JP2 metadata structure.
*
*/
OPJ_API opj_jp2_metadata_t* OPJ_CALLCONV opj_get_jp2_metadata(opj_codec_t *p_codec);
OPJ_API opj_jp2_metadata_t* OPJ_CALLCONV opj_get_jp2_metadata(
opj_codec_t *p_codec);
/**
* Get the JP2 file index from the codec FIXME
@ -1568,7 +1592,7 @@ OPJ_API opj_jp2_index_t* OPJ_CALLCONV opj_get_jp2_index(opj_codec_t *p_codec);
*
* @return true if the parameters could be set.
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_MCT( opj_cparameters_t *parameters,
OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_MCT(opj_cparameters_t *parameters,
OPJ_FLOAT32 * pEncodingMatrix,
OPJ_INT32 * p_dc_shift,
OPJ_UINT32 pNbComp);

View File

@ -39,30 +39,27 @@
/**
* Main codec handler used for compression or decompression.
*/
typedef struct opj_codec_private
{
typedef struct opj_codec_private {
/** FIXME DOC */
union
{
union {
/**
* Decompression handler.
*/
struct opj_decompression
{
struct opj_decompression {
/** Main header reading function handler */
OPJ_BOOL (*opj_read_header) ( struct opj_stream_private * cio,
OPJ_BOOL(*opj_read_header)(struct opj_stream_private * cio,
void * p_codec,
opj_image_t **p_image,
struct opj_event_mgr * p_manager);
/** Decoding function */
OPJ_BOOL (*opj_decode) ( void * p_codec,
OPJ_BOOL(*opj_decode)(void * p_codec,
struct opj_stream_private * p_cio,
opj_image_t * p_image,
struct opj_event_mgr * p_manager);
/** FIXME DOC */
OPJ_BOOL (*opj_read_tile_header)( void * p_codec,
OPJ_BOOL(*opj_read_tile_header)(void * p_codec,
OPJ_UINT32 * p_tile_index,
OPJ_UINT32 * p_data_size,
OPJ_INT32 * p_tile_x0,
@ -75,7 +72,7 @@ typedef struct opj_codec_private
struct opj_event_mgr * p_manager);
/** FIXME DOC */
OPJ_BOOL (*opj_decode_tile_data)( void * p_codec,
OPJ_BOOL(*opj_decode_tile_data)(void * p_codec,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
@ -83,18 +80,18 @@ typedef struct opj_codec_private
struct opj_event_mgr * p_manager);
/** Reading function used after codestream if necessary */
OPJ_BOOL (* opj_end_decompress) ( void *p_codec,
OPJ_BOOL(* opj_end_decompress)(void *p_codec,
struct opj_stream_private * cio,
struct opj_event_mgr * p_manager);
/** Codec destroy function handler */
void (*opj_destroy) (void * p_codec);
void (*opj_destroy)(void * p_codec);
/** Setup decoder function handler */
void (*opj_setup_decoder) ( void * p_codec, opj_dparameters_t * p_param);
void (*opj_setup_decoder)(void * p_codec, opj_dparameters_t * p_param);
/** Set decode area function handler */
OPJ_BOOL (*opj_set_decode_area) ( void * p_codec,
OPJ_BOOL(*opj_set_decode_area)(void * p_codec,
opj_image_t * p_image,
OPJ_INT32 p_start_x,
OPJ_INT32 p_end_x,
@ -103,14 +100,14 @@ typedef struct opj_codec_private
struct opj_event_mgr * p_manager);
/** Get tile function */
OPJ_BOOL (*opj_get_decoded_tile) ( void *p_codec,
OPJ_BOOL(*opj_get_decoded_tile)(void *p_codec,
opj_stream_private_t * p_cio,
opj_image_t *p_image,
struct opj_event_mgr * p_manager,
OPJ_UINT32 tile_index);
/** Set the decoded resolution factor */
OPJ_BOOL (*opj_set_decoded_resolution_factor) ( void * p_codec,
OPJ_BOOL(*opj_set_decoded_resolution_factor)(void * p_codec,
OPJ_UINT32 res_factor,
opj_event_mgr_t * p_manager);
@ -119,31 +116,30 @@ typedef struct opj_codec_private
/**
* Compression handler. FIXME DOC
*/
struct opj_compression
{
OPJ_BOOL (* opj_start_compress) ( void *p_codec,
struct opj_compression {
OPJ_BOOL(* opj_start_compress)(void *p_codec,
struct opj_stream_private * cio,
struct opj_image * p_image,
struct opj_event_mgr * p_manager);
OPJ_BOOL (* opj_encode) ( void * p_codec,
OPJ_BOOL(* opj_encode)(void * p_codec,
struct opj_stream_private *p_cio,
struct opj_event_mgr * p_manager);
OPJ_BOOL (* opj_write_tile) ( void * p_codec,
OPJ_BOOL(* opj_write_tile)(void * p_codec,
OPJ_UINT32 p_tile_index,
OPJ_BYTE * p_data,
OPJ_UINT32 p_data_size,
struct opj_stream_private * p_cio,
struct opj_event_mgr * p_manager);
OPJ_BOOL (* opj_end_compress) ( void * p_codec,
OPJ_BOOL(* opj_end_compress)(void * p_codec,
struct opj_stream_private * p_cio,
struct opj_event_mgr * p_manager);
void (* opj_destroy) (void * p_codec);
void (* opj_destroy)(void * p_codec);
OPJ_BOOL (* opj_setup_encoder) ( void * p_codec,
OPJ_BOOL(* opj_setup_encoder)(void * p_codec,
opj_cparameters_t * p_param,
struct opj_image * p_image,
struct opj_event_mgr * p_manager);
@ -155,12 +151,13 @@ typedef struct opj_codec_private
opj_event_mgr_t m_event_mgr;
/** Flag to indicate if the codec is used to decode or encode*/
OPJ_BOOL is_decompressor;
void (*opj_dump_codec) (void * p_codec, OPJ_INT32 info_flag, FILE* output_stream);
void (*opj_dump_codec)(void * p_codec, OPJ_INT32 info_flag,
FILE* output_stream);
opj_codestream_info_v2_t* (*opj_get_codec_info)(void* p_codec);
opj_codestream_index_t* (*opj_get_codec_index)(void* p_codec);
/** Set number of threads */
OPJ_BOOL (*opj_set_threads) ( void * p_codec, OPJ_UINT32 num_threads );
OPJ_BOOL(*opj_set_threads)(void * p_codec, OPJ_UINT32 num_threads);
}
opj_codec_private_t;

View File

@ -71,11 +71,11 @@
#if defined(WIN32) && !defined(Windows95) && !defined(__BORLANDC__) && \
!(defined(_MSC_VER) && _MSC_VER < 1400) && \
!(defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x800)
/*
/*
Windows '95 and Borland C do not support _lseeki64
Visual Studio does not support _fseeki64 and _ftelli64 until the 2005 release.
Without these interfaces, files over 2GB in size are not supported for Windows.
*/
*/
# define OPJ_FSEEK(stream,offset,whence) _fseeki64(stream,/* __int64 */ offset,whence)
# define OPJ_FSTAT(fildes,stat_buff) _fstati64(fildes,/* struct _stati64 */ stat_buff)
# define OPJ_FTELL(stream) /* __int64 */ _ftelli64(stream)
@ -105,11 +105,11 @@
/* Are restricted pointers available? (C99) */
#if (__STDC_VERSION__ >= 199901L)
#define OPJ_RESTRICT restrict
#define OPJ_RESTRICT restrict
#else
/* Not a C99 compiler */
#if defined(__GNUC__)
#define OPJ_RESTRICT __restrict__
/* Not a C99 compiler */
#if defined(__GNUC__)
#define OPJ_RESTRICT __restrict__
/*
vc14 (2015) outputs wrong results.
@ -117,25 +117,26 @@
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
#define OPJ_RESTRICT __restrict
*/
#else
#define OPJ_RESTRICT /* restrict */
#endif
#else
#define OPJ_RESTRICT /* restrict */
#endif
#endif
#ifdef __has_attribute
#if __has_attribute(no_sanitize)
#define OPJ_NOSANITIZE(kind) __attribute__((no_sanitize(kind)))
#endif
#if __has_attribute(no_sanitize)
#define OPJ_NOSANITIZE(kind) __attribute__((no_sanitize(kind)))
#endif
#endif
#ifndef OPJ_NOSANITIZE
#define OPJ_NOSANITIZE(kind)
#define OPJ_NOSANITIZE(kind)
#endif
/* MSVC before 2013 and Borland C do not have lrintf */
#if defined(_MSC_VER)
#include <intrin.h>
static INLINE long opj_lrintf(float f){
static INLINE long opj_lrintf(float f)
{
#ifdef _M_X64
return _mm_cvt_ss2si(_mm_load_ss(&f));
@ -154,9 +155,10 @@ static INLINE long opj_lrintf(float f){
#endif
}
#elif defined(__BORLANDC__)
static INLINE long opj_lrintf(float f) {
static INLINE long opj_lrintf(float f)
{
#ifdef _M_X64
return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f));
return (long)((f > 0.0f) ? (f + 0.5f) : (f - 0.5f));
#else
int i;
@ -169,13 +171,14 @@ static INLINE long opj_lrintf(float f) {
#endif
}
#else
static INLINE long opj_lrintf(float f) {
static INLINE long opj_lrintf(float f)
{
return lrintf(f);
}
#endif
#if defined(_MSC_VER) && (_MSC_VER < 1400)
#define vsnprintf _vsnprintf
#define vsnprintf _vsnprintf
#endif
/* MSVC x86 is really bad at doing int64 = int32 * int32 on its own. Use intrinsic. */

View File

@ -53,7 +53,8 @@ The functions in OPJ_INTMATH.H have for goal to realize operations on integers.
Get the minimum of two integers
@return Returns a if a < b else b
*/
static INLINE OPJ_INT32 opj_int_min(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_min(OPJ_INT32 a, OPJ_INT32 b)
{
return a < b ? a : b;
}
@ -61,7 +62,8 @@ static INLINE OPJ_INT32 opj_int_min(OPJ_INT32 a, OPJ_INT32 b) {
Get the minimum of two integers
@return Returns a if a < b else b
*/
static INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b) {
static INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b)
{
return a < b ? a : b;
}
@ -69,7 +71,8 @@ static INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b) {
Get the maximum of two integers
@return Returns a if a > b else b
*/
static INLINE OPJ_INT32 opj_int_max(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_max(OPJ_INT32 a, OPJ_INT32 b)
{
return (a > b) ? a : b;
}
@ -77,7 +80,8 @@ static INLINE OPJ_INT32 opj_int_max(OPJ_INT32 a, OPJ_INT32 b) {
Get the maximum of two integers
@return Returns a if a > b else b
*/
static INLINE OPJ_UINT32 opj_uint_max(OPJ_UINT32 a, OPJ_UINT32 b) {
static INLINE OPJ_UINT32 opj_uint_max(OPJ_UINT32 a, OPJ_UINT32 b)
{
return (a > b) ? a : b;
}
@ -85,7 +89,8 @@ static INLINE OPJ_UINT32 opj_uint_max(OPJ_UINT32 a, OPJ_UINT32 b) {
Get the saturated sum of two unsigned integers
@return Returns saturated sum of a+b
*/
static INLINE OPJ_UINT32 opj_uint_adds(OPJ_UINT32 a, OPJ_UINT32 b) {
static INLINE OPJ_UINT32 opj_uint_adds(OPJ_UINT32 a, OPJ_UINT32 b)
{
OPJ_UINT64 sum = (OPJ_UINT64)a + (OPJ_UINT64)b;
return (OPJ_UINT32)(-(OPJ_INT32)(sum >> 32)) | (OPJ_UINT32)sum;
}
@ -99,24 +104,30 @@ Clamp an integer inside an interval
<li>Returns min if (a < min)
</ul>
*/
static INLINE OPJ_INT32 opj_int_clamp(OPJ_INT32 a, OPJ_INT32 min, OPJ_INT32 max) {
if (a < min)
static INLINE OPJ_INT32 opj_int_clamp(OPJ_INT32 a, OPJ_INT32 min,
OPJ_INT32 max)
{
if (a < min) {
return min;
if (a > max)
}
if (a > max) {
return max;
}
return a;
}
/**
@return Get absolute value of integer
*/
static INLINE OPJ_INT32 opj_int_abs(OPJ_INT32 a) {
static INLINE OPJ_INT32 opj_int_abs(OPJ_INT32 a)
{
return a < 0 ? -a : a;
}
/**
Divide an integer and round upwards
@return Returns a divided by b
*/
static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b)
{
assert(b);
return (a + b - 1) / b;
}
@ -125,7 +136,8 @@ static INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b) {
Divide an integer and round upwards
@return Returns a divided by b
*/
static INLINE OPJ_UINT32 opj_uint_ceildiv(OPJ_UINT32 a, OPJ_UINT32 b) {
static INLINE OPJ_UINT32 opj_uint_ceildiv(OPJ_UINT32 a, OPJ_UINT32 b)
{
assert(b);
return (a + b - 1) / b;
}
@ -134,7 +146,8 @@ static INLINE OPJ_UINT32 opj_uint_ceildiv(OPJ_UINT32 a, OPJ_UINT32 b) {
Divide an integer by a power of 2 and round upwards
@return Returns a divided by 2^b
*/
static INLINE OPJ_INT32 opj_int_ceildivpow2(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_ceildivpow2(OPJ_INT32 a, OPJ_INT32 b)
{
return (OPJ_INT32)((a + ((OPJ_INT64)1 << b) - 1) >> b);
}
@ -142,7 +155,8 @@ static INLINE OPJ_INT32 opj_int_ceildivpow2(OPJ_INT32 a, OPJ_INT32 b) {
Divide a 64bits integer by a power of 2 and round upwards
@return Returns a divided by 2^b
*/
static INLINE OPJ_INT32 opj_int64_ceildivpow2(OPJ_INT64 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int64_ceildivpow2(OPJ_INT64 a, OPJ_INT32 b)
{
return (OPJ_INT32)((a + ((OPJ_INT64)1 << b) - 1) >> b);
}
@ -150,7 +164,8 @@ static INLINE OPJ_INT32 opj_int64_ceildivpow2(OPJ_INT64 a, OPJ_INT32 b) {
Divide an integer by a power of 2 and round upwards
@return Returns a divided by 2^b
*/
static INLINE OPJ_UINT32 opj_uint_ceildivpow2(OPJ_UINT32 a, OPJ_UINT32 b) {
static INLINE OPJ_UINT32 opj_uint_ceildivpow2(OPJ_UINT32 a, OPJ_UINT32 b)
{
return (OPJ_UINT32)((a + ((OPJ_UINT64)1U << b) - 1U) >> b);
}
@ -158,14 +173,16 @@ static INLINE OPJ_UINT32 opj_uint_ceildivpow2(OPJ_UINT32 a, OPJ_UINT32 b) {
Divide an integer by a power of 2 and round downwards
@return Returns a divided by 2^b
*/
static INLINE OPJ_INT32 opj_int_floordivpow2(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_floordivpow2(OPJ_INT32 a, OPJ_INT32 b)
{
return a >> b;
}
/**
Get logarithm of an integer and round downwards
@return Returns log2(a)
*/
static INLINE OPJ_INT32 opj_int_floorlog2(OPJ_INT32 a) {
static INLINE OPJ_INT32 opj_int_floorlog2(OPJ_INT32 a)
{
OPJ_INT32 l;
for (l = 0; a > 1; l++) {
a >>= 1;
@ -176,10 +193,10 @@ static INLINE OPJ_INT32 opj_int_floorlog2(OPJ_INT32 a) {
Get logarithm of an integer and round downwards
@return Returns log2(a)
*/
static INLINE OPJ_UINT32 opj_uint_floorlog2(OPJ_UINT32 a) {
static INLINE OPJ_UINT32 opj_uint_floorlog2(OPJ_UINT32 a)
{
OPJ_UINT32 l;
for (l = 0; a > 1; ++l)
{
for (l = 0; a > 1; ++l) {
a >>= 1;
}
return l;
@ -191,7 +208,8 @@ Multiply two fixed-precision rational numbers.
@param b
@return Returns a * b
*/
static INLINE OPJ_INT32 opj_int_fix_mul(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_fix_mul(OPJ_INT32 a, OPJ_INT32 b)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__INTEL_COMPILER) && defined(_M_IX86)
OPJ_INT64 temp = __emul(a, b);
#else
@ -200,10 +218,11 @@ static INLINE OPJ_INT32 opj_int_fix_mul(OPJ_INT32 a, OPJ_INT32 b) {
temp += 4096;
assert((temp >> 13) <= (OPJ_INT64)0x7FFFFFFF);
assert((temp >> 13) >= (-(OPJ_INT64)0x7FFFFFFF - (OPJ_INT64)1));
return (OPJ_INT32) (temp >> 13);
return (OPJ_INT32)(temp >> 13);
}
static INLINE OPJ_INT32 opj_int_fix_mul_t1(OPJ_INT32 a, OPJ_INT32 b) {
static INLINE OPJ_INT32 opj_int_fix_mul_t1(OPJ_INT32 a, OPJ_INT32 b)
{
#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__INTEL_COMPILER) && defined(_M_IX86)
OPJ_INT64 temp = __emul(a, b);
#else
@ -211,8 +230,9 @@ static INLINE OPJ_INT32 opj_int_fix_mul_t1(OPJ_INT32 a, OPJ_INT32 b) {
#endif
temp += 4096;
assert((temp >> (13 + 11 - T1_NMSEDEC_FRACBITS)) <= (OPJ_INT64)0x7FFFFFFF);
assert((temp >> (13 + 11 - T1_NMSEDEC_FRACBITS)) >= (-(OPJ_INT64)0x7FFFFFFF - (OPJ_INT64)1));
return (OPJ_INT32) (temp >> (13 + 11 - T1_NMSEDEC_FRACBITS)) ;
assert((temp >> (13 + 11 - T1_NMSEDEC_FRACBITS)) >= (-(OPJ_INT64)0x7FFFFFFF -
(OPJ_INT64)1));
return (OPJ_INT32)(temp >> (13 + 11 - T1_NMSEDEC_FRACBITS)) ;
}
/* ----------------------------------------------------------------------- */

View File

@ -132,9 +132,9 @@ opj_pi_iterator_t *opj_pi_initialise_encode(const opj_image_t *image,
* @param p_cp the coding parameters.
* @param p_tile_no index of the tile being encoded.
*/
void opj_pi_update_encoding_parameters( const opj_image_t *p_image,
void opj_pi_update_encoding_parameters(const opj_image_t *p_image,
opj_cp_t *p_cp,
OPJ_UINT32 p_tile_no );
OPJ_UINT32 p_tile_no);
/**
Modify the packet iterator for enabling tile part generation
@ -146,7 +146,7 @@ Modify the packet iterator for enabling tile part generation
@param tppos The position of the tile part flag in the progression order
@param t2_mode FIXME DOC
*/
void opj_pi_create_encode( opj_pi_iterator_t *pi,
void opj_pi_create_encode(opj_pi_iterator_t *pi,
opj_cp_t *cp,
OPJ_UINT32 tileno,
OPJ_UINT32 pino,

View File

@ -160,7 +160,7 @@ Encode the code-blocks of a tile
@param mct_norms FIXME DOC
@param mct_numcomps Number of components used for MCT
*/
OPJ_BOOL opj_t1_encode_cblks( opj_t1_t *t1,
OPJ_BOOL opj_t1_encode_cblks(opj_t1_t *t1,
opj_tcd_tile_t *tile,
opj_tcp_t *tcp,
const OPJ_FLOAT64 * mct_norms,
@ -172,7 +172,7 @@ Decode the code-blocks of a tile
@param tilec The tile to decode
@param tccp Tile coding parameters
*/
void opj_t1_decode_cblks( opj_thread_pool_t* tp,
void opj_t1_decode_cblks(opj_thread_pool_t* tp,
volatile OPJ_BOOL* pret,
opj_tcd_tilecomp_t* tilec,
opj_tccp_t* tccp);

View File

@ -77,7 +77,7 @@ Encode the packets of a tile to a destination buffer
@param pino FIXME DOC
@param t2_mode If == 0 In Threshold calculation ,If == 1 Final pass
*/
OPJ_BOOL opj_t2_encode_packets( opj_t2_t* t2,
OPJ_BOOL opj_t2_encode_packets(opj_t2_t* t2,
OPJ_UINT32 tileno,
opj_tcd_tile_t *tile,
OPJ_UINT32 maxlayers,
@ -102,7 +102,7 @@ Decode the packets of a tile from a source buffer
@return FIXME DOC
*/
OPJ_BOOL opj_t2_decode_packets( opj_t2_t *t2,
OPJ_BOOL opj_t2_decode_packets(opj_t2_t *t2,
OPJ_UINT32 tileno,
opj_tcd_tile_t *tile,
OPJ_BYTE *src,

View File

@ -90,11 +90,13 @@ typedef struct opj_tcd_cblk_enc {
OPJ_BYTE* data; /* Data */
opj_tcd_layer_t* layers; /* layer information */
opj_tcd_pass_t* passes; /* information about the passes */
OPJ_INT32 x0, y0, x1, y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_INT32 x0, y0, x1,
y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 numbps;
OPJ_UINT32 numlenbits;
OPJ_UINT32 data_size; /* Size of allocated data buffer */
OPJ_UINT32 numpasses; /* number of pass already done for the code-blocks */
OPJ_UINT32
numpasses; /* number of pass already done for the code-blocks */
OPJ_UINT32 numpassesinlayers; /* number of passes in the layer */
OPJ_UINT32 totalpasses; /* total number of passes */
} opj_tcd_cblk_enc_t;
@ -103,7 +105,8 @@ typedef struct opj_tcd_cblk_enc {
typedef struct opj_tcd_cblk_dec {
OPJ_BYTE * data; /* Data */
opj_tcd_seg_t* segs; /* segments information */
OPJ_INT32 x0, y0, x1, y1; /* position of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_INT32 x0, y0, x1,
y1; /* position of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 numbps;
OPJ_UINT32 numlenbits;
OPJ_UINT32 data_max_size; /* Size of allocated data buffer */
@ -118,9 +121,10 @@ typedef struct opj_tcd_cblk_dec {
FIXME DOC
*/
typedef struct opj_tcd_precinct {
OPJ_INT32 x0, y0, x1, y1; /* dimension of the precinct : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_INT32 x0, y0, x1,
y1; /* dimension of the precinct : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 cw, ch; /* number of precinct in width and height */
union{ /* code-blocks information */
union { /* code-blocks information */
opj_tcd_cblk_enc_t* enc;
opj_tcd_cblk_dec_t* dec;
void* blocks;
@ -134,7 +138,8 @@ typedef struct opj_tcd_precinct {
FIXME DOC
*/
typedef struct opj_tcd_band {
OPJ_INT32 x0, y0, x1, y1; /* dimension of the subband : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_INT32 x0, y0, x1,
y1; /* dimension of the subband : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 bandno;
opj_tcd_precinct_t *precincts; /* precinct information */
OPJ_UINT32 precincts_data_size; /* size of data taken by precincts */
@ -146,7 +151,8 @@ typedef struct opj_tcd_band {
FIXME DOC
*/
typedef struct opj_tcd_resolution {
OPJ_INT32 x0, y0, x1, y1; /* dimension of the resolution level : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_INT32 x0, y0, x1,
y1; /* dimension of the resolution level : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 pw, ph;
OPJ_UINT32 numbands; /* number sub-band for the resolution level */
opj_tcd_band_t bands[3]; /* subband information */
@ -155,16 +161,19 @@ typedef struct opj_tcd_resolution {
/**
FIXME DOC
*/
typedef struct opj_tcd_tilecomp
{
OPJ_INT32 x0, y0, x1, y1; /* dimension of component : left upper corner (x0, y0) right low corner (x1,y1) */
typedef struct opj_tcd_tilecomp {
OPJ_INT32 x0, y0, x1,
y1; /* dimension of component : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 numresolutions; /* number of resolutions level */
OPJ_UINT32 minimum_num_resolutions; /* number of resolutions level to decode (at max)*/
OPJ_UINT32
minimum_num_resolutions; /* number of resolutions level to decode (at max)*/
opj_tcd_resolution_t *resolutions; /* resolutions information */
OPJ_UINT32 resolutions_size; /* size of data for resolutions (in bytes) */
OPJ_UINT32
resolutions_size; /* size of data for resolutions (in bytes) */
OPJ_INT32 *data; /* data of the component */
OPJ_BOOL ownsData; /* if true, then need to free after usage, otherwise do not free */
OPJ_UINT32 data_size_needed; /* we may either need to allocate this amount of data, or re-use image data and ignore this value */
OPJ_UINT32
data_size_needed; /* we may either need to allocate this amount of data, or re-use image data and ignore this value */
OPJ_UINT32 data_size; /* size of the data of the component */
OPJ_INT32 numpix; /* add fixed_quality */
} opj_tcd_tilecomp_t;
@ -174,7 +183,8 @@ typedef struct opj_tcd_tilecomp
FIXME DOC
*/
typedef struct opj_tcd_tile {
OPJ_INT32 x0, y0, x1, y1; /* dimension of the tile : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_INT32 x0, y0, x1,
y1; /* dimension of the tile : left upper corner (x0, y0) right low corner (x1,y1) */
OPJ_UINT32 numcomps; /* number of components in tile */
opj_tcd_tilecomp_t *comps; /* Components information */
OPJ_INT32 numpix; /* add fixed_quality */
@ -186,8 +196,7 @@ typedef struct opj_tcd_tile {
/**
FIXME DOC
*/
typedef struct opj_tcd_image
{
typedef struct opj_tcd_image {
opj_tcd_tile_t *tiles; /* Tiles information */
}
opj_tcd_image_t;
@ -196,8 +205,7 @@ opj_tcd_image_t;
/**
Tile coder/decoder
*/
typedef struct opj_tcd
{
typedef struct opj_tcd {
/** Position of the tilepart flag in Progression order*/
OPJ_INT32 tp_pos;
/** Tile part number*/
@ -255,7 +263,7 @@ void opj_tcd_destroy(opj_tcd_t *tcd);
*
* @return true if the encoding values could be set (false otherwise).
*/
OPJ_BOOL opj_tcd_init( opj_tcd_t *p_tcd,
OPJ_BOOL opj_tcd_init(opj_tcd_t *p_tcd,
opj_image_t * p_image,
opj_cp_t * p_cp,
opj_thread_pool_t* p_tp);
@ -270,18 +278,20 @@ OPJ_BOOL opj_tcd_init( opj_tcd_t *p_tcd,
*
* @return true if the remaining data is sufficient.
*/
OPJ_BOOL opj_tcd_init_decode_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, opj_event_mgr_t* p_manager);
OPJ_BOOL opj_tcd_init_decode_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no,
opj_event_mgr_t* p_manager);
void opj_tcd_makelayer_fixed(opj_tcd_t *tcd, OPJ_UINT32 layno, OPJ_UINT32 final);
void opj_tcd_makelayer_fixed(opj_tcd_t *tcd, OPJ_UINT32 layno,
OPJ_UINT32 final);
void opj_tcd_rateallocate_fixed(opj_tcd_t *tcd);
void opj_tcd_makelayer( opj_tcd_t *tcd,
void opj_tcd_makelayer(opj_tcd_t *tcd,
OPJ_UINT32 layno,
OPJ_FLOAT64 thresh,
OPJ_UINT32 final);
OPJ_BOOL opj_tcd_rateallocate( opj_tcd_t *tcd,
OPJ_BOOL opj_tcd_rateallocate(opj_tcd_t *tcd,
OPJ_BYTE *dest,
OPJ_UINT32 * p_data_written,
OPJ_UINT32 len,
@ -290,7 +300,7 @@ OPJ_BOOL opj_tcd_rateallocate( opj_tcd_t *tcd,
/**
* Gets the maximum tile size that will be taken by the tile once decoded.
*/
OPJ_UINT32 opj_tcd_get_decoded_tile_size (opj_tcd_t *p_tcd );
OPJ_UINT32 opj_tcd_get_decoded_tile_size(opj_tcd_t *p_tcd);
/**
* Encodes a tile from the raw image into the given buffer.
@ -302,7 +312,7 @@ OPJ_UINT32 opj_tcd_get_decoded_tile_size (opj_tcd_t *p_tcd );
* @param p_cstr_info Codestream information structure
* @return true if the coding is successful.
*/
OPJ_BOOL opj_tcd_encode_tile( opj_tcd_t *p_tcd,
OPJ_BOOL opj_tcd_encode_tile(opj_tcd_t *p_tcd,
OPJ_UINT32 p_tile_no,
OPJ_BYTE *p_dest,
OPJ_UINT32 * p_data_written,
@ -319,7 +329,7 @@ Decode a tile from a buffer into a raw image
@param cstr_info FIXME DOC
@param manager the event manager.
*/
OPJ_BOOL opj_tcd_decode_tile( opj_tcd_t *tcd,
OPJ_BOOL opj_tcd_decode_tile(opj_tcd_t *tcd,
OPJ_BYTE *src,
OPJ_UINT32 len,
OPJ_UINT32 tileno,
@ -330,14 +340,14 @@ OPJ_BOOL opj_tcd_decode_tile( opj_tcd_t *tcd,
/**
* Copies tile data from the system onto the given memory block.
*/
OPJ_BOOL opj_tcd_update_tile_data ( opj_tcd_t *p_tcd,
OPJ_BOOL opj_tcd_update_tile_data(opj_tcd_t *p_tcd,
OPJ_BYTE * p_dest,
OPJ_UINT32 p_dest_length );
OPJ_UINT32 p_dest_length);
/**
*
*/
OPJ_UINT32 opj_tcd_get_encoded_tile_size ( opj_tcd_t *p_tcd );
OPJ_UINT32 opj_tcd_get_encoded_tile_size(opj_tcd_t *p_tcd);
/**
* Initialize the tile coder and may reuse some meory.
@ -348,15 +358,15 @@ OPJ_UINT32 opj_tcd_get_encoded_tile_size ( opj_tcd_t *p_tcd );
*
* @return true if the encoding values could be set (false otherwise).
*/
OPJ_BOOL opj_tcd_init_encode_tile ( opj_tcd_t *p_tcd,
OPJ_UINT32 p_tile_no, opj_event_mgr_t* p_manager );
OPJ_BOOL opj_tcd_init_encode_tile(opj_tcd_t *p_tcd,
OPJ_UINT32 p_tile_no, opj_event_mgr_t* p_manager);
/**
* Copies tile data from the given memory block onto the system.
*/
OPJ_BOOL opj_tcd_copy_tile_data (opj_tcd_t *p_tcd,
OPJ_BOOL opj_tcd_copy_tile_data(opj_tcd_t *p_tcd,
OPJ_BYTE * p_src,
OPJ_UINT32 p_src_length );
OPJ_UINT32 p_src_length);
/**
* Allocates tile component data

View File

@ -64,8 +64,7 @@ typedef struct opj_tgt_node {
/**
Tag tree
*/
typedef struct opj_tgt_tree
{
typedef struct opj_tgt_tree {
OPJ_UINT32 numleafsh;
OPJ_UINT32 numleafsv;
OPJ_UINT32 numnodes;
@ -83,7 +82,8 @@ Create a tag-tree
@param numleafsv Height of the array of leafs of the tree
@return Returns a new tag-tree if successful, returns NULL otherwise
*/
opj_tgt_tree_t *opj_tgt_create(OPJ_UINT32 numleafsh, OPJ_UINT32 numleafsv, opj_event_mgr_t *manager);
opj_tgt_tree_t *opj_tgt_create(OPJ_UINT32 numleafsh, OPJ_UINT32 numleafsv,
opj_event_mgr_t *manager);
/**
* Reinitialises a tag-tree from an exixting one.

View File

@ -151,13 +151,13 @@ typedef void (*opj_thread_fn)(void* user_data);
* @return a thread handle or NULL in case of failure (can for example happen if the library
* is built without thread support)
*/
opj_thread_t* opj_thread_create( opj_thread_fn thread_fn, void* user_data );
opj_thread_t* opj_thread_create(opj_thread_fn thread_fn, void* user_data);
/** Wait for a thread to be finished and release associated resources to the
* thread handle.
* @param thread the thread to wait for being finished.
*/
void opj_thread_join( opj_thread_t* thread );
void opj_thread_join(opj_thread_t* thread);
/*@}*/
@ -183,7 +183,8 @@ typedef void (*opj_tls_free_func)(void* value);
* @param free_func function to call currently installed value.
* @return OPJ_TRUE if successful.
*/
OPJ_BOOL opj_tls_set(opj_tls_t* tls, int key, void* value, opj_tls_free_func free_func);
OPJ_BOOL opj_tls_set(opj_tls_t* tls, int key, void* value,
opj_tls_free_func free_func);
/*@}*/
@ -221,7 +222,8 @@ typedef void (*opj_job_fn)(void* user_data, opj_tls_t* tls);
* @param user_data User data provided to thread_fn.
* @return OPJ_TRUE if the job was successfully submitted.
*/
OPJ_BOOL opj_thread_pool_submit_job(opj_thread_pool_t* tp, opj_job_fn job_fn, void* user_data);
OPJ_BOOL opj_thread_pool_submit_job(opj_thread_pool_t* tp, opj_job_fn job_fn,
void* user_data);
/** Wait that no more than max_remaining_jobs jobs are remaining in the queue of
* the thread pool. The aim of this function is to avoid submitting too many
@ -232,7 +234,8 @@ OPJ_BOOL opj_thread_pool_submit_job(opj_thread_pool_t* tp, opj_job_fn job_fn, vo
* @param tp the thread pool handle
* @param max_remaining_jobs maximum number of jobs allowed to be queued without waiting.
*/
void opj_thread_pool_wait_completion(opj_thread_pool_t* tp, int max_remaining_jobs);
void opj_thread_pool_wait_completion(opj_thread_pool_t* tp,
int max_remaining_jobs);
/** Return the number of threads associated with the thread pool.
*

View File

@ -49,15 +49,15 @@ The functions in BIO.C have for goal to realize an individual bit input - output
Individual bit input-output stream (BIO)
*/
typedef struct opj_bio {
/** pointer to the start of the buffer */
/** pointer to the start of the buffer */
unsigned char *start;
/** pointer to the end of the buffer */
/** pointer to the end of the buffer */
unsigned char *end;
/** pointer to the present position in the buffer */
/** pointer to the present position in the buffer */
unsigned char *bp;
/** temporary place where each byte is read or written */
/** temporary place where each byte is read or written */
unsigned int buf;
/** coder : number of bits free to write. decoder : number of bits read */
/** coder : number of bits free to write. decoder : number of bits read */
int ct;
} opj_bio_t;

View File

@ -57,9 +57,10 @@ Multiply two fixed-precision rational numbers.
@param b
@return Returns a * b
*/
static int fix_mul(int a, int b) {
static int fix_mul(int a, int b)
{
int64 temp = (int64) a * (int64) b >> 12;
return (int) ((temp >> 1) + (temp & 1)) ;
return (int)((temp >> 1) + (temp & 1)) ;
}
/*@}*/

View File

@ -51,14 +51,16 @@ The functions in INT.H have for goal to realize operations on integers.
Get the minimum of two integers
@return Returns a if a < b else b
*/
static int int_min(int a, int b) {
static int int_min(int a, int b)
{
return a < b ? a : b;
}
/**
Get the maximum of two integers
@return Returns a if a > b else b
*/
static int int_max(int a, int b) {
static int int_max(int a, int b)
{
return (a > b) ? a : b;
}
/**
@ -70,49 +72,58 @@ Clamp an integer inside an interval
<li>Returns min if (a < min)
</ul>
*/
static int int_clamp(int a, int min, int max) {
if (a < min)
static int int_clamp(int a, int min, int max)
{
if (a < min) {
return min;
if (a > max)
}
if (a > max) {
return max;
}
return a;
}
/**
@return Get absolute value of integer
*/
static int int_abs(int a) {
static int int_abs(int a)
{
return a < 0 ? -a : a;
}
static double dbl_abs(double a) {
static double dbl_abs(double a)
{
return a < 0 ? -a : a;
}
/**
Divide an integer and round upwards
@return Returns a divided by b
*/
static int int_ceildiv(int a, int b) {
static int int_ceildiv(int a, int b)
{
return (a + b - 1) / b;
}
/**
Divide an integer by a power of 2 and round upwards
@return Returns a divided by 2^b
*/
static int int_ceildivpow2(int a, int b) {
static int int_ceildivpow2(int a, int b)
{
return (a + (1 << b) - 1) >> b;
}
/**
Divide an integer by a power of 2 and round downwards
@return Returns a divided by 2^b
*/
static int int_floordivpow2(int a, int b) {
static int int_floordivpow2(int a, int b)
{
return a >> b;
}
/**
Get logarithm of an integer and round downwards
@return Returns log2(a)
*/
static int int_floorlog2(int a) {
static int int_floorlog2(int a)
{
int l;
for (l = 0; a > 1; l++) {
a >>= 1;

View File

@ -153,31 +153,31 @@ typedef enum J3D_STATUS {
Arbitrary transformation kernel
*/
typedef struct opj_atk {
/** index of wavelet kernel */
/** index of wavelet kernel */
int index;
/** Numerical type of scaling factor and lifting step parameters */
/** Numerical type of scaling factor and lifting step parameters */
int coeff_typ;
/** Wavelet filter category */
/** Wavelet filter category */
int filt_cat;
/** Wavelet transformation type (REV/IRR) */
/** Wavelet transformation type (REV/IRR) */
int wt_typ;
/** Initial odd/even subsequence */
/** Initial odd/even subsequence */
int minit;
/** Boundary extension method (constant CON / whole-sample symmetric WS) */
/** Boundary extension method (constant CON / whole-sample symmetric WS) */
int exten;
/** Scaling factor. Only for wt_typ=IRR */
/** Scaling factor. Only for wt_typ=IRR */
double Katk;
/** Number of lifting steps */
/** Number of lifting steps */
int Natk;
/** Offset for lifting step s. Only for filt_cat=ARB */
/** Offset for lifting step s. Only for filt_cat=ARB */
int Oatk[256];
/** Base 2 scaling exponent for lifting step s. Only for wt_typ=REV */
/** Base 2 scaling exponent for lifting step s. Only for wt_typ=REV */
int Eatk[256];
/** Additive residue for lifting step s. Only for wt_typ=REV */
/** Additive residue for lifting step s. Only for wt_typ=REV */
int Batk[256];
/** Number of lifting coefficients signaled for lifting step s */
/** Number of lifting coefficients signaled for lifting step s */
int LCatk[256];
/** Lifting coefficient k for lifting step s */
/** Lifting coefficient k for lifting step s */
double Aatk[256][256];
} opj_atk_t;
@ -186,9 +186,9 @@ typedef struct opj_atk {
Quantization stepsize
*/
typedef struct opj_stepsize {
/** exponent */
/** exponent */
int expn;
/** mantissa */
/** mantissa */
int mant;
} opj_stepsize_t;
@ -229,7 +229,7 @@ Tile coding parameters : coding/decoding parameters common to all tiles
(information like COD, COC in main header)
*/
typedef struct opj_tcp {
/** 1 : first part-tile of a tile */
/** 1 : first part-tile of a tile */
int first;
/** coding style */
int csty;
@ -251,7 +251,7 @@ typedef struct opj_tcp {
float distoratio[100];
/** tile-component coding parameters */
opj_tccp_t *tccps;
/** packet header store there for futur use in t2_decode_packet */
/** packet header store there for futur use in t2_decode_packet */
unsigned char *ppt_data;
/** pointer remaining on the first byte of the first header if ppt is used */
unsigned char *ppt_data_first;
@ -266,7 +266,7 @@ typedef struct opj_tcp {
Coding parameters
*/
typedef struct opj_cp {
/** transform format 0: 2DWT, 1: 2D1P, 2: 3DWT, 3: 3RLS */
/** transform format 0: 2DWT, 1: 2D1P, 2: 3DWT, 3: 3RLS */
OPJ_TRANSFORM transform_format;
/** entropy coding format 0: 2EB, 1: 3EB, 2: 2GR, 3: 3GR, 4: GRI*/
OPJ_ENTROPY_CODING encoding_format;
@ -505,7 +505,8 @@ Coding parameters are returned in j3d->cp.
@param parameters compression parameters
@param volume input filled volume
*/
void j3d_setup_encoder(opj_j3d_t *j3d, opj_cparameters_t *parameters, opj_volume_t *volume);
void j3d_setup_encoder(opj_j3d_t *j3d, opj_cparameters_t *parameters,
opj_volume_t *volume);
/**
Encode an volume into a JPEG-2000 codestream
@param j3d J3D compressor handle
@ -514,7 +515,8 @@ Encode an volume into a JPEG-2000 codestream
@param index Name of the index file if required, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
bool j3d_encode(opj_j3d_t *j3d, opj_cio_t *cio, opj_volume_t *volume, char *index);
bool j3d_encode(opj_j3d_t *j3d, opj_cio_t *cio, opj_volume_t *volume,
char *index);
/* ----------------------------------------------------------------------- */
/*@}*/

View File

@ -55,7 +55,7 @@ Allocate a memory block with elements initialized to 0
@param size Bytes to allocate
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
*/
void* opj_malloc( size_t size );
void* opj_malloc(size_t size);
/**
Reallocate memory blocks.
@ -63,13 +63,13 @@ Reallocate memory blocks.
@param size New size in bytes
@return Returns a void pointer to the reallocated (and possibly moved) memory block
*/
void* opj_realloc( void *memblock, size_t size );
void* opj_realloc(void *memblock, size_t size);
/**
Deallocates or frees a memory block.
@param memblock Previously allocated memory block to be freed
*/
void opj_free( void *memblock );
void opj_free(void *memblock);
/* ----------------------------------------------------------------------- */
/*@}*/

View File

@ -129,17 +129,17 @@ braindamage below.
/** Progression order */
typedef enum PROG_ORDER {
/**< place-holder */
/**< place-holder */
PROG_UNKNOWN = -1,
/**< layer-resolution-component-precinct order */
/**< layer-resolution-component-precinct order */
LRCP = 0,
/**< resolution-layer-component-precinct order */
/**< resolution-layer-component-precinct order */
RLCP = 1,
/**< resolution-precinct-component-layer order */
/**< resolution-precinct-component-layer order */
RPCL = 2,
/**< precinct-component-resolution-layer order */
/**< precinct-component-resolution-layer order */
PCRL = 3,
/**< component-precinct-resolution-layer order */
/**< component-precinct-resolution-layer order */
CPRL = 4
} OPJ_PROG_ORDER;
@ -147,13 +147,13 @@ typedef enum PROG_ORDER {
Supported volume color spaces
*/
typedef enum COLOR_SPACE {
/**< place-holder */
/**< place-holder */
CLRSPC_UNKNOWN = -1,
/**< sRGB */
/**< sRGB */
CLRSPC_SRGB = 1,
/**< grayscale */
/**< grayscale */
CLRSPC_GRAY = 2,
/**< YUV */
/**< YUV */
CLRSPC_SYCC = 3
} OPJ_COLOR_SPACE;
@ -163,9 +163,9 @@ Supported codec
typedef enum CODEC_FORMAT {
/**< place-holder */
CODEC_UNKNOWN = -1,
/**< JPEG-2000 codestream : read/write */
/**< JPEG-2000 codestream : read/write */
CODEC_J2K = 0,
/**< JPEG-2000 Part 10 file format : read/write */
/**< JPEG-2000 Part 10 file format : read/write */
CODEC_J3D = 1
} OPJ_CODEC_FORMAT;
@ -173,15 +173,15 @@ typedef enum CODEC_FORMAT {
Supported entropy coding algorithms
*/
typedef enum ENTROPY_CODING {
/**< place-holder */
/**< place-holder */
ENCOD_UNKNOWN = -1,
/**< 2D EBCOT encoding */
/**< 2D EBCOT encoding */
ENCOD_2EB = 0,
/**< 3D EBCOT encoding */
/**< 3D EBCOT encoding */
ENCOD_3EB = 1,
/**< Golomb-Rice coding with 2D context */
/**< Golomb-Rice coding with 2D context */
ENCOD_2GR = 2,
/**< Golomb-Rice coding with 3D context */
/**< Golomb-Rice coding with 3D context */
ENCOD_3GR = 3
} OPJ_ENTROPY_CODING;
@ -189,13 +189,13 @@ typedef enum ENTROPY_CODING {
Supported transforms
*/
typedef enum TRANSFORM {
/**< place-holder */
/**< place-holder */
TRF_UNKNOWN = -1,
/**< 2D DWT, no transform in axial dim */
/**< 2D DWT, no transform in axial dim */
TRF_2D_DWT = 0,
/**< 3D DWT */
/**< 3D DWT */
TRF_3D_DWT = 1,
/**< 3D prediction*/
/**< 3D prediction*/
TRF_3D_RLS = 2,
TRF_3D_LSE = 3
} OPJ_TRANSFORM;
@ -210,7 +210,7 @@ Callback function prototype for events
@param msg Event message
@param client_data
*/
typedef void (*opj_msg_callback) (const char *msg, void *client_data);
typedef void (*opj_msg_callback)(const char *msg, void *client_data);
/**
Message handler object
@ -253,73 +253,73 @@ typedef struct opj_poc {
Compression parameters
*/
typedef struct opj_cparameters {
/** size of tile: tile_size_on = false (not in argument) or = true (in argument) */
/** size of tile: tile_size_on = false (not in argument) or = true (in argument) */
bool tile_size_on;
/** XTOsiz */
/** XTOsiz */
int cp_tx0;
/** YTOsiz */
/** YTOsiz */
int cp_ty0;
/** ZTOsiz */
/** ZTOsiz */
int cp_tz0;
/** XTsiz */
/** XTsiz */
int cp_tdx;
/** YTsiz */
/** YTsiz */
int cp_tdy;
/** ZTsiz */
/** ZTsiz */
int cp_tdz;
/** allocation by rate/distortion */
/** allocation by rate/distortion */
int cp_disto_alloc;
/** allocation by fixed layer */
/** allocation by fixed layer */
int cp_fixed_alloc;
/** add fixed_quality */
/** add fixed_quality */
int cp_fixed_quality;
/** fixed layer */
/** fixed layer */
int *cp_matrice;
/** number of layers */
/** number of layers */
int tcp_numlayers;
/** rates for successive layers */
/** rates for successive layers */
float tcp_rates[100];
/** psnr's for successive layers */
/** psnr's for successive layers */
float tcp_distoratio[100];
/** comment for coding */
/** comment for coding */
char *cp_comment;
/** csty : coding style */
/** csty : coding style */
int csty;
/** DC offset (DCO) */
/** DC offset (DCO) */
int dcoffset;
/** progression order (default LRCP) */
/** progression order (default LRCP) */
OPJ_PROG_ORDER prog_order;
/** progression order changes */
opj_poc_t POC[J3D_MAXRLVLS-1];
/** number of progression order changes (POC), default to 0 */
/** progression order changes */
opj_poc_t POC[J3D_MAXRLVLS - 1];
/** number of progression order changes (POC), default to 0 */
int numpocs;
/** number of resolutions */
/** number of resolutions */
int numresolution[3];
/** initial code block width, height and depth, default to 64 */
/** initial code block width, height and depth, default to 64 */
int cblock_init[3];
/** mode switch (1=BYPASS(LAZY) 2=RESET 4=RESTART(TERMALL) 8=VSC 16=ERTERM(SEGTERM) 32=SEGMARK(SEGSYM)) */
/** mode switch (1=BYPASS(LAZY) 2=RESET 4=RESTART(TERMALL) 8=VSC 16=ERTERM(SEGTERM) 32=SEGMARK(SEGSYM)) */
int mode;
/** 1 : use the irreversible DWT 9-7, 0 : use lossless compression (default) */
/** 1 : use the irreversible DWT 9-7, 0 : use lossless compression (default) */
int irreversible;
/** WT from ATK, default to 0 (false), no of atk used */
/** WT from ATK, default to 0 (false), no of atk used */
int atk_wt[3];
/** region of interest: affected component in [0..3], -1 means no ROI */
/** region of interest: affected component in [0..3], -1 means no ROI */
int roi_compno;
/** region of interest: upshift value */
/** region of interest: upshift value */
int roi_shift;
/* number of precinct size specifications */
/* number of precinct size specifications */
int res_spec;
/** initial precinct width */
/** initial precinct width */
int prct_init[3][J3D_MAXRLVLS];
/** transform format 0: 0: 2DWT, 1: 2D1P, 2: 3DWT, 3: 3RLS */
/** transform format 0: 0: 2DWT, 1: 2D1P, 2: 3DWT, 3: 3RLS */
OPJ_TRANSFORM transform_format;
/** output file format 0: 2EB, 1: 3EB, 2: 2GR, 3: 3GR, 4: GRI */
/** output file format 0: 2EB, 1: 3EB, 2: 2GR, 3: 3GR, 4: GRI */
OPJ_ENTROPY_CODING encoding_format;
/**@name command line encoder parameters (not used inside the library) */
@ -347,27 +347,27 @@ typedef struct opj_cparameters {
Decompression parameters
*/
typedef struct opj_dparameters {
/** Set the number of highest resolution levels to be discarded. if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, volume is decoded to the full resolution */
/** Set the number of highest resolution levels to be discarded. if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, volume is decoded to the full resolution */
int cp_reduce[3];
/** Set the maximum number of quality layers to decode. if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers are decoded */
/** Set the maximum number of quality layers to decode. if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers are decoded */
int cp_layer;
int bigendian;
/**@name command line encoder parameters (not used inside the library) */
/*@{*/
/** input file name */
/** input file name */
char infile[MAX_PATH];
/** output file name */
/** output file name */
char outfile[MAX_PATH];
/** IMG file name for BIN volumes*/
/** IMG file name for BIN volumes*/
char imgfile[MAX_PATH];
/** Original file name for PSNR measures*/
/** Original file name for PSNR measures*/
char original[MAX_PATH];
/** input file format 0: J2K, 1: JP3D */
/** input file format 0: J2K, 1: JP3D */
int decod_format;
/** input file format 0: BIN, 1: PGM */
/** input file format 0: BIN, 1: PGM */
int cod_format;
/** original file format 0: BIN, 1: PGM */
/** original file format 0: BIN, 1: PGM */
int orig_format;
/*@}*/
} opj_dparameters_t;
@ -432,19 +432,19 @@ typedef struct opj_dinfo {
Byte input-output stream (CIO)
*/
typedef struct opj_cio {
/** codec context */
/** codec context */
opj_common_ptr cinfo;
/** open mode (read/write) either OPJ_STREAM_READ or OPJ_STREAM_WRITE */
/** open mode (read/write) either OPJ_STREAM_READ or OPJ_STREAM_WRITE */
int openmode;
/** pointer to the start of the buffer */
/** pointer to the start of the buffer */
unsigned char *buffer;
/** buffer size in bytes */
/** buffer size in bytes */
int length;
/** pointer to the start of the stream */
/** pointer to the start of the stream */
unsigned char *start;
/** pointer to the end of the stream */
/** pointer to the end of the stream */
unsigned char *end;
/** pointer to the current position */
/** pointer to the current position */
unsigned char *bp;
} opj_cio_t;
@ -458,13 +458,13 @@ typedef struct opj_cio {
Defines a single volume component
*/
typedef struct opj_volume_comp {
/** XRsiz: horizontal separation of a sample of ith component with respect to the reference grid */
/** XRsiz: horizontal separation of a sample of ith component with respect to the reference grid */
int dx;
/** YRsiz: vertical separation of a sample of ith component with respect to the reference grid */
/** YRsiz: vertical separation of a sample of ith component with respect to the reference grid */
int dy;
/** ZRsiz: vertical separation of a sample of ith component with respect to the reference grid */
/** ZRsiz: vertical separation of a sample of ith component with respect to the reference grid */
int dz;
/** data width */
/** data width */
int w;
/** data height */
int h;
@ -498,25 +498,25 @@ typedef struct opj_volume_comp {
Defines volume data and characteristics
*/
typedef struct opj_volume {
/** XOsiz: horizontal offset from the origin of the reference grid to the left side of the volume area */
/** XOsiz: horizontal offset from the origin of the reference grid to the left side of the volume area */
int x0;
/** YOsiz: vertical offset from the origin of the reference grid to the top side of the volume area */
/** YOsiz: vertical offset from the origin of the reference grid to the top side of the volume area */
int y0;
/** ZOsiz: vertical offset from the origin of the reference grid to the top side of the volume area */
/** ZOsiz: vertical offset from the origin of the reference grid to the top side of the volume area */
int z0;
/** Xsiz: width of the reference grid */
/** Xsiz: width of the reference grid */
int x1;
/** Ysiz: height of the reference grid */
/** Ysiz: height of the reference grid */
int y1;
/** Zsiz: length of the reference grid */
/** Zsiz: length of the reference grid */
int z1;
/** number of components in the volume */
/** number of components in the volume */
int numcomps;
/** number of slices in the volume */
/** number of slices in the volume */
int numslices;
/** color space: sRGB, Greyscale or YUV */
/** color space: sRGB, Greyscale or YUV */
OPJ_COLOR_SPACE color_space;
/** volume components */
/** volume components */
opj_volume_comp_t *comps;
} opj_volume_t;
@ -580,7 +580,8 @@ Create an volume
@param clrspc volume color space
@return returns a new volume structure if successful, returns NULL otherwise
*/
OPJ_API opj_volume_t* OPJ_CALLCONV opj_volume_create(int numcmpts, opj_volume_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
OPJ_API opj_volume_t* OPJ_CALLCONV opj_volume_create(int numcmpts,
opj_volume_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
/**
Deallocate any resources associated with an volume
@ -605,7 +606,8 @@ to contain encoded data.
@param length Reading: buffer length. Writing: 0
@return Returns a CIO handle if successful, returns NULL otherwise
*/
OPJ_API opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length);
OPJ_API opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo,
unsigned char *buffer, int length);
/**
Close and free a CIO handle
@ -632,7 +634,8 @@ OPJ_API void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos);
==========================================================
*/
OPJ_API opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo, opj_event_mgr_t *event_mgr, void *context);
OPJ_API opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo,
opj_event_mgr_t *event_mgr, void *context);
/*
==========================================================
@ -644,7 +647,8 @@ Creates a J3D decompression structure
@param format Decoder to select
@return Returns a handle to a decompressor if successful, returns NULL otherwise
*/
OPJ_API opj_dinfo_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format);
OPJ_API opj_dinfo_t* OPJ_CALLCONV opj_create_decompress(
OPJ_CODEC_FORMAT format);
/**
Destroy a decompressor handle
@param dinfo decompressor handle to destroy
@ -654,21 +658,24 @@ OPJ_API void OPJ_CALLCONV opj_destroy_decompress(opj_dinfo_t *dinfo);
Set decoding parameters to default values
@param parameters Decompression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(
opj_dparameters_t *parameters);
/**
Setup the decoder decoding parameters using user parameters.
Decoding parameters are returned in j3d->cp.
@param dinfo decompressor handle
@param parameters decompression parameters
*/
OPJ_API void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo, opj_dparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo,
opj_dparameters_t *parameters);
/**
Decode an volume from a JPEG-2000 codestream
@param dinfo decompressor handle
@param cio Input buffer stream
@return Returns a decoded volume if successful, returns NULL otherwise
*/
OPJ_API opj_volume_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio);
OPJ_API opj_volume_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo,
opj_cio_t *cio);
/**
Creates a J3D/JP2 compression structure
@param format Coder to select
@ -701,14 +708,16 @@ Set encoding parameters to default values, that means :
</ul>
@param parameters Compression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(
opj_cparameters_t *parameters);
/**
Setup the encoder parameters using the current volume and using user parameters.
@param cinfo compressor handle
@param parameters compression parameters
@param volume input filled volume
*/
OPJ_API void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparameters_t *parameters, opj_volume_t *volume);
OPJ_API void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo,
opj_cparameters_t *parameters, opj_volume_t *volume);
/**
Encode an volume into a JPEG-2000 codestream
@param cinfo compressor handle
@ -717,7 +726,8 @@ Encode an volume into a JPEG-2000 codestream
@param index Name of the index file if required, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
OPJ_API bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_volume_t *volume, char *index);
OPJ_API bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio,
opj_volume_t *volume, char *index);
#ifdef __cplusplus
}

View File

@ -52,13 +52,13 @@ by some function in T2.C.
Packet iterator : resolution level information
*/
typedef struct opj_pi_resolution {
/** Size of precints in horizontal axis */
/** Size of precints in horizontal axis */
int pdx;
/** Size of precints in vertical axis */
/** Size of precints in vertical axis */
int pdy;
/** Size of precints in axial axis */
/** Size of precints in axial axis */
int pdz;
/** Number of precints in each axis */
/** Number of precints in each axis */
int prctno[3];
} opj_pi_resolution_t;
@ -66,15 +66,15 @@ typedef struct opj_pi_resolution {
Packet iterator : component information
*/
typedef struct opj_pi_comp {
/** Size in horizontal axis */
/** Size in horizontal axis */
int dx;
/** Size in vertical axis */
/** Size in vertical axis */
int dy;
/** Size in axial axis */
/** Size in axial axis */
int dz;
/** Number of resolution levels */
/** Number of resolution levels */
int numresolution[3];
/** Packet iterator : resolution level information */
/** Packet iterator : resolution level information */
opj_pi_resolution_t *resolutions;
} opj_pi_comp_t;
@ -82,30 +82,30 @@ typedef struct opj_pi_comp {
Packet iterator
*/
typedef struct opj_pi_iterator {
/** precise if the packet has been already used (useful for progression order change) */
/** precise if the packet has been already used (useful for progression order change) */
short int *include;
/** layer step used to localize the packet in the include vector */
/** layer step used to localize the packet in the include vector */
int step_l;
/** resolution step used to localize the packet in the include vector */
/** resolution step used to localize the packet in the include vector */
int step_r;
/** component step used to localize the packet in the include vector */
/** component step used to localize the packet in the include vector */
int step_c;
/** precinct step used to localize the packet in the include vector */
/** precinct step used to localize the packet in the include vector */
int step_p;
/** component that identify the packet */
/** component that identify the packet */
int compno;
/** resolution that identify the packet */
/** resolution that identify the packet */
int resno;
/** precinct that identify the packet */
/** precinct that identify the packet */
int precno;
/** layer that identify the packet */
/** layer that identify the packet */
int layno;
/** 0 if the first packet */
/** 0 if the first packet */
int first;
/** progression order change information */
/** progression order change information */
opj_poc_t poc;
/** Packet iterator : component information */
opj_pi_comp_t *comps;
/** Packet iterator : component information */
opj_pi_comp_t *comps;
int numcomps;
int tx0, ty0, tz0;

View File

@ -48,19 +48,19 @@ with the corresponding mode switch.
RAW encoding operations
*/
typedef struct opj_raw {
/** Temporary buffer where bits are coded or decoded */
/** Temporary buffer where bits are coded or decoded */
unsigned char c;
/** Number of bits already read or free to write */
/** Number of bits already read or free to write */
unsigned int ct;
/** Maximum length to decode */
/** Maximum length to decode */
unsigned int lenmax;
/** Length decoded */
/** Length decoded */
unsigned int len;
/** Pointer to the current position in the buffer */
/** Pointer to the current position in the buffer */
unsigned char *bp;
/** Pointer to the start of the buffer */
/** Pointer to the start of the buffer */
unsigned char *start;
/** Pointer to the end of the buffer */
/** Pointer to the end of the buffer */
unsigned char *end;
} opj_raw_t;

View File

@ -168,7 +168,8 @@ Get weigths of MSE decoding
@param dwtid
returns MSE associated to decoding pass
*/
double t1_getwmsedec(int nmsedec, int compno, int level[3], int orient, int bpno, double stepsize, int numcomps, int dwtid[3]);
double t1_getwmsedec(int nmsedec, int compno, int level[3], int orient,
int bpno, double stepsize, int numcomps, int dwtid[3]);
/* ----------------------------------------------------------------------- */
/*@}*/

View File

@ -48,11 +48,11 @@
Tier-2 coding
*/
typedef struct opj_t2 {
/** Codec context */
/** Codec context */
opj_common_ptr cinfo;
/** Encoding: pointer to the src volume. Decoding: pointer to the dst volume. */
/** Encoding: pointer to the src volume. Decoding: pointer to the dst volume. */
opj_volume_t *volume;
/** Pointer to the volume coding parameters */
/** Pointer to the volume coding parameters */
opj_cp_t *cp;
} opj_t2_t;
@ -71,7 +71,8 @@ Encode the packets of a tile to a destination buffer
@param volume_info structure to create an index file
@return Number of bytes written from packets
*/
int t2_encode_packets(opj_t2_t* t2, int tileno, opj_tcd_tile_t *tile, int maxlayers, unsigned char *dest, int len, opj_volume_info_t *volume_info);
int t2_encode_packets(opj_t2_t* t2, int tileno, opj_tcd_tile_t *tile,
int maxlayers, unsigned char *dest, int len, opj_volume_info_t *volume_info);
/**
Decode the packets of a tile from a source buffer
@ -82,7 +83,8 @@ Decode the packets of a tile from a source buffer
@param tile tile for which to decode the packets
@return Number of bytes read from packets
*/
int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj_tcd_tile_t *tile);
int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno,
opj_tcd_tile_t *tile);
/**
Create a T2 handle

View File

@ -50,17 +50,17 @@ each other. The functions in TCD.C are used by some function in JP3D.C.
Tile coder/decoder: segment instance
*/
typedef struct opj_tcd_seg {
/** Number of passes in the segment */
/** Number of passes in the segment */
int numpasses;
/** Length of information */
/** Length of information */
int len;
/** Data */
/** Data */
unsigned char *data;
/** Number of passes posible for the segment */
/** Number of passes posible for the segment */
int maxpasses;
/** Number of passes added to the segment */
/** Number of passes added to the segment */
int numnewpasses;
/** New length after inclusion of segments */
/** New length after inclusion of segments */
int newlen;
} opj_tcd_seg_t;
@ -68,12 +68,12 @@ typedef struct opj_tcd_seg {
Tile coder/decoder: pass instance
*/
typedef struct opj_tcd_pass {
/** Rate obtained in the pass*/
/** Rate obtained in the pass*/
int rate;
/** Distorsion obtained in the pass*/
/** Distorsion obtained in the pass*/
double distortiondec;
int term;
/** Length of information */
/** Length of information */
int len;
} opj_tcd_pass_t;
@ -81,11 +81,11 @@ typedef struct opj_tcd_pass {
Tile coder/decoder: layer instance
*/
typedef struct opj_tcd_layer {
/** Number of passes in the layer */
/** Number of passes in the layer */
int numpasses;
/** Length of information */
/** Length of information */
int len;
/** Distortion within layer */
/** Distortion within layer */
double disto; /* add for index (Cfr. Marcela) */
unsigned char *data; /* data */
} opj_tcd_layer_t;
@ -94,31 +94,31 @@ typedef struct opj_tcd_layer {
Tile coder/decoder: codeblock instance
*/
typedef struct opj_tcd_cblk {
/** Dimension of the code-blocks : left upper corner (x0, y0, z0) */
/** Dimension of the code-blocks : left upper corner (x0, y0, z0) */
int x0, y0, z0;
/** Dimension of the code-blocks : right low corner (x1,y1,z1) */
/** Dimension of the code-blocks : right low corner (x1,y1,z1) */
int x1, y1, z1;
/** Number of bits per simbol in codeblock */
/** Number of bits per simbol in codeblock */
int numbps;
int numlenbits;
int len; /* length */
/** Number of pass already done for the code-blocks */
/** Number of pass already done for the code-blocks */
int numpasses;
/** number of pass added to the code-blocks */
/** number of pass added to the code-blocks */
int numnewpasses;
/** Number of segments */
/** Number of segments */
int numsegs;
/** Segments informations */
/** Segments informations */
opj_tcd_seg_t segs[100];
/** Number of passes in the layer */
/** Number of passes in the layer */
int numpassesinlayers;
/** Layer information */
/** Layer information */
opj_tcd_layer_t layers[100];
/** Total number of passes */
/** Total number of passes */
int totalpasses;
/** Information about the passes */
/** Information about the passes */
opj_tcd_pass_t passes[100];
/* Data */
/* Data */
unsigned char data[524288];
/*unsigned char *data;*/
} opj_tcd_cblk_t;
@ -127,17 +127,17 @@ typedef struct opj_tcd_cblk {
Tile coder/decoder: precint instance
*/
typedef struct opj_tcd_precinct {
/** Dimension of the precint : left upper corner (x0, y0, z0) */
/** Dimension of the precint : left upper corner (x0, y0, z0) */
int x0, y0, z0;
/** Dimension of the precint : right low corner (x1,y1,z1) */
/** Dimension of the precint : right low corner (x1,y1,z1) */
int x1, y1, z1;
/** Number of codeblocks in precinct in width and heigth and length*/
/** Number of codeblocks in precinct in width and heigth and length*/
int cblkno[3];
/** Information about the codeblocks */
/** Information about the codeblocks */
opj_tcd_cblk_t *cblks;
/** Inclusion tree */
/** Inclusion tree */
opj_tgt_tree_t *incltree;
/** Missing MSBs tree */
/** Missing MSBs tree */
opj_tgt_tree_t *imsbtree;
} opj_tcd_precinct_t;
@ -145,17 +145,17 @@ typedef struct opj_tcd_precinct {
Tile coder/decoder: subband instance
*/
typedef struct opj_tcd_band {
/** Dimension of the subband : left upper corner (x0, y0, z0) */
/** Dimension of the subband : left upper corner (x0, y0, z0) */
int x0, y0, z0;
/** Dimension of the subband : right low corner (x1,y1,z1) */
/** Dimension of the subband : right low corner (x1,y1,z1) */
int x1, y1, z1;
/** Information about the precints */
/** Information about the precints */
opj_tcd_precinct_t *precincts; /* precinct information */
/** Number of bits per symbol in band */
/** Number of bits per symbol in band */
int numbps;
/** Quantization stepsize associated */
/** Quantization stepsize associated */
float stepsize;
/** Band orientation (O->LLL,...,7->HHH) */
/** Band orientation (O->LLL,...,7->HHH) */
int bandno;
} opj_tcd_band_t;
@ -163,15 +163,15 @@ typedef struct opj_tcd_band {
Tile coder/decoder: resolution instance
*/
typedef struct opj_tcd_resolution {
/** Dimension of the resolution level : left upper corner (x0, y0, z0) */
/** Dimension of the resolution level : left upper corner (x0, y0, z0) */
int x0, y0, z0;
/** Dimension of the resolution level : right low corner (x1,y1,z1) */
/** Dimension of the resolution level : right low corner (x1,y1,z1) */
int x1, y1, z1;
/** Number of precints in each dimension for the resolution level */
/** Number of precints in each dimension for the resolution level */
int prctno[3];
/** Number of subbands for the resolution level */
/** Number of subbands for the resolution level */
int numbands;
/** Subband information */
/** Subband information */
opj_tcd_band_t *bands;
} opj_tcd_resolution_t;
@ -179,19 +179,19 @@ typedef struct opj_tcd_resolution {
Tile coder/decoder: component instance
*/
typedef struct opj_tcd_tilecomp {
/** Dimension of the component : left upper corner (x0, y0, z0) */
/** Dimension of the component : left upper corner (x0, y0, z0) */
int x0, y0, z0;
/** Dimension of the component : right low corner (x1,y1,z1) */
/** Dimension of the component : right low corner (x1,y1,z1) */
int x1, y1, z1;
/** Number of resolutions level if DWT transform*/
/** Number of resolutions level if DWT transform*/
int numresolution[3];
/** Resolution information */
/** Resolution information */
opj_tcd_resolution_t *resolutions;
/** Data of the component */
/** Data of the component */
int *data;
/** Fixed_quality related */
/** Fixed_quality related */
int nbpix;
/** Number of bits per voxel in component */
/** Number of bits per voxel in component */
int bpp;
} opj_tcd_tilecomp_t;
@ -199,19 +199,19 @@ typedef struct opj_tcd_tilecomp {
Tile coder/decoder: tile instance
*/
typedef struct opj_tcd_tile {
/** Dimension of the tile : left upper corner (x0, y0, z0) */
/** Dimension of the tile : left upper corner (x0, y0, z0) */
int x0, y0, z0;
/** Dimension of the tile : right low corner (x1,y1,z1) */
/** Dimension of the tile : right low corner (x1,y1,z1) */
int x1, y1, z1;
/** Number of components in tile */
/** Number of components in tile */
int numcomps;
/** Components information */
/** Components information */
opj_tcd_tilecomp_t *comps;
/** Fixed_quality related : no of bytes of data*/
/** Fixed_quality related : no of bytes of data*/
int nbpix;
/** Fixed_quality related : distortion achieved in tile */
/** Fixed_quality related : distortion achieved in tile */
double distotile;
/** Fixed_quality related : distortion achieved in each layer */
/** Fixed_quality related : distortion achieved in each layer */
double distolayer[100];
} opj_tcd_tile_t;
@ -219,9 +219,9 @@ typedef struct opj_tcd_tile {
Tile coder/decoder: volume instance
*/
typedef struct opj_tcd_volume {
/** Number of tiles in width and heigth and length */
/** Number of tiles in width and heigth and length */
int tw, th, tl;
/** Tiles information */
/** Tiles information */
opj_tcd_tile_t *tiles;
} opj_tcd_volume_t;
@ -229,19 +229,19 @@ typedef struct opj_tcd_volume {
Tile coder/decoder
*/
typedef struct opj_tcd {
/** Codec context */
/** Codec context */
opj_common_ptr cinfo;
/** Volume information */
/** Volume information */
opj_volume_t *volume;
/** Coding parameters */
/** Coding parameters */
opj_cp_t *cp;
/** Coding/decoding parameters common to all tiles */
/** Coding/decoding parameters common to all tiles */
opj_tcp_t *tcp;
/** Info on each volume tile */
/** Info on each volume tile */
opj_tcd_volume_t *tcd_volume;
/** Pointer to the current encoded/decoded tile */
/** Pointer to the current encoded/decoded tile */
opj_tcd_tile_t *tcd_tile;
/** Current encoded/decoded tile */
/** Current encoded/decoded tile */
int tcd_tileno;
/**@name working variables */
@ -281,7 +281,8 @@ Initialize the tile coder (allocate the memory)
@param cp Coding parameters
@param curtileno Number that identifies the tile that will be encoded
*/
void tcd_malloc_encode(opj_tcd_t *tcd, opj_volume_t * volume, opj_cp_t * cp, int curtileno);
void tcd_malloc_encode(opj_tcd_t *tcd, opj_volume_t * volume, opj_cp_t * cp,
int curtileno);
/**
Initialize the tile coder (reuses the memory allocated by tcd_malloc_encode)(for 3D-DWT)
@param tcd TCD handle
@ -289,7 +290,8 @@ Initialize the tile coder (reuses the memory allocated by tcd_malloc_encode)(for
@param cp Coding parameters
@param curtileno Number that identifies the tile that will be encoded
*/
void tcd_init_encode(opj_tcd_t *tcd, opj_volume_t * volume, opj_cp_t * cp, int curtileno);
void tcd_init_encode(opj_tcd_t *tcd, opj_volume_t * volume, opj_cp_t * cp,
int curtileno);
/**
Free the memory allocated for encoding
@param tcd TCD handle
@ -306,7 +308,8 @@ void tcd_malloc_decode(opj_tcd_t *tcd, opj_volume_t * volume, opj_cp_t * cp);
void tcd_makelayer_fixed(opj_tcd_t *tcd, int layno, int final);
void tcd_rateallocate_fixed(opj_tcd_t *tcd);
void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final);
bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_volume_info_t * volume_info);
bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len,
opj_volume_info_t * volume_info);
/**
Encode a tile from the raw volume into a buffer
@param tcd TCD handle
@ -316,7 +319,8 @@ Encode a tile from the raw volume into a buffer
@param volume_info Creation of index file
@return
*/
int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len, opj_volume_info_t * volume_info);
int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len,
opj_volume_info_t * volume_info);
/**
Decode a tile from a buffer into a raw volume
@param tcd TCD handle

View File

@ -50,13 +50,13 @@ are used by some function in T2.C.
Tag node
*/
typedef struct opj_tgt_node {
/** Node parent reference */
/** Node parent reference */
struct opj_tgt_node *parent;
/** */
/** */
int value;
/** */
/** */
int low;
/** */
/** */
int known;
} opj_tgt_node_t;
@ -64,15 +64,15 @@ typedef struct opj_tgt_node {
Tag tree
*/
typedef struct opj_tgt_tree {
/** Number of leaves from horizontal axis */
/** Number of leaves from horizontal axis */
int numleafsh;
/** Number of leaves from vertical axis */
/** Number of leaves from vertical axis */
int numleafsv;
/** Number of leaves from axial axis */
/** Number of leaves from axial axis */
int numleafsz;
/** Number of nodes */
/** Number of nodes */
int numnodes;
/** Reference to each node instance */
/** Reference to each node instance */
opj_tgt_node_t *nodes;
} opj_tgt_tree_t;
@ -111,7 +111,8 @@ Encode the value of a leaf of the tag-tree up to a given threshold
@param leafno Number that identifies the leaf to encode
@param threshold Threshold to use when encoding value of the leaf
*/
void tgt_encode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno, int threshold);
void tgt_encode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno,
int threshold);
/**
Decode the value of a leaf of the tag-tree up to a given threshold
@param bio Pointer to a BIO handle
@ -124,7 +125,7 @@ int tgt_decode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno, int threshold);
/*@}*/
/* ----------------------------------------------------------------------- */
void tgt_tree_dump (FILE *fd, opj_tgt_tree_t * tree);
void tgt_tree_dump(FILE *fd, opj_tgt_tree_t * tree);
/*@}*/
#endif /* __TGT_H */

View File

@ -35,7 +35,7 @@
#include "opj_includes.h"
/** auxiliary transport setting parameters*/
typedef struct auxtrans_param{
typedef struct auxtrans_param {
int tcpauxport; /**< tcp port*/
int udpauxport; /**< udp port*/
SOCKET tcplistensock; /**< listenning socket for aux tcp (-1 if not open)*/
@ -49,14 +49,14 @@ typedef struct auxtrans_param{
* @param[in] udp_auxport opening udp auxiliary port ( 0 not to open, valid No. 49152-65535)
* @return intialized transport parameters
*/
auxtrans_param_t init_aux_transport( int tcp_auxport, int udp_auxport);
auxtrans_param_t init_aux_transport(int tcp_auxport, int udp_auxport);
/**
* Close auxiliary transport server of JPIP server
*
* @param[in] auxtrans closing transport server
*/
void close_aux_transport( auxtrans_param_t auxtrans);
void close_aux_transport(auxtrans_param_t auxtrans);
/**
* Send response data on aux transport
@ -68,6 +68,7 @@ void close_aux_transport( auxtrans_param_t auxtrans);
* @param[in] length length of data
* @param[in] maxlenPerFrame maximum data length to send per frame
*/
void send_responsedata_on_aux( OPJ_BOOL istcp, auxtrans_param_t auxtrans, const char cid[], void *data, OPJ_SIZE_T length, OPJ_SIZE_T maxlenPerFrame);
void send_responsedata_on_aux(OPJ_BOOL istcp, auxtrans_param_t auxtrans,
const char cid[], void *data, OPJ_SIZE_T length, OPJ_SIZE_T maxlenPerFrame);
#endif /* !AUXTRANS_MANAGER_H_ */

View File

@ -34,7 +34,7 @@
#include "byte_manager.h"
/** box parameters*/
typedef struct box_param{
typedef struct box_param {
int fd; /**< file descriptor*/
OPJ_OFF_T offset; /**< byte position of the whole Box (LBox) in the file*/
Byte_t headlen; /**< header length 8 or 16*/
@ -45,7 +45,7 @@ typedef struct box_param{
/** Box list parameters*/
typedef struct boxlist_param{
typedef struct boxlist_param {
box_param_t *first; /**< first box pointer of the list*/
box_param_t *last; /**< last box pointer of the list*/
} boxlist_param_t;
@ -66,7 +66,7 @@ boxlist_param_t * gene_boxlist(void);
* @param[in] length length of the decomposing region
* @return pointer to the generated boxlist
*/
boxlist_param_t * get_boxstructure( int fd, OPJ_OFF_T offset, OPJ_SIZE_T length);
boxlist_param_t * get_boxstructure(int fd, OPJ_OFF_T offset, OPJ_SIZE_T length);
/**
@ -76,7 +76,7 @@ boxlist_param_t * get_boxstructure( int fd, OPJ_OFF_T offset, OPJ_SIZE_T length)
* @param[in] offset Box offset
* @return pointer to the structure of generate box parameters
*/
box_param_t * gene_boxbyOffset( int fd, OPJ_OFF_T offset);
box_param_t * gene_boxbyOffset(int fd, OPJ_OFF_T offset);
/**
@ -86,7 +86,7 @@ box_param_t * gene_boxbyOffset( int fd, OPJ_OFF_T offset);
* @param[in] offset Box offset of the whole stream
* @return pointer to the structure of generate box parameters
*/
box_param_t * gene_boxbyOffinStream( Byte_t *stream, OPJ_OFF_T offset);
box_param_t * gene_boxbyOffinStream(Byte_t *stream, OPJ_OFF_T offset);
/**
* generate(search) box from JP2 file
@ -97,7 +97,8 @@ box_param_t * gene_boxbyOffinStream( Byte_t *stream, OPJ_OFF_T offset);
* @param[in] TBox Box Type
* @return pointer to the structure of generate/found box parameters
*/
box_param_t * gene_boxbyType( int fd, OPJ_OFF_T offset, OPJ_SIZE_T length, const char TBox[]);
box_param_t * gene_boxbyType(int fd, OPJ_OFF_T offset, OPJ_SIZE_T length,
const char TBox[]);
/**
* generate(search) box from code stream
@ -108,7 +109,8 @@ box_param_t * gene_boxbyType( int fd, OPJ_OFF_T offset, OPJ_SIZE_T length, const
* @param[in] TBox Box Type
* @return pointer to the structure of generate/found box parameters
*/
box_param_t * gene_boxbyTypeinStream( Byte_t *stream, OPJ_OFF_T offset, OPJ_SIZE_T length, const char TBox[]);
box_param_t * gene_boxbyTypeinStream(Byte_t *stream, OPJ_OFF_T offset,
OPJ_SIZE_T length, const char TBox[]);
/**
* generate child box from JP2 file at the given offset
@ -117,7 +119,7 @@ box_param_t * gene_boxbyTypeinStream( Byte_t *stream, OPJ_OFF_T offset, OPJ_SIZE
* @param[in] offset offset from DBox first byte of superbox
* @return pointer to the structure of generate box parameters
*/
box_param_t * gene_childboxbyOffset( box_param_t *superbox, OPJ_OFF_T offset);
box_param_t * gene_childboxbyOffset(box_param_t *superbox, OPJ_OFF_T offset);
/**
* generate(search) box from JP2 file
@ -127,7 +129,8 @@ box_param_t * gene_childboxbyOffset( box_param_t *superbox, OPJ_OFF_T offset);
* @param[in] TBox Box Type
* @return pointer to the structure of generate/found box parameters
*/
box_param_t * gene_childboxbyType( box_param_t *superbox, OPJ_OFF_T offset, const char TBox[]);
box_param_t * gene_childboxbyType(box_param_t *superbox, OPJ_OFF_T offset,
const char TBox[]);
/**
* get DBox offset
@ -135,7 +138,7 @@ box_param_t * gene_childboxbyType( box_param_t *superbox, OPJ_OFF_T offset, cons
* @param[in] box box pointer
* @return DBox offset (byte position) in the file
*/
OPJ_OFF_T get_DBoxoff( box_param_t *box);
OPJ_OFF_T get_DBoxoff(box_param_t *box);
/**
@ -144,7 +147,7 @@ OPJ_OFF_T get_DBoxoff( box_param_t *box);
* @param[in] box box pointer
* @return DBox length ( content length)
*/
OPJ_SIZE_T get_DBoxlen( box_param_t *box);
OPJ_SIZE_T get_DBoxlen(box_param_t *box);
/**
@ -153,7 +156,7 @@ OPJ_SIZE_T get_DBoxlen( box_param_t *box);
* @param[in] box box pointer
* @return pointer to the fetched bytes
*/
Byte_t * fetch_headbytes( box_param_t *box);
Byte_t * fetch_headbytes(box_param_t *box);
/**
@ -164,7 +167,7 @@ Byte_t * fetch_headbytes( box_param_t *box);
* @param[in] size Byte length
* @return pointer to the fetched data
*/
Byte_t * fetch_DBoxbytes( box_param_t *box, OPJ_OFF_T offset, OPJ_SIZE_T size);
Byte_t * fetch_DBoxbytes(box_param_t *box, OPJ_OFF_T offset, OPJ_SIZE_T size);
/**
* fetch DBox (Box Contents) 1-byte Byte codes in file stream
@ -173,7 +176,7 @@ Byte_t * fetch_DBoxbytes( box_param_t *box, OPJ_OFF_T offset, OPJ_SIZE_T size);
* @param[in] offset start Byte position in DBox
* @return fetched code
*/
Byte_t fetch_DBox1byte( box_param_t *box, OPJ_OFF_T offset);
Byte_t fetch_DBox1byte(box_param_t *box, OPJ_OFF_T offset);
/**
* fetch DBox (Box Contents) 2-byte big endian Byte codes in file stream
@ -182,7 +185,7 @@ Byte_t fetch_DBox1byte( box_param_t *box, OPJ_OFF_T offset);
* @param[in] offset start Byte position in DBox
* @return fetched code
*/
Byte2_t fetch_DBox2bytebigendian( box_param_t *box, OPJ_OFF_T offset);
Byte2_t fetch_DBox2bytebigendian(box_param_t *box, OPJ_OFF_T offset);
/**
* fetch DBox (Box Contents) 4-byte big endian Byte codes in file stream
@ -191,7 +194,7 @@ Byte2_t fetch_DBox2bytebigendian( box_param_t *box, OPJ_OFF_T offset);
* @param[in] offset start Byte position in DBox
* @return fetched code
*/
Byte4_t fetch_DBox4bytebigendian( box_param_t *box, OPJ_OFF_T offset);
Byte4_t fetch_DBox4bytebigendian(box_param_t *box, OPJ_OFF_T offset);
/**
* fetch DBox (Box Contents) 8-byte big endian Byte codes in file stream
@ -200,7 +203,7 @@ Byte4_t fetch_DBox4bytebigendian( box_param_t *box, OPJ_OFF_T offset);
* @param[in] offset start Byte position in DBox
* @return fetched code
*/
Byte8_t fetch_DBox8bytebigendian( box_param_t *box, OPJ_OFF_T offset);
Byte8_t fetch_DBox8bytebigendian(box_param_t *box, OPJ_OFF_T offset);
/**
@ -210,14 +213,14 @@ Byte8_t fetch_DBox8bytebigendian( box_param_t *box, OPJ_OFF_T offset);
* @param[in] boxlist box list pointer
* @return found box pointer
*/
box_param_t * search_box( const char type[], boxlist_param_t *boxlist);
box_param_t * search_box(const char type[], boxlist_param_t *boxlist);
/**
* print box parameters
*
* @param[in] box box pointer
*/
void print_box( box_param_t *box);
void print_box(box_param_t *box);
/**
@ -225,7 +228,7 @@ void print_box( box_param_t *box);
*
* @param[in] boxlist box list pointer
*/
void print_allbox( boxlist_param_t *boxlist);
void print_allbox(boxlist_param_t *boxlist);
/**
* delete a box in list
@ -233,7 +236,7 @@ void print_allbox( boxlist_param_t *boxlist);
* @param[in,out] box address of the deleting box pointer
* @param[in] boxlist box list pointer
*/
void delete_box_in_list( box_param_t **box, boxlist_param_t *boxlist);
void delete_box_in_list(box_param_t **box, boxlist_param_t *boxlist);
/**
@ -242,7 +245,7 @@ void delete_box_in_list( box_param_t **box, boxlist_param_t *boxlist);
* @param[in,out] type box type
* @param[in] boxlist box list pointer
*/
void delete_box_in_list_by_type( const char type[], boxlist_param_t *boxlist);
void delete_box_in_list_by_type(const char type[], boxlist_param_t *boxlist);
/**
@ -250,7 +253,7 @@ void delete_box_in_list_by_type( const char type[], boxlist_param_t *boxlist);
*
* @param[in,out] boxlist address of the box list pointer
*/
void delete_boxlist( boxlist_param_t **boxlist);
void delete_boxlist(boxlist_param_t **boxlist);
/**
@ -259,6 +262,6 @@ void delete_boxlist( boxlist_param_t **boxlist);
* @param[in] box box pointer
* @param[in] boxlist box list pointer
*/
void insert_box_into_list( box_param_t *box, boxlist_param_t *boxlist);
void insert_box_into_list(box_param_t *box, boxlist_param_t *boxlist);
#endif /* !BOX_MANAGER_H_ */

View File

@ -36,7 +36,7 @@
#include "box_manager.h"
/** box header parameters*/
typedef struct boxheader_param{
typedef struct boxheader_param {
Byte_t headlen; /**< header length 8 or 16*/
Byte8_t length; /**< length of the reference Box*/
char type[4]; /**< type of information in the DBox*/
@ -51,7 +51,7 @@ typedef struct boxheader_param{
* @param[in] offset Box offset
* @return pointer to the structure of generate box header parameters
*/
boxheader_param_t * gene_boxheader( int fd, OPJ_OFF_T offset);
boxheader_param_t * gene_boxheader(int fd, OPJ_OFF_T offset);
/**
* generate a child box header at the given offset
@ -60,13 +60,14 @@ boxheader_param_t * gene_boxheader( int fd, OPJ_OFF_T offset);
* @param[in] offset offset from DBox first byte of superbox
* @return pointer to the structure of generate box header parameters
*/
boxheader_param_t * gene_childboxheader( box_param_t *superbox, OPJ_OFF_T offset);
boxheader_param_t * gene_childboxheader(box_param_t *superbox,
OPJ_OFF_T offset);
/**
* print box header parameters
*
* @param[in] boxheader boxheader pointer
*/
void print_boxheader( boxheader_param_t *boxheader);
void print_boxheader(boxheader_param_t *boxheader);
#endif /* !BOXHEADER_MANAGER_H_ */

View File

@ -47,7 +47,7 @@ typedef uint64_t Byte8_t;
* @param[in] size Byte length
* @return pointer to the fetched data
*/
Byte_t * fetch_bytes( int fd, OPJ_OFF_T offset, OPJ_SIZE_T size);
Byte_t * fetch_bytes(int fd, OPJ_OFF_T offset, OPJ_SIZE_T size);
/**
@ -57,7 +57,7 @@ Byte_t * fetch_bytes( int fd, OPJ_OFF_T offset, OPJ_SIZE_T size);
* @param[in] offset start Byte position
* @return fetched codes
*/
Byte_t fetch_1byte( int fd, OPJ_OFF_T offset);
Byte_t fetch_1byte(int fd, OPJ_OFF_T offset);
/**
* fetch a 2-byte big endian Byte codes in file stream
@ -66,7 +66,7 @@ Byte_t fetch_1byte( int fd, OPJ_OFF_T offset);
* @param[in] offset start Byte position
* @return fetched codes
*/
Byte2_t fetch_2bytebigendian( int fd, OPJ_OFF_T offset);
Byte2_t fetch_2bytebigendian(int fd, OPJ_OFF_T offset);
/**
* fetch a 4-byte big endian Byte codes in file stream
@ -75,7 +75,7 @@ Byte2_t fetch_2bytebigendian( int fd, OPJ_OFF_T offset);
* @param[in] offset start Byte position
* @return fetched codes
*/
Byte4_t fetch_4bytebigendian( int fd, OPJ_OFF_T offset);
Byte4_t fetch_4bytebigendian(int fd, OPJ_OFF_T offset);
/**
* fetch a 8-byte big endian Byte codes in file stream
@ -84,7 +84,7 @@ Byte4_t fetch_4bytebigendian( int fd, OPJ_OFF_T offset);
* @param[in] offset start Byte position
* @return fetched codes
*/
Byte8_t fetch_8bytebigendian( int fd, OPJ_OFF_T offset);
Byte8_t fetch_8bytebigendian(int fd, OPJ_OFF_T offset);
/**
@ -93,7 +93,7 @@ Byte8_t fetch_8bytebigendian( int fd, OPJ_OFF_T offset);
* @param[in] buf Byte codes
* @return resolved number
*/
Byte2_t big2( Byte_t *buf);
Byte2_t big2(Byte_t *buf);
/**
* convert 4-byte big endian Byte codes to number
@ -101,7 +101,7 @@ Byte2_t big2( Byte_t *buf);
* @param[in] buf Byte codes
* @return resolved number
*/
Byte4_t big4( Byte_t *buf);
Byte4_t big4(Byte_t *buf);
/**
* convert 8-byte big endian Byte codes to number
@ -109,7 +109,7 @@ Byte4_t big4( Byte_t *buf);
* @param[in] buf Byte codes
* @return resolved number
*/
Byte8_t big8( Byte_t *buf);
Byte8_t big8(Byte_t *buf);
/**
* modify 4Byte code in a codestream
@ -117,7 +117,7 @@ Byte8_t big8( Byte_t *buf);
* @param[in] code code value
* @param[out] stream modifying codestream
*/
void modify_4Bytecode( Byte4_t code, Byte_t *stream);
void modify_4Bytecode(Byte4_t code, Byte_t *stream);
/**
* Get file size
@ -125,6 +125,6 @@ void modify_4Bytecode( Byte4_t code, Byte_t *stream);
* @param[in] fd file discriptor
* @return file size
*/
OPJ_OFF_T get_filesize( int fd);
OPJ_OFF_T get_filesize(int fd);
#endif /* !BYTE_MANAGER_H_ */

View File

@ -35,7 +35,7 @@
#include "ihdrbox_manager.h"
/** cache parameters*/
typedef struct cache_param{
typedef struct cache_param {
char *filename; /**< file name*/
char *tid; /**< taregt identifier*/
int csn; /**< codestream number*/
@ -47,7 +47,7 @@ typedef struct cache_param{
} cache_param_t;
/**< cache list parameters*/
typedef struct cachelist_param{
typedef struct cachelist_param {
cache_param_t *first; /**< first cache pointer of the list*/
cache_param_t *last; /**< last cache pointer of the list*/
} cachelist_param_t;
@ -76,14 +76,15 @@ void delete_cachelist(cachelist_param_t **cachelist);
* @param[in] cid channel identifier
* @return pointer to the generated cache
*/
cache_param_t * gene_cache( const char *targetname, int csn, char *tid, char *cid);
cache_param_t * gene_cache(const char *targetname, int csn, char *tid,
char *cid);
/**
* delete a cache
*
* @param[in] cache address of the cache pointer
*/
void delete_cache( cache_param_t **cache);
void delete_cache(cache_param_t **cache);
/**
* insert a cache into list
@ -91,7 +92,7 @@ void delete_cache( cache_param_t **cache);
* @param[in] cache cache pointer
* @param[in] cachelist cache list pointer
*/
void insert_cache_into_list( cache_param_t *cache, cachelist_param_t *cachelist);
void insert_cache_into_list(cache_param_t *cache, cachelist_param_t *cachelist);
/**
@ -101,7 +102,8 @@ void insert_cache_into_list( cache_param_t *cache, cachelist_param_t *cachelist)
* @param[in] cachelist cache list pointer
* @return found cache pointer
*/
cache_param_t * search_cache( const char targetname[], cachelist_param_t *cachelist);
cache_param_t * search_cache(const char targetname[],
cachelist_param_t *cachelist);
/**
@ -111,7 +113,7 @@ cache_param_t * search_cache( const char targetname[], cachelist_param_t *cachel
* @param[in] cachelist cache list pointer
* @return found cache pointer
*/
cache_param_t * search_cacheBycsn( int csn, cachelist_param_t *cachelist);
cache_param_t * search_cacheBycsn(int csn, cachelist_param_t *cachelist);
/**
@ -121,7 +123,8 @@ cache_param_t * search_cacheBycsn( int csn, cachelist_param_t *cachelist);
* @param[in] cachelist cache list pointer
* @return found cache pointer
*/
cache_param_t * search_cacheBycid( const char cid[], cachelist_param_t *cachelist);
cache_param_t * search_cacheBycid(const char cid[],
cachelist_param_t *cachelist);
/**
@ -131,7 +134,8 @@ cache_param_t * search_cacheBycid( const char cid[], cachelist_param_t *cachelis
* @param[in] cachelist cache list pointer
* @return found cache pointer
*/
cache_param_t * search_cacheBytid( const char tid[], cachelist_param_t *cachelist);
cache_param_t * search_cacheBytid(const char tid[],
cachelist_param_t *cachelist);
/**
* add cid into a cache
@ -139,7 +143,7 @@ cache_param_t * search_cacheBytid( const char tid[], cachelist_param_t *cachelis
* @param[in] cid channel identifier
* @param[in] cache cache pointer
*/
void add_cachecid( const char *cid, cache_param_t *cache);
void add_cachecid(const char *cid, cache_param_t *cache);
/**
@ -148,7 +152,7 @@ void add_cachecid( const char *cid, cache_param_t *cache);
* @param[in] tid target identifier
* @param[in] cache cache pointer
*/
void update_cachetid( const char *tid, cache_param_t *cache);
void update_cachetid(const char *tid, cache_param_t *cache);
/**
@ -157,7 +161,7 @@ void update_cachetid( const char *tid, cache_param_t *cache);
* @param[in] cid channel identifier
* @param[in] cachelist cachelist pointer
*/
void remove_cachecid( const char *cid, cachelist_param_t *cachelist);
void remove_cachecid(const char *cid, cachelist_param_t *cachelist);
/**
@ -165,13 +169,13 @@ void remove_cachecid( const char *cid, cachelist_param_t *cachelist);
*
* @param[in] cache cache pointer
*/
void print_cache( cache_param_t *cache);
void print_cache(cache_param_t *cache);
/**
* print all cache parameters
*
* @param[in] cachelist cache list pointer
*/
void print_allcache( cachelist_param_t *cachelist);
void print_allcache(cachelist_param_t *cachelist);
#endif /* !CACHE_MANAGER_H_ */

View File

@ -34,7 +34,7 @@
#include "target_manager.h"
/** Cache model parameters*/
typedef struct cachemodel_param{
typedef struct cachemodel_param {
target_param_t *target; /**< reference pointer to the target*/
OPJ_BOOL jppstream; /**< return type, true: JPP-stream, false: JPT-stream*/
OPJ_BOOL mhead_model; /**< main header model, if sent, 1, else 0*/
@ -45,7 +45,7 @@ typedef struct cachemodel_param{
} cachemodel_param_t;
/** Cache model list parameters*/
typedef struct cachemodellist_param{
typedef struct cachemodellist_param {
cachemodel_param_t *first; /**< first cache model pointer of the list*/
cachemodel_param_t *last; /**< last cache model pointer of the list*/
} cachemodellist_param_t;
@ -66,7 +66,8 @@ cachemodellist_param_t * gene_cachemodellist(void);
* @param[in] reqJPP if JPP-stream is desired true, JPT-stream false
* @return pointer to the generated cache model
*/
cachemodel_param_t * gene_cachemodel( cachemodellist_param_t *cachemodellist, target_param_t *target, OPJ_BOOL reqJPP);
cachemodel_param_t * gene_cachemodel(cachemodellist_param_t *cachemodellist,
target_param_t *target, OPJ_BOOL reqJPP);
/**
@ -74,7 +75,7 @@ cachemodel_param_t * gene_cachemodel( cachemodellist_param_t *cachemodellist, ta
*
* @param[in] cachemodel cache model
*/
void print_cachemodel( cachemodel_param_t cachemodel);
void print_cachemodel(cachemodel_param_t cachemodel);
/**
@ -84,7 +85,8 @@ void print_cachemodel( cachemodel_param_t cachemodel);
* @param[in] cachemodellist cache model list
* @return found cache model pointer
*/
cachemodel_param_t * search_cachemodel( target_param_t *target, cachemodellist_param_t *cachemodellist);
cachemodel_param_t * search_cachemodel(target_param_t *target,
cachemodellist_param_t *cachemodellist);
/**
@ -93,7 +95,7 @@ cachemodel_param_t * search_cachemodel( target_param_t *target, cachemodellist_p
* @param[in] cachemodel cache model
* @return true if sent all, false otherwise
*/
OPJ_BOOL is_allsent( cachemodel_param_t cachemodel);
OPJ_BOOL is_allsent(cachemodel_param_t cachemodel);
/**
@ -101,14 +103,14 @@ OPJ_BOOL is_allsent( cachemodel_param_t cachemodel);
*
* @param[in] cachemodel address of the cachemodel pointer
*/
void delete_cachemodel( cachemodel_param_t **cachemodel);
void delete_cachemodel(cachemodel_param_t **cachemodel);
/**
* delete cachemodel list
*
* @param[in,out] cachemodellist address of the cachemodel list pointer
*/
void delete_cachemodellist( cachemodellist_param_t **cachemodellist);
void delete_cachemodellist(cachemodellist_param_t **cachemodellist);
#endif /* !CACHEMODEL_MANAGER_H_ */

View File

@ -40,7 +40,7 @@
#define MAX_LENOFCID 30
/** Channel parameters*/
typedef struct channel_param{
typedef struct channel_param {
cachemodel_param_t *cachemodel; /**< reference pointer to the cache model*/
char cid[MAX_LENOFCID]; /**< channel identifier*/
cnew_transport_t aux; /**< auxiliary transport*/
@ -51,7 +51,7 @@ typedef struct channel_param{
/** Channel list parameters*/
typedef struct channellist_param{
typedef struct channellist_param {
channel_param_t *first; /**< first channel pointer of the list*/
channel_param_t *last; /**< last channel pointer of the list*/
} channellist_param_t;
@ -74,7 +74,9 @@ channellist_param_t * gene_channellist(void);
* @param[in] channellist channel list pointer
* @return pointer to the generated channel
*/
channel_param_t * gene_channel( query_param_t query_param, auxtrans_param_t auxtrans, cachemodel_param_t *cachemodel, channellist_param_t *channellist);
channel_param_t * gene_channel(query_param_t query_param,
auxtrans_param_t auxtrans, cachemodel_param_t *cachemodel,
channellist_param_t *channellist);
/**
* set channel variable parameters
@ -82,7 +84,8 @@ channel_param_t * gene_channel( query_param_t query_param, auxtrans_param_t auxt
* @param[in] query_param query parameters
* @param[in,out] channel pointer to the modifying channel
*/
void set_channel_variable_param( query_param_t query_param, channel_param_t *channel);
void set_channel_variable_param(query_param_t query_param,
channel_param_t *channel);
/**
* delete a channel
@ -90,7 +93,8 @@ void set_channel_variable_param( query_param_t query_param, channel_param_t *cha
* @param[in] channel address of the deleting channel pointer
* @param[in,out] channellist channel list pointer
*/
void delete_channel( channel_param_t **channel, channellist_param_t *channellist);
void delete_channel(channel_param_t **channel,
channellist_param_t *channellist);
/**
@ -98,7 +102,7 @@ void delete_channel( channel_param_t **channel, channellist_param_t *channellist
*
* @param[in,out] channellist address of the channel list pointer
*/
void delete_channellist( channellist_param_t **channellist);
void delete_channellist(channellist_param_t **channellist);
/**
@ -106,7 +110,7 @@ void delete_channellist( channellist_param_t **channellist);
*
* @param[in] channellist channel list pointer
*/
void print_allchannel( channellist_param_t *channellist);
void print_allchannel(channellist_param_t *channellist);
/**
@ -116,5 +120,6 @@ void print_allchannel( channellist_param_t *channellist);
* @param[in] channellist channel list pointer
* @return found channel pointer
*/
channel_param_t * search_channel( const char cid[], channellist_param_t *channellist);
channel_param_t * search_channel(const char cid[],
channellist_param_t *channellist);
#endif /* !CHANNEL_MANAGER_H_ */

View File

@ -34,7 +34,7 @@
#include "byte_manager.h"
/** codestream parameters*/
typedef struct codestream_param{
typedef struct codestream_param {
int fd; /**< file descriptor*/
OPJ_OFF_T offset; /**< byte position of DBox (Box Contents) in the file*/
Byte8_t length; /**< content length*/
@ -49,7 +49,7 @@ typedef struct codestream_param{
* @param[in] length codestream length
* @return structure of generated codestream parameters
*/
codestream_param_t set_codestream( int fd, OPJ_OFF_T offset, OPJ_SIZE_T length);
codestream_param_t set_codestream(int fd, OPJ_OFF_T offset, OPJ_SIZE_T length);
/**
@ -60,7 +60,8 @@ codestream_param_t set_codestream( int fd, OPJ_OFF_T offset, OPJ_SIZE_T length);
* @param[in] size Byte length
* @return pointer to the fetched data
*/
Byte_t * fetch_codestreambytes( codestream_param_t *cs, OPJ_OFF_T offset, OPJ_SIZE_T size);
Byte_t * fetch_codestreambytes(codestream_param_t *cs, OPJ_OFF_T offset,
OPJ_SIZE_T size);
/**
* fetch Codestream 1-byte Byte code in file stream
@ -69,7 +70,7 @@ Byte_t * fetch_codestreambytes( codestream_param_t *cs, OPJ_OFF_T offset, OPJ_SI
* @param[in] offset start Byte position in codestream
* @return fetched code
*/
Byte_t fetch_codestream1byte( codestream_param_t *cs, OPJ_OFF_T offset);
Byte_t fetch_codestream1byte(codestream_param_t *cs, OPJ_OFF_T offset);
/**
* fetch Codestream 2-byte big endian Byte codes in file stream
@ -78,7 +79,8 @@ Byte_t fetch_codestream1byte( codestream_param_t *cs, OPJ_OFF_T offset);
* @param[in] offset start Byte position in codestream
* @return fetched code
*/
Byte2_t fetch_codestream2bytebigendian( codestream_param_t *cs, OPJ_OFF_T offset);
Byte2_t fetch_codestream2bytebigendian(codestream_param_t *cs,
OPJ_OFF_T offset);
/**
* fetch Codestream 4-byte big endian Byte codes in file stream
@ -87,7 +89,8 @@ Byte2_t fetch_codestream2bytebigendian( codestream_param_t *cs, OPJ_OFF_T offset
* @param[in] offset start Byte position in codestream
* @return fetched code
*/
Byte4_t fetch_codestream4bytebigendian( codestream_param_t *cs, OPJ_OFF_T offset);
Byte4_t fetch_codestream4bytebigendian(codestream_param_t *cs,
OPJ_OFF_T offset);
/**
@ -95,7 +98,7 @@ Byte4_t fetch_codestream4bytebigendian( codestream_param_t *cs, OPJ_OFF_T offset
*
* @param[in] cs codestream
*/
void print_codestream( codestream_param_t cs);
void print_codestream(codestream_param_t cs);
#endif /* !CODESTREAM_MANAGER_H_ */

View File

@ -46,7 +46,8 @@
* @param[in,out] streamlen address of stream length
* @param[in,out] msgqueue message queue pointer
*/
void handle_JPIPstreamMSG( SOCKET connected_socket, cachelist_param_t *cachelist, Byte_t **jpipstream, OPJ_SIZE_T *streamlen, msgqueue_param_t *msgqueue);
void handle_JPIPstreamMSG(SOCKET connected_socket, cachelist_param_t *cachelist,
Byte_t **jpipstream, OPJ_SIZE_T *streamlen, msgqueue_param_t *msgqueue);
/**
* handle PNM request message
@ -56,7 +57,8 @@ void handle_JPIPstreamMSG( SOCKET connected_socket, cachelist_param_t *cachelist
* @param[in] msgqueue message queue pointer
* @param[in] cachelist cache list pointer
*/
void handle_PNMreqMSG( SOCKET connected_socket, Byte_t *jpipstream, msgqueue_param_t *msgqueue, cachelist_param_t *cachelist);
void handle_PNMreqMSG(SOCKET connected_socket, Byte_t *jpipstream,
msgqueue_param_t *msgqueue, cachelist_param_t *cachelist);
/**
* handle XML request message
@ -65,7 +67,8 @@ void handle_PNMreqMSG( SOCKET connected_socket, Byte_t *jpipstream, msgqueue_par
* @param[in] jpipstream address of caching jpipstream pointer
* @param[in] cachelist cache list pointer
*/
void handle_XMLreqMSG( SOCKET connected_socket, Byte_t *jpipstream, cachelist_param_t *cachelist);
void handle_XMLreqMSG(SOCKET connected_socket, Byte_t *jpipstream,
cachelist_param_t *cachelist);
/**
* handle TargetID request message
@ -73,7 +76,7 @@ void handle_XMLreqMSG( SOCKET connected_socket, Byte_t *jpipstream, cachelist_pa
* @param[in] connected_socket socket descriptor
* @param[in] cachelist cache list pointer
*/
void handle_TIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist);
void handle_TIDreqMSG(SOCKET connected_socket, cachelist_param_t *cachelist);
/**
* handle ChannelID request message
@ -81,7 +84,7 @@ void handle_TIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist);
* @param[in] connected_socket socket descriptor
* @param[in] cachelist cache list pointer
*/
void handle_CIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist);
void handle_CIDreqMSG(SOCKET connected_socket, cachelist_param_t *cachelist);
/**
* handle distroy ChannelID message
@ -89,7 +92,7 @@ void handle_CIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist);
* @param[in] connected_socket socket descriptor
* @param[in,out] cachelist cache list pointer
*/
void handle_dstCIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist);
void handle_dstCIDreqMSG(SOCKET connected_socket, cachelist_param_t *cachelist);
/**
* handle SIZ request message
@ -99,7 +102,8 @@ void handle_dstCIDreqMSG( SOCKET connected_socket, cachelist_param_t *cachelist)
* @param[in] msgqueue message queue pointer
* @param[in,out] cachelist cache list pointer
*/
void handle_SIZreqMSG( SOCKET connected_socket, Byte_t *jpipstream, msgqueue_param_t *msgqueue, cachelist_param_t *cachelist);
void handle_SIZreqMSG(SOCKET connected_socket, Byte_t *jpipstream,
msgqueue_param_t *msgqueue, cachelist_param_t *cachelist);
/**
* handle saving JP2 file request message
@ -109,7 +113,8 @@ void handle_SIZreqMSG( SOCKET connected_socket, Byte_t *jpipstream, msgqueue_par
* @param[in] msgqueue message queue pointer
* @param[in] jpipstream address of caching jpipstream pointer
*/
void handle_JP2saveMSG( SOCKET connected_socket, cachelist_param_t *cachelist, msgqueue_param_t *msgqueue, Byte_t *jpipstream);
void handle_JP2saveMSG(SOCKET connected_socket, cachelist_param_t *cachelist,
msgqueue_param_t *msgqueue, Byte_t *jpipstream);
#endif /* !DEC_CLIENTMSG_HANDLER_H_ */

View File

@ -35,19 +35,19 @@
#include "box_manager.h"
/** 4byte parameters of a faix element*/
typedef struct faixelem4_param{
typedef struct faixelem4_param {
Byte4_t off; /**< offset*/
Byte4_t len; /**< length*/
} faixelem4_param_t;
/** 8byte parameters of a faix element*/
typedef struct faixelem8_param{
typedef struct faixelem8_param {
Byte8_t off; /**< offset*/
Byte8_t len; /**< length*/
} faixelem8_param_t;
/** 4byte parameters of fragment array index box*/
typedef struct subfaixbox4_param{
typedef struct subfaixbox4_param {
Byte4_t nmax; /**< maximum number of valid elements in any row of the array*/
Byte4_t m; /**< number of raws of the array*/
faixelem4_param_t *elem; /**< dynamic array pointer of faix elements*/
@ -56,7 +56,7 @@ typedef struct subfaixbox4_param{
} subfaixbox4_param_t;
/** 8byte parameters of fragment array index box*/
typedef struct subfaixbox8_param{
typedef struct subfaixbox8_param {
Byte8_t nmax; /**< maximum number of valid elements in any row of the array*/
Byte8_t m; /**< number of raws of the array*/
faixelem8_param_t *elem; /**< dynamic array pointer of faix elements*/
@ -65,14 +65,16 @@ typedef struct subfaixbox8_param{
} subfaixbox8_param_t;
/** variable sized parameters in fragment array index box*/
typedef union subfaixbox_param{
subfaixbox4_param_t *byte4_params; /**< parameters with 4byte codes for version 0 or 2*/
subfaixbox8_param_t *byte8_params; /**< parameters with 8byte codes for version 1 or 3*/
typedef union subfaixbox_param {
subfaixbox4_param_t
*byte4_params; /**< parameters with 4byte codes for version 0 or 2*/
subfaixbox8_param_t
*byte8_params; /**< parameters with 8byte codes for version 1 or 3*/
} subfaixbox_param_t;
/** fragment array index box parameters*/
/** I.3.2.4.2 Fragment Array Index box*/
typedef struct faixbox_param{
typedef struct faixbox_param {
Byte_t version; /**< Refer to the Table I.3 - Version values*/
subfaixbox_param_t subfaixbox; /**< rest information in faixbox*/
} faixbox_param_t;
@ -84,7 +86,7 @@ typedef struct faixbox_param{
* @param[in] box pointer to the reference faix_box
* @return generated faixbox
*/
faixbox_param_t * gene_faixbox( box_param_t *box);
faixbox_param_t * gene_faixbox(box_param_t *box);
/**
@ -92,7 +94,7 @@ faixbox_param_t * gene_faixbox( box_param_t *box);
*
* @param[in] faix faix box pointer
*/
void print_faixbox( faixbox_param_t *faix);
void print_faixbox(faixbox_param_t *faix);
/**
@ -100,21 +102,21 @@ void print_faixbox( faixbox_param_t *faix);
*
* @param[in,out] faix addressof the faixbox pointer
*/
void delete_faixbox( faixbox_param_t **faix);
void delete_faixbox(faixbox_param_t **faix);
/**
* get nmax parameter value from faix box
*
* @param[in] faix faix box pointer
*/
Byte8_t get_nmax( faixbox_param_t *faix);
Byte8_t get_nmax(faixbox_param_t *faix);
/**
* get m parameter value from faix box
*
* @param[in] faix faix box pointer
*/
Byte8_t get_m( faixbox_param_t *faix);
Byte8_t get_m(faixbox_param_t *faix);
/**
* get offset of a element from faix box
@ -123,7 +125,7 @@ Byte8_t get_m( faixbox_param_t *faix);
* @param[in] elem_id element id in a row (0<= <nmax)
* @param[in] row_id row id (0<= <m)
*/
Byte8_t get_elemOff( faixbox_param_t *faix, Byte8_t elem_id, Byte8_t row_id);
Byte8_t get_elemOff(faixbox_param_t *faix, Byte8_t elem_id, Byte8_t row_id);
/**
* get length of a element from faix box
@ -132,7 +134,7 @@ Byte8_t get_elemOff( faixbox_param_t *faix, Byte8_t elem_id, Byte8_t row_id);
* @param[in] elem_id element id in a row (0<= <nmax)
* @param[in] row_id row id (0<= <m)
*/
Byte8_t get_elemLen( faixbox_param_t *faix, Byte8_t elem_id, Byte8_t row_id);
Byte8_t get_elemLen(faixbox_param_t *faix, Byte8_t elem_id, Byte8_t row_id);
/**
* get aux of a element from faix box
@ -141,6 +143,6 @@ Byte8_t get_elemLen( faixbox_param_t *faix, Byte8_t elem_id, Byte8_t row_id);
* @param[in] elem_id element id in a row (0<= <nmax)
* @param[in] row_id row id (0<= <m)
*/
Byte4_t get_elemAux( faixbox_param_t *faix, Byte8_t elem_id, Byte8_t row_id);
Byte4_t get_elemAux(faixbox_param_t *faix, Byte8_t elem_id, Byte8_t row_id);
#endif /* !FAIXBOX_MANAGER_H_ */

View File

@ -36,7 +36,7 @@
#include "metadata_manager.h"
/** I.5.3.1 Image Header box*/
typedef struct ihdrbox_param{
typedef struct ihdrbox_param {
Byte4_t height;
Byte4_t width;
Byte2_t nc; /**< number of components*/
@ -50,7 +50,8 @@ typedef struct ihdrbox_param{
* @param[in] jpipstream JPT/JPP stream
* @return pointer to generated ihdr box
*/
ihdrbox_param_t * gene_ihdrbox( metadatalist_param_t *metadatalist, Byte_t *jpipstream);
ihdrbox_param_t * gene_ihdrbox(metadatalist_param_t *metadatalist,
Byte_t *jpipstream);
#endif /* !IHDRBOX_MANAGER_H_ */

View File

@ -32,7 +32,7 @@
# define IMGREG_MANAGER_H_
/** image region parameters */
typedef struct imgreg_param{
typedef struct imgreg_param {
int xosiz, yosiz; /** offset from the origin of the reference grid
at the decomposition level */
int fx, fy; /** frame size (fsiz) */
@ -53,7 +53,7 @@ typedef struct imgreg_param{
* @param[in] numOfreslev number of resolution levels
* @return structure of image region parameters
*/
imgreg_param_t map_viewin2imgreg( const int fx, const int fy,
imgreg_param_t map_viewin2imgreg(const int fx, const int fy,
const int rx, const int ry,
const int rw, const int rh,
const int XOsiz, const int YOsiz,
@ -76,7 +76,8 @@ imgreg_param_t map_viewin2imgreg( const int fx, const int fy,
* @param[in,out] xmax horizontal image size pointer
* @param[in,out] ymax vertical image size pointer
*/
void find_level( int maxlev, int *lev, int *fx, int *fy, int *xmin, int *ymin, int *xmax, int *ymax);
void find_level(int maxlev, int *lev, int *fx, int *fy, int *xmin, int *ymin,
int *xmax, int *ymax);
/**
* compute decomposition level (only to get the level
@ -88,14 +89,14 @@ void find_level( int maxlev, int *lev, int *fx, int *fy, int *xmin, int *ymin, i
* @param[in] Ysiz image height
* @return decomposition level
*/
int comp_decomplev( int fw, int fh, int Xsiz, int Ysiz);
int comp_decomplev(int fw, int fh, int Xsiz, int Ysiz);
/**
* print image region parameters
*
* @param[in] imgreg image region structure of parameters
*/
void print_imgreg( imgreg_param_t imgreg);
void print_imgreg(imgreg_param_t imgreg);
#endif /* !IMGREG_MANAGER_H_ */

View File

@ -36,7 +36,7 @@
#include "opj_includes.h"
#define NUM_OF_MSGTYPES 9
typedef enum eMSGTYPE{ JPIPSTREAM, PNMREQ, XMLREQ, TIDREQ, CIDREQ, CIDDST, SIZREQ, JP2SAVE, QUIT, MSGERROR} msgtype_t;
typedef enum eMSGTYPE { JPIPSTREAM, PNMREQ, XMLREQ, TIDREQ, CIDREQ, CIDDST, SIZREQ, JP2SAVE, QUIT, MSGERROR} msgtype_t;
/**
* indeitify client message type
@ -44,7 +44,7 @@ typedef enum eMSGTYPE{ JPIPSTREAM, PNMREQ, XMLREQ, TIDREQ, CIDREQ, CIDDST, SIZRE
* @param [in] connected_socket file descriptor of the connected socket
* @return message type
*/
msgtype_t identify_clientmsg( SOCKET connected_socket);
msgtype_t identify_clientmsg(SOCKET connected_socket);
/**
* receive a JPT- JPP- stream from client
@ -56,7 +56,8 @@ msgtype_t identify_clientmsg( SOCKET connected_socket);
* @param [out] streamlen length of the received codestream
* @return JPT- JPP- codestream
*/
Byte_t * receive_JPIPstream( SOCKET connected_socket, char **target, char **tid, char **cid, OPJ_SIZE_T *streamlen);
Byte_t * receive_JPIPstream(SOCKET connected_socket, char **target, char **tid,
char **cid, OPJ_SIZE_T *streamlen);
/**
* send PGM/PPM image stream to the client
@ -68,7 +69,8 @@ Byte_t * receive_JPIPstream( SOCKET connected_socket, char **target, char **tid,
* @param [in] numofcomp number of components of the image
* @param [in] maxval maximum value of the image (only 255 supported)
*/
void send_PNMstream( SOCKET connected_socket, Byte_t *pnmstream, unsigned int width, unsigned int height, unsigned int numofcomp, Byte_t maxval);
void send_PNMstream(SOCKET connected_socket, Byte_t *pnmstream,
unsigned int width, unsigned int height, unsigned int numofcomp, Byte_t maxval);
/**
* send XML data stream to the client
@ -77,7 +79,8 @@ void send_PNMstream( SOCKET connected_socket, Byte_t *pnmstream, unsigned int wi
* @param [in] xmlstream xml data stream
* @param [in] length legnth of the xml data stream
*/
void send_XMLstream( SOCKET connected_socket, Byte_t *xmlstream, OPJ_SIZE_T length);
void send_XMLstream(SOCKET connected_socket, Byte_t *xmlstream,
OPJ_SIZE_T length);
/**
* send TID data stream to the client
@ -86,7 +89,8 @@ void send_XMLstream( SOCKET connected_socket, Byte_t *xmlstream, OPJ_SIZE_T leng
* @param [in] tid tid string
* @param [in] tidlen legnth of the tid string
*/
void send_TIDstream( SOCKET connected_socket, const char *tid, OPJ_SIZE_T tidlen);
void send_TIDstream(SOCKET connected_socket, const char *tid,
OPJ_SIZE_T tidlen);
/**
* send CID data stream to the client
@ -95,7 +99,8 @@ void send_TIDstream( SOCKET connected_socket, const char *tid, OPJ_SIZE_T tidlen
* @param [in] cid cid string
* @param [in] cidlen legnth of the cid string
*/
void send_CIDstream( SOCKET connected_socket, const char *cid, OPJ_SIZE_T cidlen);
void send_CIDstream(SOCKET connected_socket, const char *cid,
OPJ_SIZE_T cidlen);
/**
* send SIZ data stream to the client
@ -104,7 +109,8 @@ void send_CIDstream( SOCKET connected_socket, const char *cid, OPJ_SIZE_T cidlen
* @param [in] width original width of the image
* @param [in] height original height of the image
*/
void send_SIZstream( SOCKET connected_socket, unsigned int width, unsigned int height);
void send_SIZstream(SOCKET connected_socket, unsigned int width,
unsigned int height);
/**
* send response signal to the client
@ -112,7 +118,7 @@ void send_SIZstream( SOCKET connected_socket, unsigned int width, unsigned int h
* @param [in] connected_socket file descriptor of the connected socket
* @param [in] succeed whether if the requested process succeeded
*/
void response_signal( SOCKET connected_socket, OPJ_BOOL succeed);
void response_signal(SOCKET connected_socket, OPJ_BOOL succeed);
#endif /* !IMGSOCK_MANAGER_H_ */

View File

@ -52,7 +52,7 @@ typedef enum porder {
#endif
/** A.5.1 Image and tile size (SIZ)*/
typedef struct SIZmarker_param{
typedef struct SIZmarker_param {
Byte2_t Lsiz; /**< length of marker segment excluding the marker*/
Byte2_t Rsiz; /**< capabilities that a decoder needs*/
Byte4_t Xsiz; /**< width of the reference grid*/
@ -72,7 +72,7 @@ typedef struct SIZmarker_param{
} SIZmarker_param_t;
/** A.6.1 Coding style default (COD)*/
typedef struct CODmarker_param{
typedef struct CODmarker_param {
Byte2_t Lcod; /**< length of marker segment excluding the marker*/
Byte_t Scod; /**< Coding style for all components*/
OPJ_PROG_ORDER prog_order; /**< progression order*/
@ -83,7 +83,7 @@ typedef struct CODmarker_param{
} CODmarker_param_t;
/** index parameters*/
typedef struct index_param{
typedef struct index_param {
metadatalist_param_t *metadatalist; /**< metadata-bin list*/
OPJ_OFF_T offset; /**< codestream offset*/
Byte8_t length; /**< codestream length */
@ -91,8 +91,10 @@ typedef struct index_param{
SIZmarker_param_t SIZ; /**< SIZ marker information*/
CODmarker_param_t COD; /**< COD marker information*/
faixbox_param_t *tilepart; /**< tile part information from tpix box*/
mhixbox_param_t **tileheader; /**< dynamic array of tile header information from thix box*/
faixbox_param_t **precpacket; /**< dynamic array of precint packet information from ppix box*/
mhixbox_param_t
**tileheader; /**< dynamic array of tile header information from thix box*/
faixbox_param_t
**precpacket; /**< dynamic array of precint packet information from ppix box*/
} index_param_t;
@ -103,46 +105,46 @@ typedef struct index_param{
* @param[in] fd file descriptor of the JP2 file
* @return pointer to the generated structure of index parameters
*/
index_param_t * parse_jp2file( int fd);
index_param_t * parse_jp2file(int fd);
/**
* print index parameters
*
* @param[in] index index parameters
*/
void print_index( index_param_t index);
void print_index(index_param_t index);
/**
* print Image and Tile SIZ parameters
*
* @param[in] SIZ SIZ marker information
*/
void print_SIZ( SIZmarker_param_t SIZ);
void print_SIZ(SIZmarker_param_t SIZ);
/**
* print Coding style default COD parameters
*
* @param[in] COD COD marker information
*/
void print_COD( CODmarker_param_t COD);
void print_COD(CODmarker_param_t COD);
/**
* delete index
*
* @param[in,out] index addressof the index pointer
*/
void delete_index( index_param_t **index);
void delete_index(index_param_t **index);
/**
* delete dynamic arrays in COD marker
*
* @param[in] COD COD marker information
*/
void delete_COD( CODmarker_param_t COD);
void delete_COD(CODmarker_param_t COD);
/** 1-dimensional range parameters*/
typedef struct range_param{
typedef struct range_param {
Byte4_t minvalue; /**< minimal value*/
Byte4_t maxvalue; /**< maximal value*/
} range_param_t;
@ -155,7 +157,8 @@ typedef struct range_param{
* @param[in] level decomposition level
* @return structured range parameter
*/
range_param_t get_tile_Xrange( SIZmarker_param_t SIZ, Byte4_t tile_id, int level);
range_param_t get_tile_Xrange(SIZmarker_param_t SIZ, Byte4_t tile_id,
int level);
/**
* get vertical range of the tile in reference grid
@ -165,7 +168,8 @@ range_param_t get_tile_Xrange( SIZmarker_param_t SIZ, Byte4_t tile_id, int level
* @param[in] level decomposition level
* @return structured range parameter
*/
range_param_t get_tile_Yrange( SIZmarker_param_t SIZ, Byte4_t tile_id, int level);
range_param_t get_tile_Yrange(SIZmarker_param_t SIZ, Byte4_t tile_id,
int level);
/**
@ -176,8 +180,8 @@ range_param_t get_tile_Yrange( SIZmarker_param_t SIZ, Byte4_t tile_id, int level
* @param[in] level decomposition level
* @return tile width
*/
Byte4_t get_tile_XSiz( SIZmarker_param_t SIZ, Byte4_t tile_id, int level);
Byte4_t get_tile_YSiz( SIZmarker_param_t SIZ, Byte4_t tile_id, int level);
Byte4_t get_tile_XSiz(SIZmarker_param_t SIZ, Byte4_t tile_id, int level);
Byte4_t get_tile_YSiz(SIZmarker_param_t SIZ, Byte4_t tile_id, int level);
/**
@ -186,6 +190,6 @@ Byte4_t get_tile_YSiz( SIZmarker_param_t SIZ, Byte4_t tile_id, int level);
* @param[in] index index parameters
* @return true if JPT-stream is feasible
*/
OPJ_BOOL isJPTfeasible( index_param_t index);
OPJ_BOOL isJPTfeasible(index_param_t index);
#endif /* !INDEX_MANAGER_H_ */

View File

@ -43,7 +43,8 @@
* @param[out] COD COD marker pointer
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL get_mainheader_from_j2kstream( Byte_t *j2kstream, SIZmarker_param_t *SIZ, CODmarker_param_t *COD);
OPJ_BOOL get_mainheader_from_j2kstream(Byte_t *j2kstream,
SIZmarker_param_t *SIZ, CODmarker_param_t *COD);
/**
* modify main header in j2k codestream to fit with the new number of decompositions
@ -55,7 +56,8 @@ OPJ_BOOL get_mainheader_from_j2kstream( Byte_t *j2kstream, SIZmarker_param_t *SI
* @param[out] j2klen pointer to the length of j2k code stream
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL modify_mainheader( Byte_t *j2kstream, int numOfdecomp, SIZmarker_param_t SIZ, CODmarker_param_t COD, Byte8_t *j2klen);
OPJ_BOOL modify_mainheader(Byte_t *j2kstream, int numOfdecomp,
SIZmarker_param_t SIZ, CODmarker_param_t COD, Byte8_t *j2klen);
/**
* modify tile header in j2k codestream to fit with the tile part length, and new number of decompositions for multi-componet images
@ -67,6 +69,7 @@ OPJ_BOOL modify_mainheader( Byte_t *j2kstream, int numOfdecomp, SIZmarker_param_
* @param[out] j2klen pointer to the length of j2k code stream
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL modify_tileheader( Byte_t *j2kstream, Byte8_t SOToffset, int numOfdecomp, Byte2_t Csiz, Byte8_t *j2klen);
OPJ_BOOL modify_tileheader(Byte_t *j2kstream, Byte8_t SOToffset,
int numOfdecomp, Byte2_t Csiz, Byte8_t *j2klen);
#endif /* !J2KHEADER_MANAGER_H_ */

View File

@ -34,6 +34,6 @@
#include "byte_manager.h"
#include "ihdrbox_manager.h"
Byte_t * j2k_to_pnm( const char *fn, ihdrbox_param_t **ihdrbox);
Byte_t * j2k_to_pnm(const char *fn, ihdrbox_param_t **ihdrbox);
#endif /* !JP2K_DECODER_H_ */

View File

@ -46,7 +46,8 @@
* @param[out] j2klen pointer to the j2k codestream length
* @return generated reconstructed j2k codestream
*/
Byte_t * recons_j2k( msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn, int fw, int fh, Byte8_t *j2klen);
Byte_t * recons_j2k(msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn,
int fw, int fh, Byte8_t *j2klen);
/**
@ -58,7 +59,8 @@ Byte_t * recons_j2k( msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn
* @param[out] jp2len pointer to the jp2 codestream length
* @return generated reconstructed jp2 codestream
*/
Byte_t * recons_jp2( msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn, Byte8_t *jp2len);
Byte_t * recons_jp2(msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn,
Byte8_t *jp2len);
/**
* reconstruct j2k codestream of mainheader from message queue
@ -69,6 +71,7 @@ Byte_t * recons_jp2( msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn
* @param[out] j2klen pointer to the j2k codestream length
* @return generated reconstructed j2k codestream
*/
Byte_t * recons_j2kmainhead( msgqueue_param_t *msgqueue, Byte_t *jpipstream, Byte8_t csn, Byte8_t *j2klen);
Byte_t * recons_j2kmainhead(msgqueue_param_t *msgqueue, Byte_t *jpipstream,
Byte8_t csn, Byte8_t *j2klen);
#endif /* !JP2K_ENCODER_H_ */

View File

@ -46,7 +46,8 @@
* @param[out] target address of target pointer
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL identify_target( query_param_t query_param, targetlist_param_t *targetlist, target_param_t **target);
OPJ_BOOL identify_target(query_param_t query_param,
targetlist_param_t *targetlist, target_param_t **target);
/**
* REQUEST: channel association
@ -58,7 +59,7 @@ OPJ_BOOL identify_target( query_param_t query_param, targetlist_param_t *targetl
* @param[out] curchannel address of the associated channel pointer
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL associate_channel( query_param_t query_param,
OPJ_BOOL associate_channel(query_param_t query_param,
sessionlist_param_t *sessionlist,
session_param_t **cursession,
channel_param_t **curchannel);
@ -73,7 +74,7 @@ OPJ_BOOL associate_channel( query_param_t query_param,
* @param[in,out] curchannel address of the associated/opened channel pointer
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL open_channel( query_param_t query_param,
OPJ_BOOL open_channel(query_param_t query_param,
sessionlist_param_t *sessionlist,
auxtrans_param_t auxtrans,
target_param_t *target,
@ -89,7 +90,7 @@ OPJ_BOOL open_channel( query_param_t query_param,
* @param[in,out] curchannel address of the deleting channel pointer
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL close_channel( query_param_t query_param,
OPJ_BOOL close_channel(query_param_t query_param,
sessionlist_param_t *sessionlist,
session_param_t **cursession,
channel_param_t **curchannel);
@ -104,7 +105,7 @@ OPJ_BOOL close_channel( query_param_t query_param,
* @param[out] msgqueue address of the message queue pointer
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL gene_JPIPstream( query_param_t query_param,
OPJ_BOOL gene_JPIPstream(query_param_t query_param,
target_param_t *target,
session_param_t *cursession,
channel_param_t *curchannel,

View File

@ -32,10 +32,13 @@
#include "msgqueue_manager.h"
#include "ihdrbox_manager.h"
Byte_t * update_JPIPstream( Byte_t *newstream, OPJ_SIZE_T newstreamlen, Byte_t *cache_stream, OPJ_SIZE_T *streamlen);
Byte_t * update_JPIPstream(Byte_t *newstream, OPJ_SIZE_T newstreamlen,
Byte_t *cache_stream, OPJ_SIZE_T *streamlen);
void save_codestream( Byte_t *codestream, OPJ_SIZE_T streamlen, const char *fmt);
void save_codestream(Byte_t *codestream, OPJ_SIZE_T streamlen, const char *fmt);
Byte_t * jpipstream_to_pnm( Byte_t *jpipstream, msgqueue_param_t *msgqueue, Byte8_t csn, int fw, int fh, ihdrbox_param_t **ihdrbox);
Byte_t * jpipstream_to_pnm(Byte_t *jpipstream, msgqueue_param_t *msgqueue,
Byte8_t csn, int fw, int fh, ihdrbox_param_t **ihdrbox);
ihdrbox_param_t * get_SIZ_from_jpipstream( Byte_t *jpipstream, msgqueue_param_t *msgqueue, Byte8_t csn);
ihdrbox_param_t * get_SIZ_from_jpipstream(Byte_t *jpipstream,
msgqueue_param_t *msgqueue, Byte8_t csn);

View File

@ -38,7 +38,7 @@
/** manifest box parameters*/
/** I.3.2.3 Manifest box*/
typedef struct manfbox_param{
typedef struct manfbox_param {
boxheader_param_t *first; /**< top of the box header list*/
} manfbox_param_t;
@ -49,7 +49,7 @@ typedef struct manfbox_param{
* @param[in] box pointer to the reference manf box
* @return generated manfbox
*/
manfbox_param_t * gene_manfbox( box_param_t *box);
manfbox_param_t * gene_manfbox(box_param_t *box);
/**
@ -57,7 +57,7 @@ manfbox_param_t * gene_manfbox( box_param_t *box);
*
* @param[in,out] manf addressof the manfbox pointer
*/
void delete_manfbox( manfbox_param_t **manf);
void delete_manfbox(manfbox_param_t **manf);
/**
@ -65,7 +65,7 @@ void delete_manfbox( manfbox_param_t **manf);
*
* @param[in] manf manf box pointer
*/
void print_manfbox( manfbox_param_t *manf);
void print_manfbox(manfbox_param_t *manf);
/**
@ -75,7 +75,7 @@ void print_manfbox( manfbox_param_t *manf);
* @param[in] manf manf box pointer
* @return found box pointer
*/
boxheader_param_t * search_boxheader( const char type[], manfbox_param_t *manf);
boxheader_param_t * search_boxheader(const char type[], manfbox_param_t *manf);
#endif /* !MANFBOX_MANAGER_H_ */

View File

@ -35,7 +35,7 @@
/** Marker parameters*/
typedef struct marker_param{
typedef struct marker_param {
codestream_param_t cs; /**< corresponding codestream*/
Byte2_t code; /**< marker code*/
OPJ_OFF_T offset; /**< offset relative to the start of the codestream ( including the length parameter but not the marker itself)*/
@ -52,7 +52,8 @@ typedef struct marker_param{
* @param[in] length marker segment length
* @return structure of generated marker parameters
*/
marker_param_t set_marker( codestream_param_t cs, Byte2_t code, OPJ_OFF_T offset, Byte2_t length);
marker_param_t set_marker(codestream_param_t cs, Byte2_t code, OPJ_OFF_T offset,
Byte2_t length);
/**
@ -62,7 +63,7 @@ marker_param_t set_marker( codestream_param_t cs, Byte2_t code, OPJ_OFF_T offset
* @param[in] offset start Byte position in marker
* @return fetched code
*/
Byte_t fetch_marker1byte( marker_param_t marker, OPJ_OFF_T offset);
Byte_t fetch_marker1byte(marker_param_t marker, OPJ_OFF_T offset);
/**
* fetch marker content 2-byte big endian Byte codes in file stream
@ -71,7 +72,7 @@ Byte_t fetch_marker1byte( marker_param_t marker, OPJ_OFF_T offset);
* @param[in] offset start Byte position in marker
* @return fetched code
*/
Byte2_t fetch_marker2bytebigendian( marker_param_t marker, OPJ_OFF_T offset);
Byte2_t fetch_marker2bytebigendian(marker_param_t marker, OPJ_OFF_T offset);
/**
* fetch marker content 4-byte big endian Byte codes in file stream
@ -80,7 +81,7 @@ Byte2_t fetch_marker2bytebigendian( marker_param_t marker, OPJ_OFF_T offset);
* @param[in] offset start Byte position in marker
* @return fetched code
*/
Byte4_t fetch_marker4bytebigendian( marker_param_t marker, OPJ_OFF_T offset);
Byte4_t fetch_marker4bytebigendian(marker_param_t marker, OPJ_OFF_T offset);
#endif /* !MARKER_MANAGER_H_ */

View File

@ -34,22 +34,24 @@
#include "box_manager.h"
#include "placeholder_manager.h"
typedef struct boxcontents_param{
typedef struct boxcontents_param {
OPJ_OFF_T offset; /**< byte position of the box contents in the file*/
Byte8_t length; /**< length of the box contents*/
} boxcontents_param_t;
/** metadata-bin parameters*/
typedef struct metadata_param{
typedef struct metadata_param {
Byte8_t idx; /**< index number*/
boxlist_param_t *boxlist; /**< box list*/
placeholderlist_param_t *placeholderlist; /**< placeholder box list*/
boxcontents_param_t *boxcontents; /**< box contens in case of no boxlist and placeholderlist*/
struct metadata_param *next; /**< pointer to the next metadata-bin*/
boxcontents_param_t
*boxcontents; /**< box contens in case of no boxlist and placeholderlist*/
struct metadata_param
*next; /**< pointer to the next metadata-bin*/
} metadata_param_t;
/** metadata-bin list parameters*/
typedef struct metadatalist_param{
typedef struct metadatalist_param {
metadata_param_t *first; /**< first metadata-bin pointer of the list*/
metadata_param_t *last; /**< last metadata-bin pointer of the list*/
} metadatalist_param_t;
@ -69,7 +71,7 @@ metadatalist_param_t * gene_metadatalist(void);
* @param[in] fd file descriptor
* @return pointer to the generated metadata-bin list
*/
metadatalist_param_t * const_metadatalist( int fd);
metadatalist_param_t * const_metadatalist(int fd);
/**
@ -77,7 +79,7 @@ metadatalist_param_t * const_metadatalist( int fd);
*
* @param[in,out] list address of the metadata list pointer
*/
void delete_metadatalist( metadatalist_param_t **list);
void delete_metadatalist(metadatalist_param_t **list);
/**
@ -89,35 +91,36 @@ void delete_metadatalist( metadatalist_param_t **list);
* @param[in] boxcontents boxcontents pointer
* @return pointer to the generated metadata bin
*/
metadata_param_t * gene_metadata( Byte8_t idx, boxlist_param_t *boxlist, placeholderlist_param_t *phldlist, boxcontents_param_t *boxcontents);
metadata_param_t * gene_metadata(Byte8_t idx, boxlist_param_t *boxlist,
placeholderlist_param_t *phldlist, boxcontents_param_t *boxcontents);
/**
* delete a metadata bin
*
* @param[in,out] metadata address of the deleting metadata bin pointer
*/
void delete_metadata( metadata_param_t **metadata);
void delete_metadata(metadata_param_t **metadata);
/**
* generate box contents
*
* @return pointer to the box contents
*/
boxcontents_param_t * gene_boxcontents( OPJ_OFF_T offset, OPJ_SIZE_T length);
boxcontents_param_t * gene_boxcontents(OPJ_OFF_T offset, OPJ_SIZE_T length);
/**
* print metadata-bin parameters
*
* @param[in] metadata metadata-bin pointer
*/
void print_metadata( metadata_param_t *metadata);
void print_metadata(metadata_param_t *metadata);
/**
* print all metadata parameters
*
* @param[in] list metadata list pointer
*/
void print_allmetadata( metadatalist_param_t *list);
void print_allmetadata(metadatalist_param_t *list);
/**
@ -127,7 +130,7 @@ void print_allmetadata( metadatalist_param_t *list);
* @param[in] list metadata-bin list pointer
* @return found metadata-bin pointer
*/
metadata_param_t * search_metadata( Byte8_t idx, metadatalist_param_t *list);
metadata_param_t * search_metadata(Byte8_t idx, metadatalist_param_t *list);
/**
@ -137,7 +140,7 @@ metadata_param_t * search_metadata( Byte8_t idx, metadatalist_param_t *list);
* @param[in] list metadata-bin list pointer
* @return found metadata-bin index, if not found, -1
*/
Byte8_t search_metadataidx( char boxtype[4], metadatalist_param_t *list);
Byte8_t search_metadataidx(char boxtype[4], metadatalist_param_t *list);
/**
@ -146,6 +149,7 @@ Byte8_t search_metadataidx( char boxtype[4], metadatalist_param_t *list);
* @param[in] metabin metadata-bin pointer
* @param[in] metadatalist metadata list pointer
*/
void insert_metadata_into_list( metadata_param_t *metabin, metadatalist_param_t *metadatalist);
void insert_metadata_into_list(metadata_param_t *metabin,
metadatalist_param_t *metadatalist);
#endif /* !METADATA_MANAGER_H_ */

View File

@ -35,7 +35,7 @@
#include "box_manager.h"
/** Marker index parameters*/
typedef struct markeridx_param{
typedef struct markeridx_param {
Byte2_t code; /**< marker code*/
Byte2_t num_remain; /**< remining number of the same marker index segments listed immediately*/
OPJ_OFF_T offset; /**< offset relative to the start of the*/
@ -49,7 +49,7 @@ typedef struct markeridx_param{
/** header index table box parameters*/
/** I.3.2.4.3 Header Index Table box*/
typedef struct mhixbox_param{
typedef struct mhixbox_param {
Byte8_t tlen; /**< length ( total length of the main*/
/**header or of the first tile-part header)*/
markeridx_param_t *first; /**< first marker index pointer of the list*/
@ -63,7 +63,7 @@ typedef struct mhixbox_param{
* @param[in] box pointer to the reference mhix box
* @return generated mhixbox pointer
*/
mhixbox_param_t * gene_mhixbox( box_param_t *box);
mhixbox_param_t * gene_mhixbox(box_param_t *box);
/**
@ -73,7 +73,7 @@ mhixbox_param_t * gene_mhixbox( box_param_t *box);
* @param[in] mhix mhix box pointer
* @return found marker index pointer
*/
markeridx_param_t * search_markeridx( Byte2_t code, mhixbox_param_t *mhix);
markeridx_param_t * search_markeridx(Byte2_t code, mhixbox_param_t *mhix);
/**
@ -81,7 +81,7 @@ markeridx_param_t * search_markeridx( Byte2_t code, mhixbox_param_t *mhix);
*
* @param[in] mhix mhix box pointer
*/
void print_mhixbox( mhixbox_param_t *mhix);
void print_mhixbox(mhixbox_param_t *mhix);
/**
@ -89,7 +89,7 @@ void print_mhixbox( mhixbox_param_t *mhix);
*
* @param[in] markeridx marker index pointer
*/
void print_markeridx( markeridx_param_t *markeridx);
void print_markeridx(markeridx_param_t *markeridx);
/**
@ -97,6 +97,6 @@ void print_markeridx( markeridx_param_t *markeridx);
*
* @param[in,out] mhix address of the mhix box pointer
*/
void delete_mhixbox( mhixbox_param_t **mhix);
void delete_mhixbox(mhixbox_param_t **mhix);
#endif /* !MHIXBOX_MANAGER_H_ */

View File

@ -45,8 +45,9 @@
#define METADATA_MSG 8
/** message parameters */
typedef struct message_param{
OPJ_BOOL last_byte; /**< if message contains the last byte of the data-bin*/
typedef struct message_param {
OPJ_BOOL
last_byte; /**< if message contains the last byte of the data-bin*/
Byte8_t in_class_id; /**< in-class identifier A.2.3*/
Byte8_t class_id; /**< class identifiers */
Byte8_t csn; /**< index of the codestream*/
@ -59,7 +60,7 @@ typedef struct message_param{
} message_param_t;
/** message queue parameters */
typedef struct msgqueue_param{
typedef struct msgqueue_param {
message_param_t *first; /**< first message pointer of the list*/
message_param_t *last; /**< last message pointer of the list*/
OPJ_BOOL stateless; /**< if this is a stateless message queue*/
@ -73,14 +74,15 @@ typedef struct msgqueue_param{
* @param[in] cachemodel cachemodel pointer
* @return generated message queue pointer
*/
msgqueue_param_t * gene_msgqueue( OPJ_BOOL stateless, cachemodel_param_t *cachemodel);
msgqueue_param_t * gene_msgqueue(OPJ_BOOL stateless,
cachemodel_param_t *cachemodel);
/**
* delete message queue
*
* @param[in] msgqueue address of the message queue pointer
*/
void delete_msgqueue( msgqueue_param_t **msgqueue);
void delete_msgqueue(msgqueue_param_t **msgqueue);
/**
* delete a message in msgqueue
@ -88,14 +90,15 @@ void delete_msgqueue( msgqueue_param_t **msgqueue);
* @param[in] message address of the deleting message pointer
* @param[in] msgqueue message queue pointer
*/
void delete_message_in_msgqueue( message_param_t **message, msgqueue_param_t *msgqueue);
void delete_message_in_msgqueue(message_param_t **message,
msgqueue_param_t *msgqueue);
/**
* print message queue
*
* @param[in] msgqueue message queue pointer
*/
void print_msgqueue( msgqueue_param_t *msgqueue);
void print_msgqueue(msgqueue_param_t *msgqueue);
/**
@ -103,7 +106,7 @@ void print_msgqueue( msgqueue_param_t *msgqueue);
*
* @param[in,out] msgqueue message queue pointer
*/
void enqueue_mainheader( msgqueue_param_t *msgqueue);
void enqueue_mainheader(msgqueue_param_t *msgqueue);
/**
* enqueue tile headers data-bin into message queue
@ -111,7 +114,7 @@ void enqueue_mainheader( msgqueue_param_t *msgqueue);
* @param[in] tile_id tile id starting from 0
* @param[in,out] msgqueue message queue pointer
*/
void enqueue_tileheader( int tile_id, msgqueue_param_t *msgqueue);
void enqueue_tileheader(int tile_id, msgqueue_param_t *msgqueue);
/**
* enqueue tile data-bin into message queue
@ -120,7 +123,7 @@ void enqueue_tileheader( int tile_id, msgqueue_param_t *msgqueue);
* @param[in] level decomposition level
* @param[in,out] msgqueue message queue pointer
*/
void enqueue_tile( Byte4_t tile_id, int level, msgqueue_param_t *msgqueue);
void enqueue_tile(Byte4_t tile_id, int level, msgqueue_param_t *msgqueue);
/**
* enqueue precinct data-bin into message queue
@ -131,7 +134,8 @@ void enqueue_tile( Byte4_t tile_id, int level, msgqueue_param_t *msgqueue);
* @param[in] layers num of layers
* @param[in,out] msgqueue message queue
*/
void enqueue_precinct( int seq_id, int tile_id, int comp_id, int layers, msgqueue_param_t *msgqueue);
void enqueue_precinct(int seq_id, int tile_id, int comp_id, int layers,
msgqueue_param_t *msgqueue);
/**
@ -140,7 +144,7 @@ void enqueue_precinct( int seq_id, int tile_id, int comp_id, int layers, msgqueu
* @param[in] meta_id metadata-bin id
* @param[in,out] msgqueue message queue pointer
*/
void enqueue_metadata( Byte8_t meta_id, msgqueue_param_t *msgqueue);
void enqueue_metadata(Byte8_t meta_id, msgqueue_param_t *msgqueue);
/**
@ -149,7 +153,7 @@ void enqueue_metadata( Byte8_t meta_id, msgqueue_param_t *msgqueue);
* @param[in] msgqueue message queue pointer
* @param[in] tmpfd file discriptor to write JPT/JPP-stream
*/
void recons_stream_from_msgqueue( msgqueue_param_t *msgqueue, int tmpfd);
void recons_stream_from_msgqueue(msgqueue_param_t *msgqueue, int tmpfd);
/**
@ -160,7 +164,8 @@ void recons_stream_from_msgqueue( msgqueue_param_t *msgqueue, int tmpfd);
* @param[in] offset offset of the stream from the whole beginning
* @param[in,out] msgqueue adding message queue pointer
*/
void parse_JPIPstream( Byte_t *JPIPstream, Byte8_t streamlen, OPJ_OFF_T offset, msgqueue_param_t *msgqueue);
void parse_JPIPstream(Byte_t *JPIPstream, Byte8_t streamlen, OPJ_OFF_T offset,
msgqueue_param_t *msgqueue);
/**
* parse JPT- JPP- stream to message queue
@ -170,7 +175,8 @@ void parse_JPIPstream( Byte_t *JPIPstream, Byte8_t streamlen, OPJ_OFF_T offset,
* @param[in] streamlen stream length
* @param[in] metadatalist adding metadata list pointer
*/
void parse_metamsg( msgqueue_param_t *msgqueue, Byte_t *stream, Byte8_t streamlen, metadatalist_param_t *metadatalist);
void parse_metamsg(msgqueue_param_t *msgqueue, Byte_t *stream,
Byte8_t streamlen, metadatalist_param_t *metadatalist);
/**
* compute precinct ID A.3.2.1
@ -182,6 +188,7 @@ void parse_metamsg( msgqueue_param_t *msgqueue, Byte_t *stream, Byte8_t streamle
* @param[in] num_tiles total number of tiles
* @return precicnt id
*/
Byte8_t comp_precinct_id( int t, int c, int s, int num_components, int num_tiles);
Byte8_t comp_precinct_id(int t, int c, int s, int num_components,
int num_tiles);
#endif /* !MSGQUEUE_MANAGER_H_ */

View File

@ -65,17 +65,17 @@
*==========================================================
*/
#ifdef SERVER
#ifdef SERVER
/** Server static records*/
typedef struct server_record{
typedef struct server_record {
sessionlist_param_t *sessionlist; /**< list of session records*/
targetlist_param_t *targetlist; /**< list of target records*/
auxtrans_param_t auxtrans;
} server_record_t;
/** Query/response data for each client*/
typedef struct QR{
typedef struct QR {
query_param_t *query; /**< query parameters*/
msgqueue_param_t *msgqueue; /**< message queue*/
channel_param_t *channel; /**< channel, (NULL if stateless)*/
@ -88,14 +88,14 @@ typedef struct QR{
* @param[in] udp_auxport opening udp auxiliary port ( 0 not to open, valid No. 49152-65535)
* @return intialized server record pointer
*/
server_record_t * init_JPIPserver( int tcp_auxport, int udp_auxport);
server_record_t * init_JPIPserver(int tcp_auxport, int udp_auxport);
/**
* Terminate the JPIP server
*
* @param[in] rec address of deleting server static record pointer
*/
void terminate_JPIPserver( server_record_t **rec);
void terminate_JPIPserver(server_record_t **rec);
/**
* 1st process per client request; parse query string
@ -103,7 +103,7 @@ void terminate_JPIPserver( server_record_t **rec);
* @param[in] query_string request query string
* @return initialized query/response data pointer
*/
QR_t * parse_querystring( const char *query_string);
QR_t * parse_querystring(const char *query_string);
/**
* 2nd process; process JPIP request and construct message queue
@ -112,7 +112,7 @@ QR_t * parse_querystring( const char *query_string);
* @param[in] qr query/response data pointer
* @return true if succeed, otherwise false
*/
OPJ_BOOL process_JPIPrequest( server_record_t *rec, QR_t *qr);
OPJ_BOOL process_JPIPrequest(server_record_t *rec, QR_t *qr);
/**
* 3rd process; send response data JPT/JPP-stream
@ -120,7 +120,7 @@ OPJ_BOOL process_JPIPrequest( server_record_t *rec, QR_t *qr);
* @param[in] rec server static record pointer
* @param[in] qr query/response data pointer
*/
void send_responsedata( server_record_t *rec, QR_t *qr);
void send_responsedata(server_record_t *rec, QR_t *qr);
/**
* 4th (last) process;
@ -128,7 +128,7 @@ void send_responsedata( server_record_t *rec, QR_t *qr);
* @param[in] rec server static record pinter
* @param[in] qr address of query/response data pointer
*/
void end_QRprocess( server_record_t *rec, QR_t **qr);
void end_QRprocess(server_record_t *rec, QR_t **qr);
/**
* Option for local tests; print out parameter values to logstream (stderr)
@ -140,7 +140,8 @@ void end_QRprocess( server_record_t *rec, QR_t **qr);
* @param[in] qr query/response data pointer
* @param[in] rec server static record pinter
*/
void local_log( OPJ_BOOL query, OPJ_BOOL messages, OPJ_BOOL sessions, OPJ_BOOL targets, QR_t *qr, server_record_t *rec);
void local_log(OPJ_BOOL query, OPJ_BOOL messages, OPJ_BOOL sessions,
OPJ_BOOL targets, QR_t *qr, server_record_t *rec);
#endif /*SERVER*/
@ -153,7 +154,7 @@ void local_log( OPJ_BOOL query, OPJ_BOOL messages, OPJ_BOOL sessions, OPJ_BOOL t
#ifndef SERVER
/** Decoding server static records*/
typedef struct dec_server_record{
typedef struct dec_server_record {
cachelist_param_t *cachelist; /**< cache list*/
Byte_t *jpipstream; /**< JPT/JPP stream*/
OPJ_SIZE_T jpipstreamlen; /**< length of jpipstream*/
@ -171,14 +172,14 @@ typedef SOCKET client_t;
* @param[in] port opening tcp port (valid No. 49152-65535)
* @return intialized decoding server record pointer
*/
OPJ_API dec_server_record_t * OPJ_CALLCONV init_dec_server( int port);
OPJ_API dec_server_record_t * OPJ_CALLCONV init_dec_server(int port);
/**
* Terminate the image decoding server
*
* @param[in] rec address of deleting decoding server static record pointer
*/
OPJ_API void OPJ_CALLCONV terminate_dec_server( dec_server_record_t **rec);
OPJ_API void OPJ_CALLCONV terminate_dec_server(dec_server_record_t **rec);
/**
* Accept client connection
@ -186,16 +187,17 @@ OPJ_API void OPJ_CALLCONV terminate_dec_server( dec_server_record_t **rec);
* @param[in] rec decoding server static record pointer
* @return client socket ID, -1 if failed
*/
OPJ_API client_t OPJ_CALLCONV accept_connection( dec_server_record_t *rec);
OPJ_API client_t OPJ_CALLCONV accept_connection(dec_server_record_t *rec);
/**
/**
* Handle client request
*
* @param[in] client client socket ID
* @param[in] rec decoding server static record pointer
* @return true if succeed
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV handle_clientreq( client_t client, dec_server_record_t *rec);
OPJ_API OPJ_BOOL OPJ_CALLCONV handle_clientreq(client_t client,
dec_server_record_t *rec);
#endif /*SERVER*/
@ -212,7 +214,7 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV handle_clientreq( client_t client, dec_server_reco
*/
/** JPIP decoding parameters*/
typedef struct jpip_dec_param{
typedef struct jpip_dec_param {
Byte_t *jpipstream; /**< JPT/JPP-stream*/
Byte8_t jpiplen; /**< length of jpipstream*/
msgqueue_param_t *msgqueue; /**< message queue*/
@ -228,14 +230,14 @@ typedef struct jpip_dec_param{
* @param[in] jp2 true in case of jp2 file encoding, else j2k file encoding
* @return JPIP decoding parameters pointer
*/
OPJ_API jpip_dec_param_t * OPJ_CALLCONV init_jpipdecoder( OPJ_BOOL jp2);
OPJ_API jpip_dec_param_t * OPJ_CALLCONV init_jpipdecoder(OPJ_BOOL jp2);
/**
* Destroy jpip decoding parameters
*
* @param[in] dec address of JPIP decoding parameters pointer
*/
OPJ_API void OPJ_CALLCONV destroy_jpipdecoder( jpip_dec_param_t **dec);
OPJ_API void OPJ_CALLCONV destroy_jpipdecoder(jpip_dec_param_t **dec);
/**
* Read jpip codestream from a file
@ -244,14 +246,15 @@ OPJ_API void OPJ_CALLCONV destroy_jpipdecoder( jpip_dec_param_t **dec);
* @param[in] dec JPIP decoding parameters pointer
* @return true if succeed
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV fread_jpip( const char fname[], jpip_dec_param_t *dec);
OPJ_API OPJ_BOOL OPJ_CALLCONV fread_jpip(const char fname[],
jpip_dec_param_t *dec);
/**
* Decode jpip codestream
*
* @param[in] dec JPIP decoding parameters pointer
*/
OPJ_API void OPJ_CALLCONV decode_jpip( jpip_dec_param_t *dec);
OPJ_API void OPJ_CALLCONV decode_jpip(jpip_dec_param_t *dec);
/**
* Write J2K/JP2 codestream to a file
@ -260,7 +263,8 @@ OPJ_API void OPJ_CALLCONV decode_jpip( jpip_dec_param_t *dec);
* @param[in] dec JPIP decoding parameters pointer
* @return true if succeed
*/
OPJ_API OPJ_BOOL OPJ_CALLCONV fwrite_jp2k( const char fname[], jpip_dec_param_t *dec);
OPJ_API OPJ_BOOL OPJ_CALLCONV fwrite_jp2k(const char fname[],
jpip_dec_param_t *dec);
/**
* Option; print out parameter values to stderr
@ -270,7 +274,8 @@ OPJ_API OPJ_BOOL OPJ_CALLCONV fwrite_jp2k( const char fname[], jpip_dec_param_t
* @param[in] ihdrbox true if image header data is to be printed out
* @param[in] dec JPIP decoding parameters pointer
*/
OPJ_API void OPJ_CALLCONV output_log( OPJ_BOOL messages, OPJ_BOOL metadata, OPJ_BOOL ihdrbox, jpip_dec_param_t *dec);
OPJ_API void OPJ_CALLCONV output_log(OPJ_BOOL messages, OPJ_BOOL metadata,
OPJ_BOOL ihdrbox, jpip_dec_param_t *dec);
/*
* test the format of index (cidx) box in JP2 file
@ -285,14 +290,14 @@ typedef index_param_t index_t;
* @param[in] fd file descriptor of the JP2 file
* @return pointer to the generated structure of index parameters
*/
OPJ_API index_t * OPJ_CALLCONV get_index_from_JP2file( int fd);
OPJ_API index_t * OPJ_CALLCONV get_index_from_JP2file(int fd);
/**
* Destroy index parameters
*
* @param[in,out] idx addressof the index pointer
*/
OPJ_API void OPJ_CALLCONV destroy_index( index_t **idx);
OPJ_API void OPJ_CALLCONV destroy_index(index_t **idx);
/**
@ -300,7 +305,7 @@ OPJ_API void OPJ_CALLCONV destroy_index( index_t **idx);
*
* @param[in] index index parameters
*/
OPJ_API void OPJ_CALLCONV output_index( index_t *index);
OPJ_API void OPJ_CALLCONV output_index(index_t *index);
#endif /*SERVER*/

View File

@ -36,7 +36,7 @@
/** A.3.6.3 Placeholder box format*/
/** placeholder box parameters*/
typedef struct placeholder_param{
typedef struct placeholder_param {
Byte4_t LBox;
char TBox[4];
Byte4_t Flags;
@ -55,7 +55,7 @@ typedef struct placeholder_param{
/** placeholder box list parameters*/
typedef struct placeholderlist_param{
typedef struct placeholderlist_param {
placeholder_param_t *first; /**< first placeholder pointer of the list*/
placeholder_param_t *last; /**< last placeholder pointer of the list*/
} placeholderlist_param_t;
@ -74,7 +74,7 @@ placeholderlist_param_t * gene_placeholderlist(void);
*
* @param[in,out] list address of the placeholder list pointer
*/
void delete_placeholderlist( placeholderlist_param_t **list);
void delete_placeholderlist(placeholderlist_param_t **list);
/**
@ -84,7 +84,7 @@ void delete_placeholderlist( placeholderlist_param_t **list);
* @param[in] origID metadata-bin ID of the bin containing the contents of the original box
* @return pointer to the generated placeholder
*/
placeholder_param_t * gene_placeholder( box_param_t *box, Byte8_t origID);
placeholder_param_t * gene_placeholder(box_param_t *box, Byte8_t origID);
/**
@ -92,9 +92,10 @@ placeholder_param_t * gene_placeholder( box_param_t *box, Byte8_t origID);
*
* @param[in,out] placeholder address of the placeholder pointer
*/
void delete_placeholder( placeholder_param_t **placeholder);
void delete_placeholder(placeholder_param_t **placeholder);
void insert_placeholder_into_list( placeholder_param_t *phld, placeholderlist_param_t *phldlist);
void insert_placeholder_into_list(placeholder_param_t *phld,
placeholderlist_param_t *phldlist);
/**
@ -102,7 +103,7 @@ void insert_placeholder_into_list( placeholder_param_t *phld, placeholderlist_pa
*
* @param[in] phld placeholder pointer
*/
void print_placeholder( placeholder_param_t *phld);
void print_placeholder(placeholder_param_t *phld);
/**
@ -110,6 +111,6 @@ void print_placeholder( placeholder_param_t *phld);
*
* @param[in] list placeholder list pointer
*/
void print_allplaceholder( placeholderlist_param_t *list);
void print_allplaceholder(placeholderlist_param_t *list);
#endif /* !PLACEHOLDER_MANAGER_H_ */

View File

@ -41,10 +41,10 @@
typedef enum cnew_transport { non, http, tcp, udp} cnew_transport_t;
/** image return type */
typedef enum image_return { JPPstream, JPTstream, UNKNOWN=-1} image_return_t;
typedef enum image_return { JPPstream, JPTstream, UNKNOWN = -1} image_return_t;
/** Query parameters */
typedef struct query_param{
typedef struct query_param {
char *target; /**< target name */
char *tid; /**< target identifier */
int fx, fy; /**< frame size (fx,fy) */
@ -53,7 +53,8 @@ typedef struct query_param{
int lastcomp; /**< last component number */
OPJ_BOOL *comps; /**< components (dynamic array) for jpp-stream, null means all components */
char *cid; /**< channel identifier */
cnew_transport_t cnew; /**< transport name if there is new channel request, else non */
cnew_transport_t
cnew; /**< transport name if there is new channel request, else non */
char *cclose; /**< list of closing channel identifiers, separated by '\\0' */
int numOfcclose; /**< number of closing channels */
char box_type[MAX_NUMOFBOX][4]; /**< interested box-types */
@ -77,14 +78,14 @@ typedef struct query_param{
* @param[in] query_string request query string
* @return pointer to query parameters
*/
query_param_t * parse_query( const char *query_string);
query_param_t * parse_query(const char *query_string);
/**
* print query parameters
*
* @param[in] query_param query parameters
*/
void print_queryparam( query_param_t query_param);
void print_queryparam(query_param_t query_param);
/**
@ -92,6 +93,6 @@ void print_queryparam( query_param_t query_param);
*
* @param[in] query address of the deleting query pointer
*/
void delete_query( query_param_t **query);
void delete_query(query_param_t **query);
#endif /* !QUERY_PARSER_H_ */

View File

@ -35,14 +35,14 @@
#include "cachemodel_manager.h"
/** Session parameters*/
typedef struct session_param{
typedef struct session_param {
channellist_param_t *channellist; /**< channel list pointer*/
cachemodellist_param_t *cachemodellist; /**< cache list pointer*/
struct session_param *next; /**< pointer to the next session*/
} session_param_t;
/** Session list parameters*/
typedef struct sessionlist_param{
typedef struct sessionlist_param {
session_param_t *first; /**< first session pointer of the list*/
session_param_t *last; /**< last session pointer of the list*/
} sessionlist_param_t;
@ -62,7 +62,7 @@ sessionlist_param_t * gene_sessionlist(void);
* @param[in] sessionlist session list to insert the new session
* @return pointer to the generated session
*/
session_param_t * gene_session( sessionlist_param_t *sessionlist);
session_param_t * gene_session(sessionlist_param_t *sessionlist);
/**
* search a channel and its belonging session by channel ID
@ -73,7 +73,7 @@ session_param_t * gene_session( sessionlist_param_t *sessionlist);
* @param[in,out] foundchannel address of the found channel pointer
* @return if the channel is found (true) or not (false)
*/
OPJ_BOOL search_session_and_channel( char cid[],
OPJ_BOOL search_session_and_channel(char cid[],
sessionlist_param_t *sessionlist,
session_param_t **foundsession,
channel_param_t **foundchannel);
@ -84,7 +84,8 @@ OPJ_BOOL search_session_and_channel( char cid[],
* @param[in] session session pointer
* @param[in] cachemodel cachemodel pointer
*/
void insert_cachemodel_into_session( session_param_t *session, cachemodel_param_t *cachemodel);
void insert_cachemodel_into_session(session_param_t *session,
cachemodel_param_t *cachemodel);
/**
@ -94,7 +95,8 @@ void insert_cachemodel_into_session( session_param_t *session, cachemodel_param_
* @param[in] sessionlist session list pointer
* @return if succeeded (true) or failed (false)
*/
OPJ_BOOL delete_session( session_param_t **session, sessionlist_param_t *sessionlist);
OPJ_BOOL delete_session(session_param_t **session,
sessionlist_param_t *sessionlist);
/**
@ -102,14 +104,14 @@ OPJ_BOOL delete_session( session_param_t **session, sessionlist_param_t *session
*
* @param[in,out] sessionlist address of the session list pointer
*/
void delete_sessionlist( sessionlist_param_t **sessionlist);
void delete_sessionlist(sessionlist_param_t **sessionlist);
/**
* print all sessions
*
* @param[in] sessionlist session list pointer
*/
void print_allsession( sessionlist_param_t *sessionlist);
void print_allsession(sessionlist_param_t *sessionlist);
#endif /* !SESSION_MANAGER_H_ */

View File

@ -48,7 +48,7 @@ typedef int SOCKET;
* @param port opening port number
* @return new socket
*/
SOCKET open_listeningsocket( uint16_t port);
SOCKET open_listeningsocket(uint16_t port);
/**
* accept a new connection to the listenning socket
@ -56,7 +56,7 @@ SOCKET open_listeningsocket( uint16_t port);
* @param listening_socket listenning socket
* @return connected socket (-1 if error occurs)
*/
SOCKET accept_socket( SOCKET listening_socket);
SOCKET accept_socket(SOCKET listening_socket);
/**
@ -74,7 +74,7 @@ OPJ_SIZE_T receive_line(SOCKET connected_socket, char *buf);
* @param [in] connected_socket file descriptor of the connected socket
* @return pointer to the string (memory allocated)
*/
char * receive_string( SOCKET connected_socket);
char * receive_string(SOCKET connected_socket);
/**
* receive data stream to client
@ -83,7 +83,7 @@ char * receive_string( SOCKET connected_socket);
* @param [in] length length of the receiving stream
* @return pointer to the data stream (memory allocated), NULL if failed
*/
void * receive_stream( SOCKET connected_socket, OPJ_SIZE_T length);
void * receive_stream(SOCKET connected_socket, OPJ_SIZE_T length);
/**
* send data stream to client
@ -92,7 +92,8 @@ void * receive_stream( SOCKET connected_socket, OPJ_SIZE_T length);
* @param [in] stream data stream
* @param [in] length length of data stream
*/
void send_stream( SOCKET connected_socket, const void *stream, OPJ_SIZE_T length);
void send_stream(SOCKET connected_socket, const void *stream,
OPJ_SIZE_T length);
/**
* close socket
@ -100,6 +101,6 @@ void send_stream( SOCKET connected_socket, const void *stream, OPJ_SIZE_T length
* @param [in] sock closing socket
* @return 0 if succeed, -1 if failed
*/
int close_socket( SOCKET sock);
int close_socket(SOCKET sock);
#endif /* !SOCK_MANAGER_H_ */

View File

@ -37,7 +37,7 @@
#define MAX_LENOFTID 30
/** target parameters*/
typedef struct target_param{
typedef struct target_param {
char tid[MAX_LENOFTID]; /**< target identifier*/
char *targetname; /**< local file path or URL ( URL is suported only with SERVER mode)*/
int fd; /**< file descriptor*/
@ -45,16 +45,18 @@ typedef struct target_param{
char *tmpfname; /**< temporal file name to download a remote target file*/
#endif
int csn; /**< codestream number */
index_param_t *codeidx; /**< index information of codestream */
index_param_t
*codeidx; /**< index information of codestream */
int num_of_use; /**< numbers of sessions referring to this target */
OPJ_BOOL jppstream; /**< if this target can return JPP-stream */
OPJ_BOOL jptstream; /**< if this target can return JPP-stream */
struct target_param *next; /**< pointer to the next target */
struct target_param
*next; /**< pointer to the next target */
} target_param_t;
/** Target list parameters*/
typedef struct targetlist_param{
typedef struct targetlist_param {
target_param_t *first; /**< first target pointer of the list*/
target_param_t *last; /**< last target pointer of the list*/
} targetlist_param_t;
@ -76,7 +78,7 @@ targetlist_param_t * gene_targetlist(void);
* @param[in] targetpath file path or URL of the target
* @return pointer to the generated target
*/
target_param_t * gene_target( targetlist_param_t *targetlist, char *targetpath);
target_param_t * gene_target(targetlist_param_t *targetlist, char *targetpath);
/**
@ -85,7 +87,7 @@ target_param_t * gene_target( targetlist_param_t *targetlist, char *targetpath);
* @param[in] reftarget reference target pointer
* @param[out] ptr address of feeding target pointer
*/
void refer_target( target_param_t *reftarget, target_param_t **ptr);
void refer_target(target_param_t *reftarget, target_param_t **ptr);
/**
@ -93,14 +95,14 @@ void refer_target( target_param_t *reftarget, target_param_t **ptr);
*
* @param[in] target reference pointer to the target
*/
void unrefer_target( target_param_t *target);
void unrefer_target(target_param_t *target);
/**
* delete a target
*
* @param[in,out] target address of the deleting target pointer
*/
void delete_target( target_param_t **target);
void delete_target(target_param_t **target);
/**
@ -109,7 +111,8 @@ void delete_target( target_param_t **target);
* @param[in,out] target address of the deleting target pointer
* @param[in] targetlist target list pointer
*/
void delete_target_in_list( target_param_t **target, targetlist_param_t *targetlist);
void delete_target_in_list(target_param_t **target,
targetlist_param_t *targetlist);
/**
@ -125,14 +128,14 @@ void delete_targetlist(targetlist_param_t **targetlist);
*
* @param[in] target target pointer
*/
void print_target( target_param_t *target);
void print_target(target_param_t *target);
/**
* print all target parameters
*
* @param[in] targetlist target list pointer
*/
void print_alltarget( targetlist_param_t *targetlist);
void print_alltarget(targetlist_param_t *targetlist);
/**
@ -142,7 +145,8 @@ void print_alltarget( targetlist_param_t *targetlist);
* @param[in] targetlist target list pointer
* @return found target pointer
*/
target_param_t * search_target( const char targetname[], targetlist_param_t *targetlist);
target_param_t * search_target(const char targetname[],
targetlist_param_t *targetlist);
/**
@ -152,7 +156,8 @@ target_param_t * search_target( const char targetname[], targetlist_param_t *tar
* @param[in] targetlist target list pointer
* @return found target pointer
*/
target_param_t * search_targetBytid( const char tid[], targetlist_param_t *targetlist);
target_param_t * search_targetBytid(const char tid[],
targetlist_param_t *targetlist);
#endif /* !TARGET_MANAGER_H_ */

View File

@ -287,7 +287,8 @@ void j2k_read_red(opj_j2k_t *j2k);
@param post_len length of post-protected data
@return returns the freshly created EPB
*/
jpwl_epb_ms_t *jpwl_epb_create(opj_j2k_t *j2k, opj_bool latest, opj_bool packed, int tileno, int idx, int hprot,
jpwl_epb_ms_t *jpwl_epb_create(opj_j2k_t *j2k, opj_bool latest, opj_bool packed,
int tileno, int idx, int hprot,
unsigned long int pre_len, unsigned long int post_len);
/** add a number of EPB marker segments
@ -334,14 +335,18 @@ int jpwl_esds_add(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int *jwmarker_num,
@param jwmarker_num number of JPWL markers
@return returns true in case of success
*/
opj_bool jpwl_update_info(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int jwmarker_num);
opj_bool jpwl_update_info(opj_j2k_t *j2k, jpwl_marker_t *jwmarker,
int jwmarker_num);
opj_bool jpwl_esd_fill(opj_j2k_t *j2k, jpwl_esd_ms_t *esdmark, unsigned char *buf);
opj_bool jpwl_esd_fill(opj_j2k_t *j2k, jpwl_esd_ms_t *esdmark,
unsigned char *buf);
opj_bool jpwl_epb_fill(opj_j2k_t *j2k, jpwl_epb_ms_t *epbmark, unsigned char *buf, unsigned char *post_buf);
opj_bool jpwl_epb_fill(opj_j2k_t *j2k, jpwl_epb_ms_t *epbmark,
unsigned char *buf, unsigned char *post_buf);
opj_bool j2k_add_marker(opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len);
opj_bool j2k_add_marker(opj_codestream_info_t *cstr_info,
unsigned short int type, int pos, int len);
/** corrects the data in the JPWL codestream
@param j2k J2K compressor handle
@ -359,7 +364,8 @@ opj_bool jpwl_correct(opj_j2k_t *j2k);
@param L4_bufp is a pointer to the buffer pointer of redundancy data
@return returns true if correction could be successfully performed
*/
opj_bool jpwl_epb_correct(opj_j2k_t *j2k, unsigned char *buffer, int type, int pre_len, int post_len, int *conn,
opj_bool jpwl_epb_correct(opj_j2k_t *j2k, unsigned char *buffer, int type,
int pre_len, int post_len, int *conn,
unsigned char **L4_bufp);
/** check that a tile and its children have valid data

View File

@ -76,7 +76,8 @@ Write some bytes
@param n Number of bytes to write
@return Returns the number of bytes written or 0 if an error occurred
*/
OPJ_API unsigned int OPJ_CALLCONV cio_write(opj_cio_t *cio, unsigned int64 v, int n);
OPJ_API unsigned int OPJ_CALLCONV cio_write(opj_cio_t *cio, unsigned int64 v,
int n);
/**
Read some bytes
@param cio CIO handle

View File

@ -54,7 +54,8 @@ Write formatted data to a string and send the string to a user callback.
@param fmt Format-control string (plus optionnal arguments)
@return Returns true if successful, returns false otherwise
*/
opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...);
opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt,
...);
/* ----------------------------------------------------------------------- */
/*@}*/

View File

@ -59,10 +59,11 @@ Multiply two fixed-precision rational numbers.
@param b
@return Returns a * b
*/
static INLINE int fix_mul(int a, int b) {
static INLINE int fix_mul(int a, int b)
{
int64 temp = (int64) a * (int64) b ;
temp += temp & 4096;
return (int) (temp >> 13) ;
return (int)(temp >> 13) ;
}
/*@}*/

View File

@ -53,14 +53,16 @@ The functions in INT.H have for goal to realize operations on integers.
Get the minimum of two integers
@return Returns a if a < b else b
*/
static INLINE int int_min(int a, int b) {
static INLINE int int_min(int a, int b)
{
return a < b ? a : b;
}
/**
Get the maximum of two integers
@return Returns a if a > b else b
*/
static INLINE int int_max(int a, int b) {
static INLINE int int_max(int a, int b)
{
return (a > b) ? a : b;
}
/**
@ -72,45 +74,53 @@ Clamp an integer inside an interval
<li>Returns min if (a < min)
</ul>
*/
static INLINE int int_clamp(int a, int min, int max) {
if (a < min)
static INLINE int int_clamp(int a, int min, int max)
{
if (a < min) {
return min;
if (a > max)
}
if (a > max) {
return max;
}
return a;
}
/**
@return Get absolute value of integer
*/
static INLINE int int_abs(int a) {
static INLINE int int_abs(int a)
{
return a < 0 ? -a : a;
}
/**
Divide an integer and round upwards
@return Returns a divided by b
*/
static INLINE int int_ceildiv(int a, int b) {
static INLINE int int_ceildiv(int a, int b)
{
return (a + b - 1) / b;
}
/**
Divide an integer by a power of 2 and round upwards
@return Returns a divided by 2^b
*/
static INLINE int int_ceildivpow2(int a, int b) {
static INLINE int int_ceildivpow2(int a, int b)
{
return (a + (1 << b) - 1) >> b;
}
/**
Divide an integer by a power of 2 and round downwards
@return Returns a divided by 2^b
*/
static INLINE int int_floordivpow2(int a, int b) {
static INLINE int int_floordivpow2(int a, int b)
{
return a >> b;
}
/**
Get logarithm of an integer and round downwards
@return Returns log2(a)
*/
static INLINE int int_floorlog2(int a) {
static INLINE int int_floorlog2(int a)
{
int l;
for (l = 0; a > 1; l++) {
a >>= 1;

View File

@ -122,7 +122,7 @@ T2 encoding mode
typedef enum T2_MODE {
THRESH_CALC = 0, /** Function called in Rate allocation process*/
FINAL_PASS = 1 /** Function called in Tier 2 process*/
}J2K_T2_MODE;
} J2K_T2_MODE;
/**
Quantization stepsize
@ -268,7 +268,7 @@ typedef struct opj_cp {
opj_tcp_t *tcps;
/** fixed layer */
int *matrice;
/* UniPG>> */
/* UniPG>> */
#ifdef USE_JPWL
/** enables writing of EPC in MH, thus activating JPWL */
opj_bool epc_on;
@ -311,7 +311,7 @@ typedef struct opj_cp {
/** maximum number of tiles at the decoder */
int max_tiles;
#endif /* USE_JPWL */
/* <<UniPG */
/* <<UniPG */
} opj_cp_t;
/**
@ -402,7 +402,8 @@ Decode an image from a JPEG-2000 codestream
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio,
opj_codestream_info_t *cstr_info);
/**
Decode an image form a JPT-stream (JPEG 2000, JPIP)
@param j2k J2K decompressor handle
@ -410,7 +411,8 @@ Decode an image form a JPT-stream (JPEG 2000, JPIP)
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
opj_image_t* j2k_decode_jpt_stream(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
opj_image_t* j2k_decode_jpt_stream(opj_j2k_t *j2k, opj_cio_t *cio,
opj_codestream_info_t *cstr_info);
/**
Creates a J2K compression structure
@param cinfo Codec context info
@ -429,7 +431,8 @@ Coding parameters are returned in j2k->cp.
@param parameters compression parameters
@param image input filled image
*/
void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_t *image);
void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters,
opj_image_t *image);
/**
Converts an enum type progression order to string type
*/
@ -442,7 +445,8 @@ Encode an image into a JPEG-2000 codestream
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
opj_bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
opj_bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image,
opj_codestream_info_t *cstr_info);
/* ----------------------------------------------------------------------- */
/*@}*/

View File

@ -60,16 +60,14 @@
/**
Channel description: channel index, type, association
*/
typedef struct opj_jp2_cdef_info
{
typedef struct opj_jp2_cdef_info {
unsigned short cn, typ, asoc;
} opj_jp2_cdef_info_t;
/**
Channel descriptions and number of descriptions
*/
typedef struct opj_jp2_cdef
{
typedef struct opj_jp2_cdef {
opj_jp2_cdef_info_t *info;
unsigned short n;
} opj_jp2_cdef_t;
@ -77,8 +75,7 @@ typedef struct opj_jp2_cdef
/**
Component mappings: channel index, mapping type, palette index
*/
typedef struct opj_jp2_cmap_comp
{
typedef struct opj_jp2_cmap_comp {
unsigned short cmp;
unsigned char mtyp, pcol;
} opj_jp2_cmap_comp_t;
@ -86,8 +83,7 @@ typedef struct opj_jp2_cmap_comp
/**
Palette data: table entries, palette columns
*/
typedef struct opj_jp2_pclr
{
typedef struct opj_jp2_pclr {
unsigned int *entries;
unsigned char *channel_sign;
unsigned char *channel_size;
@ -98,8 +94,7 @@ typedef struct opj_jp2_pclr
/**
Collector for ICC profile, palette, component mapping, channel description
*/
typedef struct opj_jp2_color
{
typedef struct opj_jp2_color {
unsigned char *icc_profile_buf;
int icc_profile_len;
@ -197,7 +192,8 @@ Decode an image from a JPEG-2000 file stream
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
opj_image_t* opj_jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
opj_image_t* opj_jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio,
opj_codestream_info_t *cstr_info);
/**
Creates a JP2 compression structure
@param cinfo Codec context info
@ -216,7 +212,8 @@ Coding parameters are returned in jp2->j2k->cp.
@param parameters compression parameters
@param image input filled image
*/
void jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters, opj_image_t *image);
void jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters,
opj_image_t *image);
/**
Encode an image into a JPEG-2000 file stream
@param jp2 JP2 compressor handle
@ -225,7 +222,8 @@ Encode an image into a JPEG-2000 file stream
@param cstr_info Codestream information structure if required, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
opj_bool opj_jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
opj_bool opj_jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image,
opj_codestream_info_t *cstr_info);
/* ----------------------------------------------------------------------- */
/*@}*/

View File

@ -75,6 +75,7 @@ Read the message header for a JPP/JPT - stream
@param cio CIO handle
@param header Message header structure
*/
void jpt_read_msg_header(opj_common_ptr cinfo, opj_cio_t *cio, opj_jpt_msg_header_t *header);
void jpt_read_msg_header(opj_common_ptr cinfo, opj_cio_t *cio,
opj_jpt_msg_header_t *header);
#endif

View File

@ -329,7 +329,8 @@ Decoding parameters are returned in mj2->j2k->cp.
@param movie MJ2 decompressor handle
@param mj2_parameters decompression parameters
*/
OPJ_API void OPJ_CALLCONV mj2_setup_decoder(opj_mj2_t *movie, mj2_dparameters_t *mj2_parameters);
OPJ_API void OPJ_CALLCONV mj2_setup_decoder(opj_mj2_t *movie,
mj2_dparameters_t *mj2_parameters);
/**
Decode an image from a JPEG-2000 file stream
@param movie MJ2 decompressor handle
@ -353,7 +354,8 @@ Coding parameters are returned in mj2->j2k->cp.
@param movie MJ2 compressor handle
@param parameters compression parameters
*/
OPJ_API void OPJ_CALLCONV mj2_setup_encoder(opj_mj2_t *movie, mj2_cparameters_t *parameters);
OPJ_API void OPJ_CALLCONV mj2_setup_encoder(opj_mj2_t *movie,
mj2_cparameters_t *parameters);
/**
Encode an image into a JPEG-2000 file stream
@param movie MJ2 compressor handle
@ -362,7 +364,8 @@ Encode an image into a JPEG-2000 file stream
@param index Name of the index file if required, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
opj_bool mj2_encode(opj_mj2_t *movie, opj_cio_t *cio, opj_image_t *image, char *index);
opj_bool mj2_encode(opj_mj2_t *movie, opj_cio_t *cio, opj_image_t *image,
char *index);
/**
Init a Standard MJ2 movie

View File

@ -35,9 +35,11 @@ OPJ_API int OPJ_CALLCONV imagetoyuv(opj_image_t * img, char *outfile);
OPJ_API int OPJ_CALLCONV imagetobmp(opj_image_t * img, char *outfile);
OPJ_API opj_image_t * OPJ_CALLCONV mj2_image_create(mj2_tk_t * tk, opj_cparameters_t *parameters);
OPJ_API opj_image_t * OPJ_CALLCONV mj2_image_create(mj2_tk_t * tk,
opj_cparameters_t *parameters);
OPJ_API char OPJ_CALLCONV yuvtoimage(mj2_tk_t * tk, opj_image_t * img, int frame_num, opj_cparameters_t *parameters, char* infile);
OPJ_API char OPJ_CALLCONV yuvtoimage(mj2_tk_t * tk, opj_image_t * img,
int frame_num, opj_cparameters_t *parameters, char* infile);
OPJ_API unsigned int OPJ_CALLCONV yuv_num_frames(mj2_tk_t * tk, char *infile);

View File

@ -1,41 +1,41 @@
/*
* 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
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* 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
* Copyright (c) 2003-2014, Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef OPENJPEG_H
#define OPENJPEG_H
@ -122,7 +122,7 @@ typedef enum CINEMA_MODE {
CINEMA2K_24 = 1, /** 2K Digital Cinema at 24 fps*/
CINEMA2K_48 = 2, /** 2K Digital Cinema at 48 fps*/
CINEMA4K_24 = 3 /** 4K Digital Cinema at 24 fps*/
}OPJ_CINEMA_MODE;
} OPJ_CINEMA_MODE;
/**
Progression order
@ -181,7 +181,7 @@ Callback function prototype for events
@param msg Event message
@param client_data
*/
typedef void (*opj_msg_callback) (const char *msg, void *client_data);
typedef void (*opj_msg_callback)(const char *msg, void *client_data);
/**
Message handler object
@ -219,21 +219,21 @@ typedef struct opj_poc {
/** Layer num start,Precinct num start, Precinct num end */
int layno0, precno0, precno1;
/** Progression order enum*/
OPJ_PROG_ORDER prg1,prg;
OPJ_PROG_ORDER prg1, prg;
/** Progression order string*/
char progorder[5];
/** Tile number */
int tile;
/** Start and end values for Tile width and height*/
int tx0,tx1,ty0,ty1;
int tx0, tx1, ty0, ty1;
/** Start value, initialised in pi_initialise_encode*/
int layS, resS, compS, prcS;
/** End value, initialised in pi_initialise_encode */
int layE, resE, compE, prcE;
/** Start and end values of Tile width and height, initialised in pi_initialise_encode*/
int txS,txE,tyS,tyE,dx,dy;
int txS, txE, tyS, tyE, dx, dy;
/** Temporary values for Tile parts, initialised in pi_create_encode */
int lay_t, res_t, comp_t, prc_t,tx0_t,ty0_t;
int lay_t, res_t, comp_t, prc_t, tx0_t, ty0_t;
} opj_poc_t;
/**
@ -319,7 +319,7 @@ typedef struct opj_cparameters {
int cod_format;
/*@}*/
/* UniPG>> */
/* UniPG>> */
/**@name JPWL encoding parameters */
/*@{*/
/** enables writing of EPC in MH, thus activating JPWL */
@ -349,7 +349,7 @@ typedef struct opj_cparameters {
/** sensitivity methods for TPHs (-1=no,0-7) */
int jpwl_sens_TPH[JPWL_MAX_NO_TILESPECS];
/*@}*/
/* <<UniPG */
/* <<UniPG */
/** Digital Cinema compliance 0-not compliant, 1-compliant*/
OPJ_CINEMA_MODE cp_cinema;
@ -399,7 +399,7 @@ typedef struct opj_dparameters {
int cod_format;
/*@}*/
/* UniPG>> */
/* UniPG>> */
/**@name JPWL decoding parameters */
/*@{*/
/** activates the JPWL correction capabilities */
@ -409,7 +409,7 @@ typedef struct opj_dparameters {
/** maximum number of tiles */
int jpwl_max_tiles;
/*@}*/
/* <<UniPG */
/* <<UniPG */
/**
Specify whether the decoding should be done on the entire codestream, or be limited to the main header
@ -710,14 +710,14 @@ typedef struct opj_codestream_info {
int numlayers;
/** number of decomposition for each component */
int *numdecompos;
/* UniPG>> */
/* UniPG>> */
/** number of markers */
int marknum;
/** list of markers */
opj_marker_info_t *marker;
/** actual size of markers array */
int maxmarknum;
/* <<UniPG */
/* <<UniPG */
/** main header position */
int main_head_start;
/** main header position */
@ -754,7 +754,8 @@ Create an image
@param clrspc image color space
@return returns a new image structure if successful, returns NULL otherwise
*/
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_create(int numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
OPJ_API opj_image_t* OPJ_CALLCONV opj_image_create(int numcmpts,
opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);
/**
Deallocate any resources associated with an image
@ -779,7 +780,8 @@ to contain encoded data.
@param length Reading: buffer length. Writing: 0
@return Returns a CIO handle if successful, returns NULL otherwise
*/
OPJ_API opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length);
OPJ_API opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo,
unsigned char *buffer, int length);
/**
Close and free a CIO handle
@ -806,7 +808,8 @@ OPJ_API void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos);
==========================================================
*/
OPJ_API opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo, opj_event_mgr_t *event_mgr, void *context);
OPJ_API opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo,
opj_event_mgr_t *event_mgr, void *context);
/*
==========================================================
@ -818,7 +821,8 @@ Creates a J2K/JPT/JP2 decompression structure
@param format Decoder to select
@return Returns a handle to a decompressor if successful, returns NULL otherwise
*/
OPJ_API opj_dinfo_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format);
OPJ_API opj_dinfo_t* OPJ_CALLCONV opj_create_decompress(
OPJ_CODEC_FORMAT format);
/**
Destroy a decompressor handle
@param dinfo decompressor handle to destroy
@ -828,21 +832,24 @@ OPJ_API void OPJ_CALLCONV opj_destroy_decompress(opj_dinfo_t *dinfo);
Set decoding parameters to default values
@param parameters Decompression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(
opj_dparameters_t *parameters);
/**
Setup the decoder decoding parameters using user parameters.
Decoding parameters are returned in j2k->cp.
@param dinfo decompressor handle
@param parameters decompression parameters
*/
OPJ_API void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo, opj_dparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_setup_decoder(opj_dinfo_t *dinfo,
opj_dparameters_t *parameters);
/**
Decode an image from a JPEG-2000 codestream
@param dinfo decompressor handle
@param cio Input buffer stream
@return Returns a decoded image if successful, returns NULL otherwise
*/
OPJ_API opj_image_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo, opj_cio_t *cio);
OPJ_API opj_image_t* OPJ_CALLCONV opj_decode(opj_dinfo_t *dinfo,
opj_cio_t *cio);
/**
Decode an image from a JPEG-2000 codestream and extract the codestream information
@ -851,7 +858,8 @@ Decode an image from a JPEG-2000 codestream and extract the codestream informati
@param cstr_info Codestream information structure if needed afterwards, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise
*/
OPJ_API opj_image_t* OPJ_CALLCONV opj_decode_with_info(opj_dinfo_t *dinfo, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
OPJ_API opj_image_t* OPJ_CALLCONV opj_decode_with_info(opj_dinfo_t *dinfo,
opj_cio_t *cio, opj_codestream_info_t *cstr_info);
/**
Creates a J2K/JP2 compression structure
@param format Coder to select
@ -884,14 +892,16 @@ Set encoding parameters to default values, that means :
</ul>
@param parameters Compression parameters
*/
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters);
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(
opj_cparameters_t *parameters);
/**
Setup the encoder parameters using the current image and using user parameters.
@param cinfo Compressor handle
@param parameters Compression parameters
@param image Input filled image
*/
OPJ_API void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparameters_t *parameters, opj_image_t *image);
OPJ_API void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo,
opj_cparameters_t *parameters, opj_image_t *image);
/**
Encode an image into a JPEG-2000 codestream
3@param cinfo compressor handle
@ -900,7 +910,8 @@ Encode an image into a JPEG-2000 codestream
@param index Depreacted -> Set to NULL. To extract index, used opj_encode_wci()
@return Returns true if successful, returns false otherwise
*/
OPJ_API opj_bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, char *index);
OPJ_API opj_bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio,
opj_image_t *image, char *index);
/**
Encode an image into a JPEG-2000 codestream and extract the codestream information
@param cinfo compressor handle
@ -909,12 +920,14 @@ Encode an image into a JPEG-2000 codestream and extract the codestream informati
@param cstr_info Codestream information structure if needed afterwards, NULL otherwise
@return Returns true if successful, returns false otherwise
*/
OPJ_API opj_bool OPJ_CALLCONV opj_encode_with_info(opj_cinfo_t *cinfo, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
OPJ_API opj_bool OPJ_CALLCONV opj_encode_with_info(opj_cinfo_t *cinfo,
opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
/**
Destroy Codestream information after compression or decompression
@param cstr_info Codestream information structure
*/
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_t *cstr_info);
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_t
*cstr_info);
#ifdef __cplusplus

View File

@ -61,7 +61,7 @@
/* Ignore GCC attributes if this is not GCC */
#ifndef __GNUC__
#define __attribute__(x) /* __attribute__(x) */
#define __attribute__(x) /* __attribute__(x) */
#endif
/*
@ -69,33 +69,34 @@ The inline keyword is supported by C99 but not by C90.
Most compilers implement their own version of this keyword ...
*/
#ifndef INLINE
#if defined(_MSC_VER)
#define INLINE __forceinline
#elif defined(__GNUC__)
#define INLINE __inline__
#elif defined(__MWERKS__)
#define INLINE inline
#else
/* add other compilers here ... */
#define INLINE
#endif /* defined(<Compiler>) */
#if defined(_MSC_VER)
#define INLINE __forceinline
#elif defined(__GNUC__)
#define INLINE __inline__
#elif defined(__MWERKS__)
#define INLINE inline
#else
/* add other compilers here ... */
#define INLINE
#endif /* defined(<Compiler>) */
#endif /* INLINE */
/* Are restricted pointers available? (C99) */
#if (__STDC_VERSION__ != 199901L)
/* Not a C99 compiler */
#ifdef __GNUC__
#define restrict __restrict__
#else
#define restrict /* restrict */
#endif
/* Not a C99 compiler */
#ifdef __GNUC__
#define restrict __restrict__
#else
#define restrict /* restrict */
#endif
#endif
/* MSVC and Borland C do not have lrintf */
#if defined(_MSC_VER) || defined(__BORLANDC__)
static INLINE long lrintf(float f){
static INLINE long lrintf(float f)
{
#ifdef _M_X64
return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f));
return (long)((f > 0.0f) ? (f + 0.5f) : (f - 0.5f));
#else
int i;

View File

@ -70,64 +70,65 @@ Allocate memory aligned to a 16 byte boundary
*/
/* FIXME: These should be set with cmake tests, but we're currently not requiring use of cmake */
#ifdef _WIN32
/* Someone should tell the mingw people that their malloc.h ought to provide _mm_malloc() */
#ifdef __GNUC__
#include <mm_malloc.h>
#define HAVE_MM_MALLOC
#else /* MSVC, Intel C++ */
#include <malloc.h>
#ifdef _mm_malloc
#define HAVE_MM_MALLOC
#endif
#endif
/* Someone should tell the mingw people that their malloc.h ought to provide _mm_malloc() */
#ifdef __GNUC__
#include <mm_malloc.h>
#define HAVE_MM_MALLOC
#else /* MSVC, Intel C++ */
#include <malloc.h>
#ifdef _mm_malloc
#define HAVE_MM_MALLOC
#endif
#endif
#else /* Not _WIN32 */
#if defined(__sun)
#define HAVE_MEMALIGN
#elif defined(__FreeBSD__)
#define HAVE_POSIX_MEMALIGN
/* Linux x86_64 and OSX always align allocations to 16 bytes */
#elif !defined(__amd64__) && !defined(__APPLE__) && !defined(_AIX)
#define HAVE_MEMALIGN
#include <malloc.h>
#endif
#if defined(__sun)
#define HAVE_MEMALIGN
#elif defined(__FreeBSD__)
#define HAVE_POSIX_MEMALIGN
/* Linux x86_64 and OSX always align allocations to 16 bytes */
#elif !defined(__amd64__) && !defined(__APPLE__) && !defined(_AIX)
#define HAVE_MEMALIGN
#include <malloc.h>
#endif
#endif
#define opj_aligned_malloc(size) malloc(size)
#define opj_aligned_free(m) free(m)
#ifdef HAVE_MM_MALLOC
#undef opj_aligned_malloc
#define opj_aligned_malloc(size) _mm_malloc(size, 16)
#undef opj_aligned_free
#define opj_aligned_free(m) _mm_free(m)
#undef opj_aligned_malloc
#define opj_aligned_malloc(size) _mm_malloc(size, 16)
#undef opj_aligned_free
#define opj_aligned_free(m) _mm_free(m)
#endif
#ifdef HAVE_MEMALIGN
extern void* memalign(size_t, size_t);
#undef opj_aligned_malloc
#define opj_aligned_malloc(size) memalign(16, (size))
#undef opj_aligned_free
#define opj_aligned_free(m) free(m)
extern void* memalign(size_t, size_t);
#undef opj_aligned_malloc
#define opj_aligned_malloc(size) memalign(16, (size))
#undef opj_aligned_free
#define opj_aligned_free(m) free(m)
#endif
#ifdef HAVE_POSIX_MEMALIGN
#undef opj_aligned_malloc
extern int posix_memalign(void**, size_t, size_t);
#undef opj_aligned_malloc
extern int posix_memalign(void**, size_t, size_t);
static INLINE void* __attribute__ ((malloc)) opj_aligned_malloc(size_t size){
static INLINE void* __attribute__((malloc)) opj_aligned_malloc(size_t size)
{
void* mem = NULL;
posix_memalign(&mem, 16, size);
return mem;
}
#undef opj_aligned_free
#define opj_aligned_free(m) free(m)
}
#undef opj_aligned_free
#define opj_aligned_free(m) free(m)
#endif
#ifdef ALLOC_PERF_OPT
#undef opj_aligned_malloc
#define opj_aligned_malloc(size) opj_malloc(size)
#undef opj_aligned_free
#define opj_aligned_free(m) opj_free(m)
#undef opj_aligned_malloc
#define opj_aligned_malloc(size) opj_malloc(size)
#undef opj_aligned_free
#define opj_aligned_free(m) opj_free(m)
#endif
/**

View File

@ -115,7 +115,8 @@ Create a packet iterator for Encoder
@return Returns a packet iterator that points to the first packet of the tile
@see pi_destroy
*/
opj_pi_iterator_t *pi_initialise_encode(opj_image_t *image, opj_cp_t *cp, int tileno,J2K_T2_MODE t2_mode);
opj_pi_iterator_t *pi_initialise_encode(opj_image_t *image, opj_cp_t *cp,
int tileno, J2K_T2_MODE t2_mode);
/**
Modify the packet iterator for enabling tile part generation
@param pi Handle to the packet iterator generated in pi_initialise_encode
@ -128,7 +129,8 @@ Modify the packet iterator for enabling tile part generation
@param cur_totnum_tp The total number of tile parts in the current tile
@return Returns true if an error is detected
*/
opj_bool pi_create_encode(opj_pi_iterator_t *pi, opj_cp_t *cp,int tileno, int pino,int tpnum, int tppos, J2K_T2_MODE t2_mode,int cur_totnum_tp);
opj_bool pi_create_encode(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno,
int pino, int tpnum, int tppos, J2K_T2_MODE t2_mode, int cur_totnum_tp);
/**
Create a packet iterator for Decoder
@param image Raw image for which the packets will be listed
@ -137,7 +139,8 @@ Create a packet iterator for Decoder
@return Returns a packet iterator that points to the first packet of the tile
@see pi_destroy
*/
opj_pi_iterator_t *pi_create_decode(opj_image_t * image, opj_cp_t * cp, int tileno);
opj_pi_iterator_t *pi_create_decode(opj_image_t * image, opj_cp_t * cp,
int tileno);
/**
Destroy a packet iterator

View File

@ -77,7 +77,9 @@ Encode the packets of a tile to a destination buffer
@param t2_mode If == 0 In Threshold calculation ,If == 1 Final pass
@param cur_totnum_tp The total number of tile parts in the current tile
*/
int t2_encode_packets(opj_t2_t* t2,int tileno, opj_tcd_tile_t *tile, int maxlayers, unsigned char *dest, int len, opj_codestream_info_t *cstr_info,int tpnum, int tppos,int pino,J2K_T2_MODE t2_mode,int cur_totnum_tp);
int t2_encode_packets(opj_t2_t* t2, int tileno, opj_tcd_tile_t *tile,
int maxlayers, unsigned char *dest, int len, opj_codestream_info_t *cstr_info,
int tpnum, int tppos, int pino, J2K_T2_MODE t2_mode, int cur_totnum_tp);
/**
Decode the packets of a tile from a source buffer
@param t2 T2 handle
@ -87,7 +89,8 @@ Decode the packets of a tile from a source buffer
@param tile tile for which to decode the packets
@param cstr_info Codestream information structure
*/
int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj_tcd_tile_t *tile, opj_codestream_info_t *cstr_info);
int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno,
opj_tcd_tile_t *tile, opj_codestream_info_t *cstr_info);
/**
Create a T2 handle

View File

@ -86,7 +86,8 @@ typedef struct opj_tcd_cblk_enc {
unsigned char* data; /* Data */
opj_tcd_layer_t* layers; /* layer information */
opj_tcd_pass_t* passes; /* information about the passes */
int x0, y0, x1, y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
int numbps;
int numlenbits;
int numpasses; /* number of pass already done for the code-blocks */
@ -97,7 +98,8 @@ typedef struct opj_tcd_cblk_enc {
typedef struct opj_tcd_cblk_dec {
unsigned char* data; /* Data */
opj_tcd_seg_t* segs; /* segments informations */
int x0, y0, x1, y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
int numbps;
int numlenbits;
int len; /* length */
@ -109,9 +111,10 @@ typedef struct opj_tcd_cblk_dec {
FIXME: documentation
*/
typedef struct opj_tcd_precinct {
int x0, y0, x1, y1; /* dimension of the precinct : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of the precinct : left upper corner (x0, y0) right low corner (x1,y1) */
int cw, ch; /* number of precinct in width and heigth */
union{ /* code-blocks informations */
union { /* code-blocks informations */
opj_tcd_cblk_enc_t* enc;
opj_tcd_cblk_dec_t* dec;
} cblks;
@ -123,7 +126,8 @@ typedef struct opj_tcd_precinct {
FIXME: documentation
*/
typedef struct opj_tcd_band {
int x0, y0, x1, y1; /* dimension of the subband : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of the subband : left upper corner (x0, y0) right low corner (x1,y1) */
int bandno;
opj_tcd_precinct_t *precincts; /* precinct information */
int numbps;
@ -134,7 +138,8 @@ typedef struct opj_tcd_band {
FIXME: documentation
*/
typedef struct opj_tcd_resolution {
int x0, y0, x1, y1; /* dimension of the resolution level : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of the resolution level : left upper corner (x0, y0) right low corner (x1,y1) */
int pw, ph;
int numbands; /* number sub-band for the resolution level */
opj_tcd_band_t bands[3]; /* subband information */
@ -144,7 +149,8 @@ typedef struct opj_tcd_resolution {
FIXME: documentation
*/
typedef struct opj_tcd_tilecomp {
int x0, y0, x1, y1; /* dimension of component : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of component : left upper corner (x0, y0) right low corner (x1,y1) */
int numresolutions; /* number of resolutions level */
opj_tcd_resolution_t *resolutions; /* resolutions information */
int *data; /* data of the component */
@ -155,7 +161,8 @@ typedef struct opj_tcd_tilecomp {
FIXME: documentation
*/
typedef struct opj_tcd_tile {
int x0, y0, x1, y1; /* dimension of the tile : left upper corner (x0, y0) right low corner (x1,y1) */
int x0, y0, x1,
y1; /* dimension of the tile : left upper corner (x0, y0) right low corner (x1,y1) */
int numcomps; /* number of components in tile */
opj_tcd_tilecomp_t *comps; /* Components information */
int numpix; /* add fixed_quality */
@ -232,7 +239,8 @@ Initialize the tile coder (allocate the memory)
@param cp Coding parameters
@param curtileno Number that identifies the tile that will be encoded
*/
void tcd_malloc_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno);
void tcd_malloc_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp,
int curtileno);
/**
Free the memory allocated for encoding
@param tcd TCD handle
@ -245,7 +253,8 @@ Initialize the tile coder (reuses the memory allocated by tcd_malloc_encode)
@param cp Coding parameters
@param curtileno Number that identifies the tile that will be encoded
*/
void tcd_init_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno);
void tcd_init_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp,
int curtileno);
/**
Initialize the tile decoder
@param tcd TCD handle
@ -253,11 +262,13 @@ Initialize the tile decoder
@param cp Coding parameters
*/
void tcd_malloc_decode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp);
void tcd_malloc_decode_tile(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int tileno, opj_codestream_info_t *cstr_info);
void tcd_malloc_decode_tile(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp,
int tileno, opj_codestream_info_t *cstr_info);
void tcd_makelayer_fixed(opj_tcd_t *tcd, int layno, int final);
void tcd_rateallocate_fixed(opj_tcd_t *tcd);
void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final);
opj_bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestream_info_t *cstr_info);
opj_bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len,
opj_codestream_info_t *cstr_info);
/**
Encode a tile from the raw image into a buffer
@param tcd TCD handle
@ -267,7 +278,8 @@ Encode a tile from the raw image into a buffer
@param cstr_info Codestream information structure
@return
*/
int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len, opj_codestream_info_t *cstr_info);
int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len,
opj_codestream_info_t *cstr_info);
/**
Decode a tile from a buffer into a raw image
@param tcd TCD handle
@ -276,7 +288,8 @@ Decode a tile from a buffer into a raw image
@param tileno Number that identifies one of the tiles to be decoded
@param cstr_info Codestream information structure
*/
opj_bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno, opj_codestream_info_t *cstr_info);
opj_bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len,
int tileno, opj_codestream_info_t *cstr_info);
/**
Free the memory allocated for decoding
@param tcd TCD handle

View File

@ -102,7 +102,8 @@ Encode the value of a leaf of the tag-tree up to a given threshold
@param leafno Number that identifies the leaf to encode
@param threshold Threshold to use when encoding value of the leaf
*/
void tgt_encode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno, int threshold);
void tgt_encode(opj_bio_t *bio, opj_tgt_tree_t *tree, int leafno,
int threshold);
/**
Decode the value of a leaf of the tag-tree up to a given threshold
@param bio Pointer to a BIO handle