cubic root calculation in dt_XYZ_to_Lab()#20649
Open
jenshannoschwalm wants to merge 1 commit intodarktable-org:masterfrom
Open
cubic root calculation in dt_XYZ_to_Lab()#20649jenshannoschwalm wants to merge 1 commit intodarktable-org:masterfrom
jenshannoschwalm wants to merge 1 commit intodarktable-org:masterfrom
Conversation
In dt_XYZ_to_Lab() we have to calculate a cubic root. For performance this was changed in 2010 for CPU code to halleys approximation in e81648c The OpenCL code started using halleys but for precision this was changed to pow() in 26341e0 and later to cbrt() 4fb7b15 1. Since 2010 cpu floating point performance has increased drastically so it seems ok now to use cbrt() for precision. 2. We used to do most modules in Lab space then, this has changed over the years so we often do multiple to/from Lab conversions resulting in accumulated errors in CPU path. Using cbrt() and cubicf() while to/from Lab conversions results in minimising errors. Integration test logs confirm much less differences.
Collaborator
Author
|
Just mentioning, if we go this way there is not much SSE specific code remaining (old colorbalance) |
Member
|
Looks fine by me. One question the integration test log above is the result with only the PR, right? Asking because there is some regressions, so maybe I should merge this before I push the changes in the integration test expected output that I have prepared today. |
Collaborator
Author
|
Yes, the log was only with this PR. So good to merge soon :-) Also there is #20639 doing no maths, just CL interface corrections. |
Collaborator
Author
Yes, there is quite a lot of CL differences that would need some love :-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In dt_XYZ_to_Lab() we have to calculate a cubic root.
For performance this was changed in 2010 for CPU code to halleys approximation in e81648c
The OpenCL code started using halleys but for precision this was changed to pow() in 26341e0 and later to cbrt() in 4fb7b15
Integration test logs confirm much less differences.
lab_cbrt.log