OpenJPEG  1.5.1
tcd.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 #ifndef __TCD_H
32 #define __TCD_H
33 
43 
47 typedef struct opj_tcd_seg {
48  unsigned char** data;
49  int dataindex;
50  int numpasses;
51  int len;
52  int maxpasses;
54  int newlen;
56 
60 typedef struct opj_tcd_pass {
61  int rate;
62  double distortiondec;
63  int term, len;
65 
69 typedef struct opj_tcd_layer {
70  int numpasses; /* Number of passes in the layer */
71  int len; /* len of information */
72  double disto; /* add for index (Cfr. Marcela) */
73  unsigned char *data; /* data */
75 
79 typedef struct opj_tcd_cblk_enc {
80  unsigned char* data; /* Data */
81  opj_tcd_layer_t* layers; /* layer information */
82  opj_tcd_pass_t* passes; /* information about the passes */
83  int x0, y0, x1, y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
84  int numbps;
86  int numpasses; /* number of pass already done for the code-blocks */
87  int numpassesinlayers; /* number of passes in the layer */
88  int totalpasses; /* total number of passes */
90 
91 typedef struct opj_tcd_cblk_dec {
92  unsigned char* data; /* Data */
93  opj_tcd_seg_t* segs; /* segments informations */
94  int x0, y0, x1, y1; /* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */
95  int numbps;
97  int len; /* length */
98  int numnewpasses; /* number of pass added to the code-blocks */
99  int numsegs; /* number of segments */
101 
105 typedef struct opj_tcd_precinct {
106  int x0, y0, x1, y1; /* dimension of the precinct : left upper corner (x0, y0) right low corner (x1,y1) */
107  int cw, ch; /* number of precinct in width and heigth */
108  union{ /* code-blocks informations */
111  } cblks;
112  opj_tgt_tree_t *incltree; /* inclusion tree */
113  opj_tgt_tree_t *imsbtree; /* IMSB tree */
115 
119 typedef struct opj_tcd_band {
120  int x0, y0, x1, y1; /* dimension of the subband : left upper corner (x0, y0) right low corner (x1,y1) */
121  int bandno;
122  opj_tcd_precinct_t *precincts; /* precinct information */
123  int numbps;
124  float stepsize;
126 
130 typedef struct opj_tcd_resolution {
131  int x0, y0, x1, y1; /* dimension of the resolution level : left upper corner (x0, y0) right low corner (x1,y1) */
132  int pw, ph;
133  int numbands; /* number sub-band for the resolution level */
134  opj_tcd_band_t bands[3]; /* subband information */
136 
140 typedef struct opj_tcd_tilecomp {
141  int x0, y0, x1, y1; /* dimension of component : left upper corner (x0, y0) right low corner (x1,y1) */
142  int numresolutions; /* number of resolutions level */
143  opj_tcd_resolution_t *resolutions; /* resolutions information */
144  int *data; /* data of the component */
145  int numpix; /* add fixed_quality */
147 
151 typedef struct opj_tcd_tile {
152  int x0, y0, x1, y1; /* dimension of the tile : left upper corner (x0, y0) right low corner (x1,y1) */
153  int numcomps; /* number of components in tile */
154  opj_tcd_tilecomp_t *comps; /* Components information */
155  int numpix; /* add fixed_quality */
156  double distotile; /* add fixed_quality */
157  double distolayer[100]; /* add fixed_quality */
159  int packno;
161 
165 typedef struct opj_tcd_image {
166  int tw, th; /* number of tiles in width and heigth */
167  opj_tcd_tile_t *tiles; /* Tiles information */
169 
173 typedef struct opj_tcd {
175  int tp_pos;
177  int tp_num;
183  int cur_pino;
186 
202 
205 /* ----------------------------------------------------------------------- */
206 
210 void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t *img);
221 void tcd_destroy(opj_tcd_t *tcd);
229 void tcd_malloc_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno);
234 void tcd_free_encode(opj_tcd_t *tcd);
242 void tcd_init_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno);
249 void tcd_malloc_decode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp);
250 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);
251 void tcd_makelayer_fixed(opj_tcd_t *tcd, int layno, int final);
253 void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final);
254 opj_bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestream_info_t *cstr_info);
264 int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len, opj_codestream_info_t *cstr_info);
273 opj_bool tcd_decode_tile(opj_tcd_t *tcd, unsigned char *src, int len, int tileno, opj_codestream_info_t *cstr_info);
278 void tcd_free_decode(opj_tcd_t *tcd);
279 void tcd_free_decode_tile(opj_tcd_t *tcd, int tileno);
280 
281 /* ----------------------------------------------------------------------- */
285 
286 #endif /* __TCD_H */
t1_encode_cblks
void t1_encode_cblks(opj_t1_t *t1, opj_tcd_tile_t *tile, opj_tcp_t *tcp)
Encode the code-blocks of a tile.
Definition: t1.c:1399
opj_tcd_tile::distotile
double distotile
Definition: tcd.h:156
opj_tile_info::packet
opj_packet_info_t * packet
information concerning packets inside tile
Definition: openjpeg.h:652
opj_tcd_resolution::y1
int y1
Definition: tcd.h:131
opj_tccp::cblkw
int cblkw
code-blocks width
Definition: j2k.h:140
opj_codestream_info::numcomps
int numcomps
component numbers
Definition: openjpeg.h:698
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_dump
void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t *img)
Dump the content of a tcd structure.
Definition: tcd.c:37
opj_tcd_cblk_dec::y0
int y0
Definition: tcd.h:94
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_tcd_cblk_dec::numnewpasses
int numnewpasses
Definition: tcd.h:98
opj_free
#define opj_free(m)
Deallocates or frees a memory block.
Definition: opj_malloc.h:152
opj_tcd::image
opj_image_t * image
image
Definition: tcd.h:190
opj_image::x1
int x1
Xsiz: width of the reference grid.
Definition: openjpeg.h:539
opj_tcd_precinct::y1
int y1
Definition: tcd.h:106
opj_tcd_cblk_enc
FIXME: documentation.
Definition: tcd.h:79
opj_malloc
#define opj_malloc(size)
Allocate an uninitialized memory block.
Definition: opj_malloc.h:51
opj_tcd_layer::data
unsigned char * data
Definition: tcd.h:73
opj_tcd_cblk_enc::totalpasses
int totalpasses
Definition: tcd.h:88
int_max
static INLINE int int_max(int a, int b)
Get the maximum of two integers.
Definition: int.h:57
opj_tile_info::ph
int ph[33]
precinct number for each resolution level (height)
Definition: openjpeg.h:646
tcd_free_decode_tile
void tcd_free_decode_tile(opj_tcd_t *tcd, int tileno)
Definition: tcd.c:1560
opj_tcd_image_t
struct opj_tcd_image opj_tcd_image_t
FIXME: documentation.
tcd_rateallocate
opj_bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestream_info_t *cstr_info)
Definition: tcd.c:1015
opj_tcd_seg
FIXME: documentation.
Definition: tcd.h:47
opj_tile_info::distotile
double distotile
add fixed_quality
Definition: openjpeg.h:656
opj_tcd_seg_t
struct opj_tcd_seg opj_tcd_seg_t
FIXME: documentation.
opj_tcd_pass::len
int len
Definition: tcd.h:63
opj_codestream_info::index_write
int index_write
writing the packet in the index with t2_encode_packets
Definition: openjpeg.h:678
opj_stepsize::expn
int expn
exponent
Definition: j2k.h:126
opj_cp::tdy
int tdy
YTsiz.
Definition: j2k.h:238
dwt_decode
void dwt_decode(opj_tcd_tilecomp_t *tilec, int numres)
Inverse 5-3 wavelet tranform in 2-D.
Definition: dwt.c:382
opj_tcd_seg::len
int len
Definition: tcd.h:51
opj_tcd_resolution::pw
int pw
Definition: tcd.h:132
opj_tcd_cblk_dec::numbps
int numbps
Definition: tcd.h:95
tgt_destroy
void tgt_destroy(opj_tgt_tree_t *tree)
Destroy a tag-tree, liberating memory.
Definition: tgt.c:111
opj_tcd_cblk_enc::passes
opj_tcd_pass_t * passes
Definition: tcd.h:82
opj_stepsize::mant
int mant
mantissa
Definition: j2k.h:128
opj_tcd_cblk_enc::layers
opj_tcd_layer_t * layers
Definition: tcd.h:81
opj_clock
double opj_clock(void)
Difference in successive opj_clock() calls tells you the elapsed time.
Definition: j2k_lib.c:36
opj_tcd::cur_totnum_tp
int cur_totnum_tp
Total number of tileparts of the current tile.
Definition: tcd.h:181
opj_tccp::qmfbid
int qmfbid
discrete wavelet transform identifier
Definition: j2k.h:146
opj_tcd_resolution::numbands
int numbands
Definition: tcd.h:133
opj_t2
Tier-2 coding.
Definition: t2.h:45
t1_create
opj_t1_t * t1_create(opj_common_ptr cinfo)
Create a new T1 handle and initialize the look-up tables of the Tier-1 coder/decoder.
Definition: t1.c:1370
opj_tcd_cblk_dec::numlenbits
int numlenbits
Definition: tcd.h:96
opj_tcd_tilecomp::y1
int y1
Definition: tcd.h:141
opj_tcd_resolution::bands
opj_tcd_band_t bands[3]
Definition: tcd.h:134
THRESH_CALC
@ THRESH_CALC
Definition: j2k.h:117
OPJ_ARG_NOT_USED
#define OPJ_ARG_NOT_USED(x)
Definition: openjpeg.h:68
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_tccp::prch
int prch[J2K_MAXRLVLS]
precinct height
Definition: j2k.h:158
tcd_rateallocate_fixed
void tcd_rateallocate_fixed(opj_tcd_t *tcd)
Definition: tcd.c:938
opj_image_comp::prec
int prec
precision
Definition: openjpeg.h:517
tcd_free_decode
void tcd_free_decode(opj_tcd_t *tcd)
Free the memory allocated for decoding.
Definition: tcd.c:1549
opj_tcd_tile::x0
int x0
Definition: tcd.h:152
opj_codestream_info::numlayers
int numlayers
number of layer
Definition: openjpeg.h:700
opj_tccp::csty
int csty
coding style
Definition: j2k.h:136
opj_tcd_precinct::y0
int y0
Definition: tcd.h:106
opj_tcd_pass::rate
int rate
Definition: tcd.h:61
int_ceildiv
static INLINE int int_ceildiv(int a, int b)
Divide an integer and round upwards.
Definition: int.h:86
opj_tcd_tile::packno
int packno
packet number
Definition: tcd.h:159
opj_tcd_layer::disto
double disto
Definition: tcd.h:72
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
tcd_free_encode
void tcd_free_encode(opj_tcd_t *tcd)
Free the memory allocated for encoding.
Definition: tcd.c:355
opj_tcd_seg::maxpasses
int maxpasses
Definition: tcd.h:52
tcd_dump
void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t *img)
Dump the content of a tcd structure.
Definition: tcd.c:37
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
int_clamp
static INLINE int int_clamp(int a, int min, int max)
Clamp an integer inside an interval.
Definition: int.h:69
opj_tcd_tilecomp::numpix
int numpix
Definition: tcd.h:145
opj_tccp::stepsizes
opj_stepsize_t stepsizes[J2K_MAXBANDS]
stepsizes used for quantization
Definition: j2k.h:150
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_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
opj_tcd_seg::numpasses
int numpasses
Definition: tcd.h:50
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
opj_tcd_tilecomp::resolutions
opj_tcd_resolution_t * resolutions
Definition: tcd.h:143
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
tcd_rateallocate
opj_bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestream_info_t *cstr_info)
Definition: tcd.c:1015
opj_tcd_tilecomp::x0
int x0
Definition: tcd.h:141
opj_tcd_band::y0
int y0
Definition: tcd.h:120
opj_tcd_tilecomp::x1
int x1
Definition: tcd.h:141
opj_cp
Coding parameters.
Definition: j2k.h:204
opj_tcd_tilecomp::y0
int y0
Definition: tcd.h:141
tcd_free_decode
void tcd_free_decode(opj_tcd_t *tcd)
Free the memory allocated for decoding.
Definition: tcd.c:1549
opj_cp::matrice
int * matrice
fixed layer
Definition: j2k.h:264
opj_tcp::numlayers
int numlayers
number of layers
Definition: j2k.h:174
opj_tcd_tile::y0
int y0
Definition: tcd.h:152
opj_aligned_free
#define opj_aligned_free(m)
Definition: opj_malloc.h:110
opj_tcd_seg::numnewpasses
int numnewpasses
Definition: tcd.h:53
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
EVT_WARNING
#define EVT_WARNING
Warning event type.
Definition: event.h:36
opj_aligned_malloc
#define opj_aligned_malloc(size)
Definition: opj_malloc.h:108
opj_tcd_image
FIXME: documentation.
Definition: tcd.h:165
opj_tcd::tcd_tile
opj_tcd_tile_t * tcd_tile
pointer to the current encoded/decoded tile
Definition: tcd.h:194
opj_t1
Tier-1 coding (coding of code-block coefficients)
Definition: t1.h:93
opj_tcd_t
struct opj_tcd opj_tcd_t
Tile coder/decoder.
opj_tcd_precinct::x1
int x1
Definition: tcd.h:106
opj_image_comp::w
int w
data width
Definition: openjpeg.h:509
tcd_makelayer_fixed
void tcd_makelayer_fixed(opj_tcd_t *tcd, int layno, int final)
Definition: tcd.c:849
tgt_create
opj_tgt_tree_t * tgt_create(int numleafsh, int numleafsv)
Create a tag-tree.
Definition: tgt.c:40
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_tcd_layer
FIXME: documentation.
Definition: tcd.h:69
opj_tcd::cp
opj_cp_t * cp
coding parameters
Definition: tcd.h:192
opj_tcd_precinct::enc
opj_tcd_cblk_enc_t * enc
Definition: tcd.h:109
opj_tcd_precinct::cw
int cw
Definition: tcd.h:107
opj_cp::tcps
opj_tcp_t * tcps
tile coding parameters
Definition: j2k.h:262
opj_tcd_precinct::imsbtree
opj_tgt_tree_t * imsbtree
Definition: tcd.h:113
opj_image_comp::x0
int x0
x component offset compared to the whole image
Definition: openjpeg.h:513
opj_tcd_precinct
FIXME: documentation.
Definition: tcd.h:105
tcd_makelayer
void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final)
Definition: tcd.c:945
opj_tcd_precinct_t
struct opj_tcd_precinct opj_tcd_precinct_t
FIXME: documentation.
opj_includes.h
opj_tcd_resolution::y0
int y0
Definition: tcd.h:131
t2_encode_packets
int t2_encode_packets(opj_t2_t *t2, int tileno, opj_tcd_tile_t *tile, int maxlayers, unsigned char *dest, int len, opj_codestream_info_t *cstr_info, int tpnum, int tppos, int pino, J2K_T2_MODE t2_mode, int cur_totnum_tp)
Encode the packets of a tile to a destination buffer.
Definition: t2.c:625
t2_create
opj_t2_t * t2_create(opj_common_ptr cinfo, opj_image_t *image, opj_cp_t *cp)
Create a T2 handle.
Definition: t2.c:807
opj_tcd_tile::distolayer
double distolayer[100]
Definition: tcd.h:157
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
opj_tcd_precinct::incltree
opj_tgt_tree_t * incltree
Definition: tcd.h:112
opj_tcd_pass
FIXME: documentation.
Definition: tcd.h:60
t2_decode_packets
int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj_tcd_tile_t *tile, opj_codestream_info_t *cstr_info)
Decode the packets of a tile from a source buffer.
Definition: t2.c:716
opj_tcd_resolution
FIXME: documentation.
Definition: tcd.h:130
opj_tcd_image::tiles
opj_tcd_tile_t * tiles
Definition: tcd.h:167
opj_tcd_tilecomp
FIXME: documentation.
Definition: tcd.h:140
opj_tcd_cblk_dec::numsegs
int numsegs
Definition: tcd.h:99
t1_decode_cblks
void t1_decode_cblks(opj_t1_t *t1, opj_tcd_tilecomp_t *tilec, opj_tccp_t *tccp)
Decode the code-blocks of a tile.
Definition: t1.c:1494
opj_tcd_band
FIXME: documentation.
Definition: tcd.h:119
opj_tcd_tile::y1
int y1
Definition: tcd.h:152
opj_tcd_cblk_enc::numpasses
int numpasses
Definition: tcd.h:86
opj_image_comp::y0
int y0
y component offset compared to the whole image
Definition: openjpeg.h:515
opj_tcd_seg::newlen
int newlen
Definition: tcd.h:54
tcd_free_encode
void tcd_free_encode(opj_tcd_t *tcd)
Free the memory allocated for encoding.
Definition: tcd.c:355
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
dwt_getgain
int dwt_getgain(int orient)
Get the gain of a subband for the reversible 5-3 DWT.
Definition: dwt.c:390
opj_cp::tx0
int tx0
XTOsiz.
Definition: j2k.h:232
opj_tcd_tile_t
struct opj_tcd_tile opj_tcd_tile_t
FIXME: documentation.
opj_tcd_precinct::cblks
union opj_tcd_precinct::@0 cblks
opj_tcd_cblk_enc_t
struct opj_tcd_cblk_enc opj_tcd_cblk_enc_t
FIXME: documentation.
int_min
static INLINE int int_min(int a, int b)
Get the minimum of two integers.
Definition: int.h:50
opj_tcd_tilecomp::numresolutions
int numresolutions
Definition: tcd.h:142
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_tcd::tcp
opj_tcp_t * tcp
coding/decoding parameters common to all tiles
Definition: tcd.h:196
J2K_CCP_CSTY_PRT
#define J2K_CCP_CSTY_PRT
Definition: j2k.h:47
tcd_makelayer
void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final)
Definition: tcd.c:945
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_tcd_tilecomp_t
struct opj_tcd_tilecomp opj_tcd_tilecomp_t
FIXME: documentation.
opj_cp::th
int th
number of tiles in heigth
Definition: j2k.h:244
opj_tcd_tile::x1
int x1
Definition: tcd.h:152
t2_destroy
void t2_destroy(opj_t2_t *t2)
Destroy a T2 handle.
Definition: t2.c:818
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_tcd_cblk_enc::x0
int x0
Definition: tcd.h:83
opj_tcd_band::precincts
opj_tcd_precinct_t * precincts
Definition: tcd.h:122
OPJ_TRUE
#define OPJ_TRUE
Definition: openjpeg.h:64
tcd_create
opj_tcd_t * tcd_create(opj_common_ptr cinfo)
Create a new TCD handle.
Definition: tcd.c:101
opj_tcd_cblk_dec::len
int len
Definition: tcd.h:97
opj_tcd_cblk_enc::numlenbits
int numlenbits
Definition: tcd.h:85
K
static const float K
Definition: dwt.c:72
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_tcd_resolution::x1
int x1
Definition: tcd.h:131
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_tcd::encoding_time
double encoding_time
Time taken to encode a tile.
Definition: tcd.h:200
opj_image_comp::data
int * data
image component data
Definition: openjpeg.h:527
opj_tcd_cblk_dec::data
unsigned char * data
Definition: tcd.h:92
dwt_getgain_real
int dwt_getgain_real(int orient)
Get the gain of a subband for the irreversible 9-7 DWT.
Definition: dwt.c:465
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_tcd_cblk_enc::x1
int x1
Definition: tcd.h:83
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
opj_common_struct
Definition: openjpeg.h:430
opj_tcd_pass_t
struct opj_tcd_pass opj_tcd_pass_t
FIXME: documentation.
opj_tcd_cblk_dec::y1
int y1
Definition: tcd.h:94
opj_tccp::numgbits
int numgbits
number of guard bits
Definition: j2k.h:152
opj_tcd_cblk_dec::x0
int x0
Definition: tcd.h:94
opj_tcd_cblk_enc::numbps
int numbps
Definition: tcd.h:84
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
opj_packet_info
Index structure : Information concerning a packet inside tile.
Definition: openjpeg.h:587
opj_tile_info::numpix
int numpix
add fixed_quality
Definition: openjpeg.h:654
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::tp_on
char tp_on
Enabling Tile part generation.
Definition: j2k.h:214
opj_tcd_band::y1
int y1
Definition: tcd.h:120
J2K_CP_CSTY_PRT
#define J2K_CP_CSTY_PRT
Definition: j2k.h:44
opj_tcd_precinct::x0
int x0
Definition: tcd.h:106
opj_cp::tileno
int * tileno
ID number of the tiles present in the codestream.
Definition: j2k.h:246
dwt_encode
void dwt_encode(opj_tcd_tilecomp_t *tilec)
Forward 5-3 wavelet tranform in 2-D.
Definition: dwt.c:326
opj_tcd_cblk_dec
Definition: tcd.h:91
EVT_INFO
#define EVT_INFO
Debug event type.
Definition: event.h:37
opj_tcd_band::x0
int x0
Definition: tcd.h:120
opj_bool
int opj_bool
Definition: openjpeg.h:63
opj_tcd_seg::data
unsigned char ** data
Definition: tcd.h:48
opj_tcd_tile::numcomps
int numcomps
Definition: tcd.h:153
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_tccp
Tile-component coding parameters.
Definition: j2k.h:134
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_tcd::tcd_image
opj_tcd_image_t * tcd_image
info on each image tile
Definition: tcd.h:188
opj_tcd_cblk_enc::data
unsigned char * data
Definition: tcd.h:80
dwt_encode_real
void dwt_encode_real(opj_tcd_tilecomp_t *tilec)
Forward 9-7 wavelet transform in 2-D.
Definition: dwt.c:409
opj_tcd::cinfo
opj_common_ptr cinfo
codec context
Definition: tcd.h:185
opj_tcd_tile
FIXME: documentation.
Definition: tcd.h:151
opj_image_comp::h
int h
data height
Definition: openjpeg.h:511
opj_tcd_cblk_enc::numpassesinlayers
int numpassesinlayers
Definition: tcd.h:87
opj_tcd_cblk_enc::y0
int y0
Definition: tcd.h:83
opj_image::comps
opj_image_comp_t * comps
image components
Definition: openjpeg.h:547
opj_tile_info::thresh
double * thresh
value of thresh for each layer by tile cfr.
Definition: openjpeg.h:634
opj_tcd_seg::dataindex
int dataindex
Definition: tcd.h:49
tcd_rateallocate_fixed
void tcd_rateallocate_fixed(opj_tcd_t *tcd)
Definition: tcd.c:938
opj_codestream_info::tile
opj_tile_info_t * tile
information regarding tiles inside image
Definition: openjpeg.h:718
opj_tcd_image::tw
int tw
Definition: tcd.h:166
opj_tcd::tp_pos
int tp_pos
Position of the tilepart flag in Progression order.
Definition: tcd.h:175
opj_tcd_band::bandno
int bandno
Definition: tcd.h:121
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_tcd_layer_t
struct opj_tcd_layer opj_tcd_layer_t
FIXME: documentation.
opj_codestream_info
Index structure of the codestream.
Definition: openjpeg.h:672
opj_tcd::tcd_tileno
int tcd_tileno
current encoded/decoded tile
Definition: tcd.h:198
tcd_makelayer_fixed
void tcd_makelayer_fixed(opj_tcd_t *tcd, int layno, int final)
Definition: tcd.c:849
opj_tcd_layer::numpasses
int numpasses
Definition: tcd.h:70
opj_tcd_image::th
int th
Definition: tcd.h:166
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
opj_tcd_resolution::x0
int x0
Definition: tcd.h:131
opj_tcd_pass::term
int term
Definition: tcd.h:63
opj_tile_info
Index structure : information regarding tiles.
Definition: openjpeg.h:632
opj_tcd_tilecomp::data
int * data
Definition: tcd.h:144
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
opj_tcd_cblk_dec::segs
opj_tcd_seg_t * segs
Definition: tcd.h:93
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_tgt_tree
Tag tree.
Definition: tgt.h:58
opj_tcd_resolution_t
struct opj_tcd_resolution opj_tcd_resolution_t
FIXME: documentation.
OPJ_FALSE
#define OPJ_FALSE
Definition: openjpeg.h:65
opj_tcd_band::numbps
int numbps
Definition: tcd.h:123
tcd_destroy
void tcd_destroy(opj_tcd_t *tcd)
Destroy a previously created TCD handle.
Definition: tcd.c:118
opj_tcd_pass::distortiondec
double distortiondec
Definition: tcd.h:62
t1_destroy
void t1_destroy(opj_t1_t *t1)
Destroy a previously created T1 handle.
Definition: t1.c:1388
opj_tcd_band::stepsize
float stepsize
Definition: tcd.h:124
opj_image::y1
int y1
Ysiz: height of the reference grid.
Definition: openjpeg.h:541
mct_decode
void mct_decode(int *restrict c0, int *restrict c1, int *restrict c2, int n)
Definition: mct.c:74
opj_tcd_band::x1
int x1
Definition: tcd.h:120
min
#define min(a, b)
Computes the minimum between two integers.
Definition: rs.h:102
opj_tcd_precinct::dec
opj_tcd_cblk_dec_t * dec
Definition: tcd.h:110
mct_encode
void mct_encode(int *restrict c0, int *restrict c1, int *restrict c2, int n)
Definition: mct.c:51
opj_cp::tdx
int tdx
XTsiz.
Definition: j2k.h:236
opj_tcd_cblk_enc::y1
int y1
Definition: tcd.h:83
opj_tccp::cblkh
int cblkh
code-blocks height
Definition: j2k.h:142
opj_tcd_cblk_dec_t
struct opj_tcd_cblk_dec opj_tcd_cblk_dec_t
mct_encode_real
void mct_encode_real(int *restrict c0, int *restrict c1, int *restrict c2, int n)
Definition: mct.c:104
opj_image
Defines image data and characteristics.
Definition: openjpeg.h:533
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
tcd_free_decode_tile
void tcd_free_decode_tile(opj_tcd_t *tcd, int tileno)
Definition: tcd.c:1560
opj_tcd_precinct::ch
int ch
Definition: tcd.h:107
opj_tcd_tile::comps
opj_tcd_tilecomp_t * comps
Definition: tcd.h:154
mct_decode_real
void mct_decode_real(float *restrict c0, float *restrict c1, float *restrict c2, int n)
Definition: mct.c:127
opj_tcd_band_t
struct opj_tcd_band opj_tcd_band_t
FIXME: documentation.
opj_tcd_layer::len
int len
Definition: tcd.h:71
opj_tcd::tp_num
int tp_num
Tile part number.
Definition: tcd.h:177
opj_tcd_cblk_dec::x1
int x1
Definition: tcd.h:94
opj_image::numcomps
int numcomps
number of components in the image
Definition: openjpeg.h:543
opj_tcd_tile::numpix
int numpix
Definition: tcd.h:155
opj_tcd
Tile coder/decoder.
Definition: tcd.h:173
dwt_decode_real
void dwt_decode_real(opj_tcd_tilecomp_t *restrict tilec, int numres)
Definition: dwt.c:775
opj_tcd_resolution::ph
int ph
Definition: tcd.h:132
opj_cp::fixed_quality
int fixed_quality
add fixed_quality
Definition: j2k.h:224
opj_tile_info::pw
int pw[33]
precinct number for each resolution level (width)
Definition: openjpeg.h:644