remove deprecated v1 style function tcd_create; rename tcd_create_v2 to opj_tcd_create

This commit is contained in:
Mickael Savinaud 2012-08-16 15:51:55 +00:00
parent b7473285ec
commit e6d97ce928
3 changed files with 5 additions and 28 deletions

View File

@ -4768,7 +4768,7 @@ opj_bool opj_j2k_read_eoc ( opj_j2k_v2_t *p_j2k,
l_nb_tiles = p_j2k->m_cp.th * p_j2k->m_cp.tw; l_nb_tiles = p_j2k->m_cp.th * p_j2k->m_cp.tw;
l_tcp = p_j2k->m_cp.tcps; l_tcp = p_j2k->m_cp.tcps;
l_tcd = tcd_create_v2(OPJ_TRUE); l_tcd = opj_tcd_create(OPJ_TRUE);
if (l_tcd == 00) { if (l_tcd == 00) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Cannot decode tile, memory error\n"); opj_event_msg_v2(p_manager, EVT_ERROR, "Cannot decode tile, memory error\n");
return OPJ_FALSE; return OPJ_FALSE;
@ -6999,7 +6999,7 @@ static opj_bool opj_j2k_copy_default_tcp_and_create_tcd ( opj_j2k_v2_t * p_j2k,
} }
/* Create the current tile decoder*/ /* Create the current tile decoder*/
p_j2k->m_tcd = (opj_tcd_v2_t*)tcd_create_v2(OPJ_TRUE); /* FIXME why a cast ? */ p_j2k->m_tcd = (opj_tcd_v2_t*)opj_tcd_create(OPJ_TRUE); /* FIXME why a cast ? */
if (! p_j2k->m_tcd ) { if (! p_j2k->m_tcd ) {
return OPJ_FALSE; return OPJ_FALSE;
} }
@ -10250,7 +10250,7 @@ static opj_bool opj_j2k_create_tcd( opj_j2k_v2_t *p_j2k,
assert(p_manager != 00); assert(p_manager != 00);
assert(p_stream != 00); assert(p_stream != 00);
p_j2k->m_tcd = tcd_create_v2(OPJ_FALSE); p_j2k->m_tcd = opj_tcd_create(OPJ_FALSE);
if (! p_j2k->m_tcd) { if (! p_j2k->m_tcd) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Not enough memory to create Tile Coder\n"); opj_event_msg_v2(p_manager, EVT_ERROR, "Not enough memory to create Tile Coder\n");

View File

@ -172,24 +172,7 @@ opj_bool tcd_dc_level_shift_decode (
/** /**
Create a new TCD handle Create a new TCD handle
*/ */
opj_tcd_t* tcd_create(opj_common_ptr cinfo) { opj_tcd_v2_t* opj_tcd_create(opj_bool p_is_decoder)
/* create the tcd structure */
opj_tcd_t *tcd = (opj_tcd_t*)opj_malloc(sizeof(opj_tcd_t));
if(!tcd) return NULL;
tcd->cinfo = cinfo;
tcd->tcd_image = (opj_tcd_image_t*)opj_malloc(sizeof(opj_tcd_image_t));
if(!tcd->tcd_image) {
opj_free(tcd);
return NULL;
}
return tcd;
}
/**
Create a new TCD handle
*/
opj_tcd_v2_t* tcd_create_v2(opj_bool p_is_decoder)
{ {
opj_tcd_v2_t *l_tcd = 00; opj_tcd_v2_t *l_tcd = 00;

View File

@ -347,19 +347,13 @@ typedef struct opj_tcd_v2
Dump the content of a tcd structure Dump the content of a tcd structure
*/ */
void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t *img); void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t *img);
/**
Create a new TCD handle
@param cinfo Codec context info
@return Returns a new TCD handle if successful returns NULL otherwise
*/
opj_tcd_t* tcd_create(opj_common_ptr cinfo);
/** /**
Create a new TCD handle Create a new TCD handle
@param FIXME @param FIXME
@return Returns a new TCD handle if successful returns NULL otherwise @return Returns a new TCD handle if successful returns NULL otherwise
*/ */
opj_tcd_v2_t* tcd_create_v2(opj_bool p_is_decoder); opj_tcd_v2_t* opj_tcd_create(opj_bool p_is_decoder);
/** /**
Destroy a previously created TCD handle Destroy a previously created TCD handle