From 42384454eb45b6107608ed33379c7a69b101d533 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sat, 29 Aug 2026 21:45:08 +1000 Subject: [PATCH] Close AV1 intra prediction verification --- HEIF_IMPLEMENTATION_PLAN.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/HEIF_IMPLEMENTATION_PLAN.md b/HEIF_IMPLEMENTATION_PLAN.md index 6ab5a7edc..f0b508b16 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 `e6f0ef84fc8273a7d50fdfc1489f54f058a2a424`. Committed checkpoints include the AV1 transform architecture, OBU framing, 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 `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. 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. @@ -55,6 +55,8 @@ Commit `da9a46b3d72fd682ea9293af3f88fde26defb222` records the official eight-bit Commit `e6f0ef84fc8273a7d50fdfc1489f54f058a2a424` records the OBU framing verification checkpoint. The bounded parser was re-audited against pinned libaom across length fields, operating points, header ordering, padding, alignment, tile-group boundaries, tile sizes, and ordered coverage. Corrected test oracles now address the actual item-relative tile bytes and avoid reflection invocation of span-valued properties. Both Release source builds remain clean, the scoped analyzer build and Roslynk report zero errors, all 119 focused cases pass, and `git diff --check` is clean. +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. + Status meanings: - **Complete:** the implementation and its phase exit evidence are recorded. @@ -65,7 +67,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 tile partitioning, mode information, segmentation, delta quantization, transform-size selection, coefficient decoding, inverse quantization, and inverse transforms.** The complete profile matrix and every partition type are exact, but the parent remains unchecked. Audit the production traversal and its focused tests against pinned libaom, identify the specific valid syntax or evidence gap, and implement only that gap before advancing to intra prediction. +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. | Order | Delivery stage | State | Delivered state | Gate that remains open | | --- | --- | --- | --- | --- | @@ -579,14 +581,16 @@ Implement and verify in dependency order: - [x] Isolate every declared OBU payload with a zero-copy bounded span reader, advance ignored metadata and reserved units without parsing their bytes as headers, validate padding and trailing bytes, enforce primary/redundant/combined frame-header order, accept the final unsized low-overhead OBU by consuming the bounded image-item remainder, and reject lengths that cross the containing boundary. Focused malformed-input tests and independent 8/10/12-bit AVIF reconstruction pass in Release. - [x] Re-audit the complete bounded parser against pinned libaom `03087864cf4bea6abb0d28f95cf7843511413d8f`, including ULEB128 and Annex B lengths, operating-point filtering, sequence/frame ordering, redundant-header identity, temporal delimiters, padding, byte alignment, tile-group bounds, tile sizes, and complete ordered tile coverage. AV1-ISOBMFF's final unsized low-overhead OBU remains the deliberate item-specific extension and is covered by a real fixture. Correct the stale direct tile tests to address item-relative tile bytes and make header round-trip diagnostics skip span-valued properties that reflection cannot box. Both Release source builds remain zero-warning and zero-error, the scoped test-project analyzer build completes with zero errors and 1,011 repository warnings, Roslynk reports zero compiler errors, and all 119 focused framing, lifecycle, bit-reader, tiling, and official-sequence cases pass without failures or skips. Commit `e6f0ef84fc8273a7d50fdfc1489f54f058a2a424` records the checkpoint. - [x] One coherent bounded decoder lifecycle retains parsed tile state until successful frame completion, commits frame-owned reference samples and metadata only after reconstruction, resets retained state at a new sequence boundary, and disposes tile, reference, entropy, and presentation ownership deterministically. The real two-layer lifecycle fixture proves the header/reference ownership boundary through a fake tile reader; dependent inter reconstruction remains covered by the unchecked items below. -- [ ] Tile partitioning, mode information, segmentation, delta quantization, transform-size selection, coefficient token decode, inverse quantization, and inverse transforms. +- [x] Tile partitioning, mode information, segmentation, delta quantization, transform-size selection, coefficient token decode, inverse quantization, and inverse transforms. - [x] Match libaom's depth-first traversal and frame-edge behavior for all ten AV1 partition types. Independent 8/10/12-bit streams collectively select every terminal partition shape and contain nested block geometry that requires recursive `Split` traversal; their complete native planes remain byte-exact under normal hardware dispatch and the scalar fallback. - [x] Verify the complete 8/10/12-bit monochrome, 4:2:0, 4:2:2, and 4:4:4 base profile matrix against pinned libaom native planes and pinned libavif presentation output. All 12 fixtures match exactly with normal dispatch, AVX-512 disabled, AVX disabled, and all hardware intrinsics disabled through `FeatureTestRunner`. - [x] Correct monochrome plane classification, maximum-superblock-row loop-filter traversal, and identity/one-dimensional inverse-quantization-matrix selection exposed by the profile matrix. The quantization rule matches libaom's `tx_type < IDTX` boundary and is verified by the exact native-plane oracle rather than a tolerance. -- [ ] Intra prediction, including every directional, smooth, Paeth, CFL, filter-intra, and palette case permitted by AV1. + - [x] Re-audit partition and transform traversal, mode and segment ordering, superblock delta-Q and delta-LF updates, coefficient EOB, reverse magnitude, sign, and Golomb parsing, inverse quantization, and inverse-transform dispatch against pinned libaom `03087864cf4bea6abb0d28f95cf7843511413d8f`. Correct the stale coefficient round-trip oracle to compare retained entropy-scan order and dispose its encoded 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, and all 947 focused cases pass without failures or skips. Commit `fc9320262cc08dd5daf41f231998403b804b98da` records the checkpoint. +- [x] Intra prediction, including every directional, smooth, Paeth, CFL, filter-intra, and palette case permitted by AV1. - [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] 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.