jbig2dec
Ralph Giles <[email protected]> Tue, 02 Jul 2002 17:30:22 -0700
| Newsgroups | gmane.comp.printing.ghostscript.jbig2dec.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/jbig2dec/jbig2dec
In directory usw-pr-cvs1:/tmp/cvs-serv29122
Modified Files:
Makefile.am jbig2_image.c jbig2_image_png.c
Log Message:
Oops. Previous stride calculation was correct.
Also remove obsolete png test code.
Index: Makefile.am
===================================================================
RCS file: /cvsroot/jbig2dec/jbig2dec/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Makefile.am 1 Jul 2002 19:34:30 -0000 1.5
+++ Makefile.am 3 Jul 2002 00:30:20 -0000 1.6
@@ -11,7 +11,7 @@
jbig2_image.c jbig2_image_pbm.c
bin_PROGRAMS = jbig2dec
-#noinst_PROGRAMS = test_huffman test_arith test_png
+#noinst_PROGRAMS = test_huffman test_arith
jbig2dec_SOURCES = jbig2dec.c
jbig2dec_LDADD = libjbig2dec.a @LIBOBJS@
Index: jbig2_image.c
===================================================================
RCS file: /cvsroot/jbig2dec/jbig2dec/jbig2_image.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- jbig2_image.c 3 Jul 2002 00:10:07 -0000 1.8
+++ jbig2_image.c 3 Jul 2002 00:30:20 -0000 1.9
@@ -33,7 +33,7 @@
return NULL;
}
- stride = ((width - 1) >> 5) + 1; /* generate a word-aligned stride */
+ stride = (((width - 1) >> 5) + 1) << 2; /* generate a word-aligned stride */
image->data = (uint32_t *)jbig2_alloc(ctx->allocator, stride*height);
if (image->data == NULL) {
jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,
Index: jbig2_image_png.c
===================================================================
RCS file: /cvsroot/jbig2dec/jbig2dec/jbig2_image_png.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- jbig2_image_png.c 15 Jun 2002 16:02:54 -0000 1.2
+++ jbig2_image_png.c 3 Jul 2002 00:30:20 -0000 1.3
@@ -92,31 +92,3 @@
return 0;
}
-
-
-#ifdef TEST
-int main(int argc, char *argv[])
-{
- int i,j;
- Jbig2Image *image;
- uint32 *data;
- char *filename = "test.png";
-
- image = jbig2_image_new(400,400);
- if (image == NULL) {
- fprintf(stderr, "failed to create jbig2 image structure!\n");
- exit(1);
- }
-
- fprintf(stderr, "creating checkerboard test image '%s'\n", filename);
- data = image->data;
- for (j = 0; j < image->height; j++) {
- for (i = 0; i < image->stride >> 2; i++) {
- *data++ = ((j & 16) >> 4) ? 0x0000FFFF: 0xFFFF0000;
- }
- }
-
- return jbig2_image_write_png(image, filename);
-}
-
-#endif /* TEST */