remove deprecated v1 style function tcd_destroy; rename tcd_destroy_v2 to opj_tcd_destroy

rename tcd_init_v2 to opj_tcd_init 
remove deprecated v1 style function tcd_malloc_encode
remove deprecated v1 style function tcd_free_encode
remove deprecated v1 style function tcd_init_encode
remove deprecated v1 style function tcd_malloc_decode
remove deprecated v1 style function tcd_malloc_decode_tile
remove deprecated v1 style function tcd_makelayer_fixed; rename tcd_makelayer_fixed_v2 to opj_tcd_makelayer_fixed
remove deprecated v1 style function tcd_rateallocate_fixed; rename tcd_rateallocate_fixed_v2 to opj_tcd_rateallocate_fixed
remove deprecated v1 style function tcd_makelayer; rename tcd_makelayer_v2 to opj_tcd_makelayer
remove deprecated v1 style function tcd_rateallocate; rename tcd_rateallocate_v2 to opj_tcd_rateallocate
remove deprecated v1 style function tcd_encode_tile; rename tcd_encode_tile_v2 to opj_tcd_encode_tile
This commit is contained in:
Mickael Savinaud 2012-08-16 16:23:07 +00:00
parent e6d97ce928
commit dbc4c47b15
3 changed files with 39 additions and 1302 deletions

View File

@ -4278,7 +4278,7 @@ opj_bool opj_j2k_write_sod( opj_j2k_v2_t *p_j2k,
*p_data_written = 0;
if (! tcd_encode_tile_v2(p_tile_coder, p_j2k->m_current_tile_number, p_data, p_data_written, l_remaining_data , l_cstr_info)) {
if (! opj_tcd_encode_tile(p_tile_coder, p_j2k->m_current_tile_number, p_data, p_data_written, l_remaining_data , l_cstr_info)) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Cannot encode tile\n");
return OPJ_FALSE;
}
@ -4777,7 +4777,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 (! opj_tcd_init_decode_tile(l_tcd, i)) {
tcd_destroy_v2(l_tcd);
opj_tcd_destroy(l_tcd);
opj_event_msg_v2(p_manager, EVT_ERROR, "Cannot decode tile, memory error\n");
return OPJ_FALSE;
}
@ -4795,7 +4795,7 @@ opj_bool opj_j2k_read_eoc ( opj_j2k_v2_t *p_j2k,
++l_tcp;
}
tcd_destroy_v2(l_tcd);
opj_tcd_destroy(l_tcd);
return OPJ_TRUE;
}
@ -7004,8 +7004,8 @@ static opj_bool opj_j2k_copy_default_tcp_and_create_tcd ( opj_j2k_v2_t * p_j2k,
return OPJ_FALSE;
}
if ( !tcd_init_v2(p_j2k->m_tcd, l_image, &(p_j2k->m_cp)) ) {
tcd_destroy_v2(p_j2k->m_tcd);
if ( !opj_tcd_init(p_j2k->m_tcd, l_image, &(p_j2k->m_cp)) ) {
opj_tcd_destroy(p_j2k->m_tcd);
p_j2k->m_tcd = 00;
opj_event_msg_v2(p_manager, EVT_ERROR, "Cannot decode tile, memory error\n");
return OPJ_FALSE;
@ -7078,7 +7078,7 @@ void opj_j2k_destroy (opj_j2k_v2_t *p_j2k)
}
}
tcd_destroy_v2(p_j2k->m_tcd);
opj_tcd_destroy(p_j2k->m_tcd);
opj_j2k_cp_destroy(&(p_j2k->m_cp));
memset(&(p_j2k->m_cp),0,sizeof(opj_cp_v2_t));
@ -10129,7 +10129,7 @@ opj_bool opj_j2k_end_encoding( opj_j2k_v2_t *p_j2k,
assert(p_manager != 00);
assert(p_stream != 00);
tcd_destroy_v2(p_j2k->m_tcd);
opj_tcd_destroy(p_j2k->m_tcd);
p_j2k->m_tcd = 00;
if (p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer) {
@ -10257,8 +10257,8 @@ static opj_bool opj_j2k_create_tcd( opj_j2k_v2_t *p_j2k,
return OPJ_FALSE;
}
if (! tcd_init_v2(p_j2k->m_tcd,p_j2k->m_private_image,&p_j2k->m_cp)) {
tcd_destroy_v2(p_j2k->m_tcd);
if (!opj_tcd_init(p_j2k->m_tcd,p_j2k->m_private_image,&p_j2k->m_cp)) {
opj_tcd_destroy(p_j2k->m_tcd);
p_j2k->m_tcd = 00;
return OPJ_FALSE;
}

File diff suppressed because it is too large Load Diff

View File

@ -359,7 +359,7 @@ opj_tcd_v2_t* opj_tcd_create(opj_bool p_is_decoder);
Destroy a previously created TCD handle
@param tcd TCD handle to destroy
*/
void tcd_destroy_v2(opj_tcd_v2_t *tcd);
void opj_tcd_destroy(opj_tcd_v2_t *tcd);
/**
* Initialize the tile coder and may reuse some memory.
@ -369,10 +369,9 @@ void tcd_destroy_v2(opj_tcd_v2_t *tcd);
*
* @return true if the encoding values could be set (false otherwise).
*/
opj_bool tcd_init_v2( opj_tcd_v2_t *p_tcd,
opj_bool opj_tcd_init( opj_tcd_v2_t *p_tcd,
opj_image_t * p_image,
opj_cp_v2_t * p_cp
);
opj_cp_v2_t * p_cp );
/**
* Allocates memory for decoding a specific tile.
@ -385,72 +384,21 @@ opj_bool tcd_init_v2( opj_tcd_v2_t *p_tcd,
*/
opj_bool opj_tcd_init_decode_tile(opj_tcd_v2_t *p_tcd, OPJ_UINT32 p_tile_no);
/**
Destroy a previously created TCD handle
@param tcd TCD handle to destroy
*/
void tcd_destroy(opj_tcd_t *tcd);
/**
Initialize the tile coder (allocate the memory)
@param tcd TCD handle
@param image Raw image
@param cp Coding parameters
@param curtileno Number that identifies the tile that will be encoded
*/
void tcd_malloc_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno);
/**
Free the memory allocated for encoding
@param tcd TCD handle
*/
void tcd_free_encode(opj_tcd_t *tcd);
/**
Initialize the tile coder (reuses the memory allocated by tcd_malloc_encode)
@param tcd TCD handle
@param image Raw image
@param cp Coding parameters
@param curtileno Number that identifies the tile that will be encoded
*/
void tcd_init_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int curtileno);
/**
Initialize the tile decoder
@param tcd TCD handle
@param image Raw image
@param cp Coding parameters
*/
void tcd_malloc_decode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp);
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 opj_tcd_makelayer_fixed(opj_tcd_v2_t *tcd, OPJ_UINT32 layno, OPJ_UINT32 final);
void tcd_makelayer_fixed(opj_tcd_t *tcd, int layno, int final);
void tcd_makelayer_fixed_v2(opj_tcd_v2_t *tcd, OPJ_UINT32 layno, OPJ_UINT32 final);
void opj_tcd_rateallocate_fixed(opj_tcd_v2_t *tcd);
void tcd_rateallocate_fixed(opj_tcd_t *tcd);
void tcd_rateallocate_fixed_v2(opj_tcd_v2_t *tcd);
void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final);
void tcd_makelayer_v2( opj_tcd_v2_t *tcd,
void opj_tcd_makelayer( opj_tcd_v2_t *tcd,
OPJ_UINT32 layno,
OPJ_FLOAT64 thresh,
OPJ_UINT32 final);
opj_bool tcd_rateallocate(opj_tcd_t *tcd, unsigned char *dest, int len, opj_codestream_info_t *cstr_info);
opj_bool tcd_rateallocate_v2( opj_tcd_v2_t *tcd,
opj_bool opj_tcd_rateallocate( opj_tcd_v2_t *tcd,
OPJ_BYTE *dest,
OPJ_UINT32 * p_data_written,
OPJ_UINT32 len,
opj_codestream_info_t *cstr_info);
/**
Encode a tile from the raw image into a buffer
@param tcd TCD handle
@param tileno Number that identifies one of the tiles to be encoded
@param dest Destination buffer
@param len Length of destination buffer
@param cstr_info Codestream information structure
@return
*/
int tcd_encode_tile(opj_tcd_t *tcd, int tileno, unsigned char *dest, int len, opj_codestream_info_t *cstr_info);
/**
Decode a tile from a buffer into a raw image
@param tcd TCD handle
@ -483,12 +431,12 @@ OPJ_UINT32 opj_tcd_get_decoded_tile_size (opj_tcd_v2_t *p_tcd );
* @param p_cstr_info Codestream information structure
* @return true if the coding is successfull.
*/
opj_bool tcd_encode_tile_v2(opj_tcd_v2_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_bool opj_tcd_encode_tile( opj_tcd_v2_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);
/**