Update to DCRAW 9.12, adding new cameras

see issue 1179
This commit is contained in:
Oliver Duis
2011-12-30 11:57:11 +01:00
parent 94fb198a87
commit f33eee1f77
3 changed files with 224 additions and 81 deletions

View File

@@ -1,6 +1,6 @@
--- C:/GCC/RT/RTSrc/rtengine/dcraw.c Tue Nov 08 07:01:10 2011
+++ C:/GCC/RT/RTSrc/rtengine/dcraw.cc Sun Nov 13 17:58:08 2011
@@ -1,3 +1,14 @@
--- C:/GCC/RT/RTSrc/rtengine/dcraw.c Thu Dec 29 11:43:38 2011
+++ C:/GCC/RT/RTSrc/rtengine/dcraw.cc Thu Dec 29 12:21:22 2011
@@ -1,3 +1,14 @@
+/*RT*/#include <glib.h>
+/*RT*/#include <glib/gstdio.h>
+/*RT*/#undef MAX
@@ -14,7 +14,22 @@
+
/*
dcraw.c -- Dave Coffin's raw photo decoder
Copyright 1997-2011 by Dave Coffin, dcoffin a cybercom o net
Copyright 1997-2011 by Dave Coffin, dcoffin a cybercom o net
@@ -19,11 +30,11 @@
*If you have not modified dcraw.c in any way, a link to my
homepage qualifies as "full source code".
- $Revision: 1.447 $
- $Date: 2011/12/26 17:31:23 $
+ $Revision: 1.445 $
+ $Date: 2011/10/07 01:00:37 $
*/
-#define DCRAW_VERSION "9.12"
+#define DCRAW_VERSION "9.11"
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@@ -98,18 +109,16 @@
#define LONG_BIT (8 * sizeof (long))
#endif
@@ -139,6 +154,15 @@
void CLASS sinar_4shot_load_raw()
{
@@ -1731,7 +1741,7 @@
if ((r = row-top_margin - (shot >> 1 & 1)) >= height) continue;
for (col=0; col < raw_width; col++) {
if ((c = col-left_margin - (shot & 1)) >= width) continue;
- image[r*width+c][FC(row,col)] = pixel[col];
+ image[r*width+c][FC(row,col)] = pixel[col];
}
}
}
@@ -1843,10 +1853,10 @@
maximum = 0x3ff;
}
@@ -167,6 +191,15 @@
cinfo->src->next_input_byte = jpeg_buffer;
cinfo->src->bytes_in_buffer = nbytes;
return TRUE;
@@ -2215,7 +2225,7 @@
for (col=0; col < raw_width; col++) {
val = curve[pixel[col]];
if ((unsigned) (col-left_margin) < width)
- BAYER(row,col-left_margin) = val;
+ BAYER(row,col-left_margin) = val;
else lblack += val;
}
}
@@ -2411,9 +2421,9 @@
maximum = (1 << (thumb_misc & 31)) - 1;
}
@@ -188,7 +221,16 @@
struct decode *cur;
int i, len;
@@ -4396,7 +4406,7 @@
@@ -3651,7 +3661,7 @@
lpass = size*((lev & 1)+1);
for (row=0; row < iheight; row++) {
hat_transform (temp, fimg+hpass+row*iwidth, 1, iwidth, 1 << lev);
- for (col=0; col < iwidth; col++)
+ for (col=0; col < iwidth; col++)
fimg[lpass + row*iwidth + col] = temp[col] * 0.25;
}
for (col=0; col < iwidth; col++) {
@@ -4397,7 +4407,7 @@
}
}
@@ -197,7 +239,7 @@
void CLASS parse_makernote (int base, int uptag)
{
@@ -4527,12 +4537,12 @@
@@ -4528,12 +4538,12 @@
cam_mul[0] = getreal(type);
cam_mul[2] = getreal(type);
}
@@ -216,7 +258,7 @@
if (tag == 0x10 && type == 4)
unique_id = get4();
if (tag == 0x11 && is_raw && !strncmp(make,"NIKON",5)) {
@@ -4911,8 +4921,8 @@
@@ -4912,8 +4922,8 @@
}
}
@@ -227,7 +269,7 @@
int CLASS parse_tiff_ifd (int base)
{
@@ -4926,7 +4936,7 @@
@@ -4927,7 +4937,7 @@
unsigned sony_curve[] = { 0,0,0,0,0,4095 };
unsigned *buf, sony_offset=0, sony_length=0, sony_key=0;
struct jhead jh;
@@ -236,7 +278,7 @@
if (tiff_nifds >= sizeof tiff_ifd / sizeof tiff_ifd[0])
return 1;
@@ -4943,6 +4953,9 @@
@@ -4944,6 +4954,9 @@
case 6: height = get2(); break;
case 7: width += get2(); break;
case 9: filters = get2(); break;
@@ -246,7 +288,7 @@
case 17: case 18:
if (type == 3 && len == 1)
cam_mul[(tag-17)*2] = get2() / 256.0;
@@ -5346,12 +5359,13 @@
@@ -5347,12 +5360,13 @@
fread (buf, sony_length, 1, ifp);
sony_decrypt (buf, sony_length/4, 1, sony_key);
sfp = ifp;
@@ -265,7 +307,7 @@
ifp = sfp;
free (buf);
}
@@ -5376,6 +5390,8 @@
@@ -5377,6 +5391,8 @@
{
int doff;
@@ -274,7 +316,7 @@
fseek (ifp, base, SEEK_SET);
order = get2();
if (order != 0x4949 && order != 0x4d4d) return 0;
@@ -5550,7 +5566,7 @@
@@ -5551,7 +5567,7 @@
{
const char *file, *ext;
char *jname, *jfile, *jext;
@@ -283,7 +325,14 @@
ext = strrchr (ifname, '.');
file = strrchr (ifname, '/');
@@ -5578,7 +5594,8 @@
@@ -5573,13 +5589,14 @@
} else
while (isdigit(*--jext)) {
if (*jext != '9') {
- (*jext)++;
+ (*jext)++;
break;
}
*jext = '0';
}
if (strcmp (jname, ifname)) {
@@ -293,7 +342,7 @@
if (verbose)
fprintf (stderr,_("Reading metadata from %s ...\n"), jname);
parse_tiff (12);
@@ -5917,7 +5934,11 @@
@@ -5918,7 +5935,11 @@
order = get2();
hlen = get4();
if (get4() == 0x48454150) /* "HEAP" */
@@ -306,7 +355,7 @@
if (parse_tiff (save+6)) apply_tiff();
fseek (ifp, save+len, SEEK_SET);
}
@@ -6182,34 +6203,34 @@
@@ -6183,34 +6204,34 @@
{ 4716,603,-830,-7798,15474,2480,-1496,1937,6651 } },
{ "Canon EOS 5D", 0, 0xe6c,
{ 6347,-479,-972,-8297,15954,2480,-1968,2131,7649 } },
@@ -344,14 +393,14 @@
+ { 6246,-1272,-523,-5075,12357,3075,-1035,1825,7333 } },
{ "Canon EOS 500D", 0, 0x3479,
{ 4763,712,-646,-6821,14399,2640,-1921,3276,6561 } },
- { "Canon EOS 550D", 0, 0x3dd7,
- { 6941,-1164,-857,-3825,11597,2534,-416,1540,6039 } },
+ { "Canon EOS 550D", 0, 0x3dd7, /* RT - Lebedev*/
+ { 6519,-772,-703,-4994,12737,2519,-1387,2492,6175 } },
{ "Canon EOS 600D", 0, 0x3510,
{ 6461,-907,-882,-4300,12184,2378,-819,1944,5931 } },
{ "Canon EOS 1000D", 0, 0xe43,
@@ -6222,8 +6243,8 @@
- { "Canon EOS 550D", 0, 0x3dd7,
- { 6941,-1164,-857,-3825,11597,2534,-416,1540,6039 } },
+ { "Canon EOS 550D", 0, 0x3dd7, /* RT - Lebedev*/
+ { 6519,-772,-703,-4994,12737,2519,-1387,2492,6175 } },
{ "Canon EOS 600D", 0, 0x3510,
{ 6461,-907,-882,-4300,12184,2378,-819,1944,5931 } },
{ "Canon EOS 1000D", 0, 0xe43,
@@ -6223,8 +6244,8 @@
{ 6517,-602,-867,-8180,15926,2378,-1618,1771,7633 } },
{ "Canon EOS-1D Mark IV", 0, 0x3bb0,
{ 6014,-220,-795,-4109,12014,2361,-561,1824,5787 } },
@@ -362,7 +411,16 @@
{ "Canon EOS-1D Mark II N", 0, 0xe80,
{ 6240,-466,-822,-8180,15825,2500,-1801,1938,8042 } },
{ "Canon EOS-1D Mark II", 0, 0xe80,
@@ -6370,8 +6391,8 @@
@@ -6302,7 +6323,7 @@
{ "Canon PowerShot SX1 IS", 0, 0,
{ 6578,-259,-502,-5974,13030,3309,-308,1058,4970 } },
{ "Canon PowerShot SX110 IS", 0, 0, /* DJC */
- { 14134,-5576,-1527,-1991,10719,1273,-1158,1929,3581 } },
+ { 14134,-5576,-1527,-1991,10719,1273,-1158,1929,3581 } },
{ "CASIO EX-S20", 0, 0, /* DJC */
{ 11634,-3924,-1128,-4968,12954,2015,-1588,2648,7206 } },
{ "CASIO EX-Z750", 0, 0, /* DJC */
@@ -6373,8 +6394,8 @@
{ 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
{ "FUJIFILM FinePix F600EXR", 0, 0,
{ 13690,-5358,-1474,-3369,11600,1998,-132,1554,4395 } },
@@ -370,10 +428,10 @@
- { 12161,-4457,-1069,-5034,12874,2400,-795,1724,6904 } },
+ { "FUJIFILM FinePix X100", 0, 0, /* RT - Colin Walker */
+ { 10841,-3288,-807,-4652,12552,2344,-642,1355,7206 } },
{ "FUJIFILM X10", 0, 0,
{ 13509,-6199,-1254,-4430,12733,1865,-331,1441,5022 } },
{ "Imacon Ixpress", 0, 0, /* DJC */
{ 7025,-1415,-704,-5188,13765,1424,-1248,2742,6038 } },
{ "KODAK NC2000", 0, 0,
@@ -6470,8 +6491,8 @@
@@ -6475,8 +6496,8 @@
{ 7702,-2245,-975,-9114,17242,1875,-2679,3055,8521 } },
{ "NIKON D1", 0, 0, /* multiplied by 2.218750, 1.0, 1.148438 */
{ 16772,-4726,-2141,-7611,15713,1972,-2846,3494,9521 } },
@@ -384,7 +442,7 @@
{ "NIKON D2H", 0, 0,
{ 5710,-901,-615,-8594,16617,2024,-2975,4120,6830 } },
{ "NIKON D2X", 0, 0,
@@ -6484,8 +6505,8 @@
@@ -6489,8 +6510,8 @@
{ 9030,-1992,-715,-8465,16302,2255,-2689,3217,8069 } },
{ "NIKON D3X", 0, 0,
{ 7171,-1986,-648,-8085,15555,2718,-2170,2512,7457 } },
@@ -395,7 +453,7 @@
{ "NIKON D3", 0, 0,
{ 8139,-2171,-663,-8747,16541,2295,-1925,2008,8093 } },
{ "NIKON D40X", 0, 0,
@@ -6500,10 +6521,10 @@
@@ -6505,10 +6526,10 @@
{ 7732,-2422,-789,-8238,15884,2498,-859,783,7330 } },
{ "NIKON D60", 0, 0,
{ 8736,-2458,-935,-9075,16894,2251,-1354,1242,8263 } },
@@ -410,7 +468,7 @@
{ "NIKON D70", 0, 0,
{ 7732,-2422,-789,-8238,15884,2498,-859,783,7330 } },
{ "NIKON D80", 0, 0,
@@ -6562,8 +6583,8 @@
@@ -6569,8 +6590,8 @@
{ 7828,-1761,-348,-5788,14071,1830,-2853,4518,6557 } },
{ "OLYMPUS E-330", 0, 0,
{ 8961,-2473,-1084,-7979,15990,2067,-2319,3035,8249 } },
@@ -421,7 +479,7 @@
{ "OLYMPUS E-3", 0, 0xf99,
{ 9487,-2875,-1115,-7533,15606,2010,-1618,2100,7389 } },
{ "OLYMPUS E-400", 0, 0,
@@ -6580,26 +6601,26 @@
@@ -6587,26 +6608,26 @@
{ 8785,-2529,-1033,-7639,15624,2112,-1783,2300,7817 } },
{ "OLYMPUS E-520", 0, 0xfd2,
{ 8344,-2322,-1020,-7596,15635,2048,-1748,2269,7287 } },
@@ -464,7 +522,7 @@
{ "OLYMPUS E-PM1", 0, 0,
{ 7575,-2159,-571,-3722,11341,2725,-1434,2819,6271 } },
{ "OLYMPUS SP350", 0, 0,
@@ -6616,8 +6637,8 @@
@@ -6623,8 +6644,8 @@
{ 10915,-3677,-982,-5587,12986,2911,-1168,1968,6223 } },
{ "OLYMPUS SP570UZ", 0, 0,
{ 11522,-4044,-1146,-4736,12172,2904,-988,1829,6039 } },
@@ -475,7 +533,7 @@
{ "PENTAX *ist DL2", 0, 0,
{ 10504,-2438,-1189,-8603,16207,2531,-1022,863,12242 } },
{ "PENTAX *ist DL", 0, 0,
@@ -6634,8 +6655,8 @@
@@ -6641,8 +6662,8 @@
{ 11095,-3157,-1324,-8377,15834,2720,-1108,947,11688 } },
{ "PENTAX K20D", 0, 0,
{ 9427,-2714,-868,-7493,16092,1373,-2199,3264,7180 } },
@@ -486,7 +544,7 @@
{ "PENTAX K2000", 0, 0,
{ 11057,-3604,-1155,-5152,13046,2329,-282,375,8104 } },
{ "PENTAX K-m", 0, 0,
@@ -6692,32 +6713,34 @@
@@ -6699,34 +6720,36 @@
{ 10909,-4295,-948,-1333,9306,2399,22,1738,4582 } },
{ "LEICA D-LUX 5", 143, 0,
{ 10909,-4295,-948,-1333,9306,2399,22,1738,4582 } },
@@ -500,6 +558,8 @@
- { 11904,-4541,-1189,-2355,10899,1662,-296,1586,4289 } },
+ { "Panasonic DMC-FZ150", 143, 0xfff, /* RT */
+ { 10435,-3208,-72,-2293,10506,2067,-486,1725,4682 } },
{ "LEICA V-LUX 3", 143, 0xfff,
{ 11904,-4541,-1189,-2355,10899,1662,-296,1586,4289 } },
{ "Panasonic DMC-FX150", 15, 0xfff,
{ 9082,-2907,-925,-6119,13377,3058,-1797,2641,5609 } },
- { "Panasonic DMC-G10", 0, 0,
@@ -538,10 +598,10 @@
+ { 6360,-1557,-375,-4201,11504,3086,-1378,2518,5843 } },
+ { "Panasonic DMC-GH2", 15, 0xf95, /* RT - Colin Walker */
+ { 6855,-1765,-456,-4223,11600,2996,-1450,2602,5761 } },
{ "Panasonic DMC-GX1", 143, 0,
{ 6763,-1919,-863,-3868,11515,2684,-1216,2387,5879 } },
{ "Phase One H 20", 0, 0, /* DJC */
{ 1313,1855,-109,-6715,15908,808,-327,1840,6020 } },
{ "Phase One H 25", 0, 0,
@@ -6774,24 +6797,20 @@
@@ -6787,26 +6810,22 @@
{ 5932,-1492,-411,-4813,12285,2856,-741,1524,6739 } },
{ "SONY DSLR-A5", 128, 0xfeb,
{ 4950,-580,-103,-5228,12542,3029,-709,1435,7371 } },
@@ -569,6 +629,8 @@
+ { 5145,-741,-123,-4915,12310,2945,-794,1489,6906 } },
+ { "SONY NEX-5", 128, 0, /* RT - Colin Walker */
+ { 5154,-716,-115,-5065,12506,2882,-988,1715,6800 } },
{ "SONY NEX-7", 128, 0,
{ 5491,-1192,-363,-4951,12342,2948,-911,1722,7192 } },
+ { "SONY NEX-C3", 128, 0, /* RT - Colin Walker */
+ { 5130,-1055,-269,-4473,11797,3050,-701,1310,7121 } },
+ { "SONY NEX-5N", 138, 0, /* RT - Colin Walker */
@@ -576,7 +638,7 @@
{ "SONY SLT-A33", 128, 0,
{ 6069,-1221,-366,-5221,12779,2734,-1024,2066,6834 } },
{ "SONY SLT-A35", 128, 0,
@@ -6800,8 +6819,8 @@
@@ -6815,8 +6834,8 @@
{ 5932,-1492,-411,-4813,12285,2856,-741,1524,6739 } },
{ "SONY SLT-A65", 128, 0,
{ 5491,-1192,-363,-4951,12342,2948,-911,1722,7192 } },
@@ -587,7 +649,7 @@
};
double cam_xyz[4][3];
char name[130];
@@ -7044,6 +7063,12 @@
@@ -7060,6 +7079,12 @@
fread (head, 1, 32, ifp);
fseek (ifp, 0, SEEK_END);
flen = fsize = ftell(ifp);
@@ -600,7 +662,7 @@
if ((cp = (char *) memmem (head, 32, "MMMM", 4)) ||
(cp = (char *) memmem (head, 32, "IIII", 4))) {
parse_phase_one (cp-head);
@@ -7051,6 +7076,8 @@
@@ -7067,6 +7092,8 @@
} else if (order == 0x4949 || order == 0x4d4d) {
if (!memcmp (head+6,"HEAPCCDR",8)) {
data_offset = hlen;
@@ -609,7 +671,7 @@
parse_ciff (hlen, flen - hlen);
} else if (parse_tiff(0)) apply_tiff();
} else if (!memcmp (head,"\xff\xd8\xff\xe1",4) &&
@@ -7094,6 +7121,7 @@
@@ -7110,6 +7137,7 @@
fseek (ifp, 100+28*(shot_select > 0), SEEK_SET);
parse_tiff (data_offset = get4());
parse_tiff (thumb_offset+12);
@@ -617,7 +679,7 @@
apply_tiff();
} else if (!memcmp (head,"RIFF",4)) {
fseek (ifp, 0, SEEK_SET);
@@ -7139,8 +7167,7 @@
@@ -7155,8 +7183,7 @@
parse_redcine();
load_raw = &CLASS redcine_load_raw;
gamma_curve (1/2.4, 12.92, 1, 4095);
@@ -627,7 +689,7 @@
parse_rollei();
else if (!memcmp (head,"PWAD",4))
parse_sinar_ia();
@@ -7195,7 +7222,7 @@
@@ -7211,7 +7238,7 @@
if (height == 3136 && width == 4864) /* Pentax K20D and Samsung GX20 */
{ height = 3124; width = 4688; filters = 0x16161616; }
if (width == 4352 && (!strcmp(model,"K-r") || !strcmp(model,"K-x")))
@@ -636,7 +698,16 @@
if (width >= 4960 && !strcmp(model,"K-5"))
{ left_margin = 10; width = 4950; filters = 0x16161616; }
if (width == 4736 && !strcmp(model,"K-7"))
@@ -8816,13 +8843,13 @@
@@ -8553,7 +8580,7 @@
for (j=0; j < 3; j++) {
for (num = k=0; k < 3; k++)
num += xyzd50_srgb[i][k] * inverse[j][k];
- oprof[pbody[j*3+23]/4+i+2] = num * 0x10000 + 0.5;
+ oprof[pbody[j*3+23]/4+i+2] = num * 0x10000 + 0.5;
}
for (i=0; i < phead[0]/4; i++)
oprof[i] = htonl(oprof[i]);
@@ -8852,13 +8879,13 @@
FORCC ppm [col*colors+c] = curve[image[soff][c]] >> 8;
else FORCC ppm2[col*colors+c] = curve[image[soff][c]];
if (output_bps == 16 && !output_tiff && htons(0x55aa) != 0x55aa)
@@ -652,7 +723,7 @@
{
int arg, status=0;
int timestamp_only=0, thumbnail_only=0, identify_only=0;
@@ -8935,7 +8962,7 @@
@@ -8971,7 +8998,7 @@
case 'i': identify_only = 1; break;
case 'c': write_to_stdout = 1; break;
case 'v': verbose = 1; break;
@@ -661,7 +732,7 @@
case 'f': four_color_rgb = 1; break;
case 'A': FORC4 greybox[c] = atoi(argv[arg++]);
case 'a': use_auto_wb = 1; break;
@@ -9198,3 +9225,4 @@
@@ -9234,3 +9261,4 @@
}
return status;
}