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.

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).
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.
static void 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.

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.
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.
opj_t2_tt2_create (opj_common_ptr cinfo, opj_image_t *image, opj_cp_t *cp)
 Create a T2 handle.
void t2_destroy (opj_t2_t *t2)
 Destroy a T2 handle.

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:
cinfo Codec context info
Parameters:
image Source or destination image
Parameters:
cp Image 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:
t2 T2 handle
Parameters:
src Source buffer
Parameters:
len Length of the source buffer
Parameters:
tile Tile for which to write the packets
Parameters:
tcp Tile coding parameters
Parameters:
pi Packet identity
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_band::numbps, opj_tcd_cblk_dec::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:
t2 T2 handle
Parameters:
src the source buffer
Parameters:
len length of the source buffer
Parameters:
tileno number that identifies the tile for which to decode the packets
Parameters:
tile tile for which to decode the packets

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, and opj_cp::tp_on.

Referenced by tcd_decode_tile().

void t2_destroy ( opj_t2_t t2  ) 

Destroy a T2 handle.

Parameters:
t2 T2 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]

Encode a packet of a tile to a destination buffer.

Parameters:
tile Tile for which to write the packets
Parameters:
tcp Tile coding parameters
Parameters:
pi Packet identity
Parameters:
dest Destination buffer
Parameters:
len Length of the destination buffer
Parameters:
cstr_info Codestream information structure
Parameters:
tileno Number of the tile encoded
Returns:

References opj_tcd_resolution::bands, bio_create(), bio_destroy(), bio_flush(), bio_init_enc(), bio_numbytes(), bio_write(), opj_tcd_precinct::cblks, opj_tcd_precinct::ch, opj_pi_iterator::compno, opj_tcd_tile::comps, opj_tcp::csty, opj_tcd_precinct::cw, opj_codestream_info::D_max, opj_tcd_layer::data, opj_tcd_layer::disto, opj_packet_info::disto, opj_tcd_precinct::enc, opj_packet_info::end_ph_pos, opj_tcd_precinct::imsbtree, opj_tcd_precinct::incltree, opj_codestream_info::index_write, int_floorlog2(), int_max(), J2K_CP_CSTY_EPH, J2K_CP_CSTY_SOP, opj_tcd_cblk_enc::layers, opj_pi_iterator::layno, opj_tcd_layer::len, opj_tcd_pass::len, opj_tcd_resolution::numbands, opj_tcd_cblk_enc::numbps, opj_tcd_band::numbps, opj_tcd_cblk_enc::numlenbits, opj_tcd_layer::numpasses, opj_tcd_cblk_enc::numpasses, opj_tile_info::packet, opj_codestream_info::packno, opj_tcd_tile::packno, opj_tcd_cblk_enc::passes, opj_tcd_band::precincts, opj_pi_iterator::precno, opj_pi_iterator::resno, opj_tcd_tilecomp::resolutions, t2_putcommacode(), t2_putnumpasses(), opj_tcd_pass::term, tgt_encode(), tgt_reset(), tgt_setvalue(), and opj_codestream_info::tile.

Referenced by t2_encode_packets().

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:
t2 T2 handle
Parameters:
tileno number of the tile encoded
Parameters:
tile the tile for which to write the packets
Parameters:
maxlayers maximum number of layers
Parameters:
dest the destination buffer
Parameters:
len the length of the destination buffer
Parameters:
cstr_info Codestream information structure
Parameters:
tpnum Tile part number of the current tile
Parameters:
tppos The position of the tile part flag in the progression order
Parameters:
t2_mode If == 0 In Threshold calculation ,If == 1 Final pass
Parameters:
cur_totnum_tp The 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 void 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:
bio Bit Input/Output component
Parameters:
n delta Zil

References bio_write().

Referenced by t2_encode_packet().

Generated on Sat Jan 22 13:23:00 2011 for OpenJPEG by  doxygen 1.6.3