Skip to content

Commit

Permalink
Merge pull request #976 from alicevision/dev/ldrToHdrSampling
Browse files Browse the repository at this point in the history
[hdr] minor code cleanup in sampling
  • Loading branch information
fabiencastan authored Feb 12, 2021
2 parents 02e5c56 + 87fd8be commit 891b2db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/aliceVision/hdr/sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ bool Sampling::extractSamplesFromImages(std::vector<ImageSample>& out_samples, c

std::vector<std::pair<int, int>> vec_blocks;
const auto step = params.blockSize - diameter;
vec_blocks.reserve(int(imageHeight / step) * int(imageWidth / step));
for(int cy = 0; cy < imageHeight; cy += step)
{
for(int cx = 0; cx < imageWidth; cx += step)
Expand Down Expand Up @@ -375,7 +376,7 @@ bool Sampling::extractSamplesFromImages(std::vector<ImageSample>& out_samples, c

for (int x = params.radius; x < samples.Width() - params.radius; ++x)
{
ImageSample & sample = samples(y, x);
const ImageSample & sample = samples(y, x);
UniqueDescriptor desc;

for (int k = 0; k < sample.descriptions.size(); ++k)
Expand All @@ -398,7 +399,7 @@ bool Sampling::extractSamplesFromImages(std::vector<ImageSample>& out_samples, c
}
}

for (int i = 0; i < omp_get_max_threads(); ++i)
for(int i = 0; i < counters_vec.size(); ++i)
{
for (auto & item : counters_vec[i])
{
Expand Down Expand Up @@ -426,7 +427,7 @@ bool Sampling::extractSamplesFromImages(std::vector<ImageSample>& out_samples, c

for (std::size_t i = 0; i < item.second.size(); ++i)
{
Coordinates coords = item.second[i];
const Coordinates& coords = item.second[i];

if (!samples(coords.second, coords.first).descriptions.empty())
{
Expand Down

0 comments on commit 891b2db

Please sign in to comment.