OpenJPEG 1.5.1
Data Structures | Typedefs
tcd.h File Reference

Implementation of a tile coder/decoder (TCD) More...

Go to the source code of this file.

Data Structures

struct  opj_tcd_seg
 FIXME: documentation. More...
 
struct  opj_tcd_pass
 FIXME: documentation. More...
 
struct  opj_tcd_layer
 FIXME: documentation. More...
 
struct  opj_tcd_cblk_enc
 FIXME: documentation. More...
 
struct  opj_tcd_cblk_dec
 
struct  opj_tcd_precinct
 FIXME: documentation. More...
 
struct  opj_tcd_band
 FIXME: documentation. More...
 
struct  opj_tcd_resolution
 FIXME: documentation. More...
 
struct  opj_tcd_tilecomp
 FIXME: documentation. More...
 
struct  opj_tcd_tile
 FIXME: documentation. More...
 
struct  opj_tcd_image
 FIXME: documentation. More...
 
struct  opj_tcd
 Tile coder/decoder. More...
 

Typedefs

typedef struct opj_tcd_seg opj_tcd_seg_t
 FIXME: documentation.
 
typedef struct opj_tcd_pass opj_tcd_pass_t
 FIXME: documentation.
 
typedef struct opj_tcd_layer opj_tcd_layer_t
 FIXME: documentation.
 
typedef struct opj_tcd_cblk_enc opj_tcd_cblk_enc_t
 FIXME: documentation.
 
typedef struct opj_tcd_cblk_dec opj_tcd_cblk_dec_t
 
typedef struct opj_tcd_precinct opj_tcd_precinct_t
 FIXME: documentation.
 
typedef struct opj_tcd_band opj_tcd_band_t
 FIXME: documentation.
 
typedef struct opj_tcd_resolution opj_tcd_resolution_t
 FIXME: documentation.
 
typedef struct opj_tcd_tilecomp opj_tcd_tilecomp_t
 FIXME: documentation.
 
typedef struct opj_tcd_tile opj_tcd_tile_t
 FIXME: documentation.
 
typedef struct opj_tcd_image opj_tcd_image_t
 FIXME: documentation.
 
typedef struct opj_tcd opj_tcd_t
 Tile coder/decoder.
 

Functions

Exported functions
void tcd_dump (FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t *img)
 Dump the content of a tcd structure.
 
opj_tcd_ttcd_create (opj_common_ptr cinfo)
 Create a new TCD handle.
 
void tcd_destroy (opj_tcd_t *tcd)
 Destroy a previously created TCD handle.
 
void tcd_malloc_encode (opj_tcd_t *tcd, opj_image_t *image, opj_cp_t *cp, int curtileno)
 Initialize the tile coder (allocate the memory)
 
void tcd_free_encode (opj_tcd_t *tcd)
 Free the memory allocated for encoding.
 
void tcd_init_encode (opj_tcd_t *tcd, opj_image_t *image, opj_cp_t *cp, int curtileno)
 Initialize the tile coder (reuses the memory allocated by tcd_malloc_encode)
 
void tcd_malloc_decode (opj_tcd_t *tcd, opj_image_t *image, opj_cp_t *cp)
 Initialize the tile decoder.
 
void tcd_malloc_decode_tile (opj_tcd_t *tcd, opj_image_t *image, opj_cp_t *cp, int tileno, opj_codestream_info_t *cstr_info)
 
void tcd_makelayer_fixed (opj_tcd_t *tcd, int layno, int final)
 
void tcd_rateallocate_fixed (opj_tcd_t *tcd)
 
void tcd_makelayer (opj_tcd_t *tcd, int layno, double thresh, int final)
 
opj_bool tcd_rateallocate (opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestream_info_t *cstr_info)
 
int tcd_encode_tile (opj_tcd_t *tcd, int tileno, unsigned char *dest, int len, opj_codestream_info_t *cstr_info)
 Encode a tile from the raw image into a buffer.
 
opj_bool tcd_decode_tile (opj_tcd_t *tcd, unsigned char *src, int len, int tileno, opj_codestream_info_t *cstr_info)
 Decode a tile from a buffer into a raw image.
 
void tcd_free_decode (opj_tcd_t *tcd)
 Free the memory allocated for decoding.
 
void tcd_free_decode_tile (opj_tcd_t *tcd, int tileno)
 

Detailed Description

Implementation of a tile coder/decoder (TCD)

The functions in TCD.C have for goal to encode or decode each tile independently from each other. The functions in TCD.C are used by some function in J2K.C.

Typedef Documentation

◆ opj_tcd_band_t

typedef struct opj_tcd_band opj_tcd_band_t

FIXME: documentation.

◆ opj_tcd_cblk_dec_t

◆ opj_tcd_cblk_enc_t

FIXME: documentation.

◆ opj_tcd_image_t

FIXME: documentation.

◆ opj_tcd_layer_t

FIXME: documentation.

◆ opj_tcd_pass_t

typedef struct opj_tcd_pass opj_tcd_pass_t

FIXME: documentation.

◆ opj_tcd_precinct_t

FIXME: documentation.

◆ opj_tcd_resolution_t

FIXME: documentation.

◆ opj_tcd_seg_t

typedef struct opj_tcd_seg opj_tcd_seg_t

FIXME: documentation.

◆ opj_tcd_t

typedef struct opj_tcd opj_tcd_t

Tile coder/decoder.

◆ opj_tcd_tile_t

typedef struct opj_tcd_tile opj_tcd_tile_t

FIXME: documentation.

◆ opj_tcd_tilecomp_t

FIXME: documentation.

Function Documentation

◆ tcd_create()

opj_tcd_t * tcd_create ( opj_common_ptr cinfo)

Create a new TCD handle.

Parameters
cinfoCodec context info
Returns
Returns a new TCD handle if successful returns NULL otherwise

References opj_tcd::cinfo, opj_free, opj_malloc, and opj_tcd::tcd_image.

Referenced by j2k_encode(), and j2k_read_eoc().

◆ tcd_decode_tile()

opj_bool tcd_decode_tile ( opj_tcd_t * tcd,
unsigned char * src,
int len,
int tileno,
opj_codestream_info_t * cstr_info )

Decode a tile from a buffer into a raw image.

Parameters
tcdTCD handle
srcSource buffer
lenLength of source buffer
tilenoNumber that identifies one of the tiles to be decoded
cstr_infoCodestream information structure

References opj_tcd::cinfo, opj_image::comps, opj_tcd_tile::comps, opj_tcd::cp, opj_tccp::csty, opj_image_comp::data, opj_tcd_tilecomp::data, dwt_decode(), dwt_decode_real(), EVT_ERROR, EVT_INFO, EVT_WARNING, opj_image_comp::factor, opj_image_comp::h, opj_tcd::image, int_ceildivpow2(), int_clamp(), J2K_CP_CSTY_PRT, opj_tcp::mct, mct_decode(), mct_decode_real(), min, opj_codestream_info::numcomps, opj_tcd_tile::numcomps, opj_codestream_info::numlayers, opj_tcd_tilecomp::numresolutions, opj_aligned_free, opj_aligned_malloc, opj_clock(), opj_event_msg(), OPJ_FALSE, opj_malloc, OPJ_TRUE, opj_tile_info::packet, opj_codestream_info::packno, opj_tile_info::pdx, opj_tile_info::pdy, opj_tile_info::ph, opj_tcd_resolution::ph, opj_tccp::prch, opj_tccp::prcw, opj_image_comp::prec, opj_tile_info::pw, opj_tcd_resolution::pw, opj_tccp::qmfbid, opj_cp::reduce, opj_image_comp::resno_decoded, opj_tcd_tilecomp::resolutions, opj_image_comp::sgnd, t1_create(), t1_decode_cblks(), t1_destroy(), t2_create(), t2_decode_packets(), t2_destroy(), opj_tcp::tccps, opj_tcd::tcd_image, opj_tcd::tcd_tile, opj_tcd::tcd_tileno, opj_tcd::tcp, opj_cp::tcps, opj_cp::th, opj_codestream_info::tile, opj_tcd_image::tiles, opj_cp::tw, opj_image_comp::w, opj_image_comp::x0, opj_tcd_resolution::x0, opj_tcd_tilecomp::x0, opj_tcd_resolution::x1, opj_tcd_tilecomp::x1, opj_image_comp::y0, opj_tcd_resolution::y0, opj_tcd_tilecomp::y0, opj_tcd_resolution::y1, and opj_tcd_tilecomp::y1.

Referenced by j2k_read_eoc().

◆ tcd_destroy()

void tcd_destroy ( opj_tcd_t * tcd)

Destroy a previously created TCD handle.

Parameters
tcdTCD handle to destroy

References opj_free, and opj_tcd::tcd_image.

Referenced by j2k_encode(), and j2k_read_eoc().

◆ tcd_dump()

void tcd_dump ( FILE * fd,
opj_tcd_t * tcd,
opj_tcd_image_t * img )

◆ tcd_encode_tile()

int tcd_encode_tile ( opj_tcd_t * tcd,
int tileno,
unsigned char * dest,
int len,
opj_codestream_info_t * cstr_info )

Encode a tile from the raw image into a buffer.

Parameters
tcdTCD handle
tilenoNumber that identifies one of the tiles to be encoded
destDestination buffer
lenLength of destination buffer
cstr_infoCodestream information structure
Returns

References opj_tcd::cinfo, opj_image::comps, opj_tcd_tile::comps, opj_tcd::cp, opj_tcd::cur_pino, opj_tcd::cur_totnum_tp, opj_tcd::cur_tp_num, opj_image_comp::data, opj_tcd_tilecomp::data, opj_cp::disto_alloc, dwt_encode(), dwt_encode_real(), opj_image_comp::dx, opj_image_comp::dy, opj_tcd::encoding_time, EVT_INFO, FINAL_PASS, opj_cp::fixed_quality, opj_tcd::image, opj_codestream_info::index_write, int_ceildiv(), opj_tcp::mct, mct_encode(), mct_encode_real(), opj_codestream_info::numcomps, opj_tcd_tile::numcomps, opj_tcp::numlayers, opj_codestream_info::numlayers, opj_tcd_tilecomp::numresolutions, opj_aligned_free, opj_calloc, opj_clock(), opj_event_msg(), opj_tile_info::packet, opj_tile_info::pdx, opj_tile_info::pdy, opj_tile_info::ph, opj_tcd_resolution::ph, opj_tccp::prch, opj_tccp::prcw, opj_image_comp::prec, opj_tile_info::pw, opj_tcd_resolution::pw, opj_tccp::qmfbid, opj_tcd_tilecomp::resolutions, opj_image_comp::sgnd, t1_create(), t1_destroy(), t1_encode_cblks(), t2_create(), t2_destroy(), t2_encode_packets(), opj_tcp::tccps, opj_tcd::tcd_image, tcd_rateallocate(), tcd_rateallocate_fixed(), opj_tcd::tcd_tile, opj_tcd::tcd_tileno, opj_tcd::tcp, opj_cp::tcps, opj_codestream_info::tile, opj_tcd_image::tiles, opj_tcd::tp_num, opj_tcd::tp_pos, opj_image::x0, opj_tcd_tilecomp::x0, opj_image::x1, opj_tcd_tilecomp::x1, opj_image::y0, opj_tcd_tilecomp::y0, and opj_tcd_tilecomp::y1.

Referenced by j2k_write_sod().

◆ tcd_free_decode()

void tcd_free_decode ( opj_tcd_t * tcd)

Free the memory allocated for decoding.

Parameters
tcdTCD handle

References opj_free, tcd_free_decode_tile(), opj_tcd::tcd_image, opj_tcd_image::th, opj_tcd_image::tiles, and opj_tcd_image::tw.

Referenced by j2k_read_eoc().

◆ tcd_free_decode_tile()

void tcd_free_decode_tile ( opj_tcd_t * tcd,
int tileno )

◆ tcd_free_encode()

void tcd_free_encode ( opj_tcd_t * tcd)

◆ tcd_init_encode()

void tcd_init_encode ( opj_tcd_t * tcd,
opj_image_t * image,
opj_cp_t * cp,
int curtileno )

Initialize the tile coder (reuses the memory allocated by tcd_malloc_encode)

Parameters
tcdTCD handle
imageRaw image
cpCoding parameters
curtilenoNumber that identifies the tile that will be encoded

References opj_tcd_band::bandno, opj_tcd_resolution::bands, opj_tccp::cblkh, opj_tccp::cblkw, opj_image::comps, opj_tcd_tile::comps, opj_tccp::csty, opj_tcd::cur_totnum_tp, opj_tcd_tilecomp::data, dwt_getgain(), dwt_getgain_real(), opj_image_comp::dx, opj_image_comp::dy, opj_stepsize::expn, int_ceildiv(), int_ceildivpow2(), int_floordivpow2(), int_max(), int_min(), J2K_CCP_CSTY_PRT, opj_stepsize::mant, opj_tcd_resolution::numbands, opj_tcd_band::numbps, opj_image::numcomps, opj_tcd_tile::numcomps, opj_tccp::numgbits, opj_tcp::numlayers, opj_tccp::numresolutions, opj_tcd_tilecomp::numresolutions, opj_aligned_malloc, opj_calloc, opj_free, opj_tcd_resolution::ph, opj_tccp::prch, opj_tccp::prcw, opj_image_comp::prec, opj_tcd_band::precincts, opj_tcd_resolution::pw, opj_tccp::qmfbid, opj_tcp::rates, opj_tcd_tilecomp::resolutions, opj_tcd_band::stepsize, opj_tccp::stepsizes, opj_tcp::tccps, opj_tcd::tcd_image, opj_cp::tcps, opj_cp::tdx, opj_cp::tdy, tgt_create(), tgt_destroy(), opj_tcd_image::tiles, opj_cp::tp_on, opj_cp::tw, opj_cp::tx0, opj_cp::ty0, opj_image::x0, opj_tcd_cblk_enc::x0, opj_tcd_precinct::x0, opj_tcd_band::x0, opj_tcd_resolution::x0, opj_tcd_tilecomp::x0, opj_tcd_tile::x0, opj_image::x1, opj_tcd_band::x1, opj_tcd_resolution::x1, opj_tcd_tilecomp::x1, opj_tcd_tile::x1, opj_image::y0, opj_tcd_band::y0, opj_tcd_resolution::y0, opj_tcd_tilecomp::y0, opj_tcd_tile::y0, opj_image::y1, opj_tcd_band::y1, opj_tcd_resolution::y1, opj_tcd_tilecomp::y1, and opj_tcd_tile::y1.

Referenced by j2k_encode().

◆ tcd_makelayer()

void tcd_makelayer ( opj_tcd_t * tcd,
int layno,
double thresh,
int final )

◆ tcd_makelayer_fixed()

void tcd_makelayer_fixed ( opj_tcd_t * tcd,
int layno,
int final )

◆ tcd_malloc_decode()

void tcd_malloc_decode ( opj_tcd_t * tcd,
opj_image_t * image,
opj_cp_t * cp )

◆ tcd_malloc_decode_tile()

void tcd_malloc_decode_tile ( opj_tcd_t * tcd,
opj_image_t * image,
opj_cp_t * cp,
int tileno,
opj_codestream_info_t * cstr_info )

◆ tcd_malloc_encode()

void tcd_malloc_encode ( opj_tcd_t * tcd,
opj_image_t * image,
opj_cp_t * cp,
int curtileno )

Initialize the tile coder (allocate the memory)

Parameters
tcdTCD handle
imageRaw image
cpCoding parameters
curtilenoNumber that identifies the tile that will be encoded

References opj_tcd_band::bandno, opj_tcd_resolution::bands, opj_tccp::cblkh, opj_tcd_precinct::cblks, opj_tccp::cblkw, opj_image::comps, opj_tcd_tile::comps, opj_tcd::cp, opj_tccp::csty, opj_tcd::cur_totnum_tp, opj_tcd_tilecomp::data, dwt_getgain(), dwt_getgain_real(), opj_image_comp::dx, opj_image_comp::dy, opj_tcd_precinct::enc, opj_stepsize::expn, opj_tcd::image, opj_tcd_precinct::imsbtree, opj_tcd_precinct::incltree, int_ceildiv(), int_ceildivpow2(), int_floordivpow2(), int_max(), int_min(), J2K_CCP_CSTY_PRT, opj_stepsize::mant, opj_tcd_resolution::numbands, opj_tcd_band::numbps, opj_image::numcomps, opj_tcd_tile::numcomps, opj_tccp::numgbits, opj_tcp::numlayers, opj_tccp::numresolutions, opj_tcd_tilecomp::numresolutions, opj_aligned_malloc, opj_calloc, opj_malloc, opj_tcd_resolution::ph, opj_tccp::prch, opj_tccp::prcw, opj_image_comp::prec, opj_tcd_band::precincts, opj_tcd_resolution::pw, opj_tccp::qmfbid, opj_tcp::rates, opj_tcd_tilecomp::resolutions, opj_tcd_band::stepsize, opj_tccp::stepsizes, opj_tcp::tccps, opj_tcd::tcd_image, opj_cp::tcps, opj_cp::tdx, opj_cp::tdy, tgt_create(), opj_cp::th, opj_tcd_image::th, opj_tcd_image::tiles, opj_cp::tp_on, opj_cp::tw, opj_tcd_image::tw, opj_cp::tx0, opj_cp::ty0, opj_image::x0, opj_tcd_cblk_enc::x0, opj_tcd_precinct::x0, opj_tcd_band::x0, opj_tcd_resolution::x0, opj_tcd_tilecomp::x0, opj_tcd_tile::x0, opj_image::x1, opj_tcd_band::x1, opj_tcd_resolution::x1, opj_tcd_tilecomp::x1, opj_tcd_tile::x1, opj_image::y0, opj_tcd_band::y0, opj_tcd_resolution::y0, opj_tcd_tilecomp::y0, opj_tcd_tile::y0, opj_image::y1, opj_tcd_band::y1, opj_tcd_resolution::y1, opj_tcd_tilecomp::y1, and opj_tcd_tile::y1.

Referenced by j2k_encode().

◆ tcd_rateallocate()

opj_bool tcd_rateallocate ( opj_tcd_t * tcd,
unsigned char * dest,
int len,
opj_codestream_info_t * cstr_info )

◆ tcd_rateallocate_fixed()

void tcd_rateallocate_fixed ( opj_tcd_t * tcd)