OpenJPEG  1.5.1
jpwl.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001-2003, David Janssens
3  * Copyright (c) 2002-2003, Yannick Verschueren
4  * Copyright (c) 2003-2005, Francois Devaux and Antonin Descampe
5  * Copyright (c) 2005, Herve Drolon, FreeImage Team
6  * Copyright (c) 2002-2005, Communications and remote sensing Laboratory, Universite catholique de Louvain, Belgium
7  * Copyright (c) 2005-2006, Dept. of Electronic and Information Engineering, Universita' degli Studi di Perugia, Italy
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 __JPWL_H
32 #define __JPWL_H
33 
34 #ifdef USE_JPWL
35 
36 #include "crc.h"
37 #include "rs.h"
38 
48 
52 #define JPWL_ASSUME OPJ_TRUE
53 
57 typedef struct jpwl_epb_ms {
65  int tileno;
67  unsigned char index;
69  int hprot;
71  int k_pre;
73  int n_pre;
75  int pre_len;
77  int k_post;
79  int n_post;
81  int post_len;
86  unsigned short int Lepb;
88  unsigned char Depb;
90  unsigned long int LDPepb;
92  unsigned long int Pepb;
94  unsigned char *data;
97 
101 typedef struct jpwl_epc_ms {
113  unsigned short int Lepc;
115  unsigned short int Pcrc;
117  unsigned long int DL;
119  unsigned char Pepc;
121  unsigned char *data;
123 } jpwl_epc_ms_t;
124 
128 typedef struct jpwl_esd_ms {
130  unsigned char addrm;
132  unsigned char ad_size;
136  unsigned char senst;
138  unsigned char se_size;
142  unsigned short int Lesd;
144  unsigned short int Cesd;
146  unsigned char Pesd;
148  unsigned char *data;
153  int numcomps;
155  int tileno;
157  unsigned long int svalnum;
159  size_t sensval_size;
161 } jpwl_esd_ms_t;
162 
166 typedef struct jpwl_red_ms {
168  unsigned short int Lred;
170  unsigned char Pred;
172  unsigned char *data;
173 } jpwl_red_ms_t;
174 
178 typedef struct jpwl_marker {
180  int id;
182  union jpwl_marks {
191  } m;
193  unsigned long int pos;
195  double dpos;
197  unsigned short int len;
206 } jpwl_marker_t;
207 
214 void jpwl_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image);
215 
223 void jpwl_prepare_marks(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image);
224 
231 void jpwl_dump_marks(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image);
232 
237 void j2k_read_epc(opj_j2k_t *j2k);
238 
246 void j2k_write_epc(opj_j2k_t *j2k);
247 
252 void j2k_read_epb(opj_j2k_t *j2k);
253 
258 void j2k_write_epb(opj_j2k_t *j2k);
259 
264 void j2k_read_esd(opj_j2k_t *j2k);
265 
270 void j2k_read_red(opj_j2k_t *j2k);
271 
283 jpwl_epb_ms_t *jpwl_epb_create(opj_j2k_t *j2k, opj_bool latest, opj_bool packed, int tileno, int idx, int hprot,
284  unsigned long int pre_len, unsigned long int post_len);
285 
302  opj_bool latest, opj_bool packed, opj_bool insideMH, int *idx, int hprot,
303  double place_pos, int tileno,
304  unsigned long int pre_len, unsigned long int post_len);
305 
320  int comps, unsigned char addrm, unsigned char ad_size,
321  unsigned char senst, unsigned char se_size,
322  double place_pos, int tileno);
323 
331 
332 
333 opj_bool jpwl_esd_fill(opj_j2k_t *j2k, jpwl_esd_ms_t *esdmark, unsigned char *buf);
334 
335 opj_bool jpwl_epb_fill(opj_j2k_t *j2k, jpwl_epb_ms_t *epbmark, unsigned char *buf, unsigned char *post_buf);
336 
337 void j2k_add_marker(opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len);
338 
344 
355 opj_bool jpwl_epb_correct(opj_j2k_t *j2k, unsigned char *buffer, int type, int pre_len, int post_len, int *conn,
356  unsigned char **L4_bufp);
357 
363 opj_bool jpwl_check_tile(opj_j2k_t *j2k, opj_tcd_t *tcd, int tileno);
364 
373 #define jpwl_updateCRC16(CRC, DATA) updateCRC16(CRC, DATA)
374 
381 #define jpwl_updateCRC32(CRC, DATA) updateCRC32(CRC, DATA)
382 
389 #ifndef min
390 #define min(a,b) (((a) < (b)) ? (a) : (b))
391 #endif /* min */
392 
395 #endif /* USE_JPWL */
396 
397 #ifdef USE_JPSEC
398 
401 
406 void j2k_read_sec(opj_j2k_t *j2k);
407 
412 void j2k_write_sec(opj_j2k_t *j2k);
413 
418 void j2k_read_insec(opj_j2k_t *j2k);
419 
422 #endif /* USE_JPSEC */
423 
424 #endif /* __JPWL_H */
425 
jpwl_esd_ms::Lesd
unsigned short int Lesd
two bytes for the length of ESD MS, exluding the marker itself (4 to 65535 bytes)
Definition: jpwl.h:142
jpwl_epb_ms::pre_len
int pre_len
length of pre-data
Definition: jpwl.h:75
jpwl_prepare_marks
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
j2k_write_epc
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
opj_tile_info::packet
opj_packet_info_t * packet
information concerning packets inside tile
Definition: openjpeg.h:652
jpwl_epb_ms::data
unsigned char * data
EPB data, variable size.
Definition: jpwl.h:94
opj_codestream_info::tw
int tw
number of tiles in X
Definition: openjpeg.h:694
jpwl_red_ms::Lred
unsigned short int Lred
two bytes for the length of RED MS, exluding the marker itself (3 to 65535 bytes)
Definition: jpwl.h:168
jpwl_updateCRC16
#define jpwl_updateCRC16(CRC, DATA)
Macro functions for CRC computation.
Definition: jpwl.h:373
opj_cp::hprot_MH
int hprot_MH
error protection method for MH (0,1,16,32,37-128)
Definition: j2k.h:278
j2k_add_marker
void j2k_add_marker(opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len)
Definition: jpwl.c:164
jpwl_esd_ms::svalnum
unsigned long int svalnum
number of sensitivity values
Definition: jpwl.h:157
jpwl_epb_ms::Pepb
unsigned long int Pepb
four bytes, next error management method
Definition: jpwl.h:92
opj_free
#define opj_free(m)
Deallocates or frees a memory block.
Definition: opj_malloc.h:152
opj_malloc
#define opj_malloc(size)
Allocate an uninitialized memory block.
Definition: opj_malloc.h:51
jpwl_epb_correct
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
jwmarker
static jpwl_marker_t jwmarker[JPWL_MAX_NO_MARKERS]
properties of JPWL markers to insert
Definition: jpwl.c:45
jpwl_epb_ms_t
struct jpwl_epb_ms jpwl_epb_ms_t
EPB (Error Protection Block) Marker segment.
j2k_read_epb
void j2k_read_epb(opj_j2k_t *j2k)
Read the EPB marker (Error Protection Block)
Definition: jpwl.c:1019
jpwl_epb_ms::LDPepb
unsigned long int LDPepb
four bytes, from 0 to 2^31-1
Definition: jpwl.h:90
opj_marker_info_t::type
unsigned short int type
marker type
Definition: openjpeg.h:605
jpwl_epc_ms::data
unsigned char * data
EPC data, variable length.
Definition: jpwl.h:121
J2K_MS_ESD
#define J2K_MS_ESD
ESD marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:84
jpwl_esd_ms::se_size
unsigned char se_size
size of sensitivity data (1/2 bytes)
Definition: jpwl.h:138
jpwl_esd_ms::Pesd
unsigned char Pesd
one byte, signals JPWL techniques adoption
Definition: jpwl.h:146
opj_tcd_resolution::pw
int pw
Definition: tcd.h:132
opj_j2k
JPEG-2000 codestream reader/writer.
Definition: j2k.h:314
jpwl_marker::parms_ready
opj_bool parms_ready
the marker parameters are ready or not?
Definition: jpwl.h:203
jpwl_epb_ms::post_len
int post_len
length of post-data
Definition: jpwl.h:81
opj_tp_info::tp_end_header
int tp_end_header
end position of tile part header
Definition: openjpeg.h:620
jwmarker_num
static int jwmarker_num
number of JPWL prepared markers
Definition: jpwl.c:43
opj_marker_info_t::len
int len
length, marker val included
Definition: openjpeg.h:609
opj_marker_info_t
Marker structure.
Definition: openjpeg.h:603
opj_clock
double opj_clock(void)
Difference in successive opj_clock() calls tells you the elapsed time.
Definition: j2k_lib.c:36
jpwl_prepare_marks
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
j2k_read_esd
void j2k_read_esd(opj_j2k_t *j2k)
Read the ESD marker (Error Sensitivity Descriptor)
Definition: jpwl.c:1170
jpwl_epc_ms::Pcrc
unsigned short int Pcrc
two bytes, CRC for the EPC, excluding Pcrc itself
Definition: jpwl.h:115
opj_tcd_resolution::numbands
int numbands
Definition: tcd.h:133
jpwl_esd_ms::tileno
int tileno
tile where this marker has been placed (-1 means MH)
Definition: jpwl.h:155
opj_tcd_resolution::bands
opj_tcd_band_t bands[3]
Definition: tcd.h:134
opj_cp::pprot_tileno
int pprot_tileno[JPWL_MAX_NO_PACKSPECS]
tile number of packet protection specification (>=0)
Definition: j2k.h:284
opj_j2k::cio
opj_cio_t * cio
pointer to the byte i/o stream
Definition: j2k.h:368
jpwl_epb_ms::hprot
int hprot
error protection method [-1=absent 0=none 1=predefined 16=CRC-16 32=CRC-32 37-128=RS]
Definition: jpwl.h:69
opj_codestream_info::maxmarknum
int maxmarknum
actual size of markers array
Definition: openjpeg.h:709
j2k_write_sec
void j2k_write_sec(opj_j2k_t *j2k)
Write the SEC marker (SEcured Codestream)
Definition: jpwl.c:1327
jpwl_esd_create
jpwl_esd_ms_t * jpwl_esd_create(opj_j2k_t *j2k, int comps, 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
opj_cio::length
int length
buffer size in bytes
Definition: openjpeg.h:484
jpwl_epc_ms
EPC (Error Protection Capability) Marker segment.
Definition: jpwl.h:101
opj_packet_info::end_pos
int end_pos
packet end position
Definition: openjpeg.h:593
j2k_write_epb
void j2k_write_epb(opj_j2k_t *j2k)
Write the EPB marker (Error Protection Block)
Definition: jpwl.c:1134
jpwl_esd_ms::data
unsigned char * data
ESD data, variable length.
Definition: jpwl.h:148
opj_cp::sens_MH
int sens_MH
sensitivity method for MH (-1,0-7)
Definition: j2k.h:296
opj_cp::esd_on
opj_bool esd_on
enables writing of ESD, in case of activated JPWL
Definition: j2k.h:272
crc.h
Functions used to compute the 16- and 32-bit CRC of byte arrays.
J2K_MS_SEC
#define J2K_MS_SEC
SEC marker value (Part 8: Secure JPEG 2000)
Definition: j2k.h:88
jpwl_epb_ms::Lepb
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_j2k::image
opj_image_t * image
pointer to the encoded / decoded image
Definition: j2k.h:362
opj_cp::exp_comps
int exp_comps
expected number of components at the decoder
Definition: j2k.h:304
opj_codestream_info::main_head_start
int main_head_start
main header position
Definition: openjpeg.h:712
jpwl_epc_ms::red_on
opj_bool red_on
is RED active?
Definition: jpwl.h:105
opj_j2k::pos_correction
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
jpwl_epc_ms::epb_on
opj_bool epb_on
is EPB active?
Definition: jpwl.h:107
opj_cp::sens_TPH
int sens_TPH[JPWL_MAX_NO_TILESPECS]
sensitivity methods for TPHs (-1,0-7)
Definition: j2k.h:300
jpwl_update_info
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_packet_info::start_pos
int start_pos
packet start position (including SOP marker if it exists)
Definition: openjpeg.h:589
j2k_read_epb
void j2k_read_epb(opj_j2k_t *j2k)
Read the EPB marker (Error Protection Block)
Definition: jpwl.c:1019
jpwl_red_ms::data
unsigned char * data
RED data, variable length.
Definition: jpwl.h:172
jpwl_marker
Structure used to store JPWL markers temporary position and readyness.
Definition: jpwl.h:178
J2K_MS_EPC
#define J2K_MS_EPC
EPC marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:82
opj_tcd_tilecomp::resolutions
opj_tcd_resolution_t * resolutions
Definition: tcd.h:143
opj_cp::pprot_packno
int pprot_packno[JPWL_MAX_NO_PACKSPECS]
packet number of packet protection specification (>=0)
Definition: j2k.h:286
jpwl_epb_ms::n_pre
int n_pre
code word length of pre-data
Definition: jpwl.h:73
jpwl_marker::len_ready
opj_bool len_ready
the marker length is ready or not?
Definition: jpwl.h:199
J2K_STATE_MH
@ J2K_STATE_MH
the decoding process is in the main header
Definition: j2k.h:103
jpwl_epb_ms::Depb
unsigned char Depb
single byte for the style
Definition: jpwl.h:88
cio_read
unsigned int cio_read(opj_cio_t *cio, int n)
Read some bytes.
Definition: cio.c:183
jpwl_dump_marks
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
jpwl_esd_ms
ESD (Error Sensitivity Descriptor) Marker segment.
Definition: jpwl.h:128
opj_j2k::cinfo
opj_common_ptr cinfo
codec context
Definition: j2k.h:316
opj_cp::hprot_TPH_tileno
int hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of header protection specification (>=0)
Definition: j2k.h:280
EVT_WARNING
#define EVT_WARNING
Warning event type.
Definition: event.h:36
opj_tcd_precinct::x1
int x1
Definition: tcd.h:106
opj_realloc
#define opj_realloc(m, s)
Reallocate memory blocks.
Definition: opj_malloc.h:142
J2K_MS_RED
#define J2K_MS_RED
RED marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:85
jpwl_epb_fill
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
opj_cp::sens_TPH_tileno
int sens_TPH_tileno[JPWL_MAX_NO_TILESPECS]
tile number of sensitivity specification (>=0)
Definition: j2k.h:298
jpwl_check_tile
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
opj_tcd_precinct::cw
int cw
Definition: tcd.h:107
jpwl_esd_write
void jpwl_esd_write(opj_j2k_t *j2k, jpwl_esd_ms_t *esdmark, unsigned char *buf)
write an ESD MS to a buffer
Definition: jpwl_lib.c:1584
jpwl_marker::id
int id
marker value (J2K_MS_EPC, etc.)
Definition: jpwl.h:180
cio_write
unsigned int cio_write(opj_cio_t *cio, unsigned int64 v, int n)
Write some bytes.
Definition: cio.c:167
opj_cio::openmode
int openmode
open mode (read/write) either OPJ_STREAM_READ or OPJ_STREAM_WRITE
Definition: openjpeg.h:480
opj_tcd_precinct
FIXME: documentation.
Definition: tcd.h:105
jpwl_encode
void jpwl_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image)
Encode according to JPWL specs.
Definition: jpwl.c:114
j2k_write_epc
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
opj_includes.h
jpwl_epc_ms::Lepc
unsigned short int Lepc
two bytes for the length of EPC MS, exluding the marker itself (9 to 65535 bytes)
Definition: jpwl.h:113
opj_cio
Byte input-output stream (CIO)
Definition: openjpeg.h:475
opj_tp_info::tp_start_pos
int tp_start_pos
start position of tile part
Definition: openjpeg.h:618
opj_codestream_info::marker
opj_marker_info_t * marker
list of markers
Definition: openjpeg.h:707
jpwl_marker::jpwl_marks::esdmark
jpwl_esd_ms_t * esdmark
pointer to ESD marker
Definition: jpwl.h:188
jpwl_epc_ms::Pepc
unsigned char Pepc
one byte, signals JPWL techniques adoption
Definition: jpwl.h:119
jpwl_epbs_add
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_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
jpwl_esd_ms::Cesd
unsigned short int Cesd
two bytes, component of error sensitivity
Definition: jpwl.h:144
opj_tcd_band
FIXME: documentation.
Definition: tcd.h:119
opj_cp::correct
opj_bool correct
enables JPWL correction at the decoder
Definition: j2k.h:302
j2k_read_red
void j2k_read_red(opj_j2k_t *j2k)
Read the RED marker (Residual Error Descriptor)
Definition: jpwl.c:1200
J2K_STATE_TPH
@ J2K_STATE_TPH
the decoding process is in a tile part header
Definition: j2k.h:105
opj_tcd_precinct::cblks
union opj_tcd_precinct::@0 cblks
jpwl_esd_ms::sensval_size
size_t sensval_size
size of a single sensitivity pair (address+value)
Definition: jpwl.h:159
opj_cio::end
unsigned char * end
pointer to the end of the stream
Definition: openjpeg.h:489
opj_tcd_tilecomp::numresolutions
int numresolutions
Definition: tcd.h:142
jpwl_epc_ms::DL
unsigned long int DL
four bytes, the codestream length from SOC to EOC
Definition: jpwl.h:117
jpwl_epc_ms_t
struct jpwl_epc_ms jpwl_epc_ms_t
EPC (Error Protection Capability) Marker segment.
jpwl_epb_write
void jpwl_epb_write(opj_j2k_t *j2k, jpwl_epb_ms_t *epbmark, unsigned char *buf)
write an EPB MS to a buffer
Definition: jpwl_lib.c:298
cio_tell
int OPJ_CALLCONV cio_tell(opj_cio_t *cio)
Get position in byte stream.
Definition: cio.c:100
opj_tile_info::num_tps
int num_tps
number of tile parts
Definition: openjpeg.h:664
jpwl_epc_write
void jpwl_epc_write(opj_j2k_t *j2k, jpwl_epc_ms_t *epcmark, unsigned char *buf)
write an EPC MS to a buffer
Definition: jpwl_lib.c:1163
opj_cp::pprot
int pprot[JPWL_MAX_NO_PACKSPECS]
error protection methods for packets (0,1,16,32,37-128)
Definition: j2k.h:288
jpwl_marker::data_ready
opj_bool data_ready
are the written data ready or not
Definition: jpwl.h:205
jpwl_epc_ms::info_on
opj_bool info_on
are informative techniques active?
Definition: jpwl.h:109
j2k_read_insec
void j2k_read_insec(opj_j2k_t *j2k)
Read the INSEC marker (SEcured Codestream)
Definition: jpwl.c:1341
opj_codestream_info::packno
int packno
packet number
Definition: openjpeg.h:676
jpwl_epb_ms::k_pre
int k_pre
message word length of pre-data
Definition: jpwl.h:71
opj_tcd_band::precincts
opj_tcd_precinct_t * precincts
Definition: tcd.h:122
jpwl_marker_t
struct jpwl_marker jpwl_marker_t
Structure used to store JPWL markers temporary position and readyness.
OPJ_TRUE
#define OPJ_TRUE
Definition: openjpeg.h:64
j2k_write_sec
void j2k_write_sec(opj_j2k_t *j2k)
Write the SEC marker (SEcured Codestream)
Definition: jpwl.c:1327
jpwl_epb_ms::index
unsigned char index
index in current header (0-63)
Definition: jpwl.h:67
jpwl_esds_add
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
jpwl_marker::jpwl_marks::redmark
jpwl_red_ms_t * redmark
pointer to RED marker
Definition: jpwl.h:190
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
cio_skip
void cio_skip(opj_cio_t *cio, int n)
Skip some bytes.
Definition: cio.c:198
jpwl_marker::jpwl_marks
union keeping the pointer to the real marker struct
Definition: jpwl.h:182
jpwl_check_tile
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
jpwl_esd_ms_t
struct jpwl_esd_ms jpwl_esd_ms_t
ESD (Error Sensitivity Descriptor) Marker segment.
jpwl_marker::jpwl_marks::epbmark
jpwl_epb_ms_t * epbmark
pointer to EPB marker
Definition: jpwl.h:184
opj_cio::bp
unsigned char * bp
pointer to the current position
Definition: openjpeg.h:491
jpwl_marker::len
unsigned short int len
length of the marker segment (marker excluded)
Definition: jpwl.h:197
jpwl_marker::pos_ready
opj_bool pos_ready
the marker position is ready or not?
Definition: jpwl.h:201
JPWL_ASSUME
#define JPWL_ASSUME
Assume a basic codestream structure, so you can resort better from uncorrected errors.
Definition: jpwl.h:52
jpwl_epb_ms
EPB (Error Protection Block) Marker segment.
Definition: jpwl.h:57
opj_codestream_info::main_head_end
int main_head_end
main header position
Definition: openjpeg.h:714
opj_cio::start
unsigned char * start
pointer to the start of the stream
Definition: openjpeg.h:487
opj_tcd_precinct::x0
int x0
Definition: tcd.h:106
j2k_read_sec
void j2k_read_sec(opj_j2k_t *j2k)
Read the SEC marker (SEcured Codestream)
Definition: jpwl.c:1310
EVT_INFO
#define EVT_INFO
Debug event type.
Definition: event.h:37
opj_bool
int opj_bool
Definition: openjpeg.h:63
jpwl_esd_ms::numcomps
int numcomps
number of components in the image
Definition: jpwl.h:153
opj_tcd_tile::numcomps
int numcomps
Definition: tcd.h:153
opj_tcd::tcd_image
opj_tcd_image_t * tcd_image
info on each image tile
Definition: tcd.h:188
j2k_read_red
void j2k_read_red(opj_j2k_t *j2k)
Read the RED marker (Residual Error Descriptor)
Definition: jpwl.c:1200
jpwl_markcomp
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
opj_cio::cinfo
opj_common_ptr cinfo
codec context
Definition: openjpeg.h:477
jpwl_epc_ms::esd_on
opj_bool esd_on
is ESD active?
Definition: jpwl.h:103
opj_cp::sens_size
int sens_size
enables writing of ESD, (0/2/4 bytes)
Definition: j2k.h:290
j2k_read_esd
void j2k_read_esd(opj_j2k_t *j2k)
Read the ESD marker (Error Sensitivity Descriptor)
Definition: jpwl.c:1170
opj_marker_info_t::pos
int pos
position in codestream
Definition: openjpeg.h:607
jpwl_marker::m
union jpwl_marker::jpwl_marks m
opj_tcd_tile
FIXME: documentation.
Definition: tcd.h:151
opj_cp::hprot_TPH
int hprot_TPH[JPWL_MAX_NO_TILESPECS]
error protection methods for TPHs (0,1,16,32,37-128)
Definition: j2k.h:282
jpwl_epb_create
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
j2k_read_epc
void j2k_read_epc(opj_j2k_t *j2k)
Read the EPC marker (Error Protection Capability)
Definition: jpwl.c:907
cio_seek
void OPJ_CALLCONV cio_seek(opj_cio_t *cio, int pos)
Set position in byte stream.
Definition: cio.c:109
jpwl_esd_ms::ad_size
unsigned char ad_size
size of codestream addresses [2/4 bytes]
Definition: jpwl.h:132
jpwl_red_ms
RED (Residual Error Descriptor) Marker segment.
Definition: jpwl.h:166
opj_codestream_info::tile
opj_tile_info_t * tile
information regarding tiles inside image
Definition: openjpeg.h:718
jpwl_red_ms::Pred
unsigned char Pred
one byte, signals JPWL techniques adoption
Definition: jpwl.h:170
JPWL_MAX_NO_PACKSPECS
#define JPWL_MAX_NO_PACKSPECS
Maximum number of packet parts expected by JPWL: increase at your will.
Definition: openjpeg.h:82
rs.h
Functions used to compute Reed-Solomon parity and check of byte arrays.
JPWL_MAX_NO_TILESPECS
#define JPWL_MAX_NO_TILESPECS
Maximum number of tile parts expected by JPWL: increase at your will.
Definition: openjpeg.h:81
opj_codestream_info
Index structure of the codestream.
Definition: openjpeg.h:672
jpwl_epc_create
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
EVT_ERROR
#define EVT_ERROR
Error event type.
Definition: event.h:35
j2k_add_marker
void j2k_add_marker(opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len)
Definition: jpwl.c:164
jpwl_esd_ms::addrm
unsigned char addrm
codestream addressing mode [0=packet, 1=byte range, 2=packet range, 3=reserved]
Definition: jpwl.h:130
jpwl_esd_ms::senst
unsigned char senst
type of sensitivity [0=relative error, 1=MSE, 2=MSE reduction, 3=PSNR, 4=PSNR increment,...
Definition: jpwl.h:136
opj_tile_info::tp
opj_tp_info_t * tp
information concerning tile parts
Definition: openjpeg.h:666
jpwl_encode
void jpwl_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image)
Encode according to JPWL specs.
Definition: jpwl.c:114
jpwl_epb_ms::k_post
int k_post
message word length of post-data
Definition: jpwl.h:77
jpwl_epb_ms::packed
opj_bool packed
is it in packed mode?
Definition: jpwl.h:63
jpwl_epb_ms::tileno
int tileno
TH where this marker has been placed (-1 means MH)
Definition: jpwl.h:65
cio_getbp
unsigned char * cio_getbp(opj_cio_t *cio)
Get pointer to the current position in the stream.
Definition: cio.c:129
jpwl_marker::dpos
double dpos
same as before, only written as a double, so we can sort it better
Definition: jpwl.h:195
OPJ_FALSE
#define OPJ_FALSE
Definition: openjpeg.h:65
opj_cp::red_on
opj_bool red_on
enables writing of RED, in case of activated JPWL
Definition: j2k.h:276
jpwl_red_ms_t
struct jpwl_red_ms jpwl_red_ms_t
RED (Residual Error Descriptor) Marker segment.
jpwl_epb_ms::latest
opj_bool latest
is the latest in header?
Definition: jpwl.h:61
opj_j2k::cp
opj_cp_t * cp
pointer to the coding parameters
Definition: j2k.h:364
opj_j2k::cstr_info
opj_codestream_info_t * cstr_info
helper used to write the index file
Definition: j2k.h:366
j2k_read_epc
void j2k_read_epc(opj_j2k_t *j2k)
Read the EPC marker (Error Protection Capability)
Definition: jpwl.c:907
jpwl_correct
opj_bool jpwl_correct(opj_j2k_t *j2k)
corrects the data in the JPWL codestream
Definition: jpwl_lib.c:546
opj_j2k::state
int state
locate in which part of the codestream the decoder is (main header, tile header, end)
Definition: j2k.h:319
jpwl_epb_ms::n_post
int n_post
code word length of post-data
Definition: jpwl.h:79
opj_cp::epb_on
opj_bool epb_on
enables writing of EPB, in case of activated JPWL
Definition: j2k.h:270
jpwl_marker::pos
unsigned long int pos
position where the marker should go, in the pre-JPWL codestream
Definition: jpwl.h:193
j2k_read_sec
void j2k_read_sec(opj_j2k_t *j2k)
Read the SEC marker (SEcured Codestream)
Definition: jpwl.c:1310
opj_codestream_info::th
int th
number of tiles in Y
Definition: openjpeg.h:696
opj_image
Defines image data and characteristics.
Definition: openjpeg.h:533
jpwl_dump_marks
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
opj_tcd_precinct::ch
int ch
Definition: tcd.h:107
opj_tcd_tile::comps
opj_tcd_tilecomp_t * comps
Definition: tcd.h:154
opj_tp_info::tp_numpacks
int tp_numpacks
number of packets of tile part
Definition: openjpeg.h:626
j2k_write_epb
void j2k_write_epb(opj_j2k_t *j2k)
Write the EPB marker (Error Protection Block)
Definition: jpwl.c:1134
jpwl_esd_fill
opj_bool jpwl_esd_fill(opj_j2k_t *j2k, jpwl_esd_ms_t *esdmark, unsigned char *buf)
Definition: jpwl_lib.c:1336
opj_cp::sens_addr
int sens_addr
sensitivity addressing size (0=auto/2/4 bytes)
Definition: j2k.h:292
jpwl_marker::jpwl_marks::epcmark
jpwl_epc_ms_t * epcmark
pointer to EPC marker
Definition: jpwl.h:186
opj_image::numcomps
int numcomps
number of components in the image
Definition: openjpeg.h:543
opj_codestream_info::marknum
int marknum
number of markers
Definition: openjpeg.h:705
j2k_read_insec
void j2k_read_insec(opj_j2k_t *j2k)
Read the INSEC marker (SEcured Codestream)
Definition: jpwl.c:1341
JPWL_MAX_NO_MARKERS
#define JPWL_MAX_NO_MARKERS
Maximum number of JPWL markers: increase at your will.
Definition: openjpeg.h:83
opj_tcd
Tile coder/decoder.
Definition: tcd.h:173
opj_cio::buffer
unsigned char * buffer
pointer to the start of the buffer
Definition: openjpeg.h:482
J2K_MS_EPB
#define J2K_MS_EPB
EPB marker value (Part 11: JPEG 2000 for Wireless)
Definition: j2k.h:83
opj_cp::sens_range
int sens_range
sensitivity range (0-3)
Definition: j2k.h:294
opj_tcd_resolution::ph
int ph
Definition: tcd.h:132
opj_tp_info::tp_start_pack
int tp_start_pack
start packet of tile part
Definition: openjpeg.h:624
opj_codestream_info::codestream_size
int codestream_size
codestream's size
Definition: openjpeg.h:716