raw2dng
I run into an error (Speicherzugriffsfehler), if there are more cold pixels found, than definied in max_cold_pixels.
The cold pixels in the first frame are detected and fixed, no problem. But the second frame gives this error. Code from raw2dng.c:
int framenumber;
for (framenumber = 0; framenumber < lv_rec_footer.frameCount; framenumber++)
{
printf("\rProcessing frame %d of %d...", framenumber+1, lv_rec_footer.frameCount);
fflush(stdout);
printf("\rdebug_frame : %d \n", (framenumber));
int r = fread(raw, 1, lv_rec_footer.frameSize, fi);
CHECK(r == lv_rec_footer.frameSize, "fread");
raw_info.buffer = raw;
/* uncomment if the raw file is recovered from a DNG with dd */
//~ reverse_bytes_order(raw, lv_rec_footer.frameSize);
char fn[100];
snprintf(fn, sizeof(fn), "%s%06d.dng", prefix, framenumber);
fix_vertical_stripes();
find_and_fix_cold_pixels(fix_cold_pixels, framenumber);
#ifdef CHROMA_SMOOTH
chroma_smooth();
#endif
dng_set_framerate(lv_rec_footer.sourceFpsx1000);
save_dng(fn, &raw_info);
}
Working on the second frame, "printf("\rProcessing frame %d of %d...", framenumber+1, lv_rec_footer.frameCount);" is correctly displayed.
Than comes this fflush, which don´t understand.
And my debug-print, which follows to the fflush, isn´t displayed anymore: "frintf("\rdebug_frame : %d \n", (framenumber));"
No clue, what´s going on here.
To avoid this error, I can set the max_cold_pixels to maybe 4000. Than all is fine and the 3500 cold pixels, I forced in an record, are correctly removed. But that is no solution. I want to know, why this error comes in, if there are to much cold pixels found.
Edgar