[trunk]remove some warnings raised by Wall

This commit is contained in:
Mickael Savinaud 2012-10-26 09:39:52 +00:00
parent a2bd3bb75b
commit bcc386e3bb
5 changed files with 18 additions and 117 deletions

View File

@ -2579,7 +2579,6 @@ opj_bool opj_j2k_write_qcd( opj_j2k_t *p_j2k,
)
{
opj_cp_t *l_cp = 00;
opj_tcp_t *l_tcp = 00;
OPJ_UINT32 l_qcd_size,l_remaining_size;
OPJ_BYTE * l_current_data = 00;
@ -2589,7 +2588,6 @@ opj_bool opj_j2k_write_qcd( opj_j2k_t *p_j2k,
assert(p_stream != 00);
l_cp = &(p_j2k->m_cp);
l_tcp = &l_cp->tcps[p_j2k->m_current_tile_number];
l_qcd_size = 4 + opj_j2k_get_SQcd_SQcc_size(p_j2k,p_j2k->m_current_tile_number,0);
l_remaining_size = l_qcd_size;
@ -2849,7 +2847,6 @@ opj_bool opj_j2k_write_poc( opj_j2k_t *p_j2k,
OPJ_UINT32 l_poc_size;
OPJ_UINT32 l_written_size = 0;
opj_tcp_t *l_tcp = 00;
opj_tccp_t *l_tccp = 00;
OPJ_UINT32 l_poc_room;
/* preconditions */
@ -2858,7 +2855,6 @@ opj_bool opj_j2k_write_poc( opj_j2k_t *p_j2k,
assert(p_stream != 00);
l_tcp = &p_j2k->m_cp.tcps[p_j2k->m_current_tile_number];
l_tccp = &l_tcp->tccps[0];
l_nb_comp = p_j2k->m_private_image->numcomps;
l_nb_poc = 1 + l_tcp->numpocs;
@ -3165,7 +3161,7 @@ static opj_bool opj_j2k_read_tlm ( opj_j2k_t *p_j2k,
opj_event_mgr_t * p_manager
)
{
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_remaining, l_quotient, l_Ptlm_size;
/* preconditions */
assert(p_header_data != 00);
assert(p_j2k != 00);
@ -3188,7 +3184,6 @@ static opj_bool opj_j2k_read_tlm ( opj_j2k_t *p_j2k,
l_Ptlm_size = (l_SP + 1) * 2;
l_quotient = l_Ptlm_size + l_ST;
l_tot_num_tp = p_header_size / l_quotient;
l_tot_num_tp_remaining = p_header_size % l_quotient;
if (l_tot_num_tp_remaining != 0) {
@ -4081,11 +4076,9 @@ opj_bool opj_j2k_write_sod( opj_j2k_t *p_j2k,
opj_event_mgr_t * p_manager
)
{
opj_tcp_t *l_tcp = 00;
opj_codestream_info_t *l_cstr_info = 00;
opj_cp_t *l_cp = 00;
OPJ_UINT32 l_size_tile;
OPJ_UINT32 l_remaining_data;
/* preconditions */
@ -4100,14 +4093,11 @@ opj_bool opj_j2k_write_sod( opj_j2k_t *p_j2k,
l_remaining_data = p_total_data_size - 4;
l_cp = &(p_j2k->m_cp);
l_tcp = &l_cp->tcps[p_j2k->m_current_tile_number];
/* update tile coder */
p_tile_coder->tp_num = p_j2k->m_specific_param.m_encoder.m_current_poc_tile_part_number ;
p_tile_coder->cur_tp_num = p_j2k->m_specific_param.m_encoder.m_current_tile_part_number;
l_size_tile = l_cp->th * l_cp->tw;
/* INDEX >> */
/* TODO mergeV2: check this part which use cstr_info */
/*l_cstr_info = p_j2k->cstr_info;
@ -5416,7 +5406,6 @@ static opj_bool opj_j2k_read_mco ( opj_j2k_t *p_j2k,
opj_tcp_t * l_tcp;
opj_tccp_t * l_tccp;
opj_image_t * l_image;
opj_image_comp_t * l_img_comp;
/* preconditions */
assert(p_header_data != 00);
@ -5447,7 +5436,6 @@ static opj_bool opj_j2k_read_mco ( opj_j2k_t *p_j2k,
}
l_tccp = l_tcp->tccps;
l_img_comp = l_image->comps;
for (i=0;i<l_image->numcomps;++i) {
l_tccp->m_dc_level_shift = 0;
@ -5727,7 +5715,6 @@ void opj_j2k_setup_encoder( opj_j2k_t *p_j2k,
{
OPJ_UINT32 i, j, tileno, numpocs_tile;
opj_cp_t *cp = 00;
opj_bool l_res;
if(!p_j2k || !parameters || ! image) {
return;
@ -5851,8 +5838,8 @@ void opj_j2k_setup_encoder( opj_j2k_t *p_j2k,
cp->tcps = (opj_tcp_t*) opj_calloc(cp->tw * cp->th, sizeof(opj_tcp_t));
if (parameters->numpocs) {
/* initialisation of POC */
l_res = opj_j2k_check_poc_val(parameters->POC,parameters->numpocs, parameters->numresolution, image->numcomps, parameters->tcp_numlayers, p_manager);
/* TODO */
opj_j2k_check_poc_val(parameters->POC,parameters->numpocs, parameters->numresolution, image->numcomps, parameters->tcp_numlayers, p_manager);
/* TODO MSD use the return value*/
}
for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
@ -5958,7 +5945,7 @@ void opj_j2k_setup_encoder( opj_j2k_t *p_j2k,
tccp->qntsty = parameters->irreversible ? J2K_CCP_QNTSTY_SEQNT : J2K_CCP_QNTSTY_NOQNT;
tccp->numgbits = 2;
if (i == parameters->roi_compno) {
if ((OPJ_INT32)i == parameters->roi_compno) {
tccp->roishift = parameters->roi_shift;
} else {
tccp->roishift = 0;
@ -8444,8 +8431,8 @@ void j2k_dump_image_comp_header(opj_image_comp_t* comp_header, opj_bool dev_dump
opj_codestream_info_v2_t* j2k_get_cstr_info(opj_j2k_t* p_j2k)
{
OPJ_UINT16 compno;
OPJ_UINT16 numcomps = p_j2k->m_private_image->numcomps;
OPJ_UINT32 compno;
OPJ_UINT32 numcomps = p_j2k->m_private_image->numcomps;
opj_tcp_t *l_default_tile;
opj_codestream_info_v2_t* cstr_info = (opj_codestream_info_v2_t*) opj_calloc(1,sizeof(opj_codestream_info_v2_t));
@ -9251,7 +9238,6 @@ opj_bool opj_j2k_post_write_tile ( opj_j2k_t * p_j2k,
{
opj_tcd_t * l_tcd = 00;
opj_cp_t * l_cp = 00;
opj_tcp_t * l_tcp = 00;
OPJ_UINT32 l_nb_bytes_written;
OPJ_BYTE * l_current_data = 00;
OPJ_UINT32 l_tile_size = 0;
@ -9262,7 +9248,6 @@ opj_bool opj_j2k_post_write_tile ( opj_j2k_t * p_j2k,
l_tcd = p_j2k->m_tcd;
l_cp = &(p_j2k->m_cp);
l_tcp = l_cp->tcps + p_j2k->m_current_tile_number;
l_tile_size = p_j2k->m_specific_param.m_encoder.m_encoded_tile_size;
l_available_data = l_tile_size;
@ -9380,13 +9365,11 @@ opj_bool opj_j2k_write_first_tile_part (opj_j2k_t *p_j2k,
OPJ_UINT32 l_current_nb_bytes_written;
OPJ_BYTE * l_begin_data = 00;
opj_tcp_t *l_tcp = 00;
opj_tcd_t * l_tcd = 00;
opj_cp_t * l_cp = 00;
l_tcd = p_j2k->m_tcd;
l_cp = &(p_j2k->m_cp);
l_tcp = l_cp->tcps + p_j2k->m_current_tile_number;
l_tcd->cur_pino = 0;

View File

@ -900,10 +900,8 @@ opj_bool opj_jp2_read_cmap( opj_jp2_t * jp2,
void opj_jp2_apply_cdef(opj_image_t *image, opj_jp2_color_t *color)
{
opj_jp2_cdef_info_t *info;
OPJ_INT32 color_space;
OPJ_UINT16 i, n, cn, typ, asoc, acn;
OPJ_UINT16 i, n, cn, asoc, acn;
color_space = image->color_space;
info = color->jp2_cdef->info;
n = color->jp2_cdef->n;
@ -912,7 +910,8 @@ void opj_jp2_apply_cdef(opj_image_t *image, opj_jp2_color_t *color)
/* WATCH: acn = asoc - 1 ! */
if((asoc = info[i].asoc) == 0) continue;
cn = info[i].cn; typ = info[i].typ; acn = asoc - 1;
cn = info[i].cn;
acn = asoc - 1;
if(cn != acn)
{

View File

@ -105,12 +105,6 @@ static void opj_t1_enc_sigpass( opj_t1_t *t1,
/**
Decode significant pass
*/
static void opj_t1_dec_sigpass( opj_t1_t *t1,
OPJ_INT32 bpno,
OPJ_UINT32 orient,
OPJ_BYTE type,
OPJ_UINT32 cblksty);
static void opj_t1_dec_sigpass_raw(
opj_t1_t *t1,
int bpno,
@ -152,10 +146,6 @@ static void opj_t1_enc_refpass( opj_t1_t *t1,
/**
Decode refinement pass
*/
static void opj_t1_dec_refpass( opj_t1_t *t1,
OPJ_INT32 bpno,
OPJ_BYTE type,
OPJ_UINT32 cblksty);
static void opj_t1_dec_refpass_raw(
opj_t1_t *t1,
int bpno,
@ -1407,17 +1397,6 @@ opj_bool opj_t1_decode_cblk(opj_t1_t *t1,
}
for (passno = 0; passno < seg->real_num_passes; ++passno) {
/* switch (passtype) {
case 0:
opj_t1_dec_sigpass(t1, bpno+1, orient, type, cblksty);
break;
case 1:
opj_t1_dec_refpass(t1, bpno+1, type, cblksty);
break;
case 2:
opj_t1_dec_clnpass(t1, bpno+1, orient, cblksty);
break;
}*/
switch (passtype) {
case 0:
if (type == T1_TYPE_RAW) {
@ -1698,35 +1677,6 @@ void opj_t1_encode_cblk(opj_t1_t *t1,
}
}
void opj_t1_dec_refpass(opj_t1_t *t1,
OPJ_INT32 bpno,
OPJ_BYTE type,
OPJ_UINT32 cblksty)
{
OPJ_UINT32 i, j, k;
OPJ_INT32 one, poshalf, neghalf;
OPJ_UINT32 vsc;
one = 1 << bpno;
poshalf = one >> 1;
neghalf = bpno > 0 ? -poshalf : -1;
for (k = 0; k < t1->h; k += 4) {
for (i = 0; i < t1->w; ++i) {
for (j = k; j < k + 4 && j < t1->h; ++j) {
vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
opj_t1_dec_refpass_step(
t1,
&t1->flags[((j+1) * t1->flags_stride) + i + 1],
&t1->data[(j * t1->w) + i],
poshalf,
neghalf,
type,
vsc);
}
}
}
} /* VSC and BYPASS by Antonin */
void opj_t1_dec_refpass_step( opj_t1_t *t1,
opj_flag_t *flagsp,
OPJ_INT32 *datap,
@ -1755,33 +1705,7 @@ void opj_t1_dec_refpass_step( opj_t1_t *t1,
}
} /* VSC and BYPASS by Antonin */
void opj_t1_dec_sigpass(opj_t1_t *t1,
OPJ_INT32 bpno,
OPJ_UINT32 orient,
OPJ_BYTE type,
OPJ_UINT32 cblksty)
{
OPJ_UINT32 i, j, k, vsc;
OPJ_INT32 one, half, oneplushalf;
one = 1 << bpno;
half = one >> 1;
oneplushalf = one | half;
for (k = 0; k < t1->h; k += 4) {
for (i = 0; i < t1->w; ++i) {
for (j = k; j < k + 4 && j < t1->h; ++j) {
vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;
opj_t1_dec_sigpass_step(
t1,
&t1->flags[((j+1) * t1->flags_stride) + i + 1],
&t1->data[(j * t1->w) + i],
orient,
oneplushalf,
type,
vsc);
}
}
}
} /* VSC and BYPASS by Antonin */
void opj_t1_dec_sigpass_step( opj_t1_t *t1,
opj_flag_t *flagsp,

View File

@ -323,7 +323,6 @@ opj_bool opj_t2_decode_packets( opj_t2_t *p_t2,
OPJ_UINT32 pino;
opj_image_t *l_image = p_t2->image;
opj_cp_t *l_cp = p_t2->cp;
opj_cp_t *cp = p_t2->cp;
opj_tcp_t *l_tcp = &(p_t2->cp->tcps[p_tile_no]);
OPJ_UINT32 l_nb_bytes_read;
OPJ_UINT32 l_nb_pocs = l_tcp->numpocs + 1;
@ -405,7 +404,7 @@ opj_bool opj_t2_decode_packets( opj_t2_t *p_t2,
curtp++;
info_PK->start_pos = p_cstr_info->tile[p_tile_no].tp[curtp].tp_end_header+1;
} else {
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 = (l_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_ph_pos += info_PK->start_pos - 1; /* End of packet header which now only represents the distance */

View File

@ -749,7 +749,7 @@ opj_bool FUNCTION ( opj_tcd_t *p_tcd, \
\
for(resno = 0; resno < l_tilec->numresolutions; ++resno) { \
/*fprintf(stderr, "\t\tresno = %d/%d\n", resno, l_tilec->numresolutions);*/ \
OPJ_INT32 tlcbgxstart, tlcbgystart, brcbgxend, brcbgyend; \
OPJ_INT32 tlcbgxstart, tlcbgystart /*, brcbgxend, brcbgyend*/; \
OPJ_UINT32 cbgwidthexpn, cbgheightexpn; \
OPJ_UINT32 cblkwidthexpn, cblkheightexpn; \
\
@ -779,8 +779,8 @@ opj_bool FUNCTION ( opj_tcd_t *p_tcd, \
if (resno == 0) { \
tlcbgxstart = l_tl_prc_x_start; \
tlcbgystart = l_tl_prc_y_start; \
brcbgxend = l_br_prc_x_end; \
brcbgyend = l_br_prc_y_end; \
/*brcbgxend = l_br_prc_x_end;*/ \
/* brcbgyend = l_br_prc_y_end;*/ \
cbgwidthexpn = l_pdx; \
cbgheightexpn = l_pdy; \
l_res->numbands = 1; \
@ -788,8 +788,8 @@ opj_bool FUNCTION ( opj_tcd_t *p_tcd, \
else { \
tlcbgxstart = opj_int_ceildivpow2(l_tl_prc_x_start, 1); \
tlcbgystart = opj_int_ceildivpow2(l_tl_prc_y_start, 1); \
brcbgxend = opj_int_ceildivpow2(l_br_prc_x_end, 1); \
brcbgyend = opj_int_ceildivpow2(l_br_prc_y_end, 1); \
/*brcbgxend = opj_int_ceildivpow2(l_br_prc_x_end, 1);*/ \
/*brcbgyend = opj_int_ceildivpow2(l_br_prc_y_end, 1);*/ \
cbgwidthexpn = l_pdx - 1; \
cbgheightexpn = l_pdy - 1; \
l_res->numbands = 3; \
@ -1635,7 +1635,6 @@ opj_bool opj_tcd_dc_level_shift_decode ( opj_tcd_t *p_tcd )
opj_tccp_t * l_tccp = 00;
opj_image_comp_t * l_img_comp = 00;
opj_tcd_resolution_t* l_res = 00;
opj_tcp_t * l_tcp = 00;
opj_tcd_tile_t * l_tile;
OPJ_UINT32 l_width,l_height,i,j;
OPJ_INT32 * l_current_ptr;
@ -1644,7 +1643,6 @@ opj_bool opj_tcd_dc_level_shift_decode ( opj_tcd_t *p_tcd )
l_tile = p_tcd->tcd_image->tiles;
l_tile_comp = l_tile->comps;
l_tcp = p_tcd->tcp;
l_tccp = p_tcd->tcp->tccps;
l_img_comp = p_tcd->image->comps;
@ -1803,14 +1801,12 @@ opj_bool opj_tcd_dc_level_shift_encode ( opj_tcd_t *p_tcd )
opj_tcd_tilecomp_t * l_tile_comp = 00;
opj_tccp_t * l_tccp = 00;
opj_image_comp_t * l_img_comp = 00;
opj_tcp_t * l_tcp = 00;
opj_tcd_tile_t * l_tile;
OPJ_UINT32 l_nb_elem,i;
OPJ_INT32 * l_current_ptr;
l_tile = p_tcd->tcd_image->tiles;
l_tile_comp = l_tile->comps;
l_tcp = p_tcd->tcp;
l_tccp = p_tcd->tcp->tccps;
l_img_comp = p_tcd->image->comps;