X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fdcraw.C;h=5a6f54210e5e67e99aeee454240a2fcb76223bc7;hb=ccd23c15fae578be22d48b1a1e8b09cb43d593ae;hp=65d880560a3109484eacb0f7cea7e0bef57a1a59;hpb=17e433a6e5021cc080101fd88ac3236dacb9f2e8;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/dcraw.C b/cinelerra-5.1/cinelerra/dcraw.C index 65d88056..5a6f5421 100644 --- a/cinelerra-5.1/cinelerra/dcraw.C +++ b/cinelerra-5.1/cinelerra/dcraw.C @@ -92,6 +92,14 @@ typedef uint64_t UINT64; #include "dcraw.h" +//const static data +const double DCRaw_data::xyz_rgb[3][3] = { /* XYZ from RGB */ + { 0.412453, 0.357580, 0.180423 }, + { 0.212671, 0.715160, 0.072169 }, + { 0.019334, 0.119193, 0.950227 } }; +const float DCRaw_data::d65_white[3] = { + 0.950456, 1.000000, 1.088754 }; + /* All global variables are defined here, and all functions that access them are prefixed with "CLASS". Note that a thread-safe @@ -3264,7 +3272,7 @@ short * CLASS foveon_make_curve (double max, double mul, double filt) if (!filt) filt = 0.8; size = 4*M_PI*max / filt; - if (size == UINT_MAX) size--; + if (size > INT_MAX-1) size = INT_MAX-1; curve = (short *) calloc (size+1, sizeof *curve); merror (curve, "foveon_make_curve()"); curve[0] = size; @@ -3298,19 +3306,34 @@ void CLASS foveon_interpolate() { static const short hood[] = { -1,-1, -1,0, -1,1, 0,-1, 0,1, 1,-1, 1,0, 1,1 }; short *pix, prev[3], *curve[8], (*shrink)[3]; - float cfilt=0, ddft[3][3][2], ppm[3][3][3]; + float cfilt, ddft[3][3][2], ppm[3][3][3]; float cam_xyz[3][3], correct[3][3], last[3][3], trans[3][3]; float chroma_dq[3], color_dq[3], diag[3][3], div[3]; float (*black)[3], (*sgain)[3], (*sgrow)[3]; float fsum[3], val, frow, num; int row, col, c, i, j, diff, sgx, irow, sum, min, max, limit; int dscr[2][2], dstb[4], (*smrow[7])[3], total[4], ipix[3]; - int work[3][3], smlast, smred, smred_p=0, dev[3]; + int work[3][3], smlast, smred, smred_p, dev[3]; int satlev[3], keep[4], active[4]; unsigned dim[3], *badpix; - double dsum=0, trsum[3]; + double dsum, trsum[3]; char str[128]; const char* cp; +// clear local storage + pix = 0; ZERO(prev); ZERO(curve); ZERO(shrink); + cfilt = 0; ZERO(ddft); ZERO(ppm); + ZERO(cam_xyz); ZERO(correct); ZERO(last); ZERO(trans); + ZERO(chroma_dq); ZERO(color_dq); ZERO(diag); ZERO(div); + ZERO(black); ZERO(sgain); ZERO(sgrow); + ZERO(fsum); val = frow = num = 0; + row = col = c = i = j = diff = sgx = irow = sum = min = max = limit = 0; + ZERO(dscr); ZERO(dstb); ZERO(smrow); ZERO(total); ZERO(ipix); + ZERO(work); ZERO(smlast); ZERO(smred); smred_p=0; ZERO(dev); + ZERO(satlev); ZERO(keep); ZERO(active); + ZERO(dim); badpix = 0; + dsum = 0; ZERO(trsum); + ZERO(str); + cp = 0; if (verbose) fprintf (stderr,_("Foveon interpolation...\n")); @@ -6017,7 +6040,7 @@ guess_cfa_pc: case 61450: cblack[4] = cblack[5] = MIN(sqrt(len),64); case 50714: /* BlackLevel */ - if (!(cblack[4] * cblack[5])) + if ((cblack[4] * cblack[5])==0) cblack[4] = cblack[5] = 1; FORC (cblack[4] * cblack[5]) cblack[6+c] = getreal(type); @@ -9875,7 +9898,7 @@ int CLASS main (int argc, const char **argv) reset(); // Globals must be reset #ifndef LOCALTIME - putenv ((char *) "TZ=UTC"); +// putenv ((char *) "TZ=UTC"); #endif #ifdef LOCALEDIR setlocale (LC_CTYPE, "");