52 #define JPWL_ASSUME OPJ_TRUE
117 unsigned long int DL;
284 unsigned long int pre_len,
unsigned long int post_len);
303 double place_pos,
int tileno,
304 unsigned long int pre_len,
unsigned long int post_len);
320 int comps,
unsigned char addrm,
unsigned char ad_size,
321 unsigned char senst,
unsigned char se_size,
322 double place_pos,
int tileno);
356 unsigned char **L4_bufp);
373 #define jpwl_updateCRC16(CRC, DATA) updateCRC16(CRC, DATA)
381 #define jpwl_updateCRC32(CRC, DATA) updateCRC32(CRC, DATA)
390 #define min(a,b) (((a) < (b)) ? (a) : (b))
unsigned short int Lepb
two bytes for the length of EPB MS, exluding the marker itself (11 to 65535 bytes) ...
Definition: jpwl.h:86
unsigned char * data
ESD data, variable length.
Definition: jpwl.h:148
jpwl_epc_ms_t * epcmark
pointer to EPC marker
Definition: jpwl.h:186
EPB (Error Protection Block) Marker segment.
Definition: jpwl.h:57
opj_bool parms_ready
the marker parameters are ready or not?
Definition: jpwl.h:203
jpwl_esd_ms_t * esdmark
pointer to ESD marker
Definition: jpwl.h:188
unsigned short int len
length of the marker segment (marker excluded)
Definition: jpwl.h:197
opj_bool latest
is the latest in header?
Definition: jpwl.h:61
unsigned char se_size
size of sensitivity data (1/2 bytes)
Definition: jpwl.h:138
static jpwl_marker_t jwmarker[JPWL_MAX_NO_MARKERS]
properties of JPWL markers to insert
Definition: jpwl.c:45
int hprot
error protection method [-1=absent 0=none 1=predefined 16=CRC-16 32=CRC-32 37-128=RS] ...
Definition: jpwl.h:69
Tile coder/decoder.
Definition: tcd.h:173
int n_pre
code word length of pre-data
Definition: jpwl.h:73
JPEG-2000 codestream reader/writer.
Definition: j2k.h:314
void j2k_read_sec(opj_j2k_t *j2k)
Read the SEC marker (SEcured Codestream)
Definition: jpwl.c:1310
void j2k_read_red(opj_j2k_t *j2k)
Read the RED marker (Residual Error Descriptor)
Definition: jpwl.c:1200
opj_bool jpwl_check_tile(opj_j2k_t *j2k, opj_tcd_t *tcd, int tileno)
check that a tile and its children have valid data
Definition: jpwl.c:1223
unsigned short int Lred
two bytes for the length of RED MS, exluding the marker itself (3 to 65535 bytes) ...
Definition: jpwl.h:168
int k_post
message word length of post-data
Definition: jpwl.h:77
struct jpwl_red_ms jpwl_red_ms_t
RED (Residual Error Descriptor) Marker segment.
int pre_len
length of pre-data
Definition: jpwl.h:75
size_t sensval_size
size of a single sensitivity pair (address+value)
Definition: jpwl.h:159
opj_bool info_on
are informative techniques active?
Definition: jpwl.h:109
unsigned short int Pcrc
two bytes, CRC for the EPC, excluding Pcrc itself
Definition: jpwl.h:115
jpwl_epb_ms_t * jpwl_epb_create(opj_j2k_t *j2k, opj_bool latest, opj_bool packed, int tileno, int idx, int hprot, unsigned long int pre_len, unsigned long int post_len)
create an EPB marker segment
Definition: jpwl_lib.c:199
void j2k_write_epc(opj_j2k_t *j2k)
Write the EPC marker (Error Protection Capability), BUT the DL field is always set to 0 (this simplif...
Definition: jpwl.c:958
Functions used to compute the 16- and 32-bit CRC of byte arrays.
unsigned char * data
EPC data, variable length.
Definition: jpwl.h:121
Functions used to compute Reed-Solomon parity and check of byte arrays.
unsigned char * data
EPB data, variable size.
Definition: jpwl.h:94
int jpwl_epbs_add(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int *jwmarker_num, opj_bool latest, opj_bool packed, opj_bool insideMH, int *idx, int hprot, double place_pos, int tileno, unsigned long int pre_len, unsigned long int post_len)
add a number of EPB marker segments
Definition: jpwl_lib.c:76
opj_bool pos_ready
the marker position is ready or not?
Definition: jpwl.h:201
Defines image data and characteristics.
Definition: openjpeg.h:533
void jpwl_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image)
Encode according to JPWL specs.
Definition: jpwl.c:114
opj_bool data_ready
are the written data ready or not
Definition: jpwl.h:205
opj_bool jpwl_epb_correct(opj_j2k_t *j2k, unsigned char *buffer, int type, int pre_len, int post_len, int *conn, unsigned char **L4_bufp)
corrects the data protected by an EPB
Definition: jpwl_lib.c:744
unsigned long int LDPepb
four bytes, from 0 to 2^31-1
Definition: jpwl.h:90
struct jpwl_epc_ms jpwl_epc_ms_t
EPC (Error Protection Capability) Marker segment.
unsigned char senst
type of sensitivity [0=relative error, 1=MSE, 2=MSE reduction, 3=PSNR, 4=PSNR increment, 5=MAXERR (absolute peak error), 6=TSE (total squared error), 7=reserved
Definition: jpwl.h:136
jpwl_red_ms_t * redmark
pointer to RED marker
Definition: jpwl.h:190
opj_bool esd_on
is ESD active?
Definition: jpwl.h:103
unsigned char index
index in current header (0-63)
Definition: jpwl.h:67
void j2k_read_epc(opj_j2k_t *j2k)
Read the EPC marker (Error Protection Capability)
Definition: jpwl.c:907
Byte input-output stream (CIO)
Definition: openjpeg.h:475
void jpwl_prepare_marks(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image)
Prepare the list of JPWL markers, after the Part 1 codestream has been finalized (index struct is ful...
Definition: jpwl.c:183
unsigned char ad_size
size of codestream addresses [2/4 bytes]
Definition: jpwl.h:132
opj_bool jpwl_epb_fill(opj_j2k_t *j2k, jpwl_epb_ms_t *epbmark, unsigned char *buf, unsigned char *post_buf)
Definition: jpwl_lib.c:359
unsigned short int Lesd
two bytes for the length of ESD MS, exluding the marker itself (4 to 65535 bytes) ...
Definition: jpwl.h:142
EPC (Error Protection Capability) Marker segment.
Definition: jpwl.h:101
union keeping the pointer to the real marker struct
Definition: jpwl.h:182
opj_bool jpwl_update_info(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int jwmarker_num)
updates the information structure by modifying the positions and lengths
Definition: jpwl_lib.c:1685
unsigned char Pepc
one byte, signals JPWL techniques adoption
Definition: jpwl.h:119
struct jpwl_esd_ms jpwl_esd_ms_t
ESD (Error Sensitivity Descriptor) Marker segment.
int post_len
length of post-data
Definition: jpwl.h:81
void j2k_write_sec(opj_j2k_t *j2k)
Write the SEC marker (SEcured Codestream)
Definition: jpwl.c:1327
void jpwl_dump_marks(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image)
Dump the list of JPWL markers, after it has been prepared.
Definition: jpwl.c:712
int id
marker value (J2K_MS_EPC, etc.)
Definition: jpwl.h:180
void j2k_read_epb(opj_j2k_t *j2k)
Read the EPB marker (Error Protection Block)
Definition: jpwl.c:1019
unsigned short int Cesd
two bytes, component of error sensitivity
Definition: jpwl.h:144
double dpos
same as before, only written as a double, so we can sort it better
Definition: jpwl.h:195
unsigned short int Lepc
two bytes for the length of EPC MS, exluding the marker itself (9 to 65535 bytes) ...
Definition: jpwl.h:113
int jpwl_esds_add(opj_j2k_t *j2k, jpwl_marker_t *jwmarker, int *jwmarker_num, int comps, unsigned char addrm, unsigned char ad_size, unsigned char senst, unsigned char se_size, double place_pos, int tileno)
add a number of ESD marker segments
Definition: jpwl_lib.c:1195
unsigned char * data
RED data, variable length.
Definition: jpwl.h:172
unsigned long int Pepb
four bytes, next error management method
Definition: jpwl.h:92
opj_bool jpwl_correct(opj_j2k_t *j2k)
corrects the data in the JPWL codestream
Definition: jpwl_lib.c:546
unsigned char Depb
single byte for the style
Definition: jpwl.h:88
unsigned long int DL
four bytes, the codestream length from SOC to EOC
Definition: jpwl.h:117
int opj_bool
Definition: openjpeg.h:63
ESD (Error Sensitivity Descriptor) Marker segment.
Definition: jpwl.h:128
unsigned long int pos
position where the marker should go, in the pre-JPWL codestream
Definition: jpwl.h:193
opj_bool len_ready
the marker length is ready or not?
Definition: jpwl.h:199
void j2k_write_epb(opj_j2k_t *j2k)
Write the EPB marker (Error Protection Block)
Definition: jpwl.c:1134
int tileno
TH where this marker has been placed (-1 means MH)
Definition: jpwl.h:65
opj_bool jpwl_esd_fill(opj_j2k_t *j2k, jpwl_esd_ms_t *esdmark, unsigned char *buf)
Definition: jpwl_lib.c:1336
void j2k_read_insec(opj_j2k_t *j2k)
Read the INSEC marker (SEcured Codestream)
Definition: jpwl.c:1341
opj_bool red_on
is RED active?
Definition: jpwl.h:105
opj_bool packed
is it in packed mode?
Definition: jpwl.h:63
int k_pre
message word length of pre-data
Definition: jpwl.h:71
RED (Residual Error Descriptor) Marker segment.
Definition: jpwl.h:166
int tileno
tile where this marker has been placed (-1 means MH)
Definition: jpwl.h:155
unsigned long int svalnum
number of sensitivity values
Definition: jpwl.h:157
Structure used to store JPWL markers temporary position and readyness.
Definition: jpwl.h:178
opj_bool epb_on
is EPB active?
Definition: jpwl.h:107
struct jpwl_epb_ms jpwl_epb_ms_t
EPB (Error Protection Block) Marker segment.
int numcomps
number of components in the image
Definition: jpwl.h:153
struct jpwl_marker jpwl_marker_t
Structure used to store JPWL markers temporary position and readyness.
union jpwl_marker::jpwl_marks m
void j2k_add_marker(opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len)
Definition: jpwl.c:164
unsigned char Pesd
one byte, signals JPWL techniques adoption
Definition: jpwl.h:146
Index structure of the codestream.
Definition: openjpeg.h:672
unsigned char Pred
one byte, signals JPWL techniques adoption
Definition: jpwl.h:170
void j2k_read_esd(opj_j2k_t *j2k)
Read the ESD marker (Error Sensitivity Descriptor)
Definition: jpwl.c:1170
static int jwmarker_num
number of JPWL prepared markers
Definition: jpwl.c:43
int n_post
code word length of post-data
Definition: jpwl.h:79
unsigned char addrm
codestream addressing mode [0=packet, 1=byte range, 2=packet range, 3=reserved]
Definition: jpwl.h:130
jpwl_epb_ms_t * epbmark
pointer to EPB marker
Definition: jpwl.h:184