fattal: use a common cache for 1:1 detail crops when denoise is turned off
This commit is contained in:
@@ -696,11 +696,16 @@ void Crop::update (int todo)
|
|||||||
int fw = skips(parent->fw, skip);
|
int fw = skips(parent->fw, skip);
|
||||||
int fh = skips(parent->fh, skip);
|
int fh = skips(parent->fh, skip);
|
||||||
bool need_cropping = false;
|
bool need_cropping = false;
|
||||||
|
bool need_fattal = true;
|
||||||
|
|
||||||
if (trafx || trafy || trafw != fw || trafh != fh) {
|
if (trafx || trafy || trafw != fw || trafh != fh) {
|
||||||
need_cropping = true;
|
need_cropping = true;
|
||||||
// fattal needs to work on the full image. So here we get the full
|
// fattal needs to work on the full image. So here we get the full
|
||||||
// image from imgsrc, and replace the denoised crop in case
|
// image from imgsrc, and replace the denoised crop in case
|
||||||
|
if (!params.dirpyrDenoise.enabled && skip == 1 && parent->fattal_11_dcrop_cache) {
|
||||||
|
f = parent->fattal_11_dcrop_cache;
|
||||||
|
need_fattal = false;
|
||||||
|
} else {
|
||||||
f = new Imagefloat(fw, fh);
|
f = new Imagefloat(fw, fh);
|
||||||
fattalCrop.reset(f);
|
fattalCrop.reset(f);
|
||||||
PreviewProps pp (0, 0, parent->fw, parent->fh, skip);
|
PreviewProps pp (0, 0, parent->fw, parent->fh, skip);
|
||||||
@@ -724,9 +729,15 @@ void Crop::update (int todo)
|
|||||||
f->b(dy, dx) = baseCrop->b(y, x);
|
f->b(dy, dx) = baseCrop->b(y, x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (skip == 1) {
|
||||||
|
parent->fattal_11_dcrop_cache = f; // cache this globally
|
||||||
|
fattalCrop.release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (need_fattal) {
|
||||||
parent->ipf.ToneMapFattal02(f);
|
parent->ipf.ToneMapFattal02(f);
|
||||||
|
}
|
||||||
|
|
||||||
// crop back to the size expected by the rest of the pipeline
|
// crop back to the size expected by the rest of the pipeline
|
||||||
if (need_cropping) {
|
if (need_cropping) {
|
||||||
|
@@ -33,7 +33,7 @@ namespace rtengine
|
|||||||
extern const Settings* settings;
|
extern const Settings* settings;
|
||||||
|
|
||||||
ImProcCoordinator::ImProcCoordinator ()
|
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 (¶ms, true), monitorIntent (RI_RELATIVE),
|
ncie (nullptr), imgsrc (nullptr), shmap (nullptr), lastAwbEqual (0.), lastAwbTempBias (0.0), ipf (¶ms, true), monitorIntent (RI_RELATIVE),
|
||||||
softProof (false), gamutCheck (false), scale (10), highDetailPreprocessComputed (false), highDetailRawComputed (false),
|
softProof (false), gamutCheck (false), scale (10), highDetailPreprocessComputed (false), highDetailRawComputed (false),
|
||||||
allocated (false), bwAutoR (-9000.f), bwAutoG (-9000.f), bwAutoB (-9000.f), CAMMean (NAN),
|
allocated (false), bwAutoR (-9000.f), bwAutoG (-9000.f), bwAutoB (-9000.f), CAMMean (NAN),
|
||||||
@@ -111,6 +111,10 @@ ImProcCoordinator::~ImProcCoordinator ()
|
|||||||
mProcessing.lock();
|
mProcessing.lock();
|
||||||
mProcessing.unlock();
|
mProcessing.unlock();
|
||||||
freeAll ();
|
freeAll ();
|
||||||
|
if (fattal_11_dcrop_cache) {
|
||||||
|
delete fattal_11_dcrop_cache;
|
||||||
|
fattal_11_dcrop_cache = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<Crop*> toDel = crops;
|
std::vector<Crop*> toDel = crops;
|
||||||
|
|
||||||
@@ -386,6 +390,10 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
|
|||||||
readyphase++;
|
readyphase++;
|
||||||
|
|
||||||
if ((todo & M_HDR) && params.fattal.enabled) {
|
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);
|
ipf.ToneMapFattal02(orig_prev);
|
||||||
if (oprevi != orig_prev) {
|
if (oprevi != orig_prev) {
|
||||||
delete oprevi;
|
delete oprevi;
|
||||||
|
@@ -57,6 +57,7 @@ protected:
|
|||||||
Imagefloat *oprevi;
|
Imagefloat *oprevi;
|
||||||
LabImage *oprevl;
|
LabImage *oprevl;
|
||||||
LabImage *nprevl;
|
LabImage *nprevl;
|
||||||
|
Imagefloat *fattal_11_dcrop_cache; // global cache for ToneMapFattal02 used in 1:1 detail windows (except when denoise is active)
|
||||||
Image8 *previmg; // displayed image in monitor color space, showing the output profile as well (soft-proofing enabled, which then correspond to workimg) or not
|
Image8 *previmg; // displayed image in monitor color space, showing the output profile as well (soft-proofing enabled, which then correspond to workimg) or not
|
||||||
Image8 *workimg; // internal image in output color space for analysis
|
Image8 *workimg; // internal image in output color space for analysis
|
||||||
CieImage *ncie;
|
CieImage *ncie;
|
||||||
|
Reference in New Issue
Block a user