mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-14 11:17:05 -04:00
LR-IMP-FORMATS: ARW6 companding curve derived clean-room from CC0 lossless pairs
The 2668-entry table read off the black-box oracle's output is gone. arw6_curve.rs now builds the 4096-entry table at first use from our own measurement: piecewise linear through knots u_k = 128 k, c_k = u_k for k <= 11 and 356.89 + 655.646 ln(k - 6) above, rounded half up, fitted to the 7 same-exposure lossless (LJ92) / ARW6 pairs of the CC0 ILCE-7RM6 set. A unit test pins the whole table (sum 27776336, weighted 92792980288), its anchors, the identity through 1408 and strict monotonicity. The corpus sums become regression values of the new output; the 12-bit codes before the curve stay verified against the oracle (Phase 0). docs/arw6-compression.md describes the curve, how it was measured, its uncertainty, the structure and x2-scale evidence, why it is not in the file, and the after-the-fact comparison with the oracle's curve; the tracker and docs no longer call the output bit-exact against LibRaw. Co-Authored-By: Claude <[email protected]>
This commit is contained in:
1 parent
4d26a4d7b4
commit
4860f5e8d4
6 files changed
+135
-221
No files matched your search
Vendored
+1
-1
@@ -658,7 +658,7 @@ pub(crate) fn decode(bytes: &[u8], mode: Mode) -> Result<RawImage> {
|
||||
_ => BlackLevel::uniform((scale_bits >= 14).then(|| sr2().and_then(sr2_black)).flatten().unwrap_or(default_black)),
|
||||
};
|
||||
// ARW6 samples are in 2 x 14-bit units, so the file's 14-bit levels double; without the tag the white is the
|
||||
// companding table's knot, 2 x 16383
|
||||
// 14-bit white in those units, 2 x 16383
|
||||
let unit = if info.compression == 32766 { 2.0 } else { 1.0 };
|
||||
let white = if linear_rgb {
|
||||
YCBCR_WHITE + YCBCR_OFFSET
|
||||
|
||||
Vendored
+3
-23
@@ -6,7 +6,7 @@
|
||||
//! names in italics below refer to it. No other raw decoder's source was consulted.
|
||||
|
||||
use crate::llvc::{Bands3, Plane, band_rows, dequant, reconstruct3, vld_decode_line};
|
||||
use crate::vendor::arw6_curve::{ARW6_CURVE, CURVE_KNEE};
|
||||
use crate::vendor::arw6_curve::curve;
|
||||
use crate::vendor::pef::Bits;
|
||||
use crate::{RawError, Result};
|
||||
use rayon::prelude::*;
|
||||
@@ -456,15 +456,6 @@ pub(crate) fn decode_tile_planes(tile: &[u8], tw: usize, th: usize) -> Result<Ti
|
||||
Ok(TilePlanes { m, c1, c2, res })
|
||||
}
|
||||
|
||||
/// Companding curve: 12-bit code to output value (2 x 14-bit units).
|
||||
pub(crate) fn curve(code12: i32) -> u16 {
|
||||
let c = code12.clamp(0, 4095) as usize;
|
||||
match c.checked_sub(CURVE_KNEE) {
|
||||
None => c as u16,
|
||||
Some(i) => ARW6_CURVE.get(i).copied().unwrap_or(39002),
|
||||
}
|
||||
}
|
||||
|
||||
/// Colour reconstruction (*Colour reconstruction*, checked against Phase 0 oracle output): the planes give a
|
||||
/// `(2 W2) x (2 H2)` mosaic with R at (0,0), G1 (0,1), G2 (1,0), B (1,1) of every 2x2 cell, each value passed through
|
||||
/// [`curve`]. G1 comes from the green mean minus a residual average, G2 is predicted from the (unclipped) G1 plus the
|
||||
@@ -829,17 +820,6 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn curve_anchors() {
|
||||
assert_eq!(ARW6_CURVE.len(), 2668);
|
||||
for (c, v) in [(0, 0), (1427, 1427), (1428, 1429), (1436, 1438), (2048, 2469), (3000, 8010), (4094, 38944), (4095, 39002)] {
|
||||
assert_eq!(curve(c), v, "code {c}");
|
||||
}
|
||||
assert_eq!(curve(-5), 0);
|
||||
assert_eq!(curve(5000), 39002);
|
||||
assert!(ARW6_CURVE.windows(2).all(|w| w[0] < w[1]));
|
||||
}
|
||||
|
||||
fn plane(w: usize, v: &[i32]) -> Plane {
|
||||
Plane { width: w, height: v.len() / w, data: v.to_vec() }
|
||||
}
|
||||
@@ -874,7 +854,7 @@ mod tests {
|
||||
let mut p = example();
|
||||
p.m.data[1] = 4100;
|
||||
let out = colour(&p).unwrap();
|
||||
assert_eq!(out[3], 39002); // G1 = 4101 -> clipped output
|
||||
assert_eq!(out[3], curve(4095)); // G1 = 4101 -> clipped output
|
||||
assert_eq!(out[6 + 2], curve(2554)); // G2 predicted from the unclipped G1
|
||||
assert_eq!(out[2], curve(3304)); // R = 2*(-10) + ((4095 + 2554) >> 1): chroma uses the clipped greens
|
||||
}
|
||||
@@ -942,7 +922,7 @@ mod tests {
|
||||
for x in 0..w2 {
|
||||
let at = |dy: usize, dx: usize| out[(2 * j + dy) * 64 + 2 * x + dx];
|
||||
assert_eq!(at(0, 0), at(1, 1), "R == B at ({x},{j})");
|
||||
assert!(at(0, 0) < 39002);
|
||||
assert!(at(0, 0) < curve(4095));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+53
-174
@@ -1,176 +1,55 @@
|
||||
//! The ARW6 companding table: 12-bit tile code to output value.
|
||||
//! The ARW6 companding curve: 12-bit tile code to output value in 2 × 14-bit DN (black 1024, white 32766).
|
||||
//!
|
||||
//! Piecewise linear through knots (c_k, 128 k): c_k = 128 k for k <= 11, else 356.89 + 655.646 ln(k - 6); each code's
|
||||
//! value is the interpolation rounded half up. Our own measurement from the CC0 lossless / ARW6 pairs of the ILCE-7RM6,
|
||||
//! not stored in the file; see docs/arw6-compression.md (*Output range*).
|
||||
|
||||
/// First code the table covers; below it the curve is the identity.
|
||||
pub(crate) const CURVE_KNEE: usize = 1428;
|
||||
use std::sync::OnceLock;
|
||||
|
||||
/// code → 2 × 14-bit DN; identity below the knee; derived in Phase 0 from the black-box oracle's output over 8 files (0 disagreements), see docs/arw6-compression.md.
|
||||
#[rustfmt::skip]
|
||||
pub(crate) const ARW6_CURVE: [u16; 2668] = [
|
||||
1429,1430,1431,1432,1433,1434,1435,1436,1438,1439,1440,1441,1442,1443,1444,1445,
|
||||
1446,1447,1448,1449,1450,1451,1452,1453,1455,1456,1457,1458,1459,1460,1461,1462,
|
||||
1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,1477,1478,
|
||||
1480,1481,1482,1483,1484,1485,1486,1487,1489,1490,1491,1492,1493,1494,1495,1496,
|
||||
1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,
|
||||
1513,1514,1515,1516,1517,1518,1519,1520,1522,1523,1524,1525,1526,1527,1529,1530,
|
||||
1531,1532,1534,1535,1536,1537,1538,1539,1541,1542,1543,1544,1545,1546,1548,1549,
|
||||
1550,1551,1553,1554,1555,1556,1558,1559,1561,1562,1563,1565,1566,1567,1568,1569,
|
||||
1571,1572,1573,1574,1575,1576,1578,1579,1580,1581,1583,1584,1585,1586,1588,1589,
|
||||
1590,1591,1593,1594,1595,1596,1598,1599,1601,1602,1603,1605,1606,1607,1608,1609,
|
||||
1611,1612,1613,1614,1615,1616,1618,1619,1621,1622,1623,1625,1626,1627,1629,1630,
|
||||
1631,1632,1634,1635,1636,1637,1639,1640,1641,1642,1644,1645,1646,1647,1649,1650,
|
||||
1651,1652,1654,1655,1656,1657,1659,1660,1662,1663,1664,1666,1667,1668,1670,1671,
|
||||
1673,1674,1675,1677,1678,1680,1681,1683,1685,1686,1688,1689,1691,1692,1694,1695,
|
||||
1697,1698,1699,1701,1702,1704,1705,1707,1709,1710,1712,1713,1715,1716,1718,1719,
|
||||
1720,1721,1723,1724,1725,1727,1728,1730,1731,1733,1734,1736,1737,1739,1740,1742,
|
||||
1743,1745,1746,1748,1749,1750,1752,1753,1755,1756,1757,1759,1760,1762,1763,1765,
|
||||
1767,1768,1770,1771,1773,1774,1776,1777,1779,1780,1781,1783,1784,1786,1787,1789,
|
||||
1791,1792,1794,1795,1797,1799,1801,1802,1804,1806,1808,1809,1811,1813,1814,1816,
|
||||
1818,1819,1821,1822,1824,1826,1827,1829,1831,1832,1834,1835,1837,1839,1841,1842,
|
||||
1844,1846,1848,1849,1851,1853,1854,1856,1858,1859,1861,1862,1864,1866,1868,1869,
|
||||
1871,1873,1875,1876,1878,1880,1881,1883,1885,1886,1888,1889,1891,1893,1894,1896,
|
||||
1898,1899,1901,1902,1904,1906,1908,1909,1911,1913,1915,1916,1918,1920,1922,1924,
|
||||
1926,1927,1929,1931,1933,1935,1937,1938,1940,1942,1944,1945,1947,1949,1951,1953,
|
||||
1955,1957,1959,1961,1963,1965,1967,1968,1970,1972,1974,1975,1977,1979,1981,1983,
|
||||
1985,1986,1988,1990,1992,1994,1996,1998,2000,2001,2003,2005,2007,2009,2011,2013,
|
||||
2015,2016,2018,2020,2022,2024,2026,2027,2029,2031,2033,2034,2036,2038,2040,2042,
|
||||
2044,2046,2048,2050,2052,2054,2056,2058,2060,2062,2064,2066,2068,2070,2072,2074,
|
||||
2076,2078,2080,2082,2084,2086,2088,2090,2092,2094,2096,2098,2100,2102,2104,2106,
|
||||
2109,2111,2113,2115,2117,2119,2121,2123,2125,2127,2129,2131,2133,2135,2137,2139,
|
||||
2141,2143,2145,2147,2149,2151,2153,2155,2157,2159,2161,2163,2165,2167,2170,2172,
|
||||
2175,2177,2179,2182,2184,2186,2188,2190,2193,2195,2197,2199,2201,2203,2206,2208,
|
||||
2210,2212,2215,2217,2219,2221,2224,2226,2228,2230,2233,2235,2237,2239,2242,2244,
|
||||
2247,2249,2251,2254,2256,2258,2261,2263,2265,2267,2270,2272,2274,2276,2279,2281,
|
||||
2283,2285,2288,2290,2292,2294,2297,2299,2302,2304,2306,2309,2311,2314,2316,2319,
|
||||
2321,2324,2326,2329,2331,2333,2336,2338,2340,2342,2345,2347,2349,2352,2354,2357,
|
||||
2359,2362,2364,2367,2369,2371,2374,2376,2379,2381,2383,2386,2388,2390,2393,2395,
|
||||
2398,2400,2402,2405,2407,2410,2412,2415,2417,2420,2422,2425,2427,2430,2432,2435,
|
||||
2438,2440,2443,2445,2448,2451,2453,2456,2459,2461,2464,2466,2469,2472,2475,2477,
|
||||
2480,2483,2486,2488,2491,2494,2496,2499,2501,2504,2506,2509,2511,2514,2517,2519,
|
||||
2522,2525,2528,2530,2533,2536,2538,2541,2543,2546,2548,2551,2553,2556,2559,2561,
|
||||
2564,2567,2570,2572,2575,2578,2581,2584,2587,2589,2592,2595,2598,2601,2604,2606,
|
||||
2609,2612,2615,2617,2620,2623,2626,2629,2632,2634,2637,2640,2643,2646,2649,2652,
|
||||
2655,2657,2660,2663,2666,2669,2672,2675,2678,2680,2683,2686,2689,2692,2695,2698,
|
||||
2701,2704,2707,2710,2713,2716,2719,2722,2725,2727,2730,2733,2736,2739,2742,2745,
|
||||
2749,2752,2755,2758,2761,2764,2767,2770,2773,2776,2779,2782,2785,2788,2791,2794,
|
||||
2798,2801,2804,2807,2810,2813,2816,2819,2823,2826,2829,2832,2835,2838,2841,2844,
|
||||
2848,2851,2854,2857,2860,2863,2867,2870,2873,2876,2880,2883,2886,2889,2893,2896,
|
||||
2899,2902,2906,2909,2912,2915,2919,2922,2925,2928,2932,2935,2938,2941,2945,2948,
|
||||
2952,2955,2958,2962,2965,2968,2972,2975,2979,2982,2985,2989,2992,2995,2999,3002,
|
||||
3006,3009,3012,3016,3019,3023,3026,3030,3033,3037,3040,3044,3047,3051,3054,3058,
|
||||
3061,3065,3068,3072,3075,3079,3082,3086,3089,3093,3096,3100,3103,3107,3110,3114,
|
||||
3118,3121,3125,3128,3132,3136,3139,3143,3146,3150,3153,3157,3160,3164,3168,3171,
|
||||
3175,3179,3183,3186,3190,3194,3197,3201,3205,3208,3212,3215,3219,3223,3227,3231,
|
||||
3235,3238,3242,3246,3250,3254,3258,3261,3265,3269,3273,3276,3280,3284,3288,3292,
|
||||
3296,3299,3303,3307,3311,3315,3319,3323,3327,3331,3335,3339,3343,3347,3351,3354,
|
||||
3358,3362,3366,3369,3373,3377,3381,3385,3389,3393,3397,3401,3405,3409,3413,3417,
|
||||
3422,3426,3430,3434,3438,3442,3446,3450,3455,3459,3463,3467,3471,3475,3479,3483,
|
||||
3487,3491,3495,3499,3503,3507,3512,3516,3520,3524,3529,3533,3537,3541,3546,3550,
|
||||
3554,3558,3563,3567,3571,3575,3580,3584,3589,3593,3597,3602,3606,3610,3615,3619,
|
||||
3624,3628,3632,3637,3641,3645,3650,3654,3658,3662,3667,3671,3675,3680,3684,3689,
|
||||
3693,3698,3702,3707,3711,3716,3720,3725,3729,3734,3738,3743,3747,3752,3756,3761,
|
||||
3766,3770,3775,3779,3784,3789,3793,3798,3802,3807,3811,3816,3820,3825,3830,3834,
|
||||
3839,3844,3849,3853,3858,3863,3868,3872,3877,3882,3887,3891,3896,3901,3906,3910,
|
||||
3915,3920,3925,3929,3934,3939,3944,3949,3954,3958,3963,3968,3973,3978,3983,3988,
|
||||
3993,3997,4002,4007,4012,4017,4022,4027,4032,4037,4042,4047,4052,4057,4062,4067,
|
||||
4072,4077,4082,4087,4092,4097,4102,4107,4113,4118,4123,4128,4133,4138,4143,4148,
|
||||
4154,4159,4164,4169,4174,4179,4185,4190,4195,4200,4206,4211,4216,4221,4227,4232,
|
||||
4237,4242,4248,4253,4258,4263,4269,4274,4280,4285,4290,4296,4301,4306,4312,4317,
|
||||
4323,4328,4333,4339,4344,4350,4355,4361,4366,4372,4377,4383,4388,4394,4399,4405,
|
||||
4410,4416,4421,4427,4432,4438,4444,4449,4455,4461,4467,4472,4478,4484,4489,4495,
|
||||
4500,4506,4511,4517,4522,4528,4534,4540,4546,4551,4557,4563,4569,4575,4581,4586,
|
||||
4592,4598,4604,4609,4615,4621,4627,4633,4639,4644,4650,4656,4662,4668,4674,4680,
|
||||
4686,4692,4698,4704,4710,4716,4722,4728,4734,4740,4746,4752,4758,4764,4771,4777,
|
||||
4783,4789,4796,4802,4808,4814,4820,4826,4832,4838,4844,4850,4856,4862,4869,4875,
|
||||
4882,4888,4894,4901,4907,4913,4920,4926,4933,4939,4945,4952,4958,4964,4971,4977,
|
||||
4983,4989,4996,5002,5008,5015,5021,5028,5034,5041,5047,5054,5060,5067,5073,5080,
|
||||
5087,5093,5100,5106,5113,5120,5126,5133,5140,5146,5153,5159,5166,5173,5180,5186,
|
||||
5193,5200,5207,5213,5220,5227,5234,5240,5247,5254,5261,5267,5274,5281,5288,5295,
|
||||
5302,5309,5316,5323,5330,5337,5344,5351,5358,5365,5372,5379,5386,5393,5400,5407,
|
||||
5414,5421,5428,5435,5442,5449,5456,5463,5471,5478,5485,5492,5499,5506,5514,5521,
|
||||
5528,5535,5543,5550,5557,5564,5572,5579,5587,5594,5601,5609,5616,5623,5631,5638,
|
||||
5646,5653,5660,5668,5675,5683,5690,5698,5705,5713,5720,5728,5735,5743,5751,5758,
|
||||
5766,5774,5782,5789,5797,5805,5812,5820,5828,5835,5843,5850,5858,5866,5874,5881,
|
||||
5889,5897,5905,5912,5920,5928,5936,5944,5952,5959,5967,5975,5983,5991,5999,6007,
|
||||
6015,6023,6031,6039,6047,6055,6063,6071,6079,6087,6095,6103,6111,6119,6128,6136,
|
||||
6144,6152,6161,6169,6177,6185,6194,6202,6210,6218,6227,6235,6243,6251,6260,6268,
|
||||
6277,6285,6293,6302,6310,6319,6327,6336,6344,6353,6361,6370,6378,6387,6395,6404,
|
||||
6412,6421,6429,6438,6446,6455,6464,6472,6481,6490,6499,6507,6516,6525,6534,6543,
|
||||
6552,6560,6569,6578,6587,6596,6605,6613,6622,6631,6640,6648,6657,6666,6675,6684,
|
||||
6694,6703,6712,6721,6730,6739,6748,6757,6767,6776,6785,6794,6803,6812,6822,6831,
|
||||
6840,6849,6859,6868,6877,6886,6896,6905,6914,6923,6933,6942,6951,6961,6970,6980,
|
||||
6989,6999,7008,7018,7027,7037,7046,7056,7065,7075,7084,7094,7103,7113,7123,7132,
|
||||
7142,7152,7162,7171,7181,7191,7201,7210,7220,7230,7240,7249,7259,7269,7279,7289,
|
||||
7299,7309,7319,7329,7339,7349,7359,7369,7379,7389,7399,7409,7419,7429,7440,7450,
|
||||
7460,7470,7481,7491,7501,7511,7522,7532,7543,7553,7563,7574,7584,7594,7605,7615,
|
||||
7626,7636,7646,7657,7667,7678,7688,7699,7709,7720,7730,7741,7751,7762,7772,7783,
|
||||
7794,7804,7815,7825,7836,7847,7858,7869,7880,7890,7901,7912,7923,7934,7945,7956,
|
||||
7967,7977,7988,7999,8010,8021,8032,8043,8055,8066,8077,8088,8099,8110,8122,8133,
|
||||
8144,8155,8167,8178,8189,8200,8212,8223,8234,8245,8257,8268,8279,8291,8302,8314,
|
||||
8326,8337,8349,8360,8372,8384,8395,8407,8418,8430,8441,8453,8464,8476,8488,8500,
|
||||
8512,8523,8535,8547,8559,8571,8583,8595,8607,8618,8630,8642,8654,8666,8678,8690,
|
||||
8702,8714,8726,8738,8750,8762,8775,8787,8799,8811,8824,8836,8848,8860,8873,8885,
|
||||
8898,8910,8922,8935,8947,8960,8972,8985,8997,9010,9022,9035,9047,9060,9072,9085,
|
||||
9098,9110,9123,9135,9148,9161,9174,9187,9200,9212,9225,9238,9251,9264,9277,9290,
|
||||
9303,9316,9329,9342,9355,9368,9381,9394,9408,9421,9434,9447,9460,9473,9487,9500,
|
||||
9513,9526,9540,9553,9566,9580,9593,9607,9620,9634,9647,9661,9674,9688,9701,9715,
|
||||
9728,9742,9755,9769,9782,9796,9810,9824,9838,9851,9865,9879,9893,9907,9921,9935,
|
||||
9949,9963,9977,9991,10005,10019,10033,10047,10061,10075,10089,10103,10117,10131,10146,10160,
|
||||
10175,10189,10203,10218,10232,10247,10261,10276,10290,10305,10319,10334,10348,10363,10377,10392,
|
||||
10407,10421,10436,10450,10465,10480,10495,10509,10524,10539,10554,10568,10583,10598,10613,10628,
|
||||
10643,10658,10673,10688,10703,10718,10734,10749,10764,10779,10795,10810,10825,10840,10856,10871,
|
||||
10887,10902,10917,10933,10948,10964,10979,10995,11010,11026,11041,11057,11072,11088,11104,11120,
|
||||
11136,11151,11167,11183,11199,11215,11231,11247,11263,11278,11294,11310,11326,11342,11358,11374,
|
||||
11391,11407,11423,11439,11455,11471,11488,11504,11521,11537,11553,11570,11586,11603,11619,11636,
|
||||
11652,11669,11685,11702,11718,11735,11752,11768,11785,11802,11819,11835,11852,11869,11886,11903,
|
||||
11920,11937,11954,11971,11988,12005,12022,12039,12057,12074,12091,12108,12125,12142,12160,12177,
|
||||
12195,12212,12229,12247,12264,12282,12299,12317,12335,12352,12370,12387,12405,12423,12441,12458,
|
||||
12476,12494,12512,12529,12547,12565,12583,12601,12619,12637,12655,12673,12691,12709,12728,12746,
|
||||
12764,12782,12801,12819,12837,12855,12874,12892,12911,12929,12947,12966,12984,13003,13022,13040,
|
||||
13059,13078,13097,13115,13134,13153,13172,13191,13210,13228,13247,13266,13285,13304,13323,13342,
|
||||
13362,13381,13400,13419,13438,13457,13477,13496,13516,13535,13554,13574,13593,13613,13632,13652,
|
||||
13672,13691,13711,13730,13750,13770,13790,13810,13830,13849,13869,13889,13909,13929,13949,13969,
|
||||
13990,14010,14030,14050,14070,14090,14111,14131,14151,14171,14192,14212,14232,14253,14273,14294,
|
||||
14315,14335,14356,14376,14397,14418,14439,14460,14481,14501,14522,14543,14564,14585,14606,14627,
|
||||
14648,14669,14690,14711,14732,14753,14775,14796,14818,14839,14860,14882,14903,14925,14946,14968,
|
||||
14990,15011,15033,15054,15076,15098,15120,15142,15164,15185,15207,15229,15251,15273,15295,15317,
|
||||
15340,15362,15384,15406,15428,15450,15473,15495,15518,15540,15562,15585,15607,15630,15653,15675,
|
||||
15698,15721,15744,15766,15789,15812,15835,15858,15881,15903,15926,15949,15972,15995,16019,16042,
|
||||
16065,16088,16112,16135,16158,16182,16205,16229,16253,16276,16300,16323,16347,16371,16395,16418,
|
||||
16442,16466,16490,16513,16537,16561,16585,16609,16634,16658,16682,16706,16730,16754,16779,16803,
|
||||
16828,16852,16876,16901,16925,16950,16975,16999,17024,17049,17074,17098,17123,17148,17173,17198,
|
||||
17223,17248,17273,17298,17323,17348,17374,17399,17424,17449,17475,17500,17525,17551,17576,17602,
|
||||
17628,17653,17679,17704,17730,17756,17782,17808,17834,17860,17886,17912,17938,17964,17991,18017,
|
||||
18043,18069,18096,18122,18148,18175,18201,18228,18254,18281,18307,18334,18360,18387,18414,18441,
|
||||
18468,18494,18521,18548,18575,18602,18630,18657,18684,18711,18739,18766,18793,18821,18848,18876,
|
||||
18904,18931,18959,18986,19014,19042,19070,19097,19125,19153,19181,19208,19236,19264,19293,19321,
|
||||
19349,19377,19406,19434,19462,19491,19519,19548,19577,19605,19634,19662,19691,19720,19749,19778,
|
||||
19807,19835,19864,19893,19922,19951,19981,20010,20040,20069,20098,20128,20157,20187,20216,20246,
|
||||
20276,20305,20335,20364,20394,20424,20454,20484,20514,20544,20574,20604,20634,20664,20695,20725,
|
||||
20756,20786,20816,20847,20877,20908,20939,20969,21000,21031,21062,21092,21123,21154,21185,21216,
|
||||
21247,21278,21309,21340,21371,21403,21434,21466,21497,21529,21560,21592,21623,21655,21687,21719,
|
||||
21751,21782,21814,21846,21878,21910,21943,21975,22007,22039,22072,22104,22136,22169,22202,22234,
|
||||
22267,22300,22333,22365,22398,22431,22464,22497,22530,22563,22596,22629,22662,22696,22729,22763,
|
||||
22796,22830,22863,22897,22930,22964,22998,23032,23066,23099,23133,23167,23201,23235,23270,23304,
|
||||
23338,23372,23407,23441,23475,23510,23545,23579,23614,23649,23684,23718,23753,23788,23823,23858,
|
||||
23894,23929,23964,23999,24034,24070,24105,24141,24176,24212,24247,24283,24318,24354,24390,24426,
|
||||
24462,24498,24534,24570,24606,24643,24679,24716,24752,24789,24825,24862,24898,24935,24972,25009,
|
||||
25046,25082,25119,25156,25193,25230,25268,25305,25342,25379,25417,25454,25491,25529,25567,25605,
|
||||
25643,25680,25718,25756,25794,25832,25871,25909,25947,25985,26024,26062,26100,26139,26178,26216,
|
||||
26255,26294,26333,26371,26410,26449,26488,26527,26567,26606,26645,26684,26723,26763,26802,26842,
|
||||
26882,26921,26961,27000,27040,27080,27121,27161,27201,27241,27282,27322,27362,27403,27443,27484,
|
||||
27525,27565,27606,27646,27687,27728,27769,27810,27852,27893,27934,27975,28016,28058,28099,28141,
|
||||
28183,28224,28266,28307,28349,28391,28433,28475,28518,28560,28602,28644,28686,28729,28772,28814,
|
||||
28857,28900,28943,28985,29028,29071,29114,29157,29201,29244,29287,29330,29373,29417,29461,29504,
|
||||
29548,29592,29636,29679,29723,29767,29812,29856,29900,29944,29989,30033,30077,30122,30167,30211,
|
||||
30256,30301,30346,30390,30435,30480,30526,30571,30617,30662,30707,30753,30798,30844,30890,30936,
|
||||
30982,31027,31073,31119,31165,31212,31258,31305,31351,31398,31444,31491,31537,31584,31631,31678,
|
||||
31725,31772,31819,31866,31913,31961,32008,32056,32104,32151,32199,32246,32294,32342,32390,32438,
|
||||
32487,32535,32583,32631,32679,32766,32777,32825,32874,32923,32972,33020,33069,33118,33168,33217,
|
||||
33267,33316,33365,33415,33464,33514,33564,33614,33664,33714,33764,33814,33864,33915,33965,34016,
|
||||
34067,34117,34168,34218,34269,34320,34371,34422,34474,34525,34576,34627,34678,34730,34782,34834,
|
||||
34886,34937,34989,35041,35093,35146,35198,35251,35303,35356,35408,35461,35513,35566,35619,35672,
|
||||
35725,35778,35831,35884,35937,35991,36045,36098,36152,36206,36260,36313,36367,36422,36476,36531,
|
||||
36585,36640,36694,36749,36803,36858,36913,36968,37023,37078,37133,37188,37243,37299,37355,37410,
|
||||
37466,37522,37578,37633,37689,37746,37802,37859,37915,37972,38028,38085,38141,38198,38255,38312,
|
||||
38369,38426,38483,38540,38597,38655,38713,38771,38829,38886,38944,39002,
|
||||
];
|
||||
/// Code of knot `k`, whose output value is 128 k.
|
||||
fn knot(k: u32) -> f64 {
|
||||
if k <= 11 { f64::from(128 * k) } else { 356.89 + 655.646 * f64::from(k - 6).ln() }
|
||||
}
|
||||
|
||||
fn table() -> &'static [u16; 4096] {
|
||||
static TABLE: OnceLock<[u16; 4096]> = OnceLock::new();
|
||||
TABLE.get_or_init(|| {
|
||||
let mut t = [0u16; 4096];
|
||||
let mut k = 0u32;
|
||||
for (code, v) in t.iter_mut().enumerate() {
|
||||
let c = code as f64;
|
||||
while knot(k + 1) < c {
|
||||
k += 1;
|
||||
}
|
||||
let (c0, c1, u0) = (knot(k), knot(k + 1), f64::from(128 * k));
|
||||
*v = (u0 + 128.0 * (c - c0) / (c1 - c0) + 0.5).floor() as u16;
|
||||
}
|
||||
t
|
||||
})
|
||||
}
|
||||
|
||||
/// Companding curve: 12-bit code (clamped to 0..=4095) to output value.
|
||||
pub(crate) fn curve(code12: i32) -> u16 {
|
||||
table().get(code12.clamp(0, 4095) as usize).copied().unwrap_or(u16::MAX)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
/// Pins the whole generated table (sum and position-weighted sum of all 4096 values, from the derivation's own
|
||||
/// table), so a platform whose `ln` rounds differently fails here.
|
||||
#[test]
|
||||
fn table_is_pinned() {
|
||||
let t = table();
|
||||
let sum: u64 = t.iter().map(|&v| u64::from(v)).sum();
|
||||
let weighted: u64 = t.iter().enumerate().map(|(i, &v)| (i as u64 + 1) * u64::from(v)).sum();
|
||||
assert_eq!((sum, weighted), (27776336, 92792980288));
|
||||
for (c, v) in [(0, 0), (1408, 1408), (1536, 1542), (2048, 2457), (3000, 7979), (3500, 16227), (3977, 32767), (4095, 39077)] {
|
||||
assert_eq!(curve(c), v, "code {c}");
|
||||
}
|
||||
assert!((0..=1408).all(|c| curve(c) == c as u16), "identity through 1408");
|
||||
assert!(t.windows(2).all(|w| w[0] < w[1]), "strictly increasing");
|
||||
assert_eq!((curve(-5), curve(5000)), (0, 39077));
|
||||
}
|
||||
}
|
||||
@@ -881,13 +881,14 @@ fn verify_sensor_arrays(cases: &[(&str, usize, usize, u64, u64)]) -> usize {
|
||||
seen
|
||||
}
|
||||
|
||||
/// Reference sums from the oracle-verified Phase 0 model (docs/arw6-compression.md); the files are CC0 from RawDB,
|
||||
/// one per geometry and compression mode.
|
||||
/// Regression values from LightCraft's decoder with the derived companding curve; the 12-bit codes before the curve
|
||||
/// were verified against the black-box oracle in Phase 0 (docs/arw6-compression.md). The files are CC0 from RawDB, one
|
||||
/// per geometry and compression mode.
|
||||
#[test]
|
||||
fn corpus_sony_arw6_samples() {
|
||||
let cases: &[(&str, usize, usize, u64, u64)] = &[
|
||||
("arw6-sony-ilce7rm6-apsc-land-hq.arw", 6592, 4372, 85834467900, 1323814215465139776),
|
||||
("arw6-sony-ilce7rm6-ff-land-c.arw", 10016, 6672, 258558260019, 9665041696390559268),
|
||||
("arw6-sony-ilce7rm6-apsc-land-hq.arw", 6592, 4372, 85546367117, 1319631546150087499),
|
||||
("arw6-sony-ilce7rm6-ff-land-c.arw", 10016, 6672, 257718215153, 9636375794063042132),
|
||||
];
|
||||
let seen = verify_sensor_arrays(cases);
|
||||
eprintln!("verified {seen} Sony ARW6 sensor arrays");
|
||||
|
||||
+71
-17
@@ -6,12 +6,12 @@ Decode timings: see the end of this document (measured in the performance pass).
|
||||
|
||||
## Format and implementation
|
||||
|
||||
The codec is Sony's use of SMPTE RDD 34 (LLVC, Low Latency Video Codec). `crates/raw/src/llvc.rs` is the codec core (bit reader, variable-length decoder, dequantiser, inverse 5/3 wavelet); `crates/raw/src/vendor/arw6.rs` is the Sony container, geometry and colour reconstruction; `crates/raw/src/vendor/arw6_curve.rs` is the companding table; `arw.rs` dispatches Compression 32766 to it. A test-only encoder (`arw6_testenc.rs`) builds synthetic tiles for round-trip tests.
|
||||
The codec is Sony's use of SMPTE RDD 34 (LLVC, Low Latency Video Codec). `crates/raw/src/llvc.rs` is the codec core (bit reader, variable-length decoder, dequantiser, inverse 5/3 wavelet); `crates/raw/src/vendor/arw6.rs` is the Sony container, geometry and colour reconstruction; `crates/raw/src/vendor/arw6_curve.rs` is the companding curve; `arw.rs` dispatches Compression 32766 to it. A test-only encoder (`arw6_testenc.rs`) builds synthetic tiles for round-trip tests.
|
||||
|
||||
### Container
|
||||
|
||||
- Raw SubIFD: Compression 32766, 14 bits per sample, BlackLevel 512 x4 (`0x7310`), WB `0x7313`, crop `0x74c7/0x74c8` (full frame: origin 12,8, size 9984x6656; APS-C: origin 16,10, size 6528x4352), CFA RGGB. The Sony tag-based white level (15360) is not read; the DNG `WhiteLevel` is (16383).
|
||||
- The single strip starts with a tile table: `u32` count, `u32` 0, then per tile a `u64` offset (relative to the strip) and `u32` x, y, width, height. Seen: full frame 4 tiles of 5008x3336 (HQ) or 5024 / 4992 wide (Compressed); APS-C (6592x4372) one tile. A 480-byte block follows the table (not interpreted, not needed).
|
||||
- The single strip starts with a tile table: `u32` count, `u32` 0, then per tile a `u64` offset (relative to the strip) and `u32` x, y, width, height. Seen: full frame 4 tiles of 5008x3336 (HQ) or 5024 / 4992 wide (Compressed); APS-C (6592x4372) one tile. Bytes up to offset 512 follow the table (480 on APS-C, 408 on full frame; not interpreted, not needed).
|
||||
- A tile is a sequence of 16-byte words. Word 0 is RDD 34 `Picture_info` (HS = tile width, VS = tile height / 2, BBD = 16, NC = 3, NW = 3, NP = `1000000000b`; other values are refused as unsupported). Word 1 holds five `u24` group byte-sums, word 2 is zero, words 3-7 describe the groups (a count byte, then `u24` stream sizes in words). Groups: g0 = LL3 (3 streams, one per component), g1 / g2 / g3 = level-3 / 2 / 1 bands (3 streams each), g4 = green residual (1 stream). Streams follow in that order from word 8.
|
||||
- A stream is a header word (a `u16` count of index words, a `u24` count of data words, then 11 bytes that are not interpreted), an index table and data, each padded to a word. The index has one entry per transform unit (TU): `A(16) X B(16) X`, where A and B are the byte lengths of the TU's two halves and X are quantiser-index (QI) nibbles (one for g0 and g4, three for g1-g3: HL, LH, HH). Halves per tile = ceil((VS - 2 - s) / 8) + 1 with s the first-half shift (below), TUs = ceil(halves / 2): 105 and 137 for the sample sizes. Halves are numbered n = 2 * TU + h; each is byte-aligned and consecutive halves are contiguous.
|
||||
- QI values seen, identical in Compressed and HQ files: level 1 component 0 (1,1,2), components 1-2 (2,2,3); level 2 (0,0,1); level 3 (0,0,0); LL3 0; residual 2. Compressed and HQ differ only in the coefficient data.
|
||||
@@ -38,22 +38,77 @@ With plane row j, column x (x +- 1 clamped at the edges), in 12-bit code units:
|
||||
- `R = 2*c1 + ((clamp(G1, 0, 4095) + clamp(G2, 0, 4095)) >> 1)`, `B = 2*c2 + (same)` (a negative green, as in deep high-ISO shadows, counts as 0).
|
||||
- Every code is clipped to 0..4095. Per 2x2 cell: R (0,0), G1 (0,1), G2 (1,0), B (1,1).
|
||||
|
||||
### Output range (companding table)
|
||||
### Output range (companding curve)
|
||||
|
||||
- Codes map through one monotone table shared by all files: identity up to code 1427, then a smooth curve reaching 39002 at code 4095 (steps grow from 1 to 58). No closed form fits within +-22, so `arw6_curve.rs` embeds the table (2668 `u16` values from code 1428). It is not stored in the file.
|
||||
- Provenance: the table was read off the black-box oracle's (LibRaw, below) output over the 8 Compressed / HQ files; every code from 1027 to 4095 occurred and no two files disagreed. It is therefore a measurement of that program's output, not an independent derivation.
|
||||
- Unit: 2 x 14-bit DN. The decoder reports black = 2 x 512 = 1024 and white = 2 x the file's DNG `WhiteLevel` (16383), i.e. 32766; saturated highlights sit at code 4095 = 39002, above white, and clip as usual. If a file carries no usable white level, the white is 32766 (2 x 16383, the table's knot below), not a data-derived value.
|
||||
- The table has one knot: at code 3977 it runs 32679 -> 32766 -> 32777 (steps +87 then +11), the same in every file. 32766 = 2 x 16383 is exactly the reported white level, so the knot is the white point of the measured curve (inferred from the arithmetic, not from any documentation): codes 3978..4095 sit above white and clip.
|
||||
Codes map through one monotone curve, the same for every file and both modes. It is not stored in the file (below); it is our own measurement. Output values are in 2 x 14-bit DN: black 2 x 512 = 1024, the 14-bit white 16383 maps to 32766.
|
||||
|
||||
- The curve is piecewise linear through knots (c_k, u_k), k = 0..306: u_k = 128 k (one knot per 64 DN of the 14-bit scale); c_k = u_k for k <= 11 (the identity through code 1408); c_k = 356.89 + 655.646 ln(k - 6) for k >= 12 (that is, c = -2824.32 + 655.646 ln(u - 768)). F(code) is the linear interpolation of u over c, rounded half up (floor(x + 0.5)). Values: F(1408) = 1408, F(1536) = 1542, F(2048) = 2457, F(3000) = 7979, F(3500) = 16227, F(3977) = 32767, F(4095) = 39077.
|
||||
- `arw6_curve.rs` builds the 4096-entry table from the formula at first use; a unit test pins the whole table (its sum and position-weighted sum), so a platform whose `ln` rounds differently fails it.
|
||||
- The decoder reports black 1024 and white = 2 x the file's DNG `WhiteLevel` (16383), i.e. 32766; a file without a usable white level gets 32766 too (2 x 16383), not a data-derived value. Codes above 3977 sit above white and clip as usual.
|
||||
|
||||
#### How it was measured
|
||||
|
||||
Each of the four scenes of the CC0 set (APS-C and full frame, landscape and portrait) has a lossless (LJ92) file and a Compressed and an HQ file, shot handheld one after another. Seven Compressed / HQ files share shutter, aperture and ISO with their lossless sibling. The eighth, APSC_land RAW-C (1/500 s against 1/1000 s), was left out: its brightness ratio to the lossless file is 1.37 rather than 2 and drifts with level, so the light changed between the shots.
|
||||
|
||||
- Data: the ARW6 12-bit codes from LightCraft's decoder with the curve replaced by the identity, and the lossless 14-bit DN from LightCraft's LJ92 path. Both modes share the sensor origin (their crop tags are equal); the lossless frame is the ARW6 frame padded with zeros at the right and bottom.
|
||||
- Registration: the handheld shifts are large (median 3 to 102 green cells). Patches were registered locally on the green planes with a curve-independent rank transform, normalised cross-correlation and a neighbour-consistency filter.
|
||||
- Two estimators per pair and CFA channel, each capture with its own gain and offset (the gains' geometric mean fixed to 1, the offsets' mean to 0):
|
||||
- quantile (CDF) matching over all overlapping pixels: for each code, the mean lossless value over the slice of the distribution the code occupies (precise, slightly smoothed by compression noise);
|
||||
- block pairs: smooth 8 x 8-cell blocks (16 x 16 sensor pixels) away from clipping, a model linear in F, fitted robustly (unbiased).
|
||||
- Fitting c = C + A ln(u - B) through the knots gives A 655.88, B 766.9, C -2826.5 on the blocks and A 653.47, B 770.1 on the quantile curves. Holding B at 768 changes the curve by at most 0.08 %; the formula above (A 655.646, C -2824.32) uses it.
|
||||
|
||||
Uncertainty: 95 % intervals of a cluster bootstrap over the 7 captures (40 replicates), as a share of F - 1024 and in codes, and the largest deviation of any subset or method fit (Compressed only, HQ only, greens, red + blue, APS-C, full frame, quantile method):
|
||||
|
||||
| Codes | Bootstrap 95 % | In codes | Largest subset / method deviation |
|
||||
|---|---|---|---|
|
||||
| 1408-1536 | -0.42..+0.35 % | -1.6..+2.0 | 0.75 % |
|
||||
| 1536-2048 | -0.65..+0.58 % | -3.0..+2.8 | 0.80 % |
|
||||
| 2048-2560 | -0.55..+0.57 % | -3.1..+3.3 | 0.78 % |
|
||||
| 2560-3072 | -0.59..+0.50 % | -3.1..+3.7 | 0.64 % |
|
||||
| 3072-3584 | -0.76..+0.54 % | -3.5..+4.9 | 0.77 % (quantile) |
|
||||
| 3584-3840 | -0.84..+0.57 % | -3.7..+5.5 | 0.90 % (quantile) |
|
||||
| 3840-3977 | -0.88..+0.59 % | -3.8..+5.8 | 0.97 % (quantile) |
|
||||
| 3977-4095 | -0.91..+0.62 % | -4.0..+5.9 | 1.03 %, extrapolated |
|
||||
|
||||
The lossless files clip at the 14-bit white, so codes above about 3977 rest on the formula alone. The camera's exact integer table can't be recovered: integer knot codes, the encoder's rounding and a few codes around the knee are below the measurement's resolution.
|
||||
|
||||
#### Evidence for the structure
|
||||
|
||||
- Knots every 128 u: the measured slope dF/dc is flat within segments and jumps at codes 1531, 1632, 1719, 1796, 1865, 1928, 1984, 2037, 2085…, where u = 1536, 1664, 1792…. On codes 1380-2200 a spacing of 128 leaves 0.021 RMS relative slope error; the next best, 126, 64 and a smooth log, leave 0.037, 0.041 and 0.068. Above code 2200 the segments are too short to resolve, but there the piecewise-linear and smooth forms differ by less than 1.
|
||||
- Log spacing: the measured knot codes follow c = C + A ln(u - B) with chi-squared per degree of freedom 0.90 (bootstrap 95 %: A 654.3-658.2, B 762.8-771.1).
|
||||
- The knee: the log branch at u = 1408 gives code 1413 (95 % 1410-1415), so the identity runs through knot 11 and the log knots start at k = 12 (segment slope 1.035 between them). Starting them at k = 11 fits as well but would need a slope below 1 right after the identity; a smooth log leaving the identity near code 1340 fits the blocks clearly worse (cost 25.4 against 22.9).
|
||||
- One curve for everything: Compressed and HQ, all four CFA channels, APS-C and full frame agree within 0.8 %, and the ratio is flat with frame radius to +-0.5 % (no gain map).
|
||||
|
||||
#### Scale
|
||||
|
||||
The x2 unit is measured, not assumed:
|
||||
|
||||
- Below the knee F(c) = c: the measured slope is 1.000 +- 0.01 for codes 1150-1408, with offsets within +-2.
|
||||
- The overall level is fixed by the captures' average exposure to +-0.4 % (per-capture gains 0.99-1.02). Independently, flat clipped areas of the Compressed files sit at code 3977 +- 1 in all four scenes, and the formula, not fitted to that, puts the 14-bit white (32766) at code 3977.0 (bootstrap 95 % 3973-3983).
|
||||
- HQ files carry data above the 14-bit clip: their clipped highlights sit at codes 3996-4095 depending on the scene (about 16.8k-19.5k DN), so the curve keeps its values above 32766. The reported white level is unaffected.
|
||||
|
||||
#### Not stored in the file
|
||||
|
||||
Every IFD of all 12 files was dumped and compared across modes:
|
||||
|
||||
- Raw SubIFD: `0x7010` (SonyToneCurve) and `0x7011` are zero. The monotone arrays `0x7032`, `0x7035` and `0x7037` are lens corrections, the same in every mode. The only mode-dependent tag is `0x7000` SonyRawFileType (4 against 6).
|
||||
- Maker note (`0x9050`, `0x94xx`, deciphered): the Compressed and HQ bytes differ from the lossless ones only in 1-2 bytes (the quality setting), and hold no curve-shaped monotone run.
|
||||
- SR2SubIFD (encrypted, 42478 bytes): every file uses the same keystream, so XOR-ing two files compares their plaintexts. The lossless and HQ files of a scene differ in only 34 bytes, so there is no ARW6-only region. A curve stored identically in every mode can't be ruled out, but none is known there. `0x7250` likewise has no mode-specific region.
|
||||
- The bytes after the tile table (480 on APS-C, 408 on full frame; the last 120 high-entropy) are identical in the Compressed and HQ files of a scene, even at different exposure, and differ between scenes: not a curve.
|
||||
|
||||
#### Verification against the oracle
|
||||
|
||||
After the derivation was frozen, the derived table was compared with the black-box oracle's output curve (below), as a check only, with no tuning. They are identical through code 1422 (both are the identity through 1408), then within -1.0 % to +0.25 % of (value - black); the largest difference is 75 (0.2 %) at code 4093. Ours minus the oracle's: -5..+1 for codes 1408-1536, -13..-2 for 1536-2048, -33..-12 for 2048-3072, -34..+40 for 3072-3977, +1..+75 for 3977-4095.
|
||||
|
||||
## Verification
|
||||
|
||||
Method: LibRaw master (commit `d1f0dd95`, 2026-10-08, run as `unprocessed_raw`, 16-bit output before any processing) was used only as a black-box oracle: it was built and run, and its source was never read. A Python reference model of the format (the Phase 0 reference model, local, not in the repo) was written from RDD 34 and from the oracle's behaviour on real and synthetic input, then reproduced the oracle exactly on every tile of the 8 Compressed / HQ files below. A test-only encoder, validated byte for byte against real tiles, probed the oracle with synthetic coefficients (dequantiser, phases, edge mapping). The Rust decoder reproduces the Phase 0 reference sums on all 8 files.
|
||||
Method: LibRaw master (commit `d1f0dd95`, 2026-10-08, run as `unprocessed_raw`, 16-bit output before any processing) was used only as a black-box oracle: it was built and run, and its source was never read. A Python reference model of the format (the Phase 0 reference model, local, not in the repo) was written from RDD 34 and from the oracle's behaviour on real and synthetic input, then reproduced the oracle exactly on every tile of the 8 Compressed / HQ files below. A test-only encoder, validated byte for byte against real tiles, probed the oracle with synthetic coefficients (dequantiser, phases, edge mapping). The Rust decoder reproduced the Phase 0 reference sums on all 8 files. Its output then went through a table read off the oracle's output; that table was strictly increasing, so these exact matches prove the 12-bit codes before the curve identical to the oracle's. The table has since been replaced by our own measured curve (*Output range*), so the output values now differ from the oracle's by the amounts in *Verification against the oracle*.
|
||||
|
||||
Geometry was checked against each file's embedded full-resolution JPEG at the DefaultCropOrigin: our output aligns at offset 0 on full frame and APS-C.
|
||||
|
||||
### LibRaw's APS-C bug
|
||||
|
||||
LibRaw assumes the full-frame grid (s = 0) for every tile. On the APS-C crop that drops the first three plane rows, leaves the last three unfed, and shifts its whole output up by 6 sensor rows; its first rows and last rows are also wrong. Our decoder differs from LibRaw there on purpose. To compare against LibRaw on APS-C files, our row y+6 equals LibRaw's row y for 12 <= y < h - 24 (LibRaw's rows 0-11 and the last 18 rows of the shifted overlap differ); on full frame compare directly, the whole frame is exact.
|
||||
LibRaw assumes the full-frame grid (s = 0) for every tile. On the APS-C crop that drops the first three plane rows, leaves the last three unfed, and shifts its whole output up by 6 sensor rows; its first rows and last rows are also wrong. Our decoder differs from LibRaw there on purpose. To compare against LibRaw on APS-C files, our row y+6 equals LibRaw's row y for 12 <= y < h - 24 (LibRaw's rows 0-11 and the last 18 rows of the shifted overlap differ); on full frame compare directly: the 12-bit codes match over the whole frame.
|
||||
|
||||
### Corpus
|
||||
|
||||
@@ -74,9 +129,9 @@ LibRaw assumes the full-frame grid (s = 0) for every tile. On the APS-C crop tha
|
||||
|
||||
These 12 files are CC0 1.0. RawDB's record of the set, <https://rawdb.dnglab.org/api/sets/Sony/ILCE-7RM6> (the data behind <https://rawdb.dnglab.org/sets/Sony/ILCE-7RM6>, accessed 2026-10-10), says `"license":"CC0 1.0"` for the set (uploaded by abbradar, 2026-08-29) and again for each of the 12 files, next to the SHA-256 values in the table.
|
||||
|
||||
They live in the gitignored corpus. `cargo xtask corpus --download` fetches two of them, one per geometry and compression mode (full frame Compressed, APS-C HQ), and checks each against its SHA-256, pinned in `RAW_SAMPLES` (`xtask/src/main.rs`). Fetch the other ten by hand: the server answers 303 to a signed object URL, so `curl -L -o corpus/raw/<file> https://rawdb.dnglab.org/api/download/Sony/ILCE-7RM6/<source path>`, then compare with the SHA-256 above. `cargo test -p lightcraft-raw corpus_sony -- --nocapture` checks the decoder's sensor sum and position-weighted sum of the two pinned files against the Phase 0 reference sums and skips absent files.
|
||||
They live in the gitignored corpus. `cargo xtask corpus --download` fetches two of them, one per geometry and compression mode (full frame Compressed, APS-C HQ), and checks each against its SHA-256, pinned in `RAW_SAMPLES` (`xtask/src/main.rs`). Fetch the other ten by hand: the server answers 303 to a signed object URL, so `curl -L -o corpus/raw/<file> https://rawdb.dnglab.org/api/download/Sony/ILCE-7RM6/<source path>`, then compare with the SHA-256 above. `cargo test -p lightcraft-raw corpus_sony -- --nocapture` checks the decoder's sensor sum and position-weighted sum of the two pinned files and skips absent files. The sums are regression values from LightCraft's decoder with the derived curve; the 12-bit codes behind them were verified against the oracle in Phase 0.
|
||||
|
||||
Nine further full-frame HQ photos from the maintainer's A7R VI were compared with the oracle locally; they are private and never committed or published. All 9 private FF photos (ISO 100-12800, incl. two near-black night shots) decode bit-exact over the full frame (0 mismatching pixels of 66.8 MP each).
|
||||
Nine further full-frame HQ photos from the maintainer's A7R VI were compared with the oracle locally; they are private and never committed or published. On all 9 (ISO 100-12800, incl. two near-black night shots) the 12-bit codes matched the oracle over the full frame (0 mismatching pixels of 66.8 MP each).
|
||||
|
||||
Unconditional synthetic tests (encode -> decode round trips for both geometries, the RDD 34 worked example, the dequantiser, hostile and truncated input) run without the corpus.
|
||||
|
||||
@@ -84,16 +139,15 @@ Unconditional synthetic tests (encode -> decode round trips for both geometries,
|
||||
|
||||
| Coverage | Status |
|
||||
|---|---|
|
||||
| ILCE-7RM6 Compressed and HQ, full frame, landscape and portrait | 4 files, exact against the reference sums |
|
||||
| ILCE-7RM6 Compressed and HQ, APS-C crop, landscape and portrait | 4 files, exact against the reference sums (interior-exact against LibRaw after the 6-row shift; LibRaw's own edge rows differ) |
|
||||
| ILCE-7RM6 Compressed and HQ, full frame, landscape and portrait | 4 files, 12-bit codes exact against the oracle; output through our measured curve |
|
||||
| ILCE-7RM6 Compressed and HQ, APS-C crop, landscape and portrait | 4 files, 12-bit codes exact against the Phase 0 model (interior-exact against LibRaw after the 6-row shift; LibRaw's own edge rows differ) |
|
||||
| ILCE-7RM6 lossless (existing LJ92 path) | 4 files decode; not in the corpus test |
|
||||
| Private A7R VI HQ photos | 9 files, bit-exact over the full frame against the oracle (local) |
|
||||
| Private A7R VI HQ photos | 9 files, 12-bit codes exact over the full frame against the oracle (local) |
|
||||
|
||||
## Not covered
|
||||
|
||||
- The 12-bit Compressed mode (electronic shutter with continuous drive): no sample exists, so it returns `Unsupported` unless its headers prove identical.
|
||||
- The ILCE-7M5: same codec, no sample; unverified.
|
||||
- The x2 scale is an assumption backed by shadow-floor evidence (the darkest pixels of all eight ISO 100 files sit at 1037..1059, just above 2 x 512, and the lossless sibling's shadows match at x2; x2.38 would put them 76 DN below black). A tripod-matched lossless / compressed pair would confirm it. If wrong, only the reported black and white levels change.
|
||||
- Tiles whose plane width is not a multiple of 8.
|
||||
- First-half shifts other than 0 and 3 (other crops / bodies): the geometry is generic and round-trip tested, but no real sample exists.
|
||||
- Memory: one FF decode peaks at about 896 MB RSS (about 6.7 x the 134 MB output; the lossless path peaks at 249 MB). Follow-ups: dequantise straight into bands, place tiles as they arrive.
|
||||
@@ -102,9 +156,9 @@ Unconditional synthetic tests (encode -> decode round trips for both geometries,
|
||||
## Sources
|
||||
|
||||
- SMPTE RDD 34:2015 "LLVC (Low Latency Video Codec) for Network Transfer", <https://pub.smpte.org/latest/rdd34/rdd34-2015.pdf> (accessed 2026-10-09): picture / TU structure, VLD, inverse quantisation, 5/3 lifting with symmetric extension.
|
||||
- LibRaw master `d1f0dd95`, run only as a black-box oracle (not a product, test or build dependency).
|
||||
- LibRaw master `d1f0dd95`, run only as a black-box oracle (not a product, test or build dependency) for the 12-bit codes; the companding curve was measured without it and compared with it only afterwards.
|
||||
- The embedded JPEG of each file, for the geometry check.
|
||||
- Not read, by licence: LibRaw, rawspeed, dnglab, RawTherapee and other ARW6 decoder sources. Exact byte layouts, deviations, geometry and the table were established through sample analysis and black-box comparison.
|
||||
- Not read, by licence: LibRaw, rawspeed, dnglab, RawTherapee and other ARW6 decoder sources. Exact byte layouts, deviations and geometry were established through sample analysis and black-box comparison; the curve was measured from the CC0 lossless / ARW6 pairs.
|
||||
|
||||
## Timings
|
||||
|
||||
|
||||
@@ -80,8 +80,8 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts).
|
||||
| LR-IMP-PROFILES | Import profiles & presets | P1 | ✅ | `cmd:file.importPresets`, `cmd:preset.import`, `cmd:profile.import`, `crates/engine/src/preset_import.rs`, `crates/engine/src/preset_luminar.rs` | presets: .lcpreset, XMP, classic .lrtemplate, photos carrying edits ("DNG presets"), Luminar looks (.lmp, .mplumpack collections; sliders with a counterpart), .zip bundles, folders (folder → group), drag & drop; masks carried over; unmapped settings reported (fields that only describe the preset or photo, e.g. `Cluster`, `SortName`, `SupportsAmount2`, the as-shot white, empty Point Color slots, are not); profiles: .cube 3D LUTs; Adobe profile formats deliberately unsupported |
|
||||
| LR-IMP-LOCAL | Work on files in place | P0 | ✅ | `cmd:library.browse`, `cmd:photo.addToLibrary`, `cmd:library.import` (mode add), `cmd:local.addRoot`, `cmd:local.hide`, `cmd:local.restoreHidden`, `crates/engine/src/cmd/browse.rs`, `crates/ui-egui/src/panels/left.rs` (`local_section`), `crates/ui-egui/src/panels/grid.rs` (`folder_header`) | Local: browse Pictures / Desktop / Downloads / Home or any folder without adding it (breadcrumb, Include subfolders, Add N to My Photos); browsed photos stay out of All Photos, albums and counts; folders picked with Browse Folder… (or Keep in Local / Add to Local on a folder row) stay listed across restarts, and browsing a folder inside a listed one highlights it inside that tree (opened down to it, siblings reachable) instead of adding a root; edits go to XMP sidecars; importing promotes them; right-click a top-level location → Remove from Local hides the shortcut only (nothing on disk or in the catalog changes), saved with the UI state, and “Show N hidden locations” (or Browse Folder… on it) brings it back; a folder is one location however its path is spelled (`/` or `\`, trailing separator, `.`/`..`, drive-letter case; `folder_key` in `crates/catalog/src/query.rs`); browsed photos nobody changed are forgotten once their folder has not been browsed for 30 days (Settings → Performance → Local folders, 0 = never; checked when the library opens, or `cmd:library.forgetLocal` with `dryRun`; files and sidecars stay, browsing again brings them back; see `crates/catalog/src/local.rs` for what counts as a change) |
|
||||
| LR-IMP-SIDECAR-SPLIT | Separate XMP sidecar variants | P2 | ⬜ | `cmd:library.xmpPreferences` | sidecar naming option exists (stem/full), no split sidecars |
|
||||
| LR-IMP-FORMATS | Supported formats | P0 | 🟡 | `crates/codecs/src/lib.rs`, `crates/raw/src/lib.rs`, `crates/raw/src/jxl.rs` | JPEG, PNG, TIFF (1- to 64-bit integer, 16- to 64-bit float, incl. bilevel and CCITT fax), WebP, JXL, PSD, GIF, BMP; DNG (incl. lossy / Smart Preview DNG and DNG 1.7 JPEG XL tiles/strips: lossless ones decode bit-exactly on synthetic CFA and LinearRaw files, lossy ones are restored to the declared linear primaries without clipping or gamut mapping, checked on one real file with 108 lossy tiles, and any tile that fails to decode makes the file preview-only; DNG 1.7 row/column-interleaved rasters (`RowInterleaveFactor` / `ColumnInterleaveFactor`) are undone before the mosaic is read, so a file from Adobe's converter with a 2×2 interleave no longer decodes as four scaled-down copies in the wrong colours; a dimension the factor does not divide decodes with short trailing fields; verified on 4 real ILCE-6400 JPEG XL DNGs rendering bit-identical to their non-interleaved twins, factors above 2 rest on the plain reading of the tag; a single-chunk JPEG XL preview IFD is offered as the embedded preview; a DNG whose samples pile up at one value well below its stated `WhiteLevel`, as a camera app's 12-bit Bayer DNG that states 4095 and clips at 3567, has those samples raised to the white level on decode, so highlight reconstruction sees the clipped areas instead of white balance tinting them magenta, issue #548, `crates/raw/src/saturation.rs`), CR2 (colour-filter layout from the file's `CR2CFAPattern` tag, issue #85), ARW (pre-2017 bodies: white balance and black level from the encrypted `SR2SubIFD`, issue #148, its `WB_RGGBLevels` being the white balance the camera applied, issue #535; the DSLR-A900's packed 12-bit strip, two pixels per three bytes, read only when the strip is exactly 1.5 bytes per pixel, with its camera-JPEG window centred, checked on one CC0 file (A850 unmeasured); downsized Sony lossless YCbCr 4:2:0 / 4:2:2 tiles decoded to linear RGB, verified on private ILCE-7M4 3:2 & 4:3 examples including 16-bit full-resolution export; Sony DSC-R1 .SR2 decodes, its big-endian 16-bit words read in the order that fits the sample range, checked on the CC0 3221 sample; its crop and white balance live in the SR2SubIFD and are not read yet; ARW6 Compressed / Compressed (HQ) of the ILCE-7RM6 (`crates/raw/src/vendor/arw6.rs`, `crates/raw/src/llvc.rs`, FF files bit-exact over the full frame, APS-C files interior-exact (LibRaw's own edge rows differ); 8 CC0 files checked against a black-box oracle and the Phase 0 reference sums, geometry checked against the camera JPEG, `docs/arw6-compression.md`; the ILCE-7M5 writes the same codec, unverified)), NEF (uncompressed, lossless and lossy compressed 12/14-bit, `crates/raw/src/vendor/nefc.rs`), RAF (uncompressed, lossless/lossy compressed Bayer and X-Trans; `crates/raw/src/vendor/rafc.rs`, full sensor verification on 13 bodies, `docs/raf-compression.md`), RW2 / Leica RWL / Panasonic RAW in every raw format (compressed 4 and 6, the prefix-coded strips of format 8 from the GH6 on, packed 2/5/7, the 16-bit words of the 2005–2007 bodies; black levels, in-camera aspect crops and mapped-out defect pixels; 178 CC0 files from 118 bodies checked, `crates/raw/src/vendor/rw2.rs`), PEF, ORF (uncompressed; colour-filter layout from the file's Exif `CFAPattern`; 12.8 bit/px 16-byte blocks of ten 12-bit samples + a zero pad byte, E-300 / E-330 / E-500 verified on CC0 files, E-M5 Mark II / PEN-F high-res files decode smooth but CFA and black unverified), Hasselblad 3FR and FFF (a TIFF without a DNG version tag that describes its CFA IFD, levels, crop and white balance with DNG's tags; `RawFormat::CfaTiff`, read by `dng::decode_as`, RGGB when the file states no `CFAPattern`): uncompressed (X1D, X1D II, X2D, CFV 100C) and Hasselblad's lossless JPEG with scan selection value 8 (every FFF; H3D, H4D and CFV-50c 3FR), `ljpeg::decode_hasselblad`, its rule measured on 14 CC0 files with the ljpeg-explorer tool, Samsung SRW without compression (NX5, NX10, NX11 and the NX20-generation bodies NX20, NX200, NX210, NX1000 and NX1100 as 12-bit packed samples in either bit order, EX1 and WB2000 as 16-bit words; layout, camera-JPEG framing, levels and white balance from the maker note, `crates/raw/src/vendor/srw.rs`; median ΔE vs the camera JPEG 2.2–7.6 on 11 of the 12 files from 10 bodies checked, 10.7 (5.7 registered) on the backlit WB2000 sample). 12-bit NEF black level: maker note `0x003d` is in 14-bit units (D750, D780, D850, D7500, Z 50 checked). Lossy type 2 NEF curves of version `0x44 0x40` (D780, D6, Z 5, Z 6, Z 7, Z 7_2) span a quarter of the sample range, read from the table's own point spacing. CR3 lossless CRX Bayer and version 0x100/0x200 C-RAW decodes to sensor pixels with timed white balance, black/white levels and file crop (the shot's aspect ratio from the maker note's `AspectInfo`); full sensor samples match the reference on M50/R100/R8 (`crates/raw/tests/crLine truncated
|
||||
| LR-IMP-CAMERA-COVERAGE | Camera coverage, verified per model | P0 | 🟡 | `crates/raw/tests/corpus.rs`, `xtask/src/main.rs` | a supported container is not the same as every camera that writes it decoding correctly: ~55 CC0 corpus files plus 6 exact-sensor CR3 cases (plus ~60 NEFs checked by hand and 178 Panasonic / Leica RW2, RWL and RAW files from 118 bodies, checked against each file's own JPEG) against the >1,000 models Lightroom lists; per-model differences still surface (e.g. the CR2 colour-filter layout differed by model until it was read from the file's own tag, issue #85, checked on 35 CR2 bodies; CR2 black levels were read from border columns light already reaches, left of `SensorInfo`'s border, so CR2s rendered dark with crushed shadows (EOS 6D: 2591 instead of 2047), now measured from the masked columns only, checked on 8 corpus bodies; pre-2017 Sony ARWs opened green until their scrambled white balance / black level were read, issue #148, checked on 16 ARWs from 15 Sony bodies; their white balance now comes from the encrypted `SR2SubIFD`'s `WB_RGGBLevels`, the gains the camera applied, which 14 bodies (DSLR-A450 … A700, NEX-3/5/C3, SLT-A33/A35/A55, ILCE-6001, UMC-R10C) had no other source for and which the maker-note estimate read before missed by up to 100 % on preset shots, issue #535, checked against ExifTool on 100 decoded ARWs from 87 Sony bodies; the encrypted SR2 black level is now read from its directory entry (the DSLR-A450/A500/A550/A700 read 354–975 instead of 512), checked on 126 ARWs from 97 Sony bodies, and downsized lossless M/S ARWs use their measured black level 1024 instead of 512, checked on 12 files from 4 bodies, issue #535; pre-2017 Sony bodies shot in the camera's 16:9 mode (ILCE-7SM2, DSLR-A580) now get the 16:9 crop of their camera JPEG instead of the whole 3:2 frame with padding columns, issue #535; Canon PowerShot and EOS M CR2s whose `ColorData` is stored as bytes opened green until the bytes were read as 16-bit words, 25 files from 25 bodies checked). Compressed RAF sensor arrays verified on 13 Fujifilm bodies (`docs/raf-compression.md`). ILCE-7RM6 ARW6 sensor arrays verified on 8 CC0 files (FF and APS-C, both compression modes). Sony ILCE-7CR (61 MP): lossless compressed L and M and compressed ARW2 samples of one scene in the corpus (black level, default crop, as-shot gains, lossless vs compressed mosaic agreement, fitted camera look), and all nine public codings (also uncompressed, small and APS-C crop) decode and fit. Grow the CC0 corpus per model and test each sample decodes with plausible colour. Nikon CropArea and untagged-preview colour-space regression tests; private Z 8 crop verified. |
|
||||
| LR-IMP-FORMATS | Supported formats | P0 | 🟡 | `crates/codecs/src/lib.rs`, `crates/raw/src/lib.rs`, `crates/raw/src/jxl.rs` | JPEG, PNG, TIFF (1- to 64-bit integer, 16- to 64-bit float, incl. bilevel and CCITT fax), WebP, JXL, PSD, GIF, BMP; DNG (incl. lossy / Smart Preview DNG and DNG 1.7 JPEG XL tiles/strips: lossless ones decode bit-exactly on synthetic CFA and LinearRaw files, lossy ones are restored to the declared linear primaries without clipping or gamut mapping, checked on one real file with 108 lossy tiles, and any tile that fails to decode makes the file preview-only; DNG 1.7 row/column-interleaved rasters (`RowInterleaveFactor` / `ColumnInterleaveFactor`) are undone before the mosaic is read, so a file from Adobe's converter with a 2×2 interleave no longer decodes as four scaled-down copies in the wrong colours; a dimension the factor does not divide decodes with short trailing fields; verified on 4 real ILCE-6400 JPEG XL DNGs rendering bit-identical to their non-interleaved twins, factors above 2 rest on the plain reading of the tag; a single-chunk JPEG XL preview IFD is offered as the embedded preview; a DNG whose samples pile up at one value well below its stated `WhiteLevel`, as a camera app's 12-bit Bayer DNG that states 4095 and clips at 3567, has those samples raised to the white level on decode, so highlight reconstruction sees the clipped areas instead of white balance tinting them magenta, issue #548, `crates/raw/src/saturation.rs`), CR2 (colour-filter layout from the file's `CR2CFAPattern` tag, issue #85), ARW (pre-2017 bodies: white balance and black level from the encrypted `SR2SubIFD`, issue #148, its `WB_RGGBLevels` being the white balance the camera applied, issue #535; the DSLR-A900's packed 12-bit strip, two pixels per three bytes, read only when the strip is exactly 1.5 bytes per pixel, with its camera-JPEG window centred, checked on one CC0 file (A850 unmeasured); downsized Sony lossless YCbCr 4:2:0 / 4:2:2 tiles decoded to linear RGB, verified on private ILCE-7M4 3:2 & 4:3 examples including 16-bit full-resolution export; Sony DSC-R1 .SR2 decodes, its big-endian 16-bit words read in the order that fits the sample range, checked on the CC0 3221 sample; its crop and white balance live in the SR2SubIFD and are not read yet; ARW6 Compressed / Compressed (HQ) of the ILCE-7RM6 (`crates/raw/src/vendor/arw6.rs`, `crates/raw/src/llvc.rs`; 12-bit codes exact against a black-box oracle on 8 CC0 files, FF over the full frame, APS-C in the interior (LibRaw's own edge rows differ); output through our own companding curve, measured from CC0 lossless / ARW6 pairs; geometry checked against the camera JPEG, `docs/arw6-compression.md`; the ILCE-7M5 writes the same codec, unverified)), NEF (uncompressed, lossless and lossy compressed 12/14-bit, `crates/raw/src/vendor/nefc.rs`), RAF (uncompressed, lossless/lossy compressed Bayer and X-Trans; `crates/raw/src/vendor/rafc.rs`, full sensor verification on 13 bodies, `docs/raf-compression.md`), RW2 / Leica RWL / Panasonic RAW in every raw format (compressed 4 and 6, the prefix-coded strips of format 8 from the GH6 on, packed 2/5/7, the 16-bit words of the 2005–2007 bodies; black levels, in-camera aspect crops and mapped-out defect pixels; 178 CC0 files from 118 bodies checked, `crates/raw/src/vendor/rw2.rs`), PEF, ORF (uncompressed; colour-filter layout from the file's Exif `CFAPattern`; 12.8 bit/px 16-byte blocks of ten 12-bit samples + a zero pad byte, E-300 / E-330 / E-500 verified on CC0 files, E-M5 Mark II / PEN-F high-res files decode smooth but CFA and black unverified), Hasselblad 3FR and FFF (a TIFF without a DNG version tag that describes its CFA IFD, levels, crop and white balance with DNG's tags; `RawFormat::CfaTiff`, read by `dng::decode_as`, RGGB when the file states no `CFAPattern`): uncompressed (X1D, X1D II, X2D, CFV 100C) and Hasselblad's lossless JPEG with scan selection value 8 (every FFF; H3D, H4D and CFV-50c 3FR), `ljpeg::decode_hasselblad`, its rule measured on 14 CC0 files with the ljpeg-explorer tool, Samsung SRW without compression (NX5, NX10, NX11 and the NX20-generation bodies NX20, NX200, NX210, NX1000 and NX1100 as 12-bit packed samples in either bit order, EX1 and WB2000 as 16-bit words; layout, camera-JPEG framing, levels and white balance from the maker note, `crates/raw/src/vendor/srw.rs`; median ΔE vs the camera JPEG 2.2–7.6 on 11 of the 12 files from 10 bodies checked, 10.7 (5.7 registered) on the backlit WB2000 sample). 12-bit NEF black level: maker note `0x003d` is in 14-bit units (D750, D780, D850, D7500, Z 50 checked). Lossy type 2 NEF curves of version `0x44 0x40` (D780, D6, Z 5, Z 6, Z 7, Z 7_2) span a quarter of the sample range, read from the table's own point spacing. CR3 lossless CRX Bayer and version 0x100/0x200 C-RAW decodes to sensor pixels with timed white balance, black/white levels and file crop (the shot's aspect ratio from the maker note's `AspectInfo`); full sensor samples match the reLine truncated
|
||||
| LR-IMP-CAMERA-COVERAGE | Camera coverage, verified per model | P0 | 🟡 | `crates/raw/tests/corpus.rs`, `xtask/src/main.rs` | a supported container is not the same as every camera that writes it decoding correctly: ~55 CC0 corpus files plus 6 exact-sensor CR3 cases (plus ~60 NEFs checked by hand and 178 Panasonic / Leica RW2, RWL and RAW files from 118 bodies, checked against each file's own JPEG) against the >1,000 models Lightroom lists; per-model differences still surface (e.g. the CR2 colour-filter layout differed by model until it was read from the file's own tag, issue #85, checked on 35 CR2 bodies; CR2 black levels were read from border columns light already reaches, left of `SensorInfo`'s border, so CR2s rendered dark with crushed shadows (EOS 6D: 2591 instead of 2047), now measured from the masked columns only, checked on 8 corpus bodies; pre-2017 Sony ARWs opened green until their scrambled white balance / black level were read, issue #148, checked on 16 ARWs from 15 Sony bodies; their white balance now comes from the encrypted `SR2SubIFD`'s `WB_RGGBLevels`, the gains the camera applied, which 14 bodies (DSLR-A450 … A700, NEX-3/5/C3, SLT-A33/A35/A55, ILCE-6001, UMC-R10C) had no other source for and which the maker-note estimate read before missed by up to 100 % on preset shots, issue #535, checked against ExifTool on 100 decoded ARWs from 87 Sony bodies; the encrypted SR2 black level is now read from its directory entry (the DSLR-A450/A500/A550/A700 read 354–975 instead of 512), checked on 126 ARWs from 97 Sony bodies, and downsized lossless M/S ARWs use their measured black level 1024 instead of 512, checked on 12 files from 4 bodies, issue #535; pre-2017 Sony bodies shot in the camera's 16:9 mode (ILCE-7SM2, DSLR-A580) now get the 16:9 crop of their camera JPEG instead of the whole 3:2 frame with padding columns, issue #535; Canon PowerShot and EOS M CR2s whose `ColorData` is stored as bytes opened green until the bytes were read as 16-bit words, 25 files from 25 bodies checked). Compressed RAF sensor arrays verified on 13 Fujifilm bodies (`docs/raf-compression.md`). ILCE-7RM6 ARW6 12-bit codes verified on 8 CC0 files (FF and APS-C, both compression modes). Sony ILCE-7CR (61 MP): lossless compressed L and M and compressed ARW2 samples of one scene in the corpus (black level, default crop, as-shot gains, lossless vs compressed mosaic agreement, fitted camera look), and all nine public codings (also uncompressed, small and APS-C crop) decode and fit. Grow the CC0 corpus per model and test each sample decodes with plausible colour. Nikon CropArea and untagged-preview colour-space regression tests; private Z 8 crop verified. |
|
||||
| LR-IMP-CULL-AT-IMPORT | Culling analysis at import | P2 | 🟡 | `cmd:photo.analyze` | run Assisted Culling on the imported photos (they're selected after an import); not automatic |
|
||||
| LR-IMP-MOVE | Move on import [Classic] | P1 | ✅ | `cmd:library.import` (`mode` move), `crates/engine/src/import_move.rs`, `crates/engine/src/tests_import_move.rs`, `crates/ui-egui/src/import.rs` | Transfer ▸ Move with Copy's destination, folders (day / month / one folder / custom template), rename template and example destination; XMP sidecars (both namings) move along; each source is removed only after its destination is written (hard link on the same volume, else copied, synced and compared byte for byte) and its catalog record is saved; failed, duplicate, unchecked files keep their sources, taken names get -1, -2…, never overwritten; files already in the destination/library are added in place; sources that can't be removed (read-only card) are kept and reported (`kept`). Undo removes the photos from the library but leaves the moved files at the destination. No Copy as DNG while moving |
|
||||
| LR-IMP-DNG-CONVERT | Convert to DNG on import [Classic] | P2 | ✅ | `cmd:library.import` (`dng`), `crates/ui-egui/src/import.rs` | copy imports: Raw files ▸ Copy as DNG (lossless; the card is untouched); the raw copy is removed only once its DNG is verified and on disk (issue #106) |
|
||||
|
||||
Reference in new issue
Block a user