Author: post
Date: 2009-06-27 17:24:39 +0200 (Sat, 27 Jun 2009)
New Revision: 2515
Modified:
trunk/plugins/denoise/fftdenoiser.cpp
trunk/plugins/denoise/fftdenoiseryuv.cpp
Log:
Denoise: Automatically skip denoising, if image is smaller than blocksize
(Segfaulted previously)
Modified: trunk/plugins/denoise/fftdenoiser.cpp
===================================================================
--- trunk/plugins/denoise/fftdenoiser.cpp 2009-06-27 14:44:19 UTC (rev
2514)
+++ trunk/plugins/denoise/fftdenoiser.cpp 2009-06-27 15:24:39 UTC (rev
2515)
@@ -46,6 +46,9 @@
img.ox = FFT_BLOCK_OVERLAP;
img.oy = FFT_BLOCK_OVERLAP;
+ if ((image->w < FFT_BLOCK_SIZE) || (image->h < FFT_BLOCK_SIZE))
+ return; // Image too small to denoise
+
if (image->channels > 1 && image->filters==0) {
img.unpackInterleaved(image);
} else {
Modified: trunk/plugins/denoise/fftdenoiseryuv.cpp
===================================================================
--- trunk/plugins/denoise/fftdenoiseryuv.cpp 2009-06-27 14:44:19 UTC (rev
2514)
+++ trunk/plugins/denoise/fftdenoiseryuv.cpp 2009-06-27 15:24:39 UTC (rev
2515)
@@ -34,8 +34,12 @@
img.ox = FFT_BLOCK_OVERLAP;
img.oy = FFT_BLOCK_OVERLAP;
- g_assert(image->channels == 3);
+ if ((image->w < FFT_BLOCK_SIZE) || (image->h < FFT_BLOCK_SIZE))
+ return; // Image too small to denoise
+ if (image->channels != 3 && image->filters==0)
+ return; // No conversion possible with this image
+
waitForJobs(img.getUnpackInterleavedYUVJobs(image));
if (abort) return;
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit