jpwl_lib.c File Reference

#include "opj_includes.h"
#include <limits.h>

Defines

#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_tjpwl_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_tjpwl_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_tjpwl_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 Documentation

#define MAX_V1   17293822569102704640.0

#define MAX_V2   131040.0

Referenced by jpwl_double_to_pfp().

#define MIN_V1   0.0

Minimum and maximum values for the double->pfp conversion.

Referenced by jpwl_double_to_pfp().

#define MIN_V2   0.000030517578125

Referenced by jpwl_double_to_pfp().


Function Documentation

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

Parameters:
V the double precision value
bytes the number of bytes of the representation
Returns:
the pseudo-floating point value (cast accordingly)

References MAX_V1, MAX_V2, MIN_V1, and MIN_V2.

Referenced by jpwl_esd_fill().

void jpwl_epb_write ( opj_j2k_t j2k,
jpwl_epb_ms_t epbmark,
unsigned char *  buf 
)

write an EPB MS to a buffer

Parameters:
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

Parameters:
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
Returns:
returns the freshly created EPC

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

Parameters:
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

Parameters:
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)
Returns:
returns the freshly created ESD

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, opj_image::numcomps, jpwl_esd_ms::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

Parameters:
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

Parameters:
arg1 pointer to first marker
arg2 pointer to second marker
Returns:
1 if arg1>arg2, 0 if arg1=arg2, -1 if arg1<arg2

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

Parameters:
em the pseudo-floating point value (cast accordingly)
bytes the number of bytes of the representation
Returns:
the double precision value

Referenced by jpwl_esd_fill().


Generated on Mon Dec 19 12:34:13 2016 for OpenJPEG by  doxygen 1.5.6