[trunk] Fix a bunch of warning about C++ comments in C code.

This commit is contained in:
Mathieu Malaterre 2012-03-02 15:53:14 +00:00
parent b9e216ac6f
commit 4a2673772a
15 changed files with 180 additions and 190 deletions

View File

@ -971,11 +971,11 @@ static void v4dwt_decode(v4dwt_t* restrict dwt){
} }
// KEEP TRUNK VERSION + return type of v2 because rev557 /* KEEP TRUNK VERSION + return type of v2 because rev557 */
/* <summary> */ /* <summary> */
/* Inverse 9-7 wavelet transform in 2-D. */ /* Inverse 9-7 wavelet transform in 2-D. */
/* </summary> */ /* </summary> */
// V1 void dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, int numres){ /* V1 void dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, int numres){ */
opj_bool dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, int numres){ opj_bool dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, int numres){
v4dwt_t h; v4dwt_t h;
v4dwt_t v; v4dwt_t v;

View File

@ -94,7 +94,7 @@ Apply an irreversible inverse DWT transform to a component of an image.
@param tilec Tile component information (current tile) @param tilec Tile component information (current tile)
@param numres Number of resolution levels to decode @param numres Number of resolution levels to decode
*/ */
// V1 void dwt_decode_real(opj_tcd_tilecomp_t* tilec, int numres); /* V1 void dwt_decode_real(opj_tcd_tilecomp_t* tilec, int numres); */
opj_bool dwt_decode_real(opj_tcd_tilecomp_t* tilec, int numres); opj_bool dwt_decode_real(opj_tcd_tilecomp_t* tilec, int numres);
opj_bool dwt_decode_real_v2(opj_tcd_tilecomp_v2_t* restrict tilec, OPJ_UINT32 numres); opj_bool dwt_decode_real_v2(opj_tcd_tilecomp_v2_t* restrict tilec, OPJ_UINT32 numres);

View File

@ -37,7 +37,7 @@
/** @defgroup validation validation procedure*/ /** @defgroup validation validation procedure*/
/*@{*/ /*@{*/
//#include "openjpeg.h" /*#include "openjpeg.h" */
/************************************************************************************************** /**************************************************************************************************
***************************************** FORWARD DECLARATION ************************************ ***************************************** FORWARD DECLARATION ************************************
**************************************************************************************************/ **************************************************************************************************/

View File

@ -907,7 +907,7 @@ const opj_dec_memory_marker_handler_t j2k_memory_marker_handler_tab [] =
{J2K_MS_SEC, J2K_DEC_STATE_MH, j2k_read_sec}, {J2K_MS_SEC, J2K_DEC_STATE_MH, j2k_read_sec},
{J2K_MS_INSEC, 0, j2k_read_insec} {J2K_MS_INSEC, 0, j2k_read_insec}
#endif /* USE_JPSEC */ #endif /* USE_JPSEC */
{J2K_MS_UNK, J2K_STATE_MH | J2K_STATE_TPH, 0}//j2k_read_unk_v2} {J2K_MS_UNK, J2K_STATE_MH | J2K_STATE_TPH, 0}/*j2k_read_unk_v2}*/
}; };
@ -1525,7 +1525,7 @@ opj_bool j2k_read_siz_v2 (
opj_image_comp_t * l_img_comp = 00; opj_image_comp_t * l_img_comp = 00;
opj_tcp_v2_t * l_current_tile_param = 00; opj_tcp_v2_t * l_current_tile_param = 00;
// preconditions /* preconditions */
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_manager != 00); assert(p_manager != 00);
assert(p_header_data != 00); assert(p_header_data != 00);
@ -1533,7 +1533,7 @@ opj_bool j2k_read_siz_v2 (
l_image = p_j2k->m_private_image; l_image = p_j2k->m_private_image;
l_cp = &(p_j2k->m_cp); l_cp = &(p_j2k->m_cp);
// minimum size == 39 - 3 (= minimum component parameter) /* minimum size == 39 - 3 (= minimum component parameter) */
if (p_header_size < 36) { if (p_header_size < 36) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Error with SIZ marker size\n"); opj_event_msg_v2(p_manager, EVT_ERROR, "Error with SIZ marker size\n");
return OPJ_FALSE; return OPJ_FALSE;
@ -1624,7 +1624,7 @@ opj_bool j2k_read_siz_v2 (
} }
#endif /* USE_JPWL */ #endif /* USE_JPWL */
// Allocate the resulting image components /* Allocate the resulting image components */
l_image->comps = (opj_image_comp_t*) opj_calloc(l_image->numcomps, sizeof(opj_image_comp_t)); l_image->comps = (opj_image_comp_t*) opj_calloc(l_image->numcomps, sizeof(opj_image_comp_t));
if (l_image->comps == 00){ if (l_image->comps == 00){
l_image->numcomps = 0; l_image->numcomps = 0;
@ -1635,7 +1635,7 @@ opj_bool j2k_read_siz_v2 (
memset(l_image->comps,0,l_image->numcomps * sizeof(opj_image_comp_t)); memset(l_image->comps,0,l_image->numcomps * sizeof(opj_image_comp_t));
l_img_comp = l_image->comps; l_img_comp = l_image->comps;
// Read the component information /* Read the component information */
for (i = 0; i < l_image->numcomps; ++i){ for (i = 0; i < l_image->numcomps; ++i){
OPJ_UINT32 tmp; OPJ_UINT32 tmp;
opj_read_bytes(p_header_data,&tmp,1); /* Ssiz_i */ opj_read_bytes(p_header_data,&tmp,1); /* Ssiz_i */
@ -1644,10 +1644,10 @@ opj_bool j2k_read_siz_v2 (
l_img_comp->sgnd = tmp >> 7; l_img_comp->sgnd = tmp >> 7;
opj_read_bytes(p_header_data,&tmp,1); /* XRsiz_i */ opj_read_bytes(p_header_data,&tmp,1); /* XRsiz_i */
++p_header_data; ++p_header_data;
l_img_comp->dx = (OPJ_INT32)tmp; // should be between 1 and 255 l_img_comp->dx = (OPJ_INT32)tmp; /* should be between 1 and 255 */
opj_read_bytes(p_header_data,&tmp,1); /* YRsiz_i */ opj_read_bytes(p_header_data,&tmp,1); /* YRsiz_i */
++p_header_data; ++p_header_data;
l_img_comp->dy = (OPJ_INT32)tmp; // should be between 1 and 255 l_img_comp->dy = (OPJ_INT32)tmp; /* should be between 1 and 255 */
#ifdef USE_JPWL #ifdef USE_JPWL
if (l_cp->correct) { if (l_cp->correct) {
@ -1681,12 +1681,12 @@ opj_bool j2k_read_siz_v2 (
++l_img_comp; ++l_img_comp;
} }
// Compute the number of tiles /* Compute the number of tiles */
l_cp->tw = int_ceildiv(l_image->x1 - l_cp->tx0, l_cp->tdx); l_cp->tw = int_ceildiv(l_image->x1 - l_cp->tx0, l_cp->tdx);
l_cp->th = int_ceildiv(l_image->y1 - l_cp->ty0, l_cp->tdy); l_cp->th = int_ceildiv(l_image->y1 - l_cp->ty0, l_cp->tdy);
l_nb_tiles = l_cp->tw * l_cp->th; l_nb_tiles = l_cp->tw * l_cp->th;
// Define the tiles which will be decoded /* Define the tiles which will be decoded */
if (p_j2k->m_specific_param.m_decoder.m_discard_tiles) { if (p_j2k->m_specific_param.m_decoder.m_discard_tiles) {
p_j2k->m_specific_param.m_decoder.m_start_tile_x = (p_j2k->m_specific_param.m_decoder.m_start_tile_x - l_cp->tx0) / l_cp->tdx; p_j2k->m_specific_param.m_decoder.m_start_tile_x = (p_j2k->m_specific_param.m_decoder.m_start_tile_x - l_cp->tx0) / l_cp->tdx;
p_j2k->m_specific_param.m_decoder.m_start_tile_y = (p_j2k->m_specific_param.m_decoder.m_start_tile_y - l_cp->ty0) / l_cp->tdy; p_j2k->m_specific_param.m_decoder.m_start_tile_y = (p_j2k->m_specific_param.m_decoder.m_start_tile_y - l_cp->ty0) / l_cp->tdy;
@ -1809,7 +1809,7 @@ opj_bool j2k_read_siz_v2 (
++l_current_tile_param; ++l_current_tile_param;
} }
p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_MH; // FIXME J2K_DEC_STATE_MH; p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_MH; /* FIXME J2K_DEC_STATE_MH; */
opj_image_comp_header_update(l_image,l_cp); opj_image_comp_header_update(l_image,l_cp);
return OPJ_TRUE; return OPJ_TRUE;
@ -1866,7 +1866,7 @@ opj_bool j2k_read_com_v2 (
struct opj_event_mgr * p_manager struct opj_event_mgr * p_manager
) )
{ {
// preconditions /* preconditions */
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_manager != 00); assert(p_manager != 00);
assert(p_header_data != 00); assert(p_header_data != 00);
@ -2018,7 +2018,7 @@ opj_bool j2k_read_cod_v2 (
struct opj_event_mgr * p_manager struct opj_event_mgr * p_manager
) )
{ {
// loop /* loop */
OPJ_UINT32 i; OPJ_UINT32 i;
OPJ_UINT32 l_tmp; OPJ_UINT32 l_tmp;
opj_cp_v2_t *l_cp = 00; opj_cp_v2_t *l_cp = 00;
@ -2052,7 +2052,7 @@ opj_bool j2k_read_cod_v2 (
opj_read_bytes(p_header_data,&l_tcp->numlayers,2); /* SGcod (B) */ opj_read_bytes(p_header_data,&l_tcp->numlayers,2); /* SGcod (B) */
p_header_data+=2; p_header_data+=2;
// If user didn't set a number layer to decode take the max specify in the codestream. /* If user didn't set a number layer to decode take the max specify in the codestream. */
if (l_cp->m_specific_param.m_dec.m_layer) { if (l_cp->m_specific_param.m_dec.m_layer) {
l_tcp->num_layers_to_decode = l_cp->m_specific_param.m_dec.m_layer; l_tcp->num_layers_to_decode = l_cp->m_specific_param.m_dec.m_layer;
} }
@ -2084,7 +2084,7 @@ opj_bool j2k_read_cod_v2 (
/* Index */ /* Index */
#ifdef WIP_REMOVE_MSD #ifdef WIP_REMOVE_MSD
if (p_j2k->cstr_info) { if (p_j2k->cstr_info) {
//opj_codestream_info_t *l_cstr_info = p_j2k->cstr_info; /*opj_codestream_info_t *l_cstr_info = p_j2k->cstr_info;*/
p_j2k->cstr_info->prog = l_tcp->prg; p_j2k->cstr_info->prog = l_tcp->prg;
p_j2k->cstr_info->numlayers = l_tcp->numlayers; p_j2k->cstr_info->numlayers = l_tcp->numlayers;
p_j2k->cstr_info->numdecompos = (OPJ_INT32*) opj_malloc(l_image->numcomps * sizeof(OPJ_UINT32)); p_j2k->cstr_info->numdecompos = (OPJ_INT32*) opj_malloc(l_image->numcomps * sizeof(OPJ_UINT32));
@ -2151,7 +2151,7 @@ opj_bool j2k_read_coc_v2 (
OPJ_UINT32 l_comp_room; OPJ_UINT32 l_comp_room;
OPJ_UINT32 l_comp_no; OPJ_UINT32 l_comp_no;
// preconditions /* preconditions */
assert(p_header_data != 00); assert(p_header_data != 00);
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -2164,7 +2164,7 @@ opj_bool j2k_read_coc_v2 (
l_comp_room = l_image->numcomps <= 256 ? 1 : 2; l_comp_room = l_image->numcomps <= 256 ? 1 : 2;
// make sure room is sufficient /* make sure room is sufficient*/
if (p_header_size < l_comp_room + 1) { if (p_header_size < l_comp_room + 1) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Error reading COC marker\n"); opj_event_msg_v2(p_manager, EVT_ERROR, "Error reading COC marker\n");
return OPJ_FALSE; return OPJ_FALSE;
@ -2658,7 +2658,7 @@ opj_bool j2k_read_crg_v2 (
) )
{ {
OPJ_UINT32 l_nb_comp; OPJ_UINT32 l_nb_comp;
// preconditions /* preconditions */
assert(p_header_data != 00); assert(p_header_data != 00);
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -2717,7 +2717,7 @@ opj_bool j2k_read_tlm_v2 (
) )
{ {
OPJ_UINT32 l_Ztlm, l_Stlm, l_ST, l_SP, l_tot_num_tp, l_tot_num_tp_remaining, l_quotient, l_Ptlm_size; OPJ_UINT32 l_Ztlm, l_Stlm, l_ST, l_SP, l_tot_num_tp, l_tot_num_tp_remaining, l_quotient, l_Ptlm_size;
// preconditions /* preconditions */
assert(p_header_data != 00); assert(p_header_data != 00);
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -2799,7 +2799,7 @@ opj_bool j2k_read_plm_v2 (
struct opj_event_mgr * p_manager struct opj_event_mgr * p_manager
) )
{ {
// preconditions /* preconditions */
assert(p_header_data != 00); assert(p_header_data != 00);
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -2889,7 +2889,7 @@ opj_bool j2k_read_plt_v2 (
{ {
OPJ_UINT32 l_Zplt, l_tmp, l_packet_len = 0, i; OPJ_UINT32 l_Zplt, l_tmp, l_packet_len = 0, i;
// preconditions /* preconditions */
assert(p_header_data != 00); assert(p_header_data != 00);
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -2906,13 +2906,13 @@ opj_bool j2k_read_plt_v2 (
for (i = 0; i < p_header_size; ++i) { for (i = 0; i < p_header_size; ++i) {
opj_read_bytes(p_header_data,&l_tmp,1); /* Iplt_ij */ opj_read_bytes(p_header_data,&l_tmp,1); /* Iplt_ij */
++p_header_data; ++p_header_data;
// take only the last seven bytes /* take only the last seven bytes */
l_packet_len |= (l_tmp & 0x7f); l_packet_len |= (l_tmp & 0x7f);
if (l_tmp & 0x80) { if (l_tmp & 0x80) {
l_packet_len <<= 7; l_packet_len <<= 7;
} }
else { else {
// store packet length and proceed to next packet /* store packet length and proceed to next packet */
l_packet_len = 0; l_packet_len = 0;
} }
} }
@ -3001,7 +3001,7 @@ opj_bool j2k_read_ppm_v2 (
opj_cp_v2_t *l_cp = 00; opj_cp_v2_t *l_cp = 00;
OPJ_UINT32 l_remaining_data, l_Z_ppm, l_N_ppm; OPJ_UINT32 l_remaining_data, l_Z_ppm, l_N_ppm;
// preconditions /* preconditions */
assert(p_header_data != 00); assert(p_header_data != 00);
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -3018,7 +3018,7 @@ opj_bool j2k_read_ppm_v2 (
++p_header_data; ++p_header_data;
--p_header_size; --p_header_size;
// First PPM marker /* First PPM marker */
if (l_Z_ppm == 0) { if (l_Z_ppm == 0) {
if (p_header_size < 4) { if (p_header_size < 4) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Error reading PPM marker\n"); opj_event_msg_v2(p_manager, EVT_ERROR, "Error reading PPM marker\n");
@ -3046,7 +3046,7 @@ opj_bool j2k_read_ppm_v2 (
while (1) { while (1) {
if (l_cp->ppm_data_size == l_cp->ppm_len) { if (l_cp->ppm_data_size == l_cp->ppm_len) {
if (p_header_size >= 4) { if (p_header_size >= 4) {
// read a N_ppm /* read a N_ppm */
opj_read_bytes(p_header_data,&l_N_ppm,4); /* N_ppm */ opj_read_bytes(p_header_data,&l_N_ppm,4); /* N_ppm */
p_header_data+=4; p_header_data+=4;
p_header_size-=4; p_header_size-=4;
@ -3107,12 +3107,12 @@ opj_bool j2k_read_ppm_v3 (
opj_cp_v2_t *l_cp = 00; opj_cp_v2_t *l_cp = 00;
OPJ_UINT32 l_remaining_data, l_Z_ppm, l_N_ppm; OPJ_UINT32 l_remaining_data, l_Z_ppm, l_N_ppm;
// preconditions /* preconditions */
assert(p_header_data != 00); assert(p_header_data != 00);
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_manager != 00); assert(p_manager != 00);
// Minimum size of PPM marker is equal to the size of Zppm element /* Minimum size of PPM marker is equal to the size of Zppm element */
if (p_header_size < 1) { if (p_header_size < 1) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Error reading PPM marker\n"); opj_event_msg_v2(p_manager, EVT_ERROR, "Error reading PPM marker\n");
return OPJ_FALSE; return OPJ_FALSE;
@ -3125,9 +3125,9 @@ opj_bool j2k_read_ppm_v3 (
++p_header_data; ++p_header_data;
--p_header_size; --p_header_size;
// First PPM marker /* First PPM marker */
if (l_Z_ppm == 0) { if (l_Z_ppm == 0) {
// We need now at least the Nppm^0 element /* We need now at least the Nppm^0 element */
if (p_header_size < 4) { if (p_header_size < 4) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Error reading PPM marker\n"); opj_event_msg_v2(p_manager, EVT_ERROR, "Error reading PPM marker\n");
return OPJ_FALSE; return OPJ_FALSE;
@ -3150,7 +3150,7 @@ opj_bool j2k_read_ppm_v3 (
l_cp->ppm_data_current = l_cp->ppm_data; l_cp->ppm_data_current = l_cp->ppm_data;
//l_cp->ppm_data = l_cp->ppm_buffer; /*l_cp->ppm_data = l_cp->ppm_buffer;*/
} }
else { else {
if (p_header_size < 4) { if (p_header_size < 4) {
@ -3158,9 +3158,9 @@ opj_bool j2k_read_ppm_v3 (
return OPJ_TRUE; return OPJ_TRUE;
} }
else { else {
// Uncompleted Ippm series in the previous PPM marker? /* Uncompleted Ippm series in the previous PPM marker?*/
if (l_cp->ppm_data_read < l_cp->ppm_len) { if (l_cp->ppm_data_read < l_cp->ppm_len) {
// Get the place where add the remaining Ippm series /* Get the place where add the remaining Ippm series*/
l_cp->ppm_data_current = &(l_cp->ppm_data[l_cp->ppm_data_read]); l_cp->ppm_data_current = &(l_cp->ppm_data[l_cp->ppm_data_read]);
l_N_ppm = l_cp->ppm_len - l_cp->ppm_data_read; l_N_ppm = l_cp->ppm_len - l_cp->ppm_data_read;
} }
@ -3169,10 +3169,10 @@ opj_bool j2k_read_ppm_v3 (
p_header_data+=4; p_header_data+=4;
p_header_size-=4; p_header_size-=4;
// Increase the size of ppm_data to add the new Ippm series /* Increase the size of ppm_data to add the new Ippm series*/
l_cp->ppm_data = (OPJ_BYTE *) opj_realloc(l_cp->ppm_data, l_cp->ppm_len + l_N_ppm); l_cp->ppm_data = (OPJ_BYTE *) opj_realloc(l_cp->ppm_data, l_cp->ppm_len + l_N_ppm);
// Keep the position of the place where concatenate the new series /* Keep the position of the place where concatenate the new series*/
l_cp->ppm_data_current = &(l_cp->ppm_data[l_cp->ppm_len]); l_cp->ppm_data_current = &(l_cp->ppm_data[l_cp->ppm_len]);
l_cp->ppm_len += l_N_ppm; l_cp->ppm_len += l_N_ppm;
} }
@ -3182,12 +3182,12 @@ opj_bool j2k_read_ppm_v3 (
l_remaining_data = p_header_size; l_remaining_data = p_header_size;
while (l_remaining_data >= l_N_ppm) { while (l_remaining_data >= l_N_ppm) {
// read a complete Ippm series /* read a complete Ippm series*/
memcpy(l_cp->ppm_data_current, p_header_data, l_N_ppm); memcpy(l_cp->ppm_data_current, p_header_data, l_N_ppm);
p_header_size -= l_N_ppm; p_header_size -= l_N_ppm;
p_header_data += l_N_ppm; p_header_data += l_N_ppm;
l_cp->ppm_data_read += l_N_ppm; // Increase the number of data read l_cp->ppm_data_read += l_N_ppm; /* Increase the number of data read*/
if (p_header_size) if (p_header_size)
{ {
@ -3202,39 +3202,39 @@ opj_bool j2k_read_ppm_v3 (
l_remaining_data = p_header_size; l_remaining_data = p_header_size;
// Next Ippm series is a complete series ? /* Next Ippm series is a complete series ?*/
if (l_remaining_data > l_N_ppm) { if (l_remaining_data > l_N_ppm) {
// Increase the size of ppm_data to add the new Ippm series /* Increase the size of ppm_data to add the new Ippm series*/
l_cp->ppm_data = (OPJ_BYTE *) opj_realloc(l_cp->ppm_data, l_cp->ppm_len + l_N_ppm); l_cp->ppm_data = (OPJ_BYTE *) opj_realloc(l_cp->ppm_data, l_cp->ppm_len + l_N_ppm);
// Keep the position of the place where concatenate the new series /* Keep the position of the place where concatenate the new series */
l_cp->ppm_data_current = &(l_cp->ppm_data[l_cp->ppm_len]); l_cp->ppm_data_current = &(l_cp->ppm_data[l_cp->ppm_len]);
l_cp->ppm_len += l_N_ppm; l_cp->ppm_len += l_N_ppm;
} }
} }
// Need to read an incomplete Ippm series /* Need to read an incomplete Ippm series*/
if (l_remaining_data) { if (l_remaining_data) {
l_cp->ppm_data = (OPJ_BYTE *) opj_realloc(l_cp->ppm_data, l_cp->ppm_len + l_N_ppm); l_cp->ppm_data = (OPJ_BYTE *) opj_realloc(l_cp->ppm_data, l_cp->ppm_len + l_N_ppm);
// Keep the position of the place where concatenate the new series /* Keep the position of the place where concatenate the new series*/
l_cp->ppm_data_current = &(l_cp->ppm_data[l_cp->ppm_len]); l_cp->ppm_data_current = &(l_cp->ppm_data[l_cp->ppm_len]);
l_cp->ppm_len += l_N_ppm; l_cp->ppm_len += l_N_ppm;
// Read incomplete Ippm series /* Read incomplete Ippm series*/
memcpy(l_cp->ppm_data_current, p_header_data, l_remaining_data); memcpy(l_cp->ppm_data_current, p_header_data, l_remaining_data);
p_header_size -= l_remaining_data; p_header_size -= l_remaining_data;
p_header_data += l_remaining_data; p_header_data += l_remaining_data;
l_cp->ppm_data_read += l_remaining_data; // Increase the number of data read l_cp->ppm_data_read += l_remaining_data; /* Increase the number of data read*/
} }
#ifdef CLEAN_MSD #ifdef CLEAN_MSD
if (l_cp->ppm_data_size == l_cp->ppm_len) { if (l_cp->ppm_data_size == l_cp->ppm_len) {
if (p_header_size >= 4) { if (p_header_size >= 4) {
// read a N_ppm /* read a N_ppm*/
opj_read_bytes(p_header_data,&l_N_ppm,4); /* N_ppm */ opj_read_bytes(p_header_data,&l_N_ppm,4); /* N_ppm */
p_header_data+=4; p_header_data+=4;
p_header_size-=4; p_header_size-=4;
@ -3929,10 +3929,10 @@ opj_bool j2k_read_sod_v2 (
l_tcp = &(p_j2k->m_cp.tcps[p_j2k->m_current_tile_number]); l_tcp = &(p_j2k->m_cp.tcps[p_j2k->m_current_tile_number]);
if (p_j2k->m_specific_param.m_decoder.m_last_tile_part) { if (p_j2k->m_specific_param.m_decoder.m_last_tile_part) {
// opj_stream_get_number_byte_left returns OPJ_OFF_T /* opj_stream_get_number_byte_left returns OPJ_OFF_T
// but we are in the last tile part, // but we are in the last tile part,
// so its result will fit on OPJ_UINT32 unless we find // so its result will fit on OPJ_UINT32 unless we find
// a file with a single tile part of more than 4 GB... // a file with a single tile part of more than 4 GB...*/
p_j2k->m_specific_param.m_decoder.m_sot_length = (OPJ_UINT32)(opj_stream_get_number_byte_left(p_stream) - 2); p_j2k->m_specific_param.m_decoder.m_sot_length = (OPJ_UINT32)(opj_stream_get_number_byte_left(p_stream) - 2);
} }
else else
@ -4070,7 +4070,7 @@ opj_bool j2k_read_rgn_v2 (
opj_tcp_v2_t *l_tcp = 00; opj_tcp_v2_t *l_tcp = 00;
OPJ_UINT32 l_comp_room, l_comp_no, l_roi_sty; OPJ_UINT32 l_comp_room, l_comp_no, l_roi_sty;
// preconditions /* preconditions*/
assert(p_header_data != 00); assert(p_header_data != 00);
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -4339,7 +4339,7 @@ opj_bool j2k_read_unk_v2 ( opj_j2k_v2_t *p_j2k,
const opj_dec_memory_marker_handler_t * l_marker_handler; const opj_dec_memory_marker_handler_t * l_marker_handler;
OPJ_UINT32 l_size_unk = 2; OPJ_UINT32 l_size_unk = 2;
// preconditions /* preconditions*/
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_manager != 00); assert(p_manager != 00);
assert(p_stream != 00); assert(p_stream != 00);
@ -4347,18 +4347,18 @@ opj_bool j2k_read_unk_v2 ( opj_j2k_v2_t *p_j2k,
opj_event_msg_v2(p_manager, EVT_WARNING, "Unknown marker\n"); opj_event_msg_v2(p_manager, EVT_WARNING, "Unknown marker\n");
while(1) { while(1) {
// Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer /* Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer*/
if (opj_stream_read_data(p_stream,p_j2k->m_specific_param.m_decoder.m_header_data,2,p_manager) != 2) { if (opj_stream_read_data(p_stream,p_j2k->m_specific_param.m_decoder.m_header_data,2,p_manager) != 2) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Stream too short\n"); opj_event_msg_v2(p_manager, EVT_ERROR, "Stream too short\n");
return OPJ_FALSE; return OPJ_FALSE;
} }
// read 2 bytes as the new marker ID /* read 2 bytes as the new marker ID*/
opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,&l_unknown_marker,2); opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,&l_unknown_marker,2);
if (!(l_unknown_marker < 0xff00)) { if (!(l_unknown_marker < 0xff00)) {
// Get the marker handler from the marker ID /* Get the marker handler from the marker ID*/
l_marker_handler = j2k_get_marker_handler(l_unknown_marker); l_marker_handler = j2k_get_marker_handler(l_unknown_marker);
if (!(p_j2k->m_specific_param.m_decoder.m_state & l_marker_handler->states)) { if (!(p_j2k->m_specific_param.m_decoder.m_state & l_marker_handler->states)) {
@ -5248,14 +5248,14 @@ opj_j2k_v2_t* j2k_create_compress_v2()
l_j2k->m_specific_param.m_encoder.m_header_tile_data_size = J2K_DEFAULT_HEADER_SIZE; l_j2k->m_specific_param.m_encoder.m_header_tile_data_size = J2K_DEFAULT_HEADER_SIZE;
// validation list creation /* validation list creation*/
l_j2k->m_validation_list = opj_procedure_list_create(); l_j2k->m_validation_list = opj_procedure_list_create();
if (! l_j2k->m_validation_list) { if (! l_j2k->m_validation_list) {
j2k_destroy(l_j2k); j2k_destroy(l_j2k);
return NULL; return NULL;
} }
// execution list creation /* execution list creation*/
l_j2k->m_procedure_list = opj_procedure_list_create(); l_j2k->m_procedure_list = opj_procedure_list_create();
if (! l_j2k->m_procedure_list) { if (! l_j2k->m_procedure_list) {
j2k_destroy(l_j2k); j2k_destroy(l_j2k);
@ -5932,7 +5932,7 @@ opj_bool j2k_read_header( struct opj_stream_private *p_stream,
*/ */
void j2k_setup_header_reading (opj_j2k_v2_t *p_j2k) void j2k_setup_header_reading (opj_j2k_v2_t *p_j2k)
{ {
// preconditions /* preconditions*/
assert(p_j2k != 00); assert(p_j2k != 00);
opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(void*)j2k_read_header_procedure); opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(void*)j2k_read_header_procedure);
@ -5948,7 +5948,7 @@ void j2k_setup_header_reading (opj_j2k_v2_t *p_j2k)
*/ */
void j2k_setup_decoding_validation (opj_j2k_v2_t *p_j2k) void j2k_setup_decoding_validation (opj_j2k_v2_t *p_j2k)
{ {
// preconditions /* preconditions*/
assert(p_j2k != 00); assert(p_j2k != 00);
opj_procedure_list_add_procedure(p_j2k->m_validation_list, (void*)j2k_build_decoder); opj_procedure_list_add_procedure(p_j2k->m_validation_list, (void*)j2k_build_decoder);
@ -5966,8 +5966,8 @@ opj_bool j2k_build_decoder (
opj_event_mgr_t * p_manager opj_event_mgr_t * p_manager
) )
{ {
// add here initialization of cp /* add here initialization of cp
// copy paste of setup_decoder // copy paste of setup_decoder*/
return OPJ_TRUE; return OPJ_TRUE;
} }
@ -5988,7 +5988,7 @@ opj_bool j2k_decoding_validation (
{ {
opj_bool l_is_valid = OPJ_TRUE; opj_bool l_is_valid = OPJ_TRUE;
// preconditions /* preconditions*/
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_stream != 00); assert(p_stream != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -6082,7 +6082,7 @@ opj_bool j2k_read_header_procedure( opj_j2k_v2_t *p_j2k,
/* read 2 bytes as the marker size */ /* read 2 bytes as the marker size */
opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,&l_marker_size,2); opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,&l_marker_size,2);
l_marker_size -= 2; // Subtract the size of the marker ID already read l_marker_size -= 2; /* Subtract the size of the marker ID already read */
/* Check if the marker size is compatible with the header data size */ /* Check if the marker size is compatible with the header data size */
if (l_marker_size > p_j2k->m_specific_param.m_decoder.m_header_data_size) { if (l_marker_size > p_j2k->m_specific_param.m_decoder.m_header_data_size) {
@ -6152,7 +6152,7 @@ opj_bool j2k_exec ( opj_j2k_v2_t * p_j2k,
opj_bool l_result = OPJ_TRUE; opj_bool l_result = OPJ_TRUE;
OPJ_UINT32 l_nb_proc, i; OPJ_UINT32 l_nb_proc, i;
// preconditions /* preconditions*/
assert(p_procedure_list != 00); assert(p_procedure_list != 00);
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_stream != 00); assert(p_stream != 00);
@ -6167,7 +6167,7 @@ opj_bool j2k_exec ( opj_j2k_v2_t * p_j2k,
++l_procedure; ++l_procedure;
} }
// and clear the procedure list at the end. /* and clear the procedure list at the end.*/
opj_procedure_list_clear(p_procedure_list); opj_procedure_list_clear(p_procedure_list);
return l_result; return l_result;
} }
@ -6289,7 +6289,7 @@ opj_bool j2k_copy_default_tcp_and_create_tcd
} }
/* 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*)tcd_create_v2(OPJ_TRUE); /* FIXME why a cast ? */
if (! p_j2k->m_tcd ) { if (! p_j2k->m_tcd ) {
return OPJ_FALSE; return OPJ_FALSE;
} }
@ -6316,7 +6316,7 @@ const opj_dec_memory_marker_handler_t * j2k_get_marker_handler (OPJ_UINT32 p_id)
const opj_dec_memory_marker_handler_t *e; const opj_dec_memory_marker_handler_t *e;
for (e = j2k_memory_marker_handler_tab; e->id != 0; ++e) { for (e = j2k_memory_marker_handler_tab; e->id != 0; ++e) {
if (e->id == p_id) { if (e->id == p_id) {
break; // we find a handler corresponding to the marker ID break; /* we find a handler corresponding to the marker ID*/
} }
} }
return e; return e;
@ -6771,7 +6771,7 @@ opj_bool j2k_read_tile_header( opj_j2k_v2_t * p_j2k,
*p_tile_y1 = p_j2k->m_tcd->tcd_image->tiles->y1; *p_tile_y1 = p_j2k->m_tcd->tcd_image->tiles->y1;
*p_nb_comps = p_j2k->m_tcd->tcd_image->tiles->numcomps; *p_nb_comps = p_j2k->m_tcd->tcd_image->tiles->numcomps;
p_j2k->m_specific_param.m_decoder.m_state |= 0x0080;// FIXME J2K_DEC_STATE_DATA; p_j2k->m_specific_param.m_decoder.m_state |= 0x0080;/* FIXME J2K_DEC_STATE_DATA;*/
return OPJ_TRUE; return OPJ_TRUE;
} }
@ -6810,7 +6810,7 @@ opj_bool j2k_decode_tile ( opj_j2k_v2_t * p_j2k,
p_tile_index, p_tile_index,
p_j2k->cstr_index) ) { p_j2k->cstr_index) ) {
j2k_tcp_destroy(l_tcp); j2k_tcp_destroy(l_tcp);
p_j2k->m_specific_param.m_decoder.m_state |= 0x8000;//FIXME J2K_DEC_STATE_ERR; p_j2k->m_specific_param.m_decoder.m_state |= 0x8000;/*FIXME J2K_DEC_STATE_ERR;*/
return OPJ_FALSE; return OPJ_FALSE;
} }
@ -6825,9 +6825,9 @@ opj_bool j2k_decode_tile ( opj_j2k_v2_t * p_j2k,
j2k_tcp_data_destroy(l_tcp); j2k_tcp_data_destroy(l_tcp);
p_j2k->m_specific_param.m_decoder.m_can_decode = 0; p_j2k->m_specific_param.m_decoder.m_can_decode = 0;
p_j2k->m_specific_param.m_decoder.m_state &= (~ (0x0080));// FIXME J2K_DEC_STATE_DATA); p_j2k->m_specific_param.m_decoder.m_state &= (~ (0x0080));/* FIXME J2K_DEC_STATE_DATA);*/
if (p_j2k->m_specific_param.m_decoder.m_state != 0x0100){ //FIXME J2K_DEC_STATE_EOC) if (p_j2k->m_specific_param.m_decoder.m_state != 0x0100){ /*FIXME J2K_DEC_STATE_EOC)*/
if (opj_stream_read_data(p_stream,l_data,2,p_manager) != 2) { if (opj_stream_read_data(p_stream,l_data,2,p_manager) != 2) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Stream too short\n"); opj_event_msg_v2(p_manager, EVT_ERROR, "Stream too short\n");
return OPJ_FALSE; return OPJ_FALSE;
@ -6837,7 +6837,7 @@ opj_bool j2k_decode_tile ( opj_j2k_v2_t * p_j2k,
if (l_current_marker == J2K_MS_EOC) { if (l_current_marker == J2K_MS_EOC) {
p_j2k->m_current_tile_number = 0; p_j2k->m_current_tile_number = 0;
p_j2k->m_specific_param.m_decoder.m_state = 0x0100;//FIXME J2K_DEC_STATE_EOC; p_j2k->m_specific_param.m_decoder.m_state = 0x0100;/*FIXME J2K_DEC_STATE_EOC;*/
} }
else if (l_current_marker != J2K_MS_SOT) else if (l_current_marker != J2K_MS_SOT)
{ {
@ -7133,7 +7133,7 @@ opj_bool j2k_set_decode_area( opj_j2k_v2_t *p_j2k,
opj_image_comp_t* l_img_comp = NULL; opj_image_comp_t* l_img_comp = NULL;
/* Check if we are read the main header */ /* Check if we are read the main header */
if (p_j2k->m_specific_param.m_decoder.m_state != J2K_STATE_TPHSOT) { // FIXME J2K_DEC_STATE_TPHSOT) if (p_j2k->m_specific_param.m_decoder.m_state != J2K_STATE_TPHSOT) { /* FIXME J2K_DEC_STATE_TPHSOT)*/
opj_event_msg_v2(p_manager, EVT_ERROR, "Need to decode the main header before begin to decode the remaining codestream"); opj_event_msg_v2(p_manager, EVT_ERROR, "Need to decode the main header before begin to decode the remaining codestream");
return OPJ_FALSE; return OPJ_FALSE;
} }
@ -7410,7 +7410,7 @@ opj_bool j2k_read_SPCod_SPCoc(
if (l_cp->m_specific_param.m_dec.m_reduce >= l_tccp->numresolutions) { if (l_cp->m_specific_param.m_dec.m_reduce >= l_tccp->numresolutions) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions to remove is higher than the number " opj_event_msg_v2(p_manager, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions to remove is higher than the number "
"of resolutions of this component\nModify the cp_reduce parameter.\n\n", compno); "of resolutions of this component\nModify the cp_reduce parameter.\n\n", compno);
p_j2k->m_specific_param.m_decoder.m_state |= 0x8000;// FIXME J2K_DEC_STATE_ERR; p_j2k->m_specific_param.m_decoder.m_state |= 0x8000;/* FIXME J2K_DEC_STATE_ERR;*/
return OPJ_FALSE; return OPJ_FALSE;
} }
@ -7482,7 +7482,7 @@ opj_bool j2k_read_SPCod_SPCoc(
*/ */
void j2k_copy_tile_component_parameters( opj_j2k_v2_t *p_j2k ) void j2k_copy_tile_component_parameters( opj_j2k_v2_t *p_j2k )
{ {
// loop /* loop */
OPJ_UINT32 i; OPJ_UINT32 i;
opj_cp_v2_t *l_cp = NULL; opj_cp_v2_t *l_cp = NULL;
opj_tcp_v2_t *l_tcp = NULL; opj_tcp_v2_t *l_tcp = NULL;
@ -7530,7 +7530,7 @@ opj_bool j2k_read_SQcd_SQcc(
struct opj_event_mgr * p_manager struct opj_event_mgr * p_manager
) )
{ {
// loop /* loop*/
OPJ_UINT32 l_band_no; OPJ_UINT32 l_band_no;
opj_cp_v2_t *l_cp = 00; opj_cp_v2_t *l_cp = 00;
opj_tcp_v2_t *l_tcp = 00; opj_tcp_v2_t *l_tcp = 00;
@ -7538,18 +7538,18 @@ opj_bool j2k_read_SQcd_SQcc(
OPJ_BYTE * l_current_ptr = 00; OPJ_BYTE * l_current_ptr = 00;
OPJ_UINT32 l_tmp, l_num_band; OPJ_UINT32 l_tmp, l_num_band;
// preconditions /* preconditions*/
assert(p_j2k != 00); assert(p_j2k != 00);
assert(p_manager != 00); assert(p_manager != 00);
assert(p_header_data != 00); assert(p_header_data != 00);
l_cp = &(p_j2k->m_cp); l_cp = &(p_j2k->m_cp);
// come from tile part header or main header ? /* come from tile part header or main header ?*/
l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ? /*FIXME J2K_DEC_STATE_TPH*/ l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ? /*FIXME J2K_DEC_STATE_TPH*/
&l_cp->tcps[p_j2k->m_current_tile_number] : &l_cp->tcps[p_j2k->m_current_tile_number] :
p_j2k->m_specific_param.m_decoder.m_default_tcp; p_j2k->m_specific_param.m_decoder.m_default_tcp;
// precondition again /* precondition again*/
assert(p_comp_no < p_j2k->m_private_image->numcomps); assert(p_comp_no < p_j2k->m_private_image->numcomps);
l_tccp = &l_tcp->tccps[p_comp_no]; l_tccp = &l_tcp->tccps[p_comp_no];
@ -7578,7 +7578,7 @@ opj_bool j2k_read_SQcd_SQcc(
opj_event_msg_v2(p_manager, EVT_WARNING, "While reading CCP_QNTSTY element inside QCD or QCC marker segment, " opj_event_msg_v2(p_manager, EVT_WARNING, "While reading CCP_QNTSTY element inside QCD or QCC marker segment, "
"number of subbands (%d) is greater to J2K_MAXBANDS (%d). So we limit the number of elements stored to " "number of subbands (%d) is greater to J2K_MAXBANDS (%d). So we limit the number of elements stored to "
"J2K_MAXBANDS (%d) and skip the rest. \n", l_num_band, J2K_MAXBANDS, J2K_MAXBANDS); "J2K_MAXBANDS (%d) and skip the rest. \n", l_num_band, J2K_MAXBANDS, J2K_MAXBANDS);
//return OPJ_FALSE; /*return OPJ_FALSE;*/
} }
} }
@ -8207,7 +8207,7 @@ opj_bool j2k_decode_tiles ( opj_j2k_v2_t *p_j2k,
*/ */
void j2k_setup_decoding (opj_j2k_v2_t *p_j2k) void j2k_setup_decoding (opj_j2k_v2_t *p_j2k)
{ {
// preconditions /* preconditions*/
assert(p_j2k != 00); assert(p_j2k != 00);
opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(void*)j2k_decode_tiles); opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(void*)j2k_decode_tiles);
@ -8337,7 +8337,7 @@ opj_bool j2k_decode_one_tile ( opj_j2k_v2_t *p_j2k,
*/ */
void j2k_setup_decoding_tile (opj_j2k_v2_t *p_j2k) void j2k_setup_decoding_tile (opj_j2k_v2_t *p_j2k)
{ {
// preconditions /* preconditions*/
assert(p_j2k != 00); assert(p_j2k != 00);
opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(void*)j2k_decode_one_tile); opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(void*)j2k_decode_one_tile);

View File

@ -485,9 +485,9 @@ typedef struct opj_cp_v2
/** Rsiz*/ /** Rsiz*/
OPJ_RSIZ_CAPABILITIES rsiz; OPJ_RSIZ_CAPABILITIES rsiz;
/** XTOsiz */ /** XTOsiz */
OPJ_UINT32 tx0; // MSD see norm OPJ_UINT32 tx0; /* MSD see norm */
/** YTOsiz */ /** YTOsiz */
OPJ_UINT32 ty0; // MSD see norm OPJ_UINT32 ty0; /* MSD see norm */
/** XTsiz */ /** XTsiz */
OPJ_UINT32 tdx; OPJ_UINT32 tdx;
/** YTsiz */ /** YTsiz */
@ -629,10 +629,10 @@ typedef struct opj_j2k_dec
typedef struct opj_j2k_enc typedef struct opj_j2k_enc
{ {
/** Tile part number, regardless of poc, for each new poc, tp is reset to 1*/ /** Tile part number, regardless of poc, for each new poc, tp is reset to 1*/
OPJ_UINT32 m_current_poc_tile_part_number; // tp_num OPJ_UINT32 m_current_poc_tile_part_number; /* tp_num */
/** Tile part number currently coding, taking into account POC. m_current_tile_part_number holds the total number of tile parts while encoding the last tile part.*/ /** Tile part number currently coding, taking into account POC. m_current_tile_part_number holds the total number of tile parts while encoding the last tile part.*/
OPJ_UINT32 m_current_tile_part_number; //cur_tp_num OPJ_UINT32 m_current_tile_part_number; /*cur_tp_num */
/** /**
locate the start position of the TLM marker locate the start position of the TLM marker
@ -650,7 +650,7 @@ typedef struct opj_j2k_enc
/** Total num of tile parts in whole image = num tiles* num tileparts in each tile*/ /** Total num of tile parts in whole image = num tiles* num tileparts in each tile*/
/** used in TLMmarker*/ /** used in TLMmarker*/
OPJ_UINT32 m_total_tile_parts; // totnum_tp OPJ_UINT32 m_total_tile_parts; /* totnum_tp */
/* encoded data for a tile */ /* encoded data for a tile */
OPJ_BYTE * m_encoded_tile_data; OPJ_BYTE * m_encoded_tile_data;

View File

@ -446,7 +446,7 @@ opj_bool jp2_read_boxhdr_v2(opj_jp2_box_t *box, OPJ_UINT32 * p_number_bytes_read
/* read header from file */ /* read header from file */
unsigned char l_data_header [8]; unsigned char l_data_header [8];
// preconditions /* preconditions */
assert(cio != 00); assert(cio != 00);
assert(box != 00); assert(box != 00);
assert(p_number_bytes_read != 00); assert(p_number_bytes_read != 00);
@ -461,8 +461,8 @@ opj_bool jp2_read_boxhdr_v2(opj_jp2_box_t *box, OPJ_UINT32 * p_number_bytes_read
opj_read_bytes(l_data_header,&(box->length), 4); opj_read_bytes(l_data_header,&(box->length), 4);
opj_read_bytes(l_data_header+4,&(box->type), 4); opj_read_bytes(l_data_header+4,&(box->type), 4);
// do we have a "special very large box ?" /* do we have a "special very large box ?" */
// read then the XLBox /* read then the XLBox */
if (box->length == 1) { if (box->length == 1) {
OPJ_UINT32 l_xl_part_size; OPJ_UINT32 l_xl_part_size;
@ -556,7 +556,7 @@ opj_bool jp2_read_ihdr_v2(
opj_event_mgr_t * p_manager opj_event_mgr_t * p_manager
) )
{ {
// preconditions /* preconditions */
assert(p_image_header_data != 00); assert(p_image_header_data != 00);
assert(jp2 != 00); assert(jp2 != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -584,15 +584,15 @@ opj_bool jp2_read_ihdr_v2(
opj_read_bytes(p_image_header_data,&(jp2->bpc),1); /* BPC */ opj_read_bytes(p_image_header_data,&(jp2->bpc),1); /* BPC */
++ p_image_header_data; ++ p_image_header_data;
// if equal to 0 then need a BPC box (cf. chapter about image header box of the norm) /* if equal to 0 then need a BPC box (cf. chapter about image header box of the norm) */
/*if (jp2->bpc == 0){ /*if (jp2->bpc == 0){
// indicate with a flag that we will wait a BPC box indicate with a flag that we will wait a BPC box
}*/ }*/
opj_read_bytes(p_image_header_data,&(jp2->C),1); /* C */ opj_read_bytes(p_image_header_data,&(jp2->C),1); /* C */
++ p_image_header_data; ++ p_image_header_data;
// Should be equal to 7 cf. chapter about image header box of the norm /* Should be equal to 7 cf. chapter about image header box of the norm */
if (jp2->C != 7){ if (jp2->C != 7){
opj_event_msg_v2(p_manager, EVT_INFO, "JP2 IHDR box: compression type indicate that the file is not a conforming JP2 file (%d) \n", jp2->C); opj_event_msg_v2(p_manager, EVT_INFO, "JP2 IHDR box: compression type indicate that the file is not a conforming JP2 file (%d) \n", jp2->C);
} }
@ -689,23 +689,23 @@ opj_bool jp2_read_bpcc_v2( opj_jp2_v2_t *jp2,
{ {
OPJ_UINT32 i; OPJ_UINT32 i;
// preconditions /* preconditions */
assert(p_bpc_header_data != 00); assert(p_bpc_header_data != 00);
assert(jp2 != 00); assert(jp2 != 00);
assert(p_manager != 00); assert(p_manager != 00);
// TODO MSD /* TODO MSD */
/*if (jp2->bpc != 0 ){ /*if (jp2->bpc != 0 ){
opj_event_msg_v2(p_manager, EVT_WARNING, "A BPCC header box is available although BPC is different to zero (%d)\n",jp2->bpc); opj_event_msg_v2(p_manager, EVT_WARNING, "A BPCC header box is available although BPC is different to zero (%d)\n",jp2->bpc);
}*/ }*/
// and length is relevant /* and length is relevant */
if (p_bpc_header_size != jp2->numcomps) { if (p_bpc_header_size != jp2->numcomps) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Bad BPCC header box (bad size)\n"); opj_event_msg_v2(p_manager, EVT_ERROR, "Bad BPCC header box (bad size)\n");
return OPJ_FALSE; return OPJ_FALSE;
} }
// read info for each component /* read info for each component */
for (i = 0; i < jp2->numcomps; ++i) { for (i = 0; i < jp2->numcomps; ++i) {
opj_read_bytes(p_bpc_header_data,&jp2->comps[i].bpcc ,1); /* read each BPCC component */ opj_read_bytes(p_bpc_header_data,&jp2->comps[i].bpcc ,1); /* read each BPCC component */
++p_bpc_header_data; ++p_bpc_header_data;
@ -913,7 +913,7 @@ opj_bool jp2_read_pclr_v2( opj_jp2_v2_t *jp2,
OPJ_UINT16 i, j; OPJ_UINT16 i, j;
OPJ_UINT32 l_value; OPJ_UINT32 l_value;
// preconditions /* preconditions */
assert(p_pclr_header_data != 00); assert(p_pclr_header_data != 00);
assert(jp2 != 00); assert(jp2 != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -953,7 +953,7 @@ opj_bool jp2_read_pclr_v2( opj_jp2_v2_t *jp2,
for(j = 0; j < nr_entries; ++j) { for(j = 0; j < nr_entries; ++j) {
for(i = 0; i < nr_channels; ++i) { for(i = 0; i < nr_channels; ++i) {
//*entries++ = cio_read(cio, channel_size[i]>>3); /**entries++ = cio_read(cio, channel_size[i]>>3); */
opj_read_bytes(p_pclr_header_data, &l_value , channel_size[i]>>3); /* Cji */ opj_read_bytes(p_pclr_header_data, &l_value , channel_size[i]>>3); /* Cji */
p_pclr_header_data += channel_size[i]>>3; p_pclr_header_data += channel_size[i]>>3;
*entries = (OPJ_UINT32) l_value; *entries = (OPJ_UINT32) l_value;
@ -1019,7 +1019,7 @@ static opj_bool jp2_read_cmap_v2( opj_jp2_v2_t * jp2,
OPJ_BYTE i, nr_channels; OPJ_BYTE i, nr_channels;
OPJ_UINT32 l_value; OPJ_UINT32 l_value;
// preconditions /* preconditions */
assert(jp2 != 00); assert(jp2 != 00);
assert(p_cmap_header_data != 00); assert(p_cmap_header_data != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -1149,7 +1149,7 @@ static opj_bool jp2_read_cdef_v2( opj_jp2_v2_t * jp2,
unsigned short i; unsigned short i;
OPJ_UINT32 l_value; OPJ_UINT32 l_value;
// preconditions /* preconditions */
assert(jp2 != 00); assert(jp2 != 00);
assert(p_cdef_header_data != 00); assert(p_cdef_header_data != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -1264,7 +1264,7 @@ static opj_bool jp2_read_colr_v2( opj_jp2_v2_t * jp2,
{ {
OPJ_UINT32 l_value; OPJ_UINT32 l_value;
// preconditions /* preconditions */
assert(jp2 != 00); assert(jp2 != 00);
assert(p_colr_header_data != 00); assert(p_colr_header_data != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -1301,7 +1301,7 @@ static opj_bool jp2_read_colr_v2( opj_jp2_v2_t * jp2,
opj_read_bytes(p_colr_header_data,&jp2->enumcs ,4); /* EnumCS */ opj_read_bytes(p_colr_header_data,&jp2->enumcs ,4); /* EnumCS */
} }
else if (jp2->meth == 2) { else if (jp2->meth == 2) {
// ICC profile /* ICC profile */
int it_icc_value = 0; int it_icc_value = 0;
int icc_len = p_colr_header_size - 3; int icc_len = p_colr_header_size - 3;
@ -1318,7 +1318,7 @@ static opj_bool jp2_read_colr_v2( opj_jp2_v2_t * jp2,
} }
} }
else // TODO MSD else /* TODO MSD */
opj_event_msg_v2(p_manager, EVT_INFO, "COLR BOX meth value is not a regular value (%d), so we will skip the fields following the approx field.\n", jp2->meth); opj_event_msg_v2(p_manager, EVT_INFO, "COLR BOX meth value is not a regular value (%d), so we will skip the fields following the approx field.\n", jp2->meth);
jp2->color.jp2_has_colr = 1; jp2->color.jp2_has_colr = 1;
@ -1964,7 +1964,7 @@ opj_bool opj_jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_
*/ */
opj_bool jp2_end_decompress(opj_jp2_v2_t *jp2, opj_stream_private_t *cio, opj_event_mgr_t * p_manager) opj_bool jp2_end_decompress(opj_jp2_v2_t *jp2, opj_stream_private_t *cio, opj_event_mgr_t * p_manager)
{ {
// preconditions /* preconditions */
assert(jp2 != 00); assert(jp2 != 00);
assert(cio != 00); assert(cio != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -1986,7 +1986,7 @@ opj_bool jp2_end_decompress(opj_jp2_v2_t *jp2, opj_stream_private_t *cio, opj_ev
*/ */
void jp2_setup_end_header_reading (opj_jp2_v2_t *jp2) void jp2_setup_end_header_reading (opj_jp2_v2_t *jp2)
{ {
// preconditions /* preconditions */
assert(jp2 != 00); assert(jp2 != 00);
opj_procedure_list_add_procedure(jp2->m_procedure_list,(void*)jp2_read_header_procedure ); opj_procedure_list_add_procedure(jp2->m_procedure_list,(void*)jp2_read_header_procedure );
/* DEVELOPER CORNER, add your custom procedures */ /* DEVELOPER CORNER, add your custom procedures */
@ -2014,7 +2014,7 @@ opj_bool jp2_read_header_procedure(
OPJ_UINT32 l_current_data_size; OPJ_UINT32 l_current_data_size;
unsigned char * l_current_data = 00; unsigned char * l_current_data = 00;
// preconditions /* preconditions */
assert(cio != 00); assert(cio != 00);
assert(jp2 != 00); assert(jp2 != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -2028,7 +2028,7 @@ opj_bool jp2_read_header_procedure(
memset(l_current_data, 0 , l_last_data_size); memset(l_current_data, 0 , l_last_data_size);
while (jp2_read_boxhdr_v2(&box,&l_nb_bytes_read,cio,p_manager)) { while (jp2_read_boxhdr_v2(&box,&l_nb_bytes_read,cio,p_manager)) {
// is it the codestream box ? /* is it the codestream box ? */
if (box.type == JP2_JP2C) { if (box.type == JP2_JP2C) {
if (jp2->jp2_state & JP2_STATE_HEADER) { if (jp2->jp2_state & JP2_STATE_HEADER) {
jp2->jp2_state |= JP2_STATE_CODESTREAM; jp2->jp2_state |= JP2_STATE_CODESTREAM;
@ -2107,7 +2107,7 @@ opj_bool jp2_exec (
opj_bool l_result = OPJ_TRUE; opj_bool l_result = OPJ_TRUE;
OPJ_UINT32 l_nb_proc, i; OPJ_UINT32 l_nb_proc, i;
// preconditions /* preconditions */
assert(p_procedure_list != 00); assert(p_procedure_list != 00);
assert(jp2 != 00); assert(jp2 != 00);
assert(cio != 00); assert(cio != 00);
@ -2121,7 +2121,7 @@ opj_bool jp2_exec (
++l_procedure; ++l_procedure;
} }
// and clear the procedure list at the end. /* and clear the procedure list at the end. */
opj_procedure_list_clear(p_procedure_list); opj_procedure_list_clear(p_procedure_list);
return l_result; return l_result;
} }
@ -2188,7 +2188,7 @@ opj_bool jp2_read_jp_v2(
{ {
unsigned int l_magic_number; unsigned int l_magic_number;
// preconditions /* preconditions */
assert(p_header_data != 00); assert(p_header_data != 00);
assert(jp2 != 00); assert(jp2 != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -2204,7 +2204,7 @@ opj_bool jp2_read_jp_v2(
return OPJ_FALSE; return OPJ_FALSE;
} }
// rearrange data /* rearrange data */
opj_read_bytes(p_header_data,&l_magic_number,4); opj_read_bytes(p_header_data,&l_magic_number,4);
if (l_magic_number != 0x0d0a870a ) { if (l_magic_number != 0x0d0a870a ) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Error with JP Signature : bad magic number\n"); opj_event_msg_v2(p_manager, EVT_ERROR, "Error with JP Signature : bad magic number\n");
@ -2236,7 +2236,7 @@ opj_bool jp2_read_ftyp_v2(
{ {
OPJ_UINT32 i, l_remaining_bytes; OPJ_UINT32 i, l_remaining_bytes;
// preconditions /* preconditions */
assert(p_header_data != 00); assert(p_header_data != 00);
assert(jp2 != 00); assert(jp2 != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -2310,7 +2310,7 @@ opj_bool jp2_read_jp2h_v2(
opj_jp2_box_t box; opj_jp2_box_t box;
const opj_jp2_header_handler_t * l_current_handler; const opj_jp2_header_handler_t * l_current_handler;
// preconditions /* preconditions */
assert(p_header_data != 00); assert(p_header_data != 00);
assert(jp2 != 00); assert(jp2 != 00);
assert(p_manager != 00); assert(p_manager != 00);
@ -2378,7 +2378,7 @@ static opj_bool jp2_read_boxhdr_char(
{ {
OPJ_UINT32 l_value; OPJ_UINT32 l_value;
// preconditions /* preconditions */
assert(p_data != 00); assert(p_data != 00);
assert(box != 00); assert(box != 00);
assert(p_number_bytes_read != 00); assert(p_number_bytes_read != 00);
@ -2400,8 +2400,8 @@ static opj_bool jp2_read_boxhdr_char(
*p_number_bytes_read = 8; *p_number_bytes_read = 8;
// do we have a "special very large box ?" /* do we have a "special very large box ?" */
// read then the XLBox /* read then the XLBox */
if (box->length == 1) { if (box->length == 1) {
unsigned int l_xl_part_size; unsigned int l_xl_part_size;
@ -2485,7 +2485,7 @@ opj_bool jp2_read_header( struct opj_stream_private *p_stream,
*/ */
void jp2_setup_decoding_validation (opj_jp2_v2_t *jp2) void jp2_setup_decoding_validation (opj_jp2_v2_t *jp2)
{ {
// preconditions /* preconditions */
assert(jp2 != 00); assert(jp2 != 00);
/* DEVELOPER CORNER, add your custom validation procedure */ /* DEVELOPER CORNER, add your custom validation procedure */
} }
@ -2496,7 +2496,7 @@ void jp2_setup_decoding_validation (opj_jp2_v2_t *jp2)
*/ */
void jp2_setup_header_reading (opj_jp2_v2_t *jp2) void jp2_setup_header_reading (opj_jp2_v2_t *jp2)
{ {
// preconditions /* preconditions */
assert(jp2 != 00); assert(jp2 != 00);
opj_procedure_list_add_procedure(jp2->m_procedure_list,(void*)jp2_read_header_procedure ); opj_procedure_list_add_procedure(jp2->m_procedure_list,(void*)jp2_read_header_procedure );
@ -2733,14 +2733,14 @@ opj_jp2_v2_t* jp2_create(opj_bool p_is_decoder)
jp2->color.jp2_pclr = NULL; jp2->color.jp2_pclr = NULL;
jp2->color.jp2_has_colr = 0; jp2->color.jp2_has_colr = 0;
// validation list creation /* validation list creation */
jp2->m_validation_list = opj_procedure_list_create(); jp2->m_validation_list = opj_procedure_list_create();
if (! jp2->m_validation_list) { if (! jp2->m_validation_list) {
jp2_destroy(jp2); jp2_destroy(jp2);
return 00; return 00;
} }
// execution list creation /* execution list creation */
jp2->m_procedure_list = opj_procedure_list_create(); jp2->m_procedure_list = opj_procedure_list_create();
if (! jp2->m_procedure_list) { if (! jp2->m_procedure_list) {
jp2_destroy(jp2); jp2_destroy(jp2);

View File

@ -49,17 +49,17 @@
#define JP2_PCLR 0x70636c72 /**< Palette box */ #define JP2_PCLR 0x70636c72 /**< Palette box */
#define JP2_CMAP 0x636d6170 /**< Component Mapping box */ #define JP2_CMAP 0x636d6170 /**< Component Mapping box */
#define JP2_CDEF 0x63646566 /**< Channel Definition box */ #define JP2_CDEF 0x63646566 /**< Channel Definition box */
// For the future MSD /* For the future MSD */
// #define JP2_RES 0x72657320 /**< Resolution box (super-box) */ /* #define JP2_RES 0x72657320 */ /**< Resolution box (super-box) */
#define JP2_JP2C 0x6a703263 /**< Contiguous codestream box */ #define JP2_JP2C 0x6a703263 /**< Contiguous codestream box */
// For the future MSD /* For the future MSD */
// #define JP2_JP2I 0x6a703269 /**< Intellectual property box */ /* #define JP2_JP2I 0x6a703269 */ /**< Intellectual property box */
// #define JP2_XML 0x786d6c20 /**< XML box */ /* #define JP2_XML 0x786d6c20 */ /**< XML box */
// #define JP2_UUID 0x75756994 /**< UUID box */ /* #define JP2_UUID 0x75756994 */ /**< UUID box */
// #define JP2_UINF 0x75696e66 /**< UUID info box (super-box) */ /* #define JP2_UINF 0x75696e66 */ /**< UUID info box (super-box) */
// #define JP2_ULST 0x756c7374 /**< UUID list box */ /* #define JP2_ULST 0x756c7374 */ /**< UUID list box */
#define JP2_URL 0x75726c20 /**< Data entry URL box */ #define JP2_URL 0x75726c20 /**< Data entry URL box */
#define JP2_DTBL 0x6474626c /**< Data Reference box */ #define JP2_DTBL 0x6474626c /**< Data Reference box */

View File

@ -191,15 +191,15 @@ double mct_getnorm_real(int compno) {
opj_bool mct_decode_custom( opj_bool mct_decode_custom(
// MCT data /* MCT data */
OPJ_BYTE * pDecodingData, OPJ_BYTE * pDecodingData,
// size of components /* size of components */
OPJ_UINT32 n, OPJ_UINT32 n,
// components /* components */
OPJ_BYTE ** pData, OPJ_BYTE ** pData,
// nb of components (i.e. size of pData) /* nb of components (i.e. size of pData) */
OPJ_UINT32 pNbComp, OPJ_UINT32 pNbComp,
// tells if the data is signed /* tells if the data is signed */
OPJ_UINT32 isSigned) OPJ_UINT32 isSigned)
{ {
OPJ_FLOAT32 * lMct; OPJ_FLOAT32 * lMct;

View File

@ -92,15 +92,15 @@ Get norm of the basis function used for the irreversible multi-component transfo
double mct_getnorm_real(int compno); double mct_getnorm_real(int compno);
opj_bool mct_decode_custom( opj_bool mct_decode_custom(
// MCT data /* MCT data */
OPJ_BYTE * pDecodingData, OPJ_BYTE * pDecodingData,
// size of components /* size of components */
OPJ_UINT32 n, OPJ_UINT32 n,
// components /* components */
OPJ_BYTE ** pData, OPJ_BYTE ** pData,
// nb of components (i.e. size of pData) /* nb of components (i.e. size of pData) */
OPJ_UINT32 pNbComp, OPJ_UINT32 pNbComp,
// tells if the data is signed /* tells if the data is signed */
OPJ_UINT32 isSigned); OPJ_UINT32 isSigned);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/*@}*/ /*@}*/

View File

@ -208,7 +208,7 @@ typedef enum CODEC_FORMAT {
CODEC_UNKNOWN = -1, /**< place-holder */ CODEC_UNKNOWN = -1, /**< place-holder */
CODEC_J2K = 0, /**< JPEG-2000 codestream : read/write */ CODEC_J2K = 0, /**< JPEG-2000 codestream : read/write */
CODEC_JPT = 1, /**< JPT-stream (JPEG 2000, JPIP) : read only */ CODEC_JPT = 1, /**< JPT-stream (JPEG 2000, JPIP) : read only */
CODEC_JP2 = 2, /**< JPEG-2000 file format : read/write */ CODEC_JP2 = 2 /**< JPEG-2000 file format : read/write */
} OPJ_CODEC_FORMAT; } OPJ_CODEC_FORMAT;
/** /**

View File

@ -178,7 +178,7 @@ static INLINE long lrintf(float f){
#endif /* USE_JPWL */ #endif /* USE_JPWL */
/* <<JPWL */ /* <<JPWL */
// V2 /* V2 */
#include "function_list.h" #include "function_list.h"
#endif /* OPJ_INCLUDES_H */ #endif /* OPJ_INCLUDES_H */

View File

@ -929,8 +929,8 @@ opj_bool t2_decode_packets_v2(
opj_packet_info_t *info_PK = &info_TL->packet[p_cstr_info->packno]; opj_packet_info_t *info_PK = &info_TL->packet[p_cstr_info->packno];
if (!p_cstr_info->packno) { if (!p_cstr_info->packno) {
info_PK->start_pos = info_TL->end_header + 1; info_PK->start_pos = info_TL->end_header + 1;
} else if (info_TL->packet[p_cstr_info->packno-1].end_pos >= (OPJ_INT32)p_cstr_info->tile[p_tile_no].tp[curtp].tp_end_pos){ // New tile part } else if (info_TL->packet[p_cstr_info->packno-1].end_pos >= (OPJ_INT32)p_cstr_info->tile[p_tile_no].tp[curtp].tp_end_pos){ /* New tile part */
info_TL->tp[curtp].tp_numpacks = p_cstr_info->packno - tp_start_packno; // Number of packets in previous tile-part info_TL->tp[curtp].tp_numpacks = p_cstr_info->packno - tp_start_packno; /* Number of packets in previous tile-part */
tp_start_packno = p_cstr_info->packno; tp_start_packno = p_cstr_info->packno;
curtp++; curtp++;
info_PK->start_pos = p_cstr_info->tile[p_tile_no].tp[curtp].tp_end_header+1; info_PK->start_pos = p_cstr_info->tile[p_tile_no].tp[curtp].tp_end_header+1;
@ -938,7 +938,7 @@ opj_bool t2_decode_packets_v2(
info_PK->start_pos = (cp->m_specific_param.m_enc.m_tp_on && info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[p_cstr_info->packno - 1].end_pos + 1; info_PK->start_pos = (cp->m_specific_param.m_enc.m_tp_on && info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[p_cstr_info->packno - 1].end_pos + 1;
} }
info_PK->end_pos = info_PK->start_pos + l_nb_bytes_read - 1; info_PK->end_pos = info_PK->start_pos + l_nb_bytes_read - 1;
info_PK->end_ph_pos += info_PK->start_pos - 1; // End of packet header which now only represents the distance info_PK->end_ph_pos += info_PK->start_pos - 1; /* End of packet header which now only represents the distance */
++p_cstr_info->packno; ++p_cstr_info->packno;
} }
#endif #endif
@ -952,7 +952,7 @@ opj_bool t2_decode_packets_v2(
#ifdef TODO_MSD #ifdef TODO_MSD
if if
(p_cstr_info) { (p_cstr_info) {
p_cstr_info->tile[p_tile_no].tp[curtp].tp_numpacks = p_cstr_info->packno - tp_start_packno; // Number of packets in last tile-part p_cstr_info->tile[p_tile_no].tp[curtp].tp_numpacks = p_cstr_info->packno - tp_start_packno; /* Number of packets in last tile-part */
} }
#endif #endif
/* << INDEX */ /* << INDEX */
@ -1150,7 +1150,7 @@ static opj_bool t2_read_packet_header(
if (p_tcp->csty & J2K_CP_CSTY_SOP) { if (p_tcp->csty & J2K_CP_CSTY_SOP) {
if ((*l_current_data) != 0xff || (*(l_current_data + 1) != 0x91)) { if ((*l_current_data) != 0xff || (*(l_current_data + 1) != 0x91)) {
// TODO opj_event_msg(t2->cinfo->event_mgr, EVT_WARNING, "Expected SOP marker\n"); /* TODO opj_event_msg(t2->cinfo->event_mgr, EVT_WARNING, "Expected SOP marker\n"); */
} else { } else {
l_current_data += 6; l_current_data += 6;
} }
@ -1210,8 +1210,8 @@ static opj_bool t2_read_packet_header(
*l_header_data_start += l_header_length; *l_header_data_start += l_header_length;
/* << INDEX */ /* << INDEX */
// End of packet header position. Currently only represents the distance to start of packet /* End of packet header position. Currently only represents the distance to start of packet
// Will be updated later by incrementing with packet start value Will be updated later by incrementing with packet start value */
if (p_pack_info) { if (p_pack_info) {
p_pack_info->end_ph_pos = (OPJ_INT32)(l_current_data - p_src_data); p_pack_info->end_ph_pos = (OPJ_INT32)(l_current_data - p_src_data);
} }
@ -1323,7 +1323,7 @@ static opj_bool t2_read_packet_header(
/* EPH markers */ /* EPH markers */
if (p_tcp->csty & J2K_CP_CSTY_EPH) { if (p_tcp->csty & J2K_CP_CSTY_EPH) {
if ((*l_header_data) != 0xff || (*(l_header_data + 1) != 0x92)) { if ((*l_header_data) != 0xff || (*(l_header_data + 1) != 0x92)) {
// TODO opj_event_msg(t2->cinfo->event_mgr, EVT_ERROR, "Expected EPH marker\n"); /* TODO opj_event_msg(t2->cinfo->event_mgr, EVT_ERROR, "Expected EPH marker\n"); */
} else { } else {
l_header_data += 2; l_header_data += 2;
} }
@ -1334,8 +1334,8 @@ static opj_bool t2_read_packet_header(
*l_header_data_start += l_header_length; *l_header_data_start += l_header_length;
/* << INDEX */ /* << INDEX */
// End of packet header position. Currently only represents the distance to start of packet /* End of packet header position. Currently only represents the distance to start of packet
// Will be updated later by incrementing with packet start value Will be updated later by incrementing with packet start value */
if (p_pack_info) { if (p_pack_info) {
p_pack_info->end_ph_pos = (OPJ_INT32)(l_current_data - p_src_data); p_pack_info->end_ph_pos = (OPJ_INT32)(l_current_data - p_src_data);
} }

View File

@ -1993,7 +1993,7 @@ opj_bool FUNCTION ( opj_tcd_v2_t *p_tcd, \
} \ } \
// V2 ENCODE MACRO_TCD_ALLOCATE(tcd_init_encode_tile,opj_tcd_cblk_enc_t,1.f,enc,tcd_code_block_enc_allocate) /* V2 ENCODE MACRO_TCD_ALLOCATE(tcd_init_encode_tile,opj_tcd_cblk_enc_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(tcd_init_decode_tile, opj_tcd_cblk_dec_v2_t, 0.5f, dec, tcd_code_block_dec_allocate)
#undef MACRO_TCD_ALLOCATE #undef MACRO_TCD_ALLOCATE
@ -2068,51 +2068,51 @@ opj_bool tcd_decode_tile_v2(
#endif #endif
/*--------------TIER2------------------*/ /*--------------TIER2------------------*/
// FIXME _ProfStart(PGROUP_T2); /* FIXME _ProfStart(PGROUP_T2); */
l_data_read = 0; l_data_read = 0;
if if
(! tcd_t2_decode(p_tcd, p_src, &l_data_read, p_max_length, p_cstr_index)) (! tcd_t2_decode(p_tcd, p_src, &l_data_read, p_max_length, p_cstr_index))
{ {
return OPJ_FALSE; return OPJ_FALSE;
} }
// FIXME _ProfStop(PGROUP_T2); /* FIXME _ProfStop(PGROUP_T2); */
/*------------------TIER1-----------------*/ /*------------------TIER1-----------------*/
// FIXME _ProfStart(PGROUP_T1); /* FIXME _ProfStart(PGROUP_T1); */
if if
(! tcd_t1_decode(p_tcd)) (! tcd_t1_decode(p_tcd))
{ {
return OPJ_FALSE; return OPJ_FALSE;
} }
// FIXME _ProfStop(PGROUP_T1); /* FIXME _ProfStop(PGROUP_T1); */
/*----------------DWT---------------------*/ /*----------------DWT---------------------*/
// FIXME _ProfStart(PGROUP_DWT); /* FIXME _ProfStart(PGROUP_DWT); */
if if
(! tcd_dwt_decode(p_tcd)) (! tcd_dwt_decode(p_tcd))
{ {
return OPJ_FALSE; return OPJ_FALSE;
} }
// FIXME _ProfStop(PGROUP_DWT); /* FIXME _ProfStop(PGROUP_DWT); */
/*----------------MCT-------------------*/ /*----------------MCT-------------------*/
// FIXME _ProfStart(PGROUP_MCT); /* FIXME _ProfStart(PGROUP_MCT); */
if if
(! tcd_mct_decode(p_tcd)) (! tcd_mct_decode(p_tcd))
{ {
return OPJ_FALSE; return OPJ_FALSE;
} }
// FIXME _ProfStop(PGROUP_MCT); /* FIXME _ProfStop(PGROUP_MCT); */
// FIXME _ProfStart(PGROUP_DC_SHIFT); /* FIXME _ProfStart(PGROUP_DC_SHIFT); */
if if
(! tcd_dc_level_shift_decode(p_tcd)) (! tcd_dc_level_shift_decode(p_tcd))
{ {
return OPJ_FALSE; return OPJ_FALSE;
} }
// FIXME _ProfStop(PGROUP_DC_SHIFT); /* FIXME _ProfStop(PGROUP_DC_SHIFT); */
/*---------------TILE-------------------*/ /*---------------TILE-------------------*/
@ -2258,7 +2258,7 @@ void tcd_free_tile(opj_tcd_v2_t *p_tcd)
l_tcd_code_block_deallocate = tcd_code_block_dec_deallocate; l_tcd_code_block_deallocate = tcd_code_block_dec_deallocate;
} }
else { else {
// FIXME l_tcd_code_block_deallocate = tcd_code_block_enc_deallocate; /* FIXME l_tcd_code_block_deallocate = tcd_code_block_enc_deallocate; */
} }
l_tile = p_tcd->tcd_image->tiles; l_tile = p_tcd->tcd_image->tiles;
@ -2341,8 +2341,8 @@ opj_bool tcd_code_block_dec_allocate (opj_tcd_cblk_dec_v2_t * p_code_block)
p_code_block->m_current_max_segs = J2K_DEFAULT_NB_SEGS; p_code_block->m_current_max_segs = J2K_DEFAULT_NB_SEGS;
/*fprintf(stderr, "m_current_max_segs of code_block->data = %d\n", p_code_block->m_current_max_segs);*/ /*fprintf(stderr, "m_current_max_segs of code_block->data = %d\n", p_code_block->m_current_max_segs);*/
} }
// TODO /* TODO */
//p_code_block->numsegs = 0; /*p_code_block->numsegs = 0; */
return OPJ_TRUE; return OPJ_TRUE;
} }
@ -2478,15 +2478,15 @@ opj_bool tcd_mct_decode ( opj_tcd_v2_t *p_tcd )
++l_tile_comp; ++l_tile_comp;
} }
if (! mct_decode_custom(// MCT data if (! mct_decode_custom(/* MCT data */
(OPJ_BYTE*) l_tcp->m_mct_decoding_matrix, (OPJ_BYTE*) l_tcp->m_mct_decoding_matrix,
// size of components /* size of components */
l_samples, l_samples,
// components /* components */
l_data, l_data,
// nb of components (i.e. size of pData) /* nb of components (i.e. size of pData) */
l_tile->numcomps, l_tile->numcomps,
// tells if the data is signed /* tells if the data is signed */
p_tcd->image->comps->sgnd)) { p_tcd->image->comps->sgnd)) {
opj_free(l_data); opj_free(l_data);
return OPJ_FALSE; return OPJ_FALSE;

View File

@ -44,15 +44,15 @@ each other. The functions in TCD.C are used by other functions in J2K.C.
/** /**
FIXME: documentation FIXME: documentation
*/ */
//typedef struct opj_tcd_seg { /*typedef struct opj_tcd_seg { */
// unsigned char** data; /* unsigned char** data; */
// int dataindex; /* int dataindex; */
// int numpasses; /* int numpasses; */
// int len; /* int len; */
// int maxpasses; /* int maxpasses; */
// int numnewpasses; /* int numnewpasses; */
// int newlen; /* int newlen; */
//} opj_tcd_seg_t; /*} opj_tcd_seg_t; */
/** /**
FIXME: documentation FIXME: documentation

View File

@ -53,16 +53,6 @@ typedef struct opj_tgt_node {
OPJ_UINT32 known; OPJ_UINT32 known;
} opj_tgt_node_t; } opj_tgt_node_t;
///** OPJ_V1
//Tag tree
//*/
//typedef struct opj_tgt_tree {
// int numleafsh;
// int numleafsv;
// int numnodes;
// opj_tgt_node_t *nodes;
//} opj_tgt_tree_t;
/** /**
Tag tree Tag tree
*/ */