merge with dev

This commit is contained in:
Alberto Griggio 2018-01-17 22:09:47 +01:00
commit bc854fc1e7
7 changed files with 10 additions and 61 deletions

View File

@ -41,6 +41,7 @@
#ifdef _OPENMP
#include <omp.h>
#endif
#include "StopWatch.h"
#define TS 64 // Tile size
#define offset 25 // shift between tiles
@ -475,6 +476,7 @@ enum nrquality {QUALITY_STANDARD, QUALITY_HIGH};
SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagefloat * dst, Imagefloat * calclum, float * ch_M, float *max_r, float *max_b, bool isRAW, const procparams::DirPyrDenoiseParams & dnparams, const double expcomp, const NoiseCurve & noiseLCurve, const NoiseCurve & noiseCCurve, float &nresi, float &highresi)
{
BENCHFUN
//#ifdef _DEBUG
MyTime t1e, t2e;
t1e.set();
@ -1781,7 +1783,6 @@ SSEFUNCTION void ImProcFunctions::RGB_denoise(int kall, Imagefloat * src, Imagef
fftwf_destroy_plan(plan_backward_blox[0]);
fftwf_destroy_plan(plan_forward_blox[1]);
fftwf_destroy_plan(plan_backward_blox[1]);
fftwf_cleanup();
}
} while (memoryAllocationFailed && numTries < 2 && (options.rgbDenoiseThreadLimit == 0) && !ponder);

View File

@ -199,11 +199,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
imgsrc->preprocess ( rp, params.lensProf, params.coarse );
imgsrc->getRAWHistogram ( histRedRaw, histGreenRaw, histBlueRaw );
if (highDetailNeeded) {
highDetailPreprocessComputed = true;
} else {
highDetailPreprocessComputed = false;
}
highDetailPreprocessComputed = highDetailNeeded;
}
/*
@ -269,21 +265,6 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
}
}
// Updating toneCurve.hrenabled if necessary
// It has to be done there, because the next 'if' statement will use the value computed here
if (todo & M_AUTOEXP) {
if (params.toneCurve.autoexp) {// this enabled HLRecovery
if (ToneCurveParams::HLReconstructionNecessary (histRedRaw, histGreenRaw, histBlueRaw) && !params.toneCurve.hrenabled) {
// switching params.toneCurve.hrenabled to true -> shouting in listener's ears!
params.toneCurve.hrenabled = true;
// forcing INIT to be done, to reconstruct HL again
todo |= M_INIT;
}
}
}
if (todo & (M_INIT | M_LINDENOISE | M_HDR)) {
MyMutex::MyLock initLock (minit); // Also used in crop window

View File

@ -16,6 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#include <fftw3.h>
#include "../rtgui/profilestorecombobox.h"
#include "rtengine.h"
#include "iccstore.h"
@ -108,10 +109,15 @@ int init (const Settings* s, Glib::ustring baseDir, Glib::ustring userSettingsDi
void cleanup ()
{
ProcParams::cleanup ();
Color::cleanup ();
RawImageSource::cleanup ();
#ifdef RT_FFTW3F_OMP
fftwf_cleanup_threads();
#else
fftwf_cleanup();
#endif
}
StagedImageProcessor* StagedImageProcessor::create (InitialImage* initialImage)

View File

@ -359,22 +359,6 @@ bool ToneCurveParams::operator !=(const ToneCurveParams& other) const
return !(*this == other);
}
bool ToneCurveParams::HLReconstructionNecessary(const LUTu& histRedRaw, const LUTu& histGreenRaw, const LUTu& histBlueRaw)
{
if (options.rtSettings.verbose) {
printf("histRedRaw[ 0]=%07d, histGreenRaw[ 0]=%07d, histBlueRaw[ 0]=%07d\nhistRedRaw[255]=%07d, histGreenRaw[255]=%07d, histBlueRaw[255]=%07d\n",
histRedRaw[0], histGreenRaw[0], histBlueRaw[0], histRedRaw[255], histGreenRaw[255], histBlueRaw[255]);
}
return
histRedRaw[255] > 50
|| histGreenRaw[255] > 50
|| histBlueRaw[255] > 50
|| histRedRaw[0] > 50
|| histGreenRaw[0] > 50
|| histBlueRaw[0] > 50;
}
RetinexParams::RetinexParams() :
enabled(false),
cdcurve{

View File

@ -287,7 +287,6 @@ struct ToneCurveParams {
bool operator ==(const ToneCurveParams& other) const;
bool operator !=(const ToneCurveParams& other) const;
static bool HLReconstructionNecessary(const LUTu& histRedRaw, const LUTu& histGreenRaw, const LUTu& histBlueRaw);
};
/**

View File

@ -200,16 +200,6 @@ private:
imgsrc->setCurrentFrame (params.raw.bayersensor.imageNum);
imgsrc->preprocess ( params.raw, params.lensProf, params.coarse, params.dirpyrDenoise.enabled);
if (params.toneCurve.autoexp) {// this enabled HLRecovery
LUTu histRedRaw (256), histGreenRaw (256), histBlueRaw (256);
imgsrc->getRAWHistogram (histRedRaw, histGreenRaw, histBlueRaw);
if (ToneCurveParams::HLReconstructionNecessary (histRedRaw, histGreenRaw, histBlueRaw) && !params.toneCurve.hrenabled) {
params.toneCurve.hrenabled = true;
// WARNING: Highlight Reconstruction is being forced 'on', should we force a method here too?
}
}
if (pl) {
pl->setProgress (0.20);
}

View File

@ -907,18 +907,6 @@ void solve_pde_fft (Array2Df *F, Array2Df *U, Array2Df *buf, bool multithread)/*
for (int i = 0; i < width * height; i++) {
(*U) (i) -= max;
}
// fft parallel threads cleanup, better handled outside this function?
#ifdef RT_FFTW3F_OMP
if (multithread) {
fftwf_cleanup_threads();
}
#endif
// ph.setValue(90);
//DEBUG_STR << "solve_pde_fft: done" << std::endl;
}