OpenJPEG 2.5.3
tcd.c File Reference
#include "opj_includes.h"
#include "opj_common.h"

Functions

static INLINE OPJ_BOOL opj_tcd_init_tile (opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, OPJ_BOOL isEncoder, OPJ_SIZE_T sizeof_block, opj_event_mgr_t *manager)
 Initializes tile coding/decoding.
 
static OPJ_BOOL opj_tcd_code_block_dec_allocate (opj_tcd_cblk_dec_t *p_code_block)
 Allocates memory for a decoding code block.
 
static void opj_tcd_code_block_dec_deallocate (opj_tcd_precinct_t *p_precinct)
 Deallocates the decoding data of the given precinct.
 
static OPJ_BOOL opj_tcd_code_block_enc_allocate (opj_tcd_cblk_enc_t *p_code_block)
 Allocates memory for an encoding code block (but not data).
 
static OPJ_BOOL opj_tcd_code_block_enc_allocate_data (opj_tcd_cblk_enc_t *p_code_block)
 Allocates data for an encoding code block.
 
static void opj_tcd_code_block_enc_deallocate (opj_tcd_precinct_t *p_precinct)
 Deallocates the encoding data of the given precinct.
 
static void opj_tcd_makelayer_fixed (opj_tcd_t *tcd, OPJ_UINT32 layno, OPJ_UINT32 final)
 For m_quality_layer_alloc_strategy == FIXED_LAYER.
 
static void opj_tcd_free_tile (opj_tcd_t *tcd)
 Free the memory allocated for encoding.
 
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, opj_event_mgr_t *p_manager)
 
static OPJ_BOOL opj_tcd_t1_decode (opj_tcd_t *p_tcd, opj_event_mgr_t *p_manager)
 
static OPJ_BOOL opj_tcd_dwt_decode (opj_tcd_t *p_tcd)
 
static OPJ_BOOL opj_tcd_mct_decode (opj_tcd_t *p_tcd, opj_event_mgr_t *p_manager)
 
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, opj_tcd_marker_info_t *p_marker_info, opj_event_mgr_t *p_manager)
 
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_event_mgr_t *p_manager)
 
static OPJ_BOOL opj_tcd_is_whole_tilecomp_decoding (opj_tcd_t *p_tcd, OPJ_UINT32 compno)
 Returns whether a tile component is fully decoded, taking into account p_tcd->win_* members.
 
opj_tcd_topj_tcd_create (OPJ_BOOL p_is_decoder)
 Create a new TCD handle.
 
static void opj_tcd_rateallocate_fixed (opj_tcd_t *tcd)
 
static OPJ_BOOL opj_tcd_makelayer (opj_tcd_t *tcd, OPJ_UINT32 layno, OPJ_FLOAT64 thresh, OPJ_UINT32 final)
 Returns OPJ_TRUE if the layer allocation is unchanged w.r.t to the previous invocation with a different threshold.
 
static 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_event_mgr_t *p_manager)
 Rate allocation for the following methods:
 
OPJ_BOOL opj_tcd_init (opj_tcd_t *p_tcd, opj_image_t *p_image, opj_cp_t *p_cp, opj_thread_pool_t *p_tp)
 Initialize the tile coder and may reuse some memory.
 
void opj_tcd_destroy (opj_tcd_t *tcd)
 Destroy a previously created TCD handle.
 
OPJ_BOOL opj_alloc_tile_component_data (opj_tcd_tilecomp_t *l_tilec)
 Allocates tile component data.
 
OPJ_BOOL opj_tcd_init_encode_tile (opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, opj_event_mgr_t *p_manager)
 Initialize the tile coder and may reuse some memory.
 
OPJ_BOOL opj_tcd_init_decode_tile (opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, opj_event_mgr_t *p_manager)
 Allocates memory for decoding a specific tile.
 
void opj_tcd_reinit_segment (opj_tcd_seg_t *seg)
 Reinitialize a segment.
 
OPJ_UINT32 opj_tcd_get_decoded_tile_size (opj_tcd_t *p_tcd, OPJ_BOOL take_into_account_partial_decoding)
 Gets the maximum tile size that will be taken by the tile once decoded.
 
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, opj_tcd_marker_info_t *p_marker_info, opj_event_mgr_t *p_manager)
 Encodes a tile from the raw image into the given buffer.
 
OPJ_BOOL opj_tcd_decode_tile (opj_tcd_t *p_tcd, OPJ_UINT32 win_x0, OPJ_UINT32 win_y0, OPJ_UINT32 win_x1, OPJ_UINT32 win_y1, OPJ_UINT32 numcomps_to_decode, const OPJ_UINT32 *comps_indices, OPJ_BYTE *p_src, OPJ_UINT32 p_max_length, OPJ_UINT32 p_tile_no, opj_codestream_index_t *p_cstr_index, opj_event_mgr_t *p_manager)
 Decode a tile from a buffer into a raw image.
 
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.
 
OPJ_SIZE_T opj_tcd_get_encoder_input_buffer_size (opj_tcd_t *p_tcd)
 Get the size in bytes of the input buffer provided before encoded.
 
OPJ_BOOL opj_tcd_copy_tile_data (opj_tcd_t *p_tcd, OPJ_BYTE *p_src, OPJ_SIZE_T p_src_length)
 Copies tile data from the given memory block onto the system.
 
OPJ_BOOL opj_tcd_is_band_empty (opj_tcd_band_t *band)
 Returns whether a sub-band is empty (i.e.
 
OPJ_BOOL opj_tcd_is_subband_area_of_interest (opj_tcd_t *tcd, OPJ_UINT32 compno, OPJ_UINT32 resno, OPJ_UINT32 bandno, OPJ_UINT32 band_x0, OPJ_UINT32 band_y0, OPJ_UINT32 band_x1, OPJ_UINT32 band_y1)
 Returns whether a sub-band region contributes to the area of interest tcd->win_x0,tcd->win_y0,tcd->win_x1,tcd->win_y1.
 
opj_tcd_marker_info_topj_tcd_marker_info_create (OPJ_BOOL need_PLT)
 Create a new opj_tcd_marker_info_t* structure.
 
void opj_tcd_marker_info_destroy (opj_tcd_marker_info_t *p_tcd_marker_info)
 Destroy a previously created opj_tcd_marker_info_t* structure.
 

Function Documentation

◆ opj_alloc_tile_component_data()

◆ opj_tcd_code_block_dec_allocate()

◆ opj_tcd_code_block_dec_deallocate()

static 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::chunks, opj_tcd_precinct::dec, opj_tcd_cblk_dec::decoded_data, opj_aligned_free(), opj_free(), and opj_tcd_cblk_dec::segs.

Referenced by opj_tcd_free_tile().

◆ opj_tcd_code_block_enc_allocate()

static OPJ_BOOL opj_tcd_code_block_enc_allocate ( opj_tcd_cblk_enc_t * p_code_block)
static

Allocates memory for an encoding code block (but not data).

Allocates memory for an encoding code block (but not data memory).

References opj_tcd_cblk_enc::layers, opj_calloc(), OPJ_FALSE, OPJ_TRUE, and opj_tcd_cblk_enc::passes.

Referenced by opj_tcd_init_tile().

◆ opj_tcd_code_block_enc_allocate_data()

static OPJ_BOOL opj_tcd_code_block_enc_allocate_data ( opj_tcd_cblk_enc_t * p_code_block)
static

Allocates data for an encoding code block.

Allocates data memory for an encoding code block.

References opj_tcd_cblk_enc::data, opj_tcd_cblk_enc::data_size, OPJ_FALSE, opj_free(), opj_malloc(), OPJ_TRUE, opj_tcd_cblk_enc::x0, opj_tcd_cblk_enc::x1, opj_tcd_cblk_enc::y0, and opj_tcd_cblk_enc::y1.

Referenced by opj_tcd_init_tile().

◆ opj_tcd_code_block_enc_deallocate()

static void opj_tcd_code_block_enc_deallocate ( opj_tcd_precinct_t * p_precinct)
static

◆ opj_tcd_copy_tile_data()

◆ opj_tcd_create()

opj_tcd_t * opj_tcd_create ( OPJ_BOOL p_is_decoder)

Create a new TCD handle.

Dump the content of a tcd structure.

References opj_tcd::m_is_decoder, opj_calloc(), opj_free(), and opj_tcd::tcd_image.

Referenced by opj_j2k_copy_default_tcp_and_create_tcd(), and opj_j2k_create_tcd().

◆ opj_tcd_dc_level_shift_decode()

◆ opj_tcd_dc_level_shift_encode()

◆ opj_tcd_decode_tile()

OPJ_BOOL opj_tcd_decode_tile ( opj_tcd_t * tcd,
OPJ_UINT32 win_x0,
OPJ_UINT32 win_y0,
OPJ_UINT32 win_x1,
OPJ_UINT32 win_y1,
OPJ_UINT32 numcomps_to_decode,
const OPJ_UINT32 * comps_indices,
OPJ_BYTE * src,
OPJ_UINT32 len,
OPJ_UINT32 tileno,
opj_codestream_index_t * cstr_info,
opj_event_mgr_t * manager )

Decode a tile from a buffer into a raw image.

Parameters
tcdTCD handle
win_x0Upper left x of region to decode (in grid coordinates)
win_y0Upper left y of region to decode (in grid coordinates)
win_x1Lower right x of region to decode (in grid coordinates)
win_y1Lower right y of region to decode (in grid coordinates)
numcomps_to_decodeSize of the comps_indices array, or 0 if decoding all components.
comps_indicesArray of numcomps values representing the indices of the components to decode (relative to the codestream, starting at 0). Or NULL if decoding all components.
srcSource buffer
lenLength of source buffer
tilenoNumber that identifies one of the tiles to be decoded
cstr_infoFIXME DOC
managerthe event manager.

References opj_image::comps, opj_tcd_tile::comps, opj_tcd::cp, opj_tcd_tilecomp::data_size_needed, opj_tcd_tilecomp::data_win, opj_image_comp::dx, opj_image_comp::dy, EVT_ERROR, opj_tcd::image, opj_tcd_tilecomp::minimum_num_resolutions, opj_image::numcomps, opj_tcd_tilecomp::numresolutions, opj_alloc_tile_component_data(), opj_calloc(), opj_event_msg(), OPJ_FALSE, opj_free(), opj_image_data_alloc(), opj_image_data_free(), opj_malloc(), opj_tcd_dc_level_shift_decode(), opj_tcd_dwt_decode(), opj_tcd_is_whole_tilecomp_decoding(), opj_tcd_mct_decode(), opj_tcd_t1_decode(), opj_tcd_t2_decode(), OPJ_TRUE, opj_uint_ceildiv(), opj_uint_ceildivpow2(), opj_uint_max(), opj_uint_min(), opj_tcd_resolution::ph, opj_tccp::prch, opj_tccp::prcw, opj_tcd_resolution::pw, opj_image_comp::resno_decoded, opj_tcd_tilecomp::resolutions, SIZE_MAX, opj_tcd::tcd_image, opj_tcd::tcd_tileno, opj_tcd::tcp, tcp, opj_cp::tcps, opj_tcd_image::tiles, opj_tcd::used_component, opj_tcd::whole_tile_decoding, opj_tcd::win_x0, opj_tcd_resolution::win_x0, opj_tcd_tilecomp::win_x0, opj_tcd::win_x1, opj_tcd_resolution::win_x1, opj_tcd_tilecomp::win_x1, opj_tcd::win_y0, opj_tcd_resolution::win_y0, opj_tcd_tilecomp::win_y0, opj_tcd::win_y1, opj_tcd_resolution::win_y1, opj_tcd_tilecomp::win_y1, opj_tcd_resolution::x0, opj_tcd_tilecomp::x0, opj_tcd_resolution::x1, opj_tcd_tilecomp::x1, opj_tcd_resolution::y0, opj_tcd_tilecomp::y0, opj_tcd_resolution::y1, and opj_tcd_tilecomp::y1.

Referenced by opj_j2k_decode_tile().

◆ opj_tcd_destroy()

void opj_tcd_destroy ( opj_tcd_t * tcd)

Destroy a previously created TCD handle.

Parameters
tcdTCD handle to destroy

References opj_free(), opj_tcd_free_tile(), opj_tcd::tcd_image, and opj_tcd::used_component.

Referenced by opj_j2k_copy_default_tcp_and_create_tcd(), opj_j2k_create_tcd(), opj_j2k_destroy(), and opj_j2k_end_encoding().

◆ opj_tcd_dwt_decode()

◆ opj_tcd_dwt_encode()

◆ opj_tcd_encode_tile()

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_len,
struct opj_codestream_info * p_cstr_info,
opj_tcd_marker_info_t * p_marker_info,
opj_event_mgr_t * p_manager )

Encodes a tile from the raw image into the given buffer.

Parameters
p_tcdTile Coder handle
p_tile_noIndex of the tile to encode.
p_destDestination buffer
p_data_writtenpointer to an int that is incremented by the number of bytes really written on p_dest
p_lenMaximum length of the destination buffer
p_cstr_infoCodestream information structure
p_marker_infoMarker information structure
p_managerthe user event manager
Returns
true if the coding is successful.

References opj_tcd_tile::comps, opj_tcd::cp, opj_tcd::cur_tp_num, opj_codestream_info::index_write, opj_codestream_info::numcomps, opj_codestream_info::numlayers, opj_tcd_tilecomp::numresolutions, opj_calloc(), OPJ_FALSE, opj_tcd_dc_level_shift_encode(), opj_tcd_dwt_encode(), opj_tcd_mct_encode(), opj_tcd_rate_allocate_encode(), opj_tcd_t1_encode(), opj_tcd_t2_encode(), OPJ_TRUE, opj_tile_info::packet, opj_tile_info::pdx, opj_tile_info::pdy, opj_tcd_resolution::ph, opj_tile_info::ph, opj_tccp::prch, opj_tccp::prcw, opj_tcd_resolution::pw, opj_tile_info::pw, opj_tcd_tilecomp::resolutions, opj_tcp::tccps, opj_tcd::tcd_image, opj_tcd::tcd_tileno, opj_tcd::tcp, opj_cp::tcps, opj_codestream_info::tile, and opj_tcd_image::tiles.

Referenced by opj_j2k_write_sod().

◆ opj_tcd_free_tile()

◆ opj_tcd_get_decoded_tile_size()

◆ opj_tcd_get_encoder_input_buffer_size()

OPJ_SIZE_T opj_tcd_get_encoder_input_buffer_size ( opj_tcd_t * p_tcd)

Get the size in bytes of the input buffer provided before encoded.

This must be the size provided to the p_src_length argument of opj_tcd_copy_tile_data()

References opj_image::comps, opj_tcd_tile::comps, opj_tcd::image, opj_image::numcomps, opj_image_comp::prec, opj_tcd::tcd_image, opj_tcd_image::tiles, opj_tcd_tilecomp::x0, opj_tcd_tilecomp::x1, opj_tcd_tilecomp::y0, and opj_tcd_tilecomp::y1.

Referenced by opj_j2k_encode(), and opj_tcd_copy_tile_data().

◆ opj_tcd_init()

OPJ_BOOL opj_tcd_init ( opj_tcd_t * p_tcd,
opj_image_t * p_image,
opj_cp_t * p_cp,
opj_thread_pool_t * p_tp )

Initialize the tile coder and may reuse some memory.

Parameters
p_tcdTCD handle.
p_imageraw image.
p_cpcoding parameters.
p_tpthread pool
Returns
true if the encoding values could be set (false otherwise).

References opj_tcd_tile::comps, opj_tcd::cp, opj_tcd::image, opj_cp::m_enc, opj_cp::m_specific_param, opj_encoding_param::m_tp_pos, opj_image::numcomps, opj_tcd_tile::numcomps, opj_calloc(), OPJ_FALSE, OPJ_TRUE, opj_tcd::tcd_image, opj_tcd::thread_pool, opj_tcd_image::tiles, and opj_tcd::tp_pos.

Referenced by opj_j2k_copy_default_tcp_and_create_tcd(), and opj_j2k_create_tcd().

◆ opj_tcd_init_decode_tile()

OPJ_BOOL opj_tcd_init_decode_tile ( opj_tcd_t * p_tcd,
OPJ_UINT32 p_tile_no,
opj_event_mgr_t * p_manager )

Allocates memory for decoding a specific tile.

Parameters
p_tcdthe tile decoder.
p_tile_nothe index of the tile received in sequence. This not necessarily lead to the tile at index p_tile_no.
p_managerthe event manager.
Returns
true if the remaining data is sufficient.

References OPJ_FALSE, and opj_tcd_init_tile().

Referenced by opj_j2k_read_tile_header().

◆ opj_tcd_init_encode_tile()

OPJ_BOOL opj_tcd_init_encode_tile ( opj_tcd_t * p_tcd,
OPJ_UINT32 p_tile_no,
opj_event_mgr_t * p_manager )

Initialize the tile coder and may reuse some memory.

Parameters
p_tcdTCD handle.
p_tile_nocurrent tile index to encode.
p_managerthe event manager.
Returns
true if the encoding values could be set (false otherwise).

References opj_tcd_init_tile(), and OPJ_TRUE.

Referenced by opj_j2k_pre_write_tile().

◆ opj_tcd_init_tile()

static INLINE OPJ_BOOL opj_tcd_init_tile ( opj_tcd_t * p_tcd,
OPJ_UINT32 p_tile_no,
OPJ_BOOL isEncoder,
OPJ_SIZE_T sizeof_block,
opj_event_mgr_t * manager )
static

Initializes tile coding/decoding.

References opj_tcd_resolution::bands, opj_tcd_precinct::block_size, opj_tcd_precinct::blocks, opj_tccp::cblkh, opj_tcd_precinct::cblks, opj_tccp::cblkw, opj_tcd_precinct::ch, opj_tcd_tilecomp::compno, opj_image::comps, opj_tcd_tile::comps, opj_tcd::cp, opj_tcd_precinct::cw, opj_tcd_tilecomp::data_size_needed, opj_tcd_tilecomp::data_win, opj_tcd_precinct::dec, opj_image_comp::dx, opj_image_comp::dy, opj_tcd_precinct::enc, EVT_ERROR, opj_stepsize::expn, opj_tcd::image, opj_tcd_precinct::imsbtree, opj_tcd_precinct::incltree, opj_cp::m_dec, opj_decoding_param::m_reduce, opj_cp::m_specific_param, opj_stepsize::mant, opj_tcd_tilecomp::minimum_num_resolutions, opj_tcd_resolution::numbands, opj_tcd_tile::numcomps, opj_tccp::numgbits, opj_tccp::numresolutions, opj_tcd_tilecomp::numresolutions, opj_event_msg(), OPJ_FALSE, opj_free(), opj_image_data_free(), opj_int64_ceildivpow2(), opj_int_ceildiv(), opj_int_ceildivpow2(), opj_int_floordivpow2(), opj_int_max(), opj_int_min(), opj_malloc(), opj_realloc(), opj_tcd_code_block_dec_allocate(), opj_tcd_code_block_enc_allocate(), opj_tcd_code_block_enc_allocate_data(), opj_tcd_is_band_empty(), opj_tgt_create(), opj_tgt_init(), OPJ_TRUE, opj_uint_adds(), opj_uint_max(), opj_uint_min(), opj_tcd_resolution::ph, opj_tccp::prch, opj_tccp::prcw, opj_image_comp::prec, opj_tcd_resolution::pw, opj_tccp::qmfbid, opj_image_comp::resno_decoded, opj_tcd_tilecomp::resolutions, opj_tcd_tilecomp::resolutions_size, SIZE_MAX, opj_tccp::stepsizes, opj_tcp::tccps, opj_tcd::tcd_image, opj_cp::tcps, opj_cp::tdx, opj_cp::tdy, opj_tcd_image::tiles, opj_cp::tw, opj_cp::tx0, opj_cp::ty0, opj_tcd_tilecomp::win_x0, opj_tcd_tilecomp::win_x1, opj_tcd_tilecomp::win_y0, opj_tcd_tilecomp::win_y1, opj_image::x0, opj_tcd_cblk_dec::x0, opj_tcd_cblk_enc::x0, opj_tcd_precinct::x0, opj_tcd_resolution::x0, opj_tcd_tile::x0, opj_tcd_tilecomp::x0, opj_image::x1, opj_tcd_cblk_dec::x1, opj_tcd_cblk_enc::x1, opj_tcd_precinct::x1, opj_tcd_resolution::x1, opj_tcd_tile::x1, opj_tcd_tilecomp::x1, opj_image::y0, opj_tcd_cblk_dec::y0, opj_tcd_cblk_enc::y0, opj_tcd_precinct::y0, opj_tcd_resolution::y0, opj_tcd_tile::y0, opj_tcd_tilecomp::y0, opj_image::y1, opj_tcd_cblk_dec::y1, opj_tcd_cblk_enc::y1, opj_tcd_precinct::y1, opj_tcd_resolution::y1, opj_tcd_tile::y1, and opj_tcd_tilecomp::y1.

Referenced by opj_tcd_init_decode_tile(), and opj_tcd_init_encode_tile().

◆ opj_tcd_is_band_empty()

OPJ_BOOL opj_tcd_is_band_empty ( opj_tcd_band_t * band)

Returns whether a sub-band is empty (i.e.

whether it has a null area)

Parameters
bandSub-band handle.
Returns
OPJ_TRUE whether the sub-band is empty.

References opj_tcd_band::x0, opj_tcd_band::x1, opj_tcd_band::y0, and opj_tcd_band::y1.

Referenced by opj_t1_encode_cblks(), opj_t2_encode_packet(), opj_t2_read_packet_header(), opj_tcd_init_tile(), opj_tcd_makelayer(), opj_tcd_makelayer_fixed(), and opj_tcd_rateallocate().

◆ opj_tcd_is_subband_area_of_interest()

OPJ_BOOL opj_tcd_is_subband_area_of_interest ( opj_tcd_t * tcd,
OPJ_UINT32 compno,
OPJ_UINT32 resno,
OPJ_UINT32 bandno,
OPJ_UINT32 x0,
OPJ_UINT32 y0,
OPJ_UINT32 x1,
OPJ_UINT32 y1 )

Returns whether a sub-band region contributes to the area of interest tcd->win_x0,tcd->win_y0,tcd->win_x1,tcd->win_y1.

Parameters
tcdTCD handle.
compnoComponent number
resnoResolution number
bandnoBand number (not band index, ie 0, 1, 2 or 3)
x0Upper left x in subband coordinates
y0Upper left y in subband coordinates
x1Lower right x in subband coordinates
y1Lower right y in subband coordinates
Returns
OPJ_TRUE whether the sub-band region contributes to the area of interest.

References opj_image::comps, opj_tcd_tile::comps, opj_image_comp::dx, opj_image_comp::dy, opj_tcd::image, opj_tcd_tilecomp::numresolutions, opj_uint_adds(), opj_uint_ceildiv(), opj_uint_ceildivpow2(), opj_uint_max(), opj_uint_min(), opj_tccp::qmfbid, opj_tcp::tccps, opj_tcd::tcd_image, opj_tcd::tcp, opj_tcd_image::tiles, opj_tcd::win_x0, opj_tcd::win_x1, opj_tcd::win_y0, opj_tcd::win_y1, opj_tcd_tilecomp::x0, opj_tcd_tilecomp::x1, opj_tcd_tilecomp::y0, and opj_tcd_tilecomp::y1.

Referenced by opj_t1_decode_cblks(), and opj_t2_decode_packets().

◆ opj_tcd_is_whole_tilecomp_decoding()

static OPJ_BOOL opj_tcd_is_whole_tilecomp_decoding ( opj_tcd_t * p_tcd,
OPJ_UINT32 compno )
static

Returns whether a tile component is fully decoded, taking into account p_tcd->win_* members.

Parameters
p_tcdTCD handle.
compnoComponent number
Returns
OPJ_TRUE whether the tile component is fully decoded

References opj_image::comps, opj_tcd_tile::comps, opj_image_comp::dx, opj_image_comp::dy, opj_tcd::image, opj_tcd_tilecomp::minimum_num_resolutions, opj_tcd_tilecomp::numresolutions, opj_uint_ceildiv(), opj_uint_max(), opj_uint_min(), opj_tcd::tcd_image, opj_tcd_image::tiles, opj_tcd::win_x0, opj_tcd::win_x1, opj_tcd::win_y0, opj_tcd::win_y1, opj_tcd_tilecomp::x0, opj_tcd_tilecomp::x1, opj_tcd_tilecomp::y0, and opj_tcd_tilecomp::y1.

Referenced by opj_tcd_decode_tile().

◆ opj_tcd_makelayer()

◆ opj_tcd_makelayer_fixed()

◆ opj_tcd_marker_info_create()

opj_tcd_marker_info_t * opj_tcd_marker_info_create ( OPJ_BOOL need_PLT)

Create a new opj_tcd_marker_info_t* structure.

Parameters
need_PLTWhether information is needed to generate PLT markers.

References opj_tcd_marker_info::need_PLT, and opj_calloc().

Referenced by opj_j2k_write_sod().

◆ opj_tcd_marker_info_destroy()

void opj_tcd_marker_info_destroy ( opj_tcd_marker_info_t * p_tcd_marker_info)

Destroy a previously created opj_tcd_marker_info_t* structure.

Parameters
p_tcd_marker_infoStructure to destroy

References opj_free(), and opj_tcd_marker_info::p_packet_size.

Referenced by opj_j2k_write_sod().

◆ opj_tcd_mct_decode()

◆ opj_tcd_mct_encode()

◆ opj_tcd_rate_allocate_encode()

◆ opj_tcd_rateallocate()

static 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_event_mgr_t * p_manager )
static

Rate allocation for the following methods:

  • allocation by rate/distortio (m_quality_layer_alloc_strategy == RATE_DISTORTION_RATIO)
  • allocation by fixed quality (m_quality_layer_alloc_strategy == FIXED_DISTORTION_RATIO)

References opj_tcd_resolution::bands, opj_tcd_precinct::cblks, opj_tcd_precinct::ch, opj_image::comps, opj_tcd_tile::comps, opj_tcd::cp, opj_tcd::cur_pino, opj_tcd::cur_tp_num, opj_tcd_precinct::cw, opj_tcd_tile::distolayer, opj_tcp::distoratio, opj_tcd_pass::distortiondec, opj_tcd_tile::distotile, opj_tile_info::distotile, opj_tcd_precinct::enc, EVT_INFO, FIXED_DISTORTION_RATIO, opj_tcd::image, opj_cp::m_enc, opj_encoding_param::m_quality_layer_alloc_strategy, opj_cp::m_specific_param, max(), min(), opj_tcd_resolution::numbands, opj_tcd_tile::numcomps, opj_tcp::numlayers, opj_tcd_tile::numpix, opj_tcd_tilecomp::numpix, opj_tile_info::numpix, opj_tcd_tilecomp::numresolutions, opj_event_msg(), OPJ_FALSE, OPJ_IS_CINEMA, OPJ_IS_IMF, opj_malloc(), opj_t2_create(), opj_t2_destroy(), opj_t2_encode_packets(), opj_tcd_is_band_empty(), opj_tcd_makelayer(), OPJ_TRUE, opj_uint_min(), opj_tcd_cblk_enc::passes, opj_tcd_resolution::ph, opj_image_comp::prec, opj_tcd_band::precincts, opj_tcd_resolution::pw, opj_tcd_pass::rate, RATE_DISTORTION_RATIO, opj_tcp::rates, opj_tcd_tilecomp::resolutions, opj_cp::rsiz, opj_tcd::tcd_image, opj_tcd::tcd_tileno, opj_tcd::tcp, opj_tile_info::thresh, THRESH_CALC, opj_codestream_info::tile, opj_tcd_image::tiles, opj_tcd_cblk_enc::totalpasses, opj_tcd::tp_pos, opj_tcd_cblk_enc::x0, opj_tcd_cblk_enc::x1, opj_tcd_cblk_enc::y0, and opj_tcd_cblk_enc::y1.

Referenced by opj_tcd_rate_allocate_encode().

◆ opj_tcd_rateallocate_fixed()

static void opj_tcd_rateallocate_fixed ( opj_tcd_t * tcd)
static

◆ opj_tcd_reinit_segment()

void opj_tcd_reinit_segment ( opj_tcd_seg_t * seg)

Reinitialize a segment.

Referenced by opj_t2_init_seg(), and opj_tcd_code_block_dec_allocate().

◆ opj_tcd_t1_decode()

◆ opj_tcd_t1_encode()

◆ opj_tcd_t2_decode()

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,
opj_event_mgr_t * p_manager )
static

◆ opj_tcd_t2_encode()

◆ opj_tcd_update_tile_data()