Go to the documentation of this file.
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
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
82 #define J2K_MS_EPC 0xff68
83 #define J2K_MS_EPB 0xff66
84 #define J2K_MS_ESD 0xff67
85 #define J2K_MS_RED 0xff69
88 #define J2K_MS_SEC 0xff65
89 #define J2K_MS_INSEC 0xff94
int compE
Definition: openjpeg.h:220
static void j2k_write_coc(opj_j2k_t *j2k, int compno)
Write the COC marker (coding style component)
Definition: j2k.c:816
int max_tiles
maximum number of tiles at the decoder
Definition: j2k.h:306
opj_dec_mstabent_t j2k_dec_mstab[]
Definition: j2k.c:1703
opj_packet_info_t * packet
information concerning packets inside tile
Definition: openjpeg.h:652
int cblkw
code-blocks width
Definition: j2k.h:140
int numcomps
component numbers
Definition: openjpeg.h:698
Packet iterator.
Definition: pi.h:67
static void j2k_read_siz(opj_j2k_t *j2k)
Read the SIZ marker (image and tile size)
Definition: j2k.c:405
int tw
number of tiles in X
Definition: openjpeg.h:694
j2k_prog_order_t j2k_prog_order_list[]
Definition: j2k.c:260
int hprot_MH
error protection method for MH (0,1,16,32,37-128)
Definition: j2k.h:278
OPJ_PROG_ORDER prg
progression order
Definition: j2k.h:172
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
enum PROG_ORDER OPJ_PROG_ORDER
Progression order.
int tp_pos
Position of tile part flag in progression order.
Definition: j2k.h:218
float tcp_rates[100]
rates of layers
Definition: openjpeg.h:262
#define opj_free(m)
Deallocates or frees a memory block.
Definition: opj_malloc.h:152
opj_marker_info_t * marker
list of markers
Definition: openjpeg.h:660
int cio_numbytesleft(opj_cio_t *cio)
Number of bytes left before the end of the stream.
Definition: cio.c:121
int x1
Xsiz: width of the reference grid.
Definition: openjpeg.h:539
#define opj_malloc(size)
Allocate an uninitialized memory block.
Definition: opj_malloc.h:51
void j2k_read_epb(opj_j2k_t *j2k)
Read the EPB marker (Error Protection Block)
Definition: jpwl.c:1019
int layE
End value, initialised in pi_initialise_encode.
Definition: openjpeg.h:220
unsigned short int type
marker type
Definition: openjpeg.h:605
void tcd_free_decode_tile(opj_tcd_t *tcd, int tileno)
Definition: tcd.c:1560
#define J2K_MS_ESD
ESD marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:84
int image_w
image width
Definition: openjpeg.h:680
struct opj_j2k opj_j2k_t
JPEG-2000 codestream reader/writer.
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
struct opj_dec_mstabent opj_dec_mstabent_t
void j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters)
Setup the decoder decoding parameters using user parameters.
Definition: j2k.c:1892
int csty
coding style
Definition: j2k.h:170
int expn
exponent
Definition: j2k.h:126
int tdy
YTsiz.
Definition: j2k.h:238
#define J2K_MS_PLT
PLT marker value.
Definition: j2k.h:73
static void j2k_write_sot(opj_j2k_t *j2k)
Write the SOT marker (start of tile-part)
Definition: j2k.c:1274
double D_max
maximum distortion reduction on the whole image (add for Marcela)
Definition: openjpeg.h:674
int qntsty
quantisation style
Definition: j2k.h:148
int cp_tx0
XTOsiz.
Definition: openjpeg.h:234
JPEG-2000 codestream reader/writer.
Definition: j2k.h:314
static void j2k_read_qcd(opj_j2k_t *j2k)
Read the QCD marker (quantization default)
Definition: j2k.c:972
int tp_end_header
end position of tile part header
Definition: openjpeg.h:620
enum LIMIT_DECODING OPJ_LIMIT_DECODING
Limit decoding to certain portions of the codestream.
J2K_STATUS
Values that specify the status of the decoding process when decoding the main header.
Definition: j2k.h:100
int tcp_numlayers
number of layers
Definition: openjpeg.h:260
int mant
mantissa
Definition: j2k.h:128
void j2k_destroy_compress(opj_j2k_t *j2k)
Destroy a J2K compressor handle.
Definition: j2k.c:2127
int max_comp_size
Maximum rate for each component.
Definition: j2k.h:208
static void j2k_read_poc(opj_j2k_t *j2k)
Read the POC marker (progression order change)
Definition: j2k.c:1074
int len
length, marker val included
Definition: openjpeg.h:609
static void j2k_write_com(opj_j2k_t *j2k)
Write the COM marker (comment)
Definition: j2k.c:644
Marker structure.
Definition: openjpeg.h:603
int cur_totnum_tp
Total number of tileparts of the current tile.
Definition: tcd.h:181
unsigned char * ppt_data_first
pointer remaining on the first byte of the first header if ppt is used
Definition: j2k.h:188
int qmfbid
discrete wavelet transform identifier
Definition: j2k.h:146
float tcp_distoratio[100]
different psnr for successive layers
Definition: openjpeg.h:264
@ J2K_STATE_MT
the EOC marker has just been read
Definition: j2k.h:106
static void j2k_read_plm(opj_j2k_t *j2k)
Read the PLM marker (packet length, main header)
Definition: j2k.c:1134
int pprot_tileno[JPWL_MAX_NO_PACKSPECS]
tile number of packet protection specification (>=0)
Definition: j2k.h:284
@ THRESH_CALC
Definition: j2k.h:117
int image_h
image height
Definition: openjpeg.h:682
opj_cio_t * cio
pointer to the byte i/o stream
Definition: j2k.h:368
int maxmarknum
actual size of markers array
Definition: openjpeg.h:709
@ J2K_STATE_MHSOC
a SOC marker is expected
Definition: j2k.h:101
#define OPJ_ARG_NOT_USED(x)
Definition: openjpeg.h:68
int tp_num
Tile part number.
Definition: j2k.h:323
int prch[J2K_MAXRLVLS]
precinct height
Definition: j2k.h:158
int roishift
Region Of Interest shift.
Definition: j2k.h:154
int prec
precision
Definition: openjpeg.h:517
int cblockh_init
initial code block height, default to 64
Definition: openjpeg.h:270
OPJ_RSIZ_CAPABILITIES rsiz
Rsiz.
Definition: j2k.h:212
int end_pos
packet end position
Definition: openjpeg.h:593
static void j2k_read_sot(opj_j2k_t *j2k)
Read the SOT marker (start of tile-part)
Definition: j2k.c:1304
#define J2K_MS_PPT
PPT marker value.
Definition: j2k.h:75
int ppt_len
ppmbug1
Definition: j2k.h:194
int sens_MH
sensitivity method for MH (-1,0-7)
Definition: j2k.h:296
opj_bool esd_on
enables writing of ESD, in case of activated JPWL
Definition: j2k.h:272
void tcd_free_decode(opj_tcd_t *tcd)
Free the memory allocated for decoding.
Definition: tcd.c:1549
#define J2K_MS_COC
COC marker value.
Definition: j2k.h:66
int compno1
Definition: openjpeg.h:206
unsigned char * ppt_data
packet header store there for futur use in t2_decode_packet
Definition: j2k.h:186
int res_spec
Definition: openjpeg.h:280
void j2k_destroy_decompress(opj_j2k_t *j2k)
Destroy a J2K decompressor handle.
Definition: j2k.c:1835
int cp_fixed_quality
add fixed_quality
Definition: openjpeg.h:246
#define J2K_MS_SEC
SEC marker value (Part 8: Secure JPEG 2000)
Definition: j2k.h:88
int numlayers
number of layer
Definition: openjpeg.h:700
int csty
coding style
Definition: j2k.h:136
opj_j2k_t * j2k_create_decompress(opj_common_ptr cinfo)
Creates a J2K decompression structure.
Definition: j2k.c:1818
int prcw_init[J2K_MAXRLVLS]
initial precinct width
Definition: openjpeg.h:282
opj_image_t * image
pointer to the encoded / decoded image
Definition: j2k.h:362
@ PCRL
precinct-component-resolution-layer order
Definition: openjpeg.h:123
#define J2K_MS_SOP
SOP marker value.
Definition: j2k.h:76
static INLINE int int_ceildiv(int a, int b)
Divide an integer and round upwards.
Definition: int.h:86
static int j2k_get_num_tp(opj_cp_t *cp, int pino, int tileno)
Definition: j2k.c:280
int exp_comps
expected number of components at the decoder
Definition: j2k.h:304
#define J2K_MS_INSEC
INSEC marker value (Part 8: Secure JPEG 2000)
Definition: j2k.h:89
int jpwl_sens_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of sensitivity specification (>=0)
Definition: openjpeg.h:336
int packno
packet number
Definition: tcd.h:159
int prch_init[J2K_MAXRLVLS]
initial precinct height
Definition: openjpeg.h:284
int main_head_start
main header position
Definition: openjpeg.h:712
int compno0
Definition: openjpeg.h:204
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
#define J2K_CCP_QNTSTY_SEQNT
Definition: j2k.h:56
int fixed_alloc
allocation by fixed layer
Definition: j2k.h:222
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
int sens_TPH[JPWL_MAX_NO_TILESPECS]
sensitivity methods for TPHs (-1,0-7)
Definition: j2k.h:300
static void j2k_read_eoc(opj_j2k_t *j2k)
Read the EOC marker (end of codestream)
Definition: j2k.c:1649
char * cp_comment
comment for coding
Definition: openjpeg.h:250
opj_stepsize_t stepsizes[J2K_MAXBANDS]
stepsizes used for quantization
Definition: j2k.h:150
char str_prog[5]
Definition: j2k.c:257
int jpwl_sens_size
enables writing of ESD, (0=no/1/2 bytes)
Definition: openjpeg.h:328
OPJ_PROG_ORDER prog_order
progression order (default LRCP)
Definition: openjpeg.h:254
int start_pos
packet start position (including SOP marker if it exists)
Definition: openjpeg.h:589
#define J2K_MAXBANDS
Number of maximum sub-band linked to number of resolution level.
Definition: openjpeg.h:78
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
int dx
XRsiz: horizontal separation of a sample of ith component with respect to the reference grid.
Definition: openjpeg.h:505
int numpocs
number of progression order changes (POC), default to 0
Definition: openjpeg.h:258
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
opj_j2k_t * j2k_create_compress(opj_common_ptr cinfo)
Creates a J2K compression structure.
Definition: j2k.c:2119
int start_pos
start position
Definition: openjpeg.h:638
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
#define J2K_MS_EPC
EPC marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:82
int resE
Definition: openjpeg.h:220
int pprot_packno[JPWL_MAX_NO_PACKSPECS]
packet number of packet protection specification (>=0)
Definition: j2k.h:286
static void j2k_write_rgn(opj_j2k_t *j2k, int compno, int tileno)
Write the RGN marker (region-of-interest)
Definition: j2k.c:1586
int jpwl_pprot_tileno[JPWL_MAX_NO_PACKSPECS]
tile number of packet protection specification (>=0)
Definition: openjpeg.h:322
opj_bool tile_size_on
size of tile: tile_size_on = false (not in argument) or = true (in argument)
Definition: openjpeg.h:232
unsigned char * ppm_data_first
pointer remaining on the first byte of the first header if ppm is used
Definition: j2k.h:252
Coding parameters.
Definition: j2k.h:204
static void j2k_read_com(opj_j2k_t *j2k)
Read the COM marker (comment)
Definition: j2k.c:671
int curtileno
number of the tile curently concern by coding/decoding
Definition: j2k.h:321
@ J2K_STATE_MH
the decoding process is in the main header
Definition: j2k.h:103
opj_j2k_t * j2k_create_compress(opj_common_ptr cinfo)
Creates a J2K compression structure.
Definition: j2k.c:2119
int resno0
Resolution num start, Component num start, given by POC.
Definition: openjpeg.h:204
int maxmarknum
actual size of markers array
Definition: openjpeg.h:662
int numresolution
number of resolutions
Definition: openjpeg.h:266
unsigned int cio_read(opj_cio_t *cio, int n)
Read some bytes.
Definition: cio.c:183
int jpwl_exp_comps
expected number of components
Definition: openjpeg.h:398
Compression parameters.
Definition: openjpeg.h:230
int * matrice
fixed layer
Definition: j2k.h:264
int numlayers
number of layers
Definition: j2k.h:174
#define J2K_MS_PPM
PPM marker value.
Definition: j2k.h:74
int cp_tdx
XTsiz.
Definition: openjpeg.h:238
int ppt
If ppt == 1 --> there was a PPT marker for the present tile.
Definition: j2k.h:190
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
opj_common_ptr cinfo
codec context
Definition: j2k.h:316
int hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of header protection specification (>=0)
Definition: j2k.h:280
#define EVT_WARNING
Warning event type.
Definition: event.h:36
int irreversible
1 : use the irreversible DWT 9-7, 0 : use lossless compression (default)
Definition: openjpeg.h:274
int sot_start
locate the start position of the SOT marker of the current coded tile: after encoding the tile,...
Definition: j2k.h:345
#define J2K_MS_TLM
TLM marker value.
Definition: j2k.h:71
#define opj_realloc(m, s)
Reallocate memory blocks.
Definition: opj_malloc.h:142
int ppt_store
used in case of multiple marker PPT (number of info already stored)
Definition: j2k.h:192
int first
1 : first part-tile of a tile
Definition: j2k.h:168
#define J2K_MS_RED
RED marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:85
enum RSIZ_CAPABILITIES OPJ_RSIZ_CAPABILITIES
Rsiz Capabilities.
int w
data width
Definition: openjpeg.h:509
int x0
XOsiz: horizontal offset from the origin of the reference grid to the left side of the image area.
Definition: openjpeg.h:535
int cp_ty0
YTOsiz.
Definition: openjpeg.h:236
int ppm
if ppm == 1 --> there was a PPM marker for the present tile
Definition: j2k.h:254
OPJ_CINEMA_MODE cp_cinema
Digital Cinema compliance 0-not compliant, 1-compliant.
Definition: openjpeg.h:343
int end_header
end position of the header
Definition: openjpeg.h:640
T2_MODE
T2 encoding mode.
Definition: j2k.h:116
@ LRCP
layer-resolution-component-precinct order
Definition: openjpeg.h:120
int sens_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of sensitivity specification (>=0)
Definition: j2k.h:298
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
#define J2K_MS_QCC
QCC marker value.
Definition: j2k.h:69
opj_tcp_t * tcps
tile coding parameters
Definition: j2k.h:262
#define J2K_MS_SIZ
SIZ marker value.
Definition: j2k.h:64
OPJ_PROG_ORDER prg
Definition: openjpeg.h:210
unsigned int cio_write(opj_cio_t *cio, unsigned int64 v, int n)
Write some bytes.
Definition: cio.c:167
static void j2k_read_soc(opj_j2k_t *j2k)
Read the SOC marker (Start of Codestream)
Definition: j2k.c:361
int cur_tp_num
Tilepart number currently coding.
Definition: j2k.h:325
void pi_destroy(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno)
Destroy a packet iterator.
Definition: pi.c:721
void jpwl_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image)
Encode according to JPWL specs.
Definition: jpwl.c:114
#define J2K_MS_SOT
SOT marker value.
Definition: j2k.h:61
struct opj_cp opj_cp_t
Coding parameters.
Byte input-output stream (CIO)
Definition: openjpeg.h:475
int tp_start_pos
start position of tile part
Definition: openjpeg.h:618
opj_marker_info_t * marker
list of markers
Definition: openjpeg.h:707
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
static void j2k_read_ppt(opj_j2k_t *j2k)
Read the PPT marker (packet packet headers, tile-part header)
Definition: j2k.c:1234
Index structure : Information concerning tile-parts.
Definition: openjpeg.h:616
opj_j2k_t * j2k_create_decompress(opj_common_ptr cinfo)
Creates a J2K decompression structure.
Definition: j2k.c:1818
void OPJ_CALLCONV opj_image_destroy(opj_image_t *image)
Deallocate any resources associated with an image.
Definition: image.c:73
#define J2K_MS_SOC
SOC marker value.
Definition: j2k.h:60
struct j2k_prog_order j2k_prog_order_t
static void j2k_write_cod(opj_j2k_t *j2k)
Write the COD marker (coding style default)
Definition: j2k.c:752
void(* handler)(opj_j2k_t *j2k)
action linked to the marker
Definition: j2k.c:1700
int resno1
Definition: openjpeg.h:206
opj_tcd_tile_t * tiles
Definition: tcd.h:167
#define JPWL_MAXIMUM_HAMMING
Expect this maximum number of bit errors in marker id's.
Definition: openjpeg.h:87
enum T2_MODE J2K_T2_MODE
T2 encoding mode.
OPJ_PROG_ORDER enum_prog
Definition: j2k.c:256
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
void tcd_free_encode(opj_tcd_t *tcd)
Free the memory allocated for encoding.
Definition: tcd.c:355
opj_bool correct
enables JPWL correction at the decoder
Definition: j2k.h:302
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 tx0
XTOsiz.
Definition: j2k.h:232
static void j2k_write_poc(opj_j2k_t *j2k)
Write the POC marker (progression order change)
Definition: j2k.c:1046
opj_bool jpwl_correct
activates the JPWL correction capabilities
Definition: openjpeg.h:396
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_bool info_on
enables writing of informative techniques of ESD, in case of activated JPWL
Definition: j2k.h:274
@ J2K_STATE_TPH
the decoding process is in a tile part header
Definition: j2k.h:105
#define J2K_MS_RGN
RGN marker value.
Definition: j2k.h:67
static INLINE int int_floorlog2(int a)
Get logarithm of an integer and round downwards.
Definition: int.h:107
char tp_flag
Flag for Tile part generation.
Definition: openjpeg.h:351
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
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_t * opj_image_create0(void)
Create an empty image.
Definition: image.c:29
static void j2k_read_qcc(opj_j2k_t *j2k)
Read the QCC marker (quantization component)
Definition: j2k.c:1002
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
static INLINE int int_min(int a, int b)
Get the minimum of two integers.
Definition: int.h:50
int jpwl_sens_range
sensitivity range (0-3)
Definition: openjpeg.h:332
opj_bool jpwl_epc_on
enables writing of EPC in MH, thus activating JPWL
Definition: openjpeg.h:314
@ LIMIT_TO_MAIN_HEADER
The decoding is limited to the Main Header.
Definition: openjpeg.h:157
int jpwl_sens_TPH[JPWL_MAX_NO_TILESPECS]
sensitivity methods for TPHs (-1=no,0-7)
Definition: openjpeg.h:338
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
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
int jpwl_sens_MH
sensitivity method for MH (-1=no,0-7)
Definition: openjpeg.h:334
int tileno
number of tile
Definition: openjpeg.h:636
#define J2K_CCP_CSTY_PRT
Definition: j2k.h:47
int OPJ_CALLCONV cio_tell(opj_cio_t *cio)
Get position in byte stream.
Definition: cio.c:100
int * tile_len
array used to store the length of each tile
Definition: j2k.h:355
#define J2K_MS_EOC
EOC marker value.
Definition: j2k.h:63
int num_tps
number of tile parts
Definition: openjpeg.h:664
@ J2K_STATE_TPHSOT
the decoding process is in a tile part header and expects a SOT marker
Definition: j2k.h:104
float rates[100]
rates of layers
Definition: j2k.h:178
int mct
multi-component transform identifier
Definition: j2k.h:176
int pprot[JPWL_MAX_NO_PACKSPECS]
error protection methods for packets (0,1,16,32,37-128)
Definition: j2k.h:288
int id
marker value
Definition: j2k.c:1696
int th
number of tiles in heigth
Definition: j2k.h:244
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 tile_Ox
Definition: openjpeg.h:690
int jpwl_pprot[JPWL_MAX_NO_PACKSPECS]
error protection methods for packets (0,1,16,32,37-128)
Definition: openjpeg.h:326
int ppm_store
use in case of multiple marker PPM (number of info already store)
Definition: j2k.h:256
#define OPJ_TRUE
Definition: openjpeg.h:64
int jpwl_sens_addr
sensitivity addressing size (0=auto/2/4 bytes)
Definition: openjpeg.h:330
int roi_compno
region of interest: affected component in [0..3], -1 means no ROI
Definition: openjpeg.h:276
int cp_layer
Set the maximum number of quality layers to decode.
Definition: openjpeg.h:378
static void j2k_write_sod(opj_j2k_t *j2k, void *tile_coder)
Write the SOD marker (start of data)
Definition: j2k.c:1454
static void j2k_read_coc(opj_j2k_t *j2k)
Read the COC marker (coding style component)
Definition: j2k.c:836
@ J2K_STATE_ERR
the decoding process has encountered an error
Definition: j2k.h:108
opj_poc_t POC[32]
progression order changes
Definition: openjpeg.h:256
int numpocs
number of progression order changes
Definition: j2k.h:180
#define J2K_MS_COM
COM marker value.
Definition: j2k.h:79
static void j2k_read_plt(opj_j2k_t *j2k)
Read the PLT marker (packet length, tile-part header)
Definition: j2k.c:1159
int layno1
Layer num end,Resolution num end, Component num end, given by POC.
Definition: openjpeg.h:206
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
char tcp_mct
MCT (multiple component transform)
Definition: openjpeg.h:353
int prcE
Definition: openjpeg.h:220
struct opj_stepsize opj_stepsize_t
Quantization stepsize.
int cp_fixed_alloc
allocation by fixed layer
Definition: openjpeg.h:244
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
void cio_skip(opj_cio_t *cio, int n)
Skip some bytes.
Definition: cio.c:198
Definition: openjpeg.h:430
static void j2k_read_crg(opj_j2k_t *j2k)
Read the CRG marker (component registration)
Definition: j2k.c:1103
#define J2K_MS_PLM
PLM marker value.
Definition: j2k.h:72
int numgbits
number of guard bits
Definition: j2k.h:152
int sod_start
Definition: j2k.h:346
char * j2k_convert_progression_order(OPJ_PROG_ORDER prg_order)
Converts an enum type progression order to string type.
Definition: j2k.c:269
int jpwl_hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of header protection specification (>=0)
Definition: openjpeg.h:318
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
static void j2k_read_tlm(opj_j2k_t *j2k)
Read the TLM marker (tile-part lengths)
Definition: j2k.c:1116
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
opj_bool epc_on
enables writing of EPC in MH, thus activating JPWL
Definition: j2k.h:268
char tp_on
Enabling Tile part generation.
Definition: j2k.h:214
#define J2K_CP_CSTY_PRT
Definition: j2k.h:44
@ CPRL
component-precinct-resolution-layer order
Definition: openjpeg.h:124
int * cur_totnum_tp
Total number of tileparts of the current tile.
Definition: j2k.h:327
#define JPWL_ASSUME
Assume a basic codestream structure, so you can resort better from uncorrected errors.
Definition: jpwl.h:52
int main_head_end
main header position
Definition: openjpeg.h:714
@ CINEMA4K_24
2K Digital Cinema at 48 fps
Definition: openjpeg.h:112
static void j2k_write_qcc(opj_j2k_t *j2k, int compno)
Write the QCC marker (quantization component)
Definition: j2k.c:986
unsigned char ** tile_data
array used to store the data of each tile
Definition: j2k.h:353
unsigned char * ppm_data
packet header store there for futur use in t2_decode_packet
Definition: j2k.h:250
int * tileno
ID number of the tiles present in the codestream.
Definition: j2k.h:246
#define EVT_INFO
Debug event type.
Definition: event.h:37
int opj_bool
Definition: openjpeg.h:63
int cp_disto_alloc
allocation by rate/distortion
Definition: openjpeg.h:242
Tile-component coding parameters.
Definition: j2k.h:134
int factor
number of division by 2 of the out image compared to the original size of image
Definition: openjpeg.h:525
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
enum CINEMA_MODE OPJ_CINEMA_MODE
Digital cinema operation mode.
opj_tcd_image_t * tcd_image
info on each image tile
Definition: tcd.h:188
void j2k_read_red(opj_j2k_t *j2k)
Read the RED marker (Residual Error Descriptor)
Definition: jpwl.c:1200
static void j2k_read_cod(opj_j2k_t *j2k)
Read the COD marker (coding style default)
Definition: j2k.c:783
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
int roi_shift
region of interest: upshift value
Definition: openjpeg.h:278
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
int sens_size
enables writing of ESD, (0/2/4 bytes)
Definition: j2k.h:290
int cblockw_init
initial code block width, default to 64
Definition: openjpeg.h:268
int tile
Tile number.
Definition: openjpeg.h:214
int marknum
number of markers
Definition: openjpeg.h:658
void j2k_read_esd(opj_j2k_t *j2k)
Read the ESD marker (Error Sensitivity Descriptor)
Definition: jpwl.c:1170
int pos
position in codestream
Definition: openjpeg.h:607
int hprot_TPH[JPWL_MAX_NO_TILESPECS]
error protection methods for TPHs (0,1,16,32,37-128)
Definition: j2k.h:282
Decompression parameters.
Definition: openjpeg.h:363
int h
data height
Definition: openjpeg.h:511
char * comment
comment for coding
Definition: j2k.h:240
static void j2k_write_qcd(opj_j2k_t *j2k)
Write the QCD marker (quantization default)
Definition: j2k.c:954
void j2k_read_epc(opj_j2k_t *j2k)
Read the EPC marker (Error Protection Capability)
Definition: jpwl.c:907
void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos)
Set position in byte stream.
Definition: cio.c:109
opj_image_comp_t * comps
image components
Definition: openjpeg.h:547
OPJ_PROG_ORDER prog
progression order
Definition: openjpeg.h:684
opj_poc_t pocs[32]
progression order changes
Definition: j2k.h:184
int totnum_tp
Total num of tile parts in whole image = num tiles* num tileparts in each tile.
Definition: j2k.h:335
static void j2k_write_tlm(opj_j2k_t *j2k)
Write the TLM marker (Mainheader)
Definition: j2k.c:1262
opj_tile_info_t * tile
information regarding tiles inside image
Definition: openjpeg.h:718
int tp_pos
Position of the tilepart flag in Progression order.
Definition: tcd.h:175
#define JPWL_MAX_NO_PACKSPECS
Maximum number of packet parts expected by JPWL: increase at your will.
Definition: openjpeg.h:82
opj_tcp_t * default_tcp
decompression only : store decoding parameters common to all tiles (information like COD,...
Definition: j2k.h:360
@ FINAL_PASS
Function called in Rate allocation process.
Definition: j2k.h:118
int cblksty
code-block coding style
Definition: j2k.h:144
OPJ_CINEMA_MODE cinema
Digital cinema profile.
Definition: j2k.h:206
struct opj_tccp opj_tccp_t
Tile-component coding parameters.
#define JPWL_MAX_NO_TILESPECS
Maximum number of tile parts expected by JPWL: increase at your will.
Definition: openjpeg.h:81
int tile_Oy
Definition: openjpeg.h:692
Index structure of the codestream.
Definition: openjpeg.h:672
int states
value of the state when the marker can appear
Definition: j2k.c:1698
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
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
struct opj_tcp opj_tcp_t
Tile coding parameters : this structure is used to store coding/decoding parameters common to all til...
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
int img_size
Size of the image in bits.
Definition: j2k.h:210
int jpwl_max_tiles
maximum number of tiles
Definition: openjpeg.h:400
#define EVT_ERROR
Error event type.
Definition: event.h:35
int prcw[J2K_MAXRLVLS]
precinct width
Definition: j2k.h:156
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
void j2k_add_marker(opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len)
Definition: jpwl.c:164
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
resolution-precinct-component-layer order
Definition: openjpeg.h:122
char tp_on
Tile part generation.
Definition: openjpeg.h:349
int mode
mode switch (cblk_style)
Definition: openjpeg.h:272
int ppm_previous
use in case of multiple marker PPM (case on non-finished previous info)
Definition: j2k.h:258
opj_tp_info_t * tp
information concerning tile parts
Definition: openjpeg.h:666
Index structure : information regarding tiles.
Definition: openjpeg.h:632
static void j2k_read_ppm(opj_j2k_t *j2k)
Read the PPM marker (packet packet headers, main header)
Definition: j2k.c:1176
int jpwl_pprot_packno[JPWL_MAX_NO_PACKSPECS]
packet number of packet protection specification (>=0)
Definition: openjpeg.h:324
unsigned char * cio_getbp(opj_cio_t *cio)
Get pointer to the current position in the stream.
Definition: cio.c:129
@ J2K_STATE_MHSIZ
a SIZ marker is expected
Definition: j2k.h:102
int cp_tdy
YTsiz.
Definition: openjpeg.h:240
static void j2k_read_unk(opj_j2k_t *j2k)
Read an unknown marker.
Definition: j2k.c:1738
int csty
csty : coding style
Definition: openjpeg.h:252
#define OPJ_FALSE
Definition: openjpeg.h:65
OPJ_PROG_ORDER prg1
Progression order enum.
Definition: openjpeg.h:210
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
char * j2k_convert_progression_order(OPJ_PROG_ORDER prg_order)
Converts an enum type progression order to string type.
Definition: j2k.c:269
opj_bool red_on
enables writing of RED, in case of activated JPWL
Definition: j2k.h:276
int tile_y
tile size in y
Definition: openjpeg.h:688
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
static void j2k_read_sod(opj_j2k_t *j2k)
Read the SOD marker (start of data)
Definition: j2k.c:1527
int POC
indicates if a POC marker has been used O:NO, 1:YES
Definition: j2k.h:182
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
int y1
Ysiz: height of the reference grid.
Definition: openjpeg.h:541
opj_cp_t * cp
pointer to the coding parameters
Definition: j2k.h:364
OPJ_RSIZ_CAPABILITIES cp_rsiz
Profile name.
Definition: openjpeg.h:347
opj_codestream_info_t * cstr_info
helper used to write the index file
Definition: j2k.h:366
int * numdecompos
number of decomposition for each component
Definition: openjpeg.h:702
void dwt_calc_explicit_stepsizes(opj_tccp_t *tccp, int prec)
Explicit calculation of the Quantization Stepsizes.
Definition: dwt.c:477
void j2k_destroy_decompress(opj_j2k_t *j2k)
Destroy a J2K decompressor handle.
Definition: j2k.c:1835
char tp_flag
Flag determining tile part generation.
Definition: j2k.h:216
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
opj_bool jpwl_correct(opj_j2k_t *j2k)
corrects the data in the JPWL codestream
Definition: jpwl_lib.c:546
int state
locate in which part of the codestream the decoder is (main header, tile header, end)
Definition: j2k.h:319
void jpt_init_msg_header(opj_jpt_msg_header_t *header)
Initialize the value of the message header structure.
Definition: jpt.c:56
int tdx
XTsiz.
Definition: j2k.h:236
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
int ppm_len
ppmbug1
Definition: j2k.h:260
opj_bool epb_on
enables writing of EPB, in case of activated JPWL
Definition: j2k.h:270
#define J2K_MAXRLVLS
Number of maximum resolution level authorized.
Definition: openjpeg.h:77
void j2k_read_sec(opj_j2k_t *j2k)
Read the SEC marker (SEcured Codestream)
Definition: jpwl.c:1310
int th
number of tiles in Y
Definition: openjpeg.h:696
#define J2K_CCP_QNTSTY_SIQNT
Definition: j2k.h:55
#define J2K_CCP_QNTSTY_NOQNT
Definition: j2k.h:54
#define J2K_MS_COD
COD marker value.
Definition: j2k.h:65
int cblkh
code-blocks height
Definition: j2k.h:142
int tp_end_pos
end position of tile part
Definition: openjpeg.h:622
Defines image data and characteristics.
Definition: openjpeg.h:533
int jpwl_hprot_TPH[JPWL_MAX_NO_TILESPECS]
error protection methods for TPHs (0,1,16,32,37-128)
Definition: openjpeg.h:320
#define J2K_MS_POC
POC marker value.
Definition: j2k.h:70
int jpwl_hprot_MH
error protection method for MH (0,1,16,32,37-128)
Definition: openjpeg.h:316
int tileno_size
size of the vector tileno
Definition: j2k.h:248
int cur_tp_num
Current tile part number.
Definition: tcd.h:179
Progression order changes.
Definition: openjpeg.h:202
#define J2K_MS_CRG
CRG marker value.
Definition: j2k.h:78
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
int tp_numpacks
number of packets of tile part
Definition: openjpeg.h:626
void j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters)
Setup the decoder decoding parameters using user parameters.
Definition: j2k.c:1892
int tp_num
Tile part number.
Definition: tcd.h:177
static void j2k_read_rgn(opj_j2k_t *j2k)
Read the RGN marker (region-of-interest)
Definition: j2k.c:1599
@ J2K_STATE_NEOC
the decoding process must not expect a EOC marker because the codestream is truncated
Definition: j2k.h:107
static void j2k_write_eoc(opj_j2k_t *j2k)
Write the EOC marker (end of codestream)
Definition: j2k.c:1636
@ RLCP
resolution-layer-component-precinct order
Definition: openjpeg.h:121
int tile_x
tile size in x
Definition: openjpeg.h:686
int * cp_matrice
fixed layer
Definition: openjpeg.h:248
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 everything except the JPEG 2000 packets.
Definition: openjpeg.h:158
int sens_addr
sensitivity addressing size (0=auto/2/4 bytes)
Definition: j2k.h:292
int cp_reduce
Set the number of highest resolution levels to be discarded.
Definition: openjpeg.h:371
int numcomps
number of components in the image
Definition: openjpeg.h:543
int marknum
number of markers
Definition: openjpeg.h:705
void j2k_read_insec(opj_j2k_t *j2k)
Read the INSEC marker (SEcured Codestream)
Definition: jpwl.c:1341
Tile coder/decoder.
Definition: tcd.h:173
#define J2K_MS_QCD
QCD marker value.
Definition: j2k.h:68
#define J2K_MS_EPB
EPB marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:83
#define J2K_MS_SOD
SOD marker value.
Definition: j2k.h:62
void j2k_destroy_compress(opj_j2k_t *j2k)
Destroy a J2K compressor handle.
Definition: j2k.c:2127
int sens_range
sensitivity range (0-3)
Definition: j2k.h:294
int max_comp_size
Maximum rate for each component.
Definition: openjpeg.h:345
int tp_start_pack
start packet of tile part
Definition: openjpeg.h:624
int end_pos
end position
Definition: openjpeg.h:642
static void j2k_write_siz(opj_j2k_t *j2k)
Write the SIZ marker (image and tile size)
Definition: j2k.c:370
int fixed_quality
add fixed_quality
Definition: j2k.h:224
static void j2k_write_soc(opj_j2k_t *j2k)
Write the SOC marker (Start Of Codestream)
Definition: j2k.c:345
int codestream_size
codestream's size
Definition: openjpeg.h:716