rev 442 - trunk
[email protected] Mon, 5 Dec 2005 17:47:35 -0800 (PST)
| Newsgroups | gmane.comp.printing.ghostscript.jbig2dec.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: giles
Date: 2005-12-05 17:47:35 -0800 (Mon, 05 Dec 2005)
New Revision: 442
Modified:
trunk/jbig2_text.c
Log:
The SBDSOFFSET field is a *signed* 5 bit integer, so we need to sign=20
extend when reading the field to get the proper value. We now correctly
handle the 042_20.jb2 test stream.
Modified: trunk/jbig2_text.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_text.c 2005-12-05 23:39:55 UTC (rev 441)
+++ trunk/jbig2_text.c 2005-12-06 01:47:35 UTC (rev 442)
@@ -494,6 +494,9 @@
/* 7.4.3.1.1 */
flags =3D jbig2_get_int16(segment_data + offset);
offset +=3D 2;
+
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+ "text region header flags 0x%04x", flags);
=20
params.SBHUFF =3D flags & 0x0001;
params.SBREFINE =3D flags & 0x0002;
@@ -503,9 +506,16 @@
params.TRANSPOSED =3D flags & 0x0040;
params.SBCOMBOP =3D (flags & 0x0180) >> 7;
params.SBDEFPIXEL =3D flags & 0x0200;
+ /* SBDSOFFSET is a signed 5 bit integer */
params.SBDSOFFSET =3D (flags & 0x7C00) >> 10;
+ if (params.SBDSOFFSET > 0x0f) params.SBDSOFFSET -=3D 0x20;
params.SBRTEMPLATE =3D flags & 0x8000;
=20
+ if (params.SBDSOFFSET) {
+ jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,
+ "text region has SBDSOFFSET %d", params.SBDSOFFSET);
+ }
+
if (params.SBHUFF) /* Huffman coding */
{
/* 7.4.3.1.2 */