[Pixman] [PATCH 09/15] pixman-filter: put filter error on center pixel

2015-12-12 Thread spitzak
From: Bill Spitzak Any error in filter normalization is placed on the center of odd-sized filters, rather than 1 pixel to the right. In particular this fixes the 1-wide filters produced by impulse sampling so they are 1.0 rather than 0.0. --- pixman/pixman-filter.c | 2 +- 1 file changed, 1

[Pixman] [PATCH 07/15] pixman-filter: Speed up the BOX+BOX filter

2015-12-12 Thread spitzak
From: Bill Spitzak This is easy as the caller already intersected the two boxes, so the width is the integral. --- pixman/pixman-filter.c | 5 + 1 file changed, 5 insertions(+) diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c index 4aafa51..782f73d 100644 --- a/pixman/pixman

[Pixman] [PATCH 05/15] pixman-filter: Correct Simpsons integration

2015-12-12 Thread spitzak
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,6,6...6,2,1 which produced about 2x the correct value

[Pixman] [PATCH 02/15] demos/scale: Added pulldown to choose PIXMAN_FILTER_* value

2015-12-12 Thread spitzak
From: Bill Spitzak This allows testing of GOOD/BEST and to do comparisons between the basic filters and PIXMAN_FILTER_SEPARABLE_CONVOLUTION settings. --- demos/scale.c | 14 +- demos/scale.ui | 40 ++-- 2 files changed, 43 insertions(+), 11

[Pixman] [PATCH 06/15] pixman-filter: reduced number of samples in Simpson's integration

2015-12-12 Thread spitzak
From: Bill Spitzak With the cubic fix this is plenty accurate enough, far in excess of the pixman fixed-point error limit. Likely even 16 samples is too many. --- pixman/pixman-filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixman/pixman-filter.c b/pixman/pixman

[Pixman] [PATCH 03/15] pixman-filter: Consistency in arg names to integral ()

2015-12-12 Thread spitzak
From: Bill Spitzak Rename kernel1/2 to reconstruct/sample and use 1/scale as the scale argument, thus matching the names in other functions. --- pixman/pixman-filter.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pixman/pixman-filter.c b

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

2015-12-12 Thread spitzak
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. --- pixman/pixman-filter.c | 59

[Pixman] [PATCH 13/15] pixman-filter: refactor cubic polynominal and don't range check

2015-12-12 Thread spitzak
From: Bill Spitzak The other filters do not check for x being in range, so there is no reason for cubic to do so. --- pixman/pixman-filter.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c index 7e10108

[Pixman] [PATCH 12/15] pixman-filter: Turn off subsampling when not necessary

2015-12-12 Thread spitzak
From: Bill Spitzak If sample is IMPULSE and reconstruct is BOX or IMPULSE the sub-pixel position of the sample is not relevant, so only one subsample is needed. --- pixman/pixman-filter.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pixman/pixman-filter.c b

[Pixman] [PATCH 11/15] pixman-filter: made IMPULSE.IMPULSE not produce a zero-wide filter

2015-12-12 Thread spitzak
From: Bill Spitzak With the other patch to put error on the center pixel, this produces the same result as BOX.IMPULSE filter. --- pixman/pixman-filter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c index 00126cd..64981cd 100644 --- a

[Pixman] [PATCH 08/15] pixman-filter: Don't recurse unnecessarily.

2015-12-12 Thread spitzak
From: Bill Spitzak Only LINEAR is not differentiable at zero, so only do the recursive split of the integral for it. --- pixman/pixman-filter.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/pixman/pixman-filter.c b/pixman/pixman

[Pixman] [PATCH 15/15] pixman-image: Implement PIXMAN_FILTER_GOOD/BEST as separable convolutions

2015-12-12 Thread spitzak
From: Bill Spitzak Detects and uses PIXMAN_FILTER_NEAREST for all 8 90-degree rotations and reflections when the scale is 1.0 and integer translation. GOOD uses: scale < 1/16 : BOX.BOX at size 16 scale < 3/4 : BOX.BOX at size 1/scale larger : BOX.BOX at size 1 If both directions

[Pixman] [PATCH 01/15] demos/scale: Compute filter size using boundary of xformed ellipse, not rectangle

2015-12-12 Thread spitzak
From: Bill Spitzak This is much more accurate and less blurry. In particular the filtering does not change as the image is rotated. --- demos/scale.c | 43 ++- 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/demos/scale.c b/demos/scale.c

[Pixman] [PATCH pixman] V6 implement PIXMAN_FILTER_GOOD/BEST

2015-12-12 Thread spitzak
This is identical to my previous series of patches except rebased atop the current git master. Note that all patches except the last one are bug fixes to produce correct filters, and do not produce any changes in pixman output. IMHO the first 14 patches should be applied asap. The last patch chang

[Pixman] [PATCH 10/15] pixman-filter: don't range-check impulse filter

2015-12-12 Thread spitzak
From: Bill Spitzak The other filters don't range-check, so there is no need for this one to either. It is only called with x==0. --- pixman/pixman-filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c index fbc657d..00

[Pixman] [PATCH 14/15] pixman-filter: Gaussian fixes

2015-12-12 Thread spitzak
From: Bill Spitzak The SIGMA term drops out on simplification. Expanded the size slightly (from ~4.25 to 5) to make the cutoff less noticable. The filter is truncated at a value of .001 instead of .006, this new value is less than 1/2 of 1/255, rather than greater than it. --- pixman/pixman

[Pixman] [PATCH 03/13] pixman-image: Added GNUPLOT_OUTPUT compile-time option to view filters in gnuplot

2016-01-03 Thread spitzak
From: Bill Spitzak If GNUPLOT_OUTPUT is set, 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 subposition filters shuffled

[Pixman] [PATCH pixman] V7 implement PIXMAN_FILTER_GOOD/BEST

2016-01-03 Thread spitzak
Differences from previous version: - Added compile-time option to pipe filters to gnuplot for analysis. - Fixed integral when one of the filters is IMPULSE, previous version was offsetting the sample from the center. - Distribute fixed-point error on all samples, rather than putting it all on th

[Pixman] [PATCH 10/13] pixman-filter: Gaussian fixes

2016-01-03 Thread spitzak
From: Bill Spitzak The SIGMA term drops out on simplification. Expanded the size slightly (from ~4.25 to 5) to make the cutoff less noticable. The filter is truncated at a value of .001 instead of .006, this new value is less than 1/2 of 1/255, rather than greater than it. --- pixman/pixman

[Pixman] [PATCH 06/13] pixman-filter: Correct Simpsons integration

2016-01-03 Thread spitzak
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,6,6...6,2,1. Since it divided by 3 this produced

[Pixman] [PATCH 11/13] pixman-filter: Turn off subsampling for width=1 filters

2016-01-03 Thread spitzak
From: Bill Spitzak Due to normalization these filters must all be identical (a single 1.0). Also make IMPULSE.IMPULSE produce a width=1 filter, rather than zero (which did not work). --- pixman/pixman-filter.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a

[Pixman] [PATCH 08/13] pixman-filter: don't range-check impulse filter

2016-01-03 Thread spitzak
From: Bill Spitzak The other filters don't range-check, so there is no need for this one to either. It is only called with x==0. --- pixman/pixman-filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c index 0749e51..22

[Pixman] [PATCH 13/13] pixman-image: Implement PIXMAN_FILTER_GOOD/BEST as separable convolutions

2016-01-03 Thread spitzak
From: Bill Spitzak Detects and uses PIXMAN_FILTER_NEAREST for all 8 90-degree rotations and reflections when the scale is 1.0 and integer translation. GOOD uses: scale < 1/16 : BOX.BOX at size 16 scale < 3/4 : BOX.BOX at size 1/scale larger : BOX.BOX at size 1 If both directions

[Pixman] [PATCH 09/13] pixman-filter: refactor cubic polynominal and don't range check

2016-01-03 Thread spitzak
From: Bill Spitzak The other filters do not check for x being in range, so there is no reason for cubic to do so. --- pixman/pixman-filter.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c index 2298235

[Pixman] [PATCH 12/13] pixman-filter: Made reconstruct==impulse and scale < 1 set scale to 1

2016-01-03 Thread spitzak
From: Bill Spitzak This replaces settings that don't work (because the filter cannot be normalized) with something that produces an image. --- pixman/pixman-filter.c | 4 1 file changed, 4 insertions(+) diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c index dba5c74..77

[Pixman] [PATCH 01/13] demos/scale: Compute filter size using boundary of xformed ellipse, not rectangle

2016-01-03 Thread spitzak
From: Bill Spitzak This is much more accurate and less blurry. In particular the filtering does not change as the image is rotated. --- demos/scale.c | 102 +++--- 1 file changed, 61 insertions(+), 41 deletions(-) diff --git a/demos/scale.c b

[Pixman] [PATCH 04/13] pixman-filter: Consistency in arg names to integral ()

2016-01-03 Thread spitzak
From: Bill Spitzak Rename kernel1/2 to reconstruct/sample and use 1/scale as the scale argument, thus matching the names in other functions. --- pixman/pixman-filter.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pixman/pixman-filter.c b

[Pixman] [PATCH 02/13] demos/scale: Added pulldown to choose PIXMAN_FILTER_* value

2016-01-03 Thread spitzak
From: Bill Spitzak This allows testing of GOOD/BEST and to do comparisons between the basic filters and PIXMAN_FILTER_SEPARABLE_CONVOLUTION settings. --- demos/scale.c | 14 +- demos/scale.ui | 40 ++-- 2 files changed, 43 insertions(+), 11

[Pixman] [PATCH 07/13] pixman-filter: Corrections to the integral() function

2016-01-03 Thread spitzak
From: Bill Spitzak The IMPULSE special-cases did not sample the center of the of the region. This caused it to sample the filters outside their range, and produce assymetric filters and other errors. Fixing this required changing the arguments to integral() so the correct point could be

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

2016-01-03 Thread spitzak
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. --- pixman/pixman-filter.c | 59

[Pixman] [PATCH v8 pixman] implement PIXMAN_FILTER_GOOD/BEST

2016-01-04 Thread spitzak
Changes from previous version: - gnuplot output is now a config option - Adjustment to cutoff between BEST filters for better match - Reduced subsampling of GOOD/BEST from extreme value mistakenly used ___ Pixman mailing list Pixman@lists.freedesktop.or

[Pixman] [PATCH v8 07/14] pixman-filter: Corrections to the integral() function

2016-01-04 Thread spitzak
From: Bill Spitzak The IMPULSE special-cases did not sample the center of the of the region. This caused it to sample the filters outside their range, and produce assymetric filters and other errors. Fixing this required changing the arguments to integral() so the correct point could be

[Pixman] [PATCH v8 09/14] pixman-filter: refactor cubic polynominal and don't range check

2016-01-04 Thread spitzak
From: Bill Spitzak The other filters do not check for x being in range, so there is no reason for cubic to do so. v1: initial version Signed-off-by: Bill Spitzak --- pixman/pixman-filter.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pixman/pixman

[Pixman] [PATCH v8 11/14] pixman-filter: Turn off subsampling for width=1 filters

2016-01-04 Thread spitzak
From: Bill Spitzak Due to normalization these filters must all be identical (a single 1.0). Also make IMPULSE.IMPULSE produce a width=1 filter, rather than zero (which did not work). v7: Replaced earlier tests for BOX.IMPULSE Signed-off-by: Bill Spitzak --- pixman/pixman-filter.c | 14

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

2016-01-04 Thread spitzak
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 subposition filters

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

2016-01-04 Thread spitzak
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 function Signed-off-by

[Pixman] [PATCH v8 01/14] demos/scale: Compute filter size using boundary of xformed ellipse, not rectangle

2016-01-04 Thread spitzak
From: Bill Spitzak 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 --- demos/scale.c | 102 +++--- 1 file changed, 61 insertions(+), 41 deletions

[Pixman] [PATCH v8 10/14] pixman-filter: Gaussian fixes

2016-01-04 Thread spitzak
From: Bill Spitzak The SIGMA term drops out on simplification. Expanded the size slightly (from ~4.25 to 5) to make the cutoff less noticable. The filter is truncated at a value of .001 instead of .006, this new value is less than 1/2 of 1/255, rather than greater than it. v1: initial version

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

2016-01-04 Thread spitzak
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,6,6...6,2,1. Since it divided by 3 this produced

[Pixman] [PATCH v8 02/14] demos/scale: Added pulldown to choose PIXMAN_FILTER_* value

2016-01-04 Thread spitzak
From: Bill Spitzak This allows testing of GOOD/BEST and to do comparisons between the basic filters and PIXMAN_FILTER_SEPARABLE_CONVOLUTION settings. Signed-off-by: Bill Spitzak --- demos/scale.c | 14 +- demos/scale.ui | 40 ++-- 2 files

[Pixman] [PATCH v8 14/14] pixman-image: Implement PIXMAN_FILTER_GOOD/BEST as separable convolutions

2016-01-04 Thread spitzak
From: Bill Spitzak Detects and uses PIXMAN_FILTER_NEAREST for all 8 90-degree rotations and reflections when the scale is 1.0 and integer translation. GOOD uses: scale < 1/16 : BOX.BOX at size 16 scale < 3/4 : BOX.BOX at size 1/scale larger : BOX.BOX at size 1 If both directions

[Pixman] [PATCH v8 08/14] pixman-filter: don't range-check impulse filter

2016-01-04 Thread spitzak
From: Bill Spitzak The other filters don't range-check, so there is no need for this one to either. It is only called with x==0. v1: initial version Signed-off-by: Bill Spitzak --- pixman/pixman-filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixman/p

[Pixman] [PATCH v8 04/14] pixman-filter: Consistency in arg names to integral ()

2016-01-04 Thread spitzak
From: Bill Spitzak Rename kernel1/2 to reconstruct/sample and use 1/scale as the scale argument, thus matching the names in other functions. Signed-off-by: Bill Spitzak --- pixman/pixman-filter.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git

[Pixman] [PATCH v8 12/14] pixman-filter: Made reconstruct==impulse and scale < 1 set scale to 1

2016-01-04 Thread spitzak
From: Bill Spitzak This replaces settings that don't work (because the filter cannot be normalized) with something that produces an image. v7: First version with this. Previously you got lots of strange garbage filters that depended on the implementation. Signed-off-by: Bill Sp

[Pixman] [PATCH v8 13/14] Added big comment to filter

2016-01-04 Thread spitzak
From: Bill Spitzak v8: first version Signed-off-by: Bill Spitzak --- pixman/pixman-filter.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c index 3237036..0961cfc 100644 --- a/pixman/pixman-filter.c

[Pixman] [PATCH v9 01/15] demos/scale: Compute filter size using boundary of xformed ellipse, not rectangle

2016-01-22 Thread spitzak
From: Bill Spitzak 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 --- demos/scale.c | 102 +++--- 1 file changed, 61 insertions(+), 41 deletions

[Pixman] [PATCH v9] Implement PIXMAN_FILTER_GOOD/BEST

2016-01-22 Thread spitzak
Changes from previous version: - Passes make check (previous one crashed in stress-test) - Negative subsample_bits sets it to appx log2(-n/scale) - Scale demo changed to default to the GOOD setting and allow negative subsamples - Some adjustment of the subsampling in GOOD/BEST Compatibiliy notes

[Pixman] [PATCH v9 02/15] demos/scale: Added pulldown to choose PIXMAN_FILTER_* value

2016-01-22 Thread spitzak
From: Bill Spitzak This allows testing of GOOD/BEST and to do comparisons between the basic filters and PIXMAN_FILTER_SEPARABLE_CONVOLUTION settings. Signed-off-by: Bill Spitzak --- demos/scale.c | 14 +- demos/scale.ui | 40 ++-- 2 files

[Pixman] [PATCH v9 05/15] pixman-filter: reduce amount of malloc/free/memcpy to generate filter

2016-01-22 Thread spitzak
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 function v1: first

[Pixman] [PATCH v9 03/15] pixman-image: Added enable-gnuplot config to view filters in gnuplot

2016-01-22 Thread spitzak
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 subposition filters

[Pixman] [PATCH v9 12/15] pixman-filter: Made reconstruct==impulse and scale < 1 set scale to 1

2016-01-22 Thread spitzak
From: Bill Spitzak This replaces settings that don't work (because the filter cannot be normalized) with something that produces an image. v7: First version with this. Previously you got lots of strange garbage filters that depended on the implementation. Signed-off-by: Bill Sp

[Pixman] [PATCH v9 04/15] pixman-filter: Consistency in arg names to integral ()

2016-01-22 Thread spitzak
From: Bill Spitzak Rename kernel1/2 to reconstruct/sample and use 1/scale as the scale argument, thus matching the names in other functions. Signed-off-by: Bill Spitzak --- pixman/pixman-filter.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git

[Pixman] [PATCH v9 07/15] pixman-filter: Corrections to the integral() function

2016-01-22 Thread spitzak
From: Bill Spitzak The IMPULSE special-cases did not sample the center of the of the region. This caused it to sample the filters outside their range, and produce assymetric filters and other errors. Fixing this required changing the arguments to integral() so the correct point could be

[Pixman] [PATCH v9 11/15] pixman-filter: Turn off subsampling for width=1 filters

2016-01-22 Thread spitzak
From: Bill Spitzak Due to normalization these filters must all be identical (a single 1.0). Also make IMPULSE.IMPULSE produce a width=1 filter, rather than zero (which did not work). v7: Replaced earlier tests for BOX.IMPULSE Signed-off-by: Bill Spitzak --- pixman/pixman-filter.c | 14

[Pixman] [PATCH v9 06/15] pixman-filter: Correct Simpsons integration

2016-01-22 Thread spitzak
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,6,6...6,2,1. Since it divided by 3 this produced

[Pixman] [PATCH v9 09/15] pixman-filter: don't range-check in filter functions

2016-01-22 Thread spitzak
From: Bill Spitzak The integral will not be called outside the width so there is no need to check against these. v9: merged commits for cubic and impulse into same one v1: initial version Signed-off-by: Bill Spitzak --- pixman/pixman-filter.c | 18 -- 1 file changed, 8

[Pixman] [PATCH v9 14/15] pixman-filter: Added big comment to filter

2016-01-22 Thread spitzak
From: Bill Spitzak v9: Described arguments and more filter combinations, fixed some errors. v8: first version Signed-off-by: Bill Spitzak --- pixman/pixman-filter.c | 46 +- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/pixman/pixman

[Pixman] [PATCH v9 15/15] pixman-image: Implement PIXMAN_FILTER_GOOD/BEST as separable convolutions

2016-01-22 Thread spitzak
From: Bill Spitzak Detects and uses PIXMAN_FILTER_NEAREST for all 8 90-degree rotations and reflections when the scale is 1.0 and integer translation. GOOD uses: scale < 1/16 : BOX.BOX at size 16 scale < 3/4 : BOX.BOX at size 1/scale larger : BOX.BOX at size 1 If both directions

[Pixman] [PATCH v9 10/15] pixman-filter: Gaussian fixes

2016-01-22 Thread spitzak
From: Bill Spitzak The SIGMA term drops out on simplification. Expanded the size slightly (from ~4.25 to 5) to make the cutoff less noticable. The filter is truncated at a value of .001 instead of .006, this new value is less than 1/2 of 1/255, rather than greater than it. v1: initial version

[Pixman] [PATCH v9 08/15] pixman-filter: fix subsample_bits = 0

2016-01-22 Thread spitzak
From: Bill Spitzak This was not calculating the correct x to compute the filter at. v9: First version with this patch Signed-off-by: Bill Spitzak --- pixman/pixman-filter.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c

[Pixman] [PATCH v9 13/15] pixman-filter: Negative subsample values produces scaled result

2016-01-22 Thread spitzak
From: Bill Spitzak If a negative value is used for the subsampling, then -n subsamples are used at scale==1, and fewer are used at larger scale, more are used at smaller scale, so that the total number of samples is approximately the same. The computed value is rounded up to the next power of 2

[Pixman] [PATCH v10 02/15] demos/scale: Added pulldown to choose PIXMAN_FILTER_* value

2016-02-01 Thread spitzak
From: Bill Spitzak This allows testing of GOOD/BEST and to do comparisons between the basic filters and PIXMAN_FILTER_SEPARABLE_CONVOLUTION settings. Signed-off-by: Bill Spitzak Reviewed-by: Oded Gabbay --- demos/scale.c | 14 +- demos/scale.ui | 40

[Pixman] [PATCH v10] Implement PIXMAN_FILTER_GOOD/BEST

2016-02-01 Thread spitzak
Changes from previous version: - Some refactor to reduce size of each patch - Fixed rebase error that made some patches not compile - Renamed "scale" to "size" to avoid confusion with the transform scale Compatibiliy notes: For the default filter of GOOD this produces the same BILINEAR result for

[Pixman] [PATCH v10 09/15] pixman-filter: don't range-check in filter functions

2016-02-01 Thread spitzak
From: Bill Spitzak The integral will not be called outside the width so there is no need to check against these. v9: merged commits for cubic and impulse into same one Signed-off-by: Bill Spitzak --- pixman/pixman-filter.c | 18 -- 1 file changed, 8 insertions(+), 10

[Pixman] [PATCH v10 12/15] pixman-filter: Made reconstruct==impulse and scale < 1 set scale to 1

2016-02-01 Thread spitzak
From: Bill Spitzak This replaces settings that don't work (because the filter cannot be normalized) with something that produces an image. v7: First version with this. Previously you got lots of strange garbage filters that depended on the implementation. v10: Moved code to filter_

[Pixman] [PATCH v10 14/15] pixman-filter: Add description to pixman_filter_create_separable_convolution()

2016-02-01 Thread spitzak
From: Bill Spitzak v9: Described arguments and more filter combinations, fixed some errors. Signed-off-by: Bill Spitzak Reviewed-by: Oded Gabbay --- pixman/pixman-filter.c | 45 + 1 file changed, 45 insertions(+) diff --git a/pixman/pixman

[Pixman] [PATCH v10 15/15] pixman-image: Implement PIXMAN_FILTER_GOOD/BEST as separable convolutions

2016-02-01 Thread spitzak
From: Bill Spitzak Detects and uses PIXMAN_FILTER_NEAREST for all 8 90-degree rotations and reflections when the scale is 1.0 and integer translation. GOOD uses: scale < 1/16 : BOX.BOX at size 16 scale < 3/4 : BOX.BOX at size 1/scale larger : BOX.BOX at size 1 If both directions

[Pixman] [PATCH v10 13/15] pixman-filter: Negative subsample values produces scaled result

2016-02-01 Thread spitzak
From: Bill Spitzak If a negative value is used for the subsampling, then -n subsamples are used at scale==1, and fewer are used at larger scale, more are used at smaller scale, so that the total number of samples is approximately the same. The computed value is rounded up to the next power of 2

[Pixman] [PATCH v10 11/15] pixman-filter: Turn off subsampling for width=1 filters

2016-02-01 Thread spitzak
From: Bill Spitzak Due to normalization these filters must all be identical (a single 1.0). Also make IMPULSE.IMPULSE produce a width=1 filter, rather than zero (which did not work). v7: Replaced earlier tests for BOX.IMPULSE v10: Moved code to filter_width function Signed-off-by: Bill

[Pixman] [PATCH v10 06/15] pixman-filter: reduce amount of malloc/free/memcpy to generate filter

2016-02-01 Thread spitzak
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 function v10: Restored

[Pixman] [PATCH v10 08/15] pixman-filter: Corrections to the integral() function

2016-02-01 Thread spitzak
From: Bill Spitzak The IMPULSE special-cases did not sample the center of the of the region. This caused it to sample the filters outside their range, and produce assymetric filters and other errors. Fixing this required changing the arguments to integral() so the correct point could be

[Pixman] [PATCH v10 04/15] pixman-image: Added enable-gnuplot config to view filters in gnuplot

2016-02-01 Thread spitzak
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 subposition filters

[Pixman] [PATCH v10 01/15] demos/scale: Compute filter size using boundary of xformed ellipse, not rectangle

2016-02-01 Thread spitzak
From: Bill Spitzak 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 Reviewed-by: Oded Gabbay --- demos/scale.c | 102 +++--- 1 file changed, 61

[Pixman] [PATCH v10 03/15] demos/scale: Only generate filters when used for separable

2016-02-01 Thread spitzak
From: Bill Spitzak This makes the speed of the demo more accurate, as the filter generation is a visible fraction of the time it takes to do a transform. This also prevents the output of unused filters in the gnuplot option in the next patch. Signed-off-by: Bill Spitzak --- demos/scale.c | 29

[Pixman] [PATCH v10 05/15] pixman-filter: Consistency in arg names to integral ()

2016-02-01 Thread spitzak
From: Bill Spitzak Rename kernel1/2 to reconstruct/sample to match the other functions. Rename "scale" to "size" to avoid confusion with the scale being applied to the image, which is the reciprocol of this value. v10: Renamed "scale" to "size" Signed-

[Pixman] [PATCH v10 10/15] pixman-filter: Gaussian fixes

2016-02-01 Thread spitzak
From: Bill Spitzak The SIGMA term drops out on simplification. Expanded the size slightly (from ~4.25 to 5) to make the cutoff less noticable. The filter is truncated at a value of .001 instead of .006, this new value is less than 1/2 of 1/255, rather than greater than it. Signed-off-by: Bill

[Pixman] [PATCH v10 07/15] pixman-filter: Correct Simpsons integration

2016-02-01 Thread spitzak
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,6,6...6,2,1. Since it divided by 3 this produced

[Pixman] [PATCH v11 01/14] demos/scale: Compute filter size using boundary of xformed ellipse, not rectangle

2016-02-04 Thread spitzak
From: Bill Spitzak 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 Reviewed-by: Oded Gabbay --- demos/scale.c | 102 +++--- 1 file changed, 61

[Pixman] [PATCH v11 08/14] pixman-filter: Corrections to the integral() function

2016-02-04 Thread spitzak
From: Bill Spitzak The IMPULSE special-cases did not sample the center of the of the region. This caused it to sample the filters outside their range, and produce assymetric filters and other errors. Fixing this required changing the arguments to integral() so the correct point could be

[Pixman] [PATCH v11 12/14] pixman-filter: Add description to pixman_filter_create_separable_convolution()

2016-02-04 Thread spitzak
From: Bill Spitzak v9: Described arguments and more filter combinations, fixed some errors. v11: Further correction, in particular replaced "scale" with "size" Signed-off-by: Bill Spitzak --- pixman/pixman-filter.c | 50 ++

[Pixman] [PATCH v11 05/14] pixman-filter: Consistency in arg names to integral ()

2016-02-04 Thread spitzak
From: Bill Spitzak Rename kernel1/2 to reconstruct/sample to match the other functions. Rename "scale" to "size" to avoid confusion with the scale being applied to the image, which is the reciprocol of this value. v10: Renamed "scale" to "size" Signed-

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

2016-02-04 Thread spitzak
From: Bill Spitzak v11: Restored range checks Signed-off-by: Bill Spitzak --- pixman/pixman-filter.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c index e82871f..e5ef8e6 100644 --- a/pixman/pixman-filter.c

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

2016-02-04 Thread spitzak
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,6,6...6,2,1. Since it divided by 3 this produced

[Pixman] [PATCH v11 11/14] pixman-filter: Negative subsample values produces scaled result

2016-02-04 Thread spitzak
From: Bill Spitzak If a negative value is used for the subsampling, then -n subsamples are used at scale==1, and fewer are used at larger scale, more are used at smaller scale, so that the total number of samples is approximately the same. The computed value is rounded up to the next power of 2

[Pixman] [PATCH v11 13/14] pixman-image: Implement PIXMAN_FILTER_GOOD/BEST as separable convolutions

2016-02-04 Thread spitzak
From: Bill Spitzak Detects and uses PIXMAN_FILTER_NEAREST for all 8 90-degree rotations and reflections when the scale is 1.0 and integer translation. GOOD uses: scale < 1/16 : BOX.BOX at size 16 scale < 3/4 : BOX.BOX at size 1/scale larger : BOX.BOX at size 1 If both directions

[Pixman] [PATCH v11 14/14] demos/scale: default to GOOD and locked-together axis

2016-02-04 Thread spitzak
From: Bill Spitzak This makes the demo match normal behavior of pixman/cairo at startup. Signed-off-by: Bill Spitzak --- demos/scale.c | 10 +- demos/scale.ui | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/demos/scale.c b/demos/scale.c index 6d7ad2a..d1fce5d

[Pixman] [PATCH v11 02/14] demos/scale: Added pulldown to choose PIXMAN_FILTER_* value

2016-02-04 Thread spitzak
From: Bill Spitzak This allows testing of GOOD/BEST and to do comparisons between the basic filters and PIXMAN_FILTER_SEPARABLE_CONVOLUTION settings. Signed-off-by: Bill Spitzak Reviewed-by: Oded Gabbay --- demos/scale.c | 14 +- demos/scale.ui | 40

[Pixman] [PATCH v11] Implement PIXMAN_FILTER_GOOD/BEST

2016-02-04 Thread spitzak
Changes form previous version: - whitespace and formatting fixes - removed "fixes" for IMPULSE.x at size < 1 or IMPULSE.IMPULSE, just let them produce unusable filters, since caller can avoid doing this. - removed patch that deleted range checks - simplification of the filter_width function - fix

[Pixman] [PATCH v11 10/14] pixman-filter: Gaussian fixes

2016-02-04 Thread spitzak
From: Bill Spitzak The SIGMA term drops out on simplification. Expanded the size slightly (from ~4.25 to 5) to make the cutoff less noticable. Previouly the value at the cutoff was gaussian_filter(sqrt(2)*3/2) = 0.00626 which is larger than the difference between 8-bit pixels (1/255 = 0.003921

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

2016-02-04 Thread spitzak
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 subposition filters

[Pixman] [PATCH v11 03/14] demos/scale: Only generate filters when used for separable

2016-02-04 Thread spitzak
From: Bill Spitzak This makes the speed of the demo more accurate, as the filter generation is a visible fraction of the time it takes to do a transform. This also prevents the output of unused filters in the gnuplot option in the next patch. Signed-off-by: Bill Spitzak Reviewed-by: Oded

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

2016-02-04 Thread spitzak
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 function v10: Restored

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

2016-02-08 Thread spitzak
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 b/pixman/pixman-filter.c index e82871f..e5ef8e6 100644 --- a

[Pixman] [PATCH v12 05/14] pixman-filter: Consistency in arg names to integral ()

2016-02-08 Thread spitzak
From: Bill Spitzak Rename kernel1/2 to reconstruct/sample to match the other functions. Rename "scale" to "size" to avoid confusion with the scale being applied to the image, which is the reciprocol of this value. v10: Renamed "scale" to "size" Signed

[Pixman] [PATCH v12 08/14] pixman-filter: Corrections to the integral() function

2016-02-08 Thread spitzak
From: Bill Spitzak The IMPULSE special-cases did not sample the center of the of the region. This caused it to sample the filters outside their range, and produce assymetric filters and other errors. Fixing this required changing the arguments to integral() so the correct point could be

[Pixman] [PATCH v12 13/14] pixman-image: Implement PIXMAN_FILTER_GOOD/BEST as separable convolutions

2016-02-08 Thread spitzak
From: Bill Spitzak Detects and uses PIXMAN_FILTER_NEAREST for all 8 90-degree rotations and reflections when the scale is 1.0 and integer translation. GOOD uses: scale < 1/16 : BOX.BOX at size 16 scale < 3/4 : BOX.BOX at size 1/scale larger : BOX.BOX at size 1 If both directions

[Pixman] [PATCH v12 03/14] demos/scale: Only generate filters when used for separable

2016-02-08 Thread spitzak
From: Bill Spitzak This makes the speed of the demo more accurate, as the filter generation is a visible fraction of the time it takes to do a transform. This also prevents the output of unused filters in the gnuplot option in the next patch. Signed-off-by: Bill Spitzak Reviewed-by: Oded

[Pixman] [PATCH v12 11/14] pixman-filter: Negative subsample values produces scaled result

2016-02-08 Thread spitzak
From: Bill Spitzak The intention here is to produce approximately the same number of samples for each filter size (ie width*samples is the same). This means the caller can pass a constant rather than a different value for each size. To avoid conflict with existing code, negative numbers are used

[Pixman] [PATCH v12 12/14] pixman-filter: Add description to pixman_filter_create_separable_convolution()

2016-02-08 Thread spitzak
From: Bill Spitzak v9: Described arguments and more filter combinations, fixed some errors. v11: Further correction, in particular replaced "scale" with "size" Signed-off-by: Bill Spitzak Acked-by: Oded Gabbay --- pixman/

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

2016-02-08 Thread spitzak
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 function v10: Restored

  1   2   3   4   5   >