Author: marcos
Date: 2008-03-02 20:03:51 -0800 (Sun, 02 Mar 2008)
New Revision: 8579

Modified:
   trunk/gs/src/gdevpx.c
Log:

Fix for compression always falling back to no compression in
pclxl_write_image_data(), bug 689732.

Details:

After much tracing of srle.c and gdevpx.c I believe this bug is in
the portion of s_RLE_process() that looks ahead in order to be able
to optimally compress the data.  Rather than attempting to modify the
function and probably breaking something else I'm taking the 99% solution
and just calling s_RLE_process with last set to true instead of false.
This disables the look ahead feature, presumably making the compression
very slightly suboptimal but at least now it works.

This change results in pxl files that are significantly smaller than
before (i.e. the test file associated with bug 689595 is reduced in size
from 1.1 megs to 387k).

Expected Differences:

None, since pxl output isn't tested.



Modified: trunk/gs/src/gdevpx.c
===================================================================
--- trunk/gs/src/gdevpx.c	2008-03-03 03:12:34 UTC (rev 8578)
+++ trunk/gs/src/gdevpx.c	2008-03-03 04:03:51 UTC (rev 8579)
@@ -514,14 +514,14 @@
 	    r.ptr = data + i * raster - 1;
 	    r.limit = r.ptr + width_bytes;
 	    if ((*s_RLE_template.process)
-		((stream_state *) & rlstate, &r, &w, false) != 0 ||
+		((stream_state *) & rlstate, &r, &w, true) != 0 ||
 		r.ptr != r.limit
 		)
 		goto ncfree;
 	    r.ptr = (const byte *)"\000\000\000\000\000";
 	    r.limit = r.ptr + (-(int)width_bytes & 3);
 	    if ((*s_RLE_template.process)
-		((stream_state *) & rlstate, &r, &w, false) != 0 ||
+		((stream_state *) & rlstate, &r, &w, true) != 0 ||
 		r.ptr != r.limit
 		)
 		goto ncfree;

_______________________________________________
gs-cvs mailing list
gs-cvs@ghostscript.com
http://www.ghostscript.com/mailman/listinfo/gs-cvs
