OpenJPEG  2.2.0
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 opj_t2_putcommacode (opj_bio_t *bio, OPJ_INT32 n)
 
static OPJ_UINT32 opj_t2_getcommacode (opj_bio_t *bio)
 
static void opj_t2_putnumpasses (opj_bio_t *bio, OPJ_UINT32 n)
 Variable length code for signalling delta Zil (truncation point) More...
 
static OPJ_UINT32 opj_t2_getnumpasses (opj_bio_t *bio)
 
static OPJ_BOOL opj_t2_encode_packet (OPJ_UINT32 tileno, opj_tcd_tile_t *tile, opj_tcp_t *tcp, opj_pi_iterator_t *pi, OPJ_BYTE *dest, OPJ_UINT32 *p_data_written, OPJ_UINT32 len, opj_codestream_info_t *cstr_info)
 Encode a packet of a tile to a destination buffer. More...
 
static OPJ_BOOL opj_t2_decode_packet (opj_t2_t *t2, opj_tcd_tile_t *tile, opj_tcp_t *tcp, opj_pi_iterator_t *pi, OPJ_BYTE *src, OPJ_UINT32 *data_read, OPJ_UINT32 max_length, opj_packet_info_t *pack_info, opj_event_mgr_t *p_manager)
 Decode a packet of a tile from a source buffer. More...
 
static OPJ_BOOL opj_t2_skip_packet (opj_t2_t *p_t2, opj_tcd_tile_t *p_tile, opj_tcp_t *p_tcp, opj_pi_iterator_t *p_pi, OPJ_BYTE *p_src, OPJ_UINT32 *p_data_read, OPJ_UINT32 p_max_length, opj_packet_info_t *p_pack_info, opj_event_mgr_t *p_manager)
 
static OPJ_BOOL opj_t2_read_packet_header (opj_t2_t *p_t2, opj_tcd_tile_t *p_tile, opj_tcp_t *p_tcp, opj_pi_iterator_t *p_pi, OPJ_BOOL *p_is_data_present, OPJ_BYTE *p_src_data, OPJ_UINT32 *p_data_read, OPJ_UINT32 p_max_length, opj_packet_info_t *p_pack_info, opj_event_mgr_t *p_manager)
 
static OPJ_BOOL opj_t2_read_packet_data (opj_t2_t *p_t2, opj_tcd_tile_t *p_tile, opj_pi_iterator_t *p_pi, OPJ_BYTE *p_src_data, OPJ_UINT32 *p_data_read, OPJ_UINT32 p_max_length, opj_packet_info_t *pack_info, opj_event_mgr_t *p_manager)
 
static OPJ_BOOL opj_t2_skip_packet_data (opj_t2_t *p_t2, opj_tcd_tile_t *p_tile, opj_pi_iterator_t *p_pi, OPJ_UINT32 *p_data_read, OPJ_UINT32 p_max_length, opj_packet_info_t *pack_info, opj_event_mgr_t *p_manager)
 
static OPJ_BOOL opj_t2_init_seg (opj_tcd_cblk_dec_t *cblk, OPJ_UINT32 index, OPJ_UINT32 cblksty, OPJ_UINT32 first)
 

Exported functions

OPJ_BOOL opj_t2_encode_packets (opj_t2_t *t2, OPJ_UINT32 tileno, opj_tcd_tile_t *tile, OPJ_UINT32 maxlayers, OPJ_BYTE *dest, OPJ_UINT32 *p_data_written, OPJ_UINT32 len, opj_codestream_info_t *cstr_info, OPJ_UINT32 tpnum, OPJ_INT32 tppos, OPJ_UINT32 pino, J2K_T2_MODE t2_mode)
 Encode the packets of a tile to a destination buffer. More...
 
OPJ_BOOL opj_t2_decode_packets (opj_t2_t *t2, OPJ_UINT32 tileno, opj_tcd_tile_t *tile, OPJ_BYTE *src, OPJ_UINT32 *p_data_read, OPJ_UINT32 len, opj_codestream_index_t *cstr_info, opj_event_mgr_t *p_manager)
 Decode the packets of a tile from a source buffer. More...
 
opj_t2_topj_t2_create (opj_image_t *p_image, opj_cp_t *p_cp)
 Creates a Tier 2 handle. More...
 
void opj_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* opj_t2_create ( opj_image_t p_image,
opj_cp_t p_cp 
)

Creates a Tier 2 handle.

Parameters
p_imageSource or destination image
p_cpImage coding parameters.
Returns
a new T2 handle if successful, NULL otherwise.

References opj_t2::cp, opj_t2::image, and opj_calloc().

Referenced by opj_tcd_rateallocate(), opj_tcd_t2_decode(), and opj_tcd_t2_encode().

static OPJ_BOOL opj_t2_decode_packet ( opj_t2_t t2,
opj_tcd_tile_t tile,
opj_tcp_t tcp,
opj_pi_iterator_t pi,
OPJ_BYTE src,
OPJ_UINT32 data_read,
OPJ_UINT32  max_length,
opj_packet_info_t pack_info,
opj_event_mgr_t p_manager 
)
static

Decode a packet of a tile from a source buffer.

Parameters
t2T2 handle
tileTile for which to write the packets
tcpTile coding parameters
piPacket identity
srcSource buffer
data_readFIXME DOC
max_lengthFIXME DOC
pack_infoPacket information
p_managerthe user event manager
Returns
FIXME DOC

References OPJ_FALSE, opj_t2_read_packet_data(), opj_t2_read_packet_header(), and OPJ_TRUE.

Referenced by opj_t2_decode_packets().

OPJ_BOOL opj_t2_decode_packets ( opj_t2_t t2,
OPJ_UINT32  tileno,
opj_tcd_tile_t tile,
OPJ_BYTE src,
OPJ_UINT32 p_data_read,
OPJ_UINT32  len,
opj_codestream_index_t cstr_info,
opj_event_mgr_t p_manager 
)
void opj_t2_destroy ( opj_t2_t t2)

Destroy a T2 handle.

Parameters
t2T2 handle to destroy

References opj_free().

Referenced by opj_tcd_rateallocate(), opj_tcd_t2_decode(), and opj_tcd_t2_encode().

static OPJ_BOOL opj_t2_encode_packet ( OPJ_UINT32  tileno,
opj_tcd_tile_t tile,
opj_tcp_t tcp,
opj_pi_iterator_t pi,
OPJ_BYTE dest,
OPJ_UINT32 p_data_written,
OPJ_UINT32  len,
opj_codestream_info_t cstr_info 
)
static

Encode a packet of a tile to a destination buffer.

Parameters
tilenoNumber of the tile encoded
tileTile for which to write the packets
tcpTile coding parameters
piPacket identity
destDestination buffer
p_data_writtenFIXME DOC
lenLength of the destination buffer
cstr_infoCodestream information structure
Returns

References opj_tcd_resolution::bands, 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, J2K_CP_CSTY_EPH, J2K_CP_CSTY_SOP, opj_tcd_cblk_enc::layers, opj_pi_iterator::layno, opj_tcd_pass::len, opj_tcd_layer::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_bio_create(), opj_bio_destroy(), opj_bio_flush(), opj_bio_init_enc(), opj_bio_numbytes(), opj_bio_write(), OPJ_FALSE, opj_int_floorlog2(), opj_int_max(), opj_t2_putcommacode(), opj_t2_putnumpasses(), opj_tcd_is_band_empty(), opj_tgt_encode(), opj_tgt_reset(), opj_tgt_setvalue(), OPJ_TRUE, opj_tile_info::packet, opj_tcd_tile::packno, opj_codestream_info::packno, opj_tcd_cblk_enc::passes, opj_tcd_band::precincts, opj_pi_iterator::precno, opj_pi_iterator::resno, opj_tcd_tilecomp::resolutions, opj_tcd_pass::term, and opj_codestream_info::tile.

Referenced by opj_t2_encode_packets().

OPJ_BOOL opj_t2_encode_packets ( opj_t2_t t2,
OPJ_UINT32  tileno,
opj_tcd_tile_t tile,
OPJ_UINT32  maxlayers,
OPJ_BYTE dest,
OPJ_UINT32 p_data_written,
OPJ_UINT32  len,
opj_codestream_info_t cstr_info,
OPJ_UINT32  tpnum,
OPJ_INT32  tppos,
OPJ_UINT32  pino,
J2K_T2_MODE  t2_mode 
)

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
p_data_writtenFIXME DOC
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
pinoFIXME DOC
t2_modeIf == 0 In Threshold calculation ,If == 1 Final pass

References opj_t2::cp, opj_tile_info::end_header, opj_packet_info::end_ph_pos, opj_packet_info::end_pos, opj_t2::image, opj_codestream_info::index_write, opj_pi_iterator::layno, opj_cp::m_enc, opj_encoding_param::m_max_comp_size, opj_cp::m_specific_param, opj_encoding_param::m_tp_on, opj_image::numcomps, opj_tcp::numpocs, OPJ_FALSE, opj_pi_create_encode(), opj_pi_destroy(), opj_pi_initialise_encode(), opj_pi_next(), OPJ_PROFILE_CINEMA_4K, OPJ_PROG_UNKNOWN, opj_t2_encode_packet(), OPJ_TRUE, opj_tile_info::packet, opj_tcd_tile::packno, opj_codestream_info::packno, opj_pi_iterator::poc, opj_tcp::POC, opj_poc::prg, opj_cp::rsiz, opj_packet_info::start_pos, opj_cp::tcps, THRESH_CALC, and opj_codestream_info::tile.

Referenced by opj_tcd_rateallocate(), and opj_tcd_t2_encode().

static OPJ_UINT32 opj_t2_getcommacode ( opj_bio_t bio)
static

References opj_bio_read().

Referenced by opj_t2_read_packet_header().

static OPJ_UINT32 opj_t2_getnumpasses ( opj_bio_t bio)
static

References opj_bio_read().

Referenced by opj_t2_read_packet_header().

static OPJ_BOOL opj_t2_init_seg ( opj_tcd_cblk_dec_t cblk,
OPJ_UINT32  index,
OPJ_UINT32  cblksty,
OPJ_UINT32  first 
)
static
static void opj_t2_putcommacode ( opj_bio_t bio,
OPJ_INT32  n 
)
static

References opj_bio_write().

Referenced by opj_t2_encode_packet().

static void opj_t2_putnumpasses ( opj_bio_t bio,
OPJ_UINT32  n 
)
static

Variable length code for signalling delta Zil (truncation point)

Parameters
bioBit Input/Output component
ndelta Zil

References opj_bio_write().

Referenced by opj_t2_encode_packet().

static OPJ_BOOL opj_t2_read_packet_data ( opj_t2_t p_t2,
opj_tcd_tile_t p_tile,
opj_pi_iterator_t p_pi,
OPJ_BYTE p_src_data,
OPJ_UINT32 p_data_read,
OPJ_UINT32  p_max_length,
opj_packet_info_t pack_info,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_t2_read_packet_header ( opj_t2_t p_t2,
opj_tcd_tile_t p_tile,
opj_tcp_t p_tcp,
opj_pi_iterator_t p_pi,
OPJ_BOOL p_is_data_present,
OPJ_BYTE p_src_data,
OPJ_UINT32 p_data_read,
OPJ_UINT32  p_max_length,
opj_packet_info_t p_pack_info,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_t2_skip_packet ( opj_t2_t p_t2,
opj_tcd_tile_t p_tile,
opj_tcp_t p_tcp,
opj_pi_iterator_t p_pi,
OPJ_BYTE p_src,
OPJ_UINT32 p_data_read,
OPJ_UINT32  p_max_length,
opj_packet_info_t p_pack_info,
opj_event_mgr_t p_manager 
)
static
static OPJ_BOOL opj_t2_skip_packet_data ( opj_t2_t p_t2,
opj_tcd_tile_t p_tile,
opj_pi_iterator_t p_pi,
OPJ_UINT32 p_data_read,
OPJ_UINT32  p_max_length,
opj_packet_info_t pack_info,
opj_event_mgr_t p_manager 
)
static