bug fixed when asking for an index with more than (layer*resolutions*100) packets per tile (2nd correction)
This commit is contained in:
parent
a0513798bb
commit
ac634b1639
|
@ -1312,7 +1312,7 @@ tcd_encode_tile_pgx(int tileno, unsigned char *dest, int len,
|
||||||
info_image * info_IM)
|
info_image * info_IM)
|
||||||
{
|
{
|
||||||
int compno;
|
int compno;
|
||||||
int l, i;
|
int l, i, npck=0;
|
||||||
clock_t time;
|
clock_t time;
|
||||||
tcd_tile_t *tile;
|
tcd_tile_t *tile;
|
||||||
j2k_tcp_t *tcp = &tcd_cp->tcps[0];
|
j2k_tcp_t *tcp = &tcd_cp->tcps[0];
|
||||||
|
@ -1323,31 +1323,24 @@ tcd_encode_tile_pgx(int tileno, unsigned char *dest, int len,
|
||||||
tcd_tcp = &tcd_cp->tcps[tileno];
|
tcd_tcp = &tcd_cp->tcps[tileno];
|
||||||
tile = tcd_tile;
|
tile = tcd_tile;
|
||||||
/* INDEX >> "Precinct_nb_X et Precinct_nb_Y" */
|
/* INDEX >> "Precinct_nb_X et Precinct_nb_Y" */
|
||||||
|
|
||||||
if (info_IM->index_on) {
|
if (info_IM->index_on) {
|
||||||
|
|
||||||
tcd_tilecomp_t *tilec_idx = &tile->comps[0]; //Based on Component 0
|
tcd_tilecomp_t *tilec_idx = &tile->comps[0]; //Based on Component 0
|
||||||
|
|
||||||
for (i = 0; i < tilec_idx->numresolutions; i++) {
|
for (i = 0; i < tilec_idx->numresolutions; i++) {
|
||||||
|
|
||||||
tcd_resolution_t *res_idx = &tilec_idx->resolutions[i];
|
tcd_resolution_t *res_idx = &tilec_idx->resolutions[i];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
info_IM->tile[tileno].pw[i] = res_idx->pw;
|
info_IM->tile[tileno].pw[i] = res_idx->pw;
|
||||||
|
|
||||||
info_IM->tile[tileno].ph[i] = res_idx->ph;
|
info_IM->tile[tileno].ph[i] = res_idx->ph;
|
||||||
|
|
||||||
|
npck+=res_idx->pw * res_idx->ph;
|
||||||
|
|
||||||
info_IM->tile[tileno].pdx[i] = tccp->prcw[i];
|
info_IM->tile[tileno].pdx[i] = tccp->prcw[i];
|
||||||
|
|
||||||
info_IM->tile[tileno].pdy[i] = tccp->prch[i];
|
info_IM->tile[tileno].pdy[i] = tccp->prch[i];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
info_IM->tile[tileno].packet = (info_packet *) calloc(info_IM->Comp * info_IM->Layer * npck, sizeof(info_packet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* << INDEX */
|
/* << INDEX */
|
||||||
/*---------------TILE-------------------*/
|
/*---------------TILE-------------------*/
|
||||||
time = clock();
|
time = clock();
|
||||||
|
|
Loading…
Reference in New Issue