From 922870e6ddb48d7a9cdbd960ee89c453b5a0fc84 Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Thu, 20 Apr 2017 14:48:52 +0200 Subject: [PATCH 1/4] further tweaks to the procparams for the new fast export pipeline - tweaked denoise params to get a better approximation for high ISO shots - use Amaze or Lmmse demosaicing if the chosen method is pixelshift --- rtengine/simpleprocess.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc index 2124ffb4d..e7a71c81e 100644 --- a/rtengine/simpleprocess.cc +++ b/rtengine/simpleprocess.cc @@ -1416,10 +1416,26 @@ private: } params.wavelet.strength *= scale_factor; params.dirpyrDenoise.luma *= scale_factor; + params.dirpyrDenoise.Ldetail += (100 - params.dirpyrDenoise.Ldetail) * scale_factor; //params.dirpyrDenoise.smethod = "shal"; for (auto &p : params.dirpyrDenoise.lcurve) { p *= scale_factor; } + const char *medmethods[] = { "soft", "33", "55soft", "55", "77", "99" }; + if (params.dirpyrDenoise.median) { + auto &key = params.dirpyrDenoise.methodmed == "RGB" ? params.dirpyrDenoise.rgbmethod : params.dirpyrDenoise.medmethod; + for (int i = 1; i < int(sizeof(medmethods)/sizeof(const char *)); ++i) { + if (key == medmethods[i]) { + int j = i - int(1.0 / scale_factor); + if (j < 0) { + params.dirpyrDenoise.median = false; + } else { + key = medmethods[j]; + } + break; + } + } + } params.epd.scale *= scale_factor; //params.epd.edgeStopping *= scale_factor; @@ -1429,6 +1445,7 @@ private: adjust_radius(defaultparams.dirpyrequalizer.mult[i], dirpyreq_scale, params.dirpyrequalizer.mult[i]); } + params.dirpyrequalizer.threshold *= scale_factor; adjust_radius(defaultparams.defringe.radius, scale_factor, params.defringe.radius); @@ -1441,6 +1458,9 @@ private: procparams::RAWParams::XTransSensor::methodstring[ procparams::RAWParams::XTransSensor::onePass]; } + if (params.raw.bayersensor.method == procparams::RAWParams::BayerSensor::methodstring[procparams::RAWParams::BayerSensor::pixelshift]) { + params.raw.bayersensor.method = procparams::RAWParams::BayerSensor::methodstring[params.raw.bayersensor.pixelShiftLmmse ? procparams::RAWParams::BayerSensor::lmmse : procparams::RAWParams::BayerSensor::amaze]; + } } private: From 224359d4ff14d4a6efdfd38510d26e152d91ca67 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Thu, 20 Apr 2017 22:44:07 +0200 Subject: [PATCH 2/4] Fix colour cast when using raw ca correction on underexposed images, fixes #3836 --- rtengine/CA_correct_RT.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtengine/CA_correct_RT.cc b/rtengine/CA_correct_RT.cc index e1493ae40..aea20d8c9 100644 --- a/rtengine/CA_correct_RT.cc +++ b/rtengine/CA_correct_RT.cc @@ -967,7 +967,7 @@ void RawImageSource::CA_correct_RT(const bool autoCA, const double cared, const int c = FC(rr + top, left + border + (FC(rr + top, 2) & 1)); for (int row = rr + top, cc = border + (FC(rr, 2) & 1), indx = (row * width + cc + left) >> 1; cc < cc1 - border; cc += 2, indx++) { - RawDataTmp[indx] = 65535.0f * rgb[c][(rr) * ts + cc] + 0.5f; + RawDataTmp[indx] = 65535.0f * rgb[c][(rr) * ts + cc]; } } From 936e62fee994c408565c15a1753baade13f1a7aa Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 21 Apr 2017 11:41:47 +0200 Subject: [PATCH 3/4] Fix integer rounding relicts, no issue --- rtengine/cfa_linedn_RT.cc | 2 +- rtengine/demosaic_algos.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rtengine/cfa_linedn_RT.cc b/rtengine/cfa_linedn_RT.cc index b5578898b..0f9e27634 100644 --- a/rtengine/cfa_linedn_RT.cc +++ b/rtengine/cfa_linedn_RT.cc @@ -231,7 +231,7 @@ void RawImageSource::CLASS cfa_linedn(float noise) for (int col = 16 + left, indx = rr * TS + 16; indx < rr * TS + numcols - 16; indx++, col++) { if (rawData[row][col] < clip_pt && cfadn[indx] < clip_pt) { - RawDataTmp[row * width + col] = CLIP((int)(cfadn[indx] + 0.5f)); + RawDataTmp[row * width + col] = CLIP(cfadn[indx]); } } } diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index 847af784f..b81dfe576 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -1879,7 +1879,7 @@ SSEFUNCTION void RawImageSource::lmmse_interpolate_omp(int winw, int winh, array gamtab = &(Color::igammatab_24_17); } else { for(int i = 0; i < 65536; i++) { - (*gamtab)[i] = (float)i + 0.5f; + (*gamtab)[i] = i; } } From 040065e55f023e11e9e8952cc938fb99eaf9fb8a Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 21 Apr 2017 11:56:34 +0200 Subject: [PATCH 4/4] lmmse_interpolate_omp() : use makeIdentity() --- rtengine/demosaic_algos.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rtengine/demosaic_algos.cc b/rtengine/demosaic_algos.cc index b81dfe576..6a5b8eba8 100644 --- a/rtengine/demosaic_algos.cc +++ b/rtengine/demosaic_algos.cc @@ -1878,9 +1878,7 @@ SSEFUNCTION void RawImageSource::lmmse_interpolate_omp(int winw, int winh, array if(applyGamma) { gamtab = &(Color::igammatab_24_17); } else { - for(int i = 0; i < 65536; i++) { - (*gamtab)[i] = i; - } + gamtab->makeIdentity(); } array2D (*rgb[3]);