MLT/PSSMLT: better logic for selecting the 'luminanceSamples' parameter

metadata
Wenzel Jakob 2014-04-02 14:40:15 +02:00
parent cf98273c7c
commit 5dc9f571e7
2 changed files with 17 additions and 3 deletions

View File

@ -275,6 +275,13 @@ public:
m_config.workUnits = (int) std::max(workUnits, (size_t) 1); m_config.workUnits = (int) std::max(workUnits, (size_t) 1);
} }
size_t luminanceSamples = m_config.luminanceSamples;
if (luminanceSamples < (size_t) m_config.workUnits * 10) {
luminanceSamples = (size_t) m_config.workUnits * 10;
Log(EWarn, "Warning: increasing number of luminance samples to " SIZE_T_FMT,
luminanceSamples);
}
m_config.nMutations = (cropSize.x * cropSize.y * m_config.nMutations = (cropSize.x * cropSize.y *
sampleCount) / m_config.workUnits; sampleCount) / m_config.workUnits;
@ -295,7 +302,7 @@ public:
ref<MLTProcess> process = new MLTProcess(job, queue, ref<MLTProcess> process = new MLTProcess(job, queue,
m_config, directImage, pathSeeds); m_config, directImage, pathSeeds);
m_config.luminance = pathSampler->generateSeeds(m_config.luminanceSamples, m_config.luminance = pathSampler->generateSeeds(luminanceSamples,
m_config.workUnits, true, m_config.importanceMap, pathSeeds); m_config.workUnits, true, m_config.importanceMap, pathSeeds);
if (!nested) if (!nested)

View File

@ -328,6 +328,13 @@ public:
m_config.workUnits = (int) std::max(workUnits, (size_t) 1); m_config.workUnits = (int) std::max(workUnits, (size_t) 1);
} }
size_t luminanceSamples = m_config.luminanceSamples;
if (luminanceSamples < (size_t) m_config.workUnits * 10) {
luminanceSamples = (size_t) m_config.workUnits * 10;
Log(EWarn, "Warning: increasing number of luminance samples to " SIZE_T_FMT,
luminanceSamples);
}
m_config.nMutations = (cropSize.x * cropSize.y * m_config.nMutations = (cropSize.x * cropSize.y *
sampleCount) / m_config.workUnits; sampleCount) / m_config.workUnits;
@ -348,7 +355,7 @@ public:
ref<PSSMLTProcess> process = new PSSMLTProcess(job, queue, ref<PSSMLTProcess> process = new PSSMLTProcess(job, queue,
m_config, directImage, pathSeeds); m_config, directImage, pathSeeds);
m_config.luminance = pathSampler->generateSeeds(m_config.luminanceSamples, m_config.luminance = pathSampler->generateSeeds(luminanceSamples,
m_config.workUnits, false, m_config.importanceMap, pathSeeds); m_config.workUnits, false, m_config.importanceMap, pathSeeds);
if (!nested) if (!nested)