]> Creatis software - gdcm.git/commitdiff
COMP: screw me, I forgot to checkin those things I send to jasper ML...
authormalaterre <malaterre>
Sat, 11 Jun 2005 02:05:14 +0000 (02:05 +0000)
committermalaterre <malaterre>
Sat, 11 Jun 2005 02:05:14 +0000 (02:05 +0000)
src/gdcmjasper/src/libjasper/jpc/jpc_cs.c
src/gdcmjasper/src/libjasper/jpc/jpc_enc.c
src/gdcmjasper/src/libjasper/jpc/jpc_t1cod.c
src/gdcmjasper/src/libjasper/jpc/jpc_t1cod.h
src/gdcmjasper/src/libjasper/pnm/pnm_dec.c

index 63daee25f995c7463c5725b8d1c2be22fbaaefd8..12b45793546f83d813d80dd121309726551c04b6 100644 (file)
@@ -64,7 +64,7 @@
 /*
  * JPEG-2000 Code Stream Library
  *
- * $Id: jpc_cs.c,v 1.1 2005/05/22 18:33:04 malaterre Exp $
+ * $Id: jpc_cs.c,v 1.2 2005/06/11 02:05:14 malaterre Exp $
  */
 
 /******************************************************************************\
@@ -689,7 +689,7 @@ static int jpc_coc_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *ou
   jpc_coc_t *coc = &ms->parms.coc;
   assert(coc->compparms.numdlvls <= 32);
   if (cstate->numcomps <= 256) {
-    if (jpc_putuint8(out, coc->compno)) {
+    if (jpc_putuint8(out, (uint_fast8_t)coc->compno)) {
       return -1;
     }
   } else {
@@ -823,7 +823,7 @@ static int jpc_rgn_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *ou
 {
   jpc_rgn_t *rgn = &ms->parms.rgn;
   if (cstate->numcomps <= 256) {
-    if (jpc_putuint8(out, rgn->compno)) {
+    if (jpc_putuint8(out, (uint_fast8_t)rgn->compno)) {
       return -1;
     }
   } else {
@@ -920,7 +920,7 @@ static int jpc_qcc_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *ou
 {
   jpc_qcc_t *qcc = &ms->parms.qcc;
   if (cstate->numcomps <= 256) {
-    jpc_putuint8(out, qcc->compno);
+    jpc_putuint8(out, (uint_fast8_t)qcc->compno);
   } else {
     jpc_putuint16(out, qcc->compno);
   }
@@ -1281,12 +1281,12 @@ static int jpc_poc_putparms(jpc_ms_t *ms, jpc_cstate_t *cstate, jas_stream_t *ou
     if (jpc_putuint8(out, pchg->rlvlnostart) ||
       ((cstate->numcomps > 256) ?
       jpc_putuint16(out, pchg->compnostart) :
-      jpc_putuint8(out, pchg->compnostart)) ||
+      jpc_putuint8(out, (uint_fast8_t)pchg->compnostart)) ||
       jpc_putuint16(out, pchg->lyrnoend) ||
       jpc_putuint8(out, pchg->rlvlnoend) ||
       ((cstate->numcomps > 256) ?
       jpc_putuint16(out, pchg->compnoend) :
-      jpc_putuint8(out, pchg->compnoend)) ||
+      jpc_putuint8(out, (uint_fast8_t)pchg->compnoend)) ||
       jpc_putuint8(out, pchg->prgord)) {
       return -1;
     }
index 06deb15cb61a988c839000e35c1587a8fc627151..ec13ad23b274fdf7ff75ed5efd51e3aaac2f83dc 100644 (file)
@@ -62,7 +62,7 @@
  */
 
 /*
- * $Id: jpc_enc.c,v 1.4 2005/06/09 22:09:41 malaterre Exp $
+ * $Id: jpc_enc.c,v 1.5 2005/06/11 02:05:20 malaterre Exp $
  */
 
 /******************************************************************************\
@@ -798,7 +798,7 @@ int ratestrtosize(char *s, uint_fast32_t rawsize, uint_fast32_t *size)
     } else if (f > 1.0) {
       *size = rawsize + 1;
     } else {
-      *size = f * rawsize;
+      *size = (uint_fast32_t)(f * rawsize);
     }
   }
   (void)cp; /* 'cp' is assigned a value that is never used in function ratestrtosize */
@@ -1037,8 +1037,8 @@ startoff = jas_stream_getrwcount(enc->out);
   cod->mctrans = (cp->tcp.mctid != JPC_MCT_NONE);
   if (tccp->csty & JPC_COX_PRT) {
     for (rlvlno = 0; rlvlno < tccp->maxrlvls; ++rlvlno) {
-      cod->compparms.rlvls[rlvlno].parwidthval = tccp->prcwidthexpns[rlvlno];
-      cod->compparms.rlvls[rlvlno].parheightval = tccp->prcheightexpns[rlvlno];
+      cod->compparms.rlvls[rlvlno].parwidthval = (uint_fast8_t)tccp->prcwidthexpns[rlvlno];
+      cod->compparms.rlvls[rlvlno].parheightval = (uint_fast8_t)tccp->prcheightexpns[rlvlno];
     }
   }
   if (jpc_putms(enc->out, enc->cstate, enc->mrk)) {
@@ -1389,14 +1389,14 @@ if (jpc_enc_enccblks(enc)) {
     rho = (double) (tile->brx - tile->tlx) * (tile->bry - tile->tly) /
       ((cp->refgrdwidth - cp->imgareatlx) * (cp->refgrdheight -
       cp->imgareatly));
-    tile->rawsize = cp->rawsize * rho;
+    tile->rawsize = (uint_fast32_t)(cp->rawsize * rho);
 
     for (lyrno = 0; lyrno < tile->numlyrs - 1; ++lyrno) {
-      tile->lyrsizes[lyrno] = tile->rawsize * jpc_fixtodbl(
-        cp->tcp.ilyrrates[lyrno]);
+      tile->lyrsizes[lyrno] = (uint_fast32_t)(tile->rawsize * jpc_fixtodbl(
+        cp->tcp.ilyrrates[lyrno]));
     }
-    tile->lyrsizes[tile->numlyrs - 1] = (cp->totalsize != UINT_FAST32_MAX) ?
-      (rho * enc->mainbodysize) : UINT_FAST32_MAX;
+    tile->lyrsizes[tile->numlyrs - 1] = (uint_fast32_t)((cp->totalsize != UINT_FAST32_MAX) ?
+      (rho * enc->mainbodysize) : UINT_FAST32_MAX);
     for (lyrno = 0; lyrno < tile->numlyrs; ++lyrno) {
       if (tile->lyrsizes[lyrno] != UINT_FAST32_MAX) {
         if (tilehdrlen <= JAS_CAST(long, tile->lyrsizes[lyrno])) {
index ba6b098c4d4fc1e3306792c469b0f40d162ad085..93f625dc46c2f6462fe39c15f0f3aa72195a2a00 100644 (file)
@@ -62,7 +62,7 @@
  */
 
 /*
- * $Id: jpc_t1cod.c,v 1.1 2005/05/22 18:33:05 malaterre Exp $
+ * $Id: jpc_t1cod.c,v 1.2 2005/06/11 02:05:27 malaterre Exp $
  */
 
 /******************************************************************************\
@@ -264,17 +264,17 @@ jpc_initmqctxs();
   }
 
   for (i = 0; i < (1 << JPC_NMSEDEC_BITS); ++i) {
-    t = i * jpc_pow2i(-JPC_NMSEDEC_FRACBITS);
+    t = (float)(i * jpc_pow2i(-JPC_NMSEDEC_FRACBITS));
     u = t;
-    v = t - 1.5;
+    v = (float)(t - 1.5);
     jpc_signmsedec[i] = jpc_dbltofix(floor((u * u - v * v) * jpc_pow2i(JPC_NMSEDEC_FRACBITS) + 0.5) / jpc_pow2i(JPC_NMSEDEC_FRACBITS));
 /* XXX - this calc is not correct */
     jpc_signmsedec0[i] = jpc_dbltofix(floor((u * u) * jpc_pow2i(JPC_NMSEDEC_FRACBITS) + 0.5) / jpc_pow2i(JPC_NMSEDEC_FRACBITS));
-    u = t - 1.0;
+    u = (float)(t - 1.0);
     if (i & (1 << (JPC_NMSEDEC_BITS - 1))) {
-      v = t - 1.5;
+      v = (float)(t - 1.5);
     } else {
-      v = t - 0.5;
+      v = (float)(t - 0.5);
     }
     jpc_refnmsedec[i] = jpc_dbltofix(floor((u * u - v * v) * jpc_pow2i(JPC_NMSEDEC_FRACBITS) + 0.5) / jpc_pow2i(JPC_NMSEDEC_FRACBITS));
 /* XXX - this calc is not correct */
index d46c8d3005c6dac571f9b4aee76a494fc236595a..c849962923bc28351fcb4808991bea0ac8a9f90b 100644 (file)
@@ -62,7 +62,7 @@
  */
 
 /*
- * $Id: jpc_t1cod.h,v 1.1 2005/05/22 18:33:05 malaterre Exp $
+ * $Id: jpc_t1cod.h,v 1.2 2005/06/11 02:05:31 malaterre Exp $
  */
 
 #ifndef JPC_T1COD_H
 
 /* These lookup tables are used by various macros/functions. */
 /* Do not access these lookup tables directly. */
-extern int jpc_zcctxnolut[];
+extern int jpc_zcctxnolut[4 * 256];
 extern int jpc_spblut[];
 extern int jpc_scctxnolut[];
 extern int jpc_magctxnolut[];
index 759bc70800cc60c243427277c2860ce99db57013..47716a7b9c26221e2d143cdcbb2979e2995bd631 100644 (file)
@@ -64,7 +64,7 @@
 /*
  * Portable Pixmap/Graymap Format Support
  *
- * $Id: pnm_dec.c,v 1.1 2005/05/22 18:33:09 malaterre Exp $
+ * $Id: pnm_dec.c,v 1.2 2005/06/11 02:05:38 malaterre Exp $
  */
 
 /******************************************************************************\
@@ -352,7 +352,7 @@ static int pnm_getdata(jas_stream_t *in, pnm_hdr_t *hdr, jas_image_t *image)
               v = uv;
             }
           }
-          jas_matrix_set(data[cmptno], 0, x, v);
+          jas_matrix_set(data[cmptno], 0, x, (jas_seqent_t)v);
         }
       }
     }