diff --git a/libopenjpeg/j2k.c b/libopenjpeg/j2k.c index 2dded5d0..11b4ff68 100644 --- a/libopenjpeg/j2k.c +++ b/libopenjpeg/j2k.c @@ -4776,7 +4776,7 @@ opj_bool opj_j2k_read_eoc ( opj_j2k_v2_t *p_j2k, for (i = 0; i < l_nb_tiles; ++i) { if (l_tcp->m_data) { - if (! tcd_init_decode_tile(l_tcd, i)) { + if (! opj_tcd_init_decode_tile(l_tcd, i)) { tcd_destroy_v2(l_tcd); opj_event_msg_v2(p_manager, EVT_ERROR, "Cannot decode tile, memory error\n"); return OPJ_FALSE; @@ -7464,7 +7464,7 @@ opj_bool opj_j2k_read_tile_header( opj_j2k_v2_t * p_j2k, } /*FIXME ???*/ - if (! tcd_init_decode_tile(p_j2k->m_tcd, p_j2k->m_current_tile_number)) { + if (! opj_tcd_init_decode_tile(p_j2k->m_tcd, p_j2k->m_current_tile_number)) { opj_event_msg_v2(p_manager, EVT_ERROR, "Cannot decode tile, memory error\n"); return OPJ_FALSE; } @@ -7474,7 +7474,7 @@ opj_bool opj_j2k_read_tile_header( opj_j2k_v2_t * p_j2k, *p_tile_index = p_j2k->m_current_tile_number; *p_go_on = OPJ_TRUE; - *p_data_size = tcd_get_decoded_tile_size(p_j2k->m_tcd); + *p_data_size = opj_tcd_get_decoded_tile_size(p_j2k->m_tcd); *p_tile_x0 = p_j2k->m_tcd->tcd_image->tiles->x0; *p_tile_y0 = p_j2k->m_tcd->tcd_image->tiles->y0; *p_tile_x1 = p_j2k->m_tcd->tcd_image->tiles->x1; @@ -7524,7 +7524,7 @@ opj_bool opj_j2k_decode_tile ( opj_j2k_v2_t * p_j2k, return OPJ_FALSE; } - if (! tcd_update_tile_data(p_j2k->m_tcd,p_data,p_data_size)) { + if (! opj_tcd_update_tile_data(p_j2k->m_tcd,p_data,p_data_size)) { return OPJ_FALSE; } @@ -9508,7 +9508,7 @@ opj_bool opj_j2k_encode_v2( opj_j2k_v2_t * p_j2k, return OPJ_FALSE; } - l_current_tile_size = tcd_get_encoded_tile_size(p_j2k->m_tcd); + l_current_tile_size = opj_tcd_get_encoded_tile_size(p_j2k->m_tcd); if (l_current_tile_size > l_max_tile_size) { l_current_data = (OPJ_BYTE*)opj_realloc(l_current_data,l_current_tile_size); if (! l_current_data) { @@ -9622,7 +9622,7 @@ opj_bool opj_j2k_pre_write_tile ( opj_j2k_v2_t * p_j2k, p_j2k->m_specific_param.m_encoder.m_current_poc_tile_part_number = 0; /* initialisation before tile encoding */ - if (! tcd_init_encode_tile(p_j2k->m_tcd, p_j2k->m_current_tile_number)) { + if (! opj_tcd_init_encode_tile(p_j2k->m_tcd, p_j2k->m_current_tile_number)) { return OPJ_FALSE; } @@ -9767,7 +9767,7 @@ opj_bool opj_j2k_post_write_tile ( opj_j2k_v2_t * p_j2k, l_available_data = l_tile_size; l_current_data = p_j2k->m_specific_param.m_encoder.m_encoded_tile_data; - if (! tcd_copy_tile_data(l_tcd,p_data,p_data_size)) { + if (! opj_tcd_copy_tile_data(l_tcd,p_data,p_data_size)) { opj_event_msg_v2(p_manager, EVT_ERROR, "Size mismatch between tile data and sent data." ); return OPJ_FALSE; } diff --git a/libopenjpeg/tcd.c b/libopenjpeg/tcd.c index 1476bef4..9159c9b1 100644 --- a/libopenjpeg/tcd.c +++ b/libopenjpeg/tcd.c @@ -2418,8 +2418,8 @@ opj_bool FUNCTION ( opj_tcd_v2_t *p_tcd, \ } \ -MACRO_TCD_ALLOCATE(tcd_init_encode_tile, opj_tcd_cblk_enc_v2_t, 1.f, enc, tcd_code_block_enc_allocate) -MACRO_TCD_ALLOCATE(tcd_init_decode_tile, opj_tcd_cblk_dec_v2_t, 0.5f, dec, tcd_code_block_dec_allocate) +MACRO_TCD_ALLOCATE(opj_tcd_init_encode_tile, opj_tcd_cblk_enc_v2_t, 1.f, enc, tcd_code_block_enc_allocate) +MACRO_TCD_ALLOCATE(opj_tcd_init_decode_tile, opj_tcd_cblk_dec_v2_t, 0.5f, dec, tcd_code_block_dec_allocate) #undef MACRO_TCD_ALLOCATE @@ -2488,7 +2488,7 @@ opj_bool tcd_code_block_dec_allocate (opj_tcd_cblk_dec_v2_t * p_code_block) return OPJ_TRUE; } -OPJ_UINT32 tcd_get_decoded_tile_size ( opj_tcd_v2_t *p_tcd ) +OPJ_UINT32 opj_tcd_get_decoded_tile_size ( opj_tcd_v2_t *p_tcd ) { OPJ_UINT32 i; OPJ_UINT32 l_data_size = 0; @@ -2691,11 +2691,10 @@ opj_bool tcd_decode_tile_v2( return OPJ_TRUE; } -opj_bool tcd_update_tile_data ( - opj_tcd_v2_t *p_tcd, - OPJ_BYTE * p_dest, - OPJ_UINT32 p_dest_length - ) +opj_bool opj_tcd_update_tile_data ( opj_tcd_v2_t *p_tcd, + OPJ_BYTE * p_dest, + OPJ_UINT32 p_dest_length + ) { OPJ_UINT32 i,j,k,l_data_size = 0; opj_image_comp_t * l_img_comp = 00; @@ -2704,7 +2703,7 @@ opj_bool tcd_update_tile_data ( OPJ_UINT32 l_size_comp, l_remaining; OPJ_UINT32 l_stride, l_width,l_height; - l_data_size = tcd_get_decoded_tile_size(p_tcd); + l_data_size = opj_tcd_get_decoded_tile_size(p_tcd); if (l_data_size > p_dest_length) { return OPJ_FALSE; } @@ -3198,7 +3197,7 @@ void tcd_code_block_enc_deallocate (opj_tcd_precinct_v2_t * p_precinct) } } -OPJ_UINT32 tcd_get_encoded_tile_size ( opj_tcd_v2_t *p_tcd ) +OPJ_UINT32 opj_tcd_get_encoded_tile_size ( opj_tcd_v2_t *p_tcd ) { OPJ_UINT32 i,l_data_size = 0; opj_image_comp_t * l_img_comp = 00; @@ -3450,9 +3449,9 @@ opj_bool tcd_rate_allocate_encode( opj_tcd_v2_t *p_tcd, } -opj_bool tcd_copy_tile_data ( opj_tcd_v2_t *p_tcd, - OPJ_BYTE * p_src, - OPJ_UINT32 p_src_length ) +opj_bool opj_tcd_copy_tile_data ( opj_tcd_v2_t *p_tcd, + OPJ_BYTE * p_src, + OPJ_UINT32 p_src_length ) { OPJ_UINT32 i,j,l_data_size = 0; opj_image_comp_t * l_img_comp = 00; @@ -3460,7 +3459,7 @@ opj_bool tcd_copy_tile_data ( opj_tcd_v2_t *p_tcd, OPJ_UINT32 l_size_comp, l_remaining; OPJ_UINT32 l_nb_elem; - l_data_size = tcd_get_encoded_tile_size(p_tcd); + l_data_size = opj_tcd_get_encoded_tile_size(p_tcd); if (l_data_size != p_src_length) { return OPJ_FALSE; } diff --git a/libopenjpeg/tcd.h b/libopenjpeg/tcd.h index bd2fe69e..cbcfba46 100644 --- a/libopenjpeg/tcd.h +++ b/libopenjpeg/tcd.h @@ -310,9 +310,6 @@ typedef struct opj_tcd { } opj_tcd_t; -struct opj_image; -struct opj_cp_v2; -struct opj_tcp_v2; /** Tile coder/decoder */ @@ -333,9 +330,9 @@ typedef struct opj_tcd_v2 /** image header */ opj_image_t *image; /** coding parameters */ - struct opj_cp_v2 *cp; + opj_cp_v2_t *cp; /** coding/decoding parameters common to all tiles */ - struct opj_tcp_v2 *tcp; + opj_tcp_v2_t *tcp; /** current encoded/decoded tile */ OPJ_UINT32 tcd_tileno; /** tell if the tcd is a decoder. */ @@ -392,10 +389,7 @@ opj_bool tcd_init_v2( opj_tcd_v2_t *p_tcd, * * @return true if the remaining data is sufficient. */ -opj_bool tcd_init_decode_tile( - opj_tcd_v2_t *p_tcd, - OPJ_UINT32 p_tile_no - ); +opj_bool opj_tcd_init_decode_tile(opj_tcd_v2_t *p_tcd, OPJ_UINT32 p_tile_no); /** Destroy a previously created TCD handle @@ -483,9 +477,7 @@ void tcd_free_decode_tile(opj_tcd_t *tcd, int tileno); /** * Gets the maximum tile size that will be taken by the tile once decoded. */ -OPJ_UINT32 tcd_get_decoded_tile_size ( - opj_tcd_v2_t *p_tcd - ); +OPJ_UINT32 opj_tcd_get_decoded_tile_size (opj_tcd_v2_t *p_tcd ); /** * Encodes a tile from the raw image into the given buffer. @@ -522,14 +514,14 @@ opj_bool tcd_decode_tile_v2(opj_tcd_v2_t *tcd, /** * Copies tile data from the system onto the given memory block. */ -opj_bool tcd_update_tile_data ( opj_tcd_v2_t *p_tcd, - OPJ_BYTE * p_dest, - OPJ_UINT32 p_dest_length ); +opj_bool opj_tcd_update_tile_data ( opj_tcd_v2_t *p_tcd, + OPJ_BYTE * p_dest, + OPJ_UINT32 p_dest_length ); /** * */ -OPJ_UINT32 tcd_get_encoded_tile_size ( opj_tcd_v2_t *p_tcd ); +OPJ_UINT32 opj_tcd_get_encoded_tile_size ( opj_tcd_v2_t *p_tcd ); /** * Initialize the tile coder and may reuse some meory. @@ -540,15 +532,15 @@ OPJ_UINT32 tcd_get_encoded_tile_size ( opj_tcd_v2_t *p_tcd ); * * @return true if the encoding values could be set (false otherwise). */ -opj_bool tcd_init_encode_tile ( opj_tcd_v2_t *p_tcd, - OPJ_UINT32 p_tile_no ); +opj_bool opj_tcd_init_encode_tile ( opj_tcd_v2_t *p_tcd, + OPJ_UINT32 p_tile_no ); /** * Copies tile data from the given memory block onto the system. */ -opj_bool tcd_copy_tile_data (opj_tcd_v2_t *p_tcd, - OPJ_BYTE * p_src, - OPJ_UINT32 p_src_length ); +opj_bool opj_tcd_copy_tile_data (opj_tcd_v2_t *p_tcd, + OPJ_BYTE * p_src, + OPJ_UINT32 p_src_length ); /* ----------------------------------------------------------------------- */ /*@}*/