-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Ensure all IOP_CS_RAW modules work without snapping for sensor pattern #20211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jenshannoschwalm
wants to merge
3
commits into
darktable-org:master
Choose a base branch
from
jenshannoschwalm:avoid_cfa_snapping_46
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Ensure all IOP_CS_RAW modules work without snapping for sensor pattern #20211
jenshannoschwalm
wants to merge
3
commits into
darktable-org:master
from
jenshannoschwalm:avoid_cfa_snapping_46
+387
−409
Conversation
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
Collaborator
Author
|
@TurboGit a pretty large single commit. No visible differences but for sure we will have subtle differences when exporting if lens, flip or alike is included so the integration tests will remind you. This would be reference now :-) |
8d06ed1 to
d6a8f57
Compare
969f86d to
84c74d0
Compare
Collaborator
Author
|
The second commit significantly improves OpenCL VNG performance as it avoids kernel calls. |
0c49f38 to
1f8b9c9
Compare
Collaborator
Author
|
Release notes:
|
3e75637 to
e735edc
Compare
This commit - adds xtrans/filters data to the piece struct - provides dt_dev_prepare_piece_cfa() setting correct filters and xtrans pattern to piece data according to specified roi if the piece module works in IOP_CS_RAW - makes sure pixelpipe and tiling code provide corrected CFA patterns in the piece struct before calling process(), process_cl() or any tiling variant - allows all IOP_CS_RAW modules to choose CFA filter/xtrans data either from piece or pipe without need to calculate those internally thus reducing code complexity. Why doing so? Snapping to a sensor pattern restricts precision of roi dimensions and displacements if distorting modules (like lens, rotate&perspective...) or even simple crop or orientation also set roi. In darkroom mode this is of minor significance, for exports there is a clear benefit. Performance gains are neglectable. Modules working in IOP_CS_RAW regularly need to know the photosite color channel for a given location, for this they require correct CFA pattern information via `filters` or the `xtrans` pattern. We have inline functions or macros as FC() or FCxtrans(), they: - can use xtrans/filters data in pipe->dsc provided by rawprepare (pipe data). While doing so, they must use the roi_in->x/y displacements with a subtle performance cost - can use corrected filters/xtrans data (piece data) and possibly use more performant inline functions Fixed and checked for OpenCL/CPU and both sensors: 1. All demosaicers, cacorrect, hotpixels, rawdenoise and highlights reconstruction modes use piece data 2. invert is safe as it uses pipe data correctly 3. rasterfile is safe as is doesn't use CFA data 4. temperature now uses piece data 5. raw overexposed uses original pattern data as provided by image
For OpenCL VNG performance the border interpolation and the bayer green equilibrate have both been integrated into the main kernels thus reducing the called kernels by 3 for bayer and 2 for xtrans sensors. Due to these changes we can also avoid an image copy for more performance and can reduce cl_mem usage for only-linear mode used for dual demosaicing.
It now fills the border area with interpolated data from input besides clearing the central part so we can get rid of the costly initial vng part.
e735edc to
5aa1195
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature: enhancement
current features to improve
OpenCL
Related to darktable OpenCL code
scope: codebase
making darktable source code easier to manage
scope: image processing
correcting pixels
scope: performance
doing everything the same but faster
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.
UPDATED (2)
These commits
according to specified roi if the piece module works in IOP_CS_RAW
calling process(), process_cl() or any tiling variant
without need to calculate those internally thus reducing code complexity.
Why doing so?
Snapping to a sensor pattern restricts precision of roi dimensions and displacements if distorting
modules (like lens, rotate&perspective...) or even simple crop or orientation also set roi.
In darkroom mode this is of very little significance, for exports there is a clear benefit.
Performance gains are neglectable.
Modules working in IOP_CS_RAW regularly need to know the photosite color channel for a given location,
for this they require correct CFA pattern information via
filtersor thextranspattern.We have inline functions or macros as FC() or FCxtrans(), they:
While doing so, they must use the roi_in->x/y displacements with a subtle performance cost
Fixed and checked for OpenCL/CPU and both sensors:
Reminder:
Generic tiling still uses CFA snappers for overlapping, not required any more.
The second commit is about OpenCL VNG performance