Lokathor/imagine

[png] "Up" filter should use SIMD calculation

Closed this issue · 0 comments

It's a small optimization in the scheme of things, but once portable simd is stabilized we should convert the "Up" filtering and unfiltering to use u8xN values.

In this case, we'd want to cancel the normal iteration we'd do using the "PB iterator" (which is byte at a time), just do all the math as wide as possible, and then re-iterate the line for output as if it was a None filtered line the whole time. This will give the correct output while also being significantly faster to compute. The math itself will happen 16x (or more) faster, though having to iterate the row twice will reduce the overall gains.

(Unfortunately, all the other PNG filters are not very SIMD friendly)