diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-04-25 12:16:40 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-04-25 12:16:40 +0200 |
commit | e0cf0261d0f81eb1c54c4d4a7636c27de4b00d36 (patch) | |
tree | f309d94bbe629b169aee2f2459078aec6dae75a9 /sys/src/cmd/rio | |
parent | b0e2ea4e5ffaec335c2a61ee98d2c5d3f1052569 (diff) |
resample: improve performance (thanks José Miguel Sánchez García)
Resample is well known for taking a long time to resize an image. This
patch brings an important performance boost (in my test image, time
was reduced from ~2850ms to ~500ms). It does that by extracting FP
multiplication and division out of the innermost loop of
resamplex/resampley.
The results differ slightly from the current implementation: in my
test: ~0.3% of the bytes had a ±2 difference in their value, which I
attribute to rounding errors. I'm personally not concerned with that
deviation, given the performance gains. However, I recommend testing
it just to be sure I didn't overlook anything.
José Miguel Sánchez García
Diffstat (limited to 'sys/src/cmd/rio')
0 files changed, 0 insertions, 0 deletions