From bd2c6cfa558682b9ba3e0e4cfa71231cd4d71564 Mon Sep 17 00:00:00 2001 From: Mickael Savinaud Date: Wed, 3 Oct 2012 12:43:15 +0000 Subject: [PATCH] [trunk] replace pi_next by opj_pi_next --- src/lib/openjp2/pi.c | 18 +++++++++--------- src/lib/openjp2/pi.h | 2 +- src/lib/openjp2/t2.c | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lib/openjp2/pi.c b/src/lib/openjp2/pi.c index b0de53dc..e59571b6 100644 --- a/src/lib/openjp2/pi.c +++ b/src/lib/openjp2/pi.c @@ -412,12 +412,12 @@ opj_bool opj_pi_next_cprl(opj_pi_iterator_t * pi) { } for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) { - OPJ_UINT32 resno; + int resno; comp = &pi->comps[pi->compno]; pi->dx = 0; pi->dy = 0; for (resno = 0; resno < comp->numresolutions; resno++) { - OPJ_UINT32 dx, dy; + int dx, dy; res = &comp->resolutions[resno]; dx = comp->dx * (1 << (res->pdx + comp->numresolutions - 1 - resno)); dy = comp->dy * (1 << (res->pdy + comp->numresolutions - 1 - resno)); @@ -432,12 +432,12 @@ opj_bool opj_pi_next_cprl(opj_pi_iterator_t * pi) { } for (pi->y = pi->poc.ty0; pi->y < pi->poc.ty1; pi->y += pi->dy - (pi->y % pi->dy)) { for (pi->x = pi->poc.tx0; pi->x < pi->poc.tx1; pi->x += pi->dx - (pi->x % pi->dx)) { - for (pi->resno = pi->poc.resno0; pi->resno < uint_min(pi->poc.resno1, comp->numresolutions); pi->resno++) { - OPJ_UINT32 levelno; - OPJ_INT32 trx0, try0; - OPJ_INT32 trx1, try1; - OPJ_UINT32 rpx, rpy; - OPJ_INT32 prci, prcj; + for (pi->resno = pi->poc.resno0; pi->resno < int_min(pi->poc.resno1, comp->numresolutions); pi->resno++) { + int levelno; + int trx0, try0; + int trx1, try1; + int rpx, rpy; + int prci, prcj; res = &comp->resolutions[pi->resno]; levelno = comp->numresolutions - 1 - pi->resno; trx0 = int_ceildiv(pi->tx0, comp->dx << levelno); @@ -1170,7 +1170,7 @@ void pi_destroy(opj_pi_iterator_t *pi, opj_cp_t *cp, int tileno) { } } -opj_bool pi_next(opj_pi_iterator_t * pi) { +opj_bool opj_pi_next(opj_pi_iterator_t * pi) { switch (pi->poc.prg) { case LRCP: return opj_pi_next_lrcp(pi); diff --git a/src/lib/openjp2/pi.h b/src/lib/openjp2/pi.h index cae0f88a..061e3e20 100644 --- a/src/lib/openjp2/pi.h +++ b/src/lib/openjp2/pi.h @@ -207,7 +207,7 @@ Modify the packet iterator to point to the next packet @param pi Packet iterator to modify @return Returns false if pi pointed to the last packet or else returns true */ -opj_bool pi_next(opj_pi_iterator_t * pi); +opj_bool opj_pi_next(opj_pi_iterator_t * pi); /* ----------------------------------------------------------------------- */ /*@}*/ diff --git a/src/lib/openjp2/t2.c b/src/lib/openjp2/t2.c index 926007c6..8dbb22ba 100644 --- a/src/lib/openjp2/t2.c +++ b/src/lib/openjp2/t2.c @@ -235,7 +235,7 @@ opj_bool opj_t2_encode_packets( opj_t2_v2_t* p_t2, /* TODO MSD : check why this function cannot fail (cf. v1) */ pi_create_encode_v2(l_pi, l_cp,p_tile_no,poc,l_tp_num,p_tp_pos,p_t2_mode); - while (pi_next(l_current_pi)) { + while (opj_pi_next(l_current_pi)) { if (l_current_pi->layno < p_maxlayers) { l_nb_bytes = 0; @@ -268,7 +268,7 @@ opj_bool opj_t2_encode_packets( opj_t2_v2_t* p_t2, l_current_pi = &l_pi[p_pino]; - while (pi_next(l_current_pi)) { + while (opj_pi_next(l_current_pi)) { if (l_current_pi->layno < p_maxlayers) { l_nb_bytes=0; @@ -358,7 +358,7 @@ opj_bool opj_t2_decode_packets( opj_t2_v2_t *p_t2, opj_bool* first_pass_failed = (opj_bool*)opj_malloc(l_image->numcomps * sizeof(opj_bool)); memset(first_pass_failed, OPJ_TRUE, l_image->numcomps * sizeof(opj_bool)); - while (pi_next(l_current_pi)) { + while (opj_pi_next(l_current_pi)) { if (l_tcp->num_layers_to_decode > l_current_pi->layno -- 2.40.0