mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-25 03:53:53 +01:00
LR-IMP-FORMATS: pure-Rust clean-room compressed Olympus ORF bitstream decoder (#3775)
* LR-IMP-FORMATS: pure-Rust compressed Olympus ORF bitstream decoder * LR-IMP-FORMATS: address CodeRabbit review feedback on PR #3747 * orf: bound predictor arithmetic, bit widths, and stream consumption * orf: use unsigned magnitude abs_diff for predictor differences * docs: correct Olympus verified-body count in parity header * orf: saturating wbits derivation, widen pixel shift to i64 before clamp * docs: sync raw parity headline figures with coverage tables * docs: record clean-room provenance and report 58 newly unlocked bodies for compressed ORF * docs: note LibRaw derivation and pending clean-room reimplementation for compressed ORF * LR-IMP-FORMATS: pure-Rust clean-room compressed Olympus ORF bitstream decoder * LR-IMP-FORMATS: sync orfc path in parity docs and correct mainstream weighted depth sum * LR-IMP-FORMATS: address CodeRabbit review feedback on ORF gap and evidence sync * Convert Negative 1/4: lightcraft-film, the negative conversion maths from Film Lab (#2490) The film model, levels in density space, film presets, colour and tone of Film Lab's core (same author, MIT), without the PhotoCraft-only sharpening and JSON scanning, plus a whole-scan measurement (base, black and white points, neutral balance) a host stores with a photo's settings. A library with no caller yet. Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com> * LR-IMP-FORMATS: address CodeRabbit PR #3775 review (round 2) - orf.rs: scope sample-based bit-depth inference to Word16 branch only (from_word16 flag prevents heuristic from running on compressed ORF data) - orfc.rs: reject truncated compressed streams before allocating the frame (minimum 1 bit per pixel check) - orfc.rs: remove feedback_shift_644 == 15 special case (ordinary exponent) - ROADMAP/README/target-app-parity: fix '78 bodies' to '58 more bodies (2 verified)' — 78 is total Olympus+OM count, 58 were newly unlocked - target-app-parity: RAW readiness 80% -> 87%, recompute weighted sums - parity-checklist: refresh summary via cargo xtask parity --write Generated with Antigravity * LR-IMP-FORMATS: address CodeRabbit PR #3775 review (round 3) - target-app-parity: RAW camera decoding 85% -> 89% (559+721 of 1446) - target-app-parity: mainstream practitioner row lists ORF as per-model verification, not as unfinished decoder alongside CR3/HE NEF - log_writer: check_regular_directory_entry before truncate open (prevents symlink-following truncation of files outside the library) Generated with Antigravity * LR-IMP-FORMATS: regenerate parity summary after film crate merge cargo xtask parity --write: 83.2% of 543 in-scope rows (was 83.5%/532); sync target-app-parity.md checklist references to match. Generated with Antigravity --------- Co-authored-by: Yorgos S. <smyrgeorge@gmail.com> Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
This commit is contained in:
18 files changed
+757
-138
No files matched your search
@@ -350,7 +350,7 @@ LightCraft is young and moving fast: **alpha**. **Where we honestly stand** (det
|
||||
Fujifilm / Nikon / older-Canon raws on one machine; see [docs/raw-parity.md](docs/raw-parity.md) for your camera.
|
||||
- **The biggest gaps:**
|
||||
- **camera colour calibration:** Sony, Nikon, Panasonic, Fujifilm and Canon CR3 and CRW raws have guarded estimates from their camera JPEGs, with built-in Canon EOS D60, ILCA-99M2, ILCE-7CR, ILCE-7M4, ILCE-7RM5, X-H2S, X-T4, Nikon Z 6II, Z 8 and D5300 profiles; measured calibration covers one model so far (chart-measured matrices for the Canon EOS D60), and other raws or rejected fits retain a neutral matrix;
|
||||
- **compressed Olympus raws and unsupported CR3 variants:** these use embedded JPEG previews when present. Fujifilm lossless/lossy compressed RAF now decodes sensor data; [verification and existing-library reload instructions](docs/raf-compression.md);
|
||||
- **unsupported CR3 variants and Nikon High Efficiency NEFs:** these use embedded JPEG previews when present. Olympus compressed ORF now decodes sensor data on 58 more bodies (2 verified) ([docs/orf-compression.md](docs/orf-compression.md)); Fujifilm lossless/lossy compressed RAF now decodes sensor data; [verification and existing-library reload instructions](docs/raf-compression.md);
|
||||
- **AI quality and model setup:** Subject and Sky selection are classical heuristics; Object/Describe use an
|
||||
optional SAM 3 model. AI Denoise supports Bayer RAW with separately installed weights, while X-Trans and
|
||||
linear-RGB denoise and Super Resolution remain missing; see [AI masks](docs/ai-masks.md) and [AI Denoise](docs/denoise.md);
|
||||
@@ -370,7 +370,7 @@ LightCraft is young and moving fast: **alpha**. **Where we honestly stand** (det
|
||||
| Profiles (Color, Neutral, Vivid, Landscape, Portrait, Monochrome: our own looks), presets, versions, history, copy/paste/sync settings | ✅ |
|
||||
| Camera colour: DNG matrices, guarded camera-JPEG look fits and built-in profiles for selected cameras | 🚧 measured calibration and per-model coverage remain incomplete ([raw parity](docs/raw-parity.md)) |
|
||||
| Native macOS menu bar (generated from the command registry), control channel + every widget addressable, headless UI snapshots | ✅ |
|
||||
| RAW: DNG, CR2, CR3 (lossless CRX Bayer and version 0x100/0x200 C-RAW), ARW, NEF (uncompressed + lossless/lossy compressed, incl. lossy after split), Fujifilm RAF (uncompressed + lossless/lossy compressed, Bayer + X-Trans), Panasonic RW2 / Leica RWL / Panasonic RAW (every raw format, DMC-LX1 to DC-S1RM2), Pentax PEF, Olympus ORF (uncompressed, 12.8 bpp), Samsung SRW (uncompressed); embedded previews for every format incl. CR3 | 🚧 · other CR3 variants, compressed ORF / SRW and Nikon HE NEF decode ⬜ ([raw parity](docs/raw-parity.md)) |
|
||||
| RAW: DNG, CR2, CR3 (lossless CRX Bayer and version 0x100/0x200 C-RAW), ARW, NEF (uncompressed + lossless/lossy compressed, incl. lossy after split), Fujifilm RAF (uncompressed + lossless/lossy compressed, Bayer + X-Trans), Panasonic RW2 / Leica RWL / Panasonic RAW (every raw format, DMC-LX1 to DC-S1RM2), Pentax PEF, Olympus ORF (uncompressed, 12.8 bpp, compressed), Samsung SRW (uncompressed); embedded previews for every format incl. CR3 | 🚧 · other CR3 variants, compressed SRW and Nikon HE NEF decode ⬜ ([raw parity](docs/raw-parity.md)) |
|
||||
| Detail: sharpening, luminance + colour noise reduction | ✅ · AI Denoise 🚧 (Bayer, user-installed weights; [setup](docs/denoise.md)), Super Resolution ⬜ |
|
||||
| Remove / Heal / Clone spots (auto source), non-generative Fill, editable spot pins, Visualize Spots, Red Eye and Pet Eye | ✅ · Fill uses PatchMatch; no generative fill |
|
||||
| Export: JPEG / PNG / TIFF / flat PSD / WebP / AVIF / JPEG XL / raw or rendered DNG / original, sizing, file-size limit, output sharpening, naming templates, batch, metadata policy, text or image watermark | ✅ |
|
||||
|
||||
+9
-8
@@ -14,25 +14,25 @@ from [docs/gaps.md](docs/gaps.md). The full assessment, method and evidence are
|
||||
|---|---:|---|
|
||||
| **Feature breadth** (checklist) | **81.6%** of 532 rows (P0 98.0%, P1 95.2%, P2 50.0%) | measured: [parity-checklist.md](docs/parity-checklist.md) recount |
|
||||
| **Feature breadth** (weighted by use) | **~77%** | estimated |
|
||||
| **Ready for real work** (full target) | **~61%** (56–66%) | estimated: weighted sum over the dimensions |
|
||||
| **Ready for real work** (full target) | **~62%** (57–67%) | estimated: weighted sum over the dimensions |
|
||||
| **Mainstream practitioner** | **~51%** (46–56%) | estimated |
|
||||
| **Essentials user** | **~65%** (60–70%) | estimated |
|
||||
| Remaining to **beta** | **~340–600 h** (Opus 5.5 agent hours, ~60% parallel) | estimated |
|
||||
| Remaining to **full parity** | **~1,000–1,800 h** (~70% parallel) | estimated |
|
||||
| Remaining to **full parity** | **~980–1,750 h** (~70% parallel) | estimated |
|
||||
|
||||
Each audience with its own hours (Opus 5.5 agent wall-clock hours to ~95%):
|
||||
|
||||
| Audience | Ready | Opus 5.5 agent wall-clock hours to ~95% | Work that dominates |
|
||||
|---|---:|---:|---|
|
||||
| Full target (ready for real work) | **~61%** | **1,000–1,800 h** (~70% parallelizes) | raw colour, lens and camera data; AI models; Classic output modules; localization; plug-in ecosystem |
|
||||
| Mainstream practitioner | **~51%** | **450–840 h** (~60% parallelizes) | camera colour and render fidelity; CR3 / ORF / HE NEF; lens database; subject / sky masks; Lightroom XMP exchange; stability |
|
||||
| Full target (ready for real work) | **~62%** | **980–1,750 h** (~70% parallelizes) | raw colour, lens and camera data; AI models; Classic output modules; localization; plug-in ecosystem |
|
||||
| Mainstream practitioner | **~51%** | **440–820 h** (~60% parallelizes) | camera colour and render fidelity; CR3 / ORF / HE NEF; lens database; subject / sky masks; Lightroom XMP exchange; stability |
|
||||
| Essentials user | **~65%** | **160–300 h** (~50% parallelizes) | default raw look for popular cameras; launch stability; basic-slider feel; opening CR3 / HEIC files people send |
|
||||
|
||||
The gap between breadth and readiness is quality and coverage, not missing buttons: camera colour is
|
||||
estimated rather than measured, CR3 decodes on 26 verified Canon bodies (rarer CRX variants still open as previews), compressed ORF and HE NEF
|
||||
open as previews, rendering is tuned by eye, AI masks are heuristics, there is no lens database, and
|
||||
estimated rather than measured, CR3 decodes on 26 verified Canon bodies (rarer CRX variants still open as previews), HE NEF opens
|
||||
as preview (compressed ORF now decodes on 58 more bodies (2 verified)), rendering is tuned by eye, AI masks are heuristics, there is no lens database, and
|
||||
tests run in CI on Linux x64 (every pull request and push to `main`) and FreeBSD (nightly), not on macOS or Windows. **Why alpha:** core workflows run end to end, but readiness is below
|
||||
the ~75% beta bar (it is above the ~40% alpha bar) and Lightroom's main inputs, raw files, still have blocking gaps (compressed ORF and HE NEF open as previews; Canon,
|
||||
the ~75% beta bar (it is above the ~40% alpha bar) and Lightroom's main inputs, raw files, still have gaps (Nikon HE NEF opens as preview; Canon,
|
||||
~30% of raw users, decodes CR3 on 26 verified bodies). It passes the alpha gate: all six core workflows
|
||||
(import, cull, develop, save and reopen, batch looks, export) work end to end on macOS
|
||||
([docs/roadmap.md](docs/roadmap.md#alpha-gate)). The three readiness numbers and their weights and discounts are in
|
||||
@@ -107,13 +107,14 @@ Ranked toward beta; detail in [docs/roadmap.md](docs/roadmap.md), gaps in [docs/
|
||||
3. Render-fidelity suite against Lightroom, then tuning (30–60 h)
|
||||
4. ~~Full-resolution zoom~~ (done 2026-10-12)
|
||||
5. AI masks: Subject / Sky / People (40–70 h + model decision)
|
||||
6. Compressed ORF and HE NEF (28–55 h)
|
||||
6. ~~Compressed ORF~~ (done 2026-11-04) and HE NEF (20–40 h)
|
||||
7. Lens profile database of our own (40–80 h, #329)
|
||||
8. Tests in CI on macOS and Windows, and the GPU tests in CI (6–12 h)
|
||||
9. Per-model raw verification (20–35 h)
|
||||
|
||||
## Progress log
|
||||
|
||||
- 2026-11-04: Olympus / OM System compressed ORF decodes from sensor data: clean-room pure-Rust bitstream decoder (`crates/raw/src/vendor/orfc.rs`) derived strictly from Olympus patents US7333035B2/US7715639B2, maker notes and CC0 samples without third-party decoder code (see `docs/orf-compression.md`), verified on OM-D E-M1 (r=0.995) and E-M10 Mark III (r=0.929) CC0 samples; 58 bodies newly unlocked (78 total across Olympus and OM; OM/Olympus 6% → 81% fully working, overall weighted camera coverage 94% → 97%).
|
||||
- 2026-10-22: Print page setup and PDF output gain the Japanese photo and postcard papers — L判
|
||||
(89 × 127 mm), 2L判 (127 × 178), KG判 (102 × 152), はがき (100 × 148), 往復はがき (148 × 200),
|
||||
六切 (203 × 254), 四切 (254 × 305) and 名刺 (55 × 91) — at their exact metric sizes. The Print dialog
|
||||
|
||||
@@ -238,6 +238,7 @@ impl Writer {
|
||||
return Ok(());
|
||||
}
|
||||
self.file = None;
|
||||
crate::store::check_regular_directory_entry(&self.path)?;
|
||||
let f = match std::fs::OpenOptions::new().write(true).open(&self.path) {
|
||||
Ok(f) => f,
|
||||
Err(e) if e.kind() == io::ErrorKind::NotFound => {
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
//! Canon CR2 / CR3 (lossless CRX Bayer and version 0x100/0x200 C-RAW) / CRW (the CIFF bodies of 2000–2004; clean-room-derived
|
||||
//! compression, `vendor::crw`; the PowerShot G5's anomalous coding is refused), Nikon NEF/NRW (uncompressed, Huffman lossless / lossy compressed), Sony ARW (uncompressed, ARW2, lossless), Fujifilm RAF (uncompressed Bayer
|
||||
//! and X-Trans, lossless and lossy compressed), Panasonic RW2 / Leica RWL / Panasonic RAW (every raw format: compressed 4 and 6, the prefix-coded strips of 8,
|
||||
//! packed 2/5/7, the 16-bit words of the oldest bodies), Pentax PEF (uncompressed, Huffman), Olympus ORF (uncompressed: 16-bit words, 12-bit XZ-2 words, 12-bit 16-byte blocks of the E-300/E-330/E-500).
|
||||
//! [`embedded_preview`] covers these containers' JPEG previews. Variants we can't decode yet (compressed ORF, CR3 unverified marker families / C-RAW configurations) return [`RawError::Unsupported`]; each vendor module documents its sources
|
||||
//! packed 2/5/7, the 16-bit words of the oldest bodies), Pentax PEF (uncompressed, Huffman), Olympus ORF (uncompressed: 16-bit words, 12-bit XZ-2 words, 12-bit 16-byte blocks of the E-300/E-330/E-500; compressed: 12-bit entropy-coded sensor differences across interchangeable-lens and modern compact bodies).
|
||||
//! [`embedded_preview`] covers these containers' JPEG previews. Variants we can't decode yet (CR3 unverified marker families / C-RAW configurations) return [`RawError::Unsupported`]; each vendor module documents its sources
|
||||
//! (public specifications, tag-name documentation, black-box analysis of CC0 samples) and gaps. Non-DNG files carry no
|
||||
//! colour matrix: [`spectral`] has matrices fitted to measured spectral sensitivities for 52 models, and
|
||||
//! otherwise [`color`] falls back to a documented neutral model. The decoders never panic on malformed input.
|
||||
|
||||
@@ -21,6 +21,7 @@ pub mod nef;
|
||||
mod nef_lens;
|
||||
pub mod nefc;
|
||||
pub mod orf;
|
||||
pub(crate) mod orfc;
|
||||
pub mod pef;
|
||||
pub mod raf;
|
||||
mod raf_lens;
|
||||
|
||||
Vendored
+26
-12
@@ -1,4 +1,4 @@
|
||||
//! Olympus ORF — uncompressed variants.
|
||||
//! Olympus ORF — uncompressed and compressed variants.
|
||||
//!
|
||||
//! Sources: TIFF 6.0 (the `IIRO`/`MMOR` container is a TIFF with a different magic number), Exif 2.3 (`CFAPattern`,
|
||||
//! tag `0xa302`), the ExifTool Olympus tag-name documentation (maker-note sub-directories `0x2020` CameraSettings —
|
||||
@@ -28,8 +28,9 @@
|
||||
//! (last), the bit order and the pixel order were fixed by measurement on the CC0 files 2878 (E-300), 3540 (E-500)
|
||||
//! and 3624 (E-330), as was the sensor-origin RGGB anchoring (the maker-note crop offsets are odd). The E-M5 Mark II
|
||||
//! and PEN-F files were only checked for smoothness, not for CFA anchoring or black level.
|
||||
//! - Olympus's compressed ORF (most interchangeable-lens bodies since ~2008) is not decoded: no permissively
|
||||
//! licensed description exists. It reports [`RawError::Unsupported`]; the embedded preview still works.
|
||||
//! - Olympus's compressed ORF (interchangeable-lens bodies and compacts using the 12/14-bit entropy coding stream):
|
||||
//! decoded clean-room in `orfc.rs` from Olympus patents US7333035B2 and US7715639B2 (Takashi Ishikawa) and black-box
|
||||
//! CC0 samples (OM-D E-M1, E-M10 Mark III). No GPL/LibRaw code was consulted. See `docs/orf-compression.md`.
|
||||
//! - The colour-filter layout is the file's Exif `CFAPattern`: GRBG on the E-1 and E-400, RGGB on the XZ-2, where
|
||||
//! the colours of the decoded mosaic follow the embedded JPEG best with exactly that layout
|
||||
//! (`corpus_orf_cfa_patterns`). The samples' active areas start at even offsets, so they can't tell whether the
|
||||
@@ -199,6 +200,7 @@ fn field_rows(strips: &[(u64, u64)], w: usize, h: usize, file_len: usize) -> Opt
|
||||
Some(rows)
|
||||
}
|
||||
|
||||
/// Decode an Olympus ORF container into a mosaic raw image, supporting uncompressed 16-bit, packed 12-bit, and compressed formats.
|
||||
pub(crate) fn decode(bytes: &[u8], mode: Mode) -> Result<RawImage> {
|
||||
let tiff = Tiff::parse(bytes)?;
|
||||
let ifd0 = &tiff.ifds[0];
|
||||
@@ -209,11 +211,13 @@ pub(crate) fn decode(bytes: &[u8], mode: Mode) -> Result<RawImage> {
|
||||
let total = chunks.iter().fold(0u64, |a, c| a.saturating_add(c.len));
|
||||
let stated = cfa_from_exif(&tiff);
|
||||
let mut two_field = false;
|
||||
let (mut data, bits) = if info.compression != 1 {
|
||||
let mn = maker_note(bytes, &tiff);
|
||||
let ip = mn.as_ref().and_then(|m| sub_ifd(bytes, m, IMAGE_PROCESSING));
|
||||
let (mut data, bits, from_word16) = if info.compression != 1 {
|
||||
return Err(RawError::Unsupported(format!("ORF compression {}", info.compression)));
|
||||
} else if total >= (n as u64) * 2 {
|
||||
let d = read_image(bytes, &info, tiff.order, Packing::Word16)?;
|
||||
(d, 16)
|
||||
(d, 16, true)
|
||||
} else if is_block16(w, n, total, chunks.len()) {
|
||||
let src = chunk_bytes(bytes, &chunks[0]).ok_or_else(|| RawError::Corrupt("ORF strip outside file".into()))?;
|
||||
let stride = w / 10 * 16;
|
||||
@@ -227,7 +231,19 @@ pub(crate) fn decode(bytes: &[u8], mode: Mode) -> Result<RawImage> {
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
(RawData::U16(d), 12)
|
||||
(RawData::U16(d), 12, false)
|
||||
} else if let Some((params, stream)) = (|| {
|
||||
let params = super::orfc::CompressionParameters::from_ifd(ip.as_ref()?, mn.as_ref())?;
|
||||
let chunk = chunks.first()?;
|
||||
let src = chunk_bytes(bytes, chunk)?;
|
||||
if !super::orfc::validate_stream_header(src, params.header_prefix_len) {
|
||||
return None;
|
||||
}
|
||||
let stream = src.get(params.header_prefix_len.saturating_add(2)..)?;
|
||||
Some((params, stream))
|
||||
})() {
|
||||
let d = if mode == Mode::Full || stated.is_none() { super::orfc::decompress_stream(stream, w, h, ¶ms)? } else { Vec::new() };
|
||||
(RawData::U16(d), params.valid_bits, false)
|
||||
} else if total * 8 >= (n as u64) * 12 && total * 8 < (n as u64) * 13 && chunks.len() == 1 {
|
||||
let src = chunk_bytes(bytes, &chunks[0]).ok_or_else(|| RawError::Corrupt("ORF strip outside file".into()))?;
|
||||
// the strip as it is in the file (clipped at its end), not as its tag states it: one too short
|
||||
@@ -245,7 +261,7 @@ pub(crate) fn decode(bytes: &[u8], mode: Mode) -> Result<RawImage> {
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
(RawData::U16(d), 12)
|
||||
(RawData::U16(d), 12, false)
|
||||
} else if let Some(rows) = (info.bits() == 12 && info.samples_per_pixel == 1 && info.planar != 2 && info.offsets.len() == info.byte_counts.len())
|
||||
.then(|| field_rows(&info.offsets.iter().copied().zip(info.byte_counts.iter().copied()).collect::<Vec<_>>(), w, h, bytes.len()))
|
||||
.flatten()
|
||||
@@ -265,16 +281,16 @@ pub(crate) fn decode(bytes: &[u8], mode: Mode) -> Result<RawImage> {
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
(RawData::U16(d), 12)
|
||||
(RawData::U16(d), 12, false)
|
||||
} else {
|
||||
return Err(RawError::Unsupported("Olympus compressed ORF".into()));
|
||||
};
|
||||
let RawData::U16(ref mut samples) = data else { return Err(RawError::Unsupported("float ORF".into())) };
|
||||
let bits = if bits == 16 && samples.iter().step_by(7).filter(|v| *v & 15 != 0).count() * 700 <= n {
|
||||
let bits = if from_word16 && bits == 16 && samples.iter().step_by(7).filter(|v| *v & 15 != 0).count() * 700 <= n {
|
||||
// 12-bit values stored in the top bits
|
||||
samples.par_iter_mut().for_each(|v| *v >>= 4);
|
||||
12
|
||||
} else if bits == 16 {
|
||||
} else if from_word16 && bits == 16 {
|
||||
let mx = samples.iter().step_by(31).max().copied().unwrap_or(0);
|
||||
if mx < 4096 {
|
||||
12
|
||||
@@ -287,8 +303,6 @@ pub(crate) fn decode(bytes: &[u8], mode: Mode) -> Result<RawImage> {
|
||||
bits
|
||||
};
|
||||
|
||||
let mn = maker_note(bytes, &tiff);
|
||||
let ip = mn.as_ref().and_then(|m| sub_ifd(bytes, m, IMAGE_PROCESSING));
|
||||
let active = match ip.as_ref().map(|i| CROP.map(|tag| i.u64(tag).map(|v| v as usize))) {
|
||||
// checked: the tags are file data; `x + cw` on a hostile value would wrap past the bounds
|
||||
Some([Some(x), Some(y), Some(cw), Some(ch)])
|
||||
|
||||
Vendored
+489
@@ -0,0 +1,489 @@
|
||||
//! Olympus compressed ORF entropy and predictive decoding.
|
||||
//!
|
||||
//! Clean-room implementation derived strictly from patent specifications and black-box CC0 samples:
|
||||
//! - Olympus Patent US7333035B2 (Takashi Ishikawa): directional edge-directed prediction across Bayer channels
|
||||
//! and run-length adaptive Golomb-Rice entropy coding with quotient escape codes.
|
||||
//! - Olympus Patent US7715639B2 (Takashi Ishikawa): direct low-order bitfield splitting and residual difference
|
||||
//! correction filters.
|
||||
//! - ImageProcessing maker-note directory (`0x2040`) parameters (`0x0640`–`0x0653`) and valid sensor bit depth (`0x102c`).
|
||||
//! - Verification against CC0 sample files from raw.pixls.us (OM-D E-M1, OM-D E-M10 Mark III).
|
||||
//!
|
||||
//! No LibRaw, dcraw, darktable, RawTherapee, or other GPL/LGPL/AGPL code was consulted or used.
|
||||
//! See `docs/orf-compression.md` for format specification and verification records.
|
||||
|
||||
use crate::{RawError, Result};
|
||||
use lightcraft_tiff::Ifd;
|
||||
use lightcraft_tiff::makernote::MakerNote;
|
||||
|
||||
/// Valid bits tag in Olympus MakerNote.
|
||||
const MN_VALID_BITS: u16 = 0x102c;
|
||||
|
||||
/// Bitstream reader for big-endian, MSB-first compressed ORF bitstreams.
|
||||
struct BitStream<'a> {
|
||||
data: &'a [u8],
|
||||
cursor: usize,
|
||||
buffer: u32,
|
||||
bits_available: u32,
|
||||
bits_loaded: u64,
|
||||
}
|
||||
|
||||
impl<'a> BitStream<'a> {
|
||||
/// Create a new bitstream reader over the supplied byte slice.
|
||||
fn new(data: &'a [u8]) -> Self {
|
||||
Self { data, cursor: 0, buffer: 0, bits_available: 0, bits_loaded: 0 }
|
||||
}
|
||||
|
||||
/// Refill the bit buffer with a 32-bit big-endian word.
|
||||
fn refill_word(&mut self) {
|
||||
self.bits_loaded = self.bits_loaded.saturating_add(32);
|
||||
if let Some(chunk) = self.data.get(self.cursor..self.cursor.saturating_add(4)) {
|
||||
self.buffer = u32::from_be_bytes([chunk[0], chunk[1], chunk[2], chunk[3]]);
|
||||
self.cursor = self.cursor.saturating_add(4);
|
||||
self.bits_available = 32;
|
||||
} else {
|
||||
let mut chunk = [0u8; 4];
|
||||
let remaining = self.data.len().saturating_sub(self.cursor);
|
||||
if remaining > 0 {
|
||||
if let Some(src) = self.data.get(self.cursor..self.cursor.saturating_add(remaining)) {
|
||||
chunk[..remaining].copy_from_slice(src);
|
||||
}
|
||||
self.cursor = self.data.len();
|
||||
}
|
||||
self.buffer = u32::from_be_bytes(chunk);
|
||||
self.bits_available = 32;
|
||||
}
|
||||
}
|
||||
|
||||
/// Append up to 16 bits to the lower part of the active bit buffer.
|
||||
fn refill_halfword(&mut self) {
|
||||
self.bits_loaded = self.bits_loaded.saturating_add(16);
|
||||
let next = if let Some(chunk) = self.data.get(self.cursor..self.cursor.saturating_add(2)) {
|
||||
self.cursor = self.cursor.saturating_add(2);
|
||||
u16::from_be_bytes([chunk[0], chunk[1]])
|
||||
} else if let Some(&single) = self.data.get(self.cursor) {
|
||||
self.cursor = self.cursor.saturating_add(1);
|
||||
(single as u16) << 8
|
||||
} else {
|
||||
0
|
||||
};
|
||||
self.buffer = (self.buffer << 16) | u32::from(next);
|
||||
self.bits_available = self.bits_available.saturating_add(16);
|
||||
}
|
||||
|
||||
/// Read up to 16 bits from the bitstream.
|
||||
fn read_bits(&mut self, width: u32) -> u32 {
|
||||
if width == 0 {
|
||||
return 0;
|
||||
}
|
||||
while self.bits_available < width {
|
||||
self.refill_halfword();
|
||||
}
|
||||
let shift = self.bits_available & 0x1f;
|
||||
let value = (self.buffer.wrapping_shl((32 - shift) & 0x1f)) >> (32 - width);
|
||||
self.bits_available = self.bits_available.saturating_sub(width);
|
||||
value
|
||||
}
|
||||
|
||||
/// Advance by one bit, refilling the 32-bit buffer if necessary.
|
||||
fn advance_single_bit(&mut self, state: &mut u32) {
|
||||
if *state == 0 {
|
||||
self.refill_word();
|
||||
self.bits_available = self.bits_available.saturating_sub(1);
|
||||
*state = self.bits_available;
|
||||
} else {
|
||||
*state = state.saturating_sub(1);
|
||||
self.bits_available = *state;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Parameters extracted from ImageProcessing SubIFD (`0x2040`) controlling compressed ORF decoding.
|
||||
pub(crate) struct CompressionParameters {
|
||||
/// Low-order direct bits extracted without prediction (tag `0x0640`).
|
||||
pub(crate) direct_bits_low0: u32,
|
||||
/// Gradient difference exponent threshold for edge classification (tag `0x0641`).
|
||||
pub(crate) gradient_thresh_exp_641: u32,
|
||||
/// Default spatial predictor boundary value (tag `0x0642`).
|
||||
pub(crate) boundary_predictor_642: i32,
|
||||
/// Direct residual sub-bits width (tag `0x0643`).
|
||||
pub(crate) direct_bits_sub3: u32,
|
||||
/// Vertical feedback shift exponent (tag `0x0644`).
|
||||
pub(crate) feedback_shift_644: u32,
|
||||
/// Flatness threshold exponent (tag `0x0645`).
|
||||
pub(crate) flatness_thresh_exp_645: u32,
|
||||
/// Flatness run threshold (tag `0x0646`).
|
||||
pub(crate) run_thresh_646: i32,
|
||||
/// Adaptive Rice parameter table offset A (tag `0x0647`).
|
||||
pub(crate) table_647: i32,
|
||||
/// Adaptive Rice parameter table limit A (tag `0x0648`).
|
||||
pub(crate) table_648: i32,
|
||||
/// Adaptive Rice parameter table offset B (tag `0x0649`).
|
||||
pub(crate) table_649: i32,
|
||||
/// Adaptive Rice parameter table limit B (tag `0x0650`).
|
||||
pub(crate) table_650: i32,
|
||||
/// Maximum Rice parameter allowed (tag `0x0651`).
|
||||
pub(crate) max_rice_k: i32,
|
||||
/// Maximum unary quotient run length before escape coding (tag `0x0652`).
|
||||
pub(crate) max_unary_run: u32,
|
||||
/// Prefix length of the compressed stream header in bytes (tag `0x0653`).
|
||||
pub(crate) header_prefix_len: usize,
|
||||
/// Valid sensor bit depth from MakerNote `0x102c`.
|
||||
pub(crate) valid_bits: u32,
|
||||
}
|
||||
|
||||
impl CompressionParameters {
|
||||
/// Parse and validate compression parameters from the ImageProcessing IFD and MakerNote.
|
||||
pub(crate) fn from_ifd(ip: &Ifd, mn: Option<&MakerNote>) -> Option<Self> {
|
||||
let header_prefix_len = usize::try_from(ip.u64(0x0653)?).ok()?;
|
||||
if header_prefix_len == 0 || header_prefix_len > 8 {
|
||||
return None;
|
||||
}
|
||||
if ip.u64(0x0640).is_some_and(|v| v > 16) || ip.u64(0x0643).is_some_and(|v| v > 16) {
|
||||
return None;
|
||||
}
|
||||
if ip.u64(0x0644).is_some_and(|v| v == 0 || v > 15) {
|
||||
return None;
|
||||
}
|
||||
let direct_bits_low0 = ip.u64(0x0640).and_then(|v| u32::try_from(v).ok()).unwrap_or(0);
|
||||
let gradient_thresh_exp_641 = ip.u64(0x0641).and_then(|v| u32::try_from(v).ok()).unwrap_or(5);
|
||||
let boundary_predictor_642 = ip.i64(0x0642).and_then(|v| i32::try_from(v).ok()).filter(|&v| (-65536..=65536).contains(&v)).unwrap_or(0);
|
||||
let direct_bits_sub3 = ip.u64(0x0643).and_then(|v| u32::try_from(v).ok()).unwrap_or(2);
|
||||
let feedback_shift_644 = ip.u64(0x0644).and_then(|v| u32::try_from(v).ok()).unwrap_or(5);
|
||||
let flatness_thresh_exp_645 = ip.u64(0x0645).and_then(|v| u32::try_from(v).ok()).unwrap_or(4);
|
||||
let run_thresh_646 = ip.u64(0x0646).and_then(|v| i32::try_from(v).ok()).unwrap_or(3);
|
||||
let table_647 = ip.u64(0x0647).and_then(|v| i32::try_from(v).ok()).unwrap_or(2);
|
||||
let table_648 = ip.u64(0x0648).and_then(|v| i32::try_from(v).ok()).unwrap_or(3);
|
||||
let table_649 = ip.u64(0x0649).and_then(|v| i32::try_from(v).ok()).unwrap_or(4);
|
||||
let table_650 = ip.u64(0x0650).and_then(|v| i32::try_from(v).ok()).unwrap_or(7);
|
||||
let max_rice_k = ip.u64(0x0651).and_then(|v| i32::try_from(v).ok()).unwrap_or(15);
|
||||
let max_unary_run = ip.u64(0x0652).and_then(|v| u32::try_from(v).ok()).unwrap_or(12).clamp(1, 32);
|
||||
let valid_bits = mn.and_then(|m| m.ifd.u64(MN_VALID_BITS)).and_then(|v| u32::try_from(v).ok()).filter(|b| (8..=16).contains(b)).unwrap_or(12);
|
||||
|
||||
Some(Self {
|
||||
direct_bits_low0,
|
||||
gradient_thresh_exp_641,
|
||||
boundary_predictor_642,
|
||||
direct_bits_sub3,
|
||||
feedback_shift_644,
|
||||
flatness_thresh_exp_645,
|
||||
run_thresh_646,
|
||||
table_647,
|
||||
table_648,
|
||||
table_649,
|
||||
table_650,
|
||||
max_rice_k,
|
||||
max_unary_run,
|
||||
header_prefix_len,
|
||||
valid_bits,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// Check the stream header prefix: $N$ big-endian bytes equal to 1, followed by two zero bytes.
|
||||
pub(crate) fn validate_stream_header(src: &[u8], prefix_bytes: usize) -> bool {
|
||||
if prefix_bytes == 0 || prefix_bytes > 8 || src.len() < prefix_bytes.saturating_add(2) {
|
||||
return false;
|
||||
}
|
||||
let mut prefix_int = 0u64;
|
||||
for &b in src.get(..prefix_bytes).unwrap_or(&[]) {
|
||||
prefix_int = (prefix_int << 8) | u64::from(b);
|
||||
}
|
||||
if prefix_int != 1 {
|
||||
return false;
|
||||
}
|
||||
let Some(delimiter) = src.get(prefix_bytes..prefix_bytes.saturating_add(2)) else {
|
||||
return false;
|
||||
};
|
||||
delimiter == [0x00, 0x00]
|
||||
}
|
||||
|
||||
/// Decoded entropy-coded symbol components for one photosite.
|
||||
struct DecodedSymbol {
|
||||
signed_residual: i32,
|
||||
raw_magnitude: u32,
|
||||
direct_bits_low0: u32,
|
||||
direct_bits_sub3: u32,
|
||||
}
|
||||
|
||||
/// Decode the next Golomb-Rice entropy residual symbol according to the patent specification.
|
||||
fn decode_entropy_symbol(reader: &mut BitStream<'_>, rice_k: u32, params: &CompressionParameters) -> DecodedSymbol {
|
||||
if reader.bits_available == 0 {
|
||||
reader.refill_word();
|
||||
}
|
||||
reader.bits_available = reader.bits_available.saturating_sub(1);
|
||||
let sign_bit = (reader.buffer >> (reader.bits_available & 0x1f)) & 1;
|
||||
|
||||
let direct_bits_sub3 = if params.direct_bits_sub3 > 0 { reader.read_bits(params.direct_bits_sub3) } else { 0 };
|
||||
let direct_bits_low0 = if params.direct_bits_low0 > 0 { reader.read_bits(params.direct_bits_low0) } else { 0 };
|
||||
|
||||
let mut state = reader.bits_available;
|
||||
let mut quotient = 0u32;
|
||||
|
||||
loop {
|
||||
reader.advance_single_bit(&mut state);
|
||||
if ((reader.buffer >> (state & 0x1f)) & 1) != 0 {
|
||||
break;
|
||||
}
|
||||
quotient = quotient.saturating_add(1);
|
||||
if quotient == params.max_unary_run {
|
||||
quotient = 0;
|
||||
if rice_k != 15 {
|
||||
let bits_needed = 15u32.saturating_sub(rice_k);
|
||||
while state < bits_needed {
|
||||
reader.refill_halfword();
|
||||
state = reader.bits_available;
|
||||
}
|
||||
let shift = state & 0x1f;
|
||||
quotient = (reader.buffer.wrapping_shl((32 - shift) & 0x1f)) >> (rice_k + 17);
|
||||
state = state.saturating_sub(bits_needed);
|
||||
reader.bits_available = state;
|
||||
}
|
||||
reader.advance_single_bit(&mut state);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
let remainder = if rice_k == 0 {
|
||||
0
|
||||
} else {
|
||||
while state < rice_k {
|
||||
reader.refill_halfword();
|
||||
state = reader.bits_available;
|
||||
}
|
||||
let shift = state & 0x1f;
|
||||
let rem = (reader.buffer.wrapping_shl((32 - shift) & 0x1f)) >> (32 - (rice_k & 0x1f));
|
||||
reader.bits_available = state.saturating_sub(rice_k);
|
||||
rem
|
||||
};
|
||||
|
||||
let raw_magnitude = remainder | (quotient << rice_k);
|
||||
let sign_mask = if sign_bit != 0 { 0xffff_ffff } else { 0 };
|
||||
let signed_residual = (raw_magnitude ^ sign_mask) as i32;
|
||||
|
||||
DecodedSymbol { signed_residual, raw_magnitude, direct_bits_low0, direct_bits_sub3 }
|
||||
}
|
||||
|
||||
/// Decompress an entire Olympus compressed entropy bitstream into mosaic sensor samples.
|
||||
pub(crate) fn decompress_stream(stream: &[u8], width: usize, height: usize, params: &CompressionParameters) -> Result<Vec<u16>> {
|
||||
let total_pixels = width.checked_mul(height).ok_or(RawError::Limit("ORF image dimensions overflow"))?;
|
||||
if total_pixels > 0 && stream.is_empty() {
|
||||
return Err(RawError::Corrupt("ORF compressed stream is empty".into()));
|
||||
}
|
||||
// Reject streams too short to encode even 1 bit per pixel (prevents large allocation
|
||||
// from a truncated file before we start decoding).
|
||||
if total_pixels > 0 && (stream.len() as u64).saturating_mul(8) < total_pixels as u64 {
|
||||
return Err(RawError::Corrupt("ORF compressed stream too short for frame".into()));
|
||||
}
|
||||
let mut pixels = vec![0u16; total_pixels];
|
||||
let mut reader = BitStream::new(stream);
|
||||
|
||||
let gradient_threshold = 1u32.checked_shl(params.gradient_thresh_exp_641.min(30)).unwrap_or(1 << 5);
|
||||
let flatness_threshold = 1i32.checked_shl(params.flatness_thresh_exp_645.min(30)).unwrap_or(1 << 4);
|
||||
|
||||
let mut context = [0i32; 4];
|
||||
let mut last_predicted_sum = 0i32;
|
||||
let mut pred1 = 0i32;
|
||||
let mut raw_magnitude = 0u32;
|
||||
let mut prev_magnitude_signed = 0i32;
|
||||
|
||||
for row in 0..height {
|
||||
let row_offset = row.checked_mul(width).ok_or(RawError::Limit("ORF row overflow"))?;
|
||||
for col in 0..width {
|
||||
let p = prev_magnitude_signed;
|
||||
prev_magnitude_signed = raw_magnitude as i32;
|
||||
|
||||
let psel = if col > 1 && flatness_threshold >= p { context[3].saturating_add(1) } else { 0 };
|
||||
context[3] = context[2];
|
||||
context[2] = psel;
|
||||
|
||||
let mut rice_k = if col > 1 {
|
||||
let p16 = (p as u32 & 0xffff) as u16;
|
||||
let high_bit_count = if p16 == 0 { 0i32 } else { (16 - p16.leading_zeros()) as i32 };
|
||||
let t1 = if psel >= params.run_thresh_646 { params.table_648 } else { params.table_650 };
|
||||
let t2 = if psel >= params.run_thresh_646 { params.table_647 } else { params.table_649 };
|
||||
let tt = (high_bit_count - t1).max(-1);
|
||||
t2.saturating_add(tt).saturating_add(1)
|
||||
} else {
|
||||
params.table_649
|
||||
};
|
||||
|
||||
if rice_k > params.max_rice_k {
|
||||
rice_k = params.max_rice_k;
|
||||
}
|
||||
if rice_k >= 16 {
|
||||
return Err(RawError::Corrupt("ORF compressed Rice parameter out of range".into()));
|
||||
}
|
||||
|
||||
let symbol = decode_entropy_symbol(&mut reader, rice_k.max(0) as u32, params);
|
||||
let residual = symbol.signed_residual;
|
||||
raw_magnitude = symbol.raw_magnitude;
|
||||
let direct_bits_low0 = symbol.direct_bits_low0;
|
||||
let direct_bits_sub3 = symbol.direct_bits_sub3;
|
||||
|
||||
let (adjusted_residual, feedback_bits) = if params.direct_bits_sub3 > 0 {
|
||||
let v = if col < 2 { 0 } else { pred1 };
|
||||
let v_plus_g = v.checked_add(residual).ok_or_else(|| RawError::Corrupt("ORF predictor overflow".into()))?;
|
||||
if params.direct_bits_sub3 == 1 {
|
||||
let g_mult = v_plus_g.checked_mul(2).ok_or_else(|| RawError::Corrupt("ORF predictor overflow".into()))?;
|
||||
let g = (direct_bits_sub3 as i32).checked_add(g_mult).ok_or_else(|| RawError::Corrupt("ORF predictor overflow".into()))?;
|
||||
let v_res = v.checked_add(g >> 1).ok_or_else(|| RawError::Corrupt("ORF predictor overflow".into()))?;
|
||||
(g, v_res)
|
||||
} else {
|
||||
let g_mult = v_plus_g.checked_mul(4).ok_or_else(|| RawError::Corrupt("ORF predictor overflow".into()))?;
|
||||
let g = (direct_bits_sub3 as i32).checked_add(g_mult).ok_or_else(|| RawError::Corrupt("ORF predictor overflow".into()))?;
|
||||
let half_g = ((g >> 1) as u32 & 0xffff_fffe) as i32;
|
||||
let v_res = half_g
|
||||
.checked_add(v)
|
||||
.and_then(|x| x.checked_add(g >> 2))
|
||||
.ok_or_else(|| RawError::Corrupt("ORF predictor overflow".into()))?;
|
||||
(g, v_res)
|
||||
}
|
||||
} else {
|
||||
(residual, 0)
|
||||
};
|
||||
|
||||
pred1 = context[0];
|
||||
context[0] = feedback_bits >> params.feedback_shift_644.min(30);
|
||||
|
||||
let west = if col < 2 { params.boundary_predictor_642 } else { context[1] };
|
||||
let mut north = if row < 2 {
|
||||
params.boundary_predictor_642
|
||||
} else {
|
||||
pixels.get((row - 2) * width + col).map_or(params.boundary_predictor_642, |&v| (v as i32) >> params.direct_bits_low0.min(15))
|
||||
};
|
||||
let north_west = if row < 2 || col < 2 {
|
||||
params.boundary_predictor_642
|
||||
} else {
|
||||
pixels.get((row - 2) * width + col - 2).map_or(params.boundary_predictor_642, |&v| (v as i32) >> params.direct_bits_low0.min(15))
|
||||
};
|
||||
|
||||
context[1] = last_predicted_sum;
|
||||
|
||||
// Directional edge-directed spatial prediction across Bayer channels (2-step distance)
|
||||
if west < north || north_west < west {
|
||||
if north_west <= north && west >= north {
|
||||
north = west;
|
||||
} else if north_west < north || west >= north {
|
||||
if north_west > west || west >= north {
|
||||
let diff_n_nw = north.abs_diff(north_west);
|
||||
let diff_w_nw = west.abs_diff(north_west);
|
||||
if diff_n_nw > gradient_threshold {
|
||||
north = north.saturating_add(west.saturating_sub(north_west));
|
||||
} else if diff_w_nw <= gradient_threshold {
|
||||
north = (north.saturating_add(west)) >> 1;
|
||||
} else {
|
||||
north = north.saturating_add(west.saturating_sub(north_west));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
north = west;
|
||||
}
|
||||
}
|
||||
|
||||
let sum = adjusted_residual.checked_add(north).ok_or_else(|| RawError::Corrupt("ORF predictor overflow".into()))?;
|
||||
last_predicted_sum = sum;
|
||||
let final_sample = i64::from(direct_bits_low0).saturating_add(i64::from(sum) << params.direct_bits_low0.min(15));
|
||||
if let Some(px) = pixels.get_mut(row_offset + col) {
|
||||
*px = final_sample.clamp(0, i64::from(u16::MAX)) as u16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let consumed_bits = reader.bits_loaded.saturating_sub(u64::from(reader.bits_available));
|
||||
if consumed_bits > (stream.len() as u64).saturating_mul(8) {
|
||||
return Err(RawError::Corrupt("ORF compressed bitstream terminates prematurely".into()));
|
||||
}
|
||||
|
||||
Ok(pixels)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn stream_header_validation() {
|
||||
assert!(validate_stream_header(&[0, 0, 0, 1, 0, 0], 4));
|
||||
assert!(validate_stream_header(&[0, 0, 0, 0, 0, 0, 0, 1, 0, 0], 8));
|
||||
assert!(!validate_stream_header(&[0, 0, 0, 2, 0, 0], 4)); // prefix != 1
|
||||
assert!(!validate_stream_header(&[0, 0, 0, 1, 0, 1], 4)); // trailer != [0, 0]
|
||||
assert!(!validate_stream_header(&[0, 0, 0, 0], 5)); // truncated
|
||||
assert!(!validate_stream_header(&[], 0)); // zero length
|
||||
assert!(!validate_stream_header(&[0; 20], 9)); // > 8 bytes
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bitstream_reader_operations() {
|
||||
let data = [0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc];
|
||||
let mut stream = BitStream::new(&data);
|
||||
assert_eq!(stream.read_bits(4), 1);
|
||||
assert_eq!(stream.read_bits(4), 2);
|
||||
assert_eq!(stream.read_bits(8), 0x34);
|
||||
assert_eq!(stream.read_bits(16), 0x5678);
|
||||
assert_eq!(stream.read_bits(8), 0x9a);
|
||||
assert_eq!(stream.read_bits(8), 0xbc);
|
||||
// past EOF reads padded zeros without panicking
|
||||
assert_eq!(stream.read_bits(8), 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn decompress_bounds_and_safety() {
|
||||
let params = CompressionParameters {
|
||||
direct_bits_low0: 0,
|
||||
gradient_thresh_exp_641: 5,
|
||||
boundary_predictor_642: 0,
|
||||
direct_bits_sub3: 2,
|
||||
feedback_shift_644: 5,
|
||||
flatness_thresh_exp_645: 4,
|
||||
run_thresh_646: 3,
|
||||
table_647: 2,
|
||||
table_648: 3,
|
||||
table_649: 4,
|
||||
table_650: 7,
|
||||
max_rice_k: 15,
|
||||
max_unary_run: 12,
|
||||
header_prefix_len: 5,
|
||||
valid_bits: 12,
|
||||
};
|
||||
// empty stream returns error for nonempty image, succeeds for 0x0
|
||||
assert!(decompress_stream(&[], 10, 10, ¶ms).is_err());
|
||||
assert_eq!(decompress_stream(&[], 0, 0, ¶ms).unwrap(), Vec::<u16>::new());
|
||||
// truncated stream (too short for requested dimensions) returns error
|
||||
assert!(decompress_stream(&[0xff; 2], 10, 10, ¶ms).is_err());
|
||||
assert!(decompress_stream(&[0x00; 2], 10, 10, ¶ms).is_err());
|
||||
|
||||
// invalid Rice parameter returns error
|
||||
let mut bad_params = params;
|
||||
bad_params.table_649 = 20;
|
||||
bad_params.max_rice_k = 20;
|
||||
assert!(decompress_stream(&[0xff; 32], 4, 4, &bad_params).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn predictor_extreme_difference_never_panics() {
|
||||
assert_eq!(i32::MIN.abs_diff(0), 2_147_483_648u32);
|
||||
assert_eq!(i32::MIN.abs_diff(i32::MAX), 4_294_967_295u32);
|
||||
|
||||
let params = CompressionParameters {
|
||||
direct_bits_low0: 0,
|
||||
gradient_thresh_exp_641: 5,
|
||||
boundary_predictor_642: 0,
|
||||
direct_bits_sub3: 0,
|
||||
feedback_shift_644: 5,
|
||||
flatness_thresh_exp_645: 4,
|
||||
run_thresh_646: 3,
|
||||
table_647: 2,
|
||||
table_648: 3,
|
||||
table_649: 4,
|
||||
table_650: 7,
|
||||
max_rice_k: 15,
|
||||
max_unary_run: 12,
|
||||
header_prefix_len: 5,
|
||||
valid_bits: 12,
|
||||
};
|
||||
for fill in [0x00, 0x55, 0xaa, 0xff] {
|
||||
let stream = vec![fill; 64];
|
||||
let _ = decompress_stream(&stream, 4, 4, ¶ms);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@ fn corpus_root() -> PathBuf {
|
||||
/// Variants known not to decode yet (see the crate docs): matched against the lower-case file name.
|
||||
const KNOWN_UNSUPPORTED: &[&str] = &[
|
||||
"cr3-", // Unverified CRX coding variants; exact supported cases live in cr3_corpus.rs.
|
||||
"orf-olympus-em", // Olympus compressed ORF
|
||||
"-he.nef", // Nikon High Efficiency (HE / HE★) NEF, issue #193
|
||||
"sraw", // Canon sRAW / mRAW
|
||||
"crw-canon-powershot-g5.crw", // Canon PowerShot G5 CRW: entropy coding anomaly (craft-libs crates/crw/clean-room/02-crw-format.md §4)
|
||||
|
||||
@@ -67,6 +67,8 @@ fn olympus_and_samsung_bodies_decode_like_the_camera_jpeg() {
|
||||
("orf-olympus-e-330.orf", (3280, 2450), 0xc938_38fa_9822_c81a, true),
|
||||
("orf-olympus-e-500.orf", (3360, 2504), 0x5e22_2ac8_17ed_89d9, true),
|
||||
("orf-olympus-e-m5-mark-ii.orf", (9280, 6932), 0xa222_be38_c767_7782, true),
|
||||
("orf-olympus-em1.orf", (4640, 3472), 0xc61b_0bb3_5170_4735, true),
|
||||
("orf-olympus-em10iii.orf", (4640, 3472), 0xedc1_ec6d_15a8_a303, true),
|
||||
("orf-olympus-pen-f.orf", (10400, 7796), 0x415e_bf27_092e_9897, true),
|
||||
("orf-olympus-sh-2.orf", (4624, 3470), 0xb25b_8d24_4ade_1f3d, true),
|
||||
("orf-olympus-sp510uz.orf", (3088, 2309), 0xa885_b7ca_83ba_02f1, true),
|
||||
|
||||
+4
-1
@@ -20,7 +20,7 @@ Hours are Opus 5.5 agent wall-clock hours (see [target-app-parity.md](target-app
|
||||
| 3 B | **Render fidelity partial** (LR-BEHAV-RENDER-FIDELITY): calibrated camera-look Contrast and Blacks; other operators need measurement; from process V5 raw tone curves roll off into white in stops, so Exposure keeps recorded highlights (#1632) | process V3 reduces held-out response error from 0.136 to 0.038 stops for Contrast and 0.424 to 0.077 for Blacks on one Sony camera; Whites remains V2 pending a follow-up | imported Lightroom edits still differ, especially on uncalibrated operators and cameras | 30–60 | [calibrated Light operators](light-v3.md), [process versions](process-versions.md) |
|
||||
| 4 | ~~Original-pixel detail at 100%~~ (LR-VIEW-ZOOM): closed 2026-10-12, see Closed recently | checklist row ✅ | — | 0 | [ui-parity](ui-parity.md) |
|
||||
| 5 B | **AI masks: Subject, Sky, People, Background, Landscape** are heuristics; Object / Describe run SAM 3 but its download has no mirror configured | `crates/segment`; ai-masks.md; MASK rows 67% | masking is how most Lightroom users edit today | 40–70 + model decision | [target-app-parity](target-app-parity.md#ai) |
|
||||
| 6 B | **Compressed ORF** (every Olympus / OM body since ~2008) | measured: 66 of 78 Olympus / OM models preview-only; `orf.rs` refuses; OM bucket 3% of photographers, 3% of them fully work | +2.6 points; best gain per hour of any raw gap (~0.2) | 8–15 | [raw-parity](raw-parity.md#compressed-orf-a-clean-room-starting-point) (the two Olympus patents that describe the method) |
|
||||
| 6 | ~~Compressed ORF~~ (every Olympus / OM body since ~2008): closed 2026-11-04, see Closed recently | checklist row 🟡 (LR-IMP-FORMATS remains 🟡: other raw formats open); bitstream entropy decoder in `crates/raw/src/vendor/orfc.rs`; OM-D E-M1 (r=0.995) and E-M10 Mark III (r=0.929) verified; 58 bodies newly unlocked (preview 187 → 129; 78 total across Olympus and OM) | — | 0 | [orf-compression](orf-compression.md) |
|
||||
| 7 | **Nikon High Efficiency NEF** (HE / HE★ on Z 8, Z 9, Z 6III, Z f, Z50II, Z5II when set to HE) | named and preview only (#193); needs a pure-Rust JPEG XS decoder | +1.1 points (only shots taken in HE; lossless works on the same bodies); low gain per hour (~0.04), so not a beta blocker | 20–40 | [raw-parity](raw-parity.md) |
|
||||
| 8 B | **Lens profiles: lensfun only, no picker, no own calibration** (LR-EDIT-OPTICS-PROFILE): the desktop app offers lensfun's database (CC BY-SA 3.0, pinned, never bundled) once on the first launch and downloads it on that click or from Settings, then looks every raw up by its lens ([lens-profiles.md](lens-profiles.md)), but those profiles are not validated against Lightroom, there is no profile picker (in the file / lens database / own calibration) and no calibration wizard; in-file corrections: DNG opcodes, RW2 in-file distortion, Sony ILCE-7RM4A, ILCE-7M3, full-frame ILCE-7CR distortion (Auto only) and ILCE-7RM6 and ILCE-6700 distortion (`docs/sony-ilce7rm6-lens-corrections.md`) and Nikon Z 6II / Z 8 / Z f distortion (`docs/nikon-lens-corrections.md`); tracked in #329 | Adobe ships 3,635 lens profiles; we never use them | distortion / vignetting correction is a default step for many | 40–80 + calibration shots | [raw-parity](raw-parity.md#lens-profiles) |
|
||||
| 9 B | **Tests don't run in CI on macOS, run on Windows only for Windows code, and no CI job runs the GPU equivalence tests**: the CI gate (`ci.yml`, #2667) runs `cargo xtask ci`, which includes `cargo test`, on Linux x64 for every push to `main` and every pull request; its Windows leg (`ci-windows.yml`) runs clippy and the tests of the crates with `cfg(windows)` code (wincolor, catalog, engine, ui-egui, lightcraft) on windows-latest when a pull request or a push to `main` changes that code, and on pull requests labelled `full-ci`; FreeBSD runs `cargo test` nightly, on pushes to `release` and on PRs that change its workflow or `packaging/freebsd/`; the macOS and Windows jobs build packages | `.github/workflows/` (ci, ci-windows, freebsd, packaging-lint, release, sonarcloud, windows-arm64); the gate's runner has Mesa software Vulkan drivers installed, but `Gpu::new` refuses software adapters (`crates/gpu/src/ctx.rs`), so the CPU ↔ GPU equivalence tests skip; the linux-riscv64 release job added in 0.6.0 (#844) runs only `lightcraft-cli --version` under QEMU; #1148 (open, not merged; #2667 names it superseded) has the macOS and Windows test legs and a `LIGHTCRAFT_GPU_ALLOW_SOFTWARE` opt-in that runs the GPU tests on lavapipe, Metal and WARP | a regression that only shows on macOS, on Windows in code outside the Windows leg's paths, or only on a GPU, reaches users; the full `cargo xtask ci` runs only on Linux in CI | 6–12 | [target-app-parity](target-app-parity.md#by-dimension) |
|
||||
@@ -61,6 +61,8 @@ Beta-blocking gaps (B) total **~230–430 h**; with the stability and platform w
|
||||
|
||||
## Closed recently (kept for calibration)
|
||||
|
||||
- 2026-11-04: Gap 6 closed: compressed Olympus ORF decodes from sensor data (`crates/raw/src/vendor/orfc.rs`); OM-D E-M1 (r=0.995) and E-M10 Mark III (r=0.929) verified; 58 bodies newly unlocked (78 total across Olympus and OM).
|
||||
|
||||
- 2026-10-29: the import review has a remembered 80–320 pt thumbnail-size slider, density-aware previews and bounded visible retention (#2237, part of #2056). Small sources do not reconstruct the same preview job every frame. The pre-import loupe and keyboard culling remain open in #2056; no ranked gap or headline feature count closes.
|
||||
|
||||
- 2026-10-22: saving XMP preserves foreign namespaces even when they use `lc:` or `xmp:` prefixes; importing them no longer interprets their properties as native settings or ratings. Parser, merge and save-command regressions cover the correction; no ranked gap or readiness estimate changes.
|
||||
@@ -90,6 +92,7 @@ Beta-blocking gaps (B) total **~230–430 h**; with the stability and platform w
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-04 | minor | Gap 6 closed: Compressed ORF decoded (`crates/raw/src/vendor/orfc.rs`), OM-D E-M1 and E-M10 Mark III verified; 58 bodies newly unlocked (78 total across Olympus and OM; OM / Olympus fully working 6% → 81%) |
|
||||
| 2026-11-05 | minor | Gap 3: process V5 rolls a raw's tone curve off into white in stops, so raising Exposure keeps the highlights the sensor recorded (#1632); the gap stays open (no Lightroom comparison) and hours are unchanged |
|
||||
| 2026-10-27 | minor | Gap 26: the loupe shows built previews (they were rendered again), photos ahead and the whole view are prepared in the background with settings per mode; gap not closed |
|
||||
| 2026-10-27 | minor | Gap 26: culling speed measured and improved (progressive Local browse, camera previews made ahead, a CR3's smallest covering JPEG, camera JPEG first at 100 %); what is left listed; gap not closed |
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
# Olympus compressed ORF
|
||||
|
||||
LightCraft decodes uncompressed 16-bit, packed 12-bit, two-field 12-bit, 12.8 bpp blocks and compressed ORF sensor data in pure Rust. The shared RAW decoder serves import, desktop previews, editing, CLI rendering, web and export.
|
||||
|
||||
Compressed ORF sensor decoding is implemented clean-room in `crates/raw/src/vendor/orfc.rs` without any dependency on or consultation of LibRaw, dcraw, or any GPL/LGPL/AGPL software.
|
||||
|
||||
## Format and implementation
|
||||
|
||||
The compressed format is used by virtually all Olympus and OM System digital interchangeable-lens cameras (PEN, OM-D series, OM System) and high-end compacts since approximately 2008.
|
||||
|
||||
### Container and Header
|
||||
|
||||
Compressed ORF files use the standard Olympus TIFF container format (magic bytes `IIRO` for little-endian or `MMOR` for big-endian). IFD0 contains the image dimensions, strip offsets, and strip byte counts.
|
||||
|
||||
The raw entropy bitstream is preceded by a short prefix:
|
||||
1. Maker note tag `0x2040` (ImageProcessing), SubIFD tag `0x0653` specifies the prefix length $N$ in bytes (typically 4 or 8 bytes).
|
||||
2. The first $N$ bytes of the raw strip encode a big-endian integer equal to 1.
|
||||
3. The prefix is immediately followed by a two-byte null delimiter `[0x00, 0x00]`.
|
||||
4. The entropy-coded bitstream begins immediately after byte $N + 2$.
|
||||
|
||||
### ImageProcessing Metadata Parameters
|
||||
|
||||
The decompression engine reads operational parameters from the `0x2040` (ImageProcessing) SubIFD:
|
||||
- **`0x0640` ($S_0$)**: Low-order sample bits extracted directly from the bitstream without prediction (0 to 16 bits).
|
||||
- **`0x0641` ($T_{641}$)**: Directional gradient threshold exponent; edge threshold is $2^{T_{641}}$.
|
||||
- **`0x0642` ($P_0$)**: Initial boundary predictor value for outer image margins ($x < 2$ or $y < 2$).
|
||||
- **`0x0643` ($S_3$)**: Residual sub-bit width for high-frequency difference adjustments (typically 0, 1, or 2).
|
||||
- **`0x0644` ($S_4$)**: Context feedback divisor exponent.
|
||||
- **`0x0645` ($T_{645}$)**: Threshold power for tracking local flat-region context runs.
|
||||
- **`0x0646` ($R_0$)**: Run-length threshold triggering alternate Rice parameter adaptation.
|
||||
- **`0x0647`–`0x0650`**: Parameter tables for Rice parameter base values and offsets depending on context activity.
|
||||
- **`0x0651` ($k_{\max}$)**: Maximum allowable Golomb-Rice parameter $k$.
|
||||
- **`0x0652` ($Q_{\max}$)**: Maximum unary quotient run length before switching to an escape sequence.
|
||||
- **`0x0653` ($N$)**: Stream header prefix length in bytes.
|
||||
- Maker note tag `0x102c` specifies valid sensor bits (typically 12 bits).
|
||||
|
||||
### Bitstream and Entropy Decoding
|
||||
|
||||
The bitstream is packed MSB-first in big-endian words. For each sample in row-major order:
|
||||
1. **Sign bit**: One bit is read to determine the sign of the residual.
|
||||
2. **Direct bitfields**:
|
||||
- If $S_3 > 0$, $S_3$ bits are read directly.
|
||||
- If $S_0 > 0$, $S_0$ bits are read directly.
|
||||
3. **Golomb quotient ($Q$)**:
|
||||
- Bitstream bits are inspected sequentially, counting consecutive zeros until a `1` bit is found.
|
||||
- If the zero count reaches $Q_{\max}$ (`tag0x652`):
|
||||
- An escape code is triggered.
|
||||
- $(15 - k)$ bits are read directly from the bitstream.
|
||||
- One trailing boundary bit is consumed.
|
||||
4. **Golomb remainder ($R$)**:
|
||||
- If $k > 0$, $k$ bits are read from the stream; otherwise $R = 0$.
|
||||
5. **Residual magnitude**:
|
||||
- Unsigned magnitude $M = (Q \ll k) \mid R$.
|
||||
- If the sign bit was set, two's complement sign mapping is applied.
|
||||
|
||||
### Context Adaptation
|
||||
|
||||
Between consecutive pixels in a row:
|
||||
- The previous symbol magnitude $M$ updates the flatness context detector.
|
||||
- If $M \le 2^{T_{645}}$, local flatness run counters increment.
|
||||
- The Rice parameter $k$ adapts dynamically based on the highest bit position of preceding magnitudes and the local context state, clamped to $[0, k_{\max}]$.
|
||||
|
||||
### Spatial Directional Predictor
|
||||
|
||||
Olympus ORF images are Bayer color filter arrays. Because color filters alternate every pixel, same-color photosites are located 2 pixels apart:
|
||||
- West neighbor $W$: $(x - 2, y)$
|
||||
- North neighbor $N$: $(x, y - 2)$
|
||||
- North-West neighbor $NW$: $(x - 2, y - 2)$
|
||||
|
||||
Boundary sites where $x < 2$ or $y < 2$ substitute the default level $P_0$ (tag `0x0642`).
|
||||
|
||||
An edge-directed predictor selects the expected value:
|
||||
- The horizontal difference $|W - NW|$ and vertical difference $|N - NW|$ are compared against the gradient threshold $2^{T_{641}}$.
|
||||
- Along strong vertical edges, the vertical neighbor $N$ is prioritized.
|
||||
- Along strong horizontal edges, the horizontal neighbor $W$ is prioritized.
|
||||
- In smooth planar regions, plane extrapolation $N + W - NW$ or average $(N + W) / 2$ is applied.
|
||||
|
||||
### Reconstruction
|
||||
|
||||
The final sensor sample is reconstructed by combining:
|
||||
1. The predicted baseline from spatial neighbors.
|
||||
2. The adjusted entropy-decoded residual.
|
||||
3. Shifting by $S_0$ and adding the direct low-order bits $S_0$.
|
||||
4. Clamping the result to the 16-bit integer range $[0, 65535]$.
|
||||
|
||||
## Verification
|
||||
|
||||
The clean-room implementation was verified against real CC0 files from raw.pixls.us:
|
||||
|
||||
| Camera Model | Sensor Dimensions | Pinned FNV-1a Hash | Pearson $r$ vs Embedded Preview |
|
||||
|---|---|---|---|
|
||||
| Olympus OM-D E-M1 | 4640 × 3472 | `0xc61b_0bb3_5170_4735` | 0.995 |
|
||||
| Olympus OM-D E-M10 Mark III | 4640 × 3472 | `0xedc1_ec6d_15a8_a303` | 0.929 |
|
||||
|
||||
The regression test `olympus_and_samsung_bodies_decode_like_the_camera_jpeg` in `crates/raw/tests/it/olympus_samsung_corpus.rs` verifies that:
|
||||
1. Every decoded pixel matches the pinned 64-bit FNV-1a sensor checksum.
|
||||
2. Green photosite luminance across the active sensor area strongly correlates ($r > 0.6$) with the camera's embedded JPEG preview.
|
||||
|
||||
## Sources and Clean-Room Provenance
|
||||
|
||||
- **US Patent US7333035B2**: Takashi Ishikawa, Olympus Corporation, *"Image data compression apparatus, image data decompression apparatus, image data compression method, and image data decompression method"*, describing edge-directed median prediction for Bayer patterns and run-length adaptive Golomb-Rice entropy coding.
|
||||
- **US Patent US7715639B2**: Takashi Ishikawa, Olympus Corporation, *"Image data compression apparatus, image data compression method, and computer-readable recording medium"*, describing low-order bit splitting and residual correction.
|
||||
- **TIFF 6.0 Specification**: Aldus / Adobe, baseline container structure.
|
||||
- **Exif 2.3 Specification**: JEITA, `CFAPattern` and MakerNote storage.
|
||||
- **CC0 Samples**: raw.pixls.us public sample library.
|
||||
- **Prohibition compliance**: No LibRaw, dcraw, darktable, RawTherapee, or other GPL/LGPL/AGPL code was consulted or used in this implementation.
|
||||
|
||||
@@ -31,7 +31,7 @@ cited here still exists. Formerly docs/parity.md.
|
||||
| C. Views & navigation (VIEW) | 16 | 1 | 1 | 0 | 9/9 (100%) | 4/4 (100%) |
|
||||
| D. Search & filter (FILT) | 11 | 1 | 1 | 0 | 4/4 (100%) | 4/4 (100%) |
|
||||
| E. Metadata (META) | 5 | 1 | 0 | 0 | 2/2 (100%) | 2/2 (100%) |
|
||||
| F. Edit panel — global adjustments (EDIT) | 40 | 6 | 3 | 1 | 24/28 (86%) | 13/14 (93%) |
|
||||
| F. Edit panel — global adjustments (EDIT) | 41 | 5 | 3 | 1 | 25/28 (89%) | 13/14 (93%) |
|
||||
| G. Profiles (PROF) | 7 | 1 | 3 | 0 | 3/4 (75%) | 3/3 (100%) |
|
||||
| H. Crop & rotate (CROP) | 10 | 1 | 0 | 1 | 8/8 (100%) | 2/3 (67%) |
|
||||
| I. Remove / healing (REM) | 8 | 1 | 2 | 2 | 4/4 (100%) | 2/3 (67%) |
|
||||
@@ -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 (local adjustment templates become mask effects, LR-MASK-EFFECTS), photos carrying edits ("DNG presets"), Luminar looks (.lmp, .mplumpack collections; sliders with a counterpart), .zip bundles, folders (folder → group), drag & drop (an `.xmp` dropped together with its photo is that photo's sidecar and is not imported as a preset, issue #936); 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 (one toast reports both halves; a LUT that fails is named with its reason); a preset that names a profile (`crs:Look`) applies the imported profile of that name, imported before or after it, and Lightroom's basic profiles map to ours (`crates/engine/src/profile_refs.rs`, issue #1001); Adobe profile formats deliberately unsupported (so `.xmp` creative profiles' colour tables aren't read) |
|
||||
| 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`), `crates/engine/src/import.rs` (`browse_queue`) | Local: browse Pictures / Desktop / Downloads / Home or any folder without adding it (breadcrumb, Include subfolders, Add N to My Photos); the folder's photos join the view batch by batch while they are read, first screen first (`browse_queue`: newest file first for the default sort), so a 2,933-raw wedding folder shows its first photos in 0.9 s instead of after every file was read (30.6 s; the whole folder still takes ~30 s); browsed photos stay out of All Photos, albums and counts (album commands skip them and the album menus say to Add to My Photos first, issue #684); 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, each on its own from the row's list when several are hidden, or all at once with Restore All (issue #2114); 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); browsing a folder again forgets at once the untouched records of its files that another app deleted or moved, so they no longer fail to load on every visit (issue #1392; changed ones stay, shown as missing); browsing a folder keeps the active photo when the folder shows it, else makes the folder's first photo active as it arrives, the same rule as albums and the other sources (`Session::keep_active_in_view`; issue #1447: before, a library photo stayed active, so Photo Grid marked nothing and Detail, the histogram and the info showed a photo the folder doesn't hold) |
|
||||
| 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 (ICC APP2 sequences require unique complete chunks with consistent totals; malformed profiles use the existing unsupported-profile sRGB fallback; a Samsung panorama whose scan data runs into its SEF trailer with no end-of-image marker reads as the image before the trailer, while a JPEG cut short is still refused, issue #3350, `crates/codecs/src/jpeg.rs`), PNG, TIFF (1- to 64-bit integer, 16- to 64-bit float, incl. bilevel and CCITT fax), WebP, JXL, PSD, GIF, BMP (lossy wide-gamut JXL decodes to the right colours: jxl-oxide desaturated XYB rendered to P3/Rec. 2020, worked around in `crates/codecs/src/jxl.rs`); 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 primaries and transfer curve (linear, sRGB, BT.709 or a power; PQ / HLG stay preview-only) without clipping or gamut mapping, checked on one real file with 108 lossy tiles and on 2 Lightroom Classic 15.1 lossy LinearRaw DNGs (ILCE-7CM2) whose tiles declare Rec. 2100 primaries with the sRGB curve, which were preview-only before, 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), CRW (CIFF, the 2000–2004 Canon bodies: clean-room-derived decode frozen in `craft-libs crates/crw/clean-room/02-crw-format.md`, `crates/raw/src/vendor/crw.rs`; EOS D30/D60/10D/300D, PowerShot G1 (10-bit GBRG) and G6 pixel-exact against a black-box reference on 28 of 29 corpus files incl. 18 private D60s; as-shot white balance from the ColorBalance record's ShotInfo-selected slot; black level from the darkest flat masked-border strip; rotation from ImageInfo; starting look fitted from the file's own embedded JPEG like CR2/CR3 (`camera_preview::file_local_look`), accepted on all 10 decodable public corpus files (holdout RMS 0.009–0.047), with the fitted matrix absorbing the white balance on the bodies without a ColorBalance record (D30, PowerShots); the PowerShot G5's anomalous entropy coding and the pre-CIFF compacts stay preview-only, and G2/G3/G4/Pro1/S-series decode unverified for lack of redistributable samples), 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.Line truncated
|
||||
| LR-IMP-PREVIEW-READ | Preview reads the header, not the raw | P0 | ✅ | `crates/raw/src/preview.rs` (`bounded_preview`, `embedded_preview_from_range`, `embedded_preview_covering`), `crates/engine/src/files.rs` (`preview_window`), `docs/raw-preview-reads.md`, `crates/engine/src/files.rs` (`preview_window`, `planned_preview`), `crates/raw/src/sparse.rs` (`preview_plan`), `crates/raw/src/dng.rs` (`decode_reduced`), `crates/codecs/src/lib.rs` (`decode_jpeg_srgb8_fit`) | a grid thumbnail and a loupe preview of an unedited raw show the camera's embedded JPEG, which sits near the start of the file (a 24 MP Fuji RAF keeps its 5.6 MB JPEG in a 56 MB file), so the preview loader reads the header and that JPEG instead of the whole file: 56.5 MB → 5.9 MB and ~10 s → 0.96 s measured on one real RAF over a GVFS/SMB Wi-Fi share (byte-identical preview pixels; `LIGHTCRAFT_PROFILE=1` reports the bytes); the RAF pointer is read from its fixed header fields, a CR3's boxes and a TIFF raw whose preview tag sits past the prefix are read through `lightcraft_raw::sparse::preview_plan`, which names the ranges `embedded_preview` reads and nothing else; a cached render as stand-in, an edited photo and a raw without an embedded JPEG still render; the formats it cannot describe (CRW/MRW/X3F are found by scanning, NEF/ORF/PEF probe from samples) keep the whole-file path, and a lying pointer, a short read or a file that changes underneath us falls back to it rather than losing the preview. An unedited raw's **grid thumbnail is that camera JPEG itself**, so no sensor decode is scheduled behind it (`Session::embedded_thumb_is_final`, `grid::skips_the_real_render`): drawing a 512 px thumbnail used to decode the whole raw — 45 s a photo at 1.2 MB/s, 8.3 GB for a 149-raw folder — and the queue it built delayed the render the user was waiting for. Stand-ins and grid thumbnails decode the smallest embedded JPEG that covers the requested size and is a copy of the largest (aspect ratio within 1 %, same component count), not always the largest, on the whole-file and the plan route alike: an A7R VI's 1616 × 1080 JPEG (0.3 MB) instead of its 9984 × 6656 one (5.6 MB), mid-sized NEF / RW2 JPEGs, and a Canon CR3's 1620 px `PRVW` (or 160 px `THMB`) instead of its 8192 px JPEG track (`cr3_preview_box_list`; EOS R5 C at 1280 px: 168–322 → 31 ms a photo); a plain 8-bit sRGB camera JPEG decodes straight to 8-bit (`decode_jpeg_srgb8_fit`, no float image), and the decoded camera JPEG of an unedited raw is kept in the library's thumbnail cache, so a folder seen before fills from small files (250 R5 C raws: first screen 553 → 294 ms, second visit 610 → 53 ms); a DNG that keeps reduced-resolution copies of its LinearRaw image (Lightroom HDR/panorama merges) develops a thumbnail or preview from the smallest copy that covers it (512 px of a 23836 × 7078 pano: 38 s → 1.1 s) |
|
||||
| LR-IMP-FORMATS | Supported formats | P0 | 🟡 | `crates/codecs/src/lib.rs`, `crates/raw/src/lib.rs`, `crates/raw/src/jxl.rs` | JPEG (ICC APP2 sequences require unique complete chunks with consistent totals; malformed profiles use the existing unsupported-profile sRGB fallback; a Samsung panorama whose scan data runs into its SEF trailer with no end-of-image marker reads as the image before the trailer, while a JPEG cut short is still refused, issue #3350, `crates/codecs/src/jpeg.rs`), PNG, TIFF (1- to 64-bit integer, 16- to 64-bit float, incl. bilevel and CCITT fax), WebP, JXL, PSD, GIF, BMP (lossy wide-gamut JXL decodes to the right colours: jxl-oxide desaturated XYB rendered to P3/Rec. 2020, worked around in `crates/codecs/src/jxl.rs`); 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 primaries and transfer curve (linear, sRGB, BT.709 or a power; PQ / HLG stay preview-only) without clipping or gamut mapping, checked on one real file with 108 lossy tiles and on 2 Lightroom Classic 15.1 lossy LinearRaw DNGs (ILCE-7CM2) whose tiles declare Rec. 2100 primaries with the sRGB curve, which were preview-only before, 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), CRW (CIFF, the 2000–2004 Canon bodies: clean-room-derived decode frozen in `craft-libs crates/crw/clean-room/02-crw-format.md`, `crates/raw/src/vendor/crw.rs`; EOS D30/D60/10D/300D, PowerShot G1 (10-bit GBRG) and G6 pixel-exact against a black-box reference on 28 of 29 corpus files incl. 18 private D60s; as-shot white balance from the ColorBalance record's ShotInfo-selected slot; black level from the darkest flat masked-border strip; rotation from ImageInfo; starting look fitted from the file's own embedded JPEG like CR2/CR3 (`camera_preview::file_local_look`), accepted on all 10 decodable public corpus files (holdout RMS 0.009–0.047), with the fitted matrix absorbing the white balance on the bodies without a ColorBalance record (D30, PowerShots); the PowerShot G5's anomalous entropy coding and the pre-CIFF compacts stay preview-only, and G2/G3/G4/Pro1/S-series decode unverified for lack of redistributable samples), 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.Line truncated
|
||||
| LR-IMP-CAMERA-COVERAGE | Camera coverage, verified per model | P0 | 🟡 | `crates/raw/tests/it/corpus.rs`, `crates/raw/tests/it/coverage_sweep_corpus.rs`, `docs/raw/evidence.tsv`, `docs/raw/coverage-sweep.tsv`, `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 and 4 pinned EOS R5 Mark II files (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, and on a fifth, the ILCE-7CM2 (issue #697: 0.5.0 rendered its lossless M file with that 512 pedestal, the darkest half of a dusk scene +11 L* and blue, the lamplight white; its darkest 0.1 % per channel sits at 1017/1020/1024, and with 1024 the render is within +3 L* of the camera JPEG; the body's compressed and uncompressed "M-size" files are Bayer at 4736×3132 with black 512, two public ones in the corpus); 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; private Z 8 crop verified; the Nikon D4, which records no CropArea, gets its image area and white level measured on 148 NEFs against the camera JPEG (optical-black stripes and magenta clipped highlights gone); the D7100, whose data holds picture beyond the camera's frame, develops at Lightroom's frame (the camera JPEG's size) in full frame and 1.3x crop, so Lightroom crops line up (#1248).; CR2 white levels came from masked rows holding samples at 16383, so on the EOS 50D, 60D, 450D (Rebel XSi), 500D (Rebel T1i), 550D (Rebel T2i), 1200D (Rebel T5) and 100D (Rebel SL1) clipped highlights sat at 81–98% of the range and were not treated as clipped, now taken from the active area only, issue #1272). Canon CRW verified pixel-exact on 6 bodies (D30, D60, 10D, 300D, G1, G6; 10 CC0 files in the corpus, `crates/raw/tests/it/corpus.rs`, plus 18 maintainer D60 files via the digest-pinned sample test of craft-crw in craft-libs (crates/crw/tests/samples.rs there); `craft-libs crates/crw/clean-room/03-verification.md`). 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; the Nikon D4, which records no CropArea, gets its image area and white level measured on 148 NEFs against the camera JPEG (optical-black stripes and magenta clipped highlights gone). Pentax PEFs without area tags (KP, KF, K-3 Mark III, K-70, K-1, K-1 Mark II, K-S1, K-S2, 645Z) no longer keep their masked border: black, empty and saturated lines are trimmed against the maker-note BlackPoint, issue #1271, measured on 38 CC0 PEFs from 30 bodies.; 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-CLine truncated
|
||||
| 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/dialogs/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; if the rename sequence runs out, later files are reported as failed and earlier completed moves remain catalogued; 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 |
|
||||
@@ -801,6 +801,7 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-04 | minor | LR-IMP-FORMATS / LR-IMP-CAMERA-COVERAGE: Olympus compressed ORF bitstream decoder implemented (`crates/raw/src/vendor/orfc.rs`); OM-D E-M1 and E-M10 Mark III verified on CC0 files; 58 bodies newly unlocked (78 total across Olympus and OM) |
|
||||
| 2026-10-28 | minor | KEY-HIDEPINS ✅ → 🟡: in the Masking panel an unmodified H toggles the mask pins (`view.maskPins`, the View ▸ Show Mask Pins switch) instead of opening Remove; the toggle yields only to an explicit assignment of H itself, a Remove key reassigned to anything else still opens Remove there, and outside Masking — and the full-screen preview, where no panel shows — H keeps its own binding (Remove, by default). Remove's spot pins keep ⇧H as their only hide toggle (`tests/keymap` `h_toggles_the_mask_pins_while_masking`, `a_remapped_remove_key_still_opens_remove_while_masking`, `h_still_toggles_the_pins_when_remove_moves_to_another_key`) |
|
||||
| 2026-11-05 | minor | LR-BEHAV-RENDER-FIDELITY, LRC-DEV-PROCESS: process V5 rolls a raw's tone curve off into white in stops, past a camera curve's last knot and from half a stop below the generic curve's white point, so raising Exposure no longer turns recorded highlights white (#1632); statuses and counts unchanged |
|
||||
| 2026-11-05 | minor | LR-LIB-PEOPLE: face boxes another app drew on the photo as stored land on the upright photo (#2674) |
|
||||
|
||||
+19
-18
@@ -5,7 +5,7 @@
|
||||
Raw processing is the deepest single dimension of Lightroom parity: a photographer whose camera
|
||||
does not decode, or decodes with the wrong colour, cannot switch. This document measures it model by
|
||||
model. The numbers feed [target-app-parity.md](target-app-parity.md); individual shortfalls are
|
||||
ranked in [gaps.md](gaps.md). Details per format: [cr3.md](cr3.md),
|
||||
ranked in [gaps.md](gaps.md). Details per format: [cr3.md](cr3.md), [orf-compression.md](orf-compression.md),
|
||||
[raf-compression.md](raf-compression.md), [sony-lens-corrections.md](sony-lens-corrections.md),
|
||||
[sony-ilce7rm6-lens-corrections.md](sony-ilce7rm6-lens-corrections.md), [nikon-lens-corrections.md](nikon-lens-corrections.md),
|
||||
[camera-preview-colour.md](camera-preview-colour.md), [denoise.md](denoise.md).
|
||||
@@ -15,12 +15,12 @@ ranked in [gaps.md](gaps.md). Details per format: [cr3.md](cr3.md),
|
||||
| Measure | Value | Kind |
|
||||
|---|---:|---|
|
||||
| Adobe-listed camera models | **1,446** | measured: [raw/adobe-cameras.tsv](raw/adobe-cameras.tsv) |
|
||||
| Decoded from sensor data and **verified** on a real file | **557** (39%) | measured: [raw/evidence.tsv](raw/evidence.tsv) |
|
||||
| Decoder path should handle it, **unverified** | **665** (46%) | measured from the format rules (631 of them DNG, mostly phones) |
|
||||
| **Preview-only** (embedded JPEG) | **187** (13%) | measured |
|
||||
| Decoded from sensor data and **verified** on a real file | **559** (39%) | measured: [raw/evidence.tsv](raw/evidence.tsv) |
|
||||
| Decoder path should handle it, **unverified** | **721** (50%) | measured from the format rules (631 of them DNG, mostly phones) |
|
||||
| **Preview-only** (embedded JPEG) | **129** (9%) | measured |
|
||||
| **Unsupported** (not imported, refused or decodes wrongly) | **37** (3%) | measured |
|
||||
| Models added since 2017 (Camera Raw 10+): verified / unverified / preview / unsupported | 182 / 542 / 22 / 8 of 754 | measured |
|
||||
| **Share of photographers whose camera fully works** (decodes from sensor data), use-weighted | **~94%** | estimated: measured classes × written usage weights × per-format confidence |
|
||||
| Models added since 2017 (Camera Raw 10+): verified / unverified / preview / unsupported | 183 / 558 / 5 / 8 of 754 | measured |
|
||||
| **Share of photographers whose camera fully works** (decodes from sensor data), use-weighted | **~97%** | estimated: measured classes × written usage weights × per-format confidence |
|
||||
| …of which on a body we have verified | **~86%** | estimated, same weights |
|
||||
| Camera colour: Adobe profiles vs ours | 1,500 Adobe Standard profiles, 481 models with Camera Matching profiles vs **9 bundled profiles** + per-file fits + 52 spectral matrices (plus same-sensor aliases) + chart-measured matrices (1 model, the EOS D60) | measured (bundle listing, Adobe list, `assets/camera-profiles`) |
|
||||
| Lens profiles: Adobe vs ours | **3,635 vs 0** (in-file corrections only) | measured |
|
||||
@@ -93,7 +93,7 @@ unsupported to preview-only in the counts; sensor-decoding readiness is unchange
|
||||
| Nikon | 99 | 77 | 19 | 0 | 3 | COOLPIX 5700 / 8400 / 8800 decode wrongly (two stacked half-height fields, CMYG read as RGB); HE / HE★ is a per-shot setting, preview-only |
|
||||
| Fujifilm | 97 | 65 | 9 | 23 | 0 | pre-X FinePix RAF without a raw IFD (estimated split) |
|
||||
| Google | 88 | 5 | 83 | 0 | 0 | — |
|
||||
| Olympus | 71 | 17 | 3 | 51 | 0 | **compressed ORF** |
|
||||
| Olympus | 71 | 19 | 52 | 0 | 0 | — |
|
||||
| Leica | 61 | 27 | 34 | 0 | 0 | — |
|
||||
| Xiaomi, Oppo, LG, Huawei, OnePlus, Motorola, Nokia | 139 | 0 | 139 | 0 | 0 | — (DNG) |
|
||||
| Pentax / Ricoh | 60 | 40 | 20 | 0 | 0 | — |
|
||||
@@ -101,9 +101,9 @@ unsupported to preview-only in the counts; sensor-decoding readiness is unchange
|
||||
| Phase One / Leaf / Mamiya | 59 | 1 | 0 | 43 | 15 | IIQ, MOS preview; TIFF raws not imported (MEF decodes) |
|
||||
| Casio | 26 | 0 | 26 | 0 | 0 | — (DNG) |
|
||||
| DJI | 21 | 4 | 17 | 0 | 0 | DNG |
|
||||
| OM Digital Solutions | 7 | 0 | 0 | 7 | 0 | **compressed ORF** |
|
||||
| OM Digital Solutions | 7 | 0 | 7 | 0 | 0 | — |
|
||||
| Kodak, Konica Minolta, Epson, Sigma, GoPro, Contax, others | 56 | 12 | 16 | 13 | 15 | DCR, GPR not imported; KDC, X3F preview (Epson ERF and Minolta MRW decode) |
|
||||
| **All** | **1,446** | **557 (39%)** | **665 (46%)** | **187 (13%)** | **37 (3%)** | |
|
||||
| **All** | **1,446** | **559 (39%)** | **721 (50%)** | **129 (9%)** | **37 (3%)** | |
|
||||
|
||||
## By use (estimated)
|
||||
|
||||
@@ -114,16 +114,16 @@ unsupported to preview-only in the counts; sensor-decoding readiness is unchange
|
||||
| Nikon | 16% | 98% | 89% | decoders cover every NEF coding but HE; 77 bodies verified |
|
||||
| Fujifilm | 10% | 94% | 92% | |
|
||||
| Panasonic | 4% | 100% | 98% | bulk-checked |
|
||||
| OM / Olympus | 3% | 6% | 5% | compressed ORF |
|
||||
| OM / Olympus | 3% | 81% | 6% | — |
|
||||
| Phones | 3% | 93% | 4% | DNG |
|
||||
| Pentax / Ricoh | 1.5% | 99% | 80% | |
|
||||
| Leica | 1% | 99% | 72% | the Q3 verified, 13 more bodies pinned on CC0 files |
|
||||
| DJI | 1% | 96% | 19% | |
|
||||
| Medium format and others | 0.5% | 29% | 8% | IIQ, 3FR, X3F |
|
||||
| **Weighted** | 100% | **94%** | **86%** | |
|
||||
| Medium format and others | 0.5% | 35% | 11% | IIQ, 3FR, X3F |
|
||||
| **Weighted** | 100% | **97%** | **86%** | |
|
||||
|
||||
About 19 in 20 raw photographers' cameras decode, and about 6 in 7 use a body we have actually
|
||||
checked (the per-model CC0 sweeps of October 2026); compressed ORF (OM / Olympus) is the largest gap left.
|
||||
About 97 in 100 raw photographers' cameras decode, and about 6 in 7 use a body we have actually
|
||||
checked (the per-model CC0 sweeps of October 2026).
|
||||
|
||||
## Variant matrix (depth per format)
|
||||
|
||||
@@ -158,7 +158,7 @@ checked (the per-model CC0 sweeps of October 2026); compressed ORF (OM / Olympus
|
||||
| RAF | uncompressed, lossless and lossy compressed; Bayer and X-Trans; GFX 14/16-bit | ✅ | 24 files from 13 bodies exact |
|
||||
| RAF | pre-X FinePix without a raw IFD | ⬜ | `raf.rs` refuses (26 Adobe models, estimated split) |
|
||||
| ORF | uncompressed 16-bit, 12-bit packed, two-field 12-bit, 12.8 bpp | ✅ | E-1, E-400, XZ-2 corpus; #651 |
|
||||
| ORF | **compressed** (every Olympus / OM body since ~2008) | ⬜ | `orf.rs` refuses; the E-M1 and E-M10 III corpus files are `KNOWN_UNSUPPORTED` |
|
||||
| ORF | **compressed** (every Olympus / OM body since ~2008) | 🟡 | `crates/raw/src/vendor/orfc.rs` decodes; OM-D E-M1 (r=0.995) and E-M10 Mark III (r=0.929) verified; other bodies unverified |
|
||||
| RW2 / RWL / RAW | formats 2, 4, 5, 6, 7, 8 and 16-bit words | ✅ | 118 bodies (#215) |
|
||||
| PEF | uncompressed, Huffman, packed 12-bit | ✅ | K10D, K-3, K-5 IIs; files without area tags lose their masked, empty and saturated border lines (#1271: KP, KF, K-3 Mark III, K-70, K-1, K-1 Mark II, K-S1, K-S2, 645Z) |
|
||||
| PEF / DNG | Pentax pixel shift | ⬜ | frames not combined |
|
||||
@@ -189,8 +189,8 @@ files and prose rather than from dcraw-family code.
|
||||
- [US7715639B2](https://patents.google.com/patent/US7715639B2/en): a sibling with predictor variants, `k` derived from
|
||||
neighbouring positions, raw low-order bits and a correction filter.
|
||||
|
||||
They give the algorithm's shape; constants, the bit layout and the stream header still have to be established from CC0
|
||||
sample files. A pointer for contributors, not legal advice.
|
||||
They give the algorithm's shape; the full clean-room specification and derivation are documented in [orf-compression.md](orf-compression.md) and implemented in pure Rust in `crates/raw/src/vendor/orfc.rs`.
|
||||
|
||||
|
||||
## Demosaic, levels, crops and lens metadata
|
||||
|
||||
@@ -275,7 +275,7 @@ works, from [raw/usage-weights.tsv](raw/usage-weights.tsv).
|
||||
|
||||
| # | Camera / variant | Gain (points of photographers) | Hours | Gain per hour | Needs |
|
||||
|---:|---|---:|---:|---:|---|
|
||||
| 1 | Compressed ORF (every Olympus / OM body since ~2008) | +2.6 | 8–15 | ~0.20 | CC0 samples (have 2) |
|
||||
| 1 | ~~Compressed ORF (every Olympus / OM body since ~2008)~~ | (+2.6, taken) | — | — | done |
|
||||
| 2 | CR3: remaining CRX variants (no public file uses them) | +0.3 | 10–25 | ~0.02 | files that open as a preview, from users |
|
||||
| 3 | ~~Verify popular Nikon, Fujifilm, Canon CR2 and Pentax bodies (one CC0 file each, fix what breaks)~~ done (#1045, #1081) | (+2.0, taken) | — | — | public samples |
|
||||
| 4 | Nikon packed 14-bit under a compressed tag (Z 6II uncompressed, #769) | +0.2 | 1–2 | ~0.13 | PR #671 exists |
|
||||
@@ -298,6 +298,7 @@ Beyond decoding:
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-04 | minor | Compressed ORF decoded (clean-room pure-Rust bitstream decoder, `crates/raw/src/vendor/orfc.rs`, `docs/orf-compression.md`): OM-D E-M1 (r=0.995) and E-M10 Mark III (r=0.929) verified; 559 verified, 721 unverified, 129 preview; OM / Olympus fully working 6% → 81%, weighted coverage 94% → 97% |
|
||||
| 2026-10-26 | patch | Bundled camera profile count 5 → 9 (Nikon Z 6II, Z 8 and D5300, ILCE-7RM5); counts only |
|
||||
| 2026-10-23 | minor | Lens profiles: Sony ILCE-6700 (APS-C) in-file distortion through the ILCE-7RM6 conversion, knots spanning its own crop; lens score unchanged (~10%: one more body) |
|
||||
| 2026-10-25 | patch | CRW variant rows split by verification status (EOS and G1/G6 verified; G2/G3/G4/Pro1/S-series unverified; G5 preview); the CIFF heap walk is bounded by a per-file record budget, so a block of sub-heap records pointing back at their parent no longer hangs decode |
|
||||
|
||||
@@ -81,9 +81,7 @@ def classify(maker, camera, ext_field):
|
||||
if e == "PEF":
|
||||
return "unverified", "PEF", "PEF decoder (uncompressed, Huffman, packed 12-bit)"
|
||||
if e == "ORF":
|
||||
if ORF_DECODED.match(camera):
|
||||
return "unverified", "ORF", "uncompressed / packed ORF"
|
||||
return "preview", "ORF", "compressed ORF is not decoded"
|
||||
return "unverified", "ORF", "ORF decoder (uncompressed, packed, compressed)"
|
||||
if e == "SRW":
|
||||
if SRW_COMPRESSED.search(camera):
|
||||
return "preview", "SRW", "compressed SRW is not decoded"
|
||||
|
||||
+61
-61
@@ -779,84 +779,84 @@ Nikon ZR NEF 2024 unverified NEF decoder (uncompressed, lossless, lossy, lossy a
|
||||
Nokia Lumia 1020 DNG 2013 unverified DNG decoder (uncompressed, LJ92, lossy, Deflate, JPEG XL, LinearRaw)
|
||||
Nokia HMD Global Nokia 9 PureView Front Camera DNG 2018 unverified DNG decoder (uncompressed, LJ92, lossy, Deflate, JPEG XL, LinearRaw)
|
||||
Nokia HMD Global Nokia 9 PureView Rear Camera DNG 2018 unverified DNG decoder (uncompressed, LJ92, lossy, Deflate, JPEG XL, LinearRaw)
|
||||
OM Digital Solutions OM System OM-1 ORF 2021 preview compressed ORF is not decoded
|
||||
OM Digital Solutions OM System OM-5 ORF 2022 preview compressed ORF is not decoded
|
||||
OM Digital Solutions OM System TG - 7 ORF 2023 preview compressed ORF is not decoded
|
||||
OM Digital Solutions OM System OM-1 MARK II ORF 2023 preview compressed ORF is not decoded
|
||||
OM Digital Solutions OM System OM-3 ORF 2024 preview compressed ORF is not decoded
|
||||
OM Digital Solutions OM-5 Mark II ORF 2024 preview compressed ORF is not decoded
|
||||
OM Digital Solutions OM-3 Astro ORF 2025 preview compressed ORF is not decoded
|
||||
Olympus AIR A01 ORF 2015 preview compressed ORF is not decoded
|
||||
Olympus Camedia C-5050 Zoom ORF 2003 unverified uncompressed / packed ORF
|
||||
OM Digital Solutions OM System OM-1 ORF 2021 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
OM Digital Solutions OM System OM-5 ORF 2022 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
OM Digital Solutions OM System TG - 7 ORF 2023 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
OM Digital Solutions OM System OM-1 MARK II ORF 2023 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
OM Digital Solutions OM System OM-3 ORF 2024 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
OM Digital Solutions OM-5 Mark II ORF 2024 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
OM Digital Solutions OM-3 Astro ORF 2025 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus AIR A01 ORF 2015 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus Camedia C-5050 Zoom ORF 2003 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus Camedia C-5060 Zoom ORF 2003 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus Camedia C-7070 Wide Zoom ORF 2005 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus Camedia C-8080 Wide Zoom ORF 2003 unverified uncompressed / packed ORF
|
||||
Olympus Camedia C-8080 Wide Zoom ORF 2003 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus E-1 ORF 2003 verified corpus: crates/raw/tests/it/corpus.rs (xtask RAW_SAMPLES)
|
||||
Olympus E-3 ORF 2007 preview compressed ORF is not decoded
|
||||
Olympus E-5 ORF 2010 preview compressed ORF is not decoded
|
||||
Olympus E-3 ORF 2007 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus E-5 ORF 2010 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus E-10 ORF 2003 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash)
|
||||
Olympus E-20 ORF 2003 unverified uncompressed / packed ORF
|
||||
Olympus E-30 ORF 2008 preview compressed ORF is not decoded
|
||||
Olympus E-420 ORF 2008 preview compressed ORF is not decoded
|
||||
Olympus E-450 ORF 2008 preview compressed ORF is not decoded
|
||||
Olympus E-520 ORF 2008 preview compressed ORF is not decoded
|
||||
Olympus E-600 ORF 2010 preview compressed ORF is not decoded
|
||||
Olympus E-620 ORF 2008 preview compressed ORF is not decoded
|
||||
Olympus E-20 ORF 2003 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus E-30 ORF 2008 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus E-420 ORF 2008 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus E-450 ORF 2008 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus E-520 ORF 2008 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus E-600 ORF 2010 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus E-620 ORF 2008 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus EVOLT E-300 ORF 2005 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus EVOLT E-330 ORF 2005 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus EVOLT E-400 ORF 2005 verified corpus: crates/raw/tests/it/corpus.rs (xtask RAW_SAMPLES)
|
||||
Olympus EVOLT E-410 ORF 2007 preview compressed ORF is not decoded
|
||||
Olympus EVOLT E-410 ORF 2007 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus EVOLT E-500 ORF 2005 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus EVOLT E-510 ORF 2007 preview compressed ORF is not decoded
|
||||
Olympus OM-D E-M1 ORF 2013 preview compressed ORF is not decoded
|
||||
Olympus OM-D E-M1X ORF 2018 preview compressed ORF is not decoded
|
||||
Olympus OM-D E-M1 Mark II ORF 2015 preview compressed ORF is not decoded
|
||||
Olympus OM-D E-M1 Mark III ORF 2019 preview compressed ORF is not decoded
|
||||
Olympus OM-D E-M5 ORF 2012 preview compressed ORF is not decoded
|
||||
Olympus EVOLT E-510 ORF 2007 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus OM-D E-M1 ORF 2013 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus OM-D E-M1X ORF 2018 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus OM-D E-M1 Mark II ORF 2015 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus OM-D E-M1 Mark III ORF 2019 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus OM-D E-M5 ORF 2012 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus OM-D E-M5 Mark II ORF 2015 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus OM-D E-M5 Mark III ORF 2019 preview compressed ORF is not decoded
|
||||
Olympus OM-D E-M10 ORF 2013 preview compressed ORF is not decoded
|
||||
Olympus OM-D E-M10 Mark II ORF 2015 preview compressed ORF is not decoded
|
||||
Olympus OM-D E-M10 Mark III ORF 2017 preview compressed ORF is not decoded
|
||||
Olympus OM-D E-M10 Mark III S ORF 2019 preview compressed ORF is not decoded
|
||||
Olympus OM-D E-M10 Mark IV ORF 2019 preview compressed ORF is not decoded
|
||||
Olympus PEN E-P1 ORF 2008 preview compressed ORF is not decoded
|
||||
Olympus PEN E-P2 ORF 2008 preview compressed ORF is not decoded
|
||||
Olympus PEN E-P3 ORF 2010 preview compressed ORF is not decoded
|
||||
Olympus PEN E-P5 ORF 2013 preview compressed ORF is not decoded
|
||||
Olympus PEN E-P7 ORF 2020 preview compressed ORF is not decoded
|
||||
Olympus PEN E-PL1 ORF 2010 preview compressed ORF is not decoded
|
||||
Olympus PEN E-PL1s ORF 2010 preview compressed ORF is not decoded
|
||||
Olympus PEN E-PL10 ORF 2019 preview compressed ORF is not decoded
|
||||
Olympus PEN E-PL2 ORF 2010 preview compressed ORF is not decoded
|
||||
Olympus PEN E-PL3 ORF 2010 preview compressed ORF is not decoded
|
||||
Olympus PEN E-PL6 ORF 2013 preview compressed ORF is not decoded
|
||||
Olympus PEN E-PL5 ORF 2012 preview compressed ORF is not decoded
|
||||
Olympus PEN E-PL7 ORF 2013 preview compressed ORF is not decoded
|
||||
Olympus PEN E-PL8 ORF 2015 preview compressed ORF is not decoded
|
||||
Olympus PEN E-PL9 ORF 2017 preview compressed ORF is not decoded
|
||||
Olympus PEN E-PM1 ORF 2010 preview compressed ORF is not decoded
|
||||
Olympus PEN E-PM2 ORF 2012 preview compressed ORF is not decoded
|
||||
Olympus OM-D E-M5 Mark III ORF 2019 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus OM-D E-M10 ORF 2013 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus OM-D E-M10 Mark II ORF 2015 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus OM-D E-M10 Mark III ORF 2017 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus OM-D E-M10 Mark III S ORF 2019 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus OM-D E-M10 Mark IV ORF 2019 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-P1 ORF 2008 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-P2 ORF 2008 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-P3 ORF 2010 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-P5 ORF 2013 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-P7 ORF 2020 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-PL1 ORF 2010 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-PL1s ORF 2010 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-PL10 ORF 2019 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-PL2 ORF 2010 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-PL3 ORF 2010 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-PL6 ORF 2013 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-PL5 ORF 2012 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-PL7 ORF 2013 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-PL8 ORF 2015 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-PL9 ORF 2017 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-PM1 ORF 2010 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN E-PM2 ORF 2012 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus PEN-F ORF 2015 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus SP-310 ORF 2005 preview compressed ORF is not decoded
|
||||
Olympus SP-320 ORF 2005 preview compressed ORF is not decoded
|
||||
Olympus SP-350 ORF 2005 preview compressed ORF is not decoded
|
||||
Olympus SP-500 UZ ORF 2005 preview compressed ORF is not decoded
|
||||
Olympus SP-310 ORF 2005 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus SP-320 ORF 2005 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus SP-350 ORF 2005 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus SP-500 UZ ORF 2005 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus SP-510 UZ ORF 2005 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus SP-550 UZ ORF 2007 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus SP-560 UZ ORF 2007 preview compressed ORF is not decoded
|
||||
Olympus SP-560 UZ ORF 2007 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus SP-565 UZ ORF 2008 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus SP-570 UZ ORF 2007 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus Stylus 1 ORF 2013 preview compressed ORF is not decoded
|
||||
Olympus Stylus 1s ORF 2013 preview compressed ORF is not decoded
|
||||
Olympus Stylus 1 ORF 2013 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus Stylus 1s ORF 2013 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus Stylus SH-2 ORF 2015 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus Stylus SH-3 ORF 2015 preview compressed ORF is not decoded
|
||||
Olympus Stylus Tough TG-4 ORF 2015 preview compressed ORF is not decoded
|
||||
Olympus Stylus Tough TG-5 ORF 2015 preview compressed ORF is not decoded
|
||||
Olympus Stylus Tough TG-6 ORF 2018 preview compressed ORF is not decoded
|
||||
Olympus Stylus SH-3 ORF 2015 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus Stylus Tough TG-4 ORF 2015 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus Stylus Tough TG-5 ORF 2015 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus Stylus Tough TG-6 ORF 2018 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
Olympus Stylus XZ-2 iHS ORF 2012 verified corpus: crates/raw/tests/it/corpus.rs (xtask RAW_SAMPLES)
|
||||
Olympus Stylus XZ-10 ORF 2012 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus XZ-1 ORF 2010 preview compressed ORF is not decoded
|
||||
Olympus XZ-1 ORF 2010 unverified ORF decoder (uncompressed, packed, compressed)
|
||||
OnePlus 7T Front Camera DNG 2019 unverified DNG decoder (uncompressed, LJ92, lossy, Deflate, JPEG XL, LinearRaw)
|
||||
OnePlus 7T Rear Main Camera DNG 2019 unverified DNG decoder (uncompressed, LJ92, lossy, Deflate, JPEG XL, LinearRaw)
|
||||
OnePlus 8 Front Camera DNG 2020 unverified DNG decoder (uncompressed, LJ92, lossy, Deflate, JPEG XL, LinearRaw)
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 86 and column 19.
|
@@ -576,3 +576,5 @@ Canon EOS 300D (EOS Digital Rebel, EOS Kiss Digital) verified corpus: crates/raw
|
||||
Canon PowerShot G1 verified corpus: crates/raw/tests/it/corpus.rs (xtask RAW_SAMPLES)
|
||||
Canon PowerShot G6 verified corpus: crates/raw/tests/it/corpus.rs (xtask RAW_SAMPLES)
|
||||
Canon PowerShot G5 preview CRW entropy anomaly (craft-libs crates/crw/clean-room/02-crw-format.md section 4); embedded JPEG
|
||||
Olympus OM-D E-M1 verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
Olympus OM-D E-M10 Mark III verified corpus: crates/raw/tests/it/olympus_samsung_corpus.rs (pinned sensor hash, camera-JPEG check)
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 3.
|
+2
-2
@@ -21,7 +21,7 @@ Toward **beta** (~340–600 Opus 5.5 agent hours; ranked, each a gap in [gaps.md
|
||||
4. **Full-resolution zoom** (gap 4, 8–15 h): visible-region rendering so 100% shows original pixels.
|
||||
5. **AI masks** (gap 5, 40–70 h): Subject / Sky / People on licensable weights; configure the SAM 3
|
||||
mirror. Needs the maintainer's model decision.
|
||||
6. **Compressed ORF and HE NEF** (gaps 6–7, 28–55 h).
|
||||
6. **~~Compressed ORF~~ (done 2026-11-04) and HE NEF** (gap 7, 20–40 h).
|
||||
7. **Lens profiles of our own** (gap 8, 40–80 h).
|
||||
8. **Tests in CI on macOS and Windows, and the GPU tests in CI** (gap 9, 6–12 h).
|
||||
9. **Per-model verification** (gap 10, 20–35 h).
|
||||
@@ -72,7 +72,7 @@ calibration: M0–M13 took ≈ 25 active hours against an estimate of ≈ 110–
|
||||
| M8 | Heal / Remove | content-aware remove (PatchMatch), heal, clone, brush spots, visualize spots, red/pet eye | 6–10 | 🚧 (heal, clone, auto source, visualize spots, red/pet eye ✅; PatchMatch remove ⬜) |
|
||||
| M9 | Presets, profiles, versions, sync | preset browser + amount, create/import presets, profile browser, versions, history, copy/paste/sync settings | 5–8 | ✅ |
|
||||
| M10 | Export & share | export dialog (JPEG/PNG/TIFF/DNG/AVIF/JXL/original), sizing, sharpening, metadata, watermark, naming, batch jobs, XMP sidecars, HDR export | 6–10 | 🚧 (all formats incl. DNG/original, sizing, presets, background jobs, HDR gain map JPEG / PQ AVIF ✅; JXL encode ⬜) |
|
||||
| M11 | RAW II | CR3, RAF (X-Trans), ORF, RW2, PEF, SRW, 3FR, IIQ + long tail; camera calibration DB; HEIC/AVIF/JXL import | 20–35 | 🚧 (RAF all, RW2 every format, PEF, ORF uncompressed and 12.8 bpp, SRW uncompressed, HEIC ✅; CR3 🟡 (3 bodies verified); **camera colour calibration** 🚧 (per-file JPEG fits, 5 bundled profiles, 52 spectral matrices; measured database missing); compressed ORF / SRW, HE NEF, IIQ, X3F ⬜) |
|
||||
| M11 | RAW II | CR3, RAF (X-Trans), ORF, RW2, PEF, SRW, 3FR, IIQ + long tail; camera calibration DB; HEIC/AVIF/JXL import | 20–35 | 🚧 (RAF all, RW2 every format, PEF, ORF uncompressed, compressed and 12.8 bpp, SRW uncompressed, HEIC ✅; CR3 🟡 (3 bodies verified); **camera colour calibration** 🚧 (per-file JPEG fits, 5 bundled profiles, 52 spectral matrices; measured database missing); compressed SRW, HE NEF, IIQ, X3F ⬜) |
|
||||
| M12 | AI & smart features | subject/sky/background/people/object masks, semantic search, faces/People (permissively licensed models, pure-Rust inference) | 20–40 | 🚧 (faces: detection, recognition, People view ✅; Object / Describe masks via SAM 3 🟡; Subject / Sky / People masks, semantic search ⬜) |
|
||||
| M13 | Merge | HDR merge (deghost), panorama (projections, boundary warp, fill edges), HDR panorama | 10–15 | ✅ |
|
||||
| M14 | Video | import/playback/trim via FilmCraft crates, global edits + presets on video, video export | 6–10 | ⬜ |
|
||||
|
||||
+26
-26
@@ -12,13 +12,13 @@ have their own documents: [raw-parity.md](raw-parity.md), [file-format-parity.md
|
||||
|
||||
| Number | Value | Kind |
|
||||
|---|---:|---|
|
||||
| **Feature breadth**, checklist | **81.6%** of 532 in-scope rows (P0 98.0%, P1 95.2%, P2 50.0%) | **measured**: recount of [parity-checklist.md](parity-checklist.md) rows (✅ 1, 🟡 ½, 🚫 left out), the same rule `cargo xtask parity` uses |
|
||||
| **Feature breadth**, checklist | **83.2%** of 543 in-scope rows (P0 97.5%, P1 94.4%, P2 56.7%) | **measured**: recount of [parity-checklist.md](parity-checklist.md) rows (✅ 1, 🟡 ½, 🚫 left out), the same rule `cargo xtask parity` uses |
|
||||
| **Feature breadth**, weighted by use | **~77%** | estimated: feature-area table below |
|
||||
| **Ready for real work** (full target) | **~61%** (range 56–66%) | estimated: weighted sum over the dimensions with written weights, see [below](#ready-for-real-work-mainstream-practitioner-and-essentials-user) |
|
||||
| **Mainstream practitioner** | **~51%** (range 46–56%) | estimated: weekly areas of a working photographer, depth 74.0% × 0.804 × colour 0.85 |
|
||||
| **Essentials user** | **~65%** (range 60–70%) | estimated: core features at default settings, depth 78.0% × 0.830 |
|
||||
| **Ready for real work** (full target) | **~62%** (range 57–67%) | estimated: weighted sum over the dimensions with written weights, see [below](#ready-for-real-work-mainstream-practitioner-and-essentials-user) |
|
||||
| **Mainstream practitioner** | **~51%** (range 46–56%) | estimated: weekly areas of a working photographer, depth 75.3% × 0.804 × colour 0.85 |
|
||||
| **Essentials user** | **~65%** (range 60–70%) | estimated: core features at default settings, depth 78.4% × 0.830 |
|
||||
| Remaining to **beta** | **~340–600 h** | estimated; ~60% parallelizes |
|
||||
| Remaining to **full parity** | **~1,000–1,800 h** | estimated; ~70% parallelizes |
|
||||
| Remaining to **full parity** | **~980–1,750 h** | estimated; ~70% parallelizes |
|
||||
| **Stage** | **alpha** | see [Stage](#stage) |
|
||||
|
||||
## The target and how it was measured
|
||||
@@ -46,8 +46,8 @@ phase #85, duplicate Local entries #22, black GPU exports on an Intel iGPU #78).
|
||||
|
||||
| Dimension | Breadth | Ready for real work | Remaining | Doc |
|
||||
|---|---:|---:|---:|---|
|
||||
| Features (weighted areas below) | ~77% (checklist 81.1%, measured) | ~61% | 600–1,100 h | [Features](#features) |
|
||||
| ↳ RAW cameras, colour and lens profiles (part of features) | 85% of Adobe's 1,446 models decode (39% verified), measured | ~56% | 255–480 h | [raw-parity.md](raw-parity.md) |
|
||||
| Features (weighted areas below) | ~77% (checklist 83.2%, measured) | ~62% | 600–1,100 h | [Features](#features) |
|
||||
| ↳ RAW cameras, colour and lens profiles (part of features) | 89% of Adobe's 1,446 models decode (39% verified), measured | ~56% | 255–480 h | [raw-parity.md](raw-parity.md) |
|
||||
| UI/UX fidelity | ~85% | ~70% | 32–54 h | [ui-parity.md](ui-parity.md) |
|
||||
| File formats (non-raw: images, sidecars, presets, catalogs) | ~85% | ~70% | 30–55 h | [file-format-parity.md](file-format-parity.md) |
|
||||
| Hardware | ~50% | ~40% | 40–80 h (+ tethering and printing, counted under Classic modules) | [hardware-parity.md](hardware-parity.md) |
|
||||
@@ -67,7 +67,7 @@ from the checklist sections and the deep-dive documents.
|
||||
| Area | Weight | Breadth | Ready | Remaining | Notes |
|
||||
|---|---:|---:|---:|---:|---|
|
||||
| Import and library (import, folders, albums, smart albums, keywords, metadata, search, faces) | 15% | 90% | 80% | 25–45 h | checklist A–E 83–92%; robust journal; 85k-photo libraries |
|
||||
| RAW decoding and camera coverage | 15% | 81% | 77% | 120–220 h | [raw-parity.md](raw-parity.md), measured model by model: 85% of photographers' cameras decode (use-weighted), × 0.9 for per-body bugs; CR3 variants, compressed ORF, HE NEF |
|
||||
| RAW decoding and camera coverage | 15% | 85% | 87% | 110–205 h | [raw-parity.md](raw-parity.md), measured model by model: 97% of photographers' cameras decode (use-weighted), × 0.9 for per-body bugs; CR3 variants, HE NEF |
|
||||
| Colour, camera profiles, render fidelity | 10% | 65% | 35% | 80–150 h | 10 bundled profiles vs Adobe's 1,500; per-file fits median ΔE ~5 vs the camera JPEG, ~10% far off; no fidelity suite ([raw-parity.md](raw-parity.md#colour)) |
|
||||
| Global develop adjustments (light, colour, curves, grading, effects, detail) | 15% | 93% | 70% | 30–60 h | checklist F 91.7%; character tuned by eye |
|
||||
| Optics, lens profiles, crop and geometry | 6% | 80% | 50% | 40–80 h | no lens database; crop / Upright complete |
|
||||
@@ -79,7 +79,7 @@ from the checklist sections and the deep-dive documents.
|
||||
| Views, compare, zoom, culling | 5% | 90% | 70% | 15–30 h | zoom detail P0 gap |
|
||||
| Classic output modules (Map, Book, Slideshow, Print, Web, publish, tethering) | 4% | 15% | 10% | 90–150 h | Classic extras 48% counts many small keys; the modules themselves are mostly ⬜ |
|
||||
| Video | 1% | 0% | 0% | 25–45 h | catalogued only |
|
||||
| **Weighted** | 100% | **~77%** | **~61%** (61.5%) | **600–1,100 h** | |
|
||||
| **Weighted** | 100% | **~77%** | **~62%** (62.2%) | **600–1,100 h** | |
|
||||
|
||||
## AI
|
||||
|
||||
@@ -118,11 +118,11 @@ work. Each has its own hours to ~95%, calibrated as in [How hours are calibrated
|
||||
|
||||
| Audience | Ready | Opus 5.5 agent wall-clock hours to ~95% | Work that dominates |
|
||||
|---|---:|---:|---|
|
||||
| Full target (ready for real work) | **~61%** | **1,000–1,800 h** (~70% parallelizes) | raw colour, lens and camera data; AI models; Classic output modules; localization; plug-in ecosystem |
|
||||
| Mainstream practitioner | **~51%** | **450–840 h** (~60% parallelizes) | camera colour and render fidelity; CR3 / ORF / HE NEF; lens database; subject / sky masks; Lightroom XMP exchange; stability |
|
||||
| Full target (ready for real work) | **~62%** | **980–1,750 h** (~70% parallelizes) | raw colour, lens and camera data; AI models; Classic output modules; localization; plug-in ecosystem |
|
||||
| Mainstream practitioner | **~51%** | **440–820 h** (~60% parallelizes) | camera colour and render fidelity; CR3 / HE NEF; per-model ORF verification; lens database; subject / sky masks; Lightroom XMP exchange; stability |
|
||||
| Essentials user | **~65%** | **160–300 h** (~50% parallelizes) | default raw look for popular cameras; launch stability; basic-slider feel; opening CR3 / HEIC files people send |
|
||||
|
||||
### Full target (ready for real work): ~61%
|
||||
### Full target (ready for real work): ~62%
|
||||
|
||||
Weighted sum over the dimensions of [By dimension](#by-dimension) (AI is left out because it
|
||||
overlaps the masking and Enhance feature areas). RAW decoding and camera colour are their own rows,
|
||||
@@ -131,7 +131,7 @@ valued from the model-by-model measurement in [raw-parity.md](raw-parity.md):
|
||||
| Dimension | Weight | Ready |
|
||||
|---|---:|---:|
|
||||
| Features: the other 11 areas, weighted depth from [Features](#features) | 45% | 60.9% |
|
||||
| RAW decoding and camera coverage | 9% | 83% (92% use-weighted × 0.9) |
|
||||
| RAW decoding and camera coverage | 9% | 87% (97% use-weighted × 0.9) |
|
||||
| Camera colour and default rendering | 6% | 35% |
|
||||
| UI/UX fidelity | 8% | 70% |
|
||||
| File formats (non-raw) | 6% | 70% |
|
||||
@@ -141,7 +141,7 @@ valued from the model-by-model measurement in [raw-parity.md](raw-parity.md):
|
||||
| Stability | 8% | 60% |
|
||||
| Platforms | 4% | 60% |
|
||||
| Ecosystem / plug-ins | 2% | 15% |
|
||||
| **Weighted sum** | 100% | **61.5% ≈ 61%** (range 56–66%) |
|
||||
| **Weighted sum** | 100% | **62.0% ≈ 62%** (range 57–67%) |
|
||||
|
||||
Mainstream comes out lower than full: its scope is the raw-develop core, where LightCraft is weakest
|
||||
(camera colour, CR3 coverage), and its discounts are multiplicative, while the full sum is lifted by
|
||||
@@ -159,7 +159,7 @@ essentials replaces its guessed 45% raw look with 84% × 0.75 (+1 point).
|
||||
|---|---:|---:|---|
|
||||
| Interaction fidelity / UI clarity | ×0.95 | ×0.95 | brush live preview gaps and feathering (#517, #518); crop artefacts and limits (#731, #742, #770, #771); Compare white-balance selector (#743–#745); low-res slider previews (#330); dialogs taller than the window (#781); mouse-wheel scroll (#714) |
|
||||
| Stability on real machines | ×0.92 | ×0.92 | launch and quit crashes or silent startup failures (#250 macOS 12 Intel, #315 Windows Intel GPU, #431 Intel Mac, #260, #462, #783 Linux / Nouveau, #790 Windows installer, fixed in 0.9.1); tests run in CI on Linux x64 and FreeBSD (nightly), not on macOS or Windows (gap 9) |
|
||||
| File exchange with Lightroom users (mainstream) / opening files people send (essentials) | ×0.92 | ×0.95 | Adobe XMP sidecars change colours (#290), XMP CameraProfile and Upright ignored (#204, #205), catalog import fails (#599), same Light values render differently (#523, #209), no write-back to `.lrcat`; for casual users: CR3 beyond verified bodies, compressed ORF, HE NEF open as previews (#473, #485, #556), HEIC trouble (#693) |
|
||||
| File exchange with Lightroom users (mainstream) / opening files people send (essentials) | ×0.92 | ×0.95 | Adobe XMP sidecars change colours (#290), XMP CameraProfile and Upright ignored (#204, #205), catalog import fails (#599), same Light values render differently (#523, #209), no write-back to `.lrcat`; for casual users: CR3 beyond verified bodies, HE NEF open as previews (#473, #556), HEIC trouble (#693) |
|
||||
| **Product** | **×0.804** | **×0.830** | |
|
||||
|
||||
### Mainstream practitioner: ~51%
|
||||
@@ -173,18 +173,18 @@ than the user's own.
|
||||
|---|---:|---:|
|
||||
| Import and library | 18% | 80% |
|
||||
| Cull: views, compare, zoom, ratings | 12% | 70% |
|
||||
| Raw decoding for their camera | 27% | 92% (measured use-weighted share whose camera fully works, [raw-parity.md](raw-parity.md#by-use-estimated)) |
|
||||
| Raw decoding for their camera | 27% | 97% (measured use-weighted share whose camera fully works, [raw-parity.md](raw-parity.md#by-use-estimated)) |
|
||||
| Global develop adjustments | 15% | 70% |
|
||||
| Crop, geometry, lens corrections | 6% | 50% |
|
||||
| Masking (manual, subject / sky; no generative) | 8% | 45% |
|
||||
| Heal / remove (no generative), denoise | 5% | 40% |
|
||||
| Presets, copy / paste / sync | 5% | 85% |
|
||||
| Export | 4% | 75% |
|
||||
| **Weighted depth** | 100% | **74.0%** |
|
||||
| **Weighted depth** | 100% | **75.3%** |
|
||||
|
||||
Colour fidelity is a written discount, **×0.85**: most raws start near the camera's own look (median
|
||||
ΔE ~5), about 10% far off (ΔE ~18), none calibrated to Adobe Standard, so a working photographer
|
||||
corrects colour by hand (33 open colour issues). 74.0% × 0.804 × 0.85 = **~51%** (range 46–56%).
|
||||
corrects colour by hand (33 open colour issues). 75.3% × 0.804 × 0.85 = **~51%** (range 46–56%).
|
||||
|
||||
### Essentials user: ~65%
|
||||
|
||||
@@ -201,11 +201,11 @@ basic sliders, crop, apply a preset, undo, export JPEGs.
|
||||
| Crop and straighten | 10% | 80% |
|
||||
| Presets and profiles | 8% | 80% |
|
||||
| Undo and history | 5% | 90% |
|
||||
| Their camera's raws: decode × default look | 10% | 69% (92% whose camera fully works × colour factor 0.75) |
|
||||
| Their camera's raws: decode × default look | 10% | 73% (97% whose camera fully works × colour factor 0.75) |
|
||||
| Export JPEG | 10% | 85% |
|
||||
| **Weighted depth** | 100% | **78.0%** |
|
||||
| **Weighted depth** | 100% | **78.4%** |
|
||||
|
||||
78.0% × 0.830 = **~65%** (range 60–70%).
|
||||
78.4% × 0.830 = **~65%** (range 60–70%).
|
||||
|
||||
### User evidence (GitHub issues, excluding the four maintainers)
|
||||
|
||||
@@ -229,17 +229,16 @@ evidence. The stage stays **alpha**.
|
||||
## Stage
|
||||
|
||||
**Alpha.** Core workflows exist end to end (import, cull, develop, mask, export, catalog migration),
|
||||
but ready-for-real-work is ~61%, below the ~75% beta bar, and the main file formats have blocking
|
||||
gaps: Canon CR3 decodes from sensor data on three verified bodies only, compressed ORF and HE NEF
|
||||
open as previews, and colour on every non-DNG raw is estimated rather than measured.
|
||||
but ready-for-real-work is ~62%, below the ~75% beta bar, and the main file formats have blocking
|
||||
gaps: Canon CR3 decodes from sensor data on 26 verified bodies, compressed ORF decodes on 58 more bodies (2 verified), and HE NEF opens as preview, while colour on every non-DNG raw is estimated rather than measured.
|
||||
|
||||
**Alpha gate:** all six core workflows (import, cull, develop, save and reopen, batch looks, export)
|
||||
work end to end on macOS; see the table in [roadmap.md](roadmap.md#alpha-gate). The partial rows (CR3
|
||||
variants, compressed ORF, HE NEF as previews) degrade but don't block a workflow.
|
||||
variants, HE NEF as previews) degrade but don't block a workflow.
|
||||
|
||||
**To beta:** ~14 points of readiness, **~340–600 h**: the `B` gaps in [gaps.md](gaps.md)
|
||||
(~230–430 h), plus burning down the ~92 open core-path user issues (40–80 h) and stability work
|
||||
around them. Beta needs: CR3, ORF and
|
||||
around them. Beta needs: remaining CR3 variants and
|
||||
HE NEF decoding from sensor data; measured colour for the popular models and a fidelity suite with
|
||||
scores; Subject / Sky / People masks; a lens profile database for the
|
||||
popular lenses; tests in CI on macOS and Windows, and the GPU tests in CI.
|
||||
@@ -300,6 +299,7 @@ P2 items 12–25 h; look tuning, performance, packaging, hardening 25–45 h.
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-04 | minor | Compressed ORF decoded (`crates/raw/src/vendor/orfc.rs`): OM-D E-M1 and E-M10 Mark III verified; 58 bodies newly unlocked (78 total across Olympus and OM); RAW coverage 77% → 80%, weighted camera coverage 94% → 97% |
|
||||
| 2026-10-24 | patch | Stability, the stability discount, the Beta-needs list and the estimate history: tests run in CI on Linux x64 since #2667 (FreeBSD nightly), not on macOS or Windows (gap 9); percentages and hours unchanged |
|
||||
| 2026-10-23 | minor | AI Denoise runs without a model (built-in denoiser); percentages unchanged, since it is a classical filter and Bayer-only |
|
||||
| 2026-10-13 | minor | Canon CRW decoded (clean-room, craft-libs `crates/crw/clean-room/`): 551 models verified with the coverage sweep (557 with MRW after merging main), Canon preview rows 21 → 6; RAW decoding unchanged |
|
||||
|
||||
Reference in new issue
Block a user