[trunk] [trunk] remove old opj_t2 and rename opj_t2_v2 to opj_t2

This commit is contained in:
Mickael Savinaud 2012-10-25 14:54:19 +00:00
parent 06615a556d
commit a41790ce8a
3 changed files with 24 additions and 37 deletions

View File

@ -82,7 +82,7 @@ Decode a packet of a tile from a source buffer
@return FIXME DOC @return FIXME DOC
*/ */
static opj_bool opj_t2_decode_packet( opj_t2_v2_t* t2, static opj_bool opj_t2_decode_packet( opj_t2_t* t2,
opj_tcd_tile_t *tile, opj_tcd_tile_t *tile,
opj_tcp_v2_t *tcp, opj_tcp_v2_t *tcp,
opj_pi_iterator_t *pi, opj_pi_iterator_t *pi,
@ -91,7 +91,7 @@ static opj_bool opj_t2_decode_packet( opj_t2_v2_t* t2,
OPJ_UINT32 max_length, OPJ_UINT32 max_length,
opj_packet_info_t *pack_info); opj_packet_info_t *pack_info);
static opj_bool opj_t2_skip_packet( opj_t2_v2_t* p_t2, static opj_bool opj_t2_skip_packet( opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile, opj_tcd_tile_t *p_tile,
opj_tcp_v2_t *p_tcp, opj_tcp_v2_t *p_tcp,
opj_pi_iterator_t *p_pi, opj_pi_iterator_t *p_pi,
@ -100,7 +100,7 @@ static opj_bool opj_t2_skip_packet( opj_t2_v2_t* p_t2,
OPJ_UINT32 p_max_length, OPJ_UINT32 p_max_length,
opj_packet_info_t *p_pack_info); opj_packet_info_t *p_pack_info);
static opj_bool opj_t2_read_packet_header( opj_t2_v2_t* p_t2, static opj_bool opj_t2_read_packet_header( opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile, opj_tcd_tile_t *p_tile,
opj_tcp_v2_t *p_tcp, opj_tcp_v2_t *p_tcp,
opj_pi_iterator_t *p_pi, opj_pi_iterator_t *p_pi,
@ -110,7 +110,7 @@ static opj_bool opj_t2_read_packet_header( opj_t2_v2_t* p_t2,
OPJ_UINT32 p_max_length, OPJ_UINT32 p_max_length,
opj_packet_info_t *p_pack_info); opj_packet_info_t *p_pack_info);
static opj_bool opj_t2_read_packet_data(opj_t2_v2_t* p_t2, static opj_bool opj_t2_read_packet_data(opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile, opj_tcd_tile_t *p_tile,
opj_pi_iterator_t *p_pi, opj_pi_iterator_t *p_pi,
OPJ_BYTE *p_src_data, OPJ_BYTE *p_src_data,
@ -118,7 +118,7 @@ static opj_bool opj_t2_read_packet_data(opj_t2_v2_t* p_t2,
OPJ_UINT32 p_max_length, OPJ_UINT32 p_max_length,
opj_packet_info_t *pack_info); opj_packet_info_t *pack_info);
static opj_bool opj_t2_skip_packet_data(opj_t2_v2_t* p_t2, static opj_bool opj_t2_skip_packet_data(opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile, opj_tcd_tile_t *p_tile,
opj_pi_iterator_t *p_pi, opj_pi_iterator_t *p_pi,
OPJ_UINT32 * p_data_read, OPJ_UINT32 * p_data_read,
@ -189,7 +189,7 @@ OPJ_UINT32 opj_t2_getnumpasses(opj_bio_t *bio) {
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
opj_bool opj_t2_encode_packets( opj_t2_v2_t* p_t2, opj_bool opj_t2_encode_packets( opj_t2_t* p_t2,
OPJ_UINT32 p_tile_no, OPJ_UINT32 p_tile_no,
opj_tcd_tile_t *p_tile, opj_tcd_tile_t *p_tile,
OPJ_UINT32 p_maxlayers, OPJ_UINT32 p_maxlayers,
@ -310,7 +310,7 @@ opj_bool opj_t2_encode_packets( opj_t2_v2_t* p_t2,
return OPJ_TRUE; return OPJ_TRUE;
} }
opj_bool opj_t2_decode_packets( opj_t2_v2_t *p_t2, opj_bool opj_t2_decode_packets( opj_t2_t *p_t2,
OPJ_UINT32 p_tile_no, OPJ_UINT32 p_tile_no,
opj_tcd_tile_t *p_tile, opj_tcd_tile_t *p_tile,
OPJ_BYTE *p_src, OPJ_BYTE *p_src,
@ -442,14 +442,14 @@ opj_bool opj_t2_decode_packets( opj_t2_v2_t *p_t2,
* @param p_cp Image coding parameters. * @param p_cp Image coding parameters.
* @return a new T2 handle if successful, NULL otherwise. * @return a new T2 handle if successful, NULL otherwise.
*/ */
opj_t2_v2_t* opj_t2_create(opj_image_t *p_image, opj_cp_v2_t *p_cp) opj_t2_t* opj_t2_create(opj_image_t *p_image, opj_cp_v2_t *p_cp)
{ {
/* create the t2 structure */ /* create the t2 structure */
opj_t2_v2_t *l_t2 = (opj_t2_v2_t*)opj_malloc(sizeof(opj_t2_v2_t)); opj_t2_t *l_t2 = (opj_t2_t*)opj_malloc(sizeof(opj_t2_t));
if (!l_t2) { if (!l_t2) {
return NULL; return NULL;
} }
memset(l_t2,0,sizeof(opj_t2_v2_t)); memset(l_t2,0,sizeof(opj_t2_t));
l_t2->image = p_image; l_t2->image = p_image;
l_t2->cp = p_cp; l_t2->cp = p_cp;
@ -457,13 +457,13 @@ opj_t2_v2_t* opj_t2_create(opj_image_t *p_image, opj_cp_v2_t *p_cp)
return l_t2; return l_t2;
} }
void opj_t2_destroy(opj_t2_v2_t *t2) { void opj_t2_destroy(opj_t2_t *t2) {
if(t2) { if(t2) {
opj_free(t2); opj_free(t2);
} }
} }
opj_bool opj_t2_decode_packet( opj_t2_v2_t* p_t2, opj_bool opj_t2_decode_packet( opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile, opj_tcd_tile_t *p_tile,
opj_tcp_v2_t *p_tcp, opj_tcp_v2_t *p_tcp,
opj_pi_iterator_t *p_pi, opj_pi_iterator_t *p_pi,
@ -727,7 +727,7 @@ opj_bool opj_t2_encode_packet( OPJ_UINT32 tileno,
return OPJ_TRUE; return OPJ_TRUE;
} }
static opj_bool opj_t2_skip_packet( opj_t2_v2_t* p_t2, static opj_bool opj_t2_skip_packet( opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile, opj_tcd_tile_t *p_tile,
opj_tcp_v2_t *p_tcp, opj_tcp_v2_t *p_tcp,
opj_pi_iterator_t *p_pi, opj_pi_iterator_t *p_pi,
@ -767,7 +767,7 @@ static opj_bool opj_t2_skip_packet( opj_t2_v2_t* p_t2,
opj_bool opj_t2_read_packet_header( opj_t2_v2_t* p_t2, opj_bool opj_t2_read_packet_header( opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile, opj_tcd_tile_t *p_tile,
opj_tcp_v2_t *p_tcp, opj_tcp_v2_t *p_tcp,
opj_pi_iterator_t *p_pi, opj_pi_iterator_t *p_pi,
@ -1022,7 +1022,7 @@ opj_bool opj_t2_read_packet_header( opj_t2_v2_t* p_t2,
return OPJ_TRUE; return OPJ_TRUE;
} }
opj_bool opj_t2_read_packet_data( opj_t2_v2_t* p_t2, opj_bool opj_t2_read_packet_data( opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile, opj_tcd_tile_t *p_tile,
opj_pi_iterator_t *p_pi, opj_pi_iterator_t *p_pi,
OPJ_BYTE *p_src_data, OPJ_BYTE *p_src_data,
@ -1134,7 +1134,7 @@ opj_bool opj_t2_read_packet_data( opj_t2_v2_t* p_t2,
return OPJ_TRUE; return OPJ_TRUE;
} }
opj_bool opj_t2_skip_packet_data( opj_t2_v2_t* p_t2, opj_bool opj_t2_skip_packet_data( opj_t2_t* p_t2,
opj_tcd_tile_t *p_tile, opj_tcd_tile_t *p_tile,
opj_pi_iterator_t *p_pi, opj_pi_iterator_t *p_pi,
OPJ_UINT32 * p_data_read, OPJ_UINT32 * p_data_read,

View File

@ -46,24 +46,11 @@ typedef struct opj_t2 {
/** codec context */ /** codec context */
opj_common_ptr cinfo; opj_common_ptr cinfo;
/** Encoding: pointer to the src image. Decoding: pointer to the dst image. */
opj_image_t *image;
/** pointer to the image coding parameters */
opj_cp_t *cp;
} opj_t2_t;
/**
Tier-2 coding
*/
typedef struct opj_t2_v2 {
/** codec context */
opj_common_ptr cinfo;
/** Encoding: pointer to the src image. Decoding: pointer to the dst image. */ /** Encoding: pointer to the src image. Decoding: pointer to the dst image. */
opj_image_t *image; opj_image_t *image;
/** pointer to the image coding parameters */ /** pointer to the image coding parameters */
opj_cp_v2_t *cp; opj_cp_v2_t *cp;
} opj_t2_v2_t; } opj_t2_t;
/** @name Exported functions */ /** @name Exported functions */
/*@{*/ /*@{*/
@ -84,7 +71,7 @@ Encode the packets of a tile to a destination buffer
@param pino FIXME DOC @param pino FIXME DOC
@param t2_mode If == 0 In Threshold calculation ,If == 1 Final pass @param t2_mode If == 0 In Threshold calculation ,If == 1 Final pass
*/ */
opj_bool opj_t2_encode_packets( opj_t2_v2_t* t2, opj_bool opj_t2_encode_packets( opj_t2_t* t2,
OPJ_UINT32 tileno, OPJ_UINT32 tileno,
opj_tcd_tile_t *tile, opj_tcd_tile_t *tile,
OPJ_UINT32 maxlayers, OPJ_UINT32 maxlayers,
@ -109,7 +96,7 @@ Decode the packets of a tile from a source buffer
@return FIXME DOC @return FIXME DOC
*/ */
opj_bool opj_t2_decode_packets( opj_t2_v2_t *t2, opj_bool opj_t2_decode_packets( opj_t2_t *t2,
OPJ_UINT32 tileno, OPJ_UINT32 tileno,
opj_tcd_tile_t *tile, opj_tcd_tile_t *tile,
OPJ_BYTE *src, OPJ_BYTE *src,
@ -124,13 +111,13 @@ opj_bool opj_t2_decode_packets( opj_t2_v2_t *t2,
* @param p_cp Image coding parameters. * @param p_cp Image coding parameters.
* @return a new T2 handle if successful, NULL otherwise. * @return a new T2 handle if successful, NULL otherwise.
*/ */
opj_t2_v2_t* opj_t2_create(opj_image_t *p_image, opj_cp_v2_t *p_cp); opj_t2_t* opj_t2_create(opj_image_t *p_image, opj_cp_v2_t *p_cp);
/** /**
Destroy a T2 handle Destroy a T2 handle
@param t2 T2 handle to destroy @param t2 T2 handle to destroy
*/ */
void opj_t2_destroy(opj_t2_v2_t *t2); void opj_t2_destroy(opj_t2_t *t2);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/*@}*/ /*@}*/

View File

@ -479,7 +479,7 @@ opj_bool opj_tcd_rateallocate( opj_tcd_t *tcd,
-q xx,yy,zz,0 (fixed_quality == 1 and distoratio == 0) -q xx,yy,zz,0 (fixed_quality == 1 and distoratio == 0)
==> possible to have some lossy layers and the last layer for sure lossless */ ==> possible to have some lossy layers and the last layer for sure lossless */
if ( ((cp->m_specific_param.m_enc.m_disto_alloc==1) && (tcd_tcp->rates[layno]>0)) || ((cp->m_specific_param.m_enc.m_fixed_quality==1) && (tcd_tcp->distoratio[layno]>0))) { if ( ((cp->m_specific_param.m_enc.m_disto_alloc==1) && (tcd_tcp->rates[layno]>0)) || ((cp->m_specific_param.m_enc.m_fixed_quality==1) && (tcd_tcp->distoratio[layno]>0))) {
opj_t2_v2_t*t2 = opj_t2_create(tcd->image, cp); opj_t2_t*t2 = opj_t2_create(tcd->image, cp);
OPJ_FLOAT64 thresh = 0; OPJ_FLOAT64 thresh = 0;
if (t2 == 00) { if (t2 == 00) {
@ -1462,7 +1462,7 @@ opj_bool opj_tcd_t2_decode (opj_tcd_t *p_tcd,
opj_codestream_index_t *p_cstr_index opj_codestream_index_t *p_cstr_index
) )
{ {
opj_t2_v2_t * l_t2; opj_t2_t * l_t2;
l_t2 = opj_t2_create(p_tcd->image, p_tcd->cp); l_t2 = opj_t2_create(p_tcd->image, p_tcd->cp);
if (l_t2 == 00) { if (l_t2 == 00) {
@ -1960,7 +1960,7 @@ opj_bool opj_tcd_t2_encode (opj_tcd_t *p_tcd,
OPJ_UINT32 p_max_dest_size, OPJ_UINT32 p_max_dest_size,
opj_codestream_info_t *p_cstr_info ) opj_codestream_info_t *p_cstr_info )
{ {
opj_t2_v2_t * l_t2; opj_t2_t * l_t2;
l_t2 = opj_t2_create(p_tcd->image, p_tcd->cp); l_t2 = opj_t2_create(p_tcd->image, p_tcd->cp);
if (l_t2 == 00) { if (l_t2 == 00) {