OpenJPEG: tcd.c File Reference

OpenJPEG 2.1.0

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions
tcd.c File Reference
`#include "opj_includes.h"`

## Macros
#define | OPJ_MACRO_TCD_ALLOCATE(FUNCTION, TYPE, FRACTION, ELEMENT, FUNCTION_ELEMENT)

## Functions
static OPJ_BOOL | opj_tcd_code_block_dec_allocate (opj_tcd_cblk_dec_t *p_code_block)
| Allocates memory for a decoding code block. More...
static void | opj_tcd_code_block_dec_deallocate (opj_tcd_precinct_t *p_precinct)
| Deallocates the decoding data of the given precinct. More...
static OPJ_BOOL | opj_tcd_code_block_enc_allocate (opj_tcd_cblk_enc_t *p_code_block)
| Allocates memory for an encoding code block. More...
static void | opj_tcd_code_block_enc_deallocate (opj_tcd_precinct_t *p_precinct)
| Deallocates the encoding data of the given precinct. More...
static void | opj_tcd_free_tile (opj_tcd_t *tcd)
| Free the memory allocated for encoding. More...
static OPJ_BOOL | opj_tcd_t2_decode (opj_tcd_t *p_tcd, OPJ_BYTE *p_src_data, OPJ_UINT32 *p_data_read, OPJ_UINT32 p_max_src_size, opj_codestream_index_t *p_cstr_index)
static OPJ_BOOL | opj_tcd_t1_decode (opj_tcd_t *p_tcd)
static OPJ_BOOL | opj_tcd_dwt_decode (opj_tcd_t *p_tcd)
static OPJ_BOOL | opj_tcd_mct_decode (opj_tcd_t *p_tcd)
static OPJ_BOOL | opj_tcd_dc_level_shift_decode (opj_tcd_t *p_tcd)
static OPJ_BOOL | opj_tcd_dc_level_shift_encode (opj_tcd_t *p_tcd)
static OPJ_BOOL | opj_tcd_mct_encode (opj_tcd_t *p_tcd)
static OPJ_BOOL | opj_tcd_dwt_encode (opj_tcd_t *p_tcd)
static OPJ_BOOL | opj_tcd_t1_encode (opj_tcd_t *p_tcd)
static OPJ_BOOL | opj_tcd_t2_encode (opj_tcd_t *p_tcd, OPJ_BYTE *p_dest_data, OPJ_UINT32 *p_data_written, OPJ_UINT32 p_max_dest_size, opj_codestream_info_t *p_cstr_info)
static OPJ_BOOL | opj_tcd_rate_allocate_encode (opj_tcd_t *p_tcd, OPJ_BYTE *p_dest_data, OPJ_UINT32 p_max_dest_size, opj_codestream_info_t *p_cstr_info)
opj_tcd_t * | opj_tcd_create (OPJ_BOOL p_is_decoder)
| Create a new TCD handle. More...
void | opj_tcd_rateallocate_fixed (opj_tcd_t *tcd)
void | opj_tcd_makelayer (opj_tcd_t *tcd, OPJ_UINT32 layno, OPJ_FLOAT64 thresh, OPJ_UINT32 final)
void | opj_tcd_makelayer_fixed (opj_tcd_t *tcd, OPJ_UINT32 layno, OPJ_UINT32 final)
OPJ_BOOL | opj_tcd_rateallocate (opj_tcd_t *tcd, OPJ_BYTE *dest, OPJ_UINT32 *p_data_written, OPJ_UINT32 len, opj_codestream_info_t *cstr_info)
OPJ_BOOL | opj_tcd_init (opj_tcd_t *p_tcd, opj_image_t *p_image, opj_cp_t *p_cp)
| Initialize the tile coder and may reuse some memory. More...
void | opj_tcd_destroy (opj_tcd_t *tcd)
| Destroy a previously created TCD handle. More...
OPJ_UINT32 | opj_tcd_get_decoded_tile_size (opj_tcd_t *p_tcd)
| Gets the maximum tile size that will be taken by the tile once decoded. More...
OPJ_BOOL | opj_tcd_encode_tile (opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, OPJ_BYTE *p_dest, OPJ_UINT32 *p_data_written, OPJ_UINT32 p_max_length, opj_codestream_info_t *p_cstr_info)
| Encodes a tile from the raw image into the given buffer. More...
OPJ_BOOL | opj_tcd_decode_tile (opj_tcd_t *p_tcd, OPJ_BYTE *p_src, OPJ_UINT32 p_max_length, OPJ_UINT32 p_tile_no, opj_codestream_index_t *p_cstr_index)
| Decode a tile from a buffer into a raw image. More...
OPJ_BOOL | opj_tcd_update_tile_data (opj_tcd_t *p_tcd, OPJ_BYTE *p_dest, OPJ_UINT32 p_dest_length)
| Copies tile data from the system onto the given memory block. More...
OPJ_UINT32 | opj_tcd_get_encoded_tile_size (opj_tcd_t *p_tcd)
OPJ_BOOL | opj_tcd_copy_tile_data (opj_tcd_t *p_tcd, OPJ_BYTE *p_src, OPJ_UINT32 p_src_length)
| Copies tile data from the given memory block onto the system. More...

## Macro Definition Documentation

#define OPJ_MACRO_TCD_ALLOCATE | ( |  | FUNCTION,
|  |  | TYPE,
|  |  | FRACTION,
|  |  | ELEMENT,
|  |  | FUNCTION_ELEMENT
| ) |  |

## Function Documentation

OPJ_BOOL opj_tcd_code_block_dec_allocate | ( | opj_tcd_cblk_dec_t * | p_code_block | ) |
| static

Allocates memory for a decoding code block.

References opj_tcd_cblk_dec::data, opj_tcd_cblk_dec::data_max_size, opj_tcd_cblk_dec::m_current_max_segs, OPJ_FALSE, OPJ_J2K_DEFAULT_CBLK_DATA_SIZE, OPJ_J2K_DEFAULT_NB_SEGS, opj_malloc, OPJ_TRUE, and opj_tcd_cblk_dec::segs.

void opj_tcd_code_block_dec_deallocate | ( | opj_tcd_precinct_t * | p_precinct | ) |
| static

Deallocates the decoding data of the given precinct.

Deallocates the encoding data of the given precinct.

References opj_tcd_precinct::block_size, opj_tcd_precinct::cblks, opj_tcd_cblk_dec::data, opj_tcd_precinct::dec, opj_free, and opj_tcd_cblk_dec::segs.

Referenced by opj_tcd_free_tile().

OPJ_BOOL opj_tcd_code_block_enc_allocate | ( | opj_tcd_cblk_enc_t * | p_code_block | ) |
| static

Allocates memory for an encoding code block.

References opj_tcd_cblk_enc::data, opj_tcd_cblk_enc::layers, OPJ_FALSE, OPJ_J2K_DEFAULT_CBLK_DATA_SIZE, opj_malloc, OPJ_TRUE, and opj_tcd_cblk_enc::passes.

void opj_tcd_code_block_enc_deallocate | ( | opj_tcd_precinct_t * | p_precinct | ) |
| static

Deallocates the encoding data of the given precinct.

References opj_tcd_precinct::block_size, opj_tcd_precinct::cblks, opj_tcd_cblk_enc::data, opj_tcd_precinct::enc, opj_tcd_cblk_enc::layers, opj_free, and opj_tcd_cblk_enc::passes.

Referenced by opj_tcd_free_tile().

OPJ_BOOL opj_tcd_dc_level_shift_decode | ( | opj_tcd_t * | p_tcd | ) |
| static

References opj_tcd_tile::comps, opj_image::comps, opj_tcd_tilecomp::data, opj_tcd::image, opj_tccp::m_dc_level_shift, opj_tcd_tile::numcomps, opj_int_clamp(), OPJ_TRUE, opj_image_comp::prec, opj_tccp::qmfbid, opj_image_comp::resno_decoded, opj_tcd_tilecomp::resolutions, opj_image_comp::sgnd, opj_tcp::tccps, opj_tcd::tcd_image, opj_tcd::tcp, opj_tcd_image::tiles, opj_tcd_resolution::x0, opj_tcd_tilecomp::x0, opj_tcd_resolution::x1, opj_tcd_tilecomp::x1, opj_tcd_resolution::y0, and opj_tcd_resolution::y1.

Referenced by opj_tcd_decode_tile().

OPJ_BOOL opj_tcd_dc_level_shift_encode | ( | opj_tcd_t * | p_tcd | ) |
| static

References opj_tcd_tile::comps, opj_image::comps, opj_tcd_tilecomp::data, opj_tcd::image, opj_tccp::m_dc_level_shift, opj_tcd_tile::numcomps, OPJ_TRUE, opj_tccp::qmfbid, opj_tcp::tccps, opj_tcd::tcd_image, opj_tcd::tcp, opj_tcd_image::tiles, opj_tcd_tilecomp::x0, opj_tcd_tilecomp::x1, opj_tcd_tilecomp::y0, and opj_tcd_tilecomp::y1.

Referenced by opj_tcd_encode_tile().

OPJ_BOOL opj_tcd_dwt_decode | ( | opj_tcd_t * | p_tcd | ) |
| static

References opj_tcd_tile::comps, opj_image::comps, opj_tcd::image, opj_tcd_tile::numcomps, opj_dwt_decode(), opj_dwt_decode_real(), OPJ_FALSE, OPJ_TRUE, opj_tccp::qmfbid, opj_image_comp::resno_decoded, opj_tcp::tccps, opj_tcd::tcd_image, opj_tcd::tcp, and opj_tcd_image::tiles.

Referenced by opj_tcd_decode_tile().

OPJ_BOOL opj_tcd_dwt_encode | ( | opj_tcd_t * | p_tcd | ) |
| static

References opj_tcd_tile::comps, opj_tcd_tile::numcomps, opj_dwt_encode(), opj_dwt_encode_real(), OPJ_FALSE, OPJ_TRUE, opj_tccp::qmfbid, opj_tcp::tccps, opj_tcd::tcd_image, opj_tcd::tcp, and opj_tcd_image::tiles.

Referenced by opj_tcd_encode_tile().

void opj_tcd_free_tile | ( | opj_tcd_t * | tcd | ) |
| static

Free the memory allocated for encoding.

Parameters

  tcd | TCD handle

References opj_tcd_resolution::bands, opj_tcd_tile::comps, opj_tcd_tilecomp::data, opj_tcd_precinct::imsbtree, opj_tcd_precinct::incltree, opj_tcd::m_is_decoder, opj_tcd_tile::numcomps, opj_free, opj_tcd_code_block_dec_deallocate(), opj_tcd_code_block_enc_deallocate(), opj_tgt_destroy(), opj_tcd_band::precincts, opj_tcd_band::precincts_data_size, opj_tcd_tilecomp::resolutions, opj_tcd_tilecomp::resolutions_size, opj_tcd::tcd_image, and opj_tcd_image::tiles.

Referenced by opj_tcd_destroy().

OPJ_BOOL opj_tcd_mct_decode | ( | opj_tcd_t * | p_tcd | ) |
| static

References opj_tcd_tile::comps, opj_image::comps, opj_tcd_tilecomp::data, opj_tcd::image, opj_tcp::m_mct_decoding_matrix, opj_tcp::mct, opj_tcd_tile::numcomps, OPJ_FALSE, opj_free, opj_malloc, opj_mct_decode(), opj_mct_decode_custom(), opj_mct_decode_real(), OPJ_TRUE, opj_tccp::qmfbid, opj_image_comp::sgnd, opj_tcp::tccps, opj_tcd::tcd_image, opj_tcd::tcp, opj_tcd_image::tiles, opj_tcd_tilecomp::x0, opj_tcd_tilecomp::x1, opj_tcd_tilecomp::y0, and opj_tcd_tilecomp::y1.

Referenced by opj_tcd_decode_tile().

OPJ_BOOL opj_tcd_mct_encode | ( | opj_tcd_t * | p_tcd | ) |
| static

References opj_tcd_tile::comps, opj_image::comps, opj_tcd_tilecomp::data, opj_tcd::image, opj_tcp::m_mct_coding_matrix, opj_tcp::mct, opj_tcd_tile::numcomps, OPJ_FALSE, opj_free, opj_malloc, opj_mct_encode(), opj_mct_encode_custom(), opj_mct_encode_real(), OPJ_TRUE, opj_tccp::qmfbid, opj_image_comp::sgnd, opj_tcp::tccps, opj_tcd::tcd_image, opj_tcd::tcp, opj_tcd_image::tiles, opj_tcd_tilecomp::x0, opj_tcd_tilecomp::x1, opj_tcd_tilecomp::y0, and opj_tcd_tilecomp::y1.

Referenced by opj_tcd_encode_tile().

OPJ_BOOL opj_tcd_rate_allocate_encode | ( | opj_tcd_t * | p_tcd,
|  | OPJ_BYTE * | p_dest_data,
|  | OPJ_UINT32 | p_max_dest_size,
|  | opj_codestream_info_t * | p_cstr_info
| ) |  |
| static

References opj_tcd::cp, opj_codestream_info::index_write, opj_encoding_param::m_disto_alloc, opj_cp::m_enc, opj_encoding_param::m_fixed_quality, opj_cp::m_specific_param, OPJ_FALSE, opj_tcd_rateallocate(), opj_tcd_rateallocate_fixed(), and OPJ_TRUE.

Referenced by opj_tcd_encode_tile().

OPJ_BOOL opj_tcd_t1_decode | ( | opj_tcd_t * | p_tcd | ) |
| static

References opj_tcd_tile::comps, opj_tcd_tile::numcomps, OPJ_FALSE, opj_t1_create(), opj_t1_decode_cblks(), opj_t1_destroy(), OPJ_TRUE, opj_tcp::tccps, opj_tcd::tcd_image, opj_tcd::tcp, and opj_tcd_image::tiles.

Referenced by opj_tcd_decode_tile().

OPJ_BOOL opj_tcd_t1_encode | ( | opj_tcd_t * | p_tcd | ) |
| static

References opj_tcp::mct, opj_tcp::mct_norms, OPJ_FALSE, opj_mct_get_mct_norms(), opj_mct_get_mct_norms_real(), opj_t1_create(), opj_t1_destroy(), opj_t1_encode_cblks(), OPJ_TRUE, opj_tccp::qmfbid, opj_tcp::tccps, opj_tcd::tcd_image, opj_tcd::tcp, and opj_tcd_image::tiles.

Referenced by opj_tcd_encode_tile().

OPJ_BOOL opj_tcd_t2_decode | ( | opj_tcd_t * | p_tcd,
|  | OPJ_BYTE * | p_src_data,
|  | OPJ_UINT32 * | p_data_read,
|  | OPJ_UINT32 | p_max_src_size,
|  | opj_codestream_index_t * | p_cstr_index
| ) |  |
| static

References opj_tcd::cp, opj_tcd::image, OPJ_FALSE, opj_t2_create(), opj_t2_decode_packets(), opj_t2_destroy(), OPJ_TRUE, opj_tcd::tcd_image, opj_tcd::tcd_tileno, and opj_tcd_image::tiles.

Referenced by opj_tcd_decode_tile().

OPJ_BOOL opj_tcd_t2_encode | ( | opj_tcd_t * | p_tcd,
|  | OPJ_BYTE * | p_dest_data,
|  | OPJ_UINT32 * | p_data_written,
|  | OPJ_UINT32 | p_max_dest_size,
|  | opj_codestream_info_t * | p_cstr_info
| ) |  |
| static

References opj_tcd::cp, opj_tcd::cur_pino, FINAL_PASS, opj_tcd::image, opj_tcp::numlayers, OPJ_FALSE, opj_t2_create(), opj_t2_destroy(), opj_t2_encode_packets(), OPJ_TRUE, opj_tcd::tcd_image, opj_tcd::tcd_tileno, opj_tcd::tcp, opj_tcd_image::tiles, opj_tcd::tp_num, and opj_tcd::tp_pos.

Referenced by opj_tcd_encode_tile().