[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1817-g428c92b
[email protected] (Robin Watts) Mon, 11 Nov 2019 16:03:31 +0000 (UTC)
| Newsgroups | gmane.comp.printing.ghostscript.cvs |
|---|---|
| Message-ID | <[email protected]> |
The ghostpdl branch, master has been updated
discards 375adf84b0d511522a4f7c2e13dfb81f00d75d53 (commit)
discards 33c5f8780d75332e5330b94686995aa558e079a5 (commit)
discards e3fee39b0d1ef26149ea885efcf9701719305701 (commit)
discards 97d08f44140b4236e7d224c42b0e288dbccb8b79 (commit)
discards aad7bcab6a3aedc4e2bfecd7b1e6bf893c299d0e (commit)
discards 2de09275898086e903a19812fd78e73381f7e71e (commit)
discards c198ac5dcb26fadc53074525cabb413e5395cdba (commit)
discards 7174b69e6c0027277fe1a9ece341c3380fe7979d (commit)
discards ba5b47dc979ca1590f280f482d432705e9b535bf (commit)
discards 4a3401e5e4f5828c67d7c65f77a3bb0106753649 (commit)
discards f44249d69a36fa7233504bdb137af9ff5008ec37 (commit)
discards 2029235dc8997314c1925e5786212a6c7331f0cf (commit)
discards 5605c6c6a9677013560a6a3c947f4b100eae4e09 (commit)
discards 95151ae3c3c63100bc7ae958f59b8096e7a0f211 (commit)
discards 0f7653fd4f1d1c5bf36719efcd8464eafcd46faf (commit)
discards 6882df85d37819d849476cf2b4822a90e64d9b24 (commit)
discards b7fac758d046c82d65fa69dd2c4bc0f1cf9712bc (commit)
discards 328d27b3cccc89c4ff60529106489a9a635f0f72 (commit)
discards 68aeff88e95ccfd1af430fe180597d624ad9f47e (commit)
discards 713645137a2fc483e5509bfd0f92d7311faeb614 (commit)
discards 6c3af6e12e4448b519d2b48c2047c0c83b3cf082 (commit)
discards 66878fb30f37b06a532fdce39991f31642cdb09b (commit)
discards 76db3df8090127482960b742f15831e59816a05e (commit)
discards 9caccf9f09e06324f07822cc55e1737d881c6eb3 (commit)
discards 018003614ad80910ca2c009eb1d523e8015756bc (commit)
discards 7da3de0c7662491fa2a0b6f5a638848bcf13a5fa (commit)
discards 494eeedf73d13fac5710e56f3a8fb2e7e2379d73 (commit)
discards 4f6bc662909ab79e8fbe9822afb36e8a0eafc2b7 (commit)
discards ce681338646435ca064ab2d1b8bde1614e5ed3f1 (commit)
discards 4e713293de84b689c4ab358f3e110ea54aa81925 (commit)
discards f70ab2044429fe4b991801476ea3f4b4a5c0cdf4 (commit)
discards ce2afc4f02617dee51f3322ae8386c4b46047c18 (commit)
via 428c92b1bce1db3c882663ef3f6b60b5c7ee9f7e (commit)
via 3a0d46f753a04b7297403cfb1197d004e386d21c (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (375adf84b0d511522a4f7c2e13dfb81f00d75d53)
\
N -- N -- N (428c92b1bce1db3c882663ef3f6b60b5c7ee9f7e)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
----------------------------------------------------------------------
commit 428c92b1bce1db3c882663ef3f6b60b5c7ee9f7e
Author: Robin Watts <[email protected]>
Date: Fri Oct 25 20:01:25 2019 +0100
WIP: Attempt to add "preferred resolution" for interpreters.
This should be used only if we're using a high level device and
the resolution has not been set from the command line, or via
PJL.
diff --git a/gpdl/psi/psitop.c b/gpdl/psi/psitop.c
index f7ca110..f20d882 100644
--- a/gpdl/psi/psitop.c
+++ b/gpdl/psi/psitop.c
@@ -606,5 +606,6 @@ const pl_interp_implementation_t ps_implementation = {
ps_impl_report_errors,
ps_impl_dnit_job,
ps_impl_deallocate_interp_instance,
+ 72, /* preferred resolution */
NULL
};
diff --git a/pcl/pcl/pcjob.c b/pcl/pcl/pcjob.c
index 7aa3f8f..a0fac49 100644
--- a/pcl/pcl/pcjob.c
+++ b/pcl/pcl/pcjob.c
@@ -330,6 +330,9 @@ pcjob_do_reset(pcl_state_t * pcs, pcl_reset_type_t type)
/* resolution is always a single number in PJL */
res[0] = res[1] = pcl_pjl_res(pcs);
+ if (res[0] != 0)
+ pcs->res_set_from_pjl = 1;
+
/*
* again we only have a single number from PJL so just
* check the width
diff --git a/pcl/pcl/pcstate.h b/pcl/pcl/pcstate.h
index 8fa1c0f..4b0c592 100644
--- a/pcl/pcl/pcstate.h
+++ b/pcl/pcl/pcstate.h
@@ -372,6 +372,7 @@ struct pcl_state_s
bool halftone_set;
bool page_set_on_command_line;
bool res_set_on_command_line;
+ bool res_set_from_pjl;
bool high_level_device;
/* last entry mode to hpgl/2 */
int hpgl_mode;
diff --git a/pcl/pcl/pctop.c b/pcl/pcl/pctop.c
index fa5b2ad..59cd4f4 100644
--- a/pcl/pcl/pctop.c
+++ b/pcl/pcl/pctop.c
@@ -536,6 +536,7 @@ pcl_impl_dnit_job(pl_interp_implementation_t * impl) /* interp instance to
if (!device->is_open)
code = gs_opendevice(device);
}
+ pl_main_set_res_set_from_pjl(device->memory, pcli->pcs.res_set_from_pjl);
return code;
}
@@ -599,5 +600,6 @@ pl_interp_implementation_t pcl_implementation = {
pcl_impl_report_errors,
pcl_impl_dnit_job,
pcl_impl_deallocate_interp_instance,
+ 600, /* resolution */
NULL
};
diff --git a/pcl/pl/pjparsei.c b/pcl/pl/pjparsei.c
index ef0dd9c..9e66b5e 100644
--- a/pcl/pl/pjparsei.c
+++ b/pcl/pl/pjparsei.c
@@ -183,5 +183,6 @@ pl_interp_implementation_t pjl_implementation = {
pjl_impl_report_errors,
pjl_impl_dnit_job,
pjl_impl_deallocate_interp_instance,
+ 0, /* resolution */
NULL, /* instance */
};
diff --git a/pcl/pl/plmain.c b/pcl/pl/plmain.c
index 0736eec..1b6e1fb 100644
--- a/pcl/pl/plmain.c
+++ b/pcl/pl/plmain.c
@@ -110,6 +110,8 @@ struct pl_main_instance_s
bool page_set_on_command_line;
long page_size[2];
bool res_set_on_command_line;
+ bool res_set_from_pjl;
+ float saved_res[2];
float res[2];
bool high_level_device;
#ifndef OMIT_SAVED_PAGES_TEST
@@ -281,6 +283,48 @@ pl_main_run_string_end(pl_main_instance_t *minst)
}
static int
+init_job(pl_main_instance_t *minst, pl_interp_implementation_t *desired_implementation)
+{
+ int code;
+
+ if (desired_implementation->preferred_resolution != 0 &&
+ minst->res_set_on_command_line == 0 &&
+ minst->res_set_from_pjl == 0 &&
+ minst->high_level_device)
+ {
+ /* Store the old res, set the preferred one. */
+ minst->saved_res[0] = minst->device->HWResolution[0];
+ minst->saved_res[1] = minst->device->HWResolution[1];
+ minst->device->HWResolution[0] = (float)desired_implementation->preferred_resolution;
+ minst->device->HWResolution[1] = (float)desired_implementation->preferred_resolution;
+ }
+
+ code = pl_init_job(desired_implementation, minst->device);
+ minst->curr_implementation = desired_implementation;
+ return code;
+}
+
+static int
+dnit_job(pl_main_instance_t *minst)
+{
+ int code;
+
+ code = pl_dnit_job(minst->curr_implementation);
+ minst->curr_implementation = NULL;
+
+ if (minst->saved_res[0] != 0)
+ {
+ /* Reset the resolution */
+ minst->saved_res[0] = 0;
+ minst->saved_res[1] = 0;
+ minst->device->HWResolution[0] = minst->saved_res[0];
+ minst->device->HWResolution[1] = minst->saved_res[1];
+ }
+
+ return code;
+}
+
+static int
revert_to_pjli(pl_main_instance_t *minst)
{
pl_interp_implementation_t *pjli =
@@ -292,7 +336,7 @@ revert_to_pjli(pl_main_instance_t *minst)
return 0;
if (minst->curr_implementation) {
- code = pl_dnit_job(minst->curr_implementation);
+ code = dnit_job(minst);
if (code < 0) {
minst->curr_implementation = NULL;
return code;
@@ -377,11 +421,10 @@ pl_main_run_file_utf8(pl_main_instance_t *minst, const char *prefix_commands, co
/* If the language implementation needs changing, change it. */
if (desired_implementation != pjli) {
- code = pl_dnit_job(pjli);
- minst->curr_implementation = NULL;
+ code = dnit_job(minst);
+
if (code >= 0)
- code = pl_init_job(desired_implementation, minst->device);
- minst->curr_implementation = desired_implementation;
+ code = init_job(minst, desired_implementation);
if (code < 0)
goto error_fatal;
}
@@ -489,12 +532,11 @@ pl_main_run_prefix(pl_main_instance_t *minst, const char *prefix_commands)
int code;
if (minst->curr_implementation != minst->implementation) {
- code = pl_dnit_job(minst->curr_implementation);
- minst->curr_implementation = NULL;
+ code = dnit_job(minst);
if (code < 0)
return code;
}
- code = pl_init_job(minst->implementation, minst->device);
+ code = init_job(minst, minst->implementation);
if (code < 0)
return code;
minst->curr_implementation = minst->implementation;
@@ -603,7 +645,7 @@ pl_to_exit(gs_memory_t *mem)
pl_main_instance_t *minst = mem->gs_lib_ctx->top_of_system;
/* Deselect last-selected device */
if (minst->curr_implementation
- && pl_dnit_job(minst->curr_implementation) < 0) {
+ && dnit_job(minst) < 0) {
ret = -1;
}
@@ -2021,6 +2063,11 @@ bool pl_main_get_res_set_on_command_line(const gs_memory_t *mem)
return pl_main_get_instance(mem)->res_set_on_command_line;
}
+void pl_main_set_res_set_from_pjl(const gs_memory_t *mem, int set)
+{
+ pl_main_get_instance(mem)->res_set_from_pjl |= set;
+}
+
void pl_main_get_forced_geometry(const gs_memory_t *mem, const float **resolutions, const long **dimensions)
{
pl_main_instance_t *minst = pl_main_get_instance(mem);
diff --git a/pcl/pl/plmain.h b/pcl/pl/plmain.h
index 354a1cb..536089b 100644
--- a/pcl/pl/plmain.h
+++ b/pcl/pl/plmain.h
@@ -66,7 +66,8 @@ bool pl_main_get_interpolate(const gs_memory_t *mem);
bool pl_main_get_nocache(const gs_memory_t *mem);
bool pl_main_get_page_set_on_command_line(const gs_memory_t *mem);
bool pl_main_get_res_set_on_command_line(const gs_memory_t *mem);
-bool pl_main_get_high_level_device(const gs_memory_t *mem);
+void pl_main_set_res_set_from_pjl(const gs_memory_t *mem, int set);
+pl_main_get_high_level_device(const gs_memory_t *mem);
void pl_main_get_forced_geometry(const gs_memory_t *mem, const float **resolutions, const long **dimensions);
int pl_main_get_scanconverter(const gs_memory_t *mem);
pl_main_instance_t *pl_main_get_instance(const gs_memory_t *mem);
diff --git a/pcl/pl/pltop.h b/pcl/pl/pltop.h
index 4329af5..d9cd84d 100644
--- a/pcl/pl/pltop.h
+++ b/pcl/pl/pltop.h
@@ -192,6 +192,7 @@ struct pl_interp_implementation_s
pl_interp_proc_dnit_job_t proc_dnit_job;
pl_interp_proc_deallocate_interp_instance_t
proc_deallocate_interp_instance;
+ int preferred_resolution;
void *interp_client_data;
};
diff --git a/pcl/pxl/pxtop.c b/pcl/pxl/pxtop.c
index bf9d346..39f6f1b 100644
--- a/pcl/pxl/pxtop.c
+++ b/pcl/pxl/pxtop.c
@@ -566,6 +566,7 @@ pl_interp_implementation_t pxl_implementation = {
pxl_impl_report_errors,
pxl_impl_dnit_job,
pxl_impl_deallocate_interp_instance,
+ 600, /* resolution */
NULL
};
diff --git a/xps/xpstop.c b/xps/xpstop.c
index 49d31c7..a3245ac 100644
--- a/xps/xpstop.c
+++ b/xps/xpstop.c
@@ -446,6 +446,7 @@ pl_interp_implementation_t xps_implementation =
xps_impl_report_errors,
xps_impl_dnit_job,
xps_impl_deallocate_interp_instance,
+ 0, /* No preferred resolution */
NULL,
};
----------------------------------------------------------------------
commit 3a0d46f753a04b7297403cfb1197d004e386d21c
Author: Robin Watts <[email protected]>
Date: Wed Dec 13 14:17:40 2017 +0000
Optimise gx_default_copy_color
Simple static inline template used to make optimised versions.
This doesn't yield a noticable speedup for me, so I hand coded
8, 24 and 32 bit cores, and do see a speedup.
diff --git a/base/gdevdbit.c b/base/gdevdbit.c
index 8b5fa2f..546966f 100644
--- a/base/gdevdbit.c
+++ b/base/gdevdbit.c
@@ -82,25 +82,16 @@ gx_default_copy_mono(gx_device * dev, const byte * data,
(&devc, data, dx, raster, id, x, y, w, h, dev, rop3_T, invert);
}
-/* Implement copy_color by filling lots of small rectangles. */
-/* This is very inefficient, but it works as a default. */
-int
-gx_default_copy_color(gx_device * dev, const byte * data,
- int dx, int raster, gx_bitmap_id id,
- int x, int y, int w, int h)
+static inline int dcc_template(gx_device * dev, const byte * data,
+ int dx, int raster,
+ int x, int y, int w, int h, int depth)
{
- int depth = dev->color_info.depth;
byte mask;
dev_proc_fill_rectangle((*fill));
const byte *row;
int iy;
- if (depth == 1)
- return (*dev_proc(dev, copy_mono)) (dev, data, dx, raster, id,
- x, y, w, h,
- (gx_color_index) 0, (gx_color_index) 1);
- fit_copy(dev, data, dx, raster, id, x, y, w, h);
fill = dev_proc(dev, fill_rectangle);
mask = (byte) ((1 << depth) - 1);
for (row = data, iy = 0; iy < h; row += raster, ++iy) {
@@ -159,6 +150,221 @@ gx_default_copy_color(gx_device * dev, const byte * data,
return 0;
}
+static int dcc_64(gx_device * dev, const byte * data,
+ int dx, int raster,
+ int x, int y, int w, int h)
+{
+ return dcc_template(dev, data, dx, raster, x, y, w, h, 64);
+}
+
+static int dcc_56(gx_device * dev, const byte * data,
+ int dx, int raster,
+ int x, int y, int w, int h)
+{
+ return dcc_template(dev, data, dx, raster, x, y, w, h, 56);
+}
+
+static int dcc_48(gx_device * dev, const byte * data,
+ int dx, int raster,
+ int x, int y, int w, int h)
+{
+ return dcc_template(dev, data, dx, raster, x, y, w, h, 48);
+}
+
+static int dcc_40(gx_device * dev, const byte * data,
+ int dx, int raster,
+ int x, int y, int w, int h)
+{
+ return dcc_template(dev, data, dx, raster, x, y, w, h, 40);
+}
+
+static int dcc_32(gx_device * dev, const byte * data,
+ int dx, int raster,
+ int x, int y, int w, int h)
+{
+ dev_proc_fill_rectangle((*fill));
+ const byte *row;
+ int iy;
+
+ fill = dev_proc(dev, fill_rectangle);
+ for (row = data, iy = 0; iy < h; row += raster, ++iy) {
+ int ix;
+ gx_color_index c0 = gx_no_color_index;
+ const byte *ptr = row + dx * 4;
+ int i0;
+
+ for (i0 = ix = 0; ix < w; ++ix) {
+ gx_color_index color;
+
+ color = *ptr++;
+ color = (color << 8) + *ptr++;
+ color = (color << 8) + *ptr++;
+ color = (color << 8) + *ptr++;
+ if (color != c0) {
+ if (ix > i0) {
+ int code = (*fill)
+ (dev, i0 + x, iy + y, ix - i0, 1, c0);
+
+ if (code < 0)
+ return code;
+ }
+ c0 = color;
+ i0 = ix;
+ }
+ }
+ if (ix > i0) {
+ int code = (*fill) (dev, i0 + x, iy + y, ix - i0, 1, c0);
+
+ if (code < 0)
+ return code;
+ }
+ }
+ return 0;
+}
+
+static int dcc_24(gx_device * dev, const byte * data,
+ int dx, int raster,
+ int x, int y, int w, int h)
+{
+ dev_proc_fill_rectangle((*fill));
+ const byte *row;
+ int iy;
+
+ fill = dev_proc(dev, fill_rectangle);
+ for (row = data, iy = 0; iy < h; row += raster, ++iy) {
+ int ix;
+ gx_color_index c0 = gx_no_color_index;
+ const byte *ptr = row + dx * 3;
+ int i0;
+
+ for (i0 = ix = 0; ix < w; ++ix) {
+ gx_color_index color;
+
+ color = *ptr++;
+ color = (color << 8) + *ptr++;
+ color = (color << 8) + *ptr++;
+ if (color != c0) {
+ if (ix > i0) {
+ int code = (*fill)
+ (dev, i0 + x, iy + y, ix - i0, 1, c0);
+
+ if (code < 0)
+ return code;
+ }
+ c0 = color;
+ i0 = ix;
+ }
+ }
+ if (ix > i0) {
+ int code = (*fill) (dev, i0 + x, iy + y, ix - i0, 1, c0);
+
+ if (code < 0)
+ return code;
+ }
+ }
+ return 0;
+}
+
+static int dcc_16(gx_device * dev, const byte * data,
+ int dx, int raster,
+ int x, int y, int w, int h)
+{
+ return dcc_template(dev, data, dx, raster, x, y, w, h, 16);
+}
+
+static int dcc_8(gx_device * dev, const byte * data,
+ int dx, int raster,
+ int x, int y, int w, int h)
+{
+ dev_proc_fill_rectangle((*fill));
+ const byte *row;
+ int iy;
+
+ fill = dev_proc(dev, fill_rectangle);
+ for (row = data, iy = 0; iy < h; row += raster, ++iy) {
+ int ix;
+ gx_color_index c0 = gx_no_color_index;
+ const byte *ptr = row + dx;
+ int i0;
+
+ for (i0 = ix = 0; ix < w; ++ix) {
+ gx_color_index color;
+
+ color = *ptr++;
+ if (color != c0) {
+ if (ix > i0) {
+ int code = (*fill)
+ (dev, i0 + x, iy + y, ix - i0, 1, c0);
+
+ if (code < 0)
+ return code;
+ }
+ c0 = color;
+ i0 = ix;
+ }
+ }
+ if (ix > i0) {
+ int code = (*fill) (dev, i0 + x, iy + y, ix - i0, 1, c0);
+
+ if (code < 0)
+ return code;
+ }
+ }
+ return 0;
+}
+
+static int dcc_4(gx_device * dev, const byte * data,
+ int dx, int raster,
+ int x, int y, int w, int h)
+{
+ return dcc_template(dev, data, dx, raster, x, y, w, h, 4);
+}
+
+static int dcc_2(gx_device * dev, const byte * data,
+ int dx, int raster,
+ int x, int y, int w, int h)
+{
+ return dcc_template(dev, data, dx, raster, x, y, w, h, 2);
+}
+
+/* Implement copy_color by filling lots of small rectangles. */
+/* This is very inefficient, but it works as a default. */
+int
+gx_default_copy_color(gx_device * dev, const byte * data,
+ int dx, int raster, gx_bitmap_id id,
+ int x, int y, int w, int h)
+{
+ int depth = dev->color_info.depth;
+ if (depth == 1)
+ return (*dev_proc(dev, copy_mono)) (dev, data, dx, raster, id,
+ x, y, w, h,
+ (gx_color_index) 0, (gx_color_index) 1);
+ fit_copy(dev, data, dx, raster, id, x, y, w, h);
+ switch (depth) {
+ case 64:
+ return dcc_64(dev, data, dx, raster, x, y, w, h);
+ case 56:
+ return dcc_56(dev, data, dx, raster, x, y, w, h);
+ case 48:
+ return dcc_48(dev, data, dx, raster, x, y, w, h);
+ case 40:
+ return dcc_40(dev, data, dx, raster, x, y, w, h);
+ case 32:
+ return dcc_32(dev, data, dx, raster, x, y, w, h);
+ case 24:
+ return dcc_24(dev, data, dx, raster, x, y, w, h);
+ case 16:
+ return dcc_16(dev, data, dx, raster, x, y, w, h);
+ case 8:
+ return dcc_8(dev, data, dx, raster, x, y, w, h);
+ case 4:
+ return dcc_4(dev, data, dx, raster, x, y, w, h);
+ case 2:
+ return dcc_2(dev, data, dx, raster, x, y, w, h);
+ }
+ return gs_error_Fatal;
+}
+
int
gx_no_copy_alpha(gx_device * dev, const byte * data, int data_x,
int raster, gx_bitmap_id id, int x, int y, int width, int height,
Summary of changes:
Resource/Init/gs_lev2.ps | 2 +-
Resource/Init/gs_res.ps | 2 +-
Resource/Init/pdf_draw.ps | 13 +--
Resource/Init/pdf_font.ps | 29 +++---
Resource/Init/pdf_ops.ps | 48 ++++------
base/gdevdbit.c | 230 ++++++++++++++++++++++++++++++++++++++++++---
base/gdevdflt.c | 3 +-
base/gdevvec.c | 5 -
base/gpmisc.c | 6 +-
base/gsicc_create.c | 4 +-
base/gxclrast.c | 1 -
base/gxhintn.c | 5 +-
base/gxiscale.c | 1 -
contrib/japanese/gdev10v.c | 3 +-
devices/gdevclj.c | 4 +-
devices/gdevepsc.c | 18 ++--
devices/gdevepsn.c | 42 ++-------
devices/gdevhl7x.c | 30 ++----
devices/gdevlp8k.c | 5 +-
devices/gdevlxm.c | 27 ++----
devices/gdevpjet.c | 60 +++++-------
doc/Language.htm | 24 -----
gpdl/psi/gpdlpsi.mak | 64 +++++++++++++
gpdl/psi/psitop.c | 1 +
pcl/pcl/pcindxed.c | 14 +--
pcl/pcl/pcjob.c | 3 +
pcl/pcl/pcstate.h | 1 +
pcl/pcl/pctop.c | 2 +
pcl/pl/pjparsei.c | 1 +
pcl/pl/pllfont.c | 10 +-
pcl/pl/plmain.c | 65 +++++++++++--
pcl/pl/plmain.h | 3 +-
pcl/pl/pltop.h | 1 +
pcl/pxl/pxtop.c | 1 +
xps/xpsimage.c | 1 -
xps/xpstop.c | 2 +-
36 files changed, 460 insertions(+), 271 deletions(-)
create mode 100644 gpdl/psi/gpdlpsi.mak