Improve caching of lensfun mismatches
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
#include "procparams.h"
|
#include "procparams.h"
|
||||||
#include "rtlensfun.h"
|
#include "rtlensfun.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
namespace rtengine
|
namespace rtengine
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -499,7 +500,7 @@ std::unique_ptr<LFModifier> LFDatabase::getModifier(const LFCamera &camera, cons
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Glib::ustring LFDatabase::lastKey;
|
std::set<std::string> LFDatabase::notFound;
|
||||||
|
|
||||||
std::unique_ptr<LFModifier> LFDatabase::findModifier(const procparams::LensProfParams &lensProf, const FramesMetaData *idata, int width, int height, const procparams::CoarseTransformParams &coarse, int rawRotationDeg)
|
std::unique_ptr<LFModifier> LFDatabase::findModifier(const procparams::LensProfParams &lensProf, const FramesMetaData *idata, int width, int height, const procparams::CoarseTransformParams &coarse, int rawRotationDeg)
|
||||||
{
|
{
|
||||||
@@ -521,9 +522,9 @@ std::unique_ptr<LFModifier> LFDatabase::findModifier(const procparams::LensProfP
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Glib::ustring temp = make + model + lens;
|
const std::string key = (make + model + lens).collate_key();
|
||||||
if (lastKey == temp) {
|
if (notFound.find(key) != notFound.end()) {
|
||||||
// This combination was not found in last search => do not search again
|
// This combination was not found => do not search again
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
const LFDatabase *db = getInstance();
|
const LFDatabase *db = getInstance();
|
||||||
@@ -555,7 +556,7 @@ std::unique_ptr<LFModifier> LFDatabase::findModifier(const procparams::LensProfP
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
lastKey = temp;
|
notFound.emplace(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <glibmm/ustring.h>
|
#include <glibmm/ustring.h>
|
||||||
@@ -135,7 +136,7 @@ private:
|
|||||||
mutable MyMutex lfDBMutex;
|
mutable MyMutex lfDBMutex;
|
||||||
static LFDatabase instance_;
|
static LFDatabase instance_;
|
||||||
lfDatabase *data_;
|
lfDatabase *data_;
|
||||||
static Glib::ustring lastKey;
|
static std::set<std::string> notFound;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rtengine
|
} // namespace rtengine
|
||||||
|
Reference in New Issue
Block a user