feat: Sony A7R VI (ILCE-7RM6) support + general ARW6 canvas geometry#2
Draft
puzza007 wants to merge 3 commits into
Draft
feat: Sony A7R VI (ILCE-7RM6) support + general ARW6 canvas geometry#2puzza007 wants to merge 3 commits into
puzza007 wants to merge 3 commits into
Conversation
Camera ID 0x19a (SonyModelID 410), FF 10240/10016 and APS-C 6656/6592 raw-width variants cropping to 9984x6656 / 6528x4352 per Adobe DNG Converter DefaultCropSize. D65 color matrix extracted from Adobe DNG Converter ColorMatrix2 on rawdb.dnglab.org CC0 samples (matches dnglab PR LibRaw#796). Lossless frames decode via the existing LJpeg path; lossy/HQ "Compressed RAW 2" frames use the ARW6 decoder already on this branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S1mAhAaVQjGgRPsXSVVnxp
…sing ARW6 lays each tile's component rows on a shared vertical canvas whose origin (comp_top) varies with the tile height modulo 16 and drives every sub-band's per-chunk row windows and the per-level IDWT merge parity. The decoder hard-coded one aligned layout (comp_top 8) plus a guarded path that was only right for some non-aligned heights; ILCE-7RM6 APS-C frames (4372 rows, comp_top 7) decoded with globally wrong detail. Replace the per-case synthesis functions with computed lattice spans, a general slot extractor (chunk rows fill fixed record slots sequentially in HL/LH/HH order, so partial chunks shift rows across the linear planes; partial-window HH rows are stored at half amplitude), and a parity-aware vertical 5/3 lift. Validated bit-identical against Adobe DNG Converter raw output on all 12 ILCE-7RM6 rawdb samples (FF + APS-C x lossless/lossy/HQ x both orientations) and all 4 ILCE-7M5 pixls.us ARW6/LJpeg samples (no change to previously exact files). Canvas model cross-checked against the format description in abbradar/arw6_decode (LibRaw#828). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S1mAhAaVQjGgRPsXSVVnxp
Post-rewrite cleanup, no decoded-byte changes (re-validated bit-exact against Adobe DNG Converter on all 16 A7R VI + A7 V sample pairs): - size packet planes to the validated block count and drop the vestigial padded-height row formula (sony_arw6_expected_packet_rows) and sony_arw6_align_up - pass the tile's chunk count into decode_packet_arrays instead of re-deriving geometry per packet; take comp_height straight from the stream header - drop integrate_type1's constant rows/dc_offset parameters and the extractor's row-multiplier parameter (always the span's rpc) - move the four result planes instead of deep-copying (~340 MB per full-frame tile) - const ints for the canvas constants, std::max/min window clamps Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S1mAhAaVQjGgRPsXSVVnxp
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.
Adds the Sony A7R VI (ILCE-7RM6) on top of the A7 V branch, and replaces the ARW6 decoder's special-cased vertical layout handling with the derived canvas geometry. Stacked on
feat/sony-a7v-support-0.22.2.Camera support (
edbe9d65-lineage commit)0x19a(SonyModelID 410), body features + Tag9050d group, normalized model, camera list entryDefaultCropSizeacross the full rawdb.dnglab.org CC0 sample matrix)ColorMatrix2on those samples; independently matches dnglab PR Add support for Sony A7R VI (ILCE-7RM6) dnglab/dnglab#796Decoder fix: derive the ARW6 vertical canvas geometry
ARW6 lays each tile's component rows on a shared vertical canvas whose origin (
comp_top) varies with tile height mod 16, and that origin drives every sub-band's per-chunk row windows and the per-level IDWT merge parity. The decoder previously hard-coded thecomp_top = 8(16-aligned) layout plus a guarded path that is wrong forcomp_top = 7— which is exactly the A7R VI's APS-C frames (height 4372), and also 7R V lossy-medium files upstream. All four APS-C lossy/HQ variants decoded with globally wrong detail (LibRaw#828's failure class).The fix computes per-lattice spans, extracts rows via the sequential HL/LH/HH slot-fill rule (partial chunks rotate rows across the linear planes; partial-window HH rows are stored at half amplitude), and merges with a parity-aware vertical 5/3 lift. Net −159 lines; the coefficient arithmetic is untouched. Canvas model cross-checked against the format description in abbradar/arw6_decode.
Validation
Bit-exact against Adobe DNG Converter raw output over the full Adobe active area:
Worth offering upstream: this closes LibRaw#828's remaining failures and silently-wrong 7R V lossy-medium/small decodes.
🤖 Generated with Claude Code
https://claude.ai/code/session_01S1mAhAaVQjGgRPsXSVVnxp