Commit Graph

9 Commits

Author SHA1 Message Date
Charlie Vieth
80b3fc2b3f Pre-calculate start offset, optimize bound check
Increased performance by 30% for RGBA and 45% for Gray images, minor
performance increase for 16-bit images.

The start offset calculated by createWeights are stored in a slice and
passed to the resize functions to prevent duplication of effort.
2014-07-29 16:53:35 -04:00
jst
016a61cd31 Optimize data-locality for a huge increase in processing speed.
This is a complete rewrite! The tight scaling loop needs data locality for optimal performance. The old version used lots of pointer redirections to access image data which was bad for data locality. By providing the complete loop for each image type, this problem is solved. Unfortunately this increases code duplication but the result should be worth it: I could measure a ~6x speed-up for certain test cases!
2014-07-19 13:19:31 +02:00
jst
314cea6612 Avoid temporaries to save some cycles. 2014-01-17 22:54:15 +01:00
jst
a32116ce4a Add documentation 2012-12-11 20:35:02 +01:00
jst
2d6edc049a Change ordering 2012-12-11 19:57:34 +01:00
jst
cfcbeb4bb2 Use replicated border in genericConverter 2012-12-10 21:26:34 +01:00
jst
dc1fcd1d24 gofmt 2012-12-10 19:52:41 +01:00
jst
378e366327 Replicate border instead of using a constant
Constant border could lead to wrong values alpha values with certain
configurations.
2012-12-10 19:27:21 +01:00
jst
3e06045c3f Speed up computation: Try to avoid Image.At() as much as possible -> specialized color access for some image types 2012-09-21 20:02:25 +02:00