OpenJPEG  1.5.1
pi.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  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #ifndef __PI_H
33 #define __PI_H
34 
45 
49 typedef struct opj_pi_resolution {
50  int pdx, pdy;
51  int pw, ph;
53 
57 typedef struct opj_pi_comp {
58  int dx, dy;
63 
67 typedef struct opj_pi_iterator {
69  char tp_on;
71  short int *include;
73  int step_l;
75  int step_r;
77  int step_c;
79  int step_p;
81  int compno;
83  int resno;
85  int precno;
87  int layno;
89  int first;
93  int numcomps;
96  int tx0, ty0, tx1, ty1;
97  int x, y, dx, dy;
99 
102 /* ----------------------------------------------------------------------- */
112 opj_pi_iterator_t *pi_initialise_encode(opj_image_t *image, opj_cp_t *cp, int tileno,J2K_T2_MODE t2_mode);
125 opj_bool pi_create_encode(opj_pi_iterator_t *pi, opj_cp_t *cp,int tileno, int pino,int tpnum, int tppos, J2K_T2_MODE t2_mode,int cur_totnum_tp);
134 opj_pi_iterator_t *pi_create_decode(opj_image_t * image, opj_cp_t * cp, int tileno);
135 
143 void pi_destroy(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno);
144 
151 /* ----------------------------------------------------------------------- */
155 
156 #endif /* __PI_H */
opj_poc::compE
int compE
Definition: openjpeg.h:220
opj_pi_resolution
FIXME: documentation.
Definition: pi.h:49
opj_tile_info::packet
opj_packet_info_t * packet
information concerning packets inside tile
Definition: openjpeg.h:652
opj_pi_iterator::first
int first
0 if the first packet
Definition: pi.h:89
opj_codestream_info::numcomps
int numcomps
component numbers
Definition: openjpeg.h:698
opj_pi_iterator
Packet iterator.
Definition: pi.h:67
opj_pi_comp_t
struct opj_pi_comp opj_pi_comp_t
FIXME: documentation.
opj_codestream_info::tw
int tw
number of tiles in X
Definition: openjpeg.h:694
opj_tcp::prg
OPJ_PROG_ORDER prg
progression order
Definition: j2k.h:172
opj_pi_iterator::ty1
int ty1
Definition: pi.h:96
opj_poc::prcS
int prcS
Definition: openjpeg.h:218
opj_free
#define opj_free(m)
Deallocates or frees a memory block.
Definition: opj_malloc.h:152
opj_image::x1
int x1
Xsiz: width of the reference grid.
Definition: openjpeg.h:539
opj_poc::ty0_t
int ty0_t
Definition: openjpeg.h:224
opj_malloc
#define opj_malloc(size)
Allocate an uninitialized memory block.
Definition: opj_malloc.h:51
int_max
static INLINE int int_max(int a, int b)
Get the maximum of two integers.
Definition: int.h:57
opj_poc::layE
int layE
End value, initialised in pi_initialise_encode.
Definition: openjpeg.h:220
opj_tile_info::ph
int ph[33]
precinct number for each resolution level (height)
Definition: openjpeg.h:646
PROG_UNKNOWN
@ PROG_UNKNOWN
place-holder
Definition: openjpeg.h:119
pi_next
opj_bool pi_next(opj_pi_iterator_t *pi)
Modify the packet iterator to point to the next packet.
Definition: pi.c:710
opj_pi_iterator::dy
int dy
Definition: pi.h:97
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:543
opj_jp2_box::type
int type
Definition: jp2.h:152
opj_cp::tdy
int tdy
YTsiz.
Definition: j2k.h:238
opj_poc::lay_t
int lay_t
Temporary values for Tile parts, initialised in pi_create_encode.
Definition: openjpeg.h:224
pi_next_rpcl
static opj_bool pi_next_rpcl(opj_pi_iterator_t *pi)
Get next packet in resolution-precinct-component-layer order.
Definition: pi.c:161
opj_poc::tyS
int tyS
Definition: openjpeg.h:222
opj_pi_iterator::comps
opj_pi_comp_t * comps
Components.
Definition: pi.h:95
opj_pi_comp
FIXME: documentation.
Definition: pi.h:57
opj_pi_iterator::ty0
int ty0
Definition: pi.h:96
opj_tccp::prch
int prch[J2K_MAXRLVLS]
precinct height
Definition: j2k.h:158
opj_poc::dy
int dy
Definition: openjpeg.h:222
opj_poc::compno1
int compno1
Definition: openjpeg.h:206
pi_next_lrcp
static opj_bool pi_next_lrcp(opj_pi_iterator_t *pi)
Get next packet in layer-resolution-component-precinct order.
Definition: pi.c:82
opj_codestream_info::numlayers
int numlayers
number of layer
Definition: openjpeg.h:700
JPIP_PHIX
#define JPIP_PHIX
Definition: indexbox_manager.h:51
opj_tccp::csty
int csty
coding style
Definition: j2k.h:136
opj_poc::layS
int layS
Start value, initialised in pi_initialise_encode.
Definition: openjpeg.h:218
PCRL
@ PCRL
precinct-component-resolution-layer order
Definition: openjpeg.h:123
pi_next_cprl
static opj_bool pi_next_cprl(opj_pi_iterator_t *pi)
Get next packet in component-precinct-resolution-layer order.
Definition: pi.c:325
opj_poc::tx0_t
int tx0_t
Definition: openjpeg.h:224
int_ceildiv
static INLINE int int_ceildiv(int a, int b)
Divide an integer and round upwards.
Definition: int.h:86
pi_create_encode
opj_bool pi_create_encode(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno, int pino, int tpnum, int tppos, J2K_T2_MODE t2_mode, int cur_totnum_tp)
Modify the packet iterator for enabling tile part generation.
Definition: pi.c:729
opj_poc::compno0
int compno0
Definition: openjpeg.h:204
opj_pi_comp::numresolutions
int numresolutions
number of resolution levels
Definition: pi.h:60
opj_pi_iterator::y
int y
Definition: pi.h:97
opj_pi_resolution_t
struct opj_pi_resolution opj_pi_resolution_t
FIXME: documentation.
opj_poc::layno0
int layno0
Layer num start,Precinct num start, Precinct num end.
Definition: openjpeg.h:208
opj_poc::txS
int txS
Start and end values of Tile width and height, initialised in pi_initialise_encode.
Definition: openjpeg.h:222
opj_packet_info::start_pos
int start_pos
packet start position (including SOP marker if it exists)
Definition: openjpeg.h:589
opj_pi_iterator::precno
int precno
precinct that identify the packet
Definition: pi.h:85
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_calloc
#define opj_calloc(num, size)
Allocate a memory block with elements initialized to 0.
Definition: opj_malloc.h:63
opj_poc::resE
int resE
Definition: openjpeg.h:220
opj_pi_comp::dx
int dx
Definition: pi.h:58
pi_create_decode
opj_pi_iterator_t * pi_create_decode(opj_image_t *image, opj_cp_t *cp, int tileno)
Create a packet iterator for Decoder.
Definition: pi.c:410
opj_pi_iterator::step_c
int step_c
component step used to localize the packet in the include vector
Definition: pi.h:77
opj_packet_info::end_ph_pos
int end_ph_pos
end of packet header position (including EPH marker if it exists)
Definition: openjpeg.h:591
opj_cp
Coding parameters.
Definition: j2k.h:204
pi_next
opj_bool pi_next(opj_pi_iterator_t *pi)
Modify the packet iterator to point to the next packet.
Definition: pi.c:710
opj_poc::resno0
int resno0
Resolution num start, Component num start, given by POC.
Definition: openjpeg.h:204
opj_tcp::numlayers
int numlayers
number of layers
Definition: j2k.h:174
opj_pi_iterator::layno
int layno
layer that identify the packet
Definition: pi.h:87
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_poc::prc_t
int prc_t
Definition: openjpeg.h:224
LRCP
@ LRCP
layer-resolution-component-precinct order
Definition: openjpeg.h:120
opj_poc::comp_t
int comp_t
Definition: openjpeg.h:224
opj_cp::tcps
opj_tcp_t * tcps
tile coding parameters
Definition: j2k.h:262
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
pi_destroy
void pi_destroy(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno)
Destroy a packet iterator.
Definition: pi.c:688
opj_pi_iterator::tx1
int tx1
Definition: pi.h:96
opj_includes.h
opj_pi_resolution::ph
int ph
Definition: pi.h:51
opj_cio
Byte input-output stream (CIO)
Definition: openjpeg.h:475
opj_poc::precno0
int precno0
Definition: openjpeg.h:208
pi_next_pcrl
static opj_bool pi_next_pcrl(opj_pi_iterator_t *pi)
Get next packet in precinct-component-resolution-layer order.
Definition: pi.c:244
opj_jp2_box
JP2 Box.
Definition: jp2.h:150
opj_pi_iterator::include
short int * include
precise if the packet has been already used (usefull for progression order change)
Definition: pi.h:71
opj_poc::resno1
int resno1
Definition: openjpeg.h:206
J2K_T2_MODE
enum T2_MODE J2K_T2_MODE
T2 encoding mode.
pi_create_encode
opj_bool pi_create_encode(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno, int pino, int tpnum, int tppos, J2K_T2_MODE t2_mode, int cur_totnum_tp)
Modify the packet iterator for enabling tile part generation.
Definition: pi.c:729
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
write_phix
int write_phix(int coff, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
Definition: phix_manager.c:53
int_min
static INLINE int int_min(int a, int b)
Get the minimum of two integers.
Definition: int.h:50
opj_tccp::numresolutions
int numresolutions
number of resolutions
Definition: j2k.h:138
opj_poc::txE
int txE
Definition: openjpeg.h:222
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_pi_comp::resolutions
opj_pi_resolution_t * resolutions
Definition: pi.h:61
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_poc::resS
int resS
Definition: openjpeg.h:218
OPJ_TRUE
#define OPJ_TRUE
Definition: openjpeg.h:64
opj_poc::ty1
int ty1
Definition: openjpeg.h:216
opj_pi_resolution::pdy
int pdy
Definition: pi.h:50
int_ceildivpow2
static INLINE int int_ceildivpow2(int a, int b)
Divide an integer by a power of 2 and round upwards.
Definition: int.h:93
opj_pi_resolution::pdx
int pdx
Definition: pi.h:50
opj_pi_iterator::step_r
int step_r
resolution step used to localize the packet in the include vector
Definition: pi.h:75
opj_tcp::numpocs
int numpocs
number of progression order changes
Definition: j2k.h:180
opj_poc::layno1
int layno1
Layer num end,Resolution num end, Component num end, given by POC.
Definition: openjpeg.h:206
opj_pi_iterator::x
int x
Definition: pi.h:97
opj_poc::prcE
int prcE
Definition: openjpeg.h:220
cio_skip
void cio_skip(opj_cio_t *cio, int n)
Skip some bytes.
Definition: cio.c:198
opj_pi_iterator::tx0
int tx0
Definition: pi.h:96
pi_destroy
void pi_destroy(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno)
Destroy a packet iterator.
Definition: pi.c:688
opj_packet_info
Index structure : Information concerning a packet inside tile.
Definition: openjpeg.h:587
opj_poc::res_t
int res_t
Definition: openjpeg.h:224
opj_cp::ty0
int ty0
YTOsiz.
Definition: j2k.h:234
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::tp_on
char tp_on
Enabling Tile part generation.
Definition: j2k.h:214
opj_poc::tx1
int tx1
Definition: openjpeg.h:216
CPRL
@ CPRL
component-precinct-resolution-layer order
Definition: openjpeg.h:124
pi_next_rlcp
static opj_bool pi_next_rlcp(opj_pi_iterator_t *pi)
Get next packet in resolution-layer-component-precinct order.
Definition: pi.c:122
write_manf
void write_manf(int second, int v, opj_jp2_box_t *box, opj_cio_t *cio)
Definition: cidx_manager.c:143
opj_poc::ty0
int ty0
Definition: openjpeg.h:216
opj_bool
int opj_bool
Definition: openjpeg.h:63
opj_tccp
Tile-component coding parameters.
Definition: j2k.h:134
write_phixfaix
int write_phixfaix(int coff, int compno, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio)
Definition: phix_manager.c:85
opj_pi_iterator_t
struct opj_pi_iterator opj_pi_iterator_t
Packet iterator.
opj_pi_iterator::resno
int resno
resolution that identify the packet
Definition: pi.h:83
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_codestream_info::tile
opj_tile_info_t * tile
information regarding tiles inside image
Definition: openjpeg.h:718
opj_poc::compS
int compS
Definition: openjpeg.h:218
FINAL_PASS
@ FINAL_PASS
Function called in Rate allocation process.
Definition: j2k.h:118
opj_cp::cinema
OPJ_CINEMA_MODE cinema
Digital cinema profile.
Definition: j2k.h:206
opj_pi_iterator::dx
int dx
Definition: pi.h:97
opj_codestream_info
Index structure of the codestream.
Definition: openjpeg.h:672
opj_poc::dx
int dx
Definition: openjpeg.h:222
opj_tccp::prcw
int prcw[J2K_MAXRLVLS]
precinct width
Definition: j2k.h:156
RPCL
@ RPCL
resolution-precinct-component-layer order
Definition: openjpeg.h:122
opj_poc::precno1
int precno1
Definition: openjpeg.h:208
opj_tile_info
Index structure : information regarding tiles.
Definition: openjpeg.h:632
opj_pi_iterator::step_p
int step_p
precinct step used to localize the packet in the include vector
Definition: pi.h:79
opj_jp2_box::length
int length
Definition: jp2.h:151
opj_poc::tyE
int tyE
Definition: openjpeg.h:222
int_floordivpow2
static INLINE int int_floordivpow2(int a, int b)
Divide an integer by a power of 2 and round downwards.
Definition: int.h:100
OPJ_FALSE
#define OPJ_FALSE
Definition: openjpeg.h:65
opj_poc::prg1
OPJ_PROG_ORDER prg1
Progression order enum.
Definition: openjpeg.h:210
opj_poc::tx0
int tx0
Start and end values for Tile width and height.
Definition: openjpeg.h:216
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:543
opj_pi_iterator::tp_on
char tp_on
Enabling Tile part generation.
Definition: pi.h:69
opj_tcp::POC
int POC
indicates if a POC marker has been used O:NO, 1:YES
Definition: j2k.h:182
opj_image::y1
int y1
Ysiz: height of the reference grid.
Definition: openjpeg.h:541
JPIP_FAIX
#define JPIP_FAIX
Definition: indexbox_manager.h:46
opj_codestream_info::numdecompos
int * numdecompos
number of decomposition for each component
Definition: openjpeg.h:702
opj_pi_iterator::compno
int compno
component that identify the packet
Definition: pi.h:81
opj_pi_comp::dy
int dy
Definition: pi.h:58
pi_create_decode
opj_pi_iterator_t * pi_create_decode(opj_image_t *image, opj_cp_t *cp, int tileno)
Create a packet iterator for Decoder.
Definition: pi.c:410
opj_cp::tdx
int tdx
XTsiz.
Definition: j2k.h:236
opj_codestream_info::th
int th
number of tiles in Y
Definition: openjpeg.h:696
opj_image
Defines image data and characteristics.
Definition: openjpeg.h:533
opj_pi_iterator::step_l
int step_l
layer step used to localize the packet in the include vector
Definition: pi.h:73
opj_pi_iterator::numcomps
int numcomps
number of components in the image
Definition: pi.h:93
opj_poc
Progression order changes.
Definition: openjpeg.h:202
RLCP
@ RLCP
resolution-layer-component-precinct order
Definition: openjpeg.h:121
opj_image::numcomps
int numcomps
number of components in the image
Definition: openjpeg.h:543
opj_pi_iterator::poc
opj_poc_t poc
progression order change information
Definition: pi.h:91
opj_pi_resolution::pw
int pw
Definition: pi.h:51
opj_tile_info::pw
int pw[33]
precinct number for each resolution level (width)
Definition: openjpeg.h:644