Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove comments and unused code link to MSD marked comments #874

Open
wants to merge 9 commits into
base: openjpeg-2.1
Choose a base branch
from
Prev Previous commit
remove unused code related to index recording which is not really fun…
…ctionnal
  • Loading branch information
savmickael committed Dec 10, 2016
commit 5c1e99867c3ce229828a70ca2b56e17ff9848a70
44 changes: 0 additions & 44 deletions src/lib/openjp2/t2.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ OPJ_BOOL opj_t2_encode_packets( opj_t2_t* p_t2,
for (poc = 0; poc < pocno ; ++poc) {
OPJ_UINT32 l_tp_num = compno;

/* TODO MSD : check why this function cannot fail (cf. v1) */
opj_pi_create_encode(l_pi, l_cp,p_tile_no,poc,l_tp_num,p_tp_pos,p_t2_mode);

if (l_current_pi->poc.prg == OPJ_PROG_UNKNOWN) {
Expand Down Expand Up @@ -362,21 +361,9 @@ OPJ_BOOL opj_t2_decode_packets( opj_t2_t *p_t2,
OPJ_UINT32 l_nb_bytes_read;
OPJ_UINT32 l_nb_pocs = l_tcp->numpocs + 1;
opj_pi_iterator_t *l_current_pi = 00;
#ifdef TODO_MSD
OPJ_UINT32 curtp = 0;
OPJ_UINT32 tp_start_packno;
#endif
opj_packet_info_t *l_pack_info = 00;
opj_image_comp_t* l_img_comp = 00;

OPJ_ARG_NOT_USED(p_cstr_index);

#ifdef TODO_MSD
if (p_cstr_index) {
l_pack_info = p_cstr_index->tile_index[p_tile_no].packet;
}
#endif

/* create a packet iterator */
l_pi = opj_pi_create_decode(l_image, l_cp, p_tile_no);
if (!l_pi) {
Expand Down Expand Up @@ -446,41 +433,11 @@ OPJ_BOOL opj_t2_decode_packets( opj_t2_t *p_t2,
l_current_data += l_nb_bytes_read;
p_max_len -= l_nb_bytes_read;

/* INDEX >> */
#ifdef TODO_MSD
if(p_cstr_info) {
opj_tile_info_v2_t *info_TL = &p_cstr_info->tile[p_tile_no];
opj_packet_info_t *info_PK = &info_TL->packet[p_cstr_info->packno];
tp_start_packno = 0;
if (!p_cstr_info->packno) {
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 */
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;
curtp++;
info_PK->start_pos = p_cstr_info->tile[p_tile_no].tp[curtp].tp_end_header+1;
} else {
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 */
++p_cstr_info->packno;
}
#endif
/* << INDEX */
}
++l_current_pi;

opj_free(first_pass_failed);
}
/* INDEX >> */
#ifdef TODO_MSD
if
(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 */
}
#endif
/* << INDEX */

/* don't forget to release pi */
opj_pi_destroy(l_pi,l_nb_pocs);
Expand Down Expand Up @@ -941,7 +898,6 @@ static OPJ_BOOL opj_t2_read_packet_header( opj_t2_t* p_t2,
l_present = opj_bio_read(l_bio, 1);
JAS_FPRINTF(stderr, "present=%d \n", l_present );
if (!l_present) {
/* TODO MSD: no test to control the output of this function*/
opj_bio_inalign(l_bio);
l_header_data += opj_bio_numbytes(l_bio);
opj_bio_destroy(l_bio);
Expand Down