From e40a88308901f37a3f2660b0d90d47edfe295686 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 29 Nov 2026 19:41:45 +0100 Subject: [PATCH 1/2] av1: document stage S2 (intra reconstruction, v0.3.0) Co-Authored-By: Claude Sonnet 5.5 --- content/en/av1.md | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/content/en/av1.md b/content/en/av1.md index 3b62801..1c93235 100644 --- a/content/en/av1.md +++ b/content/en/av1.md @@ -6,8 +6,10 @@ weight: 16 # av1 {#av1} `github.com/go-avkit/av1` is a clean-room AV1 decoder in pure Go, built in -stages S0 to S8. **Stages S0 and S1 (v0.2.0) parse syntax and do not decode -pixels**: OBU headers and Section 5 or Annex B streams, the sequence header, +stages S0 to S8. **Stages S0 and S1 (v0.2.0) parse syntax; stage S2 (v0.3.0) +reconstructs intra frames before the loop filters**, see +[Intra reconstruction](#intra). Inter prediction and the loop filters are not +there yet. S0 and S1 cover OBU headers and Section 5 or Annex B streams, the sequence header, the frame header with its decoder state, and the tile syntax of every frame type (the `block` package: intra and inter mode info, reference frames, the motion vector stack, motion field estimation, intra block copy, palette, @@ -37,8 +39,25 @@ st, err := block.DecodeTileFrame(f, tileNum, tileData, &cdfs) state := f.State() // keep it in the slots the frame refreshes ``` -Only the syntax is parsed, so motion vectors are exact but nothing is -predicted or reconstructed. +Motion vectors are exact. Intra frames are also reconstructed (next section); +inter prediction is not implemented. + +## Intra reconstruction {#intra} + +From v0.3.0 the `recon` package holds the dequantiser (with quantizer +matrices), every inverse transform (DCT 4 to 64, ADST 4/8/16, identity, +Walsh-Hadamard for lossless), the intra predictors (DC, Paeth, smooth, +directional with edge filter and upsampling, filter-intra), chroma from luma and +the palette predictor, for 8 and 10 bits, 4:2:0 and monochrome (4:4:4 is +fuzzed, with no oracle). `block` predicts and reconstructs while it parses: + +```go +st, err := block.DecodeTileFrame(f, tileNum, tileData, &cdfs) +y := f.Plane(0) // CurrFrame as uint16, after the last tile, before any loop filter +``` + +The code is scalar; SIMD kernels are tracked in +[go-avkit/av1#6](https://github.com/go-avkit/av1/issues/6). ## What it claims, and how it was checked {#claims} @@ -53,6 +72,15 @@ vectors, the tile size, symbol count, bits consumed and the hash of the end-of-frame CDFs; **all 242 match**, inter frames and intra block copy included. The tile parser is fuzzed (corpora committed). +For reconstruction (S2), the planes of the 283 key and intra-only frames of the +same vectors are hashed and compared with the reference decoder run with its +loop filters off: **281 match**. The other 2 are the frames of +`av1-1-b8-16-intra_only-intrabc-extreme-dv`, which need intra block copy +prediction ([go-avkit/av1#7](https://github.com/go-avkit/av1/issues/7)). Each +`recon` function is also checked against a second transcription of the +specification, and the tile decoder is fuzzed with quantizer matrices and +lossless coding. + What the oracle does not cover: - **Quantizer matrices** (`using_qmatrix`): no available vector sets the flag, From 4787ac3885f761164a20c8f42e965c0e3231d113 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 29 Nov 2026 19:51:05 +0100 Subject: [PATCH 2/2] av1: all 283 intra frames match (v0.3.1, intra block copy) Co-Authored-By: Claude Sonnet 5.5 --- content/en/av1.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/en/av1.md b/content/en/av1.md index 1c93235..3c39ef6 100644 --- a/content/en/av1.md +++ b/content/en/av1.md @@ -6,7 +6,7 @@ weight: 16 # av1 {#av1} `github.com/go-avkit/av1` is a clean-room AV1 decoder in pure Go, built in -stages S0 to S8. **Stages S0 and S1 (v0.2.0) parse syntax; stage S2 (v0.3.0) +stages S0 to S8. **Stages S0 and S1 (v0.2.0) parse syntax; stage S2 (v0.3.0, v0.3.1) reconstructs intra frames before the loop filters**, see [Intra reconstruction](#intra). Inter prediction and the loop filters are not there yet. S0 and S1 cover OBU headers and Section 5 or Annex B streams, the sequence header, @@ -74,9 +74,9 @@ included. The tile parser is fuzzed (corpora committed). For reconstruction (S2), the planes of the 283 key and intra-only frames of the same vectors are hashed and compared with the reference decoder run with its -loop filters off: **281 match**. The other 2 are the frames of -`av1-1-b8-16-intra_only-intrabc-extreme-dv`, which need intra block copy -prediction ([go-avkit/av1#7](https://github.com/go-avkit/av1/issues/7)). Each +loop filters off: **all 283 match**. The two frames of +`av1-1-b8-16-intra_only-intrabc-extreme-dv` need intra block copy prediction, +added in v0.3.1 ([go-avkit/av1#7](https://github.com/go-avkit/av1/issues/7)). Each `recon` function is also checked against a second transcription of the specification, and the tile decoder is fuzzed with quantizer matrices and lossless coding.