Commit Graph

2 Commits

Author SHA1 Message Date
tx_haggis be0f2c69c7
Add table2d tests (#748)
* Improve native debug experience

* Add unit tests for table2d
2021-12-23 15:07:38 +11:00
tx_haggis 9ad500189b
Performance: 15%+ loop/sec speedup by optimising 3d table bilinear interpolation (#735)
* Bi-linear interpolation - round towards nearest integer

Add the equivalent of 0.5 to the final calculation pre-rounding.
This will have the effect of rounding to the nearest integer, rather
than truncating. I.e. rounding down

* Unit tests: isolate table tests and check interpolation x/y bins

* Unit tests: add native table3d tests

* Unit tests: derive min/max from axis test values

* Unit tests: more detailed messages

* Unit tests: fix rounding & unit tests

* Performance

* Performance: use uint16_t instead of unsigned long
for the fixed point math: we only need the fractional
part. I.e. 1.16 not 16.16

* Use narrowest possible type

* Optimise bin position logic for performance

* Only promote to uint32_t when really required.

* Simplify bin checks - no zero width bins

* Save memory: use a single byte for the last bin caches

* Performance: increment pointers instead of
repeatedly dereferncing array by index.

* Comments

* Incorrect array underrun logic

* Rename type, comments

* Fix unit tests
2021-12-09 20:40:31 +11:00