OPJ_FLOAT64 lo = min;
OPJ_FLOAT64 hi = max;
opj_bool success = OPJ_FALSE;
- OPJ_UINT32 maxlen = tcd_tcp->rates[layno] ? uint_min(((OPJ_UINT32) ceil(tcd_tcp->rates[layno])), len) : len;
+ OPJ_UINT32 maxlen = tcd_tcp->rates[layno] ? opj_uint_min(((OPJ_UINT32) ceil(tcd_tcp->rates[layno])), len) : len;
OPJ_FLOAT64 goodthresh = 0;
OPJ_FLOAT64 stable_thresh = 0;
OPJ_UINT32 i;
/*fprintf(stderr, "Tile coordinate = %d,%d\n", p, q);*/ \
\
/* 4 borders of the tile rescale on the image if necessary */ \
- l_tile->x0 = int_max(l_cp->tx0 + p * l_cp->tdx, l_image->x0); \
- l_tile->y0 = int_max(l_cp->ty0 + q * l_cp->tdy, l_image->y0); \
- l_tile->x1 = int_min(l_cp->tx0 + (p + 1) * l_cp->tdx, l_image->x1); \
- l_tile->y1 = int_min(l_cp->ty0 + (q + 1) * l_cp->tdy, l_image->y1); \
+ l_tile->x0 = opj_int_max(l_cp->tx0 + p * l_cp->tdx, l_image->x0); \
+ l_tile->y0 = opj_int_max(l_cp->ty0 + q * l_cp->tdy, l_image->y0); \
+ l_tile->x1 = opj_int_min(l_cp->tx0 + (p + 1) * l_cp->tdx, l_image->x1); \
+ l_tile->y1 = opj_int_min(l_cp->ty0 + (q + 1) * l_cp->tdy, l_image->y1); \
/*fprintf(stderr, "Tile border = %d,%d,%d,%d\n", l_tile->x0, l_tile->y0,l_tile->x1,l_tile->y1);*/ \
\
/*tile->numcomps = image->numcomps; */ \
/*fprintf(stderr, "compno = %d/%d\n", compno, l_tile->numcomps);*/ \
\
/* border of each l_tile component (global) */ \
- l_tilec->x0 = int_ceildiv(l_tile->x0, l_image_comp->dx); \
- l_tilec->y0 = int_ceildiv(l_tile->y0, l_image_comp->dy); \
- l_tilec->x1 = int_ceildiv(l_tile->x1, l_image_comp->dx); \
- l_tilec->y1 = int_ceildiv(l_tile->y1, l_image_comp->dy); \
+ l_tilec->x0 = opj_int_ceildiv(l_tile->x0, l_image_comp->dx); \
+ l_tilec->y0 = opj_int_ceildiv(l_tile->y0, l_image_comp->dy); \
+ l_tilec->x1 = opj_int_ceildiv(l_tile->x1, l_image_comp->dx); \
+ l_tilec->y1 = opj_int_ceildiv(l_tile->y1, l_image_comp->dy); \
/*fprintf(stderr, "\tTile compo border = %d,%d,%d,%d\n", l_tilec->x0, l_tilec->y0,l_tilec->x1,l_tilec->y1);*/ \
\
l_data_size = (l_tilec->x1 - l_tilec->x0) \
OPJ_UINT32 cblkwidthexpn, cblkheightexpn; \
\
/* border for each resolution level (global) */ \
- l_res->x0 = int_ceildivpow2(l_tilec->x0, l_level_no); \
- l_res->y0 = int_ceildivpow2(l_tilec->y0, l_level_no); \
- l_res->x1 = int_ceildivpow2(l_tilec->x1, l_level_no); \
- l_res->y1 = int_ceildivpow2(l_tilec->y1, l_level_no); \
+ l_res->x0 = opj_int_ceildivpow2(l_tilec->x0, l_level_no); \
+ l_res->y0 = opj_int_ceildivpow2(l_tilec->y0, l_level_no); \
+ l_res->x1 = opj_int_ceildivpow2(l_tilec->x1, l_level_no); \
+ l_res->y1 = opj_int_ceildivpow2(l_tilec->y1, l_level_no); \
/*fprintf(stderr, "\t\t\tres_x0= %d, res_y0 =%d, res_x1=%d, res_y1=%d\n", l_res->x0, l_res->y0, l_res->x1, l_res->y1);*/ \
/* p. 35, table A-23, ISO/IEC FDIS154444-1 : 2000 (18 august 2000) */ \
l_pdx = l_tccp->prcw[resno]; \
l_pdy = l_tccp->prch[resno]; \
/*fprintf(stderr, "\t\t\tpdx=%d, pdy=%d\n", l_pdx, l_pdy);*/ \
/* p. 64, B.6, ISO/IEC FDIS15444-1 : 2000 (18 august 2000) */ \
- l_tl_prc_x_start = int_floordivpow2(l_res->x0, l_pdx) << l_pdx; \
- l_tl_prc_y_start = int_floordivpow2(l_res->y0, l_pdy) << l_pdy; \
- l_br_prc_x_end = int_ceildivpow2(l_res->x1, l_pdx) << l_pdx; \
- l_br_prc_y_end = int_ceildivpow2(l_res->y1, l_pdy) << l_pdy; \
+ l_tl_prc_x_start = opj_int_floordivpow2(l_res->x0, l_pdx) << l_pdx; \
+ l_tl_prc_y_start = opj_int_floordivpow2(l_res->y0, l_pdy) << l_pdy; \
+ l_br_prc_x_end = opj_int_ceildivpow2(l_res->x1, l_pdx) << l_pdx; \
+ l_br_prc_y_end = opj_int_ceildivpow2(l_res->y1, l_pdy) << l_pdy; \
/*fprintf(stderr, "\t\t\tprc_x_start=%d, prc_y_start=%d, br_prc_x_end=%d, br_prc_y_end=%d \n", l_tl_prc_x_start, l_tl_prc_y_start, l_br_prc_x_end ,l_br_prc_y_end );*/ \
\
l_res->pw = (l_res->x0 == l_res->x1) ? 0 : ((l_br_prc_x_end - l_tl_prc_x_start) >> l_pdx); \
l_res->numbands = 1; \
} \
else { \
- tlcbgxstart = int_ceildivpow2(l_tl_prc_x_start, 1); \
- tlcbgystart = int_ceildivpow2(l_tl_prc_y_start, 1); \
- brcbgxend = int_ceildivpow2(l_br_prc_x_end, 1); \
- brcbgyend = int_ceildivpow2(l_br_prc_y_end, 1); \
+ 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); \
cbgwidthexpn = l_pdx - 1; \
cbgheightexpn = l_pdy - 1; \
l_res->numbands = 3; \
} \
\
- cblkwidthexpn = uint_min(l_tccp->cblkw, cbgwidthexpn); \
- cblkheightexpn = uint_min(l_tccp->cblkh, cbgheightexpn); \
+ cblkwidthexpn = opj_uint_min(l_tccp->cblkw, cbgwidthexpn); \
+ cblkheightexpn = opj_uint_min(l_tccp->cblkh, cbgheightexpn); \
l_band = l_res->bands; \
\
for (bandno = 0; bandno < l_res->numbands; ++bandno) { \
\
if (resno == 0) { \
l_band->bandno = 0 ; \
- l_band->x0 = int_ceildivpow2(l_tilec->x0, l_level_no); \
- l_band->y0 = int_ceildivpow2(l_tilec->y0, l_level_no); \
- l_band->x1 = int_ceildivpow2(l_tilec->x1, l_level_no); \
- l_band->y1 = int_ceildivpow2(l_tilec->y1, l_level_no); \
+ l_band->x0 = opj_int_ceildivpow2(l_tilec->x0, l_level_no); \
+ l_band->y0 = opj_int_ceildivpow2(l_tilec->y0, l_level_no); \
+ l_band->x1 = opj_int_ceildivpow2(l_tilec->x1, l_level_no); \
+ l_band->y1 = opj_int_ceildivpow2(l_tilec->y1, l_level_no); \
} \
else { \
l_band->bandno = bandno + 1; \
/* y0b = 1 if bandno = 2 or 3 */ \
l_y0b = (l_band->bandno)>>1; \
/* l_band border (global) */ \
- l_band->x0 = int_ceildivpow2(l_tilec->x0 - (1 << l_level_no) * l_x0b, l_level_no + 1); \
- l_band->y0 = int_ceildivpow2(l_tilec->y0 - (1 << l_level_no) * l_y0b, l_level_no + 1); \
- l_band->x1 = int_ceildivpow2(l_tilec->x1 - (1 << l_level_no) * l_x0b, l_level_no + 1); \
- l_band->y1 = int_ceildivpow2(l_tilec->y1 - (1 << l_level_no) * l_y0b, l_level_no + 1); \
+ l_band->x0 = opj_int_ceildivpow2(l_tilec->x0 - (1 << l_level_no) * l_x0b, l_level_no + 1); \
+ l_band->y0 = opj_int_ceildivpow2(l_tilec->y0 - (1 << l_level_no) * l_y0b, l_level_no + 1); \
+ l_band->x1 = opj_int_ceildivpow2(l_tilec->x1 - (1 << l_level_no) * l_x0b, l_level_no + 1); \
+ l_band->y1 = opj_int_ceildivpow2(l_tilec->y1 - (1 << l_level_no) * l_y0b, l_level_no + 1); \
} \
\
/** avoid an if with storing function pointer */ \
/* precinct size (global) */ \
/*fprintf(stderr, "\t cbgxstart=%d, l_band->x0 = %d \n",cbgxstart, l_band->x0);*/ \
\
- l_current_precinct->x0 = int_max(cbgxstart, l_band->x0); \
- l_current_precinct->y0 = int_max(cbgystart, l_band->y0); \
- l_current_precinct->x1 = int_min(cbgxend, l_band->x1); \
- l_current_precinct->y1 = int_min(cbgyend, l_band->y1); \
+ l_current_precinct->x0 = opj_int_max(cbgxstart, l_band->x0); \
+ l_current_precinct->y0 = opj_int_max(cbgystart, l_band->y0); \
+ l_current_precinct->x1 = opj_int_min(cbgxend, l_band->x1); \
+ l_current_precinct->y1 = opj_int_min(cbgyend, l_band->y1); \
/*fprintf(stderr, "\t prc_x0=%d; prc_y0=%d, prc_x1=%d; prc_y1=%d\n",l_current_precinct->x0, l_current_precinct->y0 ,l_current_precinct->x1, l_current_precinct->y1);*/ \
\
- tlcblkxstart = int_floordivpow2(l_current_precinct->x0, cblkwidthexpn) << cblkwidthexpn; \
+ tlcblkxstart = opj_int_floordivpow2(l_current_precinct->x0, cblkwidthexpn) << cblkwidthexpn; \
/*fprintf(stderr, "\t tlcblkxstart =%d\n",tlcblkxstart );*/ \
- tlcblkystart = int_floordivpow2(l_current_precinct->y0, cblkheightexpn) << cblkheightexpn; \
+ tlcblkystart = opj_int_floordivpow2(l_current_precinct->y0, cblkheightexpn) << cblkheightexpn; \
/*fprintf(stderr, "\t tlcblkystart =%d\n",tlcblkystart );*/ \
- brcblkxend = int_ceildivpow2(l_current_precinct->x1, cblkwidthexpn) << cblkwidthexpn; \
+ brcblkxend = opj_int_ceildivpow2(l_current_precinct->x1, cblkwidthexpn) << cblkwidthexpn; \
/*fprintf(stderr, "\t brcblkxend =%d\n",brcblkxend );*/ \
- brcblkyend = int_ceildivpow2(l_current_precinct->y1, cblkheightexpn) << cblkheightexpn; \
+ brcblkyend = opj_int_ceildivpow2(l_current_precinct->y1, cblkheightexpn) << cblkheightexpn; \
/*fprintf(stderr, "\t brcblkyend =%d\n",brcblkyend );*/ \
l_current_precinct->cw = (brcblkxend - tlcblkxstart) >> cblkwidthexpn; \
l_current_precinct->ch = (brcblkyend - tlcblkystart) >> cblkheightexpn; \
} \
\
if (! l_current_precinct->incltree) { \
- l_current_precinct->incltree = tgt_create_v2(l_current_precinct->cw, \
+ l_current_precinct->incltree = opj_tgt_create(l_current_precinct->cw, \
l_current_precinct->ch); \
} \
else{ \
- l_current_precinct->incltree = tgt_init(l_current_precinct->incltree, \
+ l_current_precinct->incltree = opj_tgt_init(l_current_precinct->incltree, \
l_current_precinct->cw, \
l_current_precinct->ch); \
} \
} \
\
if (! l_current_precinct->imsbtree) { \
- l_current_precinct->imsbtree = tgt_create_v2( \
+ l_current_precinct->imsbtree = opj_tgt_create( \
l_current_precinct->cw, \
l_current_precinct->ch); \
} \
else { \
- l_current_precinct->imsbtree = tgt_init( \
+ l_current_precinct->imsbtree = opj_tgt_init( \
l_current_precinct->imsbtree, \
l_current_precinct->cw, \
l_current_precinct->ch); \
OPJ_INT32 cblkyend = cblkystart + (1 << cblkheightexpn); \
\
/* code-block size (global) */ \
- l_code_block->x0 = int_max(cblkxstart, l_current_precinct->x0); \
- l_code_block->y0 = int_max(cblkystart, l_current_precinct->y0); \
- l_code_block->x1 = int_min(cblkxend, l_current_precinct->x1); \
- l_code_block->y1 = int_min(cblkyend, l_current_precinct->y1); \
+ l_code_block->x0 = opj_int_max(cblkxstart, l_current_precinct->x0); \
+ l_code_block->y0 = opj_int_max(cblkystart, l_current_precinct->y0); \
+ l_code_block->x1 = opj_int_min(cblkxend, l_current_precinct->x1); \
+ l_code_block->y1 = opj_int_min(cblkyend, l_current_precinct->y1); \
\
if (! FUNCTION_ELEMENT(l_code_block)) { \
return OPJ_FALSE; \
l_nb_precincts = l_band->precincts_data_size / sizeof(opj_tcd_precinct_v2_t);
for (precno = 0; precno < l_nb_precincts; ++precno) {
- tgt_destroy(l_precinct->incltree);
+ opj_tgt_destroy(l_precinct->incltree);
l_precinct->incltree = 00;
- tgt_destroy(l_precinct->imsbtree);
+ opj_tgt_destroy(l_precinct->imsbtree);
l_precinct->imsbtree = 00;
(*l_tcd_code_block_deallocate) (l_precinct);
++l_precinct;
++l_tile_comp;
}
- if (! mct_decode_custom(/* MCT data */
+ if (! opj_mct_decode_custom(/* MCT data */
(OPJ_BYTE*) l_tcp->m_mct_decoding_matrix,
/* size of components */
l_samples,
}
else {
if (l_tcp->tccps->qmfbid == 1) {
- mct_decode( l_tile->comps[0].data,
+ opj_mct_decode( l_tile->comps[0].data,
l_tile->comps[1].data,
l_tile->comps[2].data,
l_samples);
}
else {
- mct_decode_real( (float*)l_tile->comps[0].data,
+ opj_mct_decode_real( (float*)l_tile->comps[0].data,
(float*)l_tile->comps[1].data,
(float*)l_tile->comps[2].data,
l_samples);
if (l_tccp->qmfbid == 1) {
for (j=0;j<l_height;++j) {
for (i = 0; i < l_width; ++i) {
- *l_current_ptr = int_clamp(*l_current_ptr + l_tccp->m_dc_level_shift, l_min, l_max);
+ *l_current_ptr = opj_int_clamp(*l_current_ptr + l_tccp->m_dc_level_shift, l_min, l_max);
++l_current_ptr;
}
l_current_ptr += l_stride;
for (j=0;j<l_height;++j) {
for (i = 0; i < l_width; ++i) {
OPJ_FLOAT32 l_value = *((OPJ_FLOAT32 *) l_current_ptr);
- *l_current_ptr = int_clamp(lrintf(l_value) + l_tccp->m_dc_level_shift, l_min, l_max); ;
+ *l_current_ptr = opj_int_clamp(lrintf(l_value) + l_tccp->m_dc_level_shift, l_min, l_max); ;
++l_current_ptr;
}
l_current_ptr += l_stride;
++l_tile_comp;
}
- if (! mct_encode_custom(/* MCT data */
+ if (! opj_mct_encode_custom(/* MCT data */
(OPJ_BYTE*) p_tcd->tcp->m_mct_coding_matrix,
/* size of components */
samples,
opj_free(l_data);
}
else if (l_tcp->tccps->qmfbid == 0) {
- mct_encode_real(l_tile->comps[0].data, l_tile->comps[1].data, l_tile->comps[2].data, samples);
+ opj_mct_encode_real(l_tile->comps[0].data, l_tile->comps[1].data, l_tile->comps[2].data, samples);
}
else {
- mct_encode(l_tile->comps[0].data, l_tile->comps[1].data, l_tile->comps[2].data, samples);
+ opj_mct_encode(l_tile->comps[0].data, l_tile->comps[1].data, l_tile->comps[2].data, samples);
}
return OPJ_TRUE;
if (l_tcp->mct == 1) {
/* irreversible encoding */
if (l_tcp->tccps->qmfbid == 0) {
- l_mct_norms = get_mct_norms_real();
+ l_mct_norms = opj_mct_get_mct_norms_real();
}
else {
- l_mct_norms = get_mct_norms();
+ l_mct_norms = opj_mct_get_mct_norms();
}
}
else {