| OLD | NEW |
| 1 /* | 1 /* |
| 2 * The copyright in this software is being made available under the 2-clauses | 2 * The copyright in this software is being made available under the 2-clauses |
| 3 * BSD License, included below. This software may be subject to other third | 3 * BSD License, included below. This software may be subject to other third |
| 4 * party and contributor rights, including patent rights, and no such rights | 4 * party and contributor rights, including patent rights, and no such rights |
| 5 * are granted under this license. | 5 * are granted under this license. |
| 6 * | 6 * |
| 7 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium | 7 * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium |
| 8 * Copyright (c) 2002-2014, Professor Benoit Macq | 8 * Copyright (c) 2002-2014, Professor Benoit Macq |
| 9 * Copyright (c) 2001-2003, David Janssens | 9 * Copyright (c) 2001-2003, David Janssens |
| 10 * Copyright (c) 2002-2003, Yannick Verschueren | 10 * Copyright (c) 2002-2003, Yannick Verschueren |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 * ((OPJ_FLOAT64)(1 << tcd->image->comps[compno].prec) -1
.0)) | 460 * ((OPJ_FLOAT64)(1 << tcd->image->comps[compno].prec) -1
.0)) |
| 461 * ((OPJ_FLOAT64)(tilec->numpix)); | 461 * ((OPJ_FLOAT64)(tilec->numpix)); |
| 462 } /* compno */ | 462 } /* compno */ |
| 463 | 463 |
| 464 /* index file */ | 464 /* index file */ |
| 465 if(cstr_info) { | 465 if(cstr_info) { |
| 466 opj_tile_info_t *tile_info = &cstr_info->tile[tcd->tcd_tileno]; | 466 opj_tile_info_t *tile_info = &cstr_info->tile[tcd->tcd_tileno]; |
| 467 tile_info->numpix = tcd_tile->numpix; | 467 tile_info->numpix = tcd_tile->numpix; |
| 468 tile_info->distotile = tcd_tile->distotile; | 468 tile_info->distotile = tcd_tile->distotile; |
| 469 tile_info->thresh = (OPJ_FLOAT64 *) opj_malloc(tcd_tcp->numlayer
s * sizeof(OPJ_FLOAT64)); | 469 tile_info->thresh = (OPJ_FLOAT64 *) opj_malloc(tcd_tcp->numlayer
s * sizeof(OPJ_FLOAT64)); |
| 470 if (!tile_info->thresh) { |
| 471 /* FIXME event manager error callback */ |
| 472 return OPJ_FALSE; |
| 473 } |
| 470 } | 474 } |
| 471 | 475 |
| 472 for (layno = 0; layno < tcd_tcp->numlayers; layno++) { | 476 for (layno = 0; layno < tcd_tcp->numlayers; layno++) { |
| 473 OPJ_FLOAT64 lo = min; | 477 OPJ_FLOAT64 lo = min; |
| 474 OPJ_FLOAT64 hi = max; | 478 OPJ_FLOAT64 hi = max; |
| 475 OPJ_BOOL success = OPJ_FALSE; | 479 OPJ_BOOL success = OPJ_FALSE; |
| 476 OPJ_UINT32 maxlen = tcd_tcp->rates[layno] ? opj_uint_min(((OPJ_U
INT32) ceil(tcd_tcp->rates[layno])), len) : len; | 480 OPJ_UINT32 maxlen = tcd_tcp->rates[layno] ? opj_uint_min(((OPJ_U
INT32) ceil(tcd_tcp->rates[layno])), len) : len; |
| 477 OPJ_FLOAT64 goodthresh = 0; | 481 OPJ_FLOAT64 goodthresh = 0; |
| 478 OPJ_FLOAT64 stable_thresh = 0; | 482 OPJ_FLOAT64 stable_thresh = 0; |
| 479 OPJ_UINT32 i; | 483 OPJ_UINT32 i; |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 opj_tcd_resolution_t *l_res_idx = &l_tilec_idx->
resolutions[i]; | 1134 opj_tcd_resolution_t *l_res_idx = &l_tilec_idx->
resolutions[i]; |
| 1131 | 1135 |
| 1132 p_cstr_info->tile[p_tile_no].pw[i] = (int)l_res_
idx->pw; | 1136 p_cstr_info->tile[p_tile_no].pw[i] = (int)l_res_
idx->pw; |
| 1133 p_cstr_info->tile[p_tile_no].ph[i] = (int)l_res_
idx->ph; | 1137 p_cstr_info->tile[p_tile_no].ph[i] = (int)l_res_
idx->ph; |
| 1134 | 1138 |
| 1135 l_num_packs += l_res_idx->pw * l_res_idx->ph; | 1139 l_num_packs += l_res_idx->pw * l_res_idx->ph; |
| 1136 p_cstr_info->tile[p_tile_no].pdx[i] = (int)l_tcc
p->prcw[i]; | 1140 p_cstr_info->tile[p_tile_no].pdx[i] = (int)l_tcc
p->prcw[i]; |
| 1137 p_cstr_info->tile[p_tile_no].pdy[i] = (int)l_tcc
p->prch[i]; | 1141 p_cstr_info->tile[p_tile_no].pdy[i] = (int)l_tcc
p->prch[i]; |
| 1138 } | 1142 } |
| 1139 p_cstr_info->tile[p_tile_no].packet = (opj_packet_info_t
*) opj_calloc((size_t)p_cstr_info->numcomps * (size_t)p_cstr_info->numlayers * l
_num_packs, sizeof(opj_packet_info_t)); | 1143 p_cstr_info->tile[p_tile_no].packet = (opj_packet_info_t
*) opj_calloc((size_t)p_cstr_info->numcomps * (size_t)p_cstr_info->numlayers * l
_num_packs, sizeof(opj_packet_info_t)); |
| 1144 if (!p_cstr_info->tile[p_tile_no].packet) { |
| 1145 /* FIXME event manager error callback */ |
| 1146 return OPJ_FALSE; |
| 1147 } |
| 1140 } | 1148 } |
| 1141 /* << INDEX */ | 1149 /* << INDEX */ |
| 1142 | 1150 |
| 1143 /* FIXME _ProfStart(PGROUP_DC_SHIFT); */ | 1151 /* FIXME _ProfStart(PGROUP_DC_SHIFT); */ |
| 1144 /*---------------TILE-------------------*/ | 1152 /*---------------TILE-------------------*/ |
| 1145 if (! opj_tcd_dc_level_shift_encode(p_tcd)) { | 1153 if (! opj_tcd_dc_level_shift_encode(p_tcd)) { |
| 1146 return OPJ_FALSE; | 1154 return OPJ_FALSE; |
| 1147 } | 1155 } |
| 1148 /* FIXME _ProfStop(PGROUP_DC_SHIFT); */ | 1156 /* FIXME _ProfStop(PGROUP_DC_SHIFT); */ |
| 1149 | 1157 |
| (...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2122 } | 2130 } |
| 2123 break; | 2131 break; |
| 2124 } | 2132 } |
| 2125 | 2133 |
| 2126 ++l_img_comp; | 2134 ++l_img_comp; |
| 2127 ++l_tilec; | 2135 ++l_tilec; |
| 2128 } | 2136 } |
| 2129 | 2137 |
| 2130 return OPJ_TRUE; | 2138 return OPJ_TRUE; |
| 2131 } | 2139 } |
| OLD | NEW |