Repository navigation
feat(raw): decode Foveon, GoPro VC-5, Canon sRAW and Kodak RADC natively - #102
Merged
Merged
Conversation
The last codecs the clean-room crate declined, done the same two-team
way as before — separate agents read the reference and wrote functional
specifications; the implementers worked from those, the samples and the
oracle output only — with a triage step first: for each format, can any
buildable reference produce a frame to verify against? Three could,
one could not, and two are declined on purpose:
Sigma Foveon X3F, Merrill and Quattro 6/6 exact (three sensor planes;
colour from the camera table)
GoPro VC-5 (GPR) 4/4 exact, ~100 MP/s
Canon sRAW/mRAW 50D and 7D exact (4/4); the
5D Mark II/III are declined by
model until verified
Kodak DC40/DC50 RADC 1/1 exact
Triage corrected an earlier belief: LibRaw 0.21.2 does read X3F, it is
merely compiled out by default; rebuilt with the flag it gave a proper
3-plane oracle. GoPro's own Apache-2.0 converter, cross-checked against
LibRaw on its output, gave the VC-5 oracle.
Still on the LibRaw fallback, deliberately: Fuji SuperCCD (a trivial
decode, but its 45° sensor grid has no representation in RawImage yet),
Nikon Z High Efficiency (licensed TicoRAW; nothing can read it without
the vendor SDK), Sigma SD9/SD10/SD14 and CR3-container sRAW (no sample).
Reviewed adversarially (~13k mutated inputs, no blind panics): the
findings — Foveon Huffman bounds, an unvalidated Quattro plane table,
missing Foveon levels and crop, a VC-5 precision assumption, sRAW's
50D-fitted colour stage and a slice-count hang — are fixed, with the
sRAW colour reconstruction now gated to the bodies it is verified on.
The plugin now develops a body with no colour matrix in camera RGB when
LibRaw cannot render it either, instead of failing, and a definitive
native "no embedded preview" is no longer overridden by a LibRaw open
failure.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The last codecs the clean-room crate declined after #98, done the same two-team way (spec writers read the reference under
/tmpand wrote prose specifications; implementers worked from the specs, the samples and oracle output only) with one addition: a triage step first — for each format, can any buildable reference produce a frame to verify against? Based on the squash-merged main.Two triage findings worth knowing: LibRaw 0.21.2 does read X3F (compiled out by default,
USE_X3FTOOLS), contrary to what the first round concluded; and a reviewer fetched six more subsampled Canon bodies, which is how the 50D-fitted colour stage was caught and gated.Deliberately still on the LibRaw fallback: Fuji SuperCCD (decode is trivial and oracle-verified, but its 45° sensor grid is not representable in
RawImage/Cfa— needs a rotate stage), Nikon Z High Efficiency (licensed intoPIX TicoRAW; nothing reads it without the SDK), Sigma SD9/SD10/SD14 and CR3-container sRAW (no samples).Review (two passes, ~13k mutated inputs, no blind panics): fixed Foveon Huffman bounds (two one-byte panics), an unvalidated Quattro plane table (a 1.8 GB allocation lever), missing Foveon levels/crop, a VC-5 precision assumption, sRAW's slice-count hang and forged-SOF allocation, and its 50D-only colour stage (gains now keyed by ColorData version; hue/matrix gated by model id). Reviewer-flagged for a human: the spec relays reference-derived colour constants for sRAW (the YCbCr matrix and hue rules) that no public document yields — a project-level call on what a spec may carry.
Plugin: a body with no colour matrix now develops in camera RGB when LibRaw cannot render it either (Foveon on a stock LibRaw), instead of failing; and a native "no embedded preview" is no longer overridden by a LibRaw open failure (GPR).
Test plan
SCHIST_RAW_CORPUS=/tmp/rawsamples)cargo fmt --check, clippy-D warningson both crates🤖 Generated with Claude Code