diff options
author | Aras Pranckevicius <aras@nesnausk.org> | 2022-06-15 20:51:12 +0300 |
---|---|---|
committer | Aras Pranckevicius <aras@nesnausk.org> | 2022-06-15 20:51:25 +0300 |
commit | 004d858138fced20d45cf3cc0149fcef1922c8a0 (patch) | |
tree | 456ba308c9119d6796c85b93467485174b64dcc8 /doc/license | |
parent | 7e89bbb2ff3e060807beaef200d9173befeba528 (diff) |
math: improve accuracy of Linear->sRGB conversion SIMD path
srgb_to_linearrgb_v3_v3 is using an approximation of powf that is
SIMD. However, while the accuracy of it is ok, a larger issue is that
it produces different results on Intel compared to ARM architectures.
On ARM (e.g. AppleSilicon), the result of the SIMD code path is much
closer to the reference implementation. This seems to be because of
_mm_rsqrt_ps usage in _bli_math_fastpow512. The ARM/NEON code path
emulates inverse square root with a combination of vrsqrteq_f32
followed by two Newton-Raphson iterations, because blender uses the
SSE2NEON_PRECISE_SQRT define.
This commit adds similar NR iterations to the "actual SSE" code path
as well.
Max error of srgb->linear->srgb conversion roundtrip goes from
0.000211 down to about 0.000062.
Reviewed By: Sergey Sharybin
Differential Revision: https://developer.blender.org/D15193
Diffstat (limited to 'doc/license')
0 files changed, 0 insertions, 0 deletions