| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
# Conflicts: # libImaging/Filter.c
# Conflicts: # libImaging/Filter.c
| "instance or class") | ||
|
|
||
| if self.im.bands == 1: | ||
| multiband = getattr(filter, 'is_multiband', False) |
There was a problem hiding this comment.
All filters used to work only with single-channel images. As this is public API and there are can be custom filters in a wild, we can't just send multi-channel images to all filters. So is_multiband flag indicates that the filter is ready for multi-channel images.
Sorry, something went wrong.
There was a problem hiding this comment.
@wiredfool As of naming things is one of the hard problems in programming, I need your help there )
Sorry, something went wrong.
There was a problem hiding this comment.
I think that's a reasonable name, at least, I haven't thought of anything better.
Sorry, something went wrong.
There was a problem hiding this comment.
The another option is subclass MultibandFilter.
Sorry, something went wrong.
There was a problem hiding this comment.
That's probably cleaner, especially with an eye towards the typing PR.
Sorry, something went wrong.
| } | ||
|
|
||
| for (i = 0; i < kernelsize; ++i) { | ||
| kerneldata[i] /= divisor; |
There was a problem hiding this comment.
Precompute by dividing coefficients to divisor rather than each result pixel.
Sorry, something went wrong.
|
Oh my god! I clash with the same bug in Intel x64 CPUs with int to float conversion, as I did when was working on resampling for Pillow 2.7. In essence: GCC version < 4.9 (at least Ubuntu 14.04, Debian 7 Wheezy, Red Hat Linux 7) generates code which runs about 2.5 times slower than GCC >= 4.9. This can be fixed using ugly hack with assembler. We decided to include this hack in Pillow 2.7 (released Jan 1, 2015). After rewriting the resampling using fixed point arithmetics, this hack become obsolete and was removed in Pillow 3.3 (Jul 1, 2016). Unlike for resampling, I don't see a way to implement kernel filters on FPA. So, I suggest to include this hack again. |
Sorry, something went wrong.
|
I've just tried SSE4 for multiband images, with no specific optimizations some optimizations. Simple SSE4 Optimized SSE4 OpenCV Smooth 137.25 Mpx/s 192.01 Mpx/s 163.68 Mpx/s Sharpen 133.55 Mpx/s 171.32 Mpx/s 163.81 Mpx/s Smooth More 45.71 Mpx/s 69.34 Mpx/s 64.01 Mpx/s |
Sorry, something went wrong.
|
@wiredfool implemented through MultibandFilter |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.