summaryrefslogtreecommitdiff
path: root/src/lib/openjp3d
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-05-15 12:21:30 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-05-15 12:21:30 +0200
commit3c2972f924857016bb454201c7e92f25de9105ee (patch)
treedee91c4c200c2e97c83fd4c46588bf923f23852c /src/lib/openjp3d
parent28d2eabca79d06378843d1e94fecfb4a5e22178d (diff)
Reformat: apply reformattin on .h files (#128)
Diffstat (limited to 'src/lib/openjp3d')
-rw-r--r--src/lib/openjp3d/bio.h34
-rw-r--r--src/lib/openjp3d/cio.h4
-rw-r--r--src/lib/openjp3d/dwt.h12
-rw-r--r--src/lib/openjp3d/event.h12
-rw-r--r--src/lib/openjp3d/fix.h9
-rw-r--r--src/lib/openjp3d/int.h69
-rw-r--r--src/lib/openjp3d/jp3d.h622
-rw-r--r--src/lib/openjp3d/jp3d_lib.h10
-rw-r--r--src/lib/openjp3d/mct.h8
-rw-r--r--src/lib/openjp3d/mqc.h48
-rw-r--r--src/lib/openjp3d/openjp3d.h666
-rw-r--r--src/lib/openjp3d/opj_includes.h4
-rw-r--r--src/lib/openjp3d/pi.h110
-rw-r--r--src/lib/openjp3d/raw.h34
-rw-r--r--src/lib/openjp3d/t1.h89
-rw-r--r--src/lib/openjp3d/t1_3d.h140
-rw-r--r--src/lib/openjp3d/t2.h22
-rw-r--r--src/lib/openjp3d/tcd.h304
-rw-r--r--src/lib/openjp3d/tgt.h45
-rw-r--r--src/lib/openjp3d/volume.h4
20 files changed, 1139 insertions, 1107 deletions
diff --git a/src/lib/openjp3d/bio.h b/src/lib/openjp3d/bio.h
index a44a0c64..1c26eb3c 100644
--- a/src/lib/openjp3d/bio.h
+++ b/src/lib/openjp3d/bio.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -35,7 +35,7 @@
#ifndef __BIO_H
#define __BIO_H
-/**
+/**
@file bio.h
@brief Implementation of an individual bit input-output (BIO)
@@ -49,23 +49,23 @@ 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 */
- unsigned char *start;
-/** pointer to the end of the buffer */
- unsigned char *end;
-/** pointer to the present position in the buffer */
- unsigned char *bp;
-/** temporary place where each byte is read or written */
- unsigned int buf;
-/** coder : number of bits free to write. decoder : number of bits read */
- int ct;
+ /** pointer to the start of the buffer */
+ unsigned char *start;
+ /** pointer to the end of the buffer */
+ unsigned char *end;
+ /** pointer to the present position in the buffer */
+ unsigned char *bp;
+ /** temporary place where each byte is read or written */
+ unsigned int buf;
+ /** coder : number of bits free to write. decoder : number of bits read */
+ int ct;
} opj_bio_t;
/** @name Funciones generales */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
-Create a new BIO handle
+Create a new BIO handle
@return Returns a new BIO handle if successful, returns NULL otherwise
*/
opj_bio_t* bio_create(void);
@@ -84,14 +84,14 @@ int bio_numbytes(opj_bio_t *bio);
Init encoder
@param bio BIO handle
@param bp Output buffer
-@param len Output buffer length
+@param len Output buffer length
*/
void bio_init_enc(opj_bio_t *bio, unsigned char *bp, int len);
/**
Init decoder
@param bio BIO handle
@param bp Input buffer
-@param len Input buffer length
+@param len Input buffer length
*/
void bio_init_dec(opj_bio_t *bio, unsigned char *bp, int len);
/**
@@ -104,7 +104,7 @@ void bio_write(opj_bio_t *bio, int v, int n);
/**
Read bits
@param bio BIO handle
-@param n Number of bits to read
+@param n Number of bits to read
@return Returns the corresponding read number
*/
int bio_read(opj_bio_t *bio, int n);
diff --git a/src/lib/openjp3d/cio.h b/src/lib/openjp3d/cio.h
index 3cfa6fcb..ff7ae683 100644
--- a/src/lib/openjp3d/cio.h
+++ b/src/lib/openjp3d/cio.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
diff --git a/src/lib/openjp3d/dwt.h b/src/lib/openjp3d/dwt.h
index 00082900..634df95a 100644
--- a/src/lib/openjp3d/dwt.h
+++ b/src/lib/openjp3d/dwt.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -54,10 +54,10 @@ DCCS-LIWT properties
typedef struct opj_wtfilt {
- double *LPS;
- int lenLPS;
- double *HPS;
- int lenHPS;
+ double *LPS;
+ int lenLPS;
+ double *HPS;
+ int lenHPS;
} opj_wtfilt_t;
/** @name Funciones generales */
/*@{*/
diff --git a/src/lib/openjp3d/event.h b/src/lib/openjp3d/event.h
index e5a09c43..67d3c6a5 100644
--- a/src/lib/openjp3d/event.h
+++ b/src/lib/openjp3d/event.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -37,9 +37,9 @@
The functions in EVENT.C have for goal to send output messages (errors, warnings, debug) to the user.
*/
-#define EVT_ERROR 1 /**< Error event type */
-#define EVT_WARNING 2 /**< Warning event type */
-#define EVT_INFO 4 /**< Debug event type */
+#define EVT_ERROR 1 /**< Error event type */
+#define EVT_WARNING 2 /**< Warning event type */
+#define EVT_INFO 4 /**< Debug event type */
/** @defgroup EVENT EVENT - Implementation of a event callback system */
/*@{*/
@@ -48,7 +48,7 @@ The functions in EVENT.C have for goal to send output messages (errors, warnings
/*@{*/
/* ----------------------------------------------------------------------- */
/**
-Write formatted data to a string and send the string to a user callback.
+Write formatted data to a string and send the string to a user callback.
@param cinfo Codec context info
@param event_type Event type or callback to use to send the message
@param fmt Format-control string (plus optionnal arguments)
diff --git a/src/lib/openjp3d/fix.h b/src/lib/openjp3d/fix.h
index ea05403c..416fd0fd 100644
--- a/src/lib/openjp3d/fix.h
+++ b/src/lib/openjp3d/fix.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -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)) ;
}
/*@}*/
diff --git a/src/lib/openjp3d/int.h b/src/lib/openjp3d/int.h
index 0e154ca4..fb0480b6 100644
--- a/src/lib/openjp3d/int.h
+++ b/src/lib/openjp3d/int.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -51,15 +51,17 @@ 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) {
- return a < b ? a : 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) {
- return (a > b) ? a : b;
+static int int_max(int a, int b)
+{
+ return (a > b) ? a : b;
}
/**
Clamp an integer inside an interval
@@ -67,57 +69,66 @@ Clamp an integer inside an interval
<ul>
<li>Returns a if (min < a < max)
<li>Returns max if (a > max)
-<li>Returns min if (a < min)
+<li>Returns min if (a < min)
</ul>
*/
-static int int_clamp(int a, int min, int max) {
- if (a < min)
- return min;
- if (a > max)
- return max;
- return a;
+static int int_clamp(int a, int min, int max)
+{
+ if (a < min) {
+ return min;
+ }
+ if (a > max) {
+ return max;
+ }
+ return a;
}
/**
@return Get absolute value of integer
*/
-static int int_abs(int a) {
- return a < 0 ? -a : a;
+static int int_abs(int a)
+{
+ return a < 0 ? -a : a;
}
-static double dbl_abs(double a) {
- return a < 0 ? -a : 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) {
- return (a + b - 1) / 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) {
- return (a + (1 << b) - 1) >> 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) {
- return a >> 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) {
- int l;
- for (l = 0; a > 1; l++) {
- a >>= 1;
- }
- return l;
+static int int_floorlog2(int a)
+{
+ int l;
+ for (l = 0; a > 1; l++) {
+ a >>= 1;
+ }
+ return l;
}
/* ----------------------------------------------------------------------- */
/*@}*/
diff --git a/src/lib/openjp3d/jp3d.h b/src/lib/openjp3d/jp3d.h
index 7032d3fb..6bd5c86f 100644
--- a/src/lib/openjp3d/jp3d.h
+++ b/src/lib/openjp3d/jp3d.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -50,55 +50,55 @@ The functions in J3D.C have for goal to read/write the several parts of the code
#define J3D_CP_CSTY_EPH 0x04
#define J3D_CCP_CSTY_PRT 0x01
/** Table A-8 */
-#define J3D_CCP_CBLKSTY_LAZY 0x01 /* Selective arithmetic coding bypass */
+#define J3D_CCP_CBLKSTY_LAZY 0x01 /* Selective arithmetic coding bypass */
#define J3D_CCP_CBLKSTY_RESET 0x02 /* Reset context probabilities on coding pass boundaries */
#define J3D_CCP_CBLKSTY_TERMALL 0x04 /* Termination on each coding pass */
-#define J3D_CCP_CBLKSTY_VSC 0x08 /* Vertically causal context, add also hook for switching off and on 3D context models */
-#define J3D_CCP_CBLKSTY_PTERM 0x10 /* Predictable termination */
-#define J3D_CCP_CBLKSTY_SEGSYM 0x20 /* Segmentation symbols are used */
+#define J3D_CCP_CBLKSTY_VSC 0x08 /* Vertically causal context, add also hook for switching off and on 3D context models */
+#define J3D_CCP_CBLKSTY_PTERM 0x10 /* Predictable termination */
+#define J3D_CCP_CBLKSTY_SEGSYM 0x20 /* Segmentation symbols are used */
#define J3D_CCP_CBLKSTY_3DCTXT 0x40 /* 3D context models (3D-EBCOT) vs 2D context models */
-#define J3D_CCP_QNTSTY_NOQNT 0 /* Quantization style : no quantization */
-#define J3D_CCP_QNTSTY_SIQNT 1 /* Quantization style : scalar derived (values signalled only in LLL subband) */
-#define J3D_CCP_QNTSTY_SEQNT 2 /* Quantization style : scalar expounded (values signalled for each subband) */
+#define J3D_CCP_QNTSTY_NOQNT 0 /* Quantization style : no quantization */
+#define J3D_CCP_QNTSTY_SIQNT 1 /* Quantization style : scalar derived (values signalled only in LLL subband) */
+#define J3D_CCP_QNTSTY_SEQNT 2 /* Quantization style : scalar expounded (values signalled for each subband) */
/* ----------------------------------------------------------------------- */
-#define J3D_MS_SOC 0xff4f /**< SOC marker value */
-#define J3D_MS_SOT 0xff90 /**< SOT marker value */
-#define J3D_MS_SOD 0xff93 /**< SOD marker value */
-#define J3D_MS_EOC 0xffd9 /**< EOC marker value */
-#define J3D_MS_CAP 0xff50 /**< CAP marker value */
-#define J3D_MS_SIZ 0xff51 /**< SIZ marker value */
-#define J3D_MS_NSI 0xff54 /**< NSI marker value */
-#define J3D_MS_COD 0xff52 /**< COD marker value */
-#define J3D_MS_COC 0xff53 /**< COC marker value */
-#define J3D_MS_RGN 0xff5e /**< RGN marker value */
-#define J3D_MS_QCD 0xff5c /**< QCD marker value */
-#define J3D_MS_QCC 0xff5d /**< QCC marker value */
-#define J3D_MS_POC 0xff5f /**< POC marker value */
-#define J3D_MS_TLM 0xff55 /**< TLM marker value */
-#define J3D_MS_PLM 0xff57 /**< PLM marker value */
-#define J3D_MS_PLT 0xff58 /**< PLT marker value */
-#define J3D_MS_PPM 0xff60 /**< PPM marker value */
-#define J3D_MS_PPT 0xff61 /**< PPT marker value */
-#define J3D_MS_SOP 0xff91 /**< SOP marker value */
-#define J3D_MS_EPH 0xff92 /**< EPH marker value */
-#define J3D_MS_CRG 0xff63 /**< CRG marker value */
-#define J3D_MS_COM 0xff64 /**< COM marker value */
+#define J3D_MS_SOC 0xff4f /**< SOC marker value */
+#define J3D_MS_SOT 0xff90 /**< SOT marker value */
+#define J3D_MS_SOD 0xff93 /**< SOD marker value */
+#define J3D_MS_EOC 0xffd9 /**< EOC marker value */
+#define J3D_MS_CAP 0xff50 /**< CAP marker value */
+#define J3D_MS_SIZ 0xff51 /**< SIZ marker value */
+#define J3D_MS_NSI 0xff54 /**< NSI marker value */
+#define J3D_MS_COD 0xff52 /**< COD marker value */
+#define J3D_MS_COC 0xff53 /**< COC marker value */
+#define J3D_MS_RGN 0xff5e /**< RGN marker value */
+#define J3D_MS_QCD 0xff5c /**< QCD marker value */
+#define J3D_MS_QCC 0xff5d /**< QCC marker value */
+#define J3D_MS_POC 0xff5f /**< POC marker value */
+#define J3D_MS_TLM 0xff55 /**< TLM marker value */
+#define J3D_MS_PLM 0xff57 /**< PLM marker value */
+#define J3D_MS_PLT 0xff58 /**< PLT marker value */
+#define J3D_MS_PPM 0xff60 /**< PPM marker value */
+#define J3D_MS_PPT 0xff61 /**< PPT marker value */
+#define J3D_MS_SOP 0xff91 /**< SOP marker value */
+#define J3D_MS_EPH 0xff92 /**< EPH marker value */
+#define J3D_MS_CRG 0xff63 /**< CRG marker value */
+#define J3D_MS_COM 0xff64 /**< COM marker value */
/*15444-2*/
-#define J3D_MS_DCO 0xff70 /**< DCO marker value */
+#define J3D_MS_DCO 0xff70 /**< DCO marker value */
#define J3D_MS_VMS 0xff71 /**< VMS marker value */
-#define J3D_MS_DFS 0xff72 /**< DFS marker value */
-#define J3D_MS_ADS 0xff73 /**< ADS marker value */
-#define J3D_MS_ATK 0xff79 /**< ATK marker value */
-#define J3D_MS_CBD 0xff78 /**< CBD marker value */
-#define J3D_MS_MCT 0xff74 /**< MCT marker value */
-#define J3D_MS_MCC 0xff75 /**< MCC marker value */
-#define J3D_MS_MCO 0xff77 /**< MCO marker value */
-#define J3D_MS_NLT 0xff76 /**< NLT marker value */
-#define J3D_MS_QPD 0xff5a /**< QPD marker value */
-#define J3D_MS_QPC 0xff5b /**< QPC marker value */
+#define J3D_MS_DFS 0xff72 /**< DFS marker value */
+#define J3D_MS_ADS 0xff73 /**< ADS marker value */
+#define J3D_MS_ATK 0xff79 /**< ATK marker value */
+#define J3D_MS_CBD 0xff78 /**< CBD marker value */
+#define J3D_MS_MCT 0xff74 /**< MCT marker value */
+#define J3D_MS_MCC 0xff75 /**< MCC marker value */
+#define J3D_MS_MCO 0xff77 /**< MCO marker value */
+#define J3D_MS_NLT 0xff76 /**< NLT marker value */
+#define J3D_MS_QPD 0xff5a /**< QPD marker value */
+#define J3D_MS_QPC 0xff5b /**< QPC marker value */
/* ----------------------------------------------------------------------- */
/* Capability RSIZ parameter, extended */
@@ -117,7 +117,7 @@ The functions in J3D.C have for goal to read/write the several parts of the code
#define J3D_RSIZ_ASHAP 0x8400
#define J3D_RSIZ_PRQNT 0x8800
-#define J3D_CAP_10 0x00400000
+#define J3D_CAP_10 0x00400000
/* Arbitrary transformation kernel, 15444-2 */
#define J3D_ATK_IRR 0
#define J3D_ATK_REV 1
@@ -127,24 +127,24 @@ The functions in J3D.C have for goal to read/write the several parts of the code
/* ----------------------------------------------------------------------- */
/**
-Values that specify the status of the decoding process when decoding the main header.
-These values may be combined with a | operator.
+Values that specify the status of the decoding process when decoding the main header.
+These values may be combined with a | operator.
*/
typedef enum J3D_STATUS {
- /**< a SOC marker is expected */
- J3D_STATE_MHSOC = 0x0001,
- /**< a SIZ marker is expected */
- J3D_STATE_MHSIZ = 0x0002,
- /**< the decoding process is in the main header */
- J3D_STATE_MH = 0x0004,
- /**< the decoding process is in a tile part header and expects a SOT marker */
- J3D_STATE_TPHSOT = 0x0008,
- /**< the decoding process is in a tile part header */
- J3D_STATE_TPH = 0x0010,
- /**< the EOC marker has just been read */
- J3D_STATE_MT = 0x0020,
- /**< the decoding process must not expect a EOC marker because the codestream is truncated */
- J3D_STATE_NEOC = 0x0040
+ /**< a SOC marker is expected */
+ J3D_STATE_MHSOC = 0x0001,
+ /**< a SIZ marker is expected */
+ J3D_STATE_MHSIZ = 0x0002,
+ /**< the decoding process is in the main header */
+ J3D_STATE_MH = 0x0004,
+ /**< the decoding process is in a tile part header and expects a SOT marker */
+ J3D_STATE_TPHSOT = 0x0008,
+ /**< the decoding process is in a tile part header */
+ J3D_STATE_TPH = 0x0010,
+ /**< the EOC marker has just been read */
+ J3D_STATE_MT = 0x0020,
+ /**< the decoding process must not expect a EOC marker because the codestream is truncated */
+ J3D_STATE_NEOC = 0x0040
} J3D_STATUS;
@@ -153,32 +153,32 @@ typedef enum J3D_STATUS {
Arbitrary transformation kernel
*/
typedef struct opj_atk {
-/** index of wavelet kernel */
- int index;
-/** Numerical type of scaling factor and lifting step parameters */
- int coeff_typ;
-/** Wavelet filter category */
- int filt_cat;
-/** Wavelet transformation type (REV/IRR) */
- int wt_typ;
-/** Initial odd/even subsequence */
- int minit;
-/** Boundary extension method (constant CON / whole-sample symmetric WS) */
- int exten;
-/** Scaling factor. Only for wt_typ=IRR */
- double Katk;
-/** Number of lifting steps */
- int Natk;
-/** 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 */
- int Eatk[256];
-/** Additive residue for lifting step s. Only for wt_typ=REV */
- int Batk[256];
-/** Number of lifting coefficients signaled for lifting step s */
- int LCatk[256];
-/** Lifting coefficient k for lifting step s */
- double Aatk[256][256];
+ /** index of wavelet kernel */
+ int index;
+ /** Numerical type of scaling factor and lifting step parameters */
+ int coeff_typ;
+ /** Wavelet filter category */
+ int filt_cat;
+ /** Wavelet transformation type (REV/IRR) */
+ int wt_typ;
+ /** Initial odd/even subsequence */
+ int minit;
+ /** Boundary extension method (constant CON / whole-sample symmetric WS) */
+ int exten;
+ /** Scaling factor. Only for wt_typ=IRR */
+ double Katk;
+ /** Number of lifting steps */
+ int Natk;
+ /** 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 */
+ int Eatk[256];
+ /** Additive residue for lifting step s. Only for wt_typ=REV */
+ int Batk[256];
+ /** Number of lifting coefficients signaled for lifting step s */
+ int LCatk[256];
+ /** Lifting coefficient k for lifting step s */
+ double Aatk[256][256];
} opj_atk_t;
@@ -186,270 +186,270 @@ typedef struct opj_atk {
Quantization stepsize
*/
typedef struct opj_stepsize {
-/** exponent */
- int expn;
-/** mantissa */
- int mant;
+ /** exponent */
+ int expn;
+ /** mantissa */
+ int mant;
} opj_stepsize_t;
/**
Tile-component coding parameters
*/
typedef struct opj_tccp {
- /** coding style */
- int csty;
- /** number of resolutions of x, y and z-axis */
- int numresolution[3];
- /** code-blocks width height & depth*/
- int cblk[3];
- /** code-block coding style */
- int cblksty;
- /** 0: no ATK (only 9-7 or 5-3) 1: ATK defined WT*/
- int atk_wt[3];
- /** Arbitrary transformation kernel (15444-2)*/
- opj_atk_t *atk;
- /** DWT identifier for x, y and z-axis (0:WT9-7 1:WT5-3 >1:WT-atk->index) */
- int dwtid[3];
- /** reversible/irreversible wavelet transfomation (0:irrev 1:reversible)*/
- int reversible;
- /** quantisation style */
- int qntsty;
- /** stepsizes used for quantization */
- opj_stepsize_t stepsizes[J3D_MAXBANDS];
- /** number of guard bits. Table A28 de 15444-1*/
- int numgbits;
- /** Region Of Interest shift */
- int roishift;
- /** precinct width heigth & depth*/
- int prctsiz[3][J3D_MAXRLVLS];
+ /** coding style */
+ int csty;
+ /** number of resolutions of x, y and z-axis */
+ int numresolution[3];
+ /** code-blocks width height & depth*/
+ int cblk[3];
+ /** code-block coding style */
+ int cblksty;
+ /** 0: no ATK (only 9-7 or 5-3) 1: ATK defined WT*/
+ int atk_wt[3];
+ /** Arbitrary transformation kernel (15444-2)*/
+ opj_atk_t *atk;
+ /** DWT identifier for x, y and z-axis (0:WT9-7 1:WT5-3 >1:WT-atk->index) */
+ int dwtid[3];
+ /** reversible/irreversible wavelet transfomation (0:irrev 1:reversible)*/
+ int reversible;
+ /** quantisation style */
+ int qntsty;
+ /** stepsizes used for quantization */
+ opj_stepsize_t stepsizes[J3D_MAXBANDS];
+ /** number of guard bits. Table A28 de 15444-1*/
+ int numgbits;
+ /** Region Of Interest shift */
+ int roishift;
+ /** precinct width heigth & depth*/
+ int prctsiz[3][J3D_MAXRLVLS];
} opj_tccp_t;
/**
-Tile coding parameters : coding/decoding parameters common to all tiles
+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 */
- int first;
- /** coding style */
- int csty;
- /** progression order */
- OPJ_PROG_ORDER prg;
- /** number of layers */
- int numlayers;
- /** multi-component transform identifier */
- int mct;
- /** rates of layers */
- float rates[100];
- /** number of progression order changes */
- int numpocs;
- /** indicates if a POC marker has been used O:NO, 1:YES */
- int POC;
- /** progression order changes */
- opj_poc_t pocs[J3D_MAXRLVLS - 1];
- /** add fixed_quality */
- float distoratio[100];
- /** tile-component coding parameters */
- opj_tccp_t *tccps;
-/** 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;
- /** If ppt == 1 --> there was a PPT marker for the present tile */
- int ppt;
- /** used in case of multiple marker PPT (number of info already stored) */
- int ppt_store;
- int ppt_len;
+ /** 1 : first part-tile of a tile */
+ int first;
+ /** coding style */
+ int csty;
+ /** progression order */
+ OPJ_PROG_ORDER prg;
+ /** number of layers */
+ int numlayers;
+ /** multi-component transform identifier */
+ int mct;
+ /** rates of layers */
+ float rates[100];
+ /** number of progression order changes */
+ int numpocs;
+ /** indicates if a POC marker has been used O:NO, 1:YES */
+ int POC;
+ /** progression order changes */
+ opj_poc_t pocs[J3D_MAXRLVLS - 1];
+ /** add fixed_quality */
+ float distoratio[100];
+ /** tile-component coding parameters */
+ opj_tccp_t *tccps;
+ /** 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;
+ /** If ppt == 1 --> there was a PPT marker for the present tile */
+ int ppt;
+ /** used in case of multiple marker PPT (number of info already stored) */
+ int ppt_store;
+ int ppt_len;
} opj_tcp_t;
/**
Coding parameters
*/
typedef struct opj_cp {
-/** 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;
- /** allocation by rate/distortion */
- int disto_alloc;
- /** allocation by fixed layer */
- int fixed_alloc;
- /** add fixed_quality */
- int fixed_quality;
- /** Rsiz: capabilities */
- int rsiz;
- /** if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, volume is decoded to the full resolution */
- int reduce[3];
- /** if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers are decoded */
- int layer;
- /** 0 = no index || 1 = index */
- int index_on;
- /** Big-Endian/Little-endian order */
- int bigendian;
- /** XTOsiz */
- int tx0;
- /** YTOsiz */
- int ty0;
- /** ZTOsiz */
- int tz0;
- /** XTsiz */
- int tdx;
- /** YTsiz */
- int tdy;
- /** ZTsiz */
- int tdz;
- /** comment for coding */
- char *comment;
- /** number of tiles in width, heigth and depth */
- int tw;
- int th;
- int tl;
- /** ID number of the tiles present in the codestream */
- int *tileno;
- /** size of the vector tileno */
- int tileno_size;
- /** tile coding parameters */
- opj_tcp_t *tcps;
- /** fixed layer */
- int *matrice;
+ /** 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;
+ /** allocation by rate/distortion */
+ int disto_alloc;
+ /** allocation by fixed layer */
+ int fixed_alloc;
+ /** add fixed_quality */
+ int fixed_quality;
+ /** Rsiz: capabilities */
+ int rsiz;
+ /** if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, volume is decoded to the full resolution */
+ int reduce[3];
+ /** if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers are decoded */
+ int layer;
+ /** 0 = no index || 1 = index */
+ int index_on;
+ /** Big-Endian/Little-endian order */
+ int bigendian;
+ /** XTOsiz */
+ int tx0;
+ /** YTOsiz */
+ int ty0;
+ /** ZTOsiz */
+ int tz0;
+ /** XTsiz */
+ int tdx;
+ /** YTsiz */
+ int tdy;
+ /** ZTsiz */
+ int tdz;
+ /** comment for coding */
+ char *comment;
+ /** number of tiles in width, heigth and depth */
+ int tw;
+ int th;
+ int tl;
+ /** ID number of the tiles present in the codestream */
+ int *tileno;
+ /** size of the vector tileno */
+ int tileno_size;
+ /** tile coding parameters */
+ opj_tcp_t *tcps;
+ /** fixed layer */
+ int *matrice;
- /** packet header store there for futur use in t2_decode_packet */
- unsigned char *ppm_data;
- /** pointer remaining on the first byte of the first header if ppm is used */
- unsigned char *ppm_data_first;
- /** if ppm == 1 --> there was a PPM marker for the present tile */
- int ppm;
- /** use in case of multiple marker PPM (number of info already store) */
- int ppm_store;
- /** use in case of multiple marker PPM (case on non-finished previous info) */
- int ppm_previous;
- int ppm_len;
+ /** packet header store there for futur use in t2_decode_packet */
+ unsigned char *ppm_data;
+ /** pointer remaining on the first byte of the first header if ppm is used */
+ unsigned char *ppm_data_first;
+ /** if ppm == 1 --> there was a PPM marker for the present tile */
+ int ppm;
+ /** use in case of multiple marker PPM (number of info already store) */
+ int ppm_store;
+ /** use in case of multiple marker PPM (case on non-finished previous info) */
+ int ppm_previous;
+ int ppm_len;
} opj_cp_t;
/**
Information concerning a packet inside tile
*/
typedef struct opj_packet_info {
- /** start position */
- int start_pos;
- /** end position */
- int end_pos;
- /** distorsion introduced */
- double disto;
+ /** start position */
+ int start_pos;
+ /** end position */
+ int end_pos;
+ /** distorsion introduced */
+ double disto;
} opj_packet_info_t;
/**
Index structure : information regarding tiles inside volume
*/
typedef struct opj_tile_info {
- /** value of thresh for each layer by tile cfr. Marcela */
- double *thresh;
- /** number of tile */
- int num_tile;
- /** start position */
- int start_pos;
- /** end position of the header */
- int end_header;
- /** end position */
- int end_pos;
- /** precinct number for each resolution level (width, heigth and depth) */
- int prctno[3][J3D_MAXRLVLS];
- /** precinct size (in power of 2), in X for each resolution level */
- int prctsiz[3][J3D_MAXRLVLS];
- /** information concerning packets inside tile */
- opj_packet_info_t *packet;
-
- /** add fixed_quality */
- int nbpix;
- /** add fixed_quality */
- double distotile;
+ /** value of thresh for each layer by tile cfr. Marcela */
+ double *thresh;
+ /** number of tile */
+ int num_tile;
+ /** start position */
+ int start_pos;
+ /** end position of the header */
+ int end_header;
+ /** end position */
+ int end_pos;
+ /** precinct number for each resolution level (width, heigth and depth) */
+ int prctno[3][J3D_MAXRLVLS];
+ /** precinct size (in power of 2), in X for each resolution level */
+ int prctsiz[3][J3D_MAXRLVLS];
+ /** information concerning packets inside tile */
+ opj_packet_info_t *packet;
+
+ /** add fixed_quality */
+ int nbpix;
+ /** add fixed_quality */
+ double distotile;
} opj_tile_info_t;
/**
Index structure
*/
typedef struct opj_volume_info {
-
- /** transform format 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*/
- OPJ_ENTROPY_CODING encoding_format; /** 0 = no index || 1 = index */
- int index_on;
- /** 0 = wt 9-7 || 1 = wt 5-3 || >=2 wt atk defined */
- int dwtid[3];
- /** maximum distortion reduction on the whole volume (add for Marcela) */
- double D_max;
- /** packet number */
- int num;
- /** writing the packet in the index with t2_encode_packets */
- int index_write;
- /** volume width, height and depth */
- int volume_w;
- int volume_h;
- int volume_l;
- /** progression order */
- OPJ_PROG_ORDER prog;
- /** tile size in x, y and z */
- int tile_x;
- int tile_y;
- int tile_z;
- /** tile origin in x, y and z */
- int tile_Ox;
- int tile_Oy;
- int tile_Oz;
- /** number of tiles in X, Y and Z */
- int tw;
- int th;
- int tl;
- /** component numbers */
- int comp;
- /** number of layer */
- int layer;
- /** number of decomposition in X, Y and Z*/
- int decomposition[3];
- /** DC offset (15444-2) */
- int dcoffset;
- /** main header position */
- int main_head_end;
- /** codestream's size */
- int codestream_size;
- /** information regarding tiles inside volume */
- opj_tile_info_t *tile;
+
+ /** transform format 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*/
+ OPJ_ENTROPY_CODING encoding_format; /** 0 = no index || 1 = index */
+ int index_on;
+ /** 0 = wt 9-7 || 1 = wt 5-3 || >=2 wt atk defined */
+ int dwtid[3];
+ /** maximum distortion reduction on the whole volume (add for Marcela) */
+ double D_max;
+ /** packet number */
+ int num;
+ /** writing the packet in the index with t2_encode_packets */
+ int index_write;
+ /** volume width, height and depth */
+ int volume_w;
+ int volume_h;
+ int volume_l;
+ /** progression order */
+ OPJ_PROG_ORDER prog;
+ /** tile size in x, y and z */
+ int tile_x;
+ int tile_y;
+ int tile_z;
+ /** tile origin in x, y and z */
+ int tile_Ox;
+ int tile_Oy;
+ int tile_Oz;
+ /** number of tiles in X, Y and Z */
+ int tw;
+ int th;
+ int tl;
+ /** component numbers */
+ int comp;
+ /** number of layer */
+ int layer;
+ /** number of decomposition in X, Y and Z*/
+ int decomposition[3];
+ /** DC offset (15444-2) */
+ int dcoffset;
+ /** main header position */
+ int main_head_end;
+ /** codestream's size */
+ int codestream_size;
+ /** information regarding tiles inside volume */
+ opj_tile_info_t *tile;
} opj_volume_info_t;
/**
JPEG-2000 codestream reader/writer
*/
typedef struct opj_j3d {
- /** codec context */
- opj_common_ptr cinfo;
- /** locate in which part of the codestream the decoder is (main header, tile header, end) */
- int state;
- /** number of the tile curently concern by coding/decoding */
- int curtileno;
- /** locate the position of the end of the tile in the codestream, used to detect a truncated codestream (in j3d_read_sod) */
- unsigned char *eot;
- /** locate the start position of the SOT marker of the current coded tile: */
- int sot_start;
- /* after encoding the tile, a jump (in j3d_write_sod) is done to the SOT marker to store the value of its length. */
- int sod_start;
- /** as the J3D-file is written in several parts during encoding, it enables to make the right correction in position return by cio_tell */
- int pos_correction;
- /** array used to store the data of each tile */
- unsigned char **tile_data;
- /** array used to store the length of each tile */
- int *tile_len;
+ /** codec context */
+ opj_common_ptr cinfo;
+ /** locate in which part of the codestream the decoder is (main header, tile header, end) */
+ int state;
+ /** number of the tile curently concern by coding/decoding */
+ int curtileno;
+ /** locate the position of the end of the tile in the codestream, used to detect a truncated codestream (in j3d_read_sod) */
+ unsigned char *eot;
+ /** locate the start position of the SOT marker of the current coded tile: */
+ int sot_start;
+ /* after encoding the tile, a jump (in j3d_write_sod) is done to the SOT marker to store the value of its length. */
+ int sod_start;
+ /** as the J3D-file is written in several parts during encoding, it enables to make the right correction in position return by cio_tell */
+ int pos_correction;
+ /** array used to store the data of each tile */
+ unsigned char **tile_data;
+ /** array used to store the length of each tile */
+ int *tile_len;
- /** decompression only : store decoding parameters common to all tiles */
- opj_tcp_t *default_tcp;
- /** pointer to the encoded / decoded volume */
- opj_volume_t *volume;
- /** pointer to the coding parameters */
- opj_cp_t *cp;
- /** helper used to write the index file */
- opj_volume_info_t *volume_info;
- /** pointer to the byte i/o stream */
- opj_cio_t *cio;
+ /** decompression only : store decoding parameters common to all tiles */
+ opj_tcp_t *default_tcp;
+ /** pointer to the encoded / decoded volume */
+ opj_volume_t *volume;
+ /** pointer to the coding parameters */
+ opj_cp_t *cp;
+ /** helper used to write the index file */
+ opj_volume_info_t *volume_info;
+ /** pointer to the byte i/o stream */
+ opj_cio_t *cio;
} opj_j3d_t;
/** @name Funciones generales */
@@ -468,7 +468,7 @@ Destroy a J3D decompressor handle
void j3d_destroy_decompress(opj_j3d_t *j3d);
/**
Setup the decoder decoding parameters using user parameters.
-Decoding parameters are returned in j3d->cp.
+Decoding parameters are returned in j3d->cp.
@param j3d J3D decompressor handle
@param parameters decompression parameters
*/
@@ -499,13 +499,14 @@ Destroy a J3D compressor handle
*/
void j3d_destroy_compress(opj_j3d_t *j3d);
/**
-Setup the encoder parameters using the current volume and using user parameters.
-Coding parameters are returned in j3d->cp.
+Setup the encoder parameters using the current volume and using user parameters.
+Coding parameters are returned in j3d->cp.
@param j3d J3D compressor handle
@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);
/* ----------------------------------------------------------------------- */
/*@}*/
diff --git a/src/lib/openjp3d/jp3d_lib.h b/src/lib/openjp3d/jp3d_lib.h
index 48c5464b..3ca1cca6 100644
--- a/src/lib/openjp3d/jp3d_lib.h
+++ b/src/lib/openjp3d/jp3d_lib.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -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);
/* ----------------------------------------------------------------------- */
/*@}*/
diff --git a/src/lib/openjp3d/mct.h b/src/lib/openjp3d/mct.h
index 5c1b3dec..24463d4a 100644
--- a/src/lib/openjp3d/mct.h
+++ b/src/lib/openjp3d/mct.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -68,7 +68,7 @@ void mct_decode(int *c0, int *c1, int *c2, int 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)
-@return
+@return
*/
double mct_getnorm(int compno);
@@ -91,7 +91,7 @@ void mct_decode_real(int *c0, int *c1, int *c2, int 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)
-@return
+@return
*/
double mct_getnorm_real(int compno);
/* ----------------------------------------------------------------------- */
diff --git a/src/lib/openjp3d/mqc.h b/src/lib/openjp3d/mqc.h
index dcb0012c..cff92f61 100644
--- a/src/lib/openjp3d/mqc.h
+++ b/src/lib/openjp3d/mqc.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -50,14 +50,14 @@ in MQC.C are used by some function in T1.C.
This struct defines the state of a context.
*/
typedef struct opj_mqc_state {
- /** the probability of the Least Probable Symbol (0.75->0x8000, 1.5->0xffff) */
- unsigned int qeval;
- /** the Most Probable Symbol (0 or 1) */
- int mps;
- /** next state if the next encoded symbol is the MPS */
- struct opj_mqc_state *nmps;
- /** next state if the next encoded symbol is the LPS */
- struct opj_mqc_state *nlps;
+ /** the probability of the Least Probable Symbol (0.75->0x8000, 1.5->0xffff) */
+ unsigned int qeval;
+ /** the Most Probable Symbol (0 or 1) */
+ int mps;
+ /** next state if the next encoded symbol is the MPS */
+ struct opj_mqc_state *nmps;
+ /** next state if the next encoded symbol is the LPS */
+ struct opj_mqc_state *nlps;
} opj_mqc_state_t;
#define MQC_NUMCTXS 32
@@ -66,21 +66,21 @@ typedef struct opj_mqc_state {
MQ coder
*/
typedef struct opj_mqc {
- unsigned int c;
- unsigned int a;
- unsigned int ct;
- unsigned char *bp;
- unsigned char *start;
- unsigned char *end;
- opj_mqc_state_t *ctxs[MQC_NUMCTXS];
- opj_mqc_state_t **curctx;
+ unsigned int c;
+ unsigned int a;
+ unsigned int ct;
+ unsigned char *bp;
+ unsigned char *start;
+ unsigned char *end;
+ opj_mqc_state_t *ctxs[MQC_NUMCTXS];
+ opj_mqc_state_t **curctx;
} opj_mqc_t;
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
-Create a new MQC handle
+Create a new MQC handle
@return Returns a new MQC handle if successful, returns NULL otherwise
*/
opj_mqc_t* mqc_create(void);
@@ -96,7 +96,7 @@ Return the number of bytes written/read since initialisation
*/
int mqc_numbytes(opj_mqc_t *mqc);
/**
-Reset the states of all the context of the coder/decoder
+Reset the states of all the context of the coder/decoder
(each context is set to a state where 0 and 1 are more or less equiprobable)
@param mqc MQC handle
*/
@@ -133,15 +133,15 @@ Flush the encoder, so that all remaining data is written
*/
void mqc_flush(opj_mqc_t *mqc);
/**
-BYPASS mode switch, initialization operation.
-JPEG 2000 p 505.
+BYPASS mode switch, initialization operation.
+JPEG 2000 p 505.
<h2>Not fully implemented and tested !!</h2>
@param mqc MQC handle
*/
void mqc_bypass_init_enc(opj_mqc_t *mqc);
/**
-BYPASS mode switch, coding operation.
-JPEG 2000 p 505.
+BYPASS mode switch, coding operation.
+JPEG 2000 p 505.
<h2>Not fully implemented and tested !!</h2>
@param mqc MQC handle
@param d The symbol to be encoded (0 or 1)
diff --git a/src/lib/openjp3d/openjp3d.h b/src/lib/openjp3d/openjp3d.h
index a720bd37..0dd8aed8 100644
--- a/src/lib/openjp3d/openjp3d.h
+++ b/src/lib/openjp3d/openjp3d.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -36,7 +36,7 @@
#ifndef OPENJPEG_H
#define OPENJPEG_H
-/*
+/*
==========================================================
Compiler directives
==========================================================
@@ -56,10 +56,10 @@
#define OPJ_CALLCONV __stdcall
/*
-The following ifdef block is the standard way of creating macros which make exporting
+The following ifdef block is the standard way of creating macros which make exporting
from a DLL simpler. All files within this DLL are compiled with the OPJ_EXPORTS
symbol defined on the command line. this symbol should not be defined on any project
-that uses this DLL. This way any other project whose source files include this file see
+that uses this DLL. This way any other project whose source files include this file see
OPJ_API functions as being imported from a DLL, whereas this DLL sees symbols
defined with this macro as being exported.
*/
@@ -84,35 +84,35 @@ The C language implementation does not provide the standard header file
braindamage below.
*/
#if !defined(bool)
-#define bool int
+#define bool int
#endif
#if !defined(true)
-#define true 1
+#define true 1
#endif
#if !defined(false)
-#define false 0
+#define false 0
#endif
#endif
#endif /* __cplusplus */
-/*
+/*
==========================================================
Useful constant definitions
==========================================================
*/
#ifndef MAX_SLICES
-#define MAX_SLICES 300 /**< Maximum allowed size for slices */
+#define MAX_SLICES 300 /**< Maximum allowed size for slices */
#endif /* MAX_PATH */
#ifndef MAX_PATH
-#define MAX_PATH 260 /**< Maximum allowed size for filenames */
+#define MAX_PATH 260 /**< Maximum allowed size for filenames */
#endif /* MAX_PATH */
-#define J3D_MAXRLVLS 32 /**< Number of maximum resolution level authorized */
-#define J3D_MAXBANDS (7*J3D_MAXRLVLS + 1) /**< Number of maximum sub-band linked to number of resolution level */
+#define J3D_MAXRLVLS 32 /**< Number of maximum resolution level authorized */
+#define J3D_MAXBANDS (7*J3D_MAXRLVLS + 1) /**< Number of maximum sub-band linked to number of resolution level */
#define TINY 1.0E-20
-/*
+/*
==========================================================
enum definitions
==========================================================
@@ -129,77 +129,77 @@ braindamage below.
/** Progression order */
typedef enum PROG_ORDER {
-/**< place-holder */
- PROG_UNKNOWN = -1,
-/**< layer-resolution-component-precinct order */
- LRCP = 0,
-/**< resolution-layer-component-precinct order */
- RLCP = 1,
-/**< resolution-precinct-component-layer order */
- RPCL = 2,
-/**< precinct-component-resolution-layer order */
- PCRL = 3,
-/**< component-precinct-resolution-layer order */
- CPRL = 4
+ /**< place-holder */
+ PROG_UNKNOWN = -1,
+ /**< layer-resolution-component-precinct order */
+ LRCP = 0,
+ /**< resolution-layer-component-precinct order */
+ RLCP = 1,
+ /**< resolution-precinct-component-layer order */
+ RPCL = 2,
+ /**< precinct-component-resolution-layer order */
+ PCRL = 3,
+ /**< component-precinct-resolution-layer order */
+ CPRL = 4
} OPJ_PROG_ORDER;
/**
Supported volume color spaces
*/
typedef enum COLOR_SPACE {
-/**< place-holder */
- CLRSPC_UNKNOWN = -1,
-/**< sRGB */
- CLRSPC_SRGB = 1,
-/**< grayscale */
- CLRSPC_GRAY = 2,
-/**< YUV */
- CLRSPC_SYCC = 3
+ /**< place-holder */
+ CLRSPC_UNKNOWN = -1,
+ /**< sRGB */
+ CLRSPC_SRGB = 1,
+ /**< grayscale */
+ CLRSPC_GRAY = 2,
+ /**< YUV */
+ CLRSPC_SYCC = 3
} OPJ_COLOR_SPACE;
/**
Supported codec
*/
typedef enum CODEC_FORMAT {
- /**< place-holder */
- CODEC_UNKNOWN = -1,
-/**< JPEG-2000 codestream : read/write */
- CODEC_J2K = 0,
-/**< JPEG-2000 Part 10 file format : read/write */
- CODEC_J3D = 1
+ /**< place-holder */
+ CODEC_UNKNOWN = -1,
+ /**< JPEG-2000 codestream : read/write */
+ CODEC_J2K = 0,
+ /**< JPEG-2000 Part 10 file format : read/write */
+ CODEC_J3D = 1
} OPJ_CODEC_FORMAT;
/**
Supported entropy coding algorithms
*/
typedef enum ENTROPY_CODING {
-/**< place-holder */
- ENCOD_UNKNOWN = -1,
-/**< 2D EBCOT encoding */
- ENCOD_2EB = 0,
-/**< 3D EBCOT encoding */
- ENCOD_3EB = 1,
-/**< Golomb-Rice coding with 2D context */
- ENCOD_2GR = 2,
-/**< Golomb-Rice coding with 3D context */
- ENCOD_3GR = 3
+ /**< place-holder */
+ ENCOD_UNKNOWN = -1,
+ /**< 2D EBCOT encoding */
+ ENCOD_2EB = 0,
+ /**< 3D EBCOT encoding */
+ ENCOD_3EB = 1,
+ /**< Golomb-Rice coding with 2D context */
+ ENCOD_2GR = 2,
+ /**< Golomb-Rice coding with 3D context */
+ ENCOD_3GR = 3
} OPJ_ENTROPY_CODING;
/**
Supported transforms
*/
typedef enum TRANSFORM {
-/**< place-holder */
- TRF_UNKNOWN = -1,
-/**< 2D DWT, no transform in axial dim */
- TRF_2D_DWT = 0,
-/**< 3D DWT */
- TRF_3D_DWT = 1,
-/**< 3D prediction*/
- TRF_3D_RLS = 2,
- TRF_3D_LSE = 3
+ /**< place-holder */
+ TRF_UNKNOWN = -1,
+ /**< 2D DWT, no transform in axial dim */
+ TRF_2D_DWT = 0,
+ /**< 3D DWT */
+ TRF_3D_DWT = 1,
+ /**< 3D prediction*/
+ TRF_3D_RLS = 2,
+ TRF_3D_LSE = 3
} OPJ_TRANSFORM;
-/*
+/*
==========================================================
event manager typedef definitions
==========================================================
@@ -208,13 +208,13 @@ typedef enum TRANSFORM {
/**
Callback function prototype for events
@param msg Event message
-@param client_data
+@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
-used for
+used for
<ul>
<li>Error messages
<li>Warning messages
@@ -222,16 +222,16 @@ used for
</ul>
*/
typedef struct opj_event_mgr {
- /** Error message callback if available, NULL otherwise */
- opj_msg_callback error_handler;
- /** Warning message callback if available, NULL otherwise */
- opj_msg_callback warning_handler;
- /** Debug message callback if available, NULL otherwise */
- opj_msg_callback info_handler;
+ /** Error message callback if available, NULL otherwise */
+ opj_msg_callback error_handler;
+ /** Warning message callback if available, NULL otherwise */
+ opj_msg_callback warning_handler;
+ /** Debug message callback if available, NULL otherwise */
+ opj_msg_callback info_handler;
} opj_event_mgr_t;
-/*
+/*
==========================================================
codec typedef definitions
==========================================================
@@ -241,11 +241,11 @@ typedef struct opj_event_mgr {
Progression order changes
*/
typedef struct opj_poc {
- int resno0, compno0;
- int layno1, resno1, compno1;
- OPJ_PROG_ORDER prg;
- int tile;
- char progorder[4];
+ int resno0, compno0;
+ int layno1, resno1, compno1;
+ OPJ_PROG_ORDER prg;
+ int tile;
+ char progorder[4];
} opj_poc_t;
@@ -253,145 +253,145 @@ typedef struct opj_poc {
Compression parameters
*/
typedef struct opj_cparameters {
-/** size of tile: tile_size_on = false (not in argument) or = true (in argument) */
- bool tile_size_on;
-/** XTOsiz */
- int cp_tx0;
-/** YTOsiz */
- int cp_ty0;
-/** ZTOsiz */
- int cp_tz0;
-
-/** XTsiz */
- int cp_tdx;
-/** YTsiz */
- int cp_tdy;
-/** ZTsiz */
- int cp_tdz;
-
-/** allocation by rate/distortion */
- int cp_disto_alloc;
-/** allocation by fixed layer */
- int cp_fixed_alloc;
-/** add fixed_quality */
- int cp_fixed_quality;
-/** fixed layer */
- int *cp_matrice;
-/** number of layers */
- int tcp_numlayers;
-/** rates for successive layers */
- float tcp_rates[100];
-/** psnr's for successive layers */
- float tcp_distoratio[100];
-/** comment for coding */
- char *cp_comment;
-/** csty : coding style */
- int csty;
-/** DC offset (DCO) */
- int dcoffset;
-/** 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 */
- int numpocs;
-
-/** number of resolutions */
- int numresolution[3];
-/** 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)) */
- int mode;
-
-/** 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 */
- int atk_wt[3];
-/** region of interest: affected component in [0..3], -1 means no ROI */
- int roi_compno;
-/** region of interest: upshift value */
- int roi_shift;
-
-/* number of precinct size specifications */
- int res_spec;
-/** initial precinct width */
- int prct_init[3][J3D_MAXRLVLS];
-
-/** 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 */
- OPJ_ENTROPY_CODING encoding_format;
-
- /**@name command line encoder parameters (not used inside the library) */
- /*@{*/
- char infile[MAX_PATH]; /** input file name */
- char outfile[MAX_PATH]; /** output file name */
- char imgfile[MAX_PATH]; /** IMG file name for BIN volumes*/
- int index_on; /** creation of an index file, default to 0 (false) */
- char index[MAX_PATH]; /** index file name */
-
- int volume_offset_x0; /** subvolume encoding: origin volume offset in x, y and z direction */
- int volume_offset_y0;
- int volume_offset_z0;
-
- int subsampling_dx; /** subsampling value for dx */
- int subsampling_dy;
- int subsampling_dz;
-
- int decod_format; /** input file format 0: BIN, 1: PGX */
- int cod_format; /** output file format 0: JP3D */
- /*@}*/
+ /** size of tile: tile_size_on = false (not in argument) or = true (in argument) */
+ bool tile_size_on;
+ /** XTOsiz */
+ int cp_tx0;
+ /** YTOsiz */
+ int cp_ty0;
+ /** ZTOsiz */
+ int cp_tz0;
+
+ /** XTsiz */
+ int cp_tdx;
+ /** YTsiz */
+ int cp_tdy;
+ /** ZTsiz */
+ int cp_tdz;
+
+ /** allocation by rate/distortion */
+ int cp_disto_alloc;
+ /** allocation by fixed layer */
+ int cp_fixed_alloc;
+ /** add fixed_quality */
+ int cp_fixed_quality;
+ /** fixed layer */
+ int *cp_matrice;
+ /** number of layers */
+ int tcp_numlayers;
+ /** rates for successive layers */
+ float tcp_rates[100];
+ /** psnr's for successive layers */
+ float tcp_distoratio[100];
+ /** comment for coding */
+ char *cp_comment;
+ /** csty : coding style */
+ int csty;
+ /** DC offset (DCO) */
+ int dcoffset;
+ /** 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 */
+ int numpocs;
+
+ /** number of resolutions */
+ int numresolution[3];
+ /** 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)) */
+ int mode;
+
+ /** 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 */
+ int atk_wt[3];
+ /** region of interest: affected component in [0..3], -1 means no ROI */
+ int roi_compno;
+ /** region of interest: upshift value */
+ int roi_shift;
+
+ /* number of precinct size specifications */
+ int res_spec;
+ /** initial precinct width */
+ int prct_init[3][J3D_MAXRLVLS];
+
+ /** 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 */
+ OPJ_ENTROPY_CODING encoding_format;
+
+ /**@name command line encoder parameters (not used inside the library) */
+ /*@{*/
+ char infile[MAX_PATH]; /** input file name */
+ char outfile[MAX_PATH]; /** output file name */
+ char imgfile[MAX_PATH]; /** IMG file name for BIN volumes*/
+ int index_on; /** creation of an index file, default to 0 (false) */
+ char index[MAX_PATH]; /** index file name */
+
+ int volume_offset_x0; /** subvolume encoding: origin volume offset in x, y and z direction */
+ int volume_offset_y0;
+ int volume_offset_z0;
+
+ int subsampling_dx; /** subsampling value for dx */
+ int subsampling_dy;
+ int subsampling_dz;
+
+ int decod_format; /** input file format 0: BIN, 1: PGX */
+ int cod_format; /** output file format 0: JP3D */
+ /*@}*/
} opj_cparameters_t;
/**
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 */
- 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 */
- int cp_layer;
- int bigendian;
-
- /**@name command line encoder parameters (not used inside the library) */
- /*@{*/
-/** input file name */
- char infile[MAX_PATH];
-/** output file name */
- char outfile[MAX_PATH];
-/** IMG file name for BIN volumes*/
- char imgfile[MAX_PATH];
-/** Original file name for PSNR measures*/
- char original[MAX_PATH];
-/** input file format 0: J2K, 1: JP3D */
- int decod_format;
-/** input file format 0: BIN, 1: PGM */
- int cod_format;
-/** original file format 0: BIN, 1: PGM */
- int orig_format;
- /*@}*/
+ /** 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 */
+ int cp_layer;
+ int bigendian;
+
+ /**@name command line encoder parameters (not used inside the library) */
+ /*@{*/
+ /** input file name */
+ char infile[MAX_PATH];
+ /** output file name */
+ char outfile[MAX_PATH];
+ /** IMG file name for BIN volumes*/
+ char imgfile[MAX_PATH];
+ /** Original file name for PSNR measures*/
+ char original[MAX_PATH];
+ /** input file format 0: J2K, 1: JP3D */
+ int decod_format;
+ /** input file format 0: BIN, 1: PGM */
+ int cod_format;
+ /** original file format 0: BIN, 1: PGM */
+ int orig_format;
+ /*@}*/
} opj_dparameters_t;
/** Common fields between JPEG-2000 compression and decompression master structs. */
#define opj_common_fields \
- opj_event_mgr_t *event_mgr; /**< pointer to the event manager */\
- void * client_data; /**< Available for use by application */\
- bool is_decompressor; /**< So common code can tell which is which */\
- OPJ_CODEC_FORMAT codec_format; /**< selected codec */\
- OPJ_ENTROPY_CODING encoding_format; /**< selected entropy coding */\
- OPJ_TRANSFORM transform_format; /**< selected transform */\
- void *j3d_handle /**< pointer to the J3D codec */
-
+ opj_event_mgr_t *event_mgr; /**< pointer to the event manager */\
+ void * client_data; /**< Available for use by application */\
+ bool is_decompressor; /**< So common code can tell which is which */\
+ OPJ_CODEC_FORMAT codec_format; /**< selected codec */\
+ OPJ_ENTROPY_CODING encoding_format; /**< selected entropy coding */\
+ OPJ_TRANSFORM transform_format; /**< selected transform */\
+ void *j3d_handle /**< pointer to the J3D codec */
+
/* Routines that are to be used by both halves of the library are declared
* to receive a pointer to this structure. There are no actual instances of
* opj_common_struct_t, only of opj_cinfo_t and opj_dinfo_t.
*/
typedef struct opj_common_struct {
- opj_common_fields; /* Fields common to both master struct types */
- /* Additional fields follow in an actual opj_cinfo_t or
- * opj_dinfo_t. All three structs must agree on these
- * initial fields! (This would be a lot cleaner in C++.)
- */
+ opj_common_fields; /* Fields common to both master struct types */
+ /* Additional fields follow in an actual opj_cinfo_t or
+ * opj_dinfo_t. All three structs must agree on these
+ * initial fields! (This would be a lot cleaner in C++.)
+ */
} opj_common_struct_t;
typedef opj_common_struct_t * opj_common_ptr;
@@ -400,21 +400,21 @@ typedef opj_common_struct_t * opj_common_ptr;
Compression context info
*/
typedef struct opj_cinfo {
- /** Fields shared with opj_dinfo_t */
- opj_common_fields;
- /* other specific fields go here */
+ /** Fields shared with opj_dinfo_t */
+ opj_common_fields;
+ /* other specific fields go here */
} opj_cinfo_t;
/**
Decompression context info
*/
typedef struct opj_dinfo {
- /** Fields shared with opj_cinfo_t */
- opj_common_fields;
- /* other specific fields go here */
+ /** Fields shared with opj_cinfo_t */
+ opj_common_fields;
+ /* other specific fields go here */
} opj_dinfo_t;
-/*
+/*
==========================================================
I/O stream typedef definitions
==========================================================
@@ -424,7 +424,7 @@ typedef struct opj_dinfo {
* Stream open flags.
*/
/** The stream was opened for reading. */
-#define OPJ_STREAM_READ 0x0001
+#define OPJ_STREAM_READ 0x0001
/** The stream was opened for writing. */
#define OPJ_STREAM_WRITE 0x0002
@@ -432,23 +432,23 @@ typedef struct opj_dinfo {
Byte input-output stream (CIO)
*/
typedef struct opj_cio {
-/** codec context */
- opj_common_ptr cinfo;
-/** open mode (read/write) either OPJ_STREAM_READ or OPJ_STREAM_WRITE */
- int openmode;
-/** pointer to the start of the buffer */
- unsigned char *buffer;
-/** buffer size in bytes */
- int length;
-/** pointer to the start of the stream */
- unsigned char *start;
-/** pointer to the end of the stream */
- unsigned char *end;
-/** pointer to the current position */
- unsigned char *bp;
+ /** codec context */
+ opj_common_ptr cinfo;
+ /** open mode (read/write) either OPJ_STREAM_READ or OPJ_STREAM_WRITE */
+ int openmode;
+ /** pointer to the start of the buffer */
+ unsigned char *buffer;
+ /** buffer size in bytes */
+ int length;
+ /** pointer to the start of the stream */
+ unsigned char *start;
+ /** pointer to the end of the stream */
+ unsigned char *end;
+ /** pointer to the current position */
+ unsigned char *bp;
} opj_cio_t;
-/*
+/*
==========================================================
volume typedef definitions
==========================================================
@@ -458,100 +458,100 @@ 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 */
- int dx;
-/** 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 */
- int dz;
-/** data width */
- int w;
- /** data height */
- int h;
- /** data length : no of slices */
- int l;
- /** x component offset compared to the whole volume */
- int x0;
- /** y component offset compared to the whole volume */
- int y0;
- /** z component offset compared to the whole volume */
- int z0;
- /** precision */
- int prec;
- /** volume depth in bits */
- int bpp;
- /** DC offset (15444-2) */
- int dcoffset;
- /** signed (1) / unsigned (0) */
- int sgnd;
- /** BE byte order (1) / LE byte order (0) */
- int bigendian;
- /** number of decoded resolution */
- int resno_decoded[3];
- /** number of division by 2 of the out volume compared to the original size of volume */
- int factor[3];
- /** volume component data */
- int *data;
+ /** 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 */
+ int dy;
+ /** ZRsiz: vertical separation of a sample of ith component with respect to the reference grid */
+ int dz;
+ /** data width */
+ int w;
+ /** data height */
+ int h;
+ /** data length : no of slices */
+ int l;
+ /** x component offset compared to the whole volume */
+ int x0;
+ /** y component offset compared to the whole volume */
+ int y0;
+ /** z component offset compared to the whole volume */
+ int z0;
+ /** precision */
+ int prec;
+ /** volume depth in bits */
+ int bpp;
+ /** DC offset (15444-2) */
+ int dcoffset;
+ /** signed (1) / unsigned (0) */
+ int sgnd;
+ /** BE byte order (1) / LE byte order (0) */
+ int bigendian;
+ /** number of decoded resolution */
+ int resno_decoded[3];
+ /** number of division by 2 of the out volume compared to the original size of volume */
+ int factor[3];
+ /** volume component data */
+ int *data;
} opj_volume_comp_t;
-/**
+/**
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 */
- int x0;
-/** 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 */
- int z0;
-/** Xsiz: width of the reference grid */
- int x1;
-/** Ysiz: height of the reference grid */
- int y1;
-/** Zsiz: length of the reference grid */
- int z1;
-/** number of components in the volume */
- int numcomps;
-/** number of slices in the volume */
- int numslices;
-/** color space: sRGB, Greyscale or YUV */
- OPJ_COLOR_SPACE color_space;
-/** volume components */
- opj_volume_comp_t *comps;
+ /** 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 */
+ int y0;
+ /** 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 */
+ int x1;
+ /** Ysiz: height of the reference grid */
+ int y1;
+ /** Zsiz: length of the reference grid */
+ int z1;
+ /** number of components in the volume */
+ int numcomps;
+ /** number of slices in the volume */
+ int numslices;
+ /** color space: sRGB, Greyscale or YUV */
+ OPJ_COLOR_SPACE color_space;
+ /** volume components */
+ opj_volume_comp_t *comps;
} opj_volume_t;
/**
Component parameters structure used by the opj_volume_create function
*/
typedef struct opj_volume_comptparm {
- /** 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 */
- int dy;
- /** ZRsiz: axial separation of a sample of ith component with respect to the reference grid */
- int dz;
- /** data width */
- int w;
- /** data height */
- int h;
- /** data length */
- int l;
- /** x component offset compared to the whole volume */
- int x0;
- /** y component offset compared to the whole volume */
- int y0;
- /** z component offset compared to the whole volume */
- int z0;
- /** precision */
- int prec;
- /** volume depth in bits */
- int bpp;
- /** signed (1) / unsigned (0) */
- int sgnd;
- /** DC offset*/
- int dcoffset;
- /** BE byte order (1) / LE byte order (0) */
- int bigendian;
+ /** 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 */
+ int dy;
+ /** ZRsiz: axial separation of a sample of ith component with respect to the reference grid */
+ int dz;
+ /** data width */
+ int w;
+ /** data height */
+ int h;
+ /** data length */
+ int l;
+ /** x component offset compared to the whole volume */
+ int x0;
+ /** y component offset compared to the whole volume */
+ int y0;
+ /** z component offset compared to the whole volume */
+ int z0;
+ /** precision */
+ int prec;
+ /** volume depth in bits */
+ int bpp;
+ /** signed (1) / unsigned (0) */
+ int sgnd;
+ /** DC offset*/
+ int dcoffset;
+ /** BE byte order (1) / LE byte order (0) */
+ int bigendian;
} opj_volume_cmptparm_t;
#ifdef __cplusplus
@@ -559,7 +559,7 @@ extern "C" {
#endif
-/*
+/*
==========================================================
openjpeg version
==========================================================
@@ -567,7 +567,7 @@ extern "C" {
OPJ_API const char * OPJ_CALLCONV opj_version(void);
-/*
+/*
==========================================================
volume functions definitions
==========================================================
@@ -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
@@ -588,24 +589,25 @@ Deallocate any resources associated with an volume
*/
OPJ_API void OPJ_CALLCONV opj_volume_destroy(opj_volume_t *volume);
-/*
+/*
==========================================================
stream functions definitions
==========================================================
*/
/**
-Open and allocate a memory stream for read / write.
-On reading, the user must provide a buffer containing encoded data. The buffer will be
-wrapped by the returned CIO handle.
-On writing, buffer parameters must be set to 0: a buffer will be allocated by the library
-to contain encoded data.
+Open and allocate a memory stream for read / write.
+On reading, the user must provide a buffer containing encoded data. The buffer will be
+wrapped by the returned CIO handle.
+On writing, buffer parameters must be set to 0: a buffer will be allocated by the library
+to contain encoded data.
@param cinfo Codec context info
@param buffer Reading: buffer address. Writing: NULL
@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
@@ -626,15 +628,16 @@ Set position in byte stream
*/
OPJ_API void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos);
-/*
+/*
==========================================================
event manager functions definitions
==========================================================
*/
-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);
-/*
+/*
==========================================================
codec functions definitions
==========================================================
@@ -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.
+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
@@ -681,7 +688,7 @@ Destroy a compressor handle
*/
OPJ_API void OPJ_CALLCONV opj_destroy_compress(opj_cinfo_t *cinfo);
/**
-Set encoding parameters to default values, that means :
+Set encoding parameters to default values, that means :
<ul>
<li>Lossless
<li>1 tile
@@ -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.
+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
}
diff --git a/src/lib/openjp3d/opj_includes.h b/src/lib/openjp3d/opj_includes.h
index 20290588..f917e2fa 100644
--- a/src/lib/openjp3d/opj_includes.h
+++ b/src/lib/openjp3d/opj_includes.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
diff --git a/src/lib/openjp3d/pi.h b/src/lib/openjp3d/pi.h
index c81f9ef0..59a73d55 100644
--- a/src/lib/openjp3d/pi.h
+++ b/src/lib/openjp3d/pi.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -49,69 +49,69 @@ by some function in T2.C.
/*@{*/
/**
-Packet iterator : resolution level information
+Packet iterator : resolution level information
*/
typedef struct opj_pi_resolution {
-/** Size of precints in horizontal axis */
- int pdx;
-/** Size of precints in vertical axis */
- int pdy;
-/** Size of precints in axial axis */
- int pdz;
-/** Number of precints in each axis */
- int prctno[3];
+ /** Size of precints in horizontal axis */
+ int pdx;
+ /** Size of precints in vertical axis */
+ int pdy;
+ /** Size of precints in axial axis */
+ int pdz;
+ /** Number of precints in each axis */
+ int prctno[3];
} opj_pi_resolution_t;
/**
-Packet iterator : component information
+Packet iterator : component information
*/
typedef struct opj_pi_comp {
-/** Size in horizontal axis */
- int dx;
-/** Size in vertical axis */
- int dy;
-/** Size in axial axis */
- int dz;
-/** Number of resolution levels */
- int numresolution[3];
-/** Packet iterator : resolution level information */
- opj_pi_resolution_t *resolutions;
+ /** Size in horizontal axis */
+ int dx;
+ /** Size in vertical axis */
+ int dy;
+ /** Size in axial axis */
+ int dz;
+ /** Number of resolution levels */
+ int numresolution[3];
+ /** Packet iterator : resolution level information */
+ opj_pi_resolution_t *resolutions;
} opj_pi_comp_t;
-/**
-Packet iterator
+/**
+Packet iterator
*/
typedef struct opj_pi_iterator {
-/** 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 */
- int step_l;
-/** 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 */
- int step_c;
-/** precinct step used to localize the packet in the include vector */
- int step_p;
-/** component that identify the packet */
- int compno;
-/** resolution that identify the packet */
- int resno;
-/** precinct that identify the packet */
- int precno;
-/** layer that identify the packet */
- int layno;
-/** 0 if the first packet */
- int first;
-/** progression order change information */
- opj_poc_t poc;
-/** Packet iterator : component information */
-opj_pi_comp_t *comps;
-
- int numcomps;
- int tx0, ty0, tz0;
- int tx1, ty1, tz1;
- int x, y, z;
- int dx, dy, dz;
+ /** 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 */
+ int step_l;
+ /** 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 */
+ int step_c;
+ /** precinct step used to localize the packet in the include vector */
+ int step_p;
+ /** component that identify the packet */
+ int compno;
+ /** resolution that identify the packet */
+ int resno;
+ /** precinct that identify the packet */
+ int precno;
+ /** layer that identify the packet */
+ int layno;
+ /** 0 if the first packet */
+ int first;
+ /** progression order change information */
+ opj_poc_t poc;
+ /** Packet iterator : component information */
+ opj_pi_comp_t *comps;
+
+ int numcomps;
+ int tx0, ty0, tz0;
+ int tx1, ty1, tz1;
+ int x, y, z;
+ int dx, dy, dz;
} opj_pi_iterator_t;
/** @name Funciones generales */
@@ -139,7 +139,7 @@ void pi_destroy(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno);
/**
Modify the packet iterator to point to the next packet
@param pi Packet iterator to modify
-@return Returns false if pi pointed to the last packet or else returns true
+@return Returns false if pi pointed to the last packet or else returns true
*/
bool pi_next(opj_pi_iterator_t * pi);
/* ----------------------------------------------------------------------- */
diff --git a/src/lib/openjp3d/raw.h b/src/lib/openjp3d/raw.h
index bd2aa4e8..a9d7080a 100644
--- a/src/lib/openjp3d/raw.h
+++ b/src/lib/openjp3d/raw.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -48,27 +48,27 @@ with the corresponding mode switch.
RAW encoding operations
*/
typedef struct opj_raw {
-/** Temporary buffer where bits are coded or decoded */
- unsigned char c;
-/** Number of bits already read or free to write */
- unsigned int ct;
-/** Maximum length to decode */
- unsigned int lenmax;
-/** Length decoded */
- unsigned int len;
-/** Pointer to the current position in the buffer */
- unsigned char *bp;
-/** Pointer to the start of the buffer */
- unsigned char *start;
-/** Pointer to the end of the buffer */
- unsigned char *end;
+ /** Temporary buffer where bits are coded or decoded */
+ unsigned char c;
+ /** Number of bits already read or free to write */
+ unsigned int ct;
+ /** Maximum length to decode */
+ unsigned int lenmax;
+ /** Length decoded */
+ unsigned int len;
+ /** Pointer to the current position in the buffer */
+ unsigned char *bp;
+ /** Pointer to the start of the buffer */
+ unsigned char *start;
+ /** Pointer to the end of the buffer */
+ unsigned char *end;
} opj_raw_t;
/** @name Funciones generales */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
-Create a new RAW handle
+Create a new RAW handle
@return Returns a new RAW handle if successful, returns NULL otherwise
*/
opj_raw_t* raw_create(void);
diff --git a/src/lib/openjp3d/t1.h b/src/lib/openjp3d/t1.h
index 8d52f0cc..f2c61e0a 100644
--- a/src/lib/openjp3d/t1.h
+++ b/src/lib/openjp3d/t1.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -48,25 +48,25 @@ in T1.C are used by some function in TCD.C.
/* ----------------------------------------------------------------------- */
#define T1_NMSEDEC_BITS 7
-#define T1_MAXCBLKW 256 /*< Maximum size of code-block (width) */
-#define T1_MAXCBLKH 256 /*< Maximum size of code-block (heigth) */
-#define T1_MAXCBLKD 256 /*< Maximum size of code-block (depth) */
-#define T1_MINCBLKW 4 /*< Minimum size of code-block (width) */
-#define T1_MINCBLKH 4 /*< Minimum size of code-block (heigth) */
-#define T1_MINCBLKD 4 /*< Minimum size of code-block (depth) */
-#define T1_MAXWHD 18
+#define T1_MAXCBLKW 256 /*< Maximum size of code-block (width) */
+#define T1_MAXCBLKH 256 /*< Maximum size of code-block (heigth) */
+#define T1_MAXCBLKD 256 /*< Maximum size of code-block (depth) */
+#define T1_MINCBLKW 4 /*< Minimum size of code-block (width) */
+#define T1_MINCBLKH 4 /*< Minimum size of code-block (heigth) */
+#define T1_MINCBLKD 4 /*< Minimum size of code-block (depth) */
+#define T1_MAXWHD 18
#define T1_CBLKW 256
#define T1_CBLKH 256
#define T1_CBLKD 256
-#define T1_SIG_NE 0x0001 /*< Context orientation : North-East direction */
-#define T1_SIG_SE 0x0002 /*< Context orientation : South-East direction */
-#define T1_SIG_SW 0x0004 /*< Context orientation : South-West direction */
-#define T1_SIG_NW 0x0008 /*< Context orientation : North-West direction */
-#define T1_SIG_N 0x0010 /*< Context orientation : North direction */
-#define T1_SIG_E 0x0020 /*< Context orientation : East direction */
-#define T1_SIG_S 0x0040 /*< Context orientation : South direction */
-#define T1_SIG_W 0x0080 /*< Context orientation : West direction */
+#define T1_SIG_NE 0x0001 /*< Context orientation : North-East direction */
+#define T1_SIG_SE 0x0002 /*< Context orientation : South-East direction */
+#define T1_SIG_SW 0x0004 /*< Context orientation : South-West direction */
+#define T1_SIG_NW 0x0008 /*< Context orientation : North-West direction */
+#define T1_SIG_N 0x0010 /*< Context orientation : North direction */
+#define T1_SIG_E 0x0020 /*< Context orientation : East direction */
+#define T1_SIG_S 0x0040 /*< Context orientation : South direction */
+#define T1_SIG_W 0x0080 /*< Context orientation : West direction */
#define T1_SIG_OTH (T1_SIG_N|T1_SIG_NE|T1_SIG_E|T1_SIG_SE|T1_SIG_S|T1_SIG_SW|T1_SIG_W|T1_SIG_NW)
#define T1_SIG_PRIM (T1_SIG_N|T1_SIG_E|T1_SIG_S|T1_SIG_W)
@@ -95,8 +95,8 @@ in T1.C are used by some function in TCD.C.
#define T1_NMSEDEC_FRACBITS (T1_NMSEDEC_BITS-1)
-#define T1_TYPE_MQ 0 /*< Normal coding using entropy coder */
-#define T1_TYPE_RAW 1 /*< No encoding the information is store under raw format in codestream (mode switch RAW)*/
+#define T1_TYPE_MQ 0 /*< Normal coding using entropy coder */
+#define T1_TYPE_RAW 1 /*< No encoding the information is store under raw format in codestream (mode switch RAW)*/
/* ----------------------------------------------------------------------- */
@@ -104,34 +104,34 @@ in T1.C are used by some function in TCD.C.
Tier-1 coding (coding of code-block coefficients)
*/
typedef struct opj_t1 {
- /** codec context */
- opj_common_ptr cinfo;
-
- /** MQC component */
- opj_mqc_t *mqc;
- /** RAW component */
- opj_raw_t *raw;
- /** LUTs for context-based coding */
- int lut_ctxno_zc[1024];
- int lut_ctxno_sc[256];
- int lut_ctxno_mag[4096];
- int lut_spb[256];
- /** LUTs for decoding normalised MSE */
- int lut_nmsedec_sig[1 << T1_NMSEDEC_BITS];
- int lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS];
- int lut_nmsedec_ref[1 << T1_NMSEDEC_BITS];
- int lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS];
- /** Codeblock data */
- int data[T1_CBLKD][T1_CBLKH][T1_CBLKW];/*int ***data;*/
- /** Context information for each voxel in codeblock */
- int flags[T1_CBLKD + 2][T1_CBLKH + 2][T1_CBLKH + 2];/*int ***flags;*/
+ /** codec context */
+ opj_common_ptr cinfo;
+
+ /** MQC component */
+ opj_mqc_t *mqc;
+ /** RAW component */
+ opj_raw_t *raw;
+ /** LUTs for context-based coding */
+ int lut_ctxno_zc[1024];
+ int lut_ctxno_sc[256];
+ int lut_ctxno_mag[4096];
+ int lut_spb[256];
+ /** LUTs for decoding normalised MSE */
+ int lut_nmsedec_sig[1 << T1_NMSEDEC_BITS];
+ int lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS];
+ int lut_nmsedec_ref[1 << T1_NMSEDEC_BITS];
+ int lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS];
+ /** Codeblock data */
+ int data[T1_CBLKD][T1_CBLKH][T1_CBLKW];/*int ***data;*/
+ /** Context information for each voxel in codeblock */
+ int flags[T1_CBLKD + 2][T1_CBLKH + 2][T1_CBLKH + 2];/*int ***flags;*/
} opj_t1_t;
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
-Create a new T1 handle
+Create a new T1 handle
and initialize the look-up tables of the Tier-1 coder/decoder
@return Returns a new T1 handle if successful, returns NULL otherwise
@see t1_init_luts
@@ -159,8 +159,8 @@ void t1_decode_cblks(opj_t1_t *t1, opj_tcd_tile_t *tile, opj_tcp_t *tcp);
/**
Get weigths of MSE decoding
@param nmsedec The normalized MSE reduction
-@param compno
-@param level
+@param compno
+@param level
@param orient
@param bpno
@param stepsize
@@ -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]);
/* ----------------------------------------------------------------------- */
/*@}*/
diff --git a/src/lib/openjp3d/t1_3d.h b/src/lib/openjp3d/t1_3d.h
index 2974781f..c7cf8876 100644
--- a/src/lib/openjp3d/t1_3d.h
+++ b/src/lib/openjp3d/t1_3d.h
@@ -39,62 +39,62 @@ The functions in T1_3D.C are used by some function in TCD.C.
/* ----------------------------------------------------------------------- */
/* Neighbourhood of 3D EBCOT (Significance context)*/
-#define T1_3D_SIG_NE 0x00000001 /*< Context orientation : North-East direction */
-#define T1_3D_SIG_SE 0x00000002 /*< Context orientation : South-East direction */
-#define T1_3D_SIG_SW 0x00000004 /*< Context orientation : South-West direction */
-#define T1_3D_SIG_NW 0x00000008 /* Context orientation : North-West direction */
-#define T1_3D_SIG_N 0x00000010 /*< Context orientation : North direction */
-#define T1_3D_SIG_E 0x00000020 /*< Context orientation : East direction */
-#define T1_3D_SIG_S 0x00000040 /*< Context orientation : South direction */
-#define T1_3D_SIG_W 0x00000080 /*< Context orientation : West direction */
-#define T1_3D_SIG_FC 0x00000100 /*< Context orientation : Forward Central direction */
-#define T1_3D_SIG_BC 0x00000200 /*< Context orientation : Backward Central direction */
-#define T1_3D_SIG_FNE 0x00000400 /*< Context orientation : Forward North-East direction */
-#define T1_3D_SIG_FSE 0x00000800 /*< Context orientation : Forward South-East direction */
-#define T1_3D_SIG_FSW 0x00001000 /*< Context orientation : Forward South-West direction */
-#define T1_3D_SIG_FNW 0x00002000 /*< Context orientation : Forward North-West direction */
-#define T1_3D_SIG_FN 0x00004000 /*< Context orientation : Forward North direction */
-#define T1_3D_SIG_FE 0x00008000 /*< Context orientation : Forward East direction */
-#define T1_3D_SIG_FS 0x00010000 /*< Context orientation : Forward South direction */
-#define T1_3D_SIG_FW 0x00020000 /*< Context orientation : Forward West direction */
-#define T1_3D_SIG_BNE 0x00040000 /*< Context orientation : Backward North-East direction */
-#define T1_3D_SIG_BSE 0x00080000 /*< Context orientation : Backward South-East direction */
-#define T1_3D_SIG_BSW 0x00100000 /*< Context orientation : Backward South-West direction */
-#define T1_3D_SIG_BNW 0x00200000 /*< Context orientation : Backward North-West direction */
-#define T1_3D_SIG_BN 0x00400000 /*< Context orientation : Backward North direction */
-#define T1_3D_SIG_BE 0x00800000 /*< Context orientation : Backward East direction */
-#define T1_3D_SIG_BS 0x01000000 /*< Context orientation : Backward South direction */
-#define T1_3D_SIG_BW 0x02000000 /*< Context orientation : Backward West direction */
-#define T1_3D_SIG_COTH (T1_3D_SIG_N|T1_3D_SIG_NE|T1_3D_SIG_E|T1_3D_SIG_SE|T1_3D_SIG_S|T1_3D_SIG_SW|T1_3D_SIG_W|T1_3D_SIG_NW)
-#define T1_3D_SIG_BOTH (T1_3D_SIG_BN|T1_3D_SIG_BNE|T1_3D_SIG_BE|T1_3D_SIG_BSE|T1_3D_SIG_BS|T1_3D_SIG_BSW|T1_3D_SIG_BW|T1_3D_SIG_BNW|T1_3D_SIG_BC)
+#define T1_3D_SIG_NE 0x00000001 /*< Context orientation : North-East direction */
+#define T1_3D_SIG_SE 0x00000002 /*< Context orientation : South-East direction */
+#define T1_3D_SIG_SW 0x00000004 /*< Context orientation : South-West direction */
+#define T1_3D_SIG_NW 0x00000008 /* Context orientation : North-West direction */
+#define T1_3D_SIG_N 0x00000010 /*< Context orientation : North direction */
+#define T1_3D_SIG_E 0x00000020 /*< Context orientation : East direction */
+#define T1_3D_SIG_S 0x00000040 /*< Context orientation : South direction */
+#define T1_3D_SIG_W 0x00000080 /*< Context orientation : West direction */
+#define T1_3D_SIG_FC 0x00000100 /*< Context orientation : Forward Central direction */
+#define T1_3D_SIG_BC 0x00000200 /*< Context orientation : Backward Central direction */
+#define T1_3D_SIG_FNE 0x00000400 /*< Context orientation : Forward North-East direction */
+#define T1_3D_SIG_FSE 0x00000800 /*< Context orientation : Forward South-East direction */
+#define T1_3D_SIG_FSW 0x00001000 /*< Context orientation : Forward South-West direction */
+#define T1_3D_SIG_FNW 0x00002000 /*< Context orientation : Forward North-West direction */
+#define T1_3D_SIG_FN 0x00004000 /*< Context orientation : Forward North direction */
+#define T1_3D_SIG_FE 0x00008000 /*< Context orientation : Forward East direction */
+#define T1_3D_SIG_FS 0x00010000 /*< Context orientation : Forward South direction */
+#define T1_3D_SIG_FW 0x00020000 /*< Context orientation : Forward West direction */
+#define T1_3D_SIG_BNE 0x00040000 /*< Context orientation : Backward North-East direction */
+#define T1_3D_SIG_BSE 0x00080000 /*< Context orientation : Backward South-East direction */
+#define T1_3D_SIG_BSW 0x00100000 /*< Context orientation : Backward South-West direction */
+#define T1_3D_SIG_BNW 0x00200000 /*< Context orientation : Backward North-West direction */
+#define T1_3D_SIG_BN 0x00400000 /*< Context orientation : Backward North direction */
+#define T1_3D_SIG_BE 0x00800000 /*< Context orientation : Backward East direction */
+#define T1_3D_SIG_BS 0x01000000 /*< Context orientation : Backward South direction */
+#define T1_3D_SIG_BW 0x02000000 /*< Context orientation : Backward West direction */
+#define T1_3D_SIG_COTH (T1_3D_SIG_N|T1_3D_SIG_NE|T1_3D_SIG_E|T1_3D_SIG_SE|T1_3D_SIG_S|T1_3D_SIG_SW|T1_3D_SIG_W|T1_3D_SIG_NW)
+#define T1_3D_SIG_BOTH (T1_3D_SIG_BN|T1_3D_SIG_BNE|T1_3D_SIG_BE|T1_3D_SIG_BSE|T1_3D_SIG_BS|T1_3D_SIG_BSW|T1_3D_SIG_BW|T1_3D_SIG_BNW|T1_3D_SIG_BC)
#define T1_3D_SIG_FOTH (T1_3D_SIG_FN|T1_3D_SIG_FNE|T1_3D_SIG_FE|T1_3D_SIG_FSE|T1_3D_SIG_FS|T1_3D_SIG_FSW|T1_3D_SIG_FW|T1_3D_SIG_FNW|T1_3D_SIG_FC)
-#define T1_3D_SIG_OTH (T1_3D_SIG_FOTH|T1_3D_SIG_BOTH|T1_3D_SIG_COTH)
-#define T1_3D_SIG_PRIM (T1_3D_SIG_N|T1_3D_SIG_E|T1_3D_SIG_S|T1_3D_SIG_W|T1_3D_SIG_FC|T1_3D_SIG_BC)
+#define T1_3D_SIG_OTH (T1_3D_SIG_FOTH|T1_3D_SIG_BOTH|T1_3D_SIG_COTH)
+#define T1_3D_SIG_PRIM (T1_3D_SIG_N|T1_3D_SIG_E|T1_3D_SIG_S|T1_3D_SIG_W|T1_3D_SIG_FC|T1_3D_SIG_BC)
-#define T1_3D_SGN_N 0x0400
-#define T1_3D_SGN_E 0x0800
-#define T1_3D_SGN_S 0x1000
-#define T1_3D_SGN_W 0x2000
-#define T1_3D_SGN_F 0x4000
-#define T1_3D_SGN_B 0x8000
-#define T1_3D_SGN (T1_3D_SGN_N|T1_3D_SGN_E|T1_3D_SGN_S|T1_3D_SGN_W|T1_3D_SGN_F|T1_3D_SGN_B)
+#define T1_3D_SGN_N 0x0400
+#define T1_3D_SGN_E 0x0800
+#define T1_3D_SGN_S 0x1000
+#define T1_3D_SGN_W 0x2000
+#define T1_3D_SGN_F 0x4000
+#define T1_3D_SGN_B 0x8000
+#define T1_3D_SGN (T1_3D_SGN_N|T1_3D_SGN_E|T1_3D_SGN_S|T1_3D_SGN_W|T1_3D_SGN_F|T1_3D_SGN_B)
-#define T1_3D_SIG 0x0001 /*Significance state*/
-#define T1_3D_REFINE 0x0002 /*Delayed significance*/
-#define T1_3D_VISIT 0x0004 /*First-pass membership*/
+#define T1_3D_SIG 0x0001 /*Significance state*/
+#define T1_3D_REFINE 0x0002 /*Delayed significance*/
+#define T1_3D_VISIT 0x0004 /*First-pass membership*/
-#define T1_3D_NUMCTXS_AGG 1
-#define T1_3D_NUMCTXS_ZC 16
-#define T1_3D_NUMCTXS_MAG 3
-#define T1_3D_NUMCTXS_SC 6
-#define T1_3D_NUMCTXS_UNI 1
+#define T1_3D_NUMCTXS_AGG 1
+#define T1_3D_NUMCTXS_ZC 16
+#define T1_3D_NUMCTXS_MAG 3
+#define T1_3D_NUMCTXS_SC 6
+#define T1_3D_NUMCTXS_UNI 1
#define T1_3D_CTXNO_AGG 0
-#define T1_3D_CTXNO_ZC (T1_3D_CTXNO_AGG+T1_3D_NUMCTXS_AGG) /*1*/
-#define T1_3D_CTXNO_MAG (T1_3D_CTXNO_ZC+T1_3D_NUMCTXS_ZC) /*17*/
-#define T1_3D_CTXNO_SC (T1_3D_CTXNO_MAG+T1_3D_NUMCTXS_MAG) /*20*/
-#define T1_3D_CTXNO_UNI (T1_3D_CTXNO_SC+T1_3D_NUMCTXS_SC) /*26*/
-#define T1_3D_NUMCTXS (T1_3D_CTXNO_UNI+T1_3D_NUMCTXS_UNI) /*27*/
+#define T1_3D_CTXNO_ZC (T1_3D_CTXNO_AGG+T1_3D_NUMCTXS_AGG) /*1*/
+#define T1_3D_CTXNO_MAG (T1_3D_CTXNO_ZC+T1_3D_NUMCTXS_ZC) /*17*/
+#define T1_3D_CTXNO_SC (T1_3D_CTXNO_MAG+T1_3D_NUMCTXS_MAG) /*20*/
+#define T1_3D_CTXNO_UNI (T1_3D_CTXNO_SC+T1_3D_NUMCTXS_SC) /*26*/
+#define T1_3D_NUMCTXS (T1_3D_CTXNO_UNI+T1_3D_NUMCTXS_UNI) /*27*/
/* ----------------------------------------------------------------------- */
@@ -103,30 +103,30 @@ The functions in T1_3D.C are used by some function in TCD.C.
Tier-1 coding (coding of code-block coefficients)
*/
typedef struct opj_t1_3d {
- /** Codec context */
- opj_common_ptr cinfo;
- /** MQC component */
- opj_mqc_t *mqc;
- /** RAW component */
- opj_raw_t *raw;
- /** LUTs for decoding normalised MSE */
- int lut_nmsedec_sig[1 << T1_NMSEDEC_BITS];
- int lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS];
- int lut_nmsedec_ref[1 << T1_NMSEDEC_BITS];
- int lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS];
- /** Codeblock data */
- int data[T1_CBLKD][T1_CBLKH][T1_CBLKW];
- /** Context information for each voxel in codeblock */
- unsigned int flags[T1_CBLKD + 2][T1_CBLKH + 2][T1_CBLKH + 2];
- /** Voxel information (significance/visited/refined) */
- int flagSVR[T1_CBLKD + 2][T1_CBLKH + 2][T1_CBLKH + 2];
+ /** Codec context */
+ opj_common_ptr cinfo;
+ /** MQC component */
+ opj_mqc_t *mqc;
+ /** RAW component */
+ opj_raw_t *raw;
+ /** LUTs for decoding normalised MSE */
+ int lut_nmsedec_sig[1 << T1_NMSEDEC_BITS];
+ int lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS];
+ int lut_nmsedec_ref[1 << T1_NMSEDEC_BITS];
+ int lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS];
+ /** Codeblock data */
+ int data[T1_CBLKD][T1_CBLKH][T1_CBLKW];
+ /** Context information for each voxel in codeblock */
+ unsigned int flags[T1_CBLKD + 2][T1_CBLKH + 2][T1_CBLKH + 2];
+ /** Voxel information (significance/visited/refined) */
+ int flagSVR[T1_CBLKD + 2][T1_CBLKH + 2][T1_CBLKH + 2];
} opj_t1_3d_t;
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
-Create a new T1_3D handle
+Create a new T1_3D handle
and initialize the look-up tables of the Tier-1 coder/decoder
@return Returns a new T1 handle if successful, returns NULL otherwise
@see t1_init_luts
@@ -154,8 +154,8 @@ void t1_3d_decode_cblks(opj_t1_3d_t *t1, opj_tcd_tile_t *tile, opj_tcp_t *tcp);
/**
Get weigths of MSE decoding
@param nmsedec The normalized MSE reduction
-@param compno
-@param level
+@param compno
+@param level
@param orient
@param bpno
@param reversible
diff --git a/src/lib/openjp3d/t2.h b/src/lib/openjp3d/t2.h
index 2f24ac44..b11bc6a5 100644
--- a/src/lib/openjp3d/t2.h
+++ b/src/lib/openjp3d/t2.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -48,12 +48,12 @@
Tier-2 coding
*/
typedef struct opj_t2 {
-/** Codec context */
- opj_common_ptr cinfo;
-/** Encoding: pointer to the src volume. Decoding: pointer to the dst volume. */
- opj_volume_t *volume;
-/** Pointer to the volume coding parameters */
- opj_cp_t *cp;
+ /** Codec context */
+ opj_common_ptr cinfo;
+ /** Encoding: pointer to the src volume. Decoding: pointer to the dst volume. */
+ opj_volume_t *volume;
+ /** Pointer to the volume coding parameters */
+ opj_cp_t *cp;
} opj_t2_t;
/** @name Funciones generales */
@@ -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
diff --git a/src/lib/openjp3d/tcd.h b/src/lib/openjp3d/tcd.h
index 66f1e167..4c57494a 100644
--- a/src/lib/openjp3d/tcd.h
+++ b/src/lib/openjp3d/tcd.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -50,209 +50,209 @@ 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 */
- int numpasses;
-/** Length of information */
- int len;
-/** Data */
- unsigned char *data;
-/** Number of passes posible for the segment */
- int maxpasses;
-/** Number of passes added to the segment */
- int numnewpasses;
-/** New length after inclusion of segments */
- int newlen;
+ /** Number of passes in the segment */
+ int numpasses;
+ /** Length of information */
+ int len;
+ /** Data */
+ unsigned char *data;
+ /** Number of passes posible for the segment */
+ int maxpasses;
+ /** Number of passes added to the segment */
+ int numnewpasses;
+ /** New length after inclusion of segments */
+ int newlen;
} opj_tcd_seg_t;
/**
Tile coder/decoder: pass instance
*/
typedef struct opj_tcd_pass {
-/** Rate obtained in the pass*/
- int rate;
-/** Distorsion obtained in the pass*/
- double distortiondec;
- int term;
-/** Length of information */
- int len;
+ /** Rate obtained in the pass*/
+ int rate;
+ /** Distorsion obtained in the pass*/
+ double distortiondec;
+ int term;
+ /** Length of information */
+ int len;
} opj_tcd_pass_t;
/**
Tile coder/decoder: layer instance
*/
typedef struct opj_tcd_layer {
-/** Number of passes in the layer */
- int numpasses;
-/** Length of information */
- int len;
-/** Distortion within layer */
- double disto; /* add for index (Cfr. Marcela) */
- unsigned char *data; /* data */
+ /** Number of passes in the layer */
+ int numpasses;
+ /** Length of information */
+ int len;
+ /** Distortion within layer */
+ double disto; /* add for index (Cfr. Marcela) */
+ unsigned char *data; /* data */
} opj_tcd_layer_t;
/**
Tile coder/decoder: codeblock instance
*/
typedef struct opj_tcd_cblk {
-/** 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) */
- int x1, y1, z1;
-/** Number of bits per simbol in codeblock */
- int numbps;
- int numlenbits;
- int len; /* length */
-/** Number of pass already done for the code-blocks */
- int numpasses;
-/** number of pass added to the code-blocks */
- int numnewpasses;
-/** Number of segments */
- int numsegs;
-/** Segments informations */
- opj_tcd_seg_t segs[100];
-/** Number of passes in the layer */
- int numpassesinlayers;
-/** Layer information */
- opj_tcd_layer_t layers[100];
-/** Total number of passes */
- int totalpasses;
-/** Information about the passes */
- opj_tcd_pass_t passes[100];
-/* Data */
- unsigned char data[524288];
- /*unsigned char *data;*/
+ /** 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) */
+ int x1, y1, z1;
+ /** Number of bits per simbol in codeblock */
+ int numbps;
+ int numlenbits;
+ int len; /* length */
+ /** Number of pass already done for the code-blocks */
+ int numpasses;
+ /** number of pass added to the code-blocks */
+ int numnewpasses;
+ /** Number of segments */
+ int numsegs;
+ /** Segments informations */
+ opj_tcd_seg_t segs[100];
+ /** Number of passes in the layer */
+ int numpassesinlayers;
+ /** Layer information */
+ opj_tcd_layer_t layers[100];
+ /** Total number of passes */
+ int totalpasses;
+ /** Information about the passes */
+ opj_tcd_pass_t passes[100];
+ /* Data */
+ unsigned char data[524288];
+ /*unsigned char *data;*/
} opj_tcd_cblk_t;
/**
Tile coder/decoder: precint instance
*/
typedef struct opj_tcd_precinct {
-/** Dimension of the precint : left upper corner (x0, y0, z0) */
- int x0, y0, z0;
-/** 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*/
- int cblkno[3];
-/** Information about the codeblocks */
- opj_tcd_cblk_t *cblks;
-/** Inclusion tree */
- opj_tgt_tree_t *incltree;
-/** Missing MSBs tree */
- opj_tgt_tree_t *imsbtree;
+ /** Dimension of the precint : left upper corner (x0, y0, z0) */
+ int x0, y0, z0;
+ /** 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*/
+ int cblkno[3];
+ /** Information about the codeblocks */
+ opj_tcd_cblk_t *cblks;
+ /** Inclusion tree */
+ opj_tgt_tree_t *incltree;
+ /** Missing MSBs tree */
+ opj_tgt_tree_t *imsbtree;
} opj_tcd_precinct_t;
/**
Tile coder/decoder: subband instance
*/
typedef struct opj_tcd_band {
-/** Dimension of the subband : left upper corner (x0, y0, z0) */
- int x0, y0, z0;
-/** Dimension of the subband : right low corner (x1,y1,z1) */
- int x1, y1, z1;
-/** Information about the precints */
- opj_tcd_precinct_t *precincts; /* precinct information */
-/** Number of bits per symbol in band */
- int numbps;
-/** Quantization stepsize associated */
- float stepsize;
-/** Band orientation (O->LLL,...,7->HHH) */
- int bandno;
+ /** Dimension of the subband : left upper corner (x0, y0, z0) */
+ int x0, y0, z0;
+ /** Dimension of the subband : right low corner (x1,y1,z1) */
+ int x1, y1, z1;
+ /** Information about the precints */
+ opj_tcd_precinct_t *precincts; /* precinct information */
+ /** Number of bits per symbol in band */
+ int numbps;
+ /** Quantization stepsize associated */
+ float stepsize;
+ /** Band orientation (O->LLL,...,7->HHH) */
+ int bandno;
} opj_tcd_band_t;
/**
Tile coder/decoder: resolution instance
*/
typedef struct opj_tcd_resolution {
-/** 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) */
- int x1, y1, z1;
-/** Number of precints in each dimension for the resolution level */
- int prctno[3];
-/** Number of subbands for the resolution level */
- int numbands;
-/** Subband information */
- opj_tcd_band_t *bands;
+ /** 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) */
+ int x1, y1, z1;
+ /** Number of precints in each dimension for the resolution level */
+ int prctno[3];
+ /** Number of subbands for the resolution level */
+ int numbands;
+ /** Subband information */
+ opj_tcd_band_t *bands;
} opj_tcd_resolution_t;
/**
Tile coder/decoder: component instance
*/
typedef struct opj_tcd_tilecomp {
-/** Dimension of the component : left upper corner (x0, y0, z0) */
- int x0, y0, z0;
-/** Dimension of the component : right low corner (x1,y1,z1) */
- int x1, y1, z1;
-/** Number of resolutions level if DWT transform*/
- int numresolution[3];
-/** Resolution information */
- opj_tcd_resolution_t *resolutions;
-/** Data of the component */
- int *data;
-/** Fixed_quality related */
- int nbpix;
-/** Number of bits per voxel in component */
- int bpp;
+ /** Dimension of the component : left upper corner (x0, y0, z0) */
+ int x0, y0, z0;
+ /** Dimension of the component : right low corner (x1,y1,z1) */
+ int x1, y1, z1;
+ /** Number of resolutions level if DWT transform*/
+ int numresolution[3];
+ /** Resolution information */
+ opj_tcd_resolution_t *resolutions;
+ /** Data of the component */
+ int *data;
+ /** Fixed_quality related */
+ int nbpix;
+ /** Number of bits per voxel in component */
+ int bpp;
} opj_tcd_tilecomp_t;
/**
Tile coder/decoder: tile instance
*/
typedef struct opj_tcd_tile {
-/** Dimension of the tile : left upper corner (x0, y0, z0) */
- int x0, y0, z0;
-/** Dimension of the tile : right low corner (x1,y1,z1) */
- int x1, y1, z1;
-/** Number of components in tile */
- int numcomps;
-/** Components information */
- opj_tcd_tilecomp_t *comps;
-/** Fixed_quality related : no of bytes of data*/
- int nbpix;
-/** Fixed_quality related : distortion achieved in tile */
- double distotile;
-/** Fixed_quality related : distortion achieved in each layer */
- double distolayer[100];
+ /** Dimension of the tile : left upper corner (x0, y0, z0) */
+ int x0, y0, z0;
+ /** Dimension of the tile : right low corner (x1,y1,z1) */
+ int x1, y1, z1;
+ /** Number of components in tile */
+ int numcomps;
+ /** Components information */
+ opj_tcd_tilecomp_t *comps;
+ /** Fixed_quality related : no of bytes of data*/
+ int nbpix;
+ /** Fixed_quality related : distortion achieved in tile */
+ double distotile;
+ /** Fixed_quality related : distortion achieved in each layer */
+ double distolayer[100];
} opj_tcd_tile_t;
/**
Tile coder/decoder: volume instance
*/
typedef struct opj_tcd_volume {
-/** Number of tiles in width and heigth and length */
- int tw, th, tl;
-/** Tiles information */
- opj_tcd_tile_t *tiles;
+ /** Number of tiles in width and heigth and length */
+ int tw, th, tl;
+ /** Tiles information */
+ opj_tcd_tile_t *tiles;
} opj_tcd_volume_t;
/**
Tile coder/decoder
*/
typedef struct opj_tcd {
-/** Codec context */
- opj_common_ptr cinfo;
-/** Volume information */
- opj_volume_t *volume;
-/** Coding parameters */
- opj_cp_t *cp;
-/** Coding/decoding parameters common to all tiles */
- opj_tcp_t *tcp;
-/** Info on each volume tile */
- opj_tcd_volume_t *tcd_volume;
-/** Pointer to the current encoded/decoded tile */
- opj_tcd_tile_t *tcd_tile;
-/** Current encoded/decoded tile */
- int tcd_tileno;
+ /** Codec context */
+ opj_common_ptr cinfo;
+ /** Volume information */
+ opj_volume_t *volume;
+ /** Coding parameters */
+ opj_cp_t *cp;
+ /** Coding/decoding parameters common to all tiles */
+ opj_tcp_t *tcp;
+ /** Info on each volume tile */
+ opj_tcd_volume_t *tcd_volume;
+ /** Pointer to the current encoded/decoded tile */
+ opj_tcd_tile_t *tcd_tile;
+ /** Current encoded/decoded tile */
+ int tcd_tileno;
- /**@name working variables */
- /*@{*/
- opj_tcd_tile_t *tile;
- opj_tcd_tilecomp_t *tilec;
- opj_tcd_resolution_t *res;
- opj_tcd_band_t *band;
- opj_tcd_precinct_t *prc;
- opj_tcd_cblk_t *cblk;
- /*@}*/
+ /**@name working variables */
+ /*@{*/
+ opj_tcd_tile_t *tile;
+ opj_tcd_tilecomp_t *tilec;
+ opj_tcd_resolution_t *res;
+ opj_tcd_band_t *band;
+ opj_tcd_precinct_t *prc;
+ opj_tcd_cblk_t *cblk;
+ /*@}*/
} opj_tcd_t;
/** @name Funciones generales */
@@ -275,13 +275,14 @@ Destroy a previously created TCD handle
*/
void tcd_destroy(opj_tcd_t *tcd);
/**
-Initialize the tile coder (allocate the memory)
+Initialize the tile coder (allocate the memory)
@param tcd TCD handle
@param volume Raw volume
@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
@@ -314,9 +317,10 @@ Encode a tile from the raw volume into a buffer
@param dest Destination buffer
@param len Length of destination buffer
@param volume_info Creation of index file
-@return
+@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
diff --git a/src/lib/openjp3d/tgt.h b/src/lib/openjp3d/tgt.h
index f73c0f84..ae937191 100644
--- a/src/lib/openjp3d/tgt.h
+++ b/src/lib/openjp3d/tgt.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*
@@ -50,30 +50,30 @@ are used by some function in T2.C.
Tag node
*/
typedef struct opj_tgt_node {
-/** Node parent reference */
- struct opj_tgt_node *parent;
-/** */
- int value;
-/** */
- int low;
-/** */
- int known;
+ /** Node parent reference */
+ struct opj_tgt_node *parent;
+ /** */
+ int value;
+ /** */
+ int low;
+ /** */
+ int known;
} opj_tgt_node_t;
/**
Tag tree
*/
typedef struct opj_tgt_tree {
-/** Number of leaves from horizontal axis */
- int numleafsh;
-/** Number of leaves from vertical axis */
- int numleafsv;
-/** Number of leaves from axial axis */
- int numleafsz;
-/** Number of nodes */
- int numnodes;
-/** Reference to each node instance */
- opj_tgt_node_t *nodes;
+ /** Number of leaves from horizontal axis */
+ int numleafsh;
+ /** Number of leaves from vertical axis */
+ int numleafsv;
+ /** Number of leaves from axial axis */
+ int numleafsz;
+ /** Number of nodes */
+ int numnodes;
+ /** Reference to each node instance */
+ opj_tgt_node_t *nodes;
} opj_tgt_tree_t;
/** @name Funciones generales */
@@ -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 */
diff --git a/src/lib/openjp3d/volume.h b/src/lib/openjp3d/volume.h
index a8a0c850..8cc6102a 100644
--- a/src/lib/openjp3d/volume.h
+++ b/src/lib/openjp3d/volume.h
@@ -1,6 +1,6 @@
/*
- * 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
+ * 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.
*