fattal: use a common cache for 1:1 detail crops when denoise is turned off

This commit is contained in:
Alberto Griggio
2017-11-17 21:28:17 +01:00
parent 7b9252be33
commit e384edba55
3 changed files with 41 additions and 21 deletions

View File

@@ -33,7 +33,7 @@ namespace rtengine
extern const Settings* settings;
ImProcCoordinator::ImProcCoordinator ()
: orig_prev (nullptr), oprevi (nullptr), oprevl (nullptr), nprevl (nullptr), previmg (nullptr), workimg (nullptr),
: orig_prev (nullptr), oprevi (nullptr), oprevl (nullptr), nprevl (nullptr), fattal_11_dcrop_cache(nullptr), previmg (nullptr), workimg (nullptr),
ncie (nullptr), imgsrc (nullptr), shmap (nullptr), lastAwbEqual (0.), lastAwbTempBias (0.0), ipf (&params, true), monitorIntent (RI_RELATIVE),
softProof (false), gamutCheck (false), scale (10), highDetailPreprocessComputed (false), highDetailRawComputed (false),
allocated (false), bwAutoR (-9000.f), bwAutoG (-9000.f), bwAutoB (-9000.f), CAMMean (NAN),
@@ -111,6 +111,10 @@ ImProcCoordinator::~ImProcCoordinator ()
mProcessing.lock();
mProcessing.unlock();
freeAll ();
if (fattal_11_dcrop_cache) {
delete fattal_11_dcrop_cache;
fattal_11_dcrop_cache = nullptr;
}
std::vector<Crop*> toDel = crops;
@@ -386,6 +390,10 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
readyphase++;
if ((todo & M_HDR) && params.fattal.enabled) {
if (fattal_11_dcrop_cache) {
delete fattal_11_dcrop_cache;
fattal_11_dcrop_cache = nullptr;
}
ipf.ToneMapFattal02(orig_prev);
if (oprevi != orig_prev) {
delete oprevi;