Skip to content

CinemaDNG (camera RAW) import: clean-room DNG decoder #1065

Closed

Description

@vangel76

Camera RAW support is at 0% (docs/codec-parity.md). CinemaDNG is the one widely used cinema RAW format with a public specification, so it can be implemented clean-room in pure Rust without any vendor SDK. Related: #383.

Spec basis (public documents only)

  • Adobe Digital Negative (DNG) Specification, versions 1.4 – 1.7 (public PDF)
  • TIFF Revision 6.0 and TIFF/EP (ISO 12234-2)
  • ITU-T T.81 / ISO/IEC 10918-1, lossless JPEG (process 14, "LJ92")
  • CinemaDNG format description (DNG image sequences in folders, or MXF-wrapped)

No other decoder's source (dcraw, LibRaw, rawspeed, darktable, RawTherapee, ffmpeg, the Adobe DNG SDK…) is read.

Scope of the first PR

  • DNG/TIFF container: IFD parsing incl. SubIFDs, bounded and hostile-input safe (offset/size checks, IFD cycle/count limits, capped allocations).
  • Raw CFA data: uncompressed (8–16-bit, packed and unpacked) and lossless JPEG (T.81 process 14, predictors 1–7, tiles and strips).
  • Processing to RGB following the DNG pipeline: linearization table, black/white levels (incl. per-CFA black), DefaultCrop, AsShotNeutral white balance, demosaic, ColorMatrix/ForwardMatrix to a linear working space, and an output transform consistent with FilmCraft's colour pipeline.
  • CinemaDNG sequences: a folder of numbered .dng frames imported as one clip (reusing image-sequence import), frame rate from the CinemaDNG FrameRate tag when present.
  • Tests on synthetic DNGs written by a test-only spec-based writer (no camera files committed), plus hostile-input tests.

Out of scope for the first PR: lossy DNG (JPEG/JPEG XL), MXF-wrapped CinemaDNG, opcode lists, a Raw/Color settings UI.

I'm working on this and will open a PR.

Activity

  1. vangel76 commented on Oct 11, 2026

    @vangel76
    ContributorAuthor

    Follow-up work on the decoder internals (building on #1068), which I'm doing now in a separate PR: ProcessOptions (raw development settings: white balance as shot or temperature/tint, exposure, highlights, demosaic quality, output space, target size for a reduced-resolution path), lossy JPEG DNG (Compression 34892), DNG opcode lists (OpcodeList1/2/3, DNG 1.7 chapter 7), and faster CinemaDNG decode/processing. JPEG XL DNG (52546) may follow as a separate draft PR behind an off-by-default feature, since it needs a new dependency (maintainer decision).

  2. added 7 commits that reference this issue on Oct 11, 2026
  3. vangel76 commented on Oct 11, 2026

    @vangel76
    ContributorAuthor

    Merge order for the CinemaDNG series (each builds on the previous one, so each PR also shows the earlier commits until those land):

    1. #1065: CinemaDNG / DNG import with a clean-room decoder #1068 — clean-room DNG / CinemaDNG decoder crate + import
    2. #1065: DNG raw settings, faster decode, opcode lists, lossy JPEG DNG #1077 — ProcessOptions (raw development settings), faster decode/develop incl. reduced-resolution development, DNG opcode lists, lossy (JPEG) DNG
    3. #1065: CinemaDNG in MXF and camera raw Source Settings #1078 — CinemaDNG in MXF, camera-raw Source Settings dialog (project schema v15 → v16)
    4. #1065: JPEG XL DNG behind an off-by-default feature (needs maintainer decision: new dependency) #1079 (draft, optional) — JPEG XL DNG behind an off-by-default jxl cargo feature; adds a new dependency, so it needs your decision

    After each merge I'll merge main into the next branch and push, so nothing needs resolving on your side. #1068 also overlaps #837 (OpenEXR) in sequence.rs / still.rs; same applies there.

  4. added 3 commits that reference this issue on Oct 12, 2026
  5. added a commit that references this issue on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions