diff --git a/HEIF_IMPLEMENTATION_PLAN.md b/HEIF_IMPLEMENTATION_PLAN.md index f0b508b16..e1716e3fa 100644 --- a/HEIF_IMPLEMENTATION_PLAN.md +++ b/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-29 against production checkpoint `fc9320262cc08dd5daf41f231998403b804b98da`. 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, 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, and progressive color and auxiliary-alpha conformance. 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-29 against production checkpoint `42384454eb45b6107608ed33379c7a69b101d533`. 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, and progressive color and auxiliary-alpha conformance. 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 `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. @@ -57,6 +57,8 @@ Commit `e6f0ef84fc8273a7d50fdfc1489f54f058a2a424` records the OBU framing verifi Commit `fc9320262cc08dd5daf41f231998403b804b98da` closes the tile, mode, segmentation, delta-quantization, transform, coefficient, and inverse-quantization checkpoint. The production traversal and entropy order were re-audited against pinned libaom `03087864cf4bea6abb0d28f95cf7843511413d8f`. The stale coefficient round-trip oracle now compares the parser's retained entropy-scan order rather than raster order and disposes its encoded buffer owner. Both Release source targets build with zero warnings and errors, the scoped test-project analyzer build completes with zero errors and 1,011 repository warnings, Roslynk reports zero compiler errors, all 947 focused cases pass without failures or skips, documentation review is complete, and `git diff --check` is clean. +Commit `42384454eb45b6107608ed33379c7a69b101d533` closes the AV1 intra-prediction checkpoint. Pinned-source review confirms conventional mode and angle syntax, palette and filter-intra eligibility and ordering, chroma-from-luma eligibility and alpha mapping, reference availability, edge preparation, and predictor dispatch. Every predictor family retains the JPEG-style static operator architecture. All 93 focused cases pass without failures or skips, including the exact 39-frame official all-intra native sequence, exact palette native and presentation fixtures, and the exact 12-profile matrix. The existing production implementation required no correction. + Status meanings: - **Complete:** the implementation and its phase exit evidence are recorded. @@ -67,7 +69,7 @@ Status meanings: Current development stage: **Stage 3 — complete AV1 still-image decoding.** The decoder retains reference/header/CDF/motion-field state, derives frame-level skip-mode references, consumes temporal segment prediction, decodes intra-coded blocks inside inter frames, and reconstructs translational single-reference, compound, inter-intra, OBMC, scaled-reference, local warped, and non-translational global prediction before residual traversal. Commit `1c58d855f70b024170ced9eb0a7005f0f9c955ad` adds exact official four-frame coverage through all ordinary inter modes, all three motion modes, every regular/smooth/sharp dual-filter pair, sub-8x8 chroma prediction, and no-round compound intermediates. Commit `019ac5648b4380a6ff4865072c96fde29ce09fad` adds exact selected-layer native reconstruction and scaled presentation. Neither AV1 nor HEVC production encoding is implemented. -Immediate checkpoint: **remaining — close intra prediction, including every directional, smooth, Paeth, chroma-from-luma, filter-intra, and palette case permitted by AV1.** Chroma-from-luma and palette reconstruction are locally implemented and independently verified. Audit the complete production syntax, edge preparation, prediction dispatch, and focused coverage against pinned libaom, identify the exact remaining valid syntax or evidence gap, and implement only that gap before advancing. +Immediate checkpoint: **remaining — close the Phase 3 AV1 still-image decode exit gate.** Inventory each remaining valid syntax path against pinned libaom, implement only demonstrated production gaps, and add exact independent native-plane and presentation evidence through every required `FeatureTestRunner` dispatch tier before advancing to HEVC. | Order | Delivery stage | State | Delivered state | Gate that remains open | | --- | --- | --- | --- | --- | @@ -85,7 +87,7 @@ Immediate checkpoint: **remaining — close intra prediction, including every di - [x] Finish the libaom-shaped AV1 forward-transform architecture, measured production dispatch, inverse-tier correction, suffix cleanup, `FeatureTestRunner` matrix, and focused Release verification recorded below. - [x] Close the base AV1 profile matrix with exact native-plane and presented-image comparisons for 8/10/12-bit monochrome, 4:2:0, 4:2:2, and 4:4:4 fixtures under normal, AVX2, 128-bit, and scalar dispatch. - [x] Accept the AV1-ISOBMFF final low-overhead OBU form that omits its payload-size field and uses the bounded image-item remainder; focused Release coverage reconstructs a valid combined frame in that form. -- [ ] **In progress:** complete layered AV1 image-item dependency reconstruction and verify default final-layer output against the pinned libavif progressive fixtures. +- [x] Complete layered AV1 image-item dependency reconstruction and verify default final-layer output against the pinned libavif progressive fixtures. - [x] Parse and associate `a1op`, `lsel`, and `a1lx` through the bounded image-item property model, including normative essential flags, duplicate handling, exact property lengths, and the four-layer limit. - [x] Validate `a1lx` layer boundaries against the logical item size and restrict concrete `lsel` decoding to the cumulative payload through the selected spatial layer without copying item bytes. - [x] Apply the selected `a1op` operating-point mask while consuming extended OBUs and validate the selected index against the parsed sequence header. @@ -96,7 +98,7 @@ Immediate checkpoint: **remaining — close intra prediction, including every di - [x] Initialize each frame's working CDF graph from the resolved primary snapshot, inherit segmentation feature data and an unchanged contiguous segmentation map, inherit loop-filter delta state, parse and inherit global-motion parameters, and initialize/project the retained per-8x8 temporal motion field. - [x] Match libaom's bounded range-decoder consumed-bit accounting and tile trailing-bit validation so implicit zero refill cannot conceal truncated entropy data. Validate before publishing the selected CDF, reset decoder state after failure, and unwind every successful frame/block workspace rent when a later constructor allocation fails. A real truncated palette tile, decoder reuse, parser lifecycle, and allocator-identity tests cover these boundaries. - [x] Consume the retained segmentation map through `seg_id_predicted` when temporal segmentation is enabled, including all three neighbor CDF contexts, pre-skip/post-skip ordering, skipped-block spatial inference, compatible retained-map geometry, and current-map updates. - - [ ] Implement the complete inter-frame entropy, mode, motion-vector, compound-prediction, inter-prediction, and warped/global-motion paths permitted by the image profile. + - [x] Implement the complete inter-frame entropy, mode, motion-vector, compound-prediction, inter-prediction, and warped/global-motion paths permitted by the image profile. - [x] Derive the frame-level skip-mode reference pair from mapped order hints, including modulo wraparound and the two-forward fallback, then decode the common inter-frame block prefix and intra-coded-block branch with retained CDF state and block-size luma contexts. - [x] Implement allocation-free SIMD-first translational single-reference interpolation for regular, smooth, sharp, and bilinear filters across 8/10/12-bit samples. The predictor mirrors JPEG's closed static operator architecture, descends through `Vector512`, `Vector256`, and `Vector128` before scalar fallback, and passes the exact independent convolution oracle through `FeatureTestRunner`. - [x] Close the single-reference inter path before advancing to another mode. @@ -590,12 +592,12 @@ Implement and verify in dependency order: - [x] Implement SIMD-first chroma-from-luma storage, 4:4:4/4:2:2/4:2:0 subsampling, rounded mean subtraction, and 8/10/12-bit prediction with exact scalar fallback and `FeatureTestRunner` parity. - [x] Implement allocation-free SIMD-first palette reconstruction for palette sizes 2-8, transform widths 4-64, and 8/10/12-bit samples with exact scalar fallback and `FeatureTestRunner` parity. - [x] Verify palette mode syntax and presented reconstruction with an independently encoded palette AVIF fixture. - - [x] Re-audit conventional intra syntax, palette and filter-intra eligibility and ordering, chroma-from-luma eligibility and alpha mapping, top-right and bottom-left availability, edge extension, filtering, upsampling, and predictor dispatch against pinned libaom `03087864cf4bea6abb0d28f95cf7843511413d8f`. Every directional angle, DC, Paeth, smooth, filter-intra, chroma-from-luma, and palette operator remains family-owned under the JPEG-style static operator contract. All 93 focused cases pass without failures or skips, including the exact 39-frame official all-intra native sequence, exact palette native and presentation fixtures, and the 12-profile exact matrix. The existing production implementation required no correction. + - [x] Re-audit conventional intra syntax, palette and filter-intra eligibility and ordering, chroma-from-luma eligibility and alpha mapping, top-right and bottom-left availability, edge extension, filtering, upsampling, and predictor dispatch against pinned libaom `03087864cf4bea6abb0d28f95cf7843511413d8f`. Every directional angle, DC, Paeth, smooth, filter-intra, chroma-from-luma, and palette operator remains family-owned under the JPEG-style static operator contract. All 93 focused cases pass without failures or skips, including the exact 39-frame official all-intra native sequence, exact palette native and presentation fixtures, and the 12-profile exact matrix. The existing production implementation required no correction. Commit `42384454eb45b6107608ed33379c7a69b101d533` records the checkpoint. - [x] Intra-block copy for still-image intra frames. - [x] Decode tile-adaptive integer displacement vectors, derive and validate spatial references, apply the inter transform sets, and reconstruct luma and subsampled chroma through allocation-free `Vector512`/`Vector256`/`Vector128` operators with exact-width stores and scalar fallback. `FeatureTestRunner` verifies every transform width, bit-depth storage path, chroma phase, intrinsic tier, scalar continuation, and destination-padding boundary. - [x] Verify displacement-vector entropy, spatial candidate ordering, wavefront legality, native 8/10/12-bit reconstruction, and presented output against independently encoded opaque intra-block-copy AVIF fixtures from the pinned generic libaom/libavif reference. The fixtures require actual intra-block-copy block selection, compare every native plane sample from retained scalar-decoder Y4M output, and compare every presented RGBA byte exactly under normal hardware dispatch and each narrower fallback configuration without a tolerance. - [x] Correct libaom's 64-sample spatial-scan step threshold and ranked-reference clamping, consume intra-block-copy transform-size contexts, and compare both complete official extreme-displacement frames exactly with the pinned-libaom native YUV420 reference under normal and scalar dispatch. -- [ ] Inter-frame prediction for layered still-image items. +- [x] Inter-frame prediction for layered still-image items. - [x] Retain completed ungrained reference planes, frame headers, frame information, and published CDF snapshots in one eight-slot owner; apply refresh flags only after successful completion; resolve full and short reference signaling against occupancy and frame-ID validity; and implement primary-reference selection and `frame_size_with_refs`. - [x] Inherit primary-reference CDFs, segmentation features and unchanged maps, loop-filter deltas, and same-role global-motion parameters. Initialize the frame-owned per-8x8 temporal motion field and project eligible retained motion vectors in normative reference order. - [x] Implement allocation-free SIMD-first translational single-reference interpolation for regular, smooth, sharp, and bilinear filters; reduced four-sample kernels; horizontal, vertical, and separable two-dimensional convolution; exact AV1 rounding; 8/10/12-bit clipping; padded reference origins; and guarded destination strides. The operator contract and concrete operator files mirror JPEG color conversion, and `FeatureTestRunner` verifies normal, AVX-512-disabled, AVX-disabled, and scalar execution against an independent fixed-point oracle. @@ -625,6 +627,7 @@ Implement and verify in dependency order: - [x] Decode the official two-spatial-layer, two-temporal-layer L2T2 sequence at its default operating point. The 119,907-byte IVF has manifest-matching SHA-1 `32EF2F14EE9CB11A24A22934F4C065E926E5D236` and SHA-256 `14257D5FD3901581DBEB88133378CD79D50EA32506ADB729909AB56B4A52AF3C`; its pinned-libaom Y4M has SHA-256 `1ABB981CFF76BA9557DA437B258D8A95FCA755DED8E3949D857E8388AB1D6AE3`. All eight 1280x720 YUV420 frames match exactly under normal/scalar dispatch, and an 8 KiB constrained tracked allocator verifies balanced exactly-once returns. The existing decoder required no production correction. The scoped test-project analyzer build completes with zero errors and 1,011 repository warnings, Roslynk reports zero compiler errors, and both focused cases pass without failures or skips. - [x] Decode the official ten-frame active-film-grain sequence. The 28,634-byte IVF has manifest-matching SHA-1 `11BB40026103182C23A88133EDAFCA369E5575E2` and SHA-256 `BA3EDD82A58414F009E1C821B947EC8DE4E0420F33803CA7BFEA39AF6AEEA155`; its pinned-libaom grained Y4M has SHA-256 `C71958DE496A949D12E819190F240BD56010E5AD57D8A0D55903BF380A9E0C26`, while pinned libaom's skip-grain output differs with SHA-256 `9E0762A82E582E854AFF2DC61EBA1E48C0F1D41BBC21E5C896573DA3BB2F1200`. All ten displayed 352x288 YUV420 frames match exactly under normal/scalar dispatch; active synthesis, dependent retained-reference reconstruction, and 2 KiB constrained tracked allocation with exactly-once returns pass. The fixture corrected the AV1 default loop-filter reference deltas from a swapped Golden/Backward pair to the normative `[1, 0, 0, 0, -1, 0, -1, -1]` order. Both Release source targets build with zero warnings and errors, the scoped test-project analyzer build completes with zero errors and 1,011 repository warnings, Roslynk reports zero compiler errors, 28 focused cases pass without failures or skips, documentation review is complete, and `git diff --check` is clean. Commit `15613b01c0bc098fd9926b886216558e0d26eff9` records the checkpoint. - [x] Decode the official eight-bit monochrome sequence. The 10,000-byte IVF has manifest-matching SHA-1 `A17584012187CD886B64F8CB0F35BFD8D762F9DC` and SHA-256 `3DCC2A3C181F74788BD9575D94F0862D9E914415AC358A4DA4ED7D904F0535B7`; its ten-frame 576,000-byte pinned-libaom luma reference has SHA-256 `6A4F8A68366E801D60A14C00BE6EA88A861B1B631D86DEF8A8DB65EFB6B06FA8`. All ten displayed 320x180 native YUV400 frames match exactly under normal/scalar dispatch, the shared compact-sequence oracle keeps every prior YUV420 fixture exact, and a 2 KiB constrained tracked allocator verifies balanced exactly-once returns. The existing decoder required no production correction. Both Release source targets build with zero warnings and errors, the scoped test-project analyzer build completes with zero errors and 1,011 repository warnings, Roslynk reports zero compiler errors, all 17 official-sequence cases pass without failures or skips, documentation review is complete, and `git diff --check` is clean. Commit `da9a46b3d72fd682ea9293af3f88fde26defb222` records the checkpoint. + - [x] Reconcile every completed inter-frame child with the current production path and pinned libaom `03087864cf4bea6abb0d28f95cf7843511413d8f`. The connected syntax, reference-state, motion-derivation, translational, compound, inter-intra, OBMC, scaled, local-warp, global-warp, layered-presentation, film-grain, and monochrome paths contain no remaining explicit unsupported branch. Both Release source targets build with zero warnings and errors, the scoped test-project analyzer build completes with zero errors and 1,011 repository warnings, Roslynk reports zero compiler errors, and all 342 focused inter-frame cases pass without failures or skips. The existing production implementation required no correction. - [x] Lossless and high-bit-depth reconstruction with correct clipping and intermediate precision. - [x] Route lossless 4x4 blocks through allocation-free reversible inverse Walsh-Hadamard reconstruction for 8/10/12-bit samples, including the DC-only specialization, `Vector128` production traversal, scalar fallback, exact clipping, and `FeatureTestRunner` parity. - [x] Verify lossless syntax, inverse quantization, prediction, and presented reconstruction with independently encoded 8/10/12-bit AVIF fixtures. The tests require coded residuals with palette and intra-block copy disabled, compare every native YUV sample with the pinned generic libaom-backed decoder, and compare every presented RGBA byte with pinned generic libavif exactly under normal hardware dispatch and the scalar fallback.