Browse Source

Record HEVC residual reconstruction verification

pull/2633/head
James Jackson-South 4 days ago
parent
commit
9eeec97351
  1. 16
      HEIF_IMPLEMENTATION_PLAN.md

16
HEIF_IMPLEMENTATION_PLAN.md

@ -29,7 +29,7 @@ Checkboxes may be marked complete only when the implementation and the verificat
## Delivery dashboard
Last reconciled with the source tree on 2026-08-30 against production checkpoint `9bc5b9842`. Committed checkpoints include the AV1 transform architecture, OBU framing, tile partitioning, mode information, segmentation, delta quantization, transform-size selection, coefficient decoding, inverse quantization, inverse transforms, complete intra prediction, intra-block copy, official extreme-displacement intra-block-copy conformance, the 12-profile reconstruction matrix, corrected twelve-bit inverse-transform SIMD arithmetic, layered-item properties, layered reference/header/CDF/motion-field state, inter-frame intra blocks, SIMD-first translational prediction, complete single-reference inter reconstruction, compound reference trees and modes, paired reference-MV derivation, reference-dependent bounded sequence decoding, allocation-free SIMD-first equal averaging, selected inter-intra prediction, selectable compound blending, OBMC, scaled-reference reconstruction, local warped prediction, non-translational global prediction, official motion-vector conformance, official spatial- and temporal-layer default-operating-point conformance, official active-film-grain and monochrome sequence conformance, selected spatial-layer presentation, progressive color and auxiliary-alpha conformance, pinned-HM HEVC CABAC verification, pinned-HM HEVC coding-tree traversal verification, and official HEVC intra-prediction verification. This dashboard is the authoritative delivery order. The detailed phase checklists below provide subsystem evidence; they do not override the current-stage marker or permit work to skip ahead.
Last reconciled with the source tree on 2026-08-30 against production checkpoint `97538abd2`. Committed checkpoints include the AV1 transform architecture, OBU framing, tile partitioning, mode information, segmentation, delta quantization, transform-size selection, coefficient decoding, inverse quantization, inverse transforms, complete intra prediction, intra-block copy, official extreme-displacement intra-block-copy conformance, the 12-profile reconstruction matrix, corrected twelve-bit inverse-transform SIMD arithmetic, layered-item properties, layered reference/header/CDF/motion-field state, inter-frame intra blocks, SIMD-first translational prediction, complete single-reference inter reconstruction, compound reference trees and modes, paired reference-MV derivation, reference-dependent bounded sequence decoding, allocation-free SIMD-first equal averaging, selected inter-intra prediction, selectable compound blending, OBMC, scaled-reference reconstruction, local warped prediction, non-translational global prediction, official motion-vector conformance, official spatial- and temporal-layer default-operating-point conformance, official active-film-grain and monochrome sequence conformance, selected spatial-layer presentation, progressive color and auxiliary-alpha conformance, pinned-HM HEVC CABAC verification, pinned-HM HEVC coding-tree traversal verification, official HEVC intra-prediction verification, and official HEVC residual-reconstruction verification. This dashboard is the authoritative delivery order. The detailed phase checklists below provide subsystem evidence; they do not override the current-stage marker or permit work to skip ahead.
Commit `a0d1b5af56acb3a3a9aebb29c916d1b36cd49367` restores the established JPEG color-converter operator architecture throughout the HEIF implementation. `Av1ForwardTransformer` owns its nested one-dimensional contract and all twelve concrete forward transform operators; `Av1Inverse2dTransformer` owns the corresponding inverse contract and operators; and `Av1InverseTransformer` owns the byte and high-bit-depth reconstruction-output operators. Each contract lives in the owner's `.Operator.cs`, while every semantic transform with a shared traversal has its own `<Owner>.<Semantic>Operator.cs` partial-family file and implements concrete scalar and SIMD overload bodies without a forwarding semantic core. The same owner-and-partial-file rule now covers HEVC inverse transforms and intra prediction, AV1 and HEVC deblocking, AV1 CDEF, and HEVC transform-skip reconstruction. Vector-width and sample-storage adapters that are not semantic dispatch operators are named `Operations`; no operator type is named after a hardware width, no static contract uses CRTP, no source file groups multiple concrete semantic operator structs, and no semantic operator remains top-level. Roslynk reports zero compiler errors, both Release source targets build with zero warnings and errors, and 736 focused `net10.0` transform, loop-filter, prediction, reconstruction, transfer-function, and film-grain cases pass without failures or skips through the existing `FeatureTestRunner` coverage. All 56 new C# paths resolve to the existing `csharp` diff driver without an attributes change, and `git diff --check` is clean.
@ -39,6 +39,8 @@ Commit `66d1f3c41b0baeaa98726b57d5feaeba50874f16` closes the Phase 4 HEVC coding
Commit `9bc5b9842` closes the Phase 4 HEVC intra-prediction checkpoint without a production correction. Exact comparison with HM commit `9c1f298659ab0cee9dc13d23d0304221575410b9` confirms reference availability and substitution, normal three-tap and strong bilinear smoothing, filter-selection thresholds, planar, DC, and all angular equations, luma edge filters, negative-angle reference extension, 4:2:2 chroma-angle remapping, luma most-probable-mode syntax, chroma-mode syntax, and combined 4:4:4 NxN chroma traversal. The official one-picture `IPRED_B_Nokia_3` Main Still Picture stream exercises all 35 modes at every published luma and chroma conformance size, for 245 mode-and-size combinations, and its complete native YUV output matches the published reference exactly. The independently coded first picture from official `CIP_A_Panasonic_3` verifies the enabled constrained-intra PPS path and exact pinned-HM decoded-plane hashes; it does not claim coverage of constrained inter-neighbor exclusion in the following B picture, which is outside the bounded still decoder. `FeatureTestRunner` verifies the predictor oracle and both reference-filter paths through normal, AVX-512-disabled, AVX-disabled, and scalar execution. A fresh Release run passes all 149 focused HEVC decoder cases without failures or skips, both Release source targets build with zero warnings and errors, Roslynk reports zero compiler errors, scoped StyleCop and whitespace verification are clean, and `git diff --check` is clean.
Commit `97538abd29cb69df0ecf3e30a4ee3b40b586c070` closes the independently coded Phase 4 residual-reconstruction checkpoint. Five official HEVC v1 and Range Extensions pictures match the native Y, Cb, and Cr plane hashes produced by pinned HM commit `9c1f298659ab0cee9dc13d23d0304221575410b9`. The retained pictures cover coding-unit luma-QP deltas, scaling lists, transform skip, transform-skip contexts and rotation, implicit residual DPCM, extended-precision processing at 12-bit 4:4:4, coding-unit chroma-QP adjustment, and complete transform-and-quantization bypass. The `DELTAQP_A_BRCM_4` comparison exposed and corrected the PCM-neighbor invariant: PCM coding units skip intra-mode syntax but remain most-probable-mode neighbors, so the allocator-backed luma-mode map now starts at HM's required DC default. The five new exact-picture cases and all 169 focused HEVC decoder cases pass without failures or skips. Both Release source targets and the scoped Release test project build with zero warnings and errors, Roslynk reports zero compiler errors, the retained fixture hashes and existing LFS attributes match their recorded provenance without an attributes change, scoped whitespace verification is clean, and `git diff --check` is clean. Explicit inter residual-DPCM syntax remains unimplemented and is not claimed by this checkpoint.
Commit `1c58d855f70b024170ced9eb0a7005f0f9c955ad` records the complete official motion-vector conformance checkpoint. The official IVF has SHA-1 `F064290D7FCD3B3DE19020E8AEC6C43C88D3A505`, matching the pinned libaom test-data manifest, and SHA-256 `222A9050059B254DAB17CFB802FF829C778E3F93AF18961A622C8268576C1395`; its pinned-libaom Y4M has SHA-256 `D97AC78C81782CF1507549368047769DC677DBE205706458D1EE9C807DE6EC78`. Both source targets build with zero warnings and errors, the `net10.0` test-project analyzer build completes with zero errors and 1,014 pre-existing repository warnings, Roslynk reports zero compiler errors, 3,985 focused `net10.0` cases pass without failures or skips, and `git diff --check` is clean.
Commit `019ac5648b4380a6ff4865072c96fde29ce09fad` records the complete selected-spatial-layer presentation checkpoint. An essential `lsel` selecting the genuine 40x40 base layer of the committed 40x40-to-80x80 progressive AVIF returns that exact pinned-libaom native reconstruction, then scales its YUV444 planes to the 80x80 `ispe` extent before color conversion and matches pinned libavif's RGBA output exactly. Retained reconstructed planes remain at coded dimensions; presentation planes use group-safe allocator-owned rows and are returned exactly once under a 1,024-byte constrained allocator. Portable `Vector128` and scalar two-times filters match pinned libyuv edge, quarter-sample, and rounding results at 8 and 12 bits through `FeatureTestRunner`. Both source targets build with zero warnings and errors, the `net10.0` test-project analyzer build completes with zero errors and 1,014 pre-existing repository warnings, Roslynk reports zero compiler errors, 156 focused reconstruction and color cases pass without failures or skips, and `git diff --check` is clean.
@ -689,18 +691,18 @@ Implement and verify in dependency order:
- [x] Implement and verify the allocation-free SIMD-first predictor primitive for all 35 modes, 4/8/16/32 blocks, and 8/10/12-bit samples.
- [x] Implement reconstructed-plane reference collection, substitution, asymmetric chroma-unit handling, and reference-filter selection from caller-owned availability and scratch spans.
- [x] Build each availability flag from reconstructed-plane and coding state, and connect the predictor to transform-unit traversal for the independently verified 8-bit 4:2:0 and 4:4:4 item paths.
- [ ] **Current:** scaling lists, inverse quantization, transform skip, every required inverse transform, range-extension precision, and lossless reconstruction.
- [x] Scaling lists, inverse quantization, transform skip, every required inverse transform for independently coded pictures, range-extension precision, and lossless reconstruction. Commit `97538abd2` records exact pinned-HM native-plane verification for the five official fixtures described above.
- [x] Implement allocation-free SIMD-first inverse DCT for every 4/8/16/32 width and height combination, the four-by-four intra-luma inverse DST, normative intermediate and residual clipping, and saturated prediction addition for 8/10/12-bit samples. Verify normal and forced-scalar execution against fixed results and a dense scalar oracle.
- [x] Implement the SIMD-first inverse-quantization primitive for flat and scaling-list paths across every transform size, component matrix, prediction mode, transform-skip scaling rule, signed normalization direction, and range-extension precision path.
- [ ] Derive effective luma and chroma quantization parameters, including bit-depth offsets and chroma-format mapping, then connect scaling-list selection and inverse quantization to transform-unit traversal.
- [x] Derive effective luma and chroma quantization parameters, including bit-depth offsets and chroma-format mapping, then connect scaling-list selection and inverse quantization to transform-unit traversal.
- [x] Implement the immutable effective-QP value used by reconstruction, including independent luma/chroma bit-depth offsets, the normative 4:2:0 mapping plateaus, the 4:2:2/4:4:4 saturation rule, and combined picture/slice/coding-unit chroma offsets.
- [ ] Select each transform unit's coding-unit luma QP and chroma-adjustment-list entry, then pass the derived component QP into inverse quantization.
- [ ] Implement transform skip, coefficient rotation, implicit and explicit residual DPCM, transquant bypass, and lossless reconstruction.
- [x] Select each transform unit's coding-unit luma QP and chroma-adjustment-list entry, then pass the derived component QP into inverse quantization.
- [ ] **Current:** implement transform skip, coefficient rotation, implicit and explicit residual DPCM, transquant bypass, and lossless reconstruction.
- [x] Implement allocation-free SIMD-first transform-skip normalization, complete-block coefficient rotation, transquant-bypass copying, implicit intra-direction selection, and horizontal/vertical inverse residual DPCM with a scalar fallback and signed residual clipping.
- [ ] Decode explicit inter residual-DPCM modes and connect bypass, transform skip, residual DPCM, prediction addition, and lossless reconstruction through transform-unit traversal.
- [ ] Connect coefficient decoding, inverse quantization, transform selection, reusable scratch, and add/clip to transform-unit traversal.
- [x] Connect coefficient decoding, inverse quantization, transform selection, reusable scratch, and add/clip to transform-unit traversal.
- [x] Implement grouped diagonal/horizontal/vertical scans, last-significant and significance context derivation, coefficient levels and signs, sign-data hiding, Range Extensions bypass alignment, four persistent Rice states, and one pooled scratch owner with no per-transform allocation or `stackalloc`.
- [ ] Invoke coefficient decoding and the existing reconstruction kernels from transform-unit traversal, then verify complete transform blocks from independently encoded HEIC fixtures.
- [x] Invoke coefficient decoding and the existing reconstruction kernels from transform-unit traversal, then verify complete transform blocks from official independently decoded HEVC fixtures.
- [ ] Deblocking and sample-adaptive offset for every signaled luma/chroma and bit-depth path.
- [ ] Tiles, wavefront entry points, dependent slices, and all other parallelization syntax permitted by the exposed still-image profiles.
- [ ] Supplemental enhancement information that changes image presentation or metadata exposed by ImageSharp.

Loading…
Cancel
Save