[Pixman] [PATCH] Cache the implementation along with the fast paths.

2010-07-10 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com When calling a fast path, we need to pass the corresponding implementation since it might contain information necessary to run the fast path. --- pixman/pixman.c | 26 -- 1 files changed, 16 insertions(+), 10 deletions

[Pixman] [PATCH] Split the fast path caching into its own force_inline function

2010-07-10 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com The do_composite() function is a lot more readable this way. --- pixman/pixman.c | 200 +- 1 files changed, 107 insertions(+), 93 deletions(-) diff --git a/pixman/pixman.c b/pixman/pixman.c index

Re: [Pixman] FAST_PATH_SAMPLES_COVER_CLIP flag fast_composite_scaled_nearest_*

2010-07-29 Thread Søren Sandmann Pedersen
Siarhei Siamashka siarhei.siamas...@gmail.com writes: Overall looks like a good fix, a few comments below. Thanks for the comments. I'll send a new patch with a long commit log as a follow-up to this message (provided I can make it work with git-send-email), but I'll reply to some specifics

[Pixman] [PATCH 1/2] Extend scaling-crash-test in various ways

2010-07-29 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com This extends scaling-crash-test to test some more things: - All combinations of NEAREST/BILINEAR/CONVOLUTION filters and NORMAL/PAD/REFLECT repeat modes. - Tests various scale factors very close to 1/7th such that the source area is very close

Re: [Pixman] [PATCH] ARM: NEON: don't hit general path for r5g6b5 OVER r5g6b5 operation

2010-08-09 Thread Søren Sandmann Pedersen
Would it be possible instead to add a new flag OPAQUE_SAMPLES that would be set whenever the image format is opaque, and then use it along with SAMPLES_COVER_CLIP to add the OPAQUE flag before strength reducing the operator? That would help all the backends, including the general one,

[Pixman] [PATCH] Introduce new FAST_PATH_SAMPLES_OPAQUE flag

2010-08-09 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com This flag is set whenever the pixels of a bits image don't have an alpha channel. Together with FAST_PATH_SAMPLES_COVER_CLIP it implies that the image effectively is opaque, so we can do operator reductions such as OVER-SRC. --- pixman/pixman-image.c

[Pixman] [PATCH] Only try to compute the FAST_SAMPLES_COVER_CLIP for bits images

2010-08-16 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com It doesn't make sense in other cases, and the computation would make use of image-bits.{width,height} which lead to uninitialized memory accesses when the image wasn't of type BITS. --- pixman/pixman.c | 17 ++--- 1 files changed, 10

[Pixman] [PATCH 1/3] Add pixman_composite_trapezoids().

2011-01-12 Thread Søren Sandmann Pedersen
This function is an implementation of the X server request Trapezoids. That request is what the X backend of cairo is using all the time; by moving it into pixman we can hopefully make it faster. --- pixman/pixman-trap.c | 87 ++ pixman/pixman.h

[Pixman] [PATCH 2/6] Add a test program for pixman_composite_trapezoids().

2011-02-11 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com A CRC32 based test program to check that pixman_composite_trapezoids() actually works. --- test/Makefile.am|5 + test/composite-traps-test.c | 253 +++ 2 files changed, 258 insertions(+), 0

[Pixman] [PATCH 3/6] Add support for triangles to pixman.

2011-02-11 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com The Render X extension can draw triangles as well as trapezoids, but the implementation has always converted them to trapezoids. This patch moves the X server's triangle conversion code into pixman, where we can reuse the pixman_composite_trapezoid

[Pixman] [PATCH 5/6] Optimize adding opaque trapezoids onto a8 destination.

2011-02-11 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com When the source is opaque and the destination is alpha only, we can avoid the temporary mask and just add the trapezoids directly. --- pixman/pixman-trap.c | 133 - 1 files changed, 76 insertions

[Pixman] [PATCH 6/6] Add new public function pixman_add_triangles()

2011-02-11 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com This allows some more code to be deleted from the X server. The implementation consists of converting to trapezoids, and is shared with pixman_composite_triangles(). --- pixman/pixman-trap.c | 61

[Pixman] [PATCH 2/3] Move miTriangles to fb as fbTriangles().

2011-02-11 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com The fb version simply calls the new pixman_composite_triangles(). This allows us to get rid of miCreateAlphaPicture(). Signed-off-by: Søren Sandmann s...@redhat.com --- fb/fbpict.c |1 + fb/fbpict.h | 10 + fb/fbtrap.c | 109

[Pixman] [PATCH 3/3] Implement fbAddTriangles() in terms of pixman_add_triangles().

2011-02-11 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com This allows the remaining triangle-to-trap conversion code to be deleted. Signed-off-by: Søren Sandmann s...@redhat.com --- fb/fbtrap.c | 91 ++- 1 files changed, 9 insertions(+), 82

Re: [Pixman] [PATCH] Add forgotten _mm_empty() calls in the SSE2 fetchers.

2011-02-18 Thread Søren Sandmann Pedersen
Here is a patch series that removes all use of MMX from pixman-sse2.c. This avoids all the emms issues and is likely also a speedup on Windows x64, where MMX intrinsics are not supported and therefore had to be emulated. b/configure.ac|2 b/pixman/pixman-sse2.c

[Pixman] [PATCH 4/8] sse2: Don't compile pixman-sse2.c with -mmmx anymore

2011-02-18 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com It's not necessary now that the file doesn't use MMX instructions. --- configure.ac |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index 5242799..8d96647 100644 --- a/configure.ac +++ b

[Pixman] [PATCH 6/8] sse2: Delete obsolete or redundant comments

2011-02-18 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com --- pixman/pixman-sse2.c | 137 -- 1 files changed, 0 insertions(+), 137 deletions(-) diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c index 0753b6d..286dea8 100644 --- a/pixman/pixman-sse2.c

[Pixman] [PATCH 8/8] sse2: Minor coding style cleanups.

2011-02-18 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com Also make pixman_fill_sse2() static. --- pixman/pixman-sse2.c | 18 -- 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c index 0509613..88287b4 100644 --- a/pixman/pixman

[Pixman] Fix

2011-03-31 Thread Søren Sandmann Pedersen
I forgot to CC pixman@lists.freedesktop.org on the following patch. The patch is necessary to make trapezoid rendering directly to X windows work and also makes the pixman_composite_trapezoids() API more similar to pixman_image_composite(). See this thread:

[Pixman] NOOP implementation

2011-05-03 Thread Søren Sandmann Pedersen
The following patches add a noop implementation, which is used as topmost in the implementation hierarchy. It is supposed to contain iterators and compositing routines that don't do anything. For example, there is a compositing fast path for the DST operator. This is useful because it allows more

[Pixman] [PATCH 1/6] Add a noop implementation.

2011-05-03 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com This new implementation is ahead of all other implementations in the fallback chain and is supposed to contain operations that don't require any work. For examples, it might contain a fast path for the DST operator that doesn't actually do anything

[Pixman] [PATCH 3/6] Move noop dest fetching to noop implementation

2011-05-03 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com It will at some point become useful to have CPU specific destination iterators. However, a problem with that is that such iterators should not be used if we can composite directly in the destination image. By moving the noop destination iterator

[Pixman] [PATCH 5/6] Move NULL iterator into pixman-noop.c

2011-05-03 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com Iterating a NULL image returns NULL for all scanlines. This may as well be done in the noop iterator. --- pixman/pixman-implementation.c | 12 +--- pixman/pixman-noop.c | 24 2 files changed, 17

[Pixman] [PATCH 4/6] Add a noop src iterator

2011-05-03 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com When the image is a8r8g8b8 and not transformed, and the fetched rectangle is within the image bounds, scanlines can be fetched by simply returning a pointer instead of copying the bits. --- pixman/pixman-noop.c | 39

[Pixman] [PATCH 01/10] pixman-cpu.c: Rename disabled to _pixman_disabled() and export it

2012-06-29 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com --- pixman/pixman-cpu.c | 22 +++--- pixman/pixman-private.h |2 ++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/pixman/pixman-cpu.c b/pixman/pixman-cpu.c index aa9036f..a0d2f8c 100644 --- a/pixman/pixman

[Pixman] [PATCH 00/10] Cleanups to CPU detection

2012-06-29 Thread Søren Sandmann Pedersen
git://people.freedesktop.org/~sandmann/pixman in the branch cpudetectfiles. Hi, The following patches contains some cleanups to the CPU detection in general, and some improvements to the x86 specific parts in particular. I was looking at making use of some of the newer x86 SIMD

[Pixman] [PATCH 07/10] Simplify MIPS CPU detection

2012-06-29 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com There is no reason to have pixman_have_feature functions when all they do is call pixman_have_mips_feature(). Instead rename pixman_have_mips_feature() to have_feature() and call it directly from _pixman_mips_get_implementations(). Also on non-Linux

[Pixman] [PATCH 03/10] Move ARM specific CPU detection to a new file pixman-arm.c

2012-06-29 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com Similar to the x86 commit, this moves the ARM specific CPU detection to its own file which exports a pixman_arm_get_implementations() function that is supposed to be a noop on non-ARM. --- pixman/Makefile.sources |1 + pixman/pixman-arm.c

[Pixman] [PATCH 02/10] Move x86 specific CPU detection to a new file pixman-x86.c

2012-06-29 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com Extract the x86 specific parts of pixman-cpu.c and put them in their own file called pixman-x86.c which exports one function pixman_x86_get_implementations() that creates the MMX and SSE2 implementations. This file is supposed to be compiled on all

[Pixman] [PATCH 09/10] Simplifications to ARM CPU detection

2012-06-29 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com Organize pixman-arm.c such that each operating system/compiler exports a detect_cpu_features() function that returns a bitmask with the various features that we are interested in. A new function have_feature() then calls this function, caches

[Pixman] [PATCH 05/10] Move MIPS specific CPU detection to its own file, pixman-mips.c

2012-06-29 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com --- pixman/Makefile.sources |1 + pixman/pixman-cpu.c | 77 + pixman/pixman-mips.c| 110 +++ pixman/pixman-private.h |3 ++ 4 files changed, 115 insertions

[Pixman] [PATCH 06/10] Move the remaining bits of pixman-cpu into pixman-implementation.c

2012-06-29 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com --- pixman/Makefile.sources|1 - pixman/pixman-cpu.c| 79 pixman/pixman-implementation.c | 51 ++ 3 files changed, 51 insertions(+), 80 deletions(-) delete

[Pixman] [PATCH 04/10] Move PowerPC specific CPU detection to its own file pixman-ppc.c

2012-06-29 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com --- pixman/Makefile.sources |1 + pixman/pixman-cpu.c | 165 +--- pixman/pixman-ppc.c | 192 +++ pixman/pixman-private.h |3 + 4 files changed, 197

[Pixman] [PATCH 10/10] Simplify CPU detection on PPC.

2012-06-29 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com Get rid of the initialized and have_vmx static variables in pixman-ppc.c There is no point to them since CPU detection only happens once per process. On Linux, just read /proc/self/auxv instead of generating the filename with getpid() and don't

[Pixman] [PATCH 08/10] Cleanups and simplifications in x86 CPU feature detection

2012-06-29 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com A new function pixman_cpuid() is added that runs the cpuid instruction and returns the results. On GCC this function uses inline assembly that is written such that it will work on both 32 and 64 bit. Compared to the old code, the only difference

[Pixman] [RFC, PATCH 0/8] Floating point pipeline

2012-08-25 Thread Søren Sandmann Pedersen
Hi, The following patches change the 64 pipeline to use single precision floating point channels instead. The main benefit of this is that we get more range and precision so that we can support HDR image formats such as half precision floating point argb. Unlike 16 bpc, single precision floating

[Pixman] [PATCH 2/8] blitters-test: Prepare for floating point

2012-08-25 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com Comment out some formats in blitters-test that are going to rely on floating point in some upcoming patches. --- test/blitters-test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/blitters-test.c b/test/blitters-test.c

[Pixman] [PATCH 1/8] glyph-test: Prepare for floating point

2012-08-25 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com In preparation for an upcoming change of the wide pipe to use floating point, comment out some formats in glyph-test that are going to be using floating point and update the CRC32 value to match. --- test/glyph-test.c | 7 +-- 1 file changed, 5

[Pixman] [PATCH 3/8] Add pixman-combine-float.c

2012-08-25 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com This file contains floating point implementations of combiners for all pixman operators. These combiners operate on buffers containing single precision floating point pixels stored in (a, r, g, b) order. The combiners are added

[Pixman] [PATCH 5/8] pixman-access.c: Add floating point accessor functions

2012-08-25 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com Three new function pointer fields are added to bits_image_t: fetch_scanline_float fetch_pixel_float store_scanline_float similar to the existing 32 and 64 bit accessors. The fetcher_info_t struct in pixman_access similarly gets

[Pixman] [PATCH] gtk-utils.c: Use cairo in show_image() rather than GdkPixbuf

2013-02-15 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com GdkPixbufs are not premultiplied, so when using them to display pixman images, there is some unecessary conversions going on: First the image is converted to non-premultiplied, and then GdkPixbuf premultiplies before sending the result to the X server

[Pixman] [PATCH 02/11] Add ITER_WIDE iter flag

2013-05-22 Thread Søren Sandmann Pedersen
This will be useful for putting iterators into tables where they can be looked up by iterator flags. Without this flag, wide iterators can only be recognized by the absence of ITER_NARROW, which makes testing for a match difficult. --- pixman/pixman-general.c | 20 +---

[Pixman] [PATCH 05/11] sse2: Replace the fetcher_info_t table with a pixman_iter_info_t table

2013-05-22 Thread Søren Sandmann Pedersen
Similar to the changes to noop, put all the iterators into a table of pixman_iter_info_t and then do a generic search of that table during iterator initialization. --- pixman/pixman-sse2.c | 64 1 file changed, 35 insertions(+), 29 deletions(-)

[Pixman] [PATCH 06/11] mmx: Replace the fetcher_info_t table with a pixman_iter_info_t table

2013-05-22 Thread Søren Sandmann Pedersen
Similar to the SSE2 commit, information about the iterators is stored in a table of pixman_iter_info_t. --- pixman/pixman-mmx.c | 64 + 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c

[Pixman] [PATCH 07/11] fast: Replace the fetcher_info_t table with a pixman_iter_info_t table

2013-05-22 Thread Søren Sandmann Pedersen
Similar to the SSE2 and MMX patches, this commit replaces a table of fetcher_info_t with a table of pixman_iter_info_t, and similar to the noop patch, both fast_src_iter_init() and fast_dest_iter_init() are now doing exactly the same thing, so their code can be shared in a new function called

[Pixman] [PATCH 09/11] Add _pixman_implementation_iter_init() and use instead of _src/_dest_init()

2013-05-22 Thread Søren Sandmann Pedersen
A new field, 'iter_info', is added to the implementation struct, and all the implementations store a pointer to their iterator tables in it. A new function, _pixman_implementation_iter_init(), is then added that searches those tables, and the new function is called in pixman-general.c and

[Pixman] [PATCH 11/11] Consolidate all the iter_init_bits_stride functions

2013-05-22 Thread Søren Sandmann Pedersen
The SSE2, MMX, and fast implementations all have a copy of the function iter_init_bits_stride that computes an image buffer and stride. Move that function to pixman-utils.c and share it among all the implementations. --- pixman/pixman-fast-path.c | 19 +-- pixman/pixman-mmx.c

[Pixman] [PATCH 2/2] ssse3: Add iterator for separable bilinear scaling

2013-08-29 Thread Søren Sandmann Pedersen
This new iterator uses the SSSE3 instructions pmaddubsw and pabsw to implement a fast iterator for bilinear scaling. There is a graph here recording the per-pixel time for various bilinear scaling algorithms as reported by scaling-bench:

[Pixman] [PATCHv2 0/3] SSSE3 iterator for bilinear scaling

2013-09-07 Thread Søren Sandmann Pedersen
Here is a new version of the bilinear scaler that fixes Matt's and Siarhei's comments and also uses movdqu instead of movdqa for the writes to iter-buffer. This ensures that the iterator doesn't impose new alignment restrictions that could interfere with the direct-to-destination optimizations.

[Pixman] [PATCHv2 3/3] ssse3: Add iterator for separable bilinear scaling

2013-09-07 Thread Søren Sandmann Pedersen
This new iterator uses the SSSE3 instructions pmaddubsw and pabsw to implement a fast iterator for bilinear scaling. There is a graph here recording the per-pixel time for various bilinear scaling algorithms as reported by scaling-bench:

[Pixman] [PATCHv2 1/3] general: Ensure that iter buffers are aligned to 16 bytes

2013-09-07 Thread Søren Sandmann Pedersen
At the moment iter buffers are only guaranteed to be aligned to a 4 byte boundary. SIMD implementations benefit from the buffers being aligned to 16 bytes, so ensure this is the case. V2: - Use uintptr_t instead of unsigned long - allocate 3 * SCANLINE_BUFFER_LENGTH byte on stack rather than just

[Pixman] [PATCHv2 2/3] Add empty SSSE3 implementation

2013-09-07 Thread Søren Sandmann Pedersen
This commit adds a new, empty SSSE3 implementation and the associated build system support. configure.ac: detect whether the compiler understands SSSE3 intrinsics and set up the required CFLAGS Makefile.am:Add libpixman-ssse3.la pixman-x86.c: Add X86_SSSE3 feature flag

[Pixman] [PATCH 1/3] {scaling, affine, composite-traps}-test: Use compute_crc32_for_image()

2013-09-12 Thread Søren Sandmann Pedersen
By using this function instead of compute_crc32() the alpha masking code and the call to image_endian_swap() are not duplicated. --- test/affine-test.c | 12 ++-- test/composite-traps-test.c | 11 +-- test/scaling-test.c | 12 ++-- 3 files changed, 5

[Pixman] [PATCH 3/3] test: Test negative strides

2013-09-12 Thread Søren Sandmann Pedersen
Pixman supports negative strides, but up until now they haven't been tested outside of stress-test. This commit adds testing of negative strides to blitters-test, scaling-test, affine-test, rotate-test, and composite-traps-test. --- test/affine-test.c | 22 --

[Pixman] [PATCH 2/3] test: Share the image printing code

2013-09-12 Thread Søren Sandmann Pedersen
The affine-test, blitters-test, and scaling-test all have the ability to print out the bytes of the destination image. Share this code by moving it to utils.c. At the same time make the code work correctly with negative strides. --- test/affine-test.c | 12 +---

[Pixman] [PATCH 2/3] Move generated affine fetchers into pixman-fast-path.c

2013-09-18 Thread Søren Sandmann Pedersen
From: Søren Sandmann Pedersen s...@redhat.com The generated fetchers for NEAREST, BILINEAR, and SEPARABLE_CONVOLUTION filters are fast paths and so they belong in pixman-fast-path.c --- pixman/pixman-bits-image.c | 530 pixman/pixman-fast-path.c

[Pixman] [PATCH 0/5] Some changes to Color Dodge and Color Burn

2013-10-05 Thread Søren Sandmann Pedersen
The overall goal of the following patches is to make it more obvious how the blend mode code relates to the specifications. To that end, the comment for each blend routine is updated with some math that shows how we go from specification to a formula that can deal with premultiplied alpha, and the

[Pixman] [PATCH 1/5] pixman-combine32.c: Formatting fixes

2013-10-05 Thread Søren Sandmann Pedersen
Fix a bunch of spacing issues. --- pixman/pixman-combine32.c | 112 +++--- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/pixman/pixman-combine32.c b/pixman/pixman-combine32.c index 3ac7576..be3cfdf 100644 --- a/pixman/pixman-combine32.c

[Pixman] [PATCH 2/5] pixman-combine32: Improve documentation for blend mode operators

2013-10-05 Thread Søren Sandmann Pedersen
This commit overhauls the comments in pixman-comine32.c regarding blend modes: - Add a link to the PDF supplement that clarifies the specification of ColorBurn and ColorDodge - Clarify how the formulas for premultiplied colors are derived form the ones in the PDF specifications - Write out

[Pixman] [PATCH 4/5] Make ColorDodge code follow the math closer

2013-10-05 Thread Søren Sandmann Pedersen
Change blend_color_dodge() to follow the math in the comment more closely. Note, the new code here is in some sense worse than the old code because it can now underflow the unsigned variables when the source is superluminescent and (as - s) is therefore negative. The old code was careful to clamp

[Pixman] [PATCH 3/5] pixman-combine32: Rename a number of variable from sa/sca to as/s

2013-10-05 Thread Søren Sandmann Pedersen
There are no semantic changes, just variables renames. The motivation for these renames is so that the names are shorter and better match the one used in the comments. --- pixman/pixman-combine32.c | 199 +++--- 1 file changed, 99 insertions(+), 100

[Pixman] [PATCH 5/5] Make code for color burn follow the math more closely

2013-10-05 Thread Søren Sandmann Pedersen
For superluminescent destinations, the old code could underflow in uint32_t r = (ad - d) * as / s; when (ad - d) was negative. The new code avoids this problem (and therefore causes changes in the checksums of thread-test and blitters-test), but it is likely still buggy due to the use of

[Pixman] [PATCH] Fix comment about BILINEAR_INTERPOLATION_BITS to say 8 rather than = 8

2014-09-19 Thread Søren Sandmann Pedersen
Since a4c79d695d52c94647b1aff7 the constant BILINEAR_INTERPOLATION_BITS must be strictly less than 8, so fix the comment to say this, and also add a COMPILE_TIME_ASSERT in the bilinear fetcher in pixman-fast-path.c --- pixman/pixman-fast-path.c | 2 ++ pixman/pixman-private.h | 2 +- 2 files

[Pixman] [PATCHv2 0/3] More general reduction of BILINEAR to NEAREST

2016-03-18 Thread Søren Sandmann Pedersen
This series addresses the comments by Bill and also changes pixman-fast-path.c so that it picks NEAREST fast paths before BILINEAR. (I noticed this because the new filter-reduction-test.c failed to detect a bug that I deliberately introduced). Søren

[Pixman] [PATCHv2 2/3] Add new test of filter reduction from BILINEAR to NEAREST

2016-03-19 Thread Søren Sandmann Pedersen
This new test tests a bunch of bilinear downscalings, where many have a transformation such that the BILINEAR filter can be reduced to NEAREST (and many don't). A CRC32 is computed for all the resulting images and compared to a known-good value for both 4-bit and 7-bit interpolation. V2: Remove

[Pixman] [PATCH 1/2] Add new test of filter reduction from BILINEAR to NEAREST

2016-03-15 Thread Søren Sandmann Pedersen
This new test tests a bunch of bilinear downscalings, where many have a transformation such that the BILINEAR filter can be reduced to NEAREST (and many don't). A CRC32 is computed for all the resulting images and compared to a known-good value for both 4-bit and 7-bit interpolation.

[Pixman] More general BILINEAR to NEAREST reduction

2016-03-15 Thread Søren Sandmann Pedersen
The following two patches generalize the reduction of BILINEAR to NEAREST based on the formula mentioned here: https://lists.freedesktop.org/archives/pixman/2010-August/000321.html Søren ___ Pixman mailing list Pixman@lists.freedesktop.org

[Pixman] [PATCH 04/14] demos/scale: Compute filter size using boundary of xformed ellipse

2016-04-11 Thread Søren Sandmann Pedersen
From: Bill Spitzak Instead of using the boundary of xformed rectangle, use the boundary of xformed ellipse. This is much more accurate and less blurry. In particular the filtering does not change as the image is rotated. Signed-off-by: Bill Spitzak

[Pixman] [PATCH 06/14] demos/scale: Default to locked axis

2016-04-11 Thread Søren Sandmann Pedersen
From: Bill Spitzak Signed-off-by: Bill Spitzak Reviewed-by: Søren Sandmann --- demos/scale.ui | 1 + 1 file changed, 1 insertion(+) diff --git a/demos/scale.ui b/demos/scale.ui index f6f6e89..d498d26 100644 --- a/demos/scale.ui

[Pixman] [PATCH 09/14] pixman-filter: Correct Simpsons integration

2016-04-11 Thread Søren Sandmann Pedersen
From: Bill Spitzak Simpsons uses cubic curve fitting, with 3 samples defining each cubic. This makes the weights of the samples be in a pattern of 1,4,2,4,2...4,1, and then dividing the result by 3. The previous code was using weights of 1,2,0,6,0,6...,2,1. With this fix the

[Pixman] [PATCH 01/14] pixman-fast-path.c: Pick NEAREST affine fast paths before BILINEAR ones

2016-04-11 Thread Søren Sandmann Pedersen
When a BILINEAR filter is reduced to NEAREST, it is possible for both types of fast paths to run; in this case, the NEAREST ones should be preferred as that is the simpler filter. Signed-off-by: Soren Sandmann --- pixman/pixman-fast-path.c | 4 ++-- 1 file changed, 2

[Pixman] [PATCH 08/14] pixman-filter: reduce amount of malloc/free/memcpy to generate filter

2016-04-11 Thread Søren Sandmann Pedersen
From: Bill Spitzak Rearranged so that the entire block of memory for the filter pair is allocated first, and then filled in. Previous version allocated and freed two temporary buffers for each filter and did an extra memcpy. v8: small refactor to remove the filter_width

[Pixman] [PATCH 10/14] pixman-filter: integral splitting is only needed for triangle filter

2016-04-11 Thread Søren Sandmann Pedersen
From: Bill Spitzak Only the triangle is discontinuous at 0. The other filters resemble a cubic closely enough that Simpsons integration works without splitting. Changes by Søren: Rebase without the changes to the integral function, update comment to match the new code.

[Pixman] [PATCH 13/14] pixman-filter: Nested polynomial for cubic

2016-04-11 Thread Søren Sandmann Pedersen
From: Bill Spitzak v11: Restored range checks Signed-off-by: Bill Spitzak Reviewed-by: Oded Gabbay --- pixman/pixman-filter.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pixman/pixman-filter.c

[Pixman] Bill Spitzak patches

2016-04-11 Thread Søren Sandmann Pedersen
Hi, The following patch series contains those of Bill's patches that I think are ready to be pushed to master, plus some other related changes that I also think are ready. 01-03: These are patches to do more BILINEAR->NEAREST filter reductions. They were inspired by a similar patch in

[Pixman] [PATCH 11/14] pixman-filter: Speed up BOX/BOX filter

2016-04-11 Thread Søren Sandmann Pedersen
The convolution of two BOX filters is simply the length of the interval where both are non-zero, so we can simply return width from the integral() function because the integration region has already been restricted to be such that both functions are non-zero on it. This is both faster and more

[Pixman] [PATCH 02/14] Add new test of filter reduction from BILINEAR to NEAREST

2016-04-11 Thread Søren Sandmann Pedersen
This new test tests a bunch of bilinear downscalings, where many have a transformation such that the BILINEAR filter can be reduced to NEAREST (and many don't). A CRC32 is computed for all the resulting images and compared to a known-good value for both 4-bit and 7-bit interpolation. V2: Remove

[Pixman] [PATCH 03/14] More general BILINEAR=>NEAREST reduction

2016-04-11 Thread Søren Sandmann Pedersen
Generalize and simplify the code that reduces BILINEAR to NEAREST so that the reduction happens for all affine transformations where t00...t12 are integers and (t00 + t01) and (t10 + t11) are both odd. This is a sufficient condition for the resulting transformed coordinates to be exactly at the

[Pixman] [PATCH 07/14] pixman-image: Added enable-gnuplot config to view filters in gnuplot

2016-04-11 Thread Søren Sandmann Pedersen
From: Bill Spitzak If enable-gnuplot is configured, then you can pipe the output of a pixman-using program to gnuplot and get a continuously-updated plot of the horizontal filter. This works well with demos/scale to test the filter generation. The plot is all the different

[Pixman] [PATCHv2 1/3] pixman-fast-path.c: Pick NEAREST affine fast paths before BILINEAR ones

2016-03-19 Thread Søren Sandmann Pedersen
When a BILINEAR filter is reduced to NEAREST, it is possible for both types of fast paths to run; in this case, the NEAREST ones should be preferred as that is the simpler filter. Signed-off-by: Soren Sandmann --- pixman/pixman-fast-path.c | 4 ++-- 1 file changed, 2

[Pixman] [PATCHv2 3/3] More general BILINEAR=>NEAREST reduction

2016-03-19 Thread Søren Sandmann Pedersen
Generalize and simplify the code that reduces BILINEAR to NEAREST so that all the reduction happens for all affine transformations where t00..t12 are integers and (t00 + t01) and (t10 + t11) are both odd. This is a sufficient condition for the resulting transformed coordinates to be exactly at the