summaryrefslogtreecommitdiff
path: root/fitz/res_colorspace.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-11-19 16:40:51 +0000
committerRobin Watts <robin.watts@artifex.com>2012-11-19 16:49:29 +0000
commitb1e3f310637a22c6b4c5e142e3582f90ff467ddf (patch)
tree09fa46ac420806bb23d0c7d247d03f956a97e27d /fitz/res_colorspace.c
parenta8560c74b6b655386c4530383eebda4e7cc239c2 (diff)
downloadmupdf-b1e3f310637a22c6b4c5e142e3582f90ff467ddf.tar.xz
Add image subsampling function.
When drawing images, if they are much bigger than we need, quickly subsample them. Makes images much more cachable, reduces time spent in expensive smooth scaler.
Diffstat (limited to 'fitz/res_colorspace.c')
-rw-r--r--fitz/res_colorspace.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/fitz/res_colorspace.c b/fitz/res_colorspace.c
index 7b36ac1e..edda776d 100644
--- a/fitz/res_colorspace.c
+++ b/fitz/res_colorspace.c
@@ -316,6 +316,31 @@ static void fast_cmyk_to_gray(fz_pixmap *dst, fz_pixmap *src)
}
}
+#if 0
+static void
+fast_cmyk_to_rgb_ARM(unsigned char *dst, unsigned char *src, int n)
+{
+ asm volatile(
+ ENTER_ARM
+ "stmfd r13!,{r4-r12,r14} \n"
+ "@ r0 = dst \n"
+ "@ r1 = src \n"
+ "@ r2 = weights \n"
+ "mov r4, #0 @ r4 = CMYK = 0 \n"
+ "mvn r5, #0xFF000000 @ r5 = RGB = FFFFFF \n"
+ "1: \n"
+ "ldr r3, [r1], #4 @ r3 = cmyk \n"
+ "cmp r3, r4 @ if (cmyk == CMYK) \n"
+ "beq match @ goto match \n"
+ "cmp r3, #0 @ if (cmyk = 0000) \n"
+ "beq black @
+
+ "ldmfd r13!,{r4-r7,r9,PC} @ pop, return to thumb \n"
+ ENTER_THUMB
+ );
+}
+#endif
+
static void fast_cmyk_to_rgb(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src)
{
unsigned char *s = src->samples;