e7ddc6f0c5
Merge branch 'master' into micropoly
2020-12-20 16:32:52 +09:00
6d6904a615
FLuv32: increase dynamic range, and decrease precision.
...
This still exceeds the precision of LogLuv, but lets us match its
dynamic range.
2020-09-22 11:06:40 +09:00
9cf5ebdf91
Cleaning up the code in fluv32 a bit.
2020-09-21 11:54:14 +09:00
066105b20a
Fluv32: slightly tweak the u/v scaling constants.
...
This allows perfect representation of E (equal energy spectrum).
It's not important from a perceptual standpoint, but it provides
a simple way for Psychopath to represent E when needed for other
purposes.
2020-09-21 09:45:47 +09:00
05f9621ac5
Added a FloatLuv decode function to decode to Yuv instead of XYZ.
...
This is useful because it's super fast, and chromaticity lookups
are typical for spectral upsampling anyway, so this will likely
enable cutting out a bunch of unecessary intermediate calculations.
2020-09-20 15:16:20 +09:00
0ba1acc42d
Add oct32 encode_precise()
function.
...
This is significantly slower than `encode()`, but a little more precise.
2020-09-20 14:36:50 +09:00
161e47fc44
Clean up oct32norm code a bit.
2020-09-20 10:37:26 +09:00
3eff608493
More FloatLuv32 optimizations, and general code cleanup.
...
This gives another little speed boost to decoding, but gives a
massive (over 3x) speed boost to encoding.
2020-09-20 10:07:02 +09:00
f4ef11f9f3
Fix some names in fluv32 error messages.
2020-09-20 03:02:56 +09:00
8dee53d1fc
Additional optimization to fluv32 decoding.
...
Tiny change but with a nice speed bump.
2020-09-20 02:35:37 +09:00
f20567247d
Go all in with the fluv32 naming.
2020-09-20 02:02:35 +09:00
cda9156af8
Optimize FloatLuv decoding.
...
Speed ups of over 20%.
2020-09-20 01:43:36 +09:00
03bedcb594
Cleanup, tweaks, and better documentation for the 32-bit Luv format.
2020-09-19 23:57:59 +09:00
485da9f918
Add a new 32-bit Luv color format.
...
It's based on the SGI LogLuv format, but using a floating point
instead of log encoding for the luminance.
2020-09-19 19:51:40 +09:00
66e9abe66e
Make signed48 trifloat encoding also a byte array.
...
Same reason as for the unsigned40 encoding in an earlier commit.
2020-09-19 12:22:51 +09:00
49c97bf0fe
Cleaned up the signed48 trifloat code.
2020-09-19 08:55:35 +09:00
fd98b33333
Make unsigned40 trifloat encoding a byte array.
...
The whole point of these formats is to compress down to less
space, so let's not leave actually putting it in the space-saving
form on the client code.
2020-09-19 08:28:59 +09:00
9fb3c95171
Added an unsigned 40-bit trifloat format.
...
It is identical to the 32-bit format, except with more precision
and range due to using more bits. This format should comfortably
store any color information with precision easily exceeding the
limits of human vision.
2020-09-18 22:12:12 +09:00
96b8dd84b9
Cleaned up the u32 trifloat implementation.
...
This also makes encoding faster. However, it no longer does
rounding to the nearest precision when encoding, and insead does
flooring. This seems like a reasonable tradeoff: if you want more
precision... you should use a format with more precision.
2020-09-18 21:04:16 +09:00
f13ffac7bd
Removed the experimental luma-chroma color format.
...
It was a worthwhile experiment, but for it to really work it needs
a really proper luma-chroma separation, which is both slower than
I really want, and requires knowing the colorspace being used.
I might make another go at this based on the TIFF LogLUV color
format, requiring XYZ as input.
2020-09-18 17:57:13 +09:00
c1f516c2b6
Use a better chroma formula for the RGB32 format.
...
This makes much better use of the bit space.
2020-09-13 11:22:48 +09:00
bd6cf359b4
Some code clean-up in the RGB32 encoding/decoding code.
2020-09-13 06:44:42 +09:00
d6ab9d06be
More work on the packed HDR RGB 32-bit format.
...
Switched to a different chroma encoding, which is notably faster
and never produces negative values when decoded.
2020-09-11 21:57:43 +09:00
339568ec0c
Remove stale comments.
2020-09-10 22:42:20 +09:00
7066c38189
Implement an experimental packed HDR RGB 32-bit storage format.
2020-09-10 22:36:20 +09:00
c1f8d21814
Refactored data tree code to present a slightly nicer API.
2020-05-01 16:08:37 +09:00
4f564d1474
All parsing is now streaming! But lots left to do.
...
In particular, parsing error messages are now either terrible or
non-existent. But it compiles and works for correct inputs!
2020-05-01 16:08:37 +09:00
9d5bc63fa5
Created a separate reader type for streaming data tree reading.
2020-05-01 16:08:37 +09:00
3eca7eae25
Take data reading out of the data tree parser.
...
It's now the responsibility of the caller to feed the parser
data as needed.
2020-05-01 16:08:37 +09:00
7f1b1d2382
Fixed silly bug in data tree parser.
2020-05-01 16:08:37 +09:00
1f4947e895
Data tree parser: only read more data when needed.
...
Before this, it would eagerly load more data on every call, which
defeats the whole point.
2020-05-01 16:08:37 +09:00
ccd7e141fb
First implementation of a streaming parser for the data tree format.
2020-05-01 16:08:37 +09:00
99b6ddfa54
Run clippy on Sobol sampler, and fix/silence warnings.
2020-05-01 16:07:19 +09:00
78acaa7b63
Make Sobol SIMD code work on all x86-64 platforms.
...
Before this it needed SSE 4.1, which is not strictly present on
all x86-64 platforms. This will still compile the faster path if
SSE 4.1 is available, but has an alternate path as well for all
x86-64 platforms.
2020-05-01 15:32:18 +09:00
fd75a72655
More code tidying of the Sobol sampler.
...
In particular, clearer and more concise documentation.
2020-05-01 10:42:02 +09:00
45241784fb
Code tidying on the Sobol sampler.
...
Also swapped the sample index and dimension paramater in the function
signature. This feels more intuitive.
2020-04-30 22:46:47 +09:00
1f75e7854e
Properly hash all four scramble values in the 4d Sobol sampler.
2020-04-25 18:12:35 +09:00
72adbedbb4
Accelerate the Sobol sampler with SIMD on x86_64.
2020-04-24 23:32:43 +09:00
0dfe916523
Preparing for SIMD accelerated Sobol sampling.
...
This implements the 4-wide API, and moves the renderer over to it.
But the actual implementation is still scalar.
2020-04-24 21:05:29 +09:00
78b5cf4c53
Faster lk hash for the sobol sampler.
...
This gets about the same quality as the previous hash, but in
much fewer operations.
2020-04-24 10:47:53 +09:00
3ffaf7bee5
Forgot to use a wrapping multiply instead of a straight multiply.
2020-04-23 13:52:04 +09:00
29fcc69ae1
Move seed hashing into the lk_scramble function.
2020-04-23 13:36:04 +09:00
b776bf56b8
Improved lk scrambling function.
...
This actually gets very close to the behavior of a full per-bit
hash, except that you still need a fairly random seed.
2020-04-23 08:31:03 +09:00
22b7151919
Use independent Sobol sequences for different sets of dimensions.
...
This reduces correlation artifacts, while preserving good convergence
for the most part.
2020-04-22 18:48:12 +09:00
aecff883ab
Misc optimizations on the Sobol sampler.
...
The biggest one is avoiding a bunch of bit reversals by keeping
numbers in bit-reversed form for as long as we can.
Also reduced the hashing rounds: just 2 rounds seems to be enough
for a reasonable amount of statistical independence on both the
scrambling and shuffling. I tested both independently, keeping
the other with no scrambling/shuffling respectively. This makes
sense because in normal contexts 3 is enough, but in this case
both act as input to yet another hash which is effectively doing
more rounds.
2020-04-22 16:21:50 +09:00
660576ec2b
Make Sobol seeding more robust.
...
This way incremental seeds can be passed (e.g. 0, 1, 2, etc.) and
still get statistically independent Sobol sequences.
2020-04-22 14:19:57 +09:00
085d1d655e
A single unified Sobol implementation.
...
This version of Sobol implements both Owen scrambling and index
permutation, allowing for multiple statistically independent
Sobol sequences.
2020-04-19 01:11:43 +09:00
f36b71184a
Use better seeding for slow version of Owen scramble as well.
2020-04-17 13:18:37 +09:00
c4e1bedd43
Improve Owen scrambling by seeding with add instead of xor.
...
Also removed some unnecessary complexity from the implementation,
and use different constants.
2020-04-17 10:42:35 +09:00
e46fc5a4d6
Cleaning up Sobol sampling code.
...
In particular, removing some things I tried when the golden ratio
sampling was causing problems, but that are now no longer needed.
2020-03-21 09:00:43 +09:00