[trunk] remove old v1 functions and rename pi_initialise_encode_v2 to opj_pi_initialise_encode; pi_create_encode_v2 to opj_pi_create_decode; pi_destroy_v2 to opj_pi_destroy; pi_create_decode_v2 to opj_pi_create_decode

This commit is contained in:
Mickael Savinaud 2012-10-03 14:29:26 +00:00
parent c508923f04
commit 1b5e677d0c
3 changed files with 244 additions and 768 deletions

File diff suppressed because it is too large Load Diff

View File

@ -100,17 +100,6 @@ typedef struct opj_pi_iterator {
/** @name Exported functions */
/*@{*/
/* ----------------------------------------------------------------------- */
/**
Create a packet iterator for Encoder
@param image Raw image for which the packets will be listed
@param cp Coding parameters
@param tileno Number that identifies the tile for which to list the packets
@param t2_mode If == 0 In Threshold calculation ,If == 1 Final pass
@return Returns a packet iterator that points to the first packet of the tile
@see pi_destroy
*/
opj_pi_iterator_t *pi_initialise_encode(opj_image_t *image, opj_cp_t *cp, int tileno,J2K_T2_MODE t2_mode);
/**
* Creates a packet iterator for encoding.
*
@ -121,8 +110,8 @@ opj_pi_iterator_t *pi_initialise_encode(opj_image_t *image, opj_cp_t *cp, int ti
*
* @return a list of packet iterator that points to the first packet of the tile (not true).
*/
opj_pi_iterator_t *pi_initialise_encode_v2( const struct opj_image *image,
struct opj_cp_v2 *cp,
opj_pi_iterator_t *opj_pi_initialise_encode(const opj_image_t *image,
opj_cp_v2_t *cp,
OPJ_UINT32 tileno,
J2K_T2_MODE t2_mode);
@ -137,20 +126,6 @@ void opj_pi_update_encoding_parameters( const opj_image_t *p_image,
opj_cp_v2_t *p_cp,
OPJ_UINT32 p_tile_no );
/**
Modify the packet iterator for enabling tile part generation
@param pi Handle to the packet iterator generated in pi_initialise_encode
@param cp Coding parameters
@param tileno Number that identifies the tile for which to list the packets
@param pino Iterator index for pi
@param tpnum Tile part number of the current tile
@param tppos The position of the tile part flag in the progression order
@param t2_mode If == 0 In Threshold calculation ,If == 1 Final pass
@param cur_totnum_tp The total number of tile parts in the current tile
@return Returns true if an error is detected
*/
opj_bool pi_create_encode(opj_pi_iterator_t *pi, opj_cp_t *cp,int tileno, int pino,int tpnum, int tppos, J2K_T2_MODE t2_mode,int cur_totnum_tp);
/**
Modify the packet iterator for enabling tile part generation
@param pi Handle to the packet iterator generated in pi_initialise_encode
@ -161,7 +136,13 @@ Modify the packet iterator for enabling tile part generation
@param tppos The position of the tile part flag in the progression order
@param t2_mode FIXME DOC
*/
void pi_create_encode_v2( opj_pi_iterator_t *pi, struct opj_cp_v2 *cp,OPJ_UINT32 tileno, OPJ_UINT32 pino,OPJ_UINT32 tpnum, OPJ_INT32 tppos, J2K_T2_MODE t2_mode);
void opj_pi_create_encode( opj_pi_iterator_t *pi,
opj_cp_v2_t *cp,
OPJ_UINT32 tileno,
OPJ_UINT32 pino,
OPJ_UINT32 tpnum,
OPJ_INT32 tppos,
J2K_T2_MODE t2_mode);
/**
Create a packet iterator for Decoder
@ -169,37 +150,18 @@ Create a packet iterator for Decoder
@param cp Coding parameters
@param tileno Number that identifies the tile for which to list the packets
@return Returns a packet iterator that points to the first packet of the tile
@see pi_destroy
@see opj_pi_destroy
*/
opj_pi_iterator_t *pi_create_decode(opj_image_t * image, opj_cp_t * cp, int tileno);
/**
Create a packet iterator for Decoder
@param image Raw image for which the packets will be listed
@param cp Coding parameters
@param tileno Number that identifies the tile for which to list the packets
@return Returns a packet iterator that points to the first packet of the tile
@see pi_destroy
*/
opj_pi_iterator_t *pi_create_decode_v2(struct opj_image * image, struct opj_cp_v2 * cp, OPJ_UINT32 tileno);
/**
Destroy a packet iterator
@param pi Previously created packet iterator
@param cp Coding parameters
@param tileno Number that identifies the tile for which the packets were listed
@see pi_create
*/
void pi_destroy(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno);
opj_pi_iterator_t *opj_pi_create_decode(opj_image_t * image,
opj_cp_v2_t * cp,
OPJ_UINT32 tileno);
/**
* Destroys a packet iterator array.
*
* @param p_pi the packet iterator array to destroy.
* @param p_nb_elements the number of elements in the array.
*/
void pi_destroy_v2(
opj_pi_iterator_t *p_pi,
void opj_pi_destroy(opj_pi_iterator_t *p_pi,
OPJ_UINT32 p_nb_elements);
/**

View File

@ -215,7 +215,7 @@ opj_bool opj_t2_encode_packets( opj_t2_v2_t* p_t2,
OPJ_UINT32 l_max_comp = l_cp->m_specific_param.m_enc.m_max_comp_size > 0 ? l_image->numcomps : 1;
OPJ_UINT32 l_nb_pocs = l_tcp->numpocs + 1;
l_pi = pi_initialise_encode_v2(l_image, l_cp, p_tile_no, p_t2_mode);
l_pi = opj_pi_initialise_encode(l_image, l_cp, p_tile_no, p_t2_mode);
if (!l_pi) {
return OPJ_FALSE;
}
@ -233,14 +233,14 @@ opj_bool opj_t2_encode_packets( opj_t2_v2_t* p_t2,
OPJ_UINT32 l_tp_num = compno;
/* TODO MSD : check why this function cannot fail (cf. v1) */
pi_create_encode_v2(l_pi, l_cp,p_tile_no,poc,l_tp_num,p_tp_pos,p_t2_mode);
opj_pi_create_encode(l_pi, l_cp,p_tile_no,poc,l_tp_num,p_tp_pos,p_t2_mode);
while (opj_pi_next(l_current_pi)) {
if (l_current_pi->layno < p_maxlayers) {
l_nb_bytes = 0;
if (! opj_t2_encode_packet(p_tile_no,p_tile, l_tcp, l_current_pi, l_current_data, &l_nb_bytes, p_max_len, cstr_info)) {
pi_destroy_v2(l_pi, l_nb_pocs);
opj_pi_destroy(l_pi, l_nb_pocs);
return OPJ_FALSE;
}
@ -254,7 +254,7 @@ opj_bool opj_t2_encode_packets( opj_t2_v2_t* p_t2,
if (l_cp->m_specific_param.m_enc.m_max_comp_size) {
if (l_comp_len > l_cp->m_specific_param.m_enc.m_max_comp_size) {
pi_destroy_v2(l_pi, l_nb_pocs);
opj_pi_destroy(l_pi, l_nb_pocs);
return OPJ_FALSE;
}
}
@ -264,7 +264,7 @@ opj_bool opj_t2_encode_packets( opj_t2_v2_t* p_t2,
}
}
else { /* t2_mode == FINAL_PASS */
pi_create_encode_v2(l_pi, l_cp,p_tile_no,p_pino,p_tp_num,p_tp_pos,p_t2_mode);
opj_pi_create_encode(l_pi, l_cp,p_tile_no,p_pino,p_tp_num,p_tp_pos,p_t2_mode);
l_current_pi = &l_pi[p_pino];
@ -273,7 +273,7 @@ opj_bool opj_t2_encode_packets( opj_t2_v2_t* p_t2,
l_nb_bytes=0;
if (! opj_t2_encode_packet(p_tile_no,p_tile, l_tcp, l_current_pi, l_current_data, &l_nb_bytes, p_max_len, cstr_info)) {
pi_destroy_v2(l_pi, l_nb_pocs);
opj_pi_destroy(l_pi, l_nb_pocs);
return OPJ_FALSE;
}
@ -305,7 +305,7 @@ opj_bool opj_t2_encode_packets( opj_t2_v2_t* p_t2,
}
}
pi_destroy_v2(l_pi, l_nb_pocs);
opj_pi_destroy(l_pi, l_nb_pocs);
return OPJ_TRUE;
}
@ -340,7 +340,7 @@ opj_bool opj_t2_decode_packets( opj_t2_v2_t *p_t2,
#endif
/* create a packet iterator */
l_pi = pi_create_decode_v2(l_image, l_cp, p_tile_no);
l_pi = opj_pi_create_decode(l_image, l_cp, p_tile_no);
if (!l_pi) {
return OPJ_FALSE;
}
@ -368,7 +368,7 @@ opj_bool opj_t2_decode_packets( opj_t2_v2_t *p_t2,
first_pass_failed[l_current_pi->compno] = OPJ_FALSE;
if (! opj_t2_decode_packet(p_t2,p_tile,l_tcp,l_current_pi,l_current_data,&l_nb_bytes_read,p_max_len,l_pack_info)) {
pi_destroy_v2(l_pi,l_nb_pocs);
opj_pi_destroy(l_pi,l_nb_pocs);
return OPJ_FALSE;
}
@ -378,7 +378,7 @@ opj_bool opj_t2_decode_packets( opj_t2_v2_t *p_t2,
else {
l_nb_bytes_read = 0;
if (! opj_t2_skip_packet(p_t2,p_tile,l_tcp,l_current_pi,l_current_data,&l_nb_bytes_read,p_max_len,l_pack_info)) {
pi_destroy_v2(l_pi,l_nb_pocs);
opj_pi_destroy(l_pi,l_nb_pocs);
return OPJ_FALSE;
}
}
@ -428,7 +428,7 @@ opj_bool opj_t2_decode_packets( opj_t2_v2_t *p_t2,
/* << INDEX */
/* don't forget to release pi */
pi_destroy_v2(l_pi,l_nb_pocs);
opj_pi_destroy(l_pi,l_nb_pocs);
*p_data_read = l_current_data - p_src;
return OPJ_TRUE;
}