OpenJPEG 1.5.1
Data Structures | Typedefs
t2.h File Reference

Implementation of a tier-2 coding (packetization of code-block data) (T2) More...

Go to the source code of this file.

Data Structures

struct  opj_t2
 Tier-2 coding. More...
 

Typedefs

typedef struct opj_t2 opj_t2_t
 Tier-2 coding.
 

Functions

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.
 

Detailed Description

Implementation of a tier-2 coding (packetization of code-block data) (T2)

Typedef Documentation

◆ opj_t2_t

typedef struct opj_t2 opj_t2_t

Tier-2 coding.

Function Documentation

◆ t2_create()

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().

◆ 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().

◆ t2_destroy()

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().

◆ 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
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_codestream_info::packno, opj_tcd_tile::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().