OpenJPEG  1.5.1
j2k.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
3  * Copyright (c) 2002-2007, Professor Benoit Macq
4  * Copyright (c) 2001-2003, David Janssens
5  * Copyright (c) 2002-2003, Yannick Verschueren
6  * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
7  * Copyright (c) 2005, Herve Drolon, FreeImage Team
8  * Copyright (c) 2006-2007, Parvatha Elangovan
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  * notice, this list of conditions and the following disclaimer in the
18  * documentation and/or other materials provided with the distribution.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 #ifndef __J2K_H
33 #define __J2K_H
34 
43 
44 #define J2K_CP_CSTY_PRT 0x01
45 #define J2K_CP_CSTY_SOP 0x02
46 #define J2K_CP_CSTY_EPH 0x04
47 #define J2K_CCP_CSTY_PRT 0x01
48 #define J2K_CCP_CBLKSTY_LAZY 0x01
49 #define J2K_CCP_CBLKSTY_RESET 0x02
50 #define J2K_CCP_CBLKSTY_TERMALL 0x04
51 #define J2K_CCP_CBLKSTY_VSC 0x08
52 #define J2K_CCP_CBLKSTY_PTERM 0x10
53 #define J2K_CCP_CBLKSTY_SEGSYM 0x20
54 #define J2K_CCP_QNTSTY_NOQNT 0
55 #define J2K_CCP_QNTSTY_SIQNT 1
56 #define J2K_CCP_QNTSTY_SEQNT 2
57 
58 /* ----------------------------------------------------------------------- */
59 
60 #define J2K_MS_SOC 0xff4f
61 #define J2K_MS_SOT 0xff90
62 #define J2K_MS_SOD 0xff93
63 #define J2K_MS_EOC 0xffd9
64 #define J2K_MS_SIZ 0xff51
65 #define J2K_MS_COD 0xff52
66 #define J2K_MS_COC 0xff53
67 #define J2K_MS_RGN 0xff5e
68 #define J2K_MS_QCD 0xff5c
69 #define J2K_MS_QCC 0xff5d
70 #define J2K_MS_POC 0xff5f
71 #define J2K_MS_TLM 0xff55
72 #define J2K_MS_PLM 0xff57
73 #define J2K_MS_PLT 0xff58
74 #define J2K_MS_PPM 0xff60
75 #define J2K_MS_PPT 0xff61
76 #define J2K_MS_SOP 0xff91
77 #define J2K_MS_EPH 0xff92
78 #define J2K_MS_CRG 0xff63
79 #define J2K_MS_COM 0xff64
80 /* UniPG>> */
81 #ifdef USE_JPWL
82 #define J2K_MS_EPC 0xff68
83 #define J2K_MS_EPB 0xff66
84 #define J2K_MS_ESD 0xff67
85 #define J2K_MS_RED 0xff69
86 #endif /* USE_JPWL */
87 #ifdef USE_JPSEC
88 #define J2K_MS_SEC 0xff65
89 #define J2K_MS_INSEC 0xff94
90 #endif /* USE_JPSEC */
91 /* <<UniPG */
92 
93 
94 /* ----------------------------------------------------------------------- */
95 
100 typedef enum J2K_STATUS {
101  J2K_STATE_MHSOC = 0x0001,
102  J2K_STATE_MHSIZ = 0x0002,
103  J2K_STATE_MH = 0x0004,
104  J2K_STATE_TPHSOT = 0x0008,
105  J2K_STATE_TPH = 0x0010,
106  J2K_STATE_MT = 0x0020,
107  J2K_STATE_NEOC = 0x0040,
108  J2K_STATE_ERR = 0x0080
109 } J2K_STATUS;
110 
111 /* ----------------------------------------------------------------------- */
112 
116 typedef enum T2_MODE {
119 }J2K_T2_MODE;
120 
124 typedef struct opj_stepsize {
126  int expn;
128  int mant;
130 
134 typedef struct opj_tccp {
136  int csty;
140  int cblkw;
142  int cblkh;
144  int cblksty;
146  int qmfbid;
148  int qntsty;
152  int numgbits;
154  int roishift;
159 } opj_tccp_t;
160 
166 typedef struct opj_tcp {
168  int first;
170  int csty;
176  int mct;
178  float rates[100];
180  int numpocs;
182  int POC;
186  unsigned char *ppt_data;
188  unsigned char *ppt_data_first;
190  int ppt;
194  int ppt_len;
196  float distoratio[100];
199 } opj_tcp_t;
200 
204 typedef struct opj_cp {
210  int img_size;
214  char tp_on;
216  char tp_flag;
218  int tp_pos;
226  int reduce;
228  int layer;
232  int tx0;
234  int ty0;
236  int tdx;
238  int tdy;
240  char *comment;
242  int tw;
244  int th;
246  int *tileno;
250  unsigned char *ppm_data;
252  unsigned char *ppm_data_first;
254  int ppm;
260  int ppm_len;
264  int *matrice;
265 /* UniPG>> */
266 #ifdef USE_JPWL
267 
278  int hprot_MH;
296  int sens_MH;
307 #endif /* USE_JPWL */
308 /* <<UniPG */
309 } opj_cp_t;
310 
314 typedef struct opj_j2k {
317 
319  int state;
323  int tp_num;
335  int totnum_tp;
340  unsigned char *eot;
353  unsigned char **tile_data;
355  int *tile_len;
369 } opj_j2k_t;
370 
373 /* ----------------------------------------------------------------------- */
391 void j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters);
426 void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_t *image);
440 
441 /* ----------------------------------------------------------------------- */
445 
446 #endif /* __J2K_H */
opj_poc::compE
int compE
Definition: openjpeg.h:220
j2k_write_coc
static void j2k_write_coc(opj_j2k_t *j2k, int compno)
Write the COC marker (coding style component)
Definition: j2k.c:816
opj_cp::max_tiles
int max_tiles
maximum number of tiles at the decoder
Definition: j2k.h:306
j2k_dec_mstab
opj_dec_mstabent_t j2k_dec_mstab[]
Definition: j2k.c:1703
opj_tile_info::packet
opj_packet_info_t * packet
information concerning packets inside tile
Definition: openjpeg.h:652
opj_tccp::cblkw
int cblkw
code-blocks width
Definition: j2k.h:140
opj_codestream_info::numcomps
int numcomps
component numbers
Definition: openjpeg.h:698
opj_pi_iterator
Packet iterator.
Definition: pi.h:67
j2k_read_siz
static void j2k_read_siz(opj_j2k_t *j2k)
Read the SIZ marker (image and tile size)
Definition: j2k.c:405
opj_codestream_info::tw
int tw
number of tiles in X
Definition: openjpeg.h:694
j2k_prog_order_list
j2k_prog_order_t j2k_prog_order_list[]
Definition: j2k.c:260
opj_cp::hprot_MH
int hprot_MH
error protection method for MH (0,1,16,32,37-128)
Definition: j2k.h:278
opj_tcp::prg
OPJ_PROG_ORDER prg
progression order
Definition: j2k.h:172
tcd_malloc_encode
void tcd_malloc_encode(opj_tcd_t *tcd, opj_image_t *image, opj_cp_t *cp, int curtileno)
Initialize the tile coder (allocate the memory)
Definition: tcd.c:127
OPJ_PROG_ORDER
enum PROG_ORDER OPJ_PROG_ORDER
Progression order.
opj_cp::tp_pos
int tp_pos
Position of tile part flag in progression order.
Definition: j2k.h:218
opj_cparameters::tcp_rates
float tcp_rates[100]
rates of layers
Definition: openjpeg.h:262
opj_free
#define opj_free(m)
Deallocates or frees a memory block.
Definition: opj_malloc.h:152
opj_tile_info::marker
opj_marker_info_t * marker
list of markers
Definition: openjpeg.h:660
cio_numbytesleft
int cio_numbytesleft(opj_cio_t *cio)
Number of bytes left before the end of the stream.
Definition: cio.c:121
opj_image::x1
int x1
Xsiz: width of the reference grid.
Definition: openjpeg.h:539
opj_malloc
#define opj_malloc(size)
Allocate an uninitialized memory block.
Definition: opj_malloc.h:51
j2k_read_epb
void j2k_read_epb(opj_j2k_t *j2k)
Read the EPB marker (Error Protection Block)
Definition: jpwl.c:1019
opj_poc::layE
int layE
End value, initialised in pi_initialise_encode.
Definition: openjpeg.h:220
opj_marker_info_t::type
unsigned short int type
marker type
Definition: openjpeg.h:605
tcd_free_decode_tile
void tcd_free_decode_tile(opj_tcd_t *tcd, int tileno)
Definition: tcd.c:1560
J2K_MS_ESD
#define J2K_MS_ESD
ESD marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:84
opj_codestream_info::image_w
int image_w
image width
Definition: openjpeg.h:680
opj_j2k_t
struct opj_j2k opj_j2k_t
JPEG-2000 codestream reader/writer.
j2k_decode_jpt_stream
opj_image_t * j2k_decode_jpt_stream(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *cstr_info)
Decode an image form a JPT-stream (JPEG 2000, JPIP)
Definition: j2k.c:2029
opj_dec_mstabent_t
struct opj_dec_mstabent opj_dec_mstabent_t
j2k_setup_decoder
void j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters)
Setup the decoder decoding parameters using user parameters.
Definition: j2k.c:1892
opj_tcp::csty
int csty
coding style
Definition: j2k.h:170
opj_stepsize::expn
int expn
exponent
Definition: j2k.h:126
opj_cp::tdy
int tdy
YTsiz.
Definition: j2k.h:238
J2K_MS_PLT
#define J2K_MS_PLT
PLT marker value.
Definition: j2k.h:73
j2k_write_sot
static void j2k_write_sot(opj_j2k_t *j2k)
Write the SOT marker (start of tile-part)
Definition: j2k.c:1274
opj_codestream_info::D_max
double D_max
maximum distortion reduction on the whole image (add for Marcela)
Definition: openjpeg.h:674
opj_tccp::qntsty
int qntsty
quantisation style
Definition: j2k.h:148
opj_cparameters::cp_tx0
int cp_tx0
XTOsiz.
Definition: openjpeg.h:234
opj_j2k
JPEG-2000 codestream reader/writer.
Definition: j2k.h:314
j2k_read_qcd
static void j2k_read_qcd(opj_j2k_t *j2k)
Read the QCD marker (quantization default)
Definition: j2k.c:972
opj_tp_info::tp_end_header
int tp_end_header
end position of tile part header
Definition: openjpeg.h:620
OPJ_LIMIT_DECODING
enum LIMIT_DECODING OPJ_LIMIT_DECODING
Limit decoding to certain portions of the codestream.
J2K_STATUS
J2K_STATUS
Values that specify the status of the decoding process when decoding the main header.
Definition: j2k.h:100
opj_cparameters::tcp_numlayers
int tcp_numlayers
number of layers
Definition: openjpeg.h:260
opj_stepsize::mant
int mant
mantissa
Definition: j2k.h:128
j2k_destroy_compress
void j2k_destroy_compress(opj_j2k_t *j2k)
Destroy a J2K compressor handle.
Definition: j2k.c:2127
opj_cp::max_comp_size
int max_comp_size
Maximum rate for each component.
Definition: j2k.h:208
j2k_read_poc
static void j2k_read_poc(opj_j2k_t *j2k)
Read the POC marker (progression order change)
Definition: j2k.c:1074
opj_marker_info_t::len
int len
length, marker val included
Definition: openjpeg.h:609
j2k_write_com
static void j2k_write_com(opj_j2k_t *j2k)
Write the COM marker (comment)
Definition: j2k.c:644
opj_marker_info_t
Marker structure.
Definition: openjpeg.h:603
opj_tcd::cur_totnum_tp
int cur_totnum_tp
Total number of tileparts of the current tile.
Definition: tcd.h:181
opj_tcp::ppt_data_first
unsigned char * ppt_data_first
pointer remaining on the first byte of the first header if ppt is used
Definition: j2k.h:188
opj_tccp::qmfbid
int qmfbid
discrete wavelet transform identifier
Definition: j2k.h:146
opj_cparameters::tcp_distoratio
float tcp_distoratio[100]
different psnr for successive layers
Definition: openjpeg.h:264
J2K_STATE_MT
@ J2K_STATE_MT
the EOC marker has just been read
Definition: j2k.h:106
j2k_read_plm
static void j2k_read_plm(opj_j2k_t *j2k)
Read the PLM marker (packet length, main header)
Definition: j2k.c:1134
opj_cp::pprot_tileno
int pprot_tileno[JPWL_MAX_NO_PACKSPECS]
tile number of packet protection specification (>=0)
Definition: j2k.h:284
THRESH_CALC
@ THRESH_CALC
Definition: j2k.h:117
opj_codestream_info::image_h
int image_h
image height
Definition: openjpeg.h:682
opj_j2k::cio
opj_cio_t * cio
pointer to the byte i/o stream
Definition: j2k.h:368
opj_codestream_info::maxmarknum
int maxmarknum
actual size of markers array
Definition: openjpeg.h:709
J2K_STATE_MHSOC
@ J2K_STATE_MHSOC
a SOC marker is expected
Definition: j2k.h:101
OPJ_ARG_NOT_USED
#define OPJ_ARG_NOT_USED(x)
Definition: openjpeg.h:68
opj_j2k::tp_num
int tp_num
Tile part number.
Definition: j2k.h:323
opj_tccp::prch
int prch[J2K_MAXRLVLS]
precinct height
Definition: j2k.h:158
opj_tccp::roishift
int roishift
Region Of Interest shift.
Definition: j2k.h:154
opj_image_comp::prec
int prec
precision
Definition: openjpeg.h:517
opj_cparameters::cblockh_init
int cblockh_init
initial code block height, default to 64
Definition: openjpeg.h:270
opj_cp::rsiz
OPJ_RSIZ_CAPABILITIES rsiz
Rsiz.
Definition: j2k.h:212
opj_packet_info::end_pos
int end_pos
packet end position
Definition: openjpeg.h:593
j2k_read_sot
static void j2k_read_sot(opj_j2k_t *j2k)
Read the SOT marker (start of tile-part)
Definition: j2k.c:1304
J2K_MS_PPT
#define J2K_MS_PPT
PPT marker value.
Definition: j2k.h:75
opj_tcp::ppt_len
int ppt_len
ppmbug1
Definition: j2k.h:194
opj_cp::sens_MH
int sens_MH
sensitivity method for MH (-1,0-7)
Definition: j2k.h:296
opj_cp::esd_on
opj_bool esd_on
enables writing of ESD, in case of activated JPWL
Definition: j2k.h:272
tcd_free_decode
void tcd_free_decode(opj_tcd_t *tcd)
Free the memory allocated for decoding.
Definition: tcd.c:1549
J2K_MS_COC
#define J2K_MS_COC
COC marker value.
Definition: j2k.h:66
opj_poc::compno1
int compno1
Definition: openjpeg.h:206
opj_tcp::ppt_data
unsigned char * ppt_data
packet header store there for futur use in t2_decode_packet
Definition: j2k.h:186
opj_cparameters::res_spec
int res_spec
Definition: openjpeg.h:280
j2k_destroy_decompress
void j2k_destroy_decompress(opj_j2k_t *j2k)
Destroy a J2K decompressor handle.
Definition: j2k.c:1835
opj_cparameters::cp_fixed_quality
int cp_fixed_quality
add fixed_quality
Definition: openjpeg.h:246
J2K_MS_SEC
#define J2K_MS_SEC
SEC marker value (Part 8: Secure JPEG 2000)
Definition: j2k.h:88
opj_codestream_info::numlayers
int numlayers
number of layer
Definition: openjpeg.h:700
opj_tccp::csty
int csty
coding style
Definition: j2k.h:136
j2k_create_decompress
opj_j2k_t * j2k_create_decompress(opj_common_ptr cinfo)
Creates a J2K decompression structure.
Definition: j2k.c:1818
opj_cparameters::prcw_init
int prcw_init[J2K_MAXRLVLS]
initial precinct width
Definition: openjpeg.h:282
opj_j2k::image
opj_image_t * image
pointer to the encoded / decoded image
Definition: j2k.h:362
PCRL
@ PCRL
precinct-component-resolution-layer order
Definition: openjpeg.h:123
J2K_MS_SOP
#define J2K_MS_SOP
SOP marker value.
Definition: j2k.h:76
int_ceildiv
static INLINE int int_ceildiv(int a, int b)
Divide an integer and round upwards.
Definition: int.h:86
j2k_get_num_tp
static int j2k_get_num_tp(opj_cp_t *cp, int pino, int tileno)
Definition: j2k.c:280
opj_cp::exp_comps
int exp_comps
expected number of components at the decoder
Definition: j2k.h:304
J2K_MS_INSEC
#define J2K_MS_INSEC
INSEC marker value (Part 8: Secure JPEG 2000)
Definition: j2k.h:89
opj_cparameters::jpwl_sens_TPH_tileno
int jpwl_sens_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of sensitivity specification (>=0)
Definition: openjpeg.h:336
opj_tcd_tile::packno
int packno
packet number
Definition: tcd.h:159
opj_cparameters::prch_init
int prch_init[J2K_MAXRLVLS]
initial precinct height
Definition: openjpeg.h:284
opj_codestream_info::main_head_start
int main_head_start
main header position
Definition: openjpeg.h:712
opj_poc::compno0
int compno0
Definition: openjpeg.h:204
opj_tile_info::pdy
int pdy[33]
precinct size (in power of 2), in Y for each resolution level
Definition: openjpeg.h:650
tcd_decode_tile
opj_bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno, opj_codestream_info_t *cstr_info)
Decode a tile from a buffer into a raw image.
Definition: tcd.c:1331
J2K_CCP_QNTSTY_SEQNT
#define J2K_CCP_QNTSTY_SEQNT
Definition: j2k.h:56
opj_cp::fixed_alloc
int fixed_alloc
allocation by fixed layer
Definition: j2k.h:222
opj_j2k::pos_correction
int pos_correction
as the J2K-file is written in several parts during encoding, it enables to make the right correction ...
Definition: j2k.h:351
opj_cp::sens_TPH
int sens_TPH[JPWL_MAX_NO_TILESPECS]
sensitivity methods for TPHs (-1,0-7)
Definition: j2k.h:300
j2k_read_eoc
static void j2k_read_eoc(opj_j2k_t *j2k)
Read the EOC marker (end of codestream)
Definition: j2k.c:1649
opj_cparameters::cp_comment
char * cp_comment
comment for coding
Definition: openjpeg.h:250
opj_tccp::stepsizes
opj_stepsize_t stepsizes[J2K_MAXBANDS]
stepsizes used for quantization
Definition: j2k.h:150
j2k_prog_order::str_prog
char str_prog[5]
Definition: j2k.c:257
opj_cparameters::jpwl_sens_size
int jpwl_sens_size
enables writing of ESD, (0=no/1/2 bytes)
Definition: openjpeg.h:328
opj_cparameters::prog_order
OPJ_PROG_ORDER prog_order
progression order (default LRCP)
Definition: openjpeg.h:254
opj_packet_info::start_pos
int start_pos
packet start position (including SOP marker if it exists)
Definition: openjpeg.h:589
J2K_MAXBANDS
#define J2K_MAXBANDS
Number of maximum sub-band linked to number of resolution level.
Definition: openjpeg.h:78
j2k_add_mhmarker
static void j2k_add_mhmarker(opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len)
Add main header marker information.
Definition: j2k.c:2627
opj_image_comp::dx
int dx
XRsiz: horizontal separation of a sample of ith component with respect to the reference grid.
Definition: openjpeg.h:505
opj_cparameters::numpocs
int numpocs
number of progression order changes (POC), default to 0
Definition: openjpeg.h:258
opj_cp::disto_alloc
int disto_alloc
allocation by rate/distortion
Definition: j2k.h:220
opj_image_comp
Defines a single image component.
Definition: openjpeg.h:503
opj_calloc
#define opj_calloc(num, size)
Allocate a memory block with elements initialized to 0.
Definition: opj_malloc.h:63
j2k_create_compress
opj_j2k_t * j2k_create_compress(opj_common_ptr cinfo)
Creates a J2K compression structure.
Definition: j2k.c:2119
opj_tile_info::start_pos
int start_pos
start position
Definition: openjpeg.h:638
tcd_malloc_decode_tile
void tcd_malloc_decode_tile(opj_tcd_t *tcd, opj_image_t *image, opj_cp_t *cp, int tileno, opj_codestream_info_t *cstr_info)
Definition: tcd.c:681
opj_image_comp::sgnd
int sgnd
signed (1) / unsigned (0)
Definition: openjpeg.h:521
J2K_MS_EPC
#define J2K_MS_EPC
EPC marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:82
opj_poc::resE
int resE
Definition: openjpeg.h:220
opj_cp::pprot_packno
int pprot_packno[JPWL_MAX_NO_PACKSPECS]
packet number of packet protection specification (>=0)
Definition: j2k.h:286
j2k_write_rgn
static void j2k_write_rgn(opj_j2k_t *j2k, int compno, int tileno)
Write the RGN marker (region-of-interest)
Definition: j2k.c:1586
opj_cparameters::jpwl_pprot_tileno
int jpwl_pprot_tileno[JPWL_MAX_NO_PACKSPECS]
tile number of packet protection specification (>=0)
Definition: openjpeg.h:322
opj_cparameters::tile_size_on
opj_bool tile_size_on
size of tile: tile_size_on = false (not in argument) or = true (in argument)
Definition: openjpeg.h:232
opj_cp::ppm_data_first
unsigned char * ppm_data_first
pointer remaining on the first byte of the first header if ppm is used
Definition: j2k.h:252
opj_cp
Coding parameters.
Definition: j2k.h:204
j2k_read_com
static void j2k_read_com(opj_j2k_t *j2k)
Read the COM marker (comment)
Definition: j2k.c:671
opj_j2k::curtileno
int curtileno
number of the tile curently concern by coding/decoding
Definition: j2k.h:321
J2K_STATE_MH
@ J2K_STATE_MH
the decoding process is in the main header
Definition: j2k.h:103
j2k_create_compress
opj_j2k_t * j2k_create_compress(opj_common_ptr cinfo)
Creates a J2K compression structure.
Definition: j2k.c:2119
opj_poc::resno0
int resno0
Resolution num start, Component num start, given by POC.
Definition: openjpeg.h:204
opj_tile_info::maxmarknum
int maxmarknum
actual size of markers array
Definition: openjpeg.h:662
opj_cparameters::numresolution
int numresolution
number of resolutions
Definition: openjpeg.h:266
cio_read
unsigned int cio_read(opj_cio_t *cio, int n)
Read some bytes.
Definition: cio.c:183
opj_dparameters::jpwl_exp_comps
int jpwl_exp_comps
expected number of components
Definition: openjpeg.h:398
opj_cparameters
Compression parameters.
Definition: openjpeg.h:230
opj_cp::matrice
int * matrice
fixed layer
Definition: j2k.h:264
opj_tcp::numlayers
int numlayers
number of layers
Definition: j2k.h:174
opj_jpt_msg_header::Class_Id
unsigned int Class_Id
Class Identifier.
Definition: jpt.h:48
J2K_MS_PPM
#define J2K_MS_PPM
PPM marker value.
Definition: j2k.h:74
opj_cparameters::cp_tdx
int cp_tdx
XTsiz.
Definition: openjpeg.h:238
opj_tcp::ppt
int ppt
If ppt == 1 --> there was a PPT marker for the present tile.
Definition: j2k.h:190
opj_stepsize
Quantization stepsize.
Definition: j2k.h:124
tcd_encode_tile
int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len, opj_codestream_info_t *cstr_info)
Encode a tile from the raw image into a buffer.
Definition: tcd.c:1182
opj_j2k::cinfo
opj_common_ptr cinfo
codec context
Definition: j2k.h:316
opj_cp::hprot_TPH_tileno
int hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of header protection specification (>=0)
Definition: j2k.h:280
EVT_WARNING
#define EVT_WARNING
Warning event type.
Definition: event.h:36
opj_cparameters::irreversible
int irreversible
1 : use the irreversible DWT 9-7, 0 : use lossless compression (default)
Definition: openjpeg.h:274
opj_j2k::sot_start
int sot_start
locate the start position of the SOT marker of the current coded tile: after encoding the tile,...
Definition: j2k.h:345
J2K_MS_TLM
#define J2K_MS_TLM
TLM marker value.
Definition: j2k.h:71
opj_realloc
#define opj_realloc(m, s)
Reallocate memory blocks.
Definition: opj_malloc.h:142
opj_tcp::ppt_store
int ppt_store
used in case of multiple marker PPT (number of info already stored)
Definition: j2k.h:192
opj_tcp::first
int first
1 : first part-tile of a tile
Definition: j2k.h:168
J2K_MS_RED
#define J2K_MS_RED
RED marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:85
OPJ_RSIZ_CAPABILITIES
enum RSIZ_CAPABILITIES OPJ_RSIZ_CAPABILITIES
Rsiz Capabilities.
opj_image_comp::w
int w
data width
Definition: openjpeg.h:509
opj_image::x0
int x0
XOsiz: horizontal offset from the origin of the reference grid to the left side of the image area.
Definition: openjpeg.h:535
opj_cparameters::cp_ty0
int cp_ty0
YTOsiz.
Definition: openjpeg.h:236
opj_cp::ppm
int ppm
if ppm == 1 --> there was a PPM marker for the present tile
Definition: j2k.h:254
opj_cparameters::cp_cinema
OPJ_CINEMA_MODE cp_cinema
Digital Cinema compliance 0-not compliant, 1-compliant.
Definition: openjpeg.h:343
opj_tile_info::end_header
int end_header
end position of the header
Definition: openjpeg.h:640
T2_MODE
T2_MODE
T2 encoding mode.
Definition: j2k.h:116
LRCP
@ LRCP
layer-resolution-component-precinct order
Definition: openjpeg.h:120
opj_cp::sens_TPH_tileno
int sens_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of sensitivity specification (>=0)
Definition: j2k.h:298
j2k_write_cox
static void j2k_write_cox(opj_j2k_t *j2k, int compno)
Write the value concerning the specified component in the marker COD and COC.
Definition: j2k.c:680
J2K_MS_QCC
#define J2K_MS_QCC
QCC marker value.
Definition: j2k.h:69
opj_cp::tcps
opj_tcp_t * tcps
tile coding parameters
Definition: j2k.h:262
J2K_MS_SIZ
#define J2K_MS_SIZ
SIZ marker value.
Definition: j2k.h:64
opj_poc::prg
OPJ_PROG_ORDER prg
Definition: openjpeg.h:210
cio_write
unsigned int cio_write(opj_cio_t *cio, unsigned int64 v, int n)
Write some bytes.
Definition: cio.c:167
j2k_read_soc
static void j2k_read_soc(opj_j2k_t *j2k)
Read the SOC marker (Start of Codestream)
Definition: j2k.c:361
opj_j2k::cur_tp_num
int cur_tp_num
Tilepart number currently coding.
Definition: j2k.h:325
pi_destroy
void pi_destroy(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno)
Destroy a packet iterator.
Definition: pi.c:721
jpwl_encode
void jpwl_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image)
Encode according to JPWL specs.
Definition: jpwl.c:114
opj_includes.h
J2K_MS_SOT
#define J2K_MS_SOT
SOT marker value.
Definition: j2k.h:61
opj_cp_t
struct opj_cp opj_cp_t
Coding parameters.
opj_cio
Byte input-output stream (CIO)
Definition: openjpeg.h:475
opj_tp_info::tp_start_pos
int tp_start_pos
start position of tile part
Definition: openjpeg.h:618
opj_codestream_info::marker
opj_marker_info_t * marker
list of markers
Definition: openjpeg.h:707
tcd_init_encode
void tcd_init_encode(opj_tcd_t *tcd, opj_image_t *image, opj_cp_t *cp, int curtileno)
Initialize the tile coder (reuses the memory allocated by tcd_malloc_encode)
Definition: tcd.c:402
tcd_create
opj_tcd_t * tcd_create(opj_common_ptr cinfo)
Create a new TCD handle.
Definition: tcd.c:101
j2k_read_ppt
static void j2k_read_ppt(opj_j2k_t *j2k)
Read the PPT marker (packet packet headers, tile-part header)
Definition: j2k.c:1234
opj_tp_info
Index structure : Information concerning tile-parts.
Definition: openjpeg.h:616
j2k_create_decompress
opj_j2k_t * j2k_create_decompress(opj_common_ptr cinfo)
Creates a J2K decompression structure.
Definition: j2k.c:1818
opj_image_destroy
void OPJ_CALLCONV opj_image_destroy(opj_image_t *image)
Deallocate any resources associated with an image.
Definition: image.c:73
J2K_MS_SOC
#define J2K_MS_SOC
SOC marker value.
Definition: j2k.h:60
j2k_prog_order_t
struct j2k_prog_order j2k_prog_order_t
j2k_write_cod
static void j2k_write_cod(opj_j2k_t *j2k)
Write the COD marker (coding style default)
Definition: j2k.c:752
opj_dec_mstabent::handler
void(* handler)(opj_j2k_t *j2k)
action linked to the marker
Definition: j2k.c:1700
opj_poc::resno1
int resno1
Definition: openjpeg.h:206
opj_tcd_image::tiles
opj_tcd_tile_t * tiles
Definition: tcd.h:167
JPWL_MAXIMUM_HAMMING
#define JPWL_MAXIMUM_HAMMING
Expect this maximum number of bit errors in marker id's.
Definition: openjpeg.h:87
J2K_T2_MODE
enum T2_MODE J2K_T2_MODE
T2 encoding mode.
j2k_prog_order::enum_prog
OPJ_PROG_ORDER enum_prog
Definition: j2k.c:256
j2k_decode
opj_image_t * j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *cstr_info)
Decode an image from a JPEG-2000 codestream.
Definition: j2k.c:1912
tcd_free_encode
void tcd_free_encode(opj_tcd_t *tcd)
Free the memory allocated for encoding.
Definition: tcd.c:355
opj_cp::correct
opj_bool correct
enables JPWL correction at the decoder
Definition: j2k.h:302
opj_cp::tw
int tw
number of tiles in width
Definition: j2k.h:242
opj_image::y0
int y0
YOsiz: vertical offset from the origin of the reference grid to the top side of the image area.
Definition: openjpeg.h:537
opj_cp::tx0
int tx0
XTOsiz.
Definition: j2k.h:232
j2k_write_poc
static void j2k_write_poc(opj_j2k_t *j2k)
Write the POC marker (progression order change)
Definition: j2k.c:1046
opj_dparameters::jpwl_correct
opj_bool jpwl_correct
activates the JPWL correction capabilities
Definition: openjpeg.h:396
j2k_read_qcx
static void j2k_read_qcx(opj_j2k_t *j2k, int compno, int len)
Read the value concerning the specified component in the marker QCD and QCC.
Definition: j2k.c:880
opj_cp::info_on
opj_bool info_on
enables writing of informative techniques of ESD, in case of activated JPWL
Definition: j2k.h:274
J2K_STATE_TPH
@ J2K_STATE_TPH
the decoding process is in a tile part header
Definition: j2k.h:105
J2K_MS_RGN
#define J2K_MS_RGN
RGN marker value.
Definition: j2k.h:67
int_floorlog2
static INLINE int int_floorlog2(int a)
Get logarithm of an integer and round downwards.
Definition: int.h:107
opj_cparameters::tp_flag
char tp_flag
Flag for Tile part generation.
Definition: openjpeg.h:351
opj_cp::limit_decoding
OPJ_LIMIT_DECODING limit_decoding
if == NO_LIMITATION, decode entire codestream; if == LIMIT_TO_MAIN_HEADER then only decode the main h...
Definition: j2k.h:230
j2k_decode_jpt_stream
opj_image_t * j2k_decode_jpt_stream(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *cstr_info)
Decode an image form a JPT-stream (JPEG 2000, JPIP)
Definition: j2k.c:2029
opj_image_create0
opj_image_t * opj_image_create0(void)
Create an empty image.
Definition: image.c:29
j2k_read_qcc
static void j2k_read_qcc(opj_j2k_t *j2k)
Read the QCC marker (quantization component)
Definition: j2k.c:1002
opj_dparameters::cp_limit_decoding
OPJ_LIMIT_DECODING cp_limit_decoding
Specify whether the decoding should be done on the entire codestream, or be limited to the main heade...
Definition: openjpeg.h:410
int_min
static INLINE int int_min(int a, int b)
Get the minimum of two integers.
Definition: int.h:50
opj_cparameters::jpwl_sens_range
int jpwl_sens_range
sensitivity range (0-3)
Definition: openjpeg.h:332
opj_cparameters::jpwl_epc_on
opj_bool jpwl_epc_on
enables writing of EPC in MH, thus activating JPWL
Definition: openjpeg.h:314
LIMIT_TO_MAIN_HEADER
@ LIMIT_TO_MAIN_HEADER
The decoding is limited to the Main Header.
Definition: openjpeg.h:157
opj_cparameters::jpwl_sens_TPH
int jpwl_sens_TPH[JPWL_MAX_NO_TILESPECS]
sensitivity methods for TPHs (-1=no,0-7)
Definition: openjpeg.h:338
j2k_read_cox
static void j2k_read_cox(opj_j2k_t *j2k, int compno)
Read the value concerning the specified component in the marker COD and COC.
Definition: j2k.c:701
opj_tccp::numresolutions
int numresolutions
number of resolutions
Definition: j2k.h:138
opj_tile_info::pdx
int pdx[33]
precinct size (in power of 2), in X for each resolution level
Definition: openjpeg.h:648
opj_cparameters::jpwl_sens_MH
int jpwl_sens_MH
sensitivity method for MH (-1=no,0-7)
Definition: openjpeg.h:334
opj_tile_info::tileno
int tileno
number of tile
Definition: openjpeg.h:636
J2K_CCP_CSTY_PRT
#define J2K_CCP_CSTY_PRT
Definition: j2k.h:47
cio_tell
int OPJ_CALLCONV cio_tell(opj_cio_t *cio)
Get position in byte stream.
Definition: cio.c:100
opj_j2k::tile_len
int * tile_len
array used to store the length of each tile
Definition: j2k.h:355
J2K_MS_EOC
#define J2K_MS_EOC
EOC marker value.
Definition: j2k.h:63
opj_tile_info::num_tps
int num_tps
number of tile parts
Definition: openjpeg.h:664
J2K_STATE_TPHSOT
@ J2K_STATE_TPHSOT
the decoding process is in a tile part header and expects a SOT marker
Definition: j2k.h:104
opj_tcp::rates
float rates[100]
rates of layers
Definition: j2k.h:178
opj_tcp::mct
int mct
multi-component transform identifier
Definition: j2k.h:176
opj_cp::pprot
int pprot[JPWL_MAX_NO_PACKSPECS]
error protection methods for packets (0,1,16,32,37-128)
Definition: j2k.h:288
opj_dec_mstabent::id
int id
marker value
Definition: j2k.c:1696
opj_cp::th
int th
number of tiles in heigth
Definition: j2k.h:244
opj_dec_mstabent
Definition: j2k.c:1694
opj_codestream_info::packno
int packno
packet number
Definition: openjpeg.h:676
opj_image_comp::dy
int dy
YRsiz: vertical separation of a sample of ith component with respect to the reference grid.
Definition: openjpeg.h:507
opj_codestream_info::tile_Ox
int tile_Ox
Definition: openjpeg.h:690
opj_cparameters::jpwl_pprot
int jpwl_pprot[JPWL_MAX_NO_PACKSPECS]
error protection methods for packets (0,1,16,32,37-128)
Definition: openjpeg.h:326
opj_cp::ppm_store
int ppm_store
use in case of multiple marker PPM (number of info already store)
Definition: j2k.h:256
OPJ_TRUE
#define OPJ_TRUE
Definition: openjpeg.h:64
opj_cparameters::jpwl_sens_addr
int jpwl_sens_addr
sensitivity addressing size (0=auto/2/4 bytes)
Definition: openjpeg.h:330
opj_cparameters::roi_compno
int roi_compno
region of interest: affected component in [0..3], -1 means no ROI
Definition: openjpeg.h:276
opj_dparameters::cp_layer
int cp_layer
Set the maximum number of quality layers to decode.
Definition: openjpeg.h:378
j2k_write_sod
static void j2k_write_sod(opj_j2k_t *j2k, void *tile_coder)
Write the SOD marker (start of data)
Definition: j2k.c:1454
j2k_read_coc
static void j2k_read_coc(opj_j2k_t *j2k)
Read the COC marker (coding style component)
Definition: j2k.c:836
J2K_STATE_ERR
@ J2K_STATE_ERR
the decoding process has encountered an error
Definition: j2k.h:108
opj_cparameters::POC
opj_poc_t POC[32]
progression order changes
Definition: openjpeg.h:256
opj_tcp::numpocs
int numpocs
number of progression order changes
Definition: j2k.h:180
J2K_MS_COM
#define J2K_MS_COM
COM marker value.
Definition: j2k.h:79
j2k_read_plt
static void j2k_read_plt(opj_j2k_t *j2k)
Read the PLT marker (packet length, tile-part header)
Definition: j2k.c:1159
opj_poc::layno1
int layno1
Layer num end,Resolution num end, Component num end, given by POC.
Definition: openjpeg.h:206
opj_cp::reduce
int reduce
if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, image is decoded to the ...
Definition: j2k.h:226
opj_cparameters::tcp_mct
char tcp_mct
MCT (multiple component transform)
Definition: openjpeg.h:353
opj_poc::prcE
int prcE
Definition: openjpeg.h:220
opj_stepsize_t
struct opj_stepsize opj_stepsize_t
Quantization stepsize.
opj_cparameters::cp_fixed_alloc
int cp_fixed_alloc
allocation by fixed layer
Definition: openjpeg.h:244
opj_event_msg
opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt,...)
Write formatted data to a string and send the string to a user callback.
Definition: event.c:76
cio_skip
void cio_skip(opj_cio_t *cio, int n)
Skip some bytes.
Definition: cio.c:198
opj_common_struct
Definition: openjpeg.h:430
j2k_read_crg
static void j2k_read_crg(opj_j2k_t *j2k)
Read the CRG marker (component registration)
Definition: j2k.c:1103
J2K_MS_PLM
#define J2K_MS_PLM
PLM marker value.
Definition: j2k.h:72
opj_jpt_msg_header
Message Header JPT stream structure.
Definition: jpt.h:42
opj_tccp::numgbits
int numgbits
number of guard bits
Definition: j2k.h:152
opj_j2k::sod_start
int sod_start
Definition: j2k.h:346
j2k_convert_progression_order
char * j2k_convert_progression_order(OPJ_PROG_ORDER prg_order)
Converts an enum type progression order to string type.
Definition: j2k.c:269
opj_cparameters::jpwl_hprot_TPH_tileno
int jpwl_hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of header protection specification (>=0)
Definition: openjpeg.h:318
opj_tcp::distoratio
float distoratio[100]
add fixed_quality
Definition: j2k.h:196
tcd_destroy
void tcd_destroy(opj_tcd_t *tcd)
Destroy a previously created TCD handle.
Definition: tcd.c:118
j2k_read_tlm
static void j2k_read_tlm(opj_j2k_t *j2k)
Read the TLM marker (tile-part lengths)
Definition: j2k.c:1116
opj_cp::ty0
int ty0
YTOsiz.
Definition: j2k.h:234
opj_tcd::cur_pino
int cur_pino
Current Packet iterator number.
Definition: tcd.h:183
opj_tcp
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
Definition: j2k.h:166
opj_tcp::tccps
opj_tccp_t * tccps
tile-component coding parameters
Definition: j2k.h:198
opj_cp::epc_on
opj_bool epc_on
enables writing of EPC in MH, thus activating JPWL
Definition: j2k.h:268
opj_cp::tp_on
char tp_on
Enabling Tile part generation.
Definition: j2k.h:214
J2K_CP_CSTY_PRT
#define J2K_CP_CSTY_PRT
Definition: j2k.h:44
CPRL
@ CPRL
component-precinct-resolution-layer order
Definition: openjpeg.h:124
opj_j2k::cur_totnum_tp
int * cur_totnum_tp
Total number of tileparts of the current tile.
Definition: j2k.h:327
JPWL_ASSUME
#define JPWL_ASSUME
Assume a basic codestream structure, so you can resort better from uncorrected errors.
Definition: jpwl.h:52
opj_codestream_info::main_head_end
int main_head_end
main header position
Definition: openjpeg.h:714
CINEMA4K_24
@ CINEMA4K_24
2K Digital Cinema at 48 fps
Definition: openjpeg.h:112
opj_jpt_msg_header::Msg_length
unsigned int Msg_length
Message length.
Definition: jpt.h:54
j2k_write_qcc
static void j2k_write_qcc(opj_j2k_t *j2k, int compno)
Write the QCC marker (quantization component)
Definition: j2k.c:986
opj_j2k::tile_data
unsigned char ** tile_data
array used to store the data of each tile
Definition: j2k.h:353
opj_cp::ppm_data
unsigned char * ppm_data
packet header store there for futur use in t2_decode_packet
Definition: j2k.h:250
opj_cp::tileno
int * tileno
ID number of the tiles present in the codestream.
Definition: j2k.h:246
EVT_INFO
#define EVT_INFO
Debug event type.
Definition: event.h:37
opj_bool
int opj_bool
Definition: openjpeg.h:63
opj_cparameters::cp_disto_alloc
int cp_disto_alloc
allocation by rate/distortion
Definition: openjpeg.h:242
opj_tccp
Tile-component coding parameters.
Definition: j2k.h:134
opj_image_comp::factor
int factor
number of division by 2 of the out image compared to the original size of image
Definition: openjpeg.h:525
opj_image_comp::resno_decoded
int resno_decoded
number of decoded resolution
Definition: openjpeg.h:523
tcd_malloc_decode
void tcd_malloc_decode(opj_tcd_t *tcd, opj_image_t *image, opj_cp_t *cp)
Initialize the tile decoder.
Definition: tcd.c:616
OPJ_CINEMA_MODE
enum CINEMA_MODE OPJ_CINEMA_MODE
Digital cinema operation mode.
opj_tcd::tcd_image
opj_tcd_image_t * tcd_image
info on each image tile
Definition: tcd.h:188
j2k_read_red
void j2k_read_red(opj_j2k_t *j2k)
Read the RED marker (Residual Error Descriptor)
Definition: jpwl.c:1200
j2k_read_cod
static void j2k_read_cod(opj_j2k_t *j2k)
Read the COD marker (coding style default)
Definition: j2k.c:783
j2k_setup_encoder
void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_t *image)
Setup the encoder parameters using the current image and using user parameters.
Definition: j2k.c:2150
j2k_prog_order
Definition: j2k.c:255
opj_cparameters::roi_shift
int roi_shift
region of interest: upshift value
Definition: openjpeg.h:278
j2k_write_qcx
static void j2k_write_qcx(opj_j2k_t *j2k, int compno)
Write the value concerning the specified component in the marker QCD and QCC.
Definition: j2k.c:856
opj_cp::sens_size
int sens_size
enables writing of ESD, (0/2/4 bytes)
Definition: j2k.h:290
opj_cparameters::cblockw_init
int cblockw_init
initial code block width, default to 64
Definition: openjpeg.h:268
opj_poc::tile
int tile
Tile number.
Definition: openjpeg.h:214
opj_tile_info::marknum
int marknum
number of markers
Definition: openjpeg.h:658
j2k_read_esd
void j2k_read_esd(opj_j2k_t *j2k)
Read the ESD marker (Error Sensitivity Descriptor)
Definition: jpwl.c:1170
opj_marker_info_t::pos
int pos
position in codestream
Definition: openjpeg.h:607
opj_cp::hprot_TPH
int hprot_TPH[JPWL_MAX_NO_TILESPECS]
error protection methods for TPHs (0,1,16,32,37-128)
Definition: j2k.h:282
opj_dparameters
Decompression parameters.
Definition: openjpeg.h:363
opj_image_comp::h
int h
data height
Definition: openjpeg.h:511
opj_cp::comment
char * comment
comment for coding
Definition: j2k.h:240
j2k_write_qcd
static void j2k_write_qcd(opj_j2k_t *j2k)
Write the QCD marker (quantization default)
Definition: j2k.c:954
j2k_read_epc
void j2k_read_epc(opj_j2k_t *j2k)
Read the EPC marker (Error Protection Capability)
Definition: jpwl.c:907
cio_seek
void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos)
Set position in byte stream.
Definition: cio.c:109
opj_image::comps
opj_image_comp_t * comps
image components
Definition: openjpeg.h:547
opj_codestream_info::prog
OPJ_PROG_ORDER prog
progression order
Definition: openjpeg.h:684
opj_tcp::pocs
opj_poc_t pocs[32]
progression order changes
Definition: j2k.h:184
opj_j2k::totnum_tp
int totnum_tp
Total num of tile parts in whole image = num tiles* num tileparts in each tile.
Definition: j2k.h:335
j2k_write_tlm
static void j2k_write_tlm(opj_j2k_t *j2k)
Write the TLM marker (Mainheader)
Definition: j2k.c:1262
opj_codestream_info::tile
opj_tile_info_t * tile
information regarding tiles inside image
Definition: openjpeg.h:718
opj_tcd::tp_pos
int tp_pos
Position of the tilepart flag in Progression order.
Definition: tcd.h:175
JPWL_MAX_NO_PACKSPECS
#define JPWL_MAX_NO_PACKSPECS
Maximum number of packet parts expected by JPWL: increase at your will.
Definition: openjpeg.h:82
opj_j2k::default_tcp
opj_tcp_t * default_tcp
decompression only : store decoding parameters common to all tiles (information like COD,...
Definition: j2k.h:360
FINAL_PASS
@ FINAL_PASS
Function called in Rate allocation process.
Definition: j2k.h:118
opj_tccp::cblksty
int cblksty
code-block coding style
Definition: j2k.h:144
opj_cp::cinema
OPJ_CINEMA_MODE cinema
Digital cinema profile.
Definition: j2k.h:206
opj_tccp_t
struct opj_tccp opj_tccp_t
Tile-component coding parameters.
JPWL_MAX_NO_TILESPECS
#define JPWL_MAX_NO_TILESPECS
Maximum number of tile parts expected by JPWL: increase at your will.
Definition: openjpeg.h:81
opj_codestream_info::tile_Oy
int tile_Oy
Definition: openjpeg.h:692
opj_codestream_info
Index structure of the codestream.
Definition: openjpeg.h:672
opj_dec_mstabent::states
int states
value of the state when the marker can appear
Definition: j2k.c:1698
opj_j2k::eot
unsigned char * eot
locate the position of the end of the tile in the codestream, used to detect a truncated codestream (...
Definition: j2k.h:340
opj_j2k::tlm_start
int tlm_start
locate the start position of the TLM marker after encoding the tilepart, a jump (in j2k_write_sod) ...
Definition: j2k.h:332
opj_tcp_t
struct opj_tcp opj_tcp_t
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
j2k_add_tlmarker
static void j2k_add_tlmarker(int tileno, opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len)
Add tile header marker information.
Definition: j2k.c:2646
opj_cp::img_size
int img_size
Size of the image in bits.
Definition: j2k.h:210
opj_dparameters::jpwl_max_tiles
int jpwl_max_tiles
maximum number of tiles
Definition: openjpeg.h:400
EVT_ERROR
#define EVT_ERROR
Error event type.
Definition: event.h:35
opj_tccp::prcw
int prcw[J2K_MAXRLVLS]
precinct width
Definition: j2k.h:156
j2k_calculate_tp
int j2k_calculate_tp(opj_cp_t *cp, int img_numcomp, opj_image_t *image, opj_j2k_t *j2k)
mem allocation for TLM marker
Definition: j2k.c:316
j2k_add_marker
void j2k_add_marker(opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len)
Definition: jpwl.c:164
jpt_read_msg_header
void jpt_read_msg_header(opj_common_ptr cinfo, opj_cio_t *cio, opj_jpt_msg_header_t *header)
Read the message header for a JPP/JPT - stream.
Definition: jpt.c:83
RPCL
@ RPCL
resolution-precinct-component-layer order
Definition: openjpeg.h:122
opj_cparameters::tp_on
char tp_on
Tile part generation.
Definition: openjpeg.h:349
opj_cparameters::mode
int mode
mode switch (cblk_style)
Definition: openjpeg.h:272
opj_cp::ppm_previous
int ppm_previous
use in case of multiple marker PPM (case on non-finished previous info)
Definition: j2k.h:258
opj_tile_info::tp
opj_tp_info_t * tp
information concerning tile parts
Definition: openjpeg.h:666
opj_tile_info
Index structure : information regarding tiles.
Definition: openjpeg.h:632
j2k_read_ppm
static void j2k_read_ppm(opj_j2k_t *j2k)
Read the PPM marker (packet packet headers, main header)
Definition: j2k.c:1176
opj_cparameters::jpwl_pprot_packno
int jpwl_pprot_packno[JPWL_MAX_NO_PACKSPECS]
packet number of packet protection specification (>=0)
Definition: openjpeg.h:324
cio_getbp
unsigned char * cio_getbp(opj_cio_t *cio)
Get pointer to the current position in the stream.
Definition: cio.c:129
J2K_STATE_MHSIZ
@ J2K_STATE_MHSIZ
a SIZ marker is expected
Definition: j2k.h:102
opj_cparameters::cp_tdy
int cp_tdy
YTsiz.
Definition: openjpeg.h:240
j2k_read_unk
static void j2k_read_unk(opj_j2k_t *j2k)
Read an unknown marker.
Definition: j2k.c:1738
opj_cparameters::csty
int csty
csty : coding style
Definition: openjpeg.h:252
OPJ_FALSE
#define OPJ_FALSE
Definition: openjpeg.h:65
opj_poc::prg1
OPJ_PROG_ORDER prg1
Progression order enum.
Definition: openjpeg.h:210
j2k_setup_encoder
void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_t *image)
Setup the encoder parameters using the current image and using user parameters.
Definition: j2k.c:2150
j2k_convert_progression_order
char * j2k_convert_progression_order(OPJ_PROG_ORDER prg_order)
Converts an enum type progression order to string type.
Definition: j2k.c:269
opj_cp::red_on
opj_bool red_on
enables writing of RED, in case of activated JPWL
Definition: j2k.h:276
opj_codestream_info::tile_y
int tile_y
tile size in y
Definition: openjpeg.h:688
pi_initialise_encode
opj_pi_iterator_t * pi_initialise_encode(opj_image_t *image, opj_cp_t *cp, int tileno, J2K_T2_MODE t2_mode)
Create a packet iterator for Encoder.
Definition: pi.c:576
j2k_read_sod
static void j2k_read_sod(opj_j2k_t *j2k)
Read the SOD marker (start of data)
Definition: j2k.c:1527
opj_tcp::POC
int POC
indicates if a POC marker has been used O:NO, 1:YES
Definition: j2k.h:182
j2k_decode
opj_image_t * j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *cstr_info)
Decode an image from a JPEG-2000 codestream.
Definition: j2k.c:1912
opj_image::y1
int y1
Ysiz: height of the reference grid.
Definition: openjpeg.h:541
opj_j2k::cp
opj_cp_t * cp
pointer to the coding parameters
Definition: j2k.h:364
opj_cparameters::cp_rsiz
OPJ_RSIZ_CAPABILITIES cp_rsiz
Profile name.
Definition: openjpeg.h:347
opj_j2k::cstr_info
opj_codestream_info_t * cstr_info
helper used to write the index file
Definition: j2k.h:366
opj_codestream_info::numdecompos
int * numdecompos
number of decomposition for each component
Definition: openjpeg.h:702
dwt_calc_explicit_stepsizes
void dwt_calc_explicit_stepsizes(opj_tccp_t *tccp, int prec)
Explicit calculation of the Quantization Stepsizes.
Definition: dwt.c:477
j2k_destroy_decompress
void j2k_destroy_decompress(opj_j2k_t *j2k)
Destroy a J2K decompressor handle.
Definition: j2k.c:1835
opj_cp::tp_flag
char tp_flag
Flag determining tile part generation.
Definition: j2k.h:216
j2k_dec_mstab_lookup
static opj_dec_mstabent_t * j2k_dec_mstab_lookup(int id)
Read the lookup table containing all the marker, status and action.
Definition: j2k.c:1804
jpwl_correct
opj_bool jpwl_correct(opj_j2k_t *j2k)
corrects the data in the JPWL codestream
Definition: jpwl_lib.c:546
opj_j2k::state
int state
locate in which part of the codestream the decoder is (main header, tile header, end)
Definition: j2k.h:319
jpt_init_msg_header
void jpt_init_msg_header(opj_jpt_msg_header_t *header)
Initialize the value of the message header structure.
Definition: jpt.c:56
opj_cp::tdx
int tdx
XTsiz.
Definition: j2k.h:236
j2k_encode
opj_bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info)
Encode an image into a JPEG-2000 codestream.
Definition: j2k.c:2408
opj_cp::ppm_len
int ppm_len
ppmbug1
Definition: j2k.h:260
opj_cp::epb_on
opj_bool epb_on
enables writing of EPB, in case of activated JPWL
Definition: j2k.h:270
J2K_MAXRLVLS
#define J2K_MAXRLVLS
Number of maximum resolution level authorized.
Definition: openjpeg.h:77
j2k_read_sec
void j2k_read_sec(opj_j2k_t *j2k)
Read the SEC marker (SEcured Codestream)
Definition: jpwl.c:1310
opj_codestream_info::th
int th
number of tiles in Y
Definition: openjpeg.h:696
J2K_CCP_QNTSTY_SIQNT
#define J2K_CCP_QNTSTY_SIQNT
Definition: j2k.h:55
J2K_CCP_QNTSTY_NOQNT
#define J2K_CCP_QNTSTY_NOQNT
Definition: j2k.h:54
J2K_MS_COD
#define J2K_MS_COD
COD marker value.
Definition: j2k.h:65
opj_tccp::cblkh
int cblkh
code-blocks height
Definition: j2k.h:142
opj_tp_info::tp_end_pos
int tp_end_pos
end position of tile part
Definition: openjpeg.h:622
opj_image
Defines image data and characteristics.
Definition: openjpeg.h:533
opj_cparameters::jpwl_hprot_TPH
int jpwl_hprot_TPH[JPWL_MAX_NO_TILESPECS]
error protection methods for TPHs (0,1,16,32,37-128)
Definition: openjpeg.h:320
J2K_MS_POC
#define J2K_MS_POC
POC marker value.
Definition: j2k.h:70
opj_cparameters::jpwl_hprot_MH
int jpwl_hprot_MH
error protection method for MH (0,1,16,32,37-128)
Definition: openjpeg.h:316
opj_cp::tileno_size
int tileno_size
size of the vector tileno
Definition: j2k.h:248
opj_tcd::cur_tp_num
int cur_tp_num
Current tile part number.
Definition: tcd.h:179
opj_poc
Progression order changes.
Definition: openjpeg.h:202
J2K_MS_CRG
#define J2K_MS_CRG
CRG marker value.
Definition: j2k.h:78
opj_cp::layer
int layer
if != 0, then only the first "layer" layers are decoded; if == 0 or not used, all the quality layers ...
Definition: j2k.h:228
opj_tp_info::tp_numpacks
int tp_numpacks
number of packets of tile part
Definition: openjpeg.h:626
j2k_setup_decoder
void j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters)
Setup the decoder decoding parameters using user parameters.
Definition: j2k.c:1892
opj_tcd::tp_num
int tp_num
Tile part number.
Definition: tcd.h:177
j2k_read_rgn
static void j2k_read_rgn(opj_j2k_t *j2k)
Read the RGN marker (region-of-interest)
Definition: j2k.c:1599
J2K_STATE_NEOC
@ J2K_STATE_NEOC
the decoding process must not expect a EOC marker because the codestream is truncated
Definition: j2k.h:107
j2k_write_eoc
static void j2k_write_eoc(opj_j2k_t *j2k)
Write the EOC marker (end of codestream)
Definition: j2k.c:1636
RLCP
@ RLCP
resolution-layer-component-precinct order
Definition: openjpeg.h:121
opj_codestream_info::tile_x
int tile_x
tile size in x
Definition: openjpeg.h:686
opj_cparameters::cp_matrice
int * cp_matrice
fixed layer
Definition: openjpeg.h:248
j2k_encode
opj_bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info)
Encode an image into a JPEG-2000 codestream.
Definition: j2k.c:2408
DECODE_ALL_BUT_PACKETS
@ DECODE_ALL_BUT_PACKETS
Decode everything except the JPEG 2000 packets.
Definition: openjpeg.h:158
opj_cp::sens_addr
int sens_addr
sensitivity addressing size (0=auto/2/4 bytes)
Definition: j2k.h:292
opj_dparameters::cp_reduce
int cp_reduce
Set the number of highest resolution levels to be discarded.
Definition: openjpeg.h:371
opj_image::numcomps
int numcomps
number of components in the image
Definition: openjpeg.h:543
opj_codestream_info::marknum
int marknum
number of markers
Definition: openjpeg.h:705
j2k_read_insec
void j2k_read_insec(opj_j2k_t *j2k)
Read the INSEC marker (SEcured Codestream)
Definition: jpwl.c:1341
opj_tcd
Tile coder/decoder.
Definition: tcd.h:173
J2K_MS_QCD
#define J2K_MS_QCD
QCD marker value.
Definition: j2k.h:68
J2K_MS_EPB
#define J2K_MS_EPB
EPB marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:83
J2K_MS_SOD
#define J2K_MS_SOD
SOD marker value.
Definition: j2k.h:62
j2k_destroy_compress
void j2k_destroy_compress(opj_j2k_t *j2k)
Destroy a J2K compressor handle.
Definition: j2k.c:2127
opj_cp::sens_range
int sens_range
sensitivity range (0-3)
Definition: j2k.h:294
opj_cparameters::max_comp_size
int max_comp_size
Maximum rate for each component.
Definition: openjpeg.h:345
opj_tp_info::tp_start_pack
int tp_start_pack
start packet of tile part
Definition: openjpeg.h:624
opj_tile_info::end_pos
int end_pos
end position
Definition: openjpeg.h:642
j2k_write_siz
static void j2k_write_siz(opj_j2k_t *j2k)
Write the SIZ marker (image and tile size)
Definition: j2k.c:370
opj_cp::fixed_quality
int fixed_quality
add fixed_quality
Definition: j2k.h:224
j2k_write_soc
static void j2k_write_soc(opj_j2k_t *j2k)
Write the SOC marker (Start Of Codestream)
Definition: j2k.c:345
opj_codestream_info::codestream_size
int codestream_size
codestream's size
Definition: openjpeg.h:716