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
double distotile
Definition: tcd.h:156
opj_packet_info_t * packet
information concerning packets inside tile
Definition: openjpeg.h:652
int y1
Definition: tcd.h:131
int cblkw
code-blocks width
Definition: j2k.h:140
int numcomps
component numbers
Definition: openjpeg.h:698
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
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
int y0
Definition: tcd.h:94
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
int numnewpasses
Definition: tcd.h:98
#define opj_free(m)
Deallocates or frees a memory block.
Definition: opj_malloc.h:152
opj_image_t * image
image
Definition: tcd.h:190
int x1
Xsiz: width of the reference grid.
Definition: openjpeg.h:539
int y1
Definition: tcd.h:106
FIXME: documentation.
Definition: tcd.h:79
#define opj_malloc(size)
Allocate an uninitialized memory block.
Definition: opj_malloc.h:51
unsigned char * data
Definition: tcd.h:73
int totalpasses
Definition: tcd.h:88
static INLINE int int_max(int a, int b)
Get the maximum of two integers.
Definition: int.h:57
int ph[33]
precinct number for each resolution level (height)
Definition: openjpeg.h:646
void tcd_free_decode_tile(opj_tcd_t *tcd, int tileno)
Definition: tcd.c:1560
struct opj_tcd_image opj_tcd_image_t
FIXME: documentation.
opj_bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestream_info_t *cstr_info)
Definition: tcd.c:1015
FIXME: documentation.
Definition: tcd.h:47
double distotile
add fixed_quality
Definition: openjpeg.h:656
struct opj_tcd_seg opj_tcd_seg_t
FIXME: documentation.
int len
Definition: tcd.h:63
int index_write
writing the packet in the index with t2_encode_packets
Definition: openjpeg.h:678
int expn
exponent
Definition: j2k.h:126
int tdy
YTsiz.
Definition: j2k.h:238
void dwt_decode(opj_tcd_tilecomp_t *tilec, int numres)
Inverse 5-3 wavelet tranform in 2-D.
Definition: dwt.c:382
int len
Definition: tcd.h:51
int pw
Definition: tcd.h:132
int numbps
Definition: tcd.h:95
void tgt_destroy(opj_tgt_tree_t *tree)
Destroy a tag-tree, liberating memory.
Definition: tgt.c:111
opj_tcd_pass_t * passes
Definition: tcd.h:82
int mant
mantissa
Definition: j2k.h:128
opj_tcd_layer_t * layers
Definition: tcd.h:81
double opj_clock(void)
Difference in successive opj_clock() calls tells you the elapsed time.
Definition: j2k_lib.c:36
int cur_totnum_tp
Total number of tileparts of the current tile.
Definition: tcd.h:181
int qmfbid
discrete wavelet transform identifier
Definition: j2k.h:146
int numbands
Definition: tcd.h:133
Tier-2 coding.
Definition: t2.h:45
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
int numlenbits
Definition: tcd.h:96
int y1
Definition: tcd.h:141
opj_tcd_band_t bands[3]
Definition: tcd.h:134
@ THRESH_CALC
Definition: j2k.h:117
#define OPJ_ARG_NOT_USED(x)
Definition: openjpeg.h:68
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
int prch[J2K_MAXRLVLS]
precinct height
Definition: j2k.h:158
void tcd_rateallocate_fixed(opj_tcd_t *tcd)
Definition: tcd.c:938
int prec
precision
Definition: openjpeg.h:517
void tcd_free_decode(opj_tcd_t *tcd)
Free the memory allocated for decoding.
Definition: tcd.c:1549
int x0
Definition: tcd.h:152
int numlayers
number of layer
Definition: openjpeg.h:700
int csty
coding style
Definition: j2k.h:136
int y0
Definition: tcd.h:106
int rate
Definition: tcd.h:61
static INLINE int int_ceildiv(int a, int b)
Divide an integer and round upwards.
Definition: int.h:86
int packno
packet number
Definition: tcd.h:159
double disto
Definition: tcd.h:72
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
void tcd_free_encode(opj_tcd_t *tcd)
Free the memory allocated for encoding.
Definition: tcd.c:355
int maxpasses
Definition: tcd.h:52
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
int pdy[33]
precinct size (in power of 2), in Y for each resolution level
Definition: openjpeg.h:650
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
static INLINE int int_clamp(int a, int min, int max)
Clamp an integer inside an interval.
Definition: int.h:69
int numpix
Definition: tcd.h:145
opj_stepsize_t stepsizes[J2K_MAXBANDS]
stepsizes used for quantization
Definition: j2k.h:150
int dx
XRsiz: horizontal separation of a sample of ith component with respect to the reference grid.
Definition: openjpeg.h:505
int disto_alloc
allocation by rate/distortion
Definition: j2k.h:220
Defines a single image component.
Definition: openjpeg.h:503
#define opj_calloc(num, size)
Allocate a memory block with elements initialized to 0.
Definition: opj_malloc.h:63
int numpasses
Definition: tcd.h:50
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
int sgnd
signed (1) / unsigned (0)
Definition: openjpeg.h:521
opj_tcd_resolution_t * resolutions
Definition: tcd.h:143
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_bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestream_info_t *cstr_info)
Definition: tcd.c:1015
int x0
Definition: tcd.h:141
int y0
Definition: tcd.h:120
int x1
Definition: tcd.h:141
Coding parameters.
Definition: j2k.h:204
int y0
Definition: tcd.h:141
void tcd_free_decode(opj_tcd_t *tcd)
Free the memory allocated for decoding.
Definition: tcd.c:1549
int * matrice
fixed layer
Definition: j2k.h:264
int numlayers
number of layers
Definition: j2k.h:174
int y0
Definition: tcd.h:152
#define opj_aligned_free(m)
Definition: opj_malloc.h:110
int numnewpasses
Definition: tcd.h:53
Quantization stepsize.
Definition: j2k.h:124
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
#define EVT_WARNING
Warning event type.
Definition: event.h:36
#define opj_aligned_malloc(size)
Definition: opj_malloc.h:108
FIXME: documentation.
Definition: tcd.h:165
opj_tcd_tile_t * tcd_tile
pointer to the current encoded/decoded tile
Definition: tcd.h:194
Tier-1 coding (coding of code-block coefficients)
Definition: t1.h:93
struct opj_tcd opj_tcd_t
Tile coder/decoder.
int x1
Definition: tcd.h:106
int w
data width
Definition: openjpeg.h:509
void tcd_makelayer_fixed(opj_tcd_t *tcd, int layno, int final)
Definition: tcd.c:849
opj_tgt_tree_t * tgt_create(int numleafsh, int numleafsv)
Create a tag-tree.
Definition: tgt.c:40
int x0
XOsiz: horizontal offset from the origin of the reference grid to the left side of the image area.
Definition: openjpeg.h:535
FIXME: documentation.
Definition: tcd.h:69
opj_cp_t * cp
coding parameters
Definition: tcd.h:192
opj_tcd_cblk_enc_t * enc
Definition: tcd.h:109
int cw
Definition: tcd.h:107
opj_tcp_t * tcps
tile coding parameters
Definition: j2k.h:262
opj_tgt_tree_t * imsbtree
Definition: tcd.h:113
int x0
x component offset compared to the whole image
Definition: openjpeg.h:513
FIXME: documentation.
Definition: tcd.h:105
void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final)
Definition: tcd.c:945
struct opj_tcd_precinct opj_tcd_precinct_t
FIXME: documentation.
int y0
Definition: tcd.h:131
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
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
double distolayer[100]
Definition: tcd.h:157
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
opj_tcd_t * tcd_create(opj_common_ptr cinfo)
Create a new TCD handle.
Definition: tcd.c:101
opj_tgt_tree_t * incltree
Definition: tcd.h:112
FIXME: documentation.
Definition: tcd.h:60
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
FIXME: documentation.
Definition: tcd.h:130
opj_tcd_tile_t * tiles
Definition: tcd.h:167
FIXME: documentation.
Definition: tcd.h:140
int numsegs
Definition: tcd.h:99
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
FIXME: documentation.
Definition: tcd.h:119
int y1
Definition: tcd.h:152
int numpasses
Definition: tcd.h:86
int y0
y component offset compared to the whole image
Definition: openjpeg.h:515
int newlen
Definition: tcd.h:54
void tcd_free_encode(opj_tcd_t *tcd)
Free the memory allocated for encoding.
Definition: tcd.c:355
int tw
number of tiles in width
Definition: j2k.h:242
int y0
YOsiz: vertical offset from the origin of the reference grid to the top side of the image area.
Definition: openjpeg.h:537
int dwt_getgain(int orient)
Get the gain of a subband for the reversible 5-3 DWT.
Definition: dwt.c:390
int tx0
XTOsiz.
Definition: j2k.h:232
struct opj_tcd_tile opj_tcd_tile_t
FIXME: documentation.
union opj_tcd_precinct::@0 cblks
struct opj_tcd_cblk_enc opj_tcd_cblk_enc_t
FIXME: documentation.
static INLINE int int_min(int a, int b)
Get the minimum of two integers.
Definition: int.h:50
int numresolutions
Definition: tcd.h:142
int numresolutions
number of resolutions
Definition: j2k.h:138
int pdx[33]
precinct size (in power of 2), in X for each resolution level
Definition: openjpeg.h:648
opj_tcp_t * tcp
coding/decoding parameters common to all tiles
Definition: tcd.h:196
#define J2K_CCP_CSTY_PRT
Definition: j2k.h:47
void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final)
Definition: tcd.c:945
float rates[100]
rates of layers
Definition: j2k.h:178
int mct
multi-component transform identifier
Definition: j2k.h:176
struct opj_tcd_tilecomp opj_tcd_tilecomp_t
FIXME: documentation.
int th
number of tiles in heigth
Definition: j2k.h:244
int x1
Definition: tcd.h:152
void t2_destroy(opj_t2_t *t2)
Destroy a T2 handle.
Definition: t2.c:818
int packno
packet number
Definition: openjpeg.h:676
int dy
YRsiz: vertical separation of a sample of ith component with respect to the reference grid.
Definition: openjpeg.h:507
int x0
Definition: tcd.h:83
opj_tcd_precinct_t * precincts
Definition: tcd.h:122
#define OPJ_TRUE
Definition: openjpeg.h:64
opj_tcd_t * tcd_create(opj_common_ptr cinfo)
Create a new TCD handle.
Definition: tcd.c:101
int len
Definition: tcd.h:97
int numlenbits
Definition: tcd.h:85
static const float K
Definition: dwt.c:72
static INLINE int int_ceildivpow2(int a, int b)
Divide an integer by a power of 2 and round upwards.
Definition: int.h:93
int x1
Definition: tcd.h:131
void tcd_malloc_decode(opj_tcd_t *tcd, opj_image_t *image, opj_cp_t *cp)
Initialize the tile decoder.
Definition: tcd.c:616
double encoding_time
Time taken to encode a tile.
Definition: tcd.h:200
int * data
image component data
Definition: openjpeg.h:527
unsigned char * data
Definition: tcd.h:92
int dwt_getgain_real(int orient)
Get the gain of a subband for the irreversible 9-7 DWT.
Definition: dwt.c:465
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
int x1
Definition: tcd.h:83
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
Definition: openjpeg.h:430
struct opj_tcd_pass opj_tcd_pass_t
FIXME: documentation.
int y1
Definition: tcd.h:94
int numgbits
number of guard bits
Definition: j2k.h:152
int x0
Definition: tcd.h:94
int numbps
Definition: tcd.h:84
float distoratio[100]
add fixed_quality
Definition: j2k.h:196
void tcd_destroy(opj_tcd_t *tcd)
Destroy a previously created TCD handle.
Definition: tcd.c:118
Index structure : Information concerning a packet inside tile.
Definition: openjpeg.h:587
int numpix
add fixed_quality
Definition: openjpeg.h:654
int ty0
YTOsiz.
Definition: j2k.h:234
int cur_pino
Current Packet iterator number.
Definition: tcd.h:183
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
Definition: j2k.h:166
opj_tccp_t * tccps
tile-component coding parameters
Definition: j2k.h:198
char tp_on
Enabling Tile part generation.
Definition: j2k.h:214
int y1
Definition: tcd.h:120
#define J2K_CP_CSTY_PRT
Definition: j2k.h:44
int x0
Definition: tcd.h:106
int * tileno
ID number of the tiles present in the codestream.
Definition: j2k.h:246
void dwt_encode(opj_tcd_tilecomp_t *tilec)
Forward 5-3 wavelet tranform in 2-D.
Definition: dwt.c:326
#define EVT_INFO
Debug event type.
Definition: event.h:37
int x0
Definition: tcd.h:120
int opj_bool
Definition: openjpeg.h:63
unsigned char ** data
Definition: tcd.h:48
int numcomps
Definition: tcd.h:153
int factor
number of division by 2 of the out image compared to the original size of image
Definition: openjpeg.h:525
Tile-component coding parameters.
Definition: j2k.h:134
int resno_decoded
number of decoded resolution
Definition: openjpeg.h:523
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_image_t * tcd_image
info on each image tile
Definition: tcd.h:188
unsigned char * data
Definition: tcd.h:80
void dwt_encode_real(opj_tcd_tilecomp_t *tilec)
Forward 9-7 wavelet transform in 2-D.
Definition: dwt.c:409
opj_common_ptr cinfo
codec context
Definition: tcd.h:185
FIXME: documentation.
Definition: tcd.h:151
int h
data height
Definition: openjpeg.h:511
int numpassesinlayers
Definition: tcd.h:87
int y0
Definition: tcd.h:83
opj_image_comp_t * comps
image components
Definition: openjpeg.h:547
double * thresh
value of thresh for each layer by tile cfr.
Definition: openjpeg.h:634
int dataindex
Definition: tcd.h:49
void tcd_rateallocate_fixed(opj_tcd_t *tcd)
Definition: tcd.c:938
opj_tile_info_t * tile
information regarding tiles inside image
Definition: openjpeg.h:718
int tw
Definition: tcd.h:166
int tp_pos
Position of the tilepart flag in Progression order.
Definition: tcd.h:175
int bandno
Definition: tcd.h:121
@ FINAL_PASS
Function called in Rate allocation process.
Definition: j2k.h:118
OPJ_CINEMA_MODE cinema
Digital cinema profile.
Definition: j2k.h:206
struct opj_tcd_layer opj_tcd_layer_t
FIXME: documentation.
Index structure of the codestream.
Definition: openjpeg.h:672
int tcd_tileno
current encoded/decoded tile
Definition: tcd.h:198
void tcd_makelayer_fixed(opj_tcd_t *tcd, int layno, int final)
Definition: tcd.c:849
int numpasses
Definition: tcd.h:70
int th
Definition: tcd.h:166
#define EVT_ERROR
Error event type.
Definition: event.h:35
int prcw[J2K_MAXRLVLS]
precinct width
Definition: j2k.h:156
int x0
Definition: tcd.h:131
int term
Definition: tcd.h:63
Index structure : information regarding tiles.
Definition: openjpeg.h:632
int * data
Definition: tcd.h:144
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_seg_t * segs
Definition: tcd.h:93
static INLINE int int_floordivpow2(int a, int b)
Divide an integer by a power of 2 and round downwards.
Definition: int.h:100
Tag tree.
Definition: tgt.h:58
struct opj_tcd_resolution opj_tcd_resolution_t
FIXME: documentation.
#define OPJ_FALSE
Definition: openjpeg.h:65
int numbps
Definition: tcd.h:123
void tcd_destroy(opj_tcd_t *tcd)
Destroy a previously created TCD handle.
Definition: tcd.c:118
double distortiondec
Definition: tcd.h:62
void t1_destroy(opj_t1_t *t1)
Destroy a previously created T1 handle.
Definition: t1.c:1388
float stepsize
Definition: tcd.h:124
int y1
Ysiz: height of the reference grid.
Definition: openjpeg.h:541
void mct_decode(int *restrict c0, int *restrict c1, int *restrict c2, int n)
Definition: mct.c:74
int x1
Definition: tcd.h:120
#define min(a, b)
Computes the minimum between two integers.
Definition: rs.h:102
opj_tcd_cblk_dec_t * dec
Definition: tcd.h:110
void mct_encode(int *restrict c0, int *restrict c1, int *restrict c2, int n)
Definition: mct.c:51
int tdx
XTsiz.
Definition: j2k.h:236
int y1
Definition: tcd.h:83
int cblkh
code-blocks height
Definition: j2k.h:142
struct opj_tcd_cblk_dec opj_tcd_cblk_dec_t
void mct_encode_real(int *restrict c0, int *restrict c1, int *restrict c2, int n)
Definition: mct.c:104
Defines image data and characteristics.
Definition: openjpeg.h:533
int tileno_size
size of the vector tileno
Definition: j2k.h:248
int cur_tp_num
Current tile part number.
Definition: tcd.h:179
void tcd_free_decode_tile(opj_tcd_t *tcd, int tileno)
Definition: tcd.c:1560
int ch
Definition: tcd.h:107
opj_tcd_tilecomp_t * comps
Definition: tcd.h:154
void mct_decode_real(float *restrict c0, float *restrict c1, float *restrict c2, int n)
Definition: mct.c:127
struct opj_tcd_band opj_tcd_band_t
FIXME: documentation.
int len
Definition: tcd.h:71
int tp_num
Tile part number.
Definition: tcd.h:177
int x1
Definition: tcd.h:94
int numcomps
number of components in the image
Definition: openjpeg.h:543
int numpix
Definition: tcd.h:155
Tile coder/decoder.
Definition: tcd.h:173
void dwt_decode_real(opj_tcd_tilecomp_t *restrict tilec, int numres)
Definition: dwt.c:775
int ph
Definition: tcd.h:132
int fixed_quality
add fixed_quality
Definition: j2k.h:224
int pw[33]
precinct number for each resolution level (width)
Definition: openjpeg.h:644