OpenJPEG  1.5.1
Data Structures | Typedefs
T2 - Implementation of a tier-2 coding

Data Structures

struct  opj_t2
 Tier-2 coding. More...
 

Typedefs

typedef struct opj_t2 opj_t2_t
 Tier-2 coding. More...
 

Local static functions

static void t2_putcommacode (opj_bio_t *bio, int n)
 
static int t2_getcommacode (opj_bio_t *bio)
 
static void t2_putnumpasses (opj_bio_t *bio, int n)
 Variable length code for signalling delta Zil (truncation point) More...
 
static int t2_getnumpasses (opj_bio_t *bio)
 
static int t2_encode_packet (opj_tcd_tile_t *tile, opj_tcp_t *tcp, opj_pi_iterator_t *pi, unsigned char *dest, int len, opj_codestream_info_t *cstr_info, int tileno)
 Encode a packet of a tile to a destination buffer. More...
 
static opj_bool t2_init_seg (opj_tcd_cblk_dec_t *cblk, int index, int cblksty, int first)
 
static int t2_decode_packet (opj_t2_t *t2, unsigned char *src, int len, opj_tcd_tile_t *tile, opj_tcp_t *tcp, opj_pi_iterator_t *pi, opj_packet_info_t *pack_info)
 Decode a packet of a tile from a source buffer. More...
 

Exported functions

int t2_encode_packets (opj_t2_t *t2, int tileno, opj_tcd_tile_t *tile, int maxlayers, unsigned char *dest, int len, opj_codestream_info_t *cstr_info, int tpnum, int tppos, int pino, J2K_T2_MODE t2_mode, int cur_totnum_tp)
 Encode the packets of a tile to a destination buffer. More...
 
int t2_decode_packets (opj_t2_t *t2, unsigned char *src, int len, int tileno, opj_tcd_tile_t *tile, opj_codestream_info_t *cstr_info)
 Decode the packets of a tile from a source buffer. More...
 
opj_t2_tt2_create (opj_common_ptr cinfo, opj_image_t *image, opj_cp_t *cp)
 Create a T2 handle. More...
 
void t2_destroy (opj_t2_t *t2)
 Destroy a T2 handle. More...
 

Detailed Description

Typedef Documentation

typedef struct opj_t2 opj_t2_t

Tier-2 coding.

Function Documentation

opj_t2_t* t2_create ( opj_common_ptr  cinfo,
opj_image_t image,
opj_cp_t cp 
)

Create a T2 handle.

Parameters
cinfoCodec context info
imageSource or destination image
cpImage coding parameters
Returns
Returns a new T2 handle if successful, returns NULL otherwise

References opj_t2::cinfo, opj_t2::cp, opj_t2::image, and opj_malloc.

Referenced by tcd_decode_tile(), tcd_encode_tile(), and tcd_rateallocate().

static int t2_decode_packet ( opj_t2_t t2,
unsigned char *  src,
int  len,
opj_tcd_tile_t tile,
opj_tcp_t tcp,
opj_pi_iterator_t pi,
opj_packet_info_t pack_info 
)
static

Decode a packet of a tile from a source buffer.

Parameters
t2T2 handle
srcSource buffer
lenLength of the source buffer
tileTile for which to write the packets
tcpTile coding parameters
piPacket identity
pack_infoPacket information
Returns

TODO : check the Nsop value

References opj_tcd_resolution::bands, bio_create(), bio_destroy(), bio_inalign(), bio_init_dec(), bio_numbytes(), bio_read(), opj_tcd_precinct::cblks, opj_tccp::cblksty, opj_tcd_precinct::ch, opj_t2::cinfo, opj_pi_iterator::compno, opj_tcd_tile::comps, opj_t2::cp, opj_tcp::csty, opj_tcd_precinct::cw, opj_tcd_seg::data, opj_tcd_cblk_dec::data, opj_tcd_seg::dataindex, opj_tcd_precinct::dec, opj_packet_info::end_ph_pos, EVT_ERROR, EVT_WARNING, opj_tcd_precinct::imsbtree, opj_tcd_precinct::incltree, int_floorlog2(), int_min(), J2K_CP_CSTY_EPH, J2K_CP_CSTY_SOP, JPWL_ASSUME, opj_pi_iterator::layno, opj_tcd_seg::len, opj_tcd_cblk_dec::len, opj_tcd_seg::maxpasses, opj_tcd_seg::newlen, opj_tcd_resolution::numbands, opj_tcd_cblk_dec::numbps, opj_tcd_band::numbps, opj_tcd_cblk_dec::numlenbits, opj_tcd_seg::numnewpasses, opj_tcd_cblk_dec::numnewpasses, opj_tcd_seg::numpasses, opj_tcd_cblk_dec::numsegs, opj_event_msg(), opj_realloc, opj_cp::ppm, opj_cp::ppm_data, opj_cp::ppm_len, opj_tcp::ppt, opj_tcp::ppt_data, opj_tcp::ppt_len, opj_tcd_band::precincts, opj_pi_iterator::precno, opj_pi_iterator::resno, opj_tcd_tilecomp::resolutions, opj_tcd_cblk_dec::segs, t2_getcommacode(), t2_getnumpasses(), t2_init_seg(), opj_tcp::tccps, tgt_decode(), tgt_reset(), opj_tcd_band::x0, opj_tcd_band::x1, opj_tcd_band::y0, and opj_tcd_band::y1.

Referenced by t2_decode_packets().

int t2_decode_packets ( opj_t2_t t2,
unsigned char *  src,
int  len,
int  tileno,
opj_tcd_tile_t tile,
opj_codestream_info_t cstr_info 
)

Decode the packets of a tile from a source buffer.

Parameters
t2T2 handle
srcthe source buffer
lenlength of the source buffer
tilenonumber that identifies the tile for which to decode the packets
tiletile for which to decode the packets
cstr_infoCodestream information structure

References opj_pi_iterator::compno, opj_image::comps, opj_t2::cp, opj_tile_info::end_header, opj_packet_info::end_ph_pos, opj_packet_info::end_pos, opj_t2::image, int_max(), opj_cp::layer, opj_pi_iterator::layno, opj_tcp::numpocs, opj_tile_info::packet, opj_codestream_info::packno, pi_create_decode(), pi_destroy(), pi_next(), opj_image_comp::resno_decoded, opj_packet_info::start_pos, t2_decode_packet(), opj_cp::tcps, opj_codestream_info::tile, opj_tile_info::tp, opj_tp_info::tp_end_header, opj_tp_info::tp_end_pos, opj_tp_info::tp_numpacks, opj_cp::tp_on, and opj_tp_info::tp_start_pack.

Referenced by tcd_decode_tile().

void t2_destroy ( opj_t2_t t2)

Destroy a T2 handle.

Parameters
t2T2 handle to destroy

References opj_free.

Referenced by tcd_decode_tile(), tcd_encode_tile(), and tcd_rateallocate().

static int t2_encode_packet ( opj_tcd_tile_t tile,
opj_tcp_t tcp,
opj_pi_iterator_t pi,
unsigned char *  dest,
int  len,
opj_codestream_info_t cstr_info,
int  tileno 
)
static
int t2_encode_packets ( opj_t2_t t2,
int  tileno,
opj_tcd_tile_t tile,
int  maxlayers,
unsigned char *  dest,
int  len,
opj_codestream_info_t cstr_info,
int  tpnum,
int  tppos,
int  pino,
J2K_T2_MODE  t2_mode,
int  cur_totnum_tp 
)

Encode the packets of a tile to a destination buffer.

Parameters
t2T2 handle
tilenonumber of the tile encoded
tilethe tile for which to write the packets
maxlayersmaximum number of layers
destthe destination buffer
lenthe length of the destination buffer
cstr_infoCodestream information structure
tpnumTile part number of the current tile
tpposThe position of the tile part flag in the progression order
pino
t2_modeIf == 0 In Threshold calculation ,If == 1 Final pass
cur_totnum_tpThe total number of tile parts in the current tile

References opj_cp::cinema, CINEMA4K_24, opj_t2::cinfo, opj_t2::cp, opj_tile_info::end_header, opj_packet_info::end_ph_pos, opj_packet_info::end_pos, EVT_ERROR, opj_t2::image, opj_codestream_info::index_write, opj_cp::max_comp_size, opj_image::numcomps, opj_event_msg(), opj_tile_info::packet, opj_tcd_tile::packno, opj_codestream_info::packno, pi_create_encode(), pi_destroy(), pi_initialise_encode(), pi_next(), opj_tcp::POC, opj_packet_info::start_pos, t2_encode_packet(), opj_cp::tcps, THRESH_CALC, opj_codestream_info::tile, and opj_cp::tp_on.

Referenced by tcd_encode_tile(), and tcd_rateallocate().

static int t2_getcommacode ( opj_bio_t bio)
static

References bio_read().

Referenced by t2_decode_packet().

static int t2_getnumpasses ( opj_bio_t bio)
static

References bio_read().

Referenced by t2_decode_packet().

static opj_bool t2_init_seg ( opj_tcd_cblk_dec_t cblk,
int  index,
int  cblksty,
int  first 
)
static
static void t2_putcommacode ( opj_bio_t bio,
int  n 
)
static

References bio_write().

Referenced by t2_encode_packet().

static void t2_putnumpasses ( opj_bio_t bio,
int  n 
)
static

Variable length code for signalling delta Zil (truncation point)

Parameters
bioBit Input/Output component
ndelta Zil

References bio_write().

Referenced by t2_encode_packet().