Commit Graph

16 Commits

Author SHA1 Message Date
rom9
157d83d169 Partially reverting my last commit. When using large exponents, huge raw values could cause segfaults in ImProcFunctions:rgbProc (specifically in shadowToneCurve), and in Amaze demosaic.
Re-added the clipping check on raw values, but with a higher threshold. This way, raw clipping is less frequent in highlight areas (so those can be used as spots for exponents calculation), but the threshold is low enough to avoid the segfaults.
Not a very clean solution, need to find a better one...
2019-06-26 00:14:03 +02:00
rom9
22f6297a5b Removed clipping check for values above 65535 (reverts commit 9156572). It was just a defensive check to avoid hitting corner cases like this: 1e4f9ac , that is already fixed elsewhere.
The check is now causing problems with the dual-spot feature, because after clipping, the formula cannot be undone to get back the original raw values.
Since there are no known issues caused by raw values >65k, i'm removing the check until there will be a good reason to re-introduce it.
2019-06-24 21:48:06 +02:00
rom9
2fde6e562a The "dual-spot" exponents calculation feature now honors the master (green) exponent set by the user, and adjusts red and blue based on the ratios between the new, "guessed" exponents.
This way, if the user has chosen a different master exponent than the default, using the feature just alters the color characteristic of the conversion, while keeping the same contrast level.
2019-06-23 22:21:24 +02:00
rom9
03dc855fc7 Merged cleanup patch proposed by heckflosse, moves exponents negation to a single place. Now it's much easier to read. 2019-06-18 21:08:18 +02:00
rom9
7c0275ca1a Updated copyright notice in new source files 2019-06-18 13:52:58 +02:00
Flössie
b687ca2643 Merge branch 'rom9-filmnegative' into filmnegative-cleanup 2019-06-17 08:57:14 +02:00
Flössie
54cc02eea9 Filmenegative core cleanup 2019-06-17 08:03:46 +02:00
Flössie
80f2b6a002 Replace raw arrays with std::array<> 2019-06-14 08:58:04 +02:00
rom9
c819cb63a2 Speed boost in the median vectors fill via loop unrolling 2019-06-12 22:11:34 +02:00
rom9
8d0755eddc Raised default master exponent from 1.0 to 2.0, to get a reasonable contrast right from the start. 2019-06-11 22:50:36 +02:00
rom9
8fa30d496d Now that medians are known *before* processing, moved multiplication step inside the same loop as exponentiation for further optimization. Patch kindly provided by @heckflosse ;-) 2019-06-11 21:02:16 +02:00
rom9
e1c9197ed5 Moved median calculation block before exponentiation. This way findMinMaxPercentile() can be used again because it works on the original raw file values (which are in a much more reasonable range). Patch kindly provided by @heckflosse ;-) 2019-06-11 20:08:46 +02:00
rom9
b95bdb1aea Linked red and blue exponent adjuster to the green adjuster, in order to maintain the ratio between exponents if the user moves the green adjuster (master).
Switched back to vector sort for median calculations: the results of the histogram search function diverge more and more from the simple median calculation as the exponents increase.
At 2.0 the test picture is already impossible to WB as the multipliers are too far off (2.78226e+08 histo vs 9.7927e+11 sort), and the normal WB sliders can't compensate for those huge factors.
2019-06-10 22:05:54 +02:00
rom9
91565728e5 Clamped output values to a max of 65535.f after applying multipliers, to avoid trouble further down the processing pipeline. 2019-06-09 19:25:15 +02:00
rom9
d2366e633c Enabled bad pixels interpolation for ST_XTRANS after upstream fix c0a033e 2019-06-09 13:09:29 +02:00
rom9
9df8008949 Film negative processing: first usable version. Only supports bayer raw files, thumbnails don't work
Added performance improvements suggested by heckflosse. Lowered median sampling step from 7 to 5 since calculation is now much faster.

Added support for Fuji X-Trans raw files.

Applied SSE2 patch provided by @heckflosse, improves performance in main processing loop.

Moved film negative processing stuff in its own compilation unit.

Code cleanup: removed redundant omp directives.

Added check for dead pixels, going above threshold after inversion. ST_BAYER only for now.

Reverted leftover hack in cropwindow.cc
2019-06-08 01:40:29 +02:00