OpenJPEG 1.5.1
|
#include "opj_includes.h"
Functions | |
Local static functions | |
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 | |
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 | |
int | jpwl_markcomp (const void *arg1, const void *arg2) |
this function is used to compare two JPWL markers based on their relevant wishlist position | |
void | jpwl_epb_write (opj_j2k_t *j2k, jpwl_epb_ms_t *epbmark, unsigned char *buf) |
write an EPB MS to a buffer | |
void | jpwl_epc_write (opj_j2k_t *j2k, jpwl_epc_ms_t *epcmark, unsigned char *buf) |
write an EPC MS to a buffer | |
void | jpwl_esd_write (opj_j2k_t *j2k, jpwl_esd_ms_t *esdmark, unsigned char *buf) |
write an ESD MS to a buffer | |
void | jpwl_encode (opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image) |
Encode according to JPWL specs. | |
void | j2k_add_marker (opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len) |
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 full) | |
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. | |
void | j2k_read_epc (opj_j2k_t *j2k) |
Read the EPC marker (Error Protection Capability) | |
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 simplifies the management of EPBs and it is openly stated in the standard as a possible value, mening that the information is not available) and the informative techniques are not yet implemented. | |
void | j2k_read_epb (opj_j2k_t *j2k) |
Read the EPB marker (Error Protection Block) | |
void | j2k_write_epb (opj_j2k_t *j2k) |
Write the EPB marker (Error Protection Block) | |
void | j2k_read_esd (opj_j2k_t *j2k) |
Read the ESD marker (Error Sensitivity Descriptor) | |
void | j2k_read_red (opj_j2k_t *j2k) |
Read the RED marker (Residual Error Descriptor) | |
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 | |
void | j2k_read_sec (opj_j2k_t *j2k) |
Read the SEC marker (SEcured Codestream) | |
void | j2k_write_sec (opj_j2k_t *j2k) |
Write the SEC marker (SEcured Codestream) | |
void | j2k_read_insec (opj_j2k_t *j2k) |
Read the INSEC marker (SEcured Codestream) | |
Variables | |
Local static variables | |
static int | jwmarker_num |
number of JPWL prepared markers | |
static jpwl_marker_t | jwmarker [JPWL_MAX_NO_MARKERS] |
properties of JPWL markers to insert | |
void j2k_add_marker | ( | opj_codestream_info_t * | cstr_info, |
unsigned short int | type, | ||
int | pos, | ||
int | len ) |
References opj_marker_info_t::len, opj_codestream_info::marker, opj_codestream_info::marknum, opj_codestream_info::maxmarknum, opj_realloc, opj_marker_info_t::pos, and opj_marker_info_t::type.
Referenced by j2k_write_eoc(), j2k_write_epb(), j2k_write_epc(), j2k_write_soc(), j2k_write_sod(), j2k_write_sot(), jpwl_epb_write(), jpwl_epc_write(), and jpwl_esd_write().
void j2k_read_epb | ( | opj_j2k_t * | j2k | ) |
Read the EPB marker (Error Protection Block)
j2k | J2K handle |
References opj_cio::bp, opj_j2k::cinfo, opj_j2k::cio, cio_read(), cio_seek(), cio_skip(), cio_tell(), opj_cp::correct, opj_j2k::cp, EVT_ERROR, EVT_INFO, opj_cp::exp_comps, J2K_STATE_MH, J2K_STATE_TPH, jpwl_epb_correct(), opj_event_msg(), OPJ_FALSE, OPJ_TRUE, and opj_j2k::state.
void j2k_read_epc | ( | opj_j2k_t * | j2k | ) |
Read the EPC marker (Error Protection Capability)
j2k | J2K handle |
References opj_j2k::cinfo, opj_j2k::cio, cio_read(), cio_seek(), cio_skip(), cio_tell(), EVT_INFO, jpwl_updateCRC16, and opj_event_msg().
void j2k_read_esd | ( | opj_j2k_t * | j2k | ) |
Read the ESD marker (Error Sensitivity Descriptor)
j2k | J2K handle |
References opj_j2k::cinfo, opj_j2k::cio, cio_read(), cio_skip(), cio_tell(), EVT_INFO, opj_j2k::image, opj_image::numcomps, and opj_event_msg().
void j2k_read_insec | ( | opj_j2k_t * | j2k | ) |
Read the INSEC marker (SEcured Codestream)
j2k | J2K handle |
References opj_j2k::cinfo, opj_j2k::cio, cio_read(), cio_skip(), cio_tell(), EVT_INFO, and opj_event_msg().
void j2k_read_red | ( | opj_j2k_t * | j2k | ) |
Read the RED marker (Residual Error Descriptor)
j2k | J2K handle |
References opj_j2k::cinfo, opj_j2k::cio, cio_read(), cio_skip(), cio_tell(), EVT_INFO, and opj_event_msg().
void j2k_read_sec | ( | opj_j2k_t * | j2k | ) |
Read the SEC marker (SEcured Codestream)
j2k | J2K handle |
References opj_j2k::cinfo, opj_j2k::cio, cio_read(), cio_skip(), cio_tell(), EVT_INFO, and opj_event_msg().
void j2k_write_epb | ( | opj_j2k_t * | j2k | ) |
Write the EPB marker (Error Protection Block)
j2k | J2K handle |
References opj_j2k::cio, cio_seek(), cio_skip(), cio_tell(), cio_write(), opj_j2k::cstr_info, j2k_add_marker(), and J2K_MS_EPB.
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 simplifies the management of EPBs and it is openly stated in the standard as a possible value, mening that the information is not available) and the informative techniques are not yet implemented.
j2k | J2K handle |
References opj_j2k::cio, cio_read(), cio_seek(), cio_skip(), cio_tell(), cio_write(), opj_j2k::cstr_info, j2k_add_marker(), J2K_MS_EPC, and jpwl_updateCRC16.
void j2k_write_sec | ( | opj_j2k_t * | j2k | ) |
Write the SEC marker (SEcured Codestream)
j2k | J2K handle |
References opj_j2k::cio, cio_write(), and J2K_MS_SEC.
check that a tile and its children have valid data
j2k | J2K decompressor handle |
tcd | Tile decompressor handle |
tileno | number of the tile to check |
References opj_tcd_resolution::bands, opj_tcd_precinct::cblks, opj_tcd_precinct::ch, opj_j2k::cinfo, opj_tcd_tile::comps, opj_tcd_precinct::cw, EVT_ERROR, EVT_WARNING, JPWL_ASSUME, opj_tcd_resolution::numbands, opj_tcd_tile::numcomps, opj_tcd_tilecomp::numresolutions, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, opj_tcd_resolution::ph, opj_tcd_band::precincts, opj_tcd_resolution::pw, opj_tcd_tilecomp::resolutions, opj_tcd::tcd_image, opj_tcd_image::tiles, opj_tcd_precinct::x0, and opj_tcd_precinct::x1.
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.
j2k | J2K handle |
cio | codestream handle |
image | image handle |
References opj_cio::bp, opj_cio::buffer, opj_cio::cinfo, opj_j2k::cinfo, cio_getbp(), cio_seek(), opj_codestream_info::codestream_size, opj_j2k::cp, opj_j2k::cstr_info, jpwl_epc_ms::DL, jpwl_marker::dpos, opj_cio::end, opj_cp::epb_on, jpwl_marker::jpwl_marks::epcmark, opj_cp::esd_on, EVT_ERROR, EVT_INFO, jpwl_marker::id, J2K_MS_EPB, J2K_MS_EPC, J2K_MS_ESD, J2K_MS_RED, jpwl_epb_fill(), jpwl_epb_write(), jpwl_epc_write(), jpwl_esd_fill(), jpwl_esd_write(), jpwl_markcomp(), jpwl_update_info(), jpwl_updateCRC16, jwmarker, jwmarker_num, jpwl_marker::len, opj_cio::length, jpwl_marker::m, opj_codestream_info::main_head_start, opj_codestream_info::marker, opj_codestream_info::marknum, opj_cio::openmode, opj_clock(), opj_event_msg(), opj_free, opj_malloc, jpwl_epc_ms::Pcrc, jpwl_marker::pos, opj_marker_info_t::pos, and opj_cio::start.
Referenced by jpwl_encode().
void jpwl_encode | ( | opj_j2k_t * | j2k, |
opj_cio_t * | cio, | ||
opj_image_t * | image ) |
Encode according to JPWL specs.
j2k | J2K handle |
cio | codestream handle |
image | image handle |
References J2K_MS_EPB, J2K_MS_EPC, J2K_MS_ESD, J2K_MS_RED, jpwl_dump_marks(), JPWL_MAX_NO_MARKERS, jpwl_prepare_marks(), jwmarker, jwmarker_num, opj_free, and opj_j2k::pos_correction.
Referenced by j2k_encode().
void jpwl_epb_write | ( | opj_j2k_t * | j2k, |
jpwl_epb_ms_t * | epbmark, | ||
unsigned char * | buf ) |
write an EPB MS to a buffer
j2k | J2K compressor handle |
epbmark | pointer to the EPB MS |
buf | pointer to the memory buffer |
References opj_j2k::cstr_info, jpwl_epb_ms::Depb, j2k_add_marker(), J2K_MS_EPB, jpwl_epb_ms::LDPepb, jpwl_epb_ms::Lepb, and jpwl_epb_ms::Pepb.
Referenced by jpwl_dump_marks().
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
j2k | J2K compressor handle |
esd_on | true if ESD is activated |
red_on | true if RED is activated |
epb_on | true if EPB is activated |
info_on | true if informative techniques are activated |
References opj_j2k::cinfo, opj_j2k::cp, jpwl_epc_ms::DL, jpwl_epc_ms::epb_on, opj_cp::epb_on, jpwl_epc_ms::esd_on, opj_cp::esd_on, EVT_ERROR, jpwl_epc_ms::info_on, opj_cp::info_on, jpwl_epc_ms::Lepc, opj_event_msg(), opj_malloc, jpwl_epc_ms::Pcrc, jpwl_epc_ms::Pepc, jpwl_epc_ms::red_on, and opj_cp::red_on.
Referenced by jpwl_prepare_marks().
void jpwl_epc_write | ( | opj_j2k_t * | j2k, |
jpwl_epc_ms_t * | epcmark, | ||
unsigned char * | buf ) |
write an EPC MS to a buffer
j2k | J2K compressor handle |
epcmark | pointer to the EPC MS |
buf | pointer to the memory buffer |
References opj_j2k::cstr_info, jpwl_epc_ms::DL, j2k_add_marker(), J2K_MS_EPC, jpwl_epc_ms::Lepc, jpwl_epc_ms::Pcrc, and jpwl_epc_ms::Pepc.
Referenced by jpwl_dump_marks().
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
j2k | J2K compressor handle |
comps | considered component (-1=average, 0/1/2/...=component no.) |
addrm | addressing mode (0=packet, 1=byte range, 2=packet range, 3=reserved) |
ad_size | size of addresses (2/4 bytes) |
senst | sensitivity type |
se_size | sensitivity values size (1/2 bytes) |
tileno | tile where this ESD lies (-1 means MH) |
svalnum | number of sensitivity values (if 0, they will be automatically filled) |
sensval | pointer to an array of sensitivity values (if NULL, they will be automatically filled) |
References jpwl_esd_ms::ad_size, jpwl_esd_ms::addrm, jpwl_esd_ms::Cesd, opj_j2k::cinfo, opj_codestream_info::codestream_size, opj_j2k::cstr_info, jpwl_esd_ms::data, EVT_ERROR, opj_j2k::image, jpwl_esd_ms::Lesd, jpwl_esd_ms::numcomps, opj_image::numcomps, opj_event_msg(), opj_malloc, opj_codestream_info::packno, jpwl_esd_ms::Pesd, jpwl_esd_ms::se_size, jpwl_esd_ms::senst, jpwl_esd_ms::sensval_size, jpwl_esd_ms::svalnum, opj_codestream_info::th, jpwl_esd_ms::tileno, and opj_codestream_info::tw.
Referenced by jpwl_prepare_marks().
void jpwl_esd_write | ( | opj_j2k_t * | j2k, |
jpwl_esd_ms_t * | esdmark, | ||
unsigned char * | buf ) |
write an ESD MS to a buffer
j2k | J2K compressor handle |
esdmark | pointer to the ESD MS |
buf | pointer to the memory buffer |
References jpwl_esd_ms::Cesd, opj_j2k::cstr_info, j2k_add_marker(), J2K_MS_ESD, jpwl_esd_ms::Lesd, jpwl_esd_ms::numcomps, and jpwl_esd_ms::Pesd.
Referenced by jpwl_dump_marks().
int jpwl_markcomp | ( | const void * | arg1, |
const void * | arg2 ) |
this function is used to compare two JPWL markers based on their relevant wishlist position
arg1 | pointer to first marker |
arg2 | pointer to second marker |
Referenced by jpwl_dump_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 full)
j2k | J2K handle |
cio | codestream handle |
image | image handle |
References opj_j2k::cinfo, cio_getbp(), cio_read(), cio_seek(), cio_skip(), cio_tell(), cio_write(), opj_j2k::cp, opj_j2k::cstr_info, jpwl_marker::data_ready, jpwl_epb_ms::Depb, jpwl_marker::dpos, opj_packet_info::end_pos, opj_cp::epb_on, jpwl_marker::jpwl_marks::epbmark, jpwl_marker::jpwl_marks::epcmark, opj_cp::esd_on, jpwl_marker::jpwl_marks::esdmark, EVT_ERROR, EVT_INFO, opj_cp::hprot_MH, opj_cp::hprot_TPH, opj_cp::hprot_TPH_tileno, jpwl_marker::id, J2K_MS_EPB, J2K_MS_EPC, J2K_MS_ESD, jpwl_epb_create(), jpwl_epbs_add(), jpwl_epc_create(), jpwl_esd_create(), JPWL_MAX_NO_MARKERS, JPWL_MAX_NO_PACKSPECS, JPWL_MAX_NO_TILESPECS, jwmarker, jwmarker_num, jpwl_marker::len, jpwl_marker::len_ready, jpwl_epb_ms::Lepb, jpwl_epc_ms::Lepc, jpwl_esd_ms::Lesd, jpwl_marker::m, opj_codestream_info::main_head_end, opj_codestream_info::main_head_start, opj_tile_info::num_tps, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, opj_tile_info::packet, opj_codestream_info::packno, jpwl_marker::parms_ready, jpwl_marker::pos, jpwl_marker::pos_ready, opj_cp::pprot, opj_cp::pprot_packno, opj_cp::pprot_tileno, opj_cp::red_on, opj_cp::sens_addr, opj_cp::sens_MH, opj_cp::sens_range, opj_cp::sens_size, opj_cp::sens_TPH, opj_cp::sens_TPH_tileno, opj_packet_info::start_pos, opj_codestream_info::th, opj_codestream_info::tile, opj_tile_info::tp, opj_tp_info::tp_end_header, opj_tp_info::tp_numpacks, opj_tp_info::tp_start_pack, opj_tp_info::tp_start_pos, and opj_codestream_info::tw.
Referenced by jpwl_encode().
|
static |
properties of JPWL markers to insert
Referenced by jpwl_dump_marks(), jpwl_encode(), jpwl_epbs_add(), jpwl_prepare_marks(), and jpwl_update_info().
|
static |
number of JPWL prepared markers
Referenced by jpwl_dump_marks(), jpwl_encode(), jpwl_epbs_add(), jpwl_prepare_marks(), and jpwl_update_info().