OpenJPEG 1.5.1
|
Macros | |
#define | MIN_V1 0.0 |
Minimum and maximum values for the double->pfp conversion. | |
#define | MAX_V1 17293822569102704640.0 |
#define | MIN_V2 0.000030517578125 |
#define | MAX_V2 131040.0 |
Functions | |
unsigned short int | jpwl_double_to_pfp (double V, int bytes) |
conversion between a double precision floating point number and the corresponding pseudo-floating point used to represent sensitivity values | |
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 double precision floating point number | |
int | jpwl_markcomp (const void *arg1, const void *arg2) |
this function is used to compare two JPWL markers based on their relevant wishlist position | |
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 | |
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 | |
void | jpwl_epb_write (opj_j2k_t *j2k, jpwl_epb_ms_t *epb, unsigned char *buf) |
write an EPB MS to a buffer | |
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 | |
opj_bool | jpwl_epb_fill (opj_j2k_t *j2k, jpwl_epb_ms_t *epb, unsigned char *buf, unsigned char *post_buf) |
opj_bool | jpwl_correct (opj_j2k_t *j2k) |
corrects the data in the JPWL codestream | |
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 | |
void | jpwl_epc_write (opj_j2k_t *j2k, jpwl_epc_ms_t *epc, unsigned char *buf) |
write an EPC MS to a buffer | |
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 | |
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 | |
opj_bool | jpwl_esd_fill (opj_j2k_t *j2k, jpwl_esd_ms_t *esd, unsigned char *buf) |
void | jpwl_esd_write (opj_j2k_t *j2k, jpwl_esd_ms_t *esd, unsigned char *buf) |
write an ESD MS to a buffer | |
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 | |
#define MAX_V1 17293822569102704640.0 |
#define MAX_V2 131040.0 |
#define MIN_V1 0.0 |
Minimum and maximum values for the double->pfp conversion.
#define MIN_V2 0.000030517578125 |
corrects the data in the JPWL codestream
j2k | J2K compressor 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, opj_cio::end, EVT_WARNING, opj_cp::exp_comps, J2K_MS_EOC, J2K_MS_EPB, J2K_MS_SIZ, J2K_MS_SOC, J2K_MS_SOD, J2K_MS_SOT, J2K_STATE_MH, J2K_STATE_MHSIZ, J2K_STATE_MHSOC, J2K_STATE_MT, J2K_STATE_TPH, jpwl_epb_correct(), opj_cio::length, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, and opj_j2k::state.
Referenced by j2k_decode().
unsigned short int jpwl_double_to_pfp | ( | double | V, |
int | bytes | ||
) |
conversion between a double precision floating point number and the corresponding pseudo-floating point used to represent sensitivity values
V | the double precision value |
bytes | the number of bytes of the representation |
References MAX_V1, MAX_V2, MIN_V1, and MIN_V2.
Referenced by jpwl_esd_fill().
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
j2k | J2K compressor handle |
buffer | pointer to the EPB position |
type | type of EPB: 0=MH, 1=TPH, 2=other, 3=auto |
pre_len | length of pre-data |
post_len | length of post_data |
conn | is a pointer to the length of all connected (packed) EPBs |
L4_bufp | is a pointer to the buffer pointer of redundancy data |
References opj_cio::bp, opj_j2k::cinfo, opj_j2k::cio, cio_numbytesleft(), cio_read(), cio_seek(), cio_skip(), cio_tell(), eras_dec_rs(), EVT_ERROR, EVT_INFO, EVT_WARNING, init_rs(), jpwl_epb_correct(), jpwl_updateCRC16, jpwl_updateCRC32, NN, opj_event_msg(), OPJ_FALSE, and OPJ_TRUE.
Referenced by j2k_read_epb(), jpwl_correct(), and jpwl_epb_correct().
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
j2k | J2K compressor handle |
latest | it is the latest EPB in the header |
packed | EPB is in packed style |
tileno | tile number where the marker has been placed (-1 means MH) |
idx | current EPB running index |
hprot | applied protection type (-1/0,1,16,32,37-128) |
pre_len | length of pre-protected data |
post_len | length of post-protected data |
References opj_j2k::cinfo, jpwl_epb_ms::Depb, EVT_ERROR, jpwl_epb_ms::hprot, jpwl_epb_ms::k_post, jpwl_epb_ms::k_pre, jpwl_epb_ms::LDPepb, jpwl_epb_ms::Lepb, jpwl_epb_ms::n_post, jpwl_epb_ms::n_pre, opj_event_msg(), opj_malloc, jpwl_epb_ms::Pepb, jpwl_epb_ms::post_len, jpwl_epb_ms::pre_len, and jpwl_epb_ms::tileno.
Referenced by jpwl_epbs_add(), and jpwl_prepare_marks().
opj_bool jpwl_epb_fill | ( | opj_j2k_t * | j2k, |
jpwl_epb_ms_t * | epb, | ||
unsigned char * | buf, | ||
unsigned char * | post_buf | ||
) |
References opj_j2k::cinfo, encode_rs(), EVT_ERROR, EVT_WARNING, jpwl_epb_ms::hprot, init_rs(), jpwl_updateCRC16, jpwl_updateCRC32, jpwl_epb_ms::k_post, jpwl_epb_ms::k_pre, jpwl_epb_ms::Lepb, jpwl_epb_ms::n_post, jpwl_epb_ms::n_pre, NN, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, jpwl_epb_ms::post_len, and jpwl_epb_ms::pre_len.
Referenced by jpwl_dump_marks().
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().
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
j2k | J2K compressor handle |
jwmarker | pointer to the JPWL markers list |
jwmarker_num | pointer to the number of JPWL markers (gets updated) |
latest | it is the latest group of EPBs in the header |
packed | EPBs are in packed style |
insideMH | it is in the MH |
idx | pointer to the starting EPB running index (gets updated) |
hprot | applied protection type (-1/0,1,16,32,37-128) |
place_pos | place in original codestream where EPBs should go |
tileno | tile number of these EPBs |
pre_len | length of pre-protected data |
post_len | length of post-protected data |
References opj_j2k::cinfo, jpwl_marker::data_ready, jpwl_marker::dpos, jpwl_marker::jpwl_marks::epbmark, EVT_ERROR, jpwl_marker::id, J2K_MS_EPB, jpwl_epb_create(), JPWL_MAX_NO_MARKERS, JPWL_MAXIMUM_EPB_ROOM, jwmarker, jwmarker_num, jpwl_marker::len, jpwl_marker::len_ready, jpwl_epb_ms::Lepb, jpwl_marker::m, min, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, jpwl_marker::parms_ready, jpwl_marker::pos, and jpwl_marker::pos_ready.
Referenced by jpwl_prepare_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, opj_cp::epb_on, jpwl_epc_ms::epb_on, opj_cp::esd_on, jpwl_epc_ms::esd_on, EVT_ERROR, opj_cp::info_on, jpwl_epc_ms::info_on, jpwl_epc_ms::Lepc, opj_event_msg(), opj_malloc, jpwl_epc_ms::Pcrc, jpwl_epc_ms::Pepc, opj_cp::red_on, and jpwl_epc_ms::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().
opj_bool jpwl_esd_fill | ( | opj_j2k_t * | j2k, |
jpwl_esd_ms_t * | esd, | ||
unsigned char * | buf | ||
) |
References jpwl_esd_ms::ad_size, jpwl_esd_ms::addrm, opj_image_comp::bpp, opj_j2k::cinfo, opj_image::comps, opj_j2k::cstr_info, jpwl_esd_ms::data, opj_packet_info::disto, opj_tile_info::distotile, opj_tile_info::end_header, opj_packet_info::end_pos, EVT_WARNING, opj_j2k::image, jpwl_double_to_pfp(), jpwl_pfp_to_double(), opj_codestream_info::main_head_end, MAX_V1, jpwl_esd_ms::numcomps, opj_image::numcomps, opj_tile_info::numpix, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, opj_tile_info::packet, opj_codestream_info::packno, jpwl_esd_ms::se_size, jpwl_esd_ms::senst, opj_image_comp::sgnd, opj_packet_info::start_pos, opj_tile_info::start_pos, jpwl_esd_ms::svalnum, opj_codestream_info::th, opj_codestream_info::tile, jpwl_esd_ms::tileno, and opj_codestream_info::tw.
Referenced by jpwl_dump_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_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
j2k | J2K compressor handle |
jwmarker | pointer to the JPWL markers list |
jwmarker_num | pointer to the number of JPWL markers (gets updated) |
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) |
place_pos | place in original codestream where EPBs should go |
tileno | tile number of these EPBs |
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().
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 double precision floating point number
em | the pseudo-floating point value (cast accordingly) |
bytes | the number of bytes of the representation |
Referenced by jpwl_esd_fill().
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
j2k | J2K compressor handle |
jwmarker | pointer to JPWL markers list |
jwmarker_num | number of JPWL markers |
References opj_j2k::cinfo, opj_codestream_info::codestream_size, opj_j2k::cstr_info, opj_tile_info::end_header, opj_packet_info::end_ph_pos, opj_packet_info::end_pos, opj_tile_info::end_pos, EVT_ERROR, jwmarker, jwmarker_num, jpwl_marker::len, opj_codestream_info::main_head_end, opj_tile_info::num_tps, opj_event_msg(), OPJ_FALSE, OPJ_TRUE, opj_tile_info::packet, opj_codestream_info::packno, opj_packet_info::start_pos, opj_tile_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_end_pos, opj_tp_info::tp_start_pos, and opj_codestream_info::tw.
Referenced by jpwl_dump_marks().