Go to the documentation of this file.
55 void mct_encode(
int *c0,
int *c1,
int *c2,
int n);
63 void mct_decode(
int *c0,
int *c1,
int *c2,
int n);
unsigned short int Lesd
two bytes for the length of ESD MS, exluding the marker itself (4 to 65535 bytes)
Definition: jpwl.h:142
int pre_len
length of pre-data
Definition: jpwl.h:75
opj_packet_info_t * packet
information concerning packets inside tile
Definition: openjpeg.h:652
int tw
number of tiles in X
Definition: openjpeg.h:694
#define MAX_V2
Definition: jpwl_lib.c:41
#define jpwl_updateCRC16(CRC, DATA)
Macro functions for CRC computation.
Definition: jpwl.h:373
unsigned long int svalnum
number of sensitivity values
Definition: jpwl.h:157
unsigned long int Pepb
four bytes, next error management method
Definition: jpwl.h:92
int cio_numbytesleft(opj_cio_t *cio)
Number of bytes left before the end of the stream.
Definition: cio.c:121
#define opj_malloc(size)
Allocate an uninitialized memory block.
Definition: opj_malloc.h:51
#define jpwl_updateCRC32(CRC, DATA)
Computes the CRC-32, as stated in JPWL specs.
Definition: jpwl.h:381
static jpwl_marker_t jwmarker[JPWL_MAX_NO_MARKERS]
properties of JPWL markers to insert
Definition: jpwl.c:45
unsigned long int LDPepb
four bytes, from 0 to 2^31-1
Definition: jpwl.h:90
#define J2K_MS_ESD
ESD marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:84
double distotile
add fixed_quality
Definition: openjpeg.h:656
unsigned char se_size
size of sensitivity data (1/2 bytes)
Definition: jpwl.h:138
unsigned char Pesd
one byte, signals JPWL techniques adoption
Definition: jpwl.h:146
JPEG-2000 codestream reader/writer.
Definition: j2k.h:314
opj_bool parms_ready
the marker parameters are ready or not?
Definition: jpwl.h:203
int post_len
length of post-data
Definition: jpwl.h:81
int tp_end_header
end position of tile part header
Definition: openjpeg.h:620
static int jwmarker_num
number of JPWL prepared markers
Definition: jpwl.c:43
#define JPWL_MAXIMUM_EPB_ROOM
Expect this maximum number of bytes for composition of EPBs.
Definition: openjpeg.h:88
unsigned short int Pcrc
two bytes, CRC for the EPC, excluding Pcrc itself
Definition: jpwl.h:115
@ J2K_STATE_MT
the EOC marker has just been read
Definition: j2k.h:106
int tileno
tile where this marker has been placed (-1 means MH)
Definition: jpwl.h:155
opj_cio_t * cio
pointer to the byte i/o stream
Definition: j2k.h:368
unsigned short int jpwl_double_to_pfp(double V, int bytes)
conversion between a double precision floating point number and the corresponding pseudo-floating poi...
Definition: jpwl_lib.c:1615
int hprot
error protection method [-1=absent 0=none 1=predefined 16=CRC-16 32=CRC-32 37-128=RS]
Definition: jpwl.h:69
@ J2K_STATE_MHSOC
a SOC marker is expected
Definition: j2k.h:101
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
int length
buffer size in bytes
Definition: openjpeg.h:484
EPC (Error Protection Capability) Marker segment.
Definition: jpwl.h:101
void jpwl_esd_write(opj_j2k_t *j2k, jpwl_esd_ms_t *esd, unsigned char *buf)
write an ESD MS to a buffer
Definition: jpwl_lib.c:1584
int end_pos
packet end position
Definition: openjpeg.h:593
unsigned char * data
ESD data, variable length.
Definition: jpwl.h:148
double disto
packet distorsion
Definition: openjpeg.h:595
opj_bool esd_on
enables writing of ESD, in case of activated JPWL
Definition: j2k.h:272
static const double mct_norms_real[3]
Definition: mct.c:46
jpwl_epc_ms_t * jpwl_epc_create(opj_j2k_t *j2k, opj_bool esd_on, opj_bool red_on, opj_bool epb_on, opj_bool info_on)
create an EPC marker segment
Definition: jpwl_lib.c:333
double jpwl_pfp_to_double(unsigned short int em, int bytes)
conversion between a pseudo-floating point used to represent sensitivity values and the corresponding...
Definition: jpwl_lib.c:1660
double mct_getnorm(int compno)
Get norm of the basis function used for the reversible multi-component transform.
Definition: mct.c:97
unsigned short int Lepb
two bytes for the length of EPB MS, exluding the marker itself (11 to 65535 bytes)
Definition: jpwl.h:86
opj_image_t * image
pointer to the encoded / decoded image
Definition: j2k.h:362
int exp_comps
expected number of components at the decoder
Definition: j2k.h:304
opj_bool red_on
is RED active?
Definition: jpwl.h:105
opj_bool epb_on
is EPB active?
Definition: jpwl.h:107
int start_pos
packet start position (including SOP marker if it exists)
Definition: openjpeg.h:589
int start_pos
start position
Definition: openjpeg.h:638
int sgnd
signed (1) / unsigned (0)
Definition: openjpeg.h:521
Structure used to store JPWL markers temporary position and readyness.
Definition: jpwl.h:178
int eras_dec_rs(dtype *data, int *eras_pos, int no_eras)
Definition: rs.c:367
#define J2K_MS_EPC
EPC marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:82
int n_pre
code word length of pre-data
Definition: jpwl.h:73
opj_bool len_ready
the marker length is ready or not?
Definition: jpwl.h:199
void mct_decode_real(float *c0, float *c1, float *c2, int n)
Apply an irreversible multi-component inverse transform to an image.
int end_ph_pos
end of packet header position (including EPH marker if it exists)
Definition: openjpeg.h:591
@ J2K_STATE_MH
the decoding process is in the main header
Definition: j2k.h:103
unsigned char Depb
single byte for the style
Definition: jpwl.h:88
unsigned int cio_read(opj_cio_t *cio, int n)
Read some bytes.
Definition: cio.c:183
int encode_rs(dtype *data, dtype *bb)
Definition: rs.c:324
void mct_encode(int *c0, int *c1, int *c2, int n)
Apply a reversible multi-component transform to an image.
#define NN
Definition: rs.h:61
int bpp
image depth in bits
Definition: openjpeg.h:519
ESD (Error Sensitivity Descriptor) Marker segment.
Definition: jpwl.h:128
opj_common_ptr cinfo
codec context
Definition: j2k.h:316
#define EVT_WARNING
Warning event type.
Definition: event.h:36
#define MIN_V2
Definition: jpwl_lib.c:40
int end_header
end position of the header
Definition: openjpeg.h:640
int id
marker value (J2K_MS_EPC, etc.)
Definition: jpwl.h:180
#define J2K_MS_SIZ
SIZ marker value.
Definition: j2k.h:64
#define J2K_MS_SOT
SOT marker value.
Definition: j2k.h:61
void mct_encode_real(int *c0, int *c1, int *c2, int n)
Apply an irreversible multi-component transform to an image.
unsigned short int Lepc
two bytes for the length of EPC MS, exluding the marker itself (9 to 65535 bytes)
Definition: jpwl.h:113
Byte input-output stream (CIO)
Definition: openjpeg.h:475
int tp_start_pos
start position of tile part
Definition: openjpeg.h:618
int jpwl_markcomp(const void *arg1, const void *arg2)
this function is used to compare two JPWL markers based on their relevant wishlist position
Definition: jpwl_lib.c:63
void jpwl_epb_write(opj_j2k_t *j2k, jpwl_epb_ms_t *epb, unsigned char *buf)
write an EPB MS to a buffer
Definition: jpwl_lib.c:298
unsigned char Pepc
one byte, signals JPWL techniques adoption
Definition: jpwl.h:119
#define J2K_MS_SOC
SOC marker value.
Definition: j2k.h:60
unsigned short int Cesd
two bytes, component of error sensitivity
Definition: jpwl.h:144
opj_bool correct
enables JPWL correction at the decoder
Definition: j2k.h:302
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
static INLINE int fix_mul(int a, int b)
Multiply two fixed-precision rational numbers.
Definition: fix.h:56
size_t sensval_size
size of a single sensitivity pair (address+value)
Definition: jpwl.h:159
unsigned char * end
pointer to the end of the stream
Definition: openjpeg.h:489
unsigned long int DL
four bytes, the codestream length from SOC to EOC
Definition: jpwl.h:117
int OPJ_CALLCONV cio_tell(opj_cio_t *cio)
Get position in byte stream.
Definition: cio.c:100
#define J2K_MS_EOC
EOC marker value.
Definition: j2k.h:63
int num_tps
number of tile parts
Definition: openjpeg.h:664
opj_bool data_ready
are the written data ready or not
Definition: jpwl.h:205
opj_bool info_on
are informative techniques active?
Definition: jpwl.h:109
int packno
packet number
Definition: openjpeg.h:676
int k_pre
message word length of pre-data
Definition: jpwl.h:71
#define OPJ_TRUE
Definition: openjpeg.h:64
void init_rs(int k)
Initialization function.
Definition: rs.c:198
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
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
opj_bool jpwl_epb_fill(opj_j2k_t *j2k, jpwl_epb_ms_t *epb, unsigned char *buf, unsigned char *post_buf)
Definition: jpwl_lib.c:359
jpwl_epb_ms_t * epbmark
pointer to EPB marker
Definition: jpwl.h:184
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
double mct_getnorm(int compno)
Get norm of the basis function used for the reversible multi-component transform.
Definition: mct.c:97
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
int numpix
add fixed_quality
Definition: openjpeg.h:654
unsigned char * bp
pointer to the current position
Definition: openjpeg.h:491
unsigned short int len
length of the marker segment (marker excluded)
Definition: jpwl.h:197
opj_bool pos_ready
the marker position is ready or not?
Definition: jpwl.h:201
#define MIN_V1
Minimum and maximum values for the double->pfp conversion.
Definition: jpwl_lib.c:38
EPB (Error Protection Block) Marker segment.
Definition: jpwl.h:57
int main_head_end
main header position
Definition: openjpeg.h:714
double mct_getnorm_real(int compno)
Get norm of the basis function used for the irreversible multi-component transform.
Definition: mct.c:188
#define EVT_INFO
Debug event type.
Definition: event.h:37
int opj_bool
Definition: openjpeg.h:63
int numcomps
number of components in the image
Definition: jpwl.h:153
#define restrict
Definition: opj_includes.h:85
opj_bool esd_on
is ESD active?
Definition: jpwl.h:103
union jpwl_marker::jpwl_marks m
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
void mct_decode(int *c0, int *c1, int *c2, int n)
Apply a reversible multi-component inverse transform to an image.
unsigned char ad_size
size of codestream addresses [2/4 bytes]
Definition: jpwl.h:132
opj_tile_info_t * tile
information regarding tiles inside image
Definition: openjpeg.h:718
Index structure of the codestream.
Definition: openjpeg.h:672
#define EVT_ERROR
Error event type.
Definition: event.h:35
void j2k_add_marker(opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len)
Definition: jpwl.c:164
unsigned char addrm
codestream addressing mode [0=packet, 1=byte range, 2=packet range, 3=reserved]
Definition: jpwl.h:130
void jpwl_epc_write(opj_j2k_t *j2k, jpwl_epc_ms_t *epc, unsigned char *buf)
write an EPC MS to a buffer
Definition: jpwl_lib.c:1163
unsigned char senst
type of sensitivity [0=relative error, 1=MSE, 2=MSE reduction, 3=PSNR, 4=PSNR increment,...
Definition: jpwl.h:136
opj_tp_info_t * tp
information concerning tile parts
Definition: openjpeg.h:666
int k_post
message word length of post-data
Definition: jpwl.h:77
int tileno
TH where this marker has been placed (-1 means MH)
Definition: jpwl.h:65
@ J2K_STATE_MHSIZ
a SIZ marker is expected
Definition: j2k.h:102
double dpos
same as before, only written as a double, so we can sort it better
Definition: jpwl.h:195
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
jpwl_esd_ms_t * jpwl_esd_create(opj_j2k_t *j2k, int comp, unsigned char addrm, unsigned char ad_size, unsigned char senst, int se_size, int tileno, unsigned long int svalnum, void *sensval)
create an EPC marker segment
Definition: jpwl_lib.c:1203
#define OPJ_FALSE
Definition: openjpeg.h:65
opj_bool red_on
enables writing of RED, in case of activated JPWL
Definition: j2k.h:276
opj_cp_t * cp
pointer to the coding parameters
Definition: j2k.h:364
opj_codestream_info_t * cstr_info
helper used to write the index file
Definition: j2k.h:366
void mct_decode(int *restrict c0, int *restrict c1, int *restrict c2, int n)
Definition: mct.c:74
#define min(a, b)
Computes the minimum between two integers.
Definition: rs.h:102
void mct_encode(int *restrict c0, int *restrict c1, int *restrict c2, int n)
Definition: mct.c:51
int state
locate in which part of the codestream the decoder is (main header, tile header, end)
Definition: j2k.h:319
int n_post
code word length of post-data
Definition: jpwl.h:79
opj_bool jpwl_esd_fill(opj_j2k_t *j2k, jpwl_esd_ms_t *esd, unsigned char *buf)
Definition: jpwl_lib.c:1336
opj_bool epb_on
enables writing of EPB, in case of activated JPWL
Definition: j2k.h:270
double mct_getnorm_real(int compno)
Get norm of the basis function used for the irreversible multi-component transform.
Definition: mct.c:188
unsigned long int pos
position where the marker should go, in the pre-JPWL codestream
Definition: jpwl.h:193
int th
number of tiles in Y
Definition: openjpeg.h:696
void mct_encode_real(int *restrict c0, int *restrict c1, int *restrict c2, int n)
Definition: mct.c:104
int tp_end_pos
end position of tile part
Definition: openjpeg.h:622
void mct_decode_real(float *restrict c0, float *restrict c1, float *restrict c2, int n)
Definition: mct.c:127
int numcomps
number of components in the image
Definition: openjpeg.h:543
#define JPWL_MAX_NO_MARKERS
Maximum number of JPWL markers: increase at your will.
Definition: openjpeg.h:83
#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
#define MAX_V1
Definition: jpwl_lib.c:39
int end_pos
end position
Definition: openjpeg.h:642
opj_bool jpwl_correct(opj_j2k_t *j2k)
corrects the data in the JPWL codestream
Definition: jpwl_lib.c:546
static const double mct_norms[3]
Definition: mct.c:41
int codestream_size
codestream's size
Definition: openjpeg.h:716