Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions content/en/av1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, 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,
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,
Expand Down Expand Up @@ -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}

Expand All @@ -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: **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.

What the oracle does not cover:

- **Quantizer matrices** (`using_qmatrix`): no available vector sets the flag,
Expand Down
Loading