rev 438 - trunk

[email protected] Mon, 5 Dec 2005 16:02:28 -0800 (PST)
Newsgroups gmane.comp.printing.ghostscript.jbig2dec.cvs
Message-ID <[email protected]>
Author: giles
Date: 2005-12-01 15:56:54 -0800 (Thu, 01 Dec 2005)
New Revision: 438

Modified:
   trunk/jbig2_arith.c
Log:
Promote artimetic debug printout code to JBIG2_DECODE_ARITH from
plain JBIG2_DEBUG to cut down on noise.


Modified: trunk/jbig2_arith.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/jbig2_arith.c	2005-12-01 21:52:38 UTC (rev 437)
+++ trunk/jbig2_arith.c	2005-12-01 23:56:54 UTC (rev 438)
@@ -84,8 +84,8 @@
 	  B1 =3D (byte)((as->next_word >> 24) & 0xFF);
 	  if (B1 > 0x8F)
 	    {
-#ifdef JBIG2_DEBUG
-	      printf ("read %02x (aa)\n", B);
+#ifdef JBIG2_DEBUG_ARITH
+	      fprintf(stderr, "read %02x (aa)\n", B);
 #endif
 #ifndef SOFTWARE_CONVENTION
 	      as->C +=3D 0xFF00;
@@ -96,8 +96,8 @@
 	    }
 	  else
 	    {
-#ifdef JBIG2_DEBUG
-	      printf ("read %02x (a)\n", B);
+#ifdef JBIG2_DEBUG_ARITH
+	      fprintf(stderr, "read %02x (a)\n", B);
 #endif
 #ifdef SOFTWARE_CONVENTION
 	      as->C +=3D 0xFE00 - (B1 << 9);
@@ -113,8 +113,8 @@
 	  B1 =3D (byte)((as->next_word >> 16) & 0xFF);
 	  if (B1 > 0x8F)
 	    {
-#ifdef JBIG2_DEBUG
-	      printf ("read %02x (ba)\n", B);
+#ifdef JBIG2_DEBUG_ARITH
+	      fprintf(stderr, "read %02x (ba)\n", B);
 #endif
 #ifndef SOFTWARE_CONVENTION
 	      as->C +=3D 0xFF00;
@@ -125,8 +125,8 @@
 	    {
 	      as->next_word_bytes--;
 	      as->next_word <<=3D 8;
-#ifdef JBIG2_DEBUG
-	      printf ("read %02x (b)\n", B);
+#ifdef JBIG2_DEBUG_ARITH
+	      fprintf(stderr, "read %02x (b)\n", B);
 #endif
=20
 #ifdef SOFTWARE_CONVENTION
@@ -140,8 +140,8 @@
     }
   else
     {
-#ifdef JBIG2_DEBUG
-      printf ("read %02x\n", B);
+#ifdef JBIG2_DEBUG_ARITH
+      fprintf(stderr, "read %02x\n", B);
 #endif
       as->CT =3D 8;
       as->next_word <<=3D 8;
@@ -163,13 +163,13 @@
     }
 }
=20
-#ifdef JBIG2_DEBUG
+#if defined(JBIG2_DEBUG) || defined(JBIG2_DEBUG_ARITH)
 #include <stdio.h>
=20
 static void
 jbig2_arith_trace (Jbig2ArithState *as, Jbig2ArithCx cx)
 {
-  printf ("I =3D %2d, MPS =3D %d, A =3D %04x, CT =3D %2d, C =3D %08x\n",
+  fprintf(stderr, "I =3D %2d, MPS =3D %d, A =3D %04x, CT =3D %2d, C =3D =
%08x\n",
 	  cx & 0x7f, cx >> 7, as->A, as->CT, as->C);
 }
 #endif
@@ -373,7 +373,7 @@
=20
   ws.get_next_word =3D test_get_word;
   as =3D jbig2_arith_new (ctx, &ws);
-#ifdef JBIG2_DEBUG
+#ifdef JBIG2_DEBUG_ARITH
   jbig2_arith_trace (as, cx);
 #endif
=20
@@ -382,8 +382,8 @@
       bool D;
=20
       D =3D jbig2_arith_decode (as, &cx);
-#ifdef JBIG2_DEBUG
-      printf ("%3d: D =3D %d, ", i, D);
+#ifdef JBIG2_DEBUG_ARITH
+      fprintf(stderr, "%3d: D =3D %d, ", i, D);
       jbig2_arith_trace (as, cx);
 #endif     =20
     }