forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on a29d62bfa6ad16507a70ae4800bb08940152d17d

2026-09-07

feat(av1): a group's top ARF names the ARF two groups back as its second anchorAhmet Kaan Gümüş · 6aa3e57
feat(av1): a group's top ARF names the ARF two groups back as its second anchor

The ARF-vs-ARF census found our first top ARF naming the SAME picture as LAST
and GOLDEN (refs LAST@-8 GOLDEN@-8), where rav1e's ARFs read two distinct
anchors of their own chain. The slot the ARF is about to refresh still holds
the anchor from two groups back while this frame is coded, so naming it as
ALTREF costs no DPB slot and no extra encode.

Long-GOP gate on top of the pyramid tpl window: film A +42.8/+4.5 ->
+40.9/+3.1, film B +127.3/+32.9 -> +125.6/+32.0 -- both films down on both
columns. Pins re-taken: 9853 at q=150, 35866 at q=60; EC_AV1_ARF_ALTREF=0
restores 9859 / 35904.
test(av1): re-take the encoder's stream pins for the pyramid tpl window, and wire a second past anchor for the top ARF behind EC_AV1_ARF_ALTREFAhmet Kaan Gümüş · 51ec13e
test(av1): re-take the encoder's stream pins for the pyramid tpl window, and wire a second past anchor for the top ARF behind EC_AV1_ARF_ALTREF

The pins move by construction: every superblock of the four pinned pictures
is priced at its own temporal lambda now (9835 -> 9859 at q=150, 35798 ->
35904 at q=60, EC_AV1_TPL_PYRAMID=0 restores the pair). The long-GOP gate
keeps the change on both films and both columns (film A +43.1/+4.6 ->
+42.8/+4.5, film B +129.0/+34.3 -> +127.3/+32.9) and so does the 12-frame
gate on its two real film rows.

EC_AV1_ARF_ALTREF (default off) names the ARF from two groups back as the top
ARF's ALTREF instead of the key it already reads as GOLDEN -- the census
found our first ARF naming the SAME picture as LAST and GOLDEN where rav1e's
ARFs read two distinct anchors. The slot the ARF is about to refresh still
holds that older anchor, so it costs no DPB slot; its gate arm is running.
feat(av1): the temporal lambda map runs on the pyramid path, which is every default streamAhmet Kaan Gümüş · ccbcc73
feat(av1): the temporal lambda map runs on the pyramid path, which is every default stream

encode_pyramid_inter passed an empty lookahead window, so the propagating
per-superblock lambda map lane-av1tpl2/3 shipped has been inert on every
stream the encoder writes by default since the pyramid became the default --
it only ever ran on the flat A/B arm. The window is the group's own buffered
sources: display-order successors for a frame inside the leaf run, and the
group's leaves in reverse display order for its top ARF, whose successors are
not buffered yet and which those leaves predict backward from.

Measured through enc_probe on film B against the control's own rate/quality
slope: 1.9% fewer bytes at the q=150 point's PSNR and 0.2% at q=90, wall
unchanged. EC_AV1_TPL_PYRAMID=0 restores the old behaviour.

Also from the census lane: EC_AV1_LAMBDA_HIDDEN, a rate weight for hidden
frames alone (default 1.0 = unchanged), which is the knob the pyramid's q
offsets cannot express; the sweep says 1.0 is already the optimum.
census(av1): per-coded-frame syntax census with order hints, and the ARF-vs-ARF table it printsAhmet Kaan Gümüş · 671d201
census(av1): per-coded-frame syntax census with order hints, and the ARF-vs-ARF table it prints

The census now carries each coded frame's order_hint and its references'
order hints, so EC_CENSUS_PERFRAME=1 prints one full report per coded frame
with the display-order PSNR joined to it and every reference named by display
distance -- which is what an ARF-vs-ARF comparison against another encoder's
stream needs. EC_AV1_MV_DIST_SCALE is readable outside a test build (like the
encoder's other search margins) and its ceiling is a named constant with its
own knob, because the ceiling was written when the deepest reference in the
GOP sat at distance 4.
fix(av1): keep the rate loop's one-hidden-frame group splitAhmet Kaan Gümüş · 84491e1
fix(av1): keep the rate loop's one-hidden-frame group split

Pricing the group by its real hidden-frame count is the truthful model and
lands the 48-frame bitrate gate -9.4% / -14.9% under target against -1.8% /
-6.3%: the old split's over-allocation cancels ARF_WEIGHT's under-pricing of
a hidden frame, and fixing one alone un-cancels them. Documented at the line
with the measured pair; recalibration is a rate-control lane.
feat(av1): a fourth pyramid level -- hidden quarter-point ARFsAhmet Kaan Gümüş · e9fd8a5
feat(av1): a fourth pyramid level -- hidden quarter-point ARFs

Within a mini-GOP the leaf run now carries two more hidden frames, at the
middle of each half (pictures 2 and 6 of eight), coded at their own
quarter_q_offset -- the sixth EC_AV1_PYRAMID field, off by default until
the long-GOP sweep picks its offset. Every leaf names the nearest hidden
frame behind it as LAST_FRAME and the nearest one ahead as ALTREF_FRAME,
which the leaf loop now derives from one sorted list of the group's inner
hidden frames instead of the mid frame's index (byte-identical at three
levels and at two). The quarters take DPB slots 5 and 6; the whole slot
map is documented on QUARTER_SLOTS. RateLoop prices a group as h hidden
frames plus mini_gop - h leaves instead of assuming one hidden frame.
fix(av1): the probe armed a window film B does not haveAhmet Kaan Gümüş · 2ebcc2c
fix(av1): the probe armed a window film B does not have

`examples/enc_probe` was handed its crop by hand, and every long-GOP
census so far passed `crop=1920:1024:960:568` -- the centre of a
3840x2160 frame. Film B is coded 3840x1608, so the gate's own window is
`crop=1920:1024:960:292`: the instrument measured different pixels than
the gate it reported on (60466 B vs the gate's 90674 B at q=150), and
the probe also had no `-ss`, so on any clip it read from frame 0
instead of the gate's pinned seek.

One definition of the arming now serves both: `ec_av1::probe::source`
(the loader, with the seek) and `ec_av1::probe::gate_crop` (the
superblock-aligned centre window, from ffprobe), called by the probe and
by `encode::tests`' `clip_frames_vf`/`native_bd_arm`. The probe takes
`gate` as its width argument to ask for that window, and `EC_ENC_SS` for
the seek. In gate mode the probe now codes 90674 bytes on film B at
q=150 -- byte-exact with `bd_rate_film_long_gop`'s own ladder point.

`lanes/census-longgop-v2.md` re-takes the per-level census on the real
window; the v1 shares were off (ARF 49.3% -> 53.8%, key 25.6% -> 21.6%).
feat(av1): lossless key frames decode exact; lossless inter refused by nameAhmet Kaan Gümüş · 1e1a080
feat(av1): lossless key frames decode exact; lossless inter refused by name

Key/intra-only lossless frames decode sample-exact at 8 and 10 bit (64x64,
256x128 8-bit, 192x96 10-bit libaom -crf 0 streams, 0 sample diffs vs
ffmpeg). The inter path's luma leaves are synthesized as TX_4X4 but its
chroma plane is still one transform per block, so a lossless INTER frame is
refused by name and the refusal inventory carries it. The old refusal gate
becomes a_lossless_libaom_key_frame_decodes_sample_exact.
feat(av1): a lossless key frame decodes sample-exactAhmet Kaan Gümüş · b0db8e9
feat(av1): a lossless key frame decodes sample-exact

The rect strip readers take the per-transform-unit walk on a lossless frame
(depth_to_tx_wh returns TX_4X4 before it looks at the block), their chroma is
coded as 4x4 units plane-major with get_txb_ctx's +10 offset rows, and the
Walsh-Hadamard orientation is pinned by measurement. A 64x64 libaom -crf 0
key frame now decodes sample-exact against ffmpeg (6488 entropy steps
identical to aomdec's EC_TRACE_COEFF, 0 sample diffs).
docs(lane): lossless lane reportAhmet Kaan Gümüş · 27c4ad5Browse files
feat(av1): lossless decode groundwork -- WHT, TX_4X4 forcing, CfL narrowingAhmet Kaan Gümüş · f0a5a15
feat(av1): lossless decode groundwork -- WHT, TX_4X4 forcing, CfL narrowing

The 4x4 Walsh-Hadamard inverse (libaom av1_iwht4x4_16_add_c) with its own
round-trip test, a per-frame CodedLossless flag replacing the refusal (a
frame mixing lossless and lossy segments is still refused by name), the
TX_4X4 forcing in the square and 8x8-leaf intra readers, no tx_type symbol
(libaom read_tx_type: qindex 0 returns early), DCT_DCT on every plane, the
is_cfl_allowed narrowing to a 4x4 chroma plane block, and the +10 chroma
txb_skip rows at TX_4X4 that only a lossless frame reaches.
Merge branch 'lane-dpm1' (a016424d): a 128x128 intra block in an inter frame never set mu_chroma; lossless frames refused by name; the ladder decode assertion collectsAhmet Kaan Gümüş · bb30488
Merge branch 'lane-dpm1' (a016424d): a 128x128 intra block in an inter frame never set mu_chroma; lossless frames refused by name; the ladder decode assertion collects

Class: override slot on one arm. The bars 2160p libaom crf 45 point now
decodes exact; film B crf 5 was already exact. The screen row's libaom
crf 5 key frame is lossless (base_q_idx 0), which the tile reader does
not implement -- a feature lane follows.
docs(av1): lane-dpm1 suite totalsAhmet Kaan Gümüş · be62388Browse files
test(av1): the arfq arf and mini-gop arms; leaf 12 wins the long-GOP gateAhmet Kaan Gümüş · e11e279
test(av1): the arfq arf and mini-gop arms; leaf 12 wins the long-GOP gate
fix(av1): refuse lossless frames by name; the 128-intra-in-inter chroma context gateAhmet Kaan Gümüş · 2f8409b
fix(av1): refuse lossless frames by name; the 128-intra-in-inter chroma context gate
test(av1): the ladder decode assertion collects every failing reference point; the force_integer_mv fixture is sensitive againAhmet Kaan Gümüş · 5a13b43
test(av1): the ladder decode assertion collects every failing reference point; the force_integer_mv fixture is sensitive again
Merge branch 'lane-dkey' (c28d3574): key-frame sub-8x8 groups never cleared the palette bands; every reference ladder point now decodes through our decoder as a gate assertionAhmet Kaan Gümüş · f09b4e3
Merge branch 'lane-dkey' (c28d3574): key-frame sub-8x8 groups never cleared the palette bands; every reference ladder point now decodes through our decoder as a gate assertion

Class: CDF row held constant. libaom film B crf 5 key frame is symbol-
identical to aomdec now; its fourth inter frame still refuses. The new
assertion is red on bars 1080p libaom crf 45 (a +-1 reconstruction gap
in inter frame 1), which is the next decoder lane.
test(av1): pin the libaom screen stream whose sub-8x8 groups sit beside palette blocksAhmet Kaan Gümüş · 8d023ec
test(av1): pin the libaom screen stream whose sub-8x8 groups sit beside palette blocks

The stream whose key-frame block mi(76,88) exposed the stale palette bands:
without the fix all 12 frames differ from ffmpeg's decode from luma sample
491904 on. Synthetic 1920x1024 source, no film sample in fixtures.
fix(av1): the palette neighbour bands are cleared by the key-frame sub-8x8 leavesAhmet Kaan Gümüş · 2fe9a36
fix(av1): the palette neighbour bands are cleared by the key-frame sub-8x8 leaves

Narrows the previous commit: the 5 INTER-side zero-stamps regressed 13 tests
(our own encoder's screen streams stopped decoding) because the inter readers'
band index/footprint convention is not the palette bands' -- reverted, recorded
in lanes/dkey.report.md as the open half of the sweep. The two key-frame
sub-8x8 stamps, which are what the measured mi(76,88) desync needed, stay.
Merge branch 'lane-keyq' (1331ffaf): the pyramid codes its key frame 48 q-steps below base; the rate loop prices the key's shareAhmet Kaan Gümüş · a792324
Merge branch 'lane-keyq' (1331ffaf): the pyramid codes its key frame 48 q-steps below base; the rate loop prices the key's share

Long-GOP film A +52.0/+11.7 -> +43.5/+4.6, film B +144.5/+44.3 ->
+131.3/+35.0; 12-frame film A +43.3/+15.0 -> +38.5/+8.2, film B
+66.9/+35.1 -> +58.2/+26.5 vs libaom cpu-used 6 / rav1e speed 6. Key
share of the stream 10% -> 22%. Pins 9778 / 35450.
fix(av1): sub-8x8 and inter blocks never cleared the palette neighbour bandsAhmet Kaan Gümüş · 66e8f70
fix(av1): sub-8x8 and inter blocks never cleared the palette neighbour bands

A palette-Y block left its size and colours standing in the mi-granular
above/left palette bands: the sub-8x8 leaves and every inter block reader
published skip/lf/mode state but no palette state, while libaom's mi grid
carries palette_size 0 in exactly those cells. The next intra block then read
palette_y_mode off CDF row 1 where libaom reads row 0, decoded a palette libaom
never coded and skipped the use_filter_intra symbol a palette block has none of
-- one symbol short, tile desynced (class cdf-row-held-constant).

Measured on an instrumented aomdec: key frame block mi(76,88), ctx 0 vs ours 1.

external_ladder now decodes every reference ladder point through decode_stream
and asserts it sample-exact against ffmpeg.
docs(av1): the keyq sweep tableAhmet Kaan Gümüş · cf00a22Browse files
feat(av1): the pyramid codes its key frame 48 q-steps below baseAhmet Kaan Gümüş · 20d60a5
feat(av1): the pyramid codes its key frame 48 q-steps below base

The long-GOP sweep (lanes/keyq.sweep.txt): every arm from -16 to -48
improves both films on both columns, -48 is the floor (film A +52.0/+11.7
-> +43.5/+4.6, film B +144.5/+44.3 -> +131.3/+35.0), -64 overshoots on
film B, and a deeper ARF under the same key gives the bytes back. The
12-frame gate agrees (film A +43.3/+15.0 -> +38.5/+8.2, film B
+66.9/+35.1 -> +58.2/+26.5), so the offset is not gated on GOP length.

The rate loop had to learn the offset: a run holds one key frame, so the
key slot never gets a second frame to steer on, and the finer key ran the
48-frame bitrate gate +10.8% over target. Its byte share is now priced
through the calibration slope and the rest of the run pays for it (-0.3%).

Pins re-taken: 8590 -> 9778 and 28535 -> 35450.
Merge branch 'lane-dgolomb' (a4670b5a): temporal MV candidates ignored force_integer_mv; libaom's film B streams decode sample-exactAhmet Kaan Gümüş · edaf368
Merge branch 'lane-dgolomb' (a4670b5a): temporal MV candidates ignored force_integer_mv; libaom's film B streams decode sample-exact

The "Golomb tail" refusal was a correlate: lower_mv_precision had dropped
the is_integer half as unreachable, while libaom sets screen-content
tools on dark smooth film and force_integer_mv on any inter frame whose
source repeats the previous one. Class: branch dropped as unreachable.
test(av1): a synthetic 1920x1024 force_integer_mv gate, plus the lane reportAhmet Kaan Gümüş · fabb8ce
test(av1): a synthetic 1920x1024 force_integer_mv gate, plus the lane report

The gate builds its own source -- near-flat dark background (2..=4 luma values
per 16x16 block, libaom's own screen-content counting rule) with a textured
patch stepping 9 px every second frame, so half the frames are exact
duplicates of their predecessor, which is the only condition under which
`av1_is_integer_mv` returns 1. It asserts that libaom really coded an inter
frame with `force_integer_mv` and `use_ref_frame_mvs` before comparing all 12
shown frames against ffmpeg's own decode.

Reported honestly in lanes/dgolomb.report.md: this gate is currently BLIND to
the defect it was written for (stubbing the integer branch out still passes),
so the regression cover is the motion_field unit test whose values come from
the instrumented libaom oracle. The film-B ladder decodes sample-exact at
crf 20/35/45; crf 5 still desyncs on the key frame at mi(184,344).
test(av1): the encode:: tests take the knob lock the encoder:: gates already takeAhmet Kaan Gümüş · c1c9418
test(av1): the encode:: tests take the knob lock the encoder:: gates already take

Same shape as 963327d2, now for `encode::tests`: `speed::KNOBS` only protects a
setter from a concurrent encode if EVERY encoding test holds the read side, and
half the crate's encodes live in this module -- `force_intrabc`,
`force_filter_intra`, `force_screen` (via `favourite_mode`),
`set_verify_final_replay` and the census counter resets are all process-global
writes that were racing the `encoder::` gates and each other under the default
`--test-threads`.

11 tests that SET a global take `knob_write()`, 41 that only encode take
`knob_read()`, and 7 pure table tests (the rect-reach/of_tu/vert_ab tables and
the tpl factor unit test) take nothing because they never reach the encoder.
tile.rs and filter_search.rs need nothing: no test there calls the search or a
knob setter. Test-only, no production path touched.

Gates: `cargo test -p ec-av1 --release --lib -- encode:: tile::` 80 passed,
the two thread-count gates `--include-ignored` 2 passed, the crate suite
548 passed / 43 ignored, `cargo check --workspace --all-targets -j4` 0 errors
and 0 ec-av1 warnings, pins 8590 / 28535 unchanged.
fix(av1): temporal MV candidates ignored force_integer_mvAhmet Kaan Gümüş · 0c17efc
fix(av1): temporal MV candidates ignored force_integer_mv

`lower_mv_precision` implemented only its `is_integer == false` half, on a
comment claiming no reachable stream sets `force_integer_mv` because
`allow_screen_content_tools` is refused at the stream level. Neither half of
that claim holds: libaom turns screen-content tools on for dark, smooth FILM
(`av1_set_screen_content_options` counts near-flat 16x16 blocks) and then sets
`force_integer_mv` on the frames its hash test calls static, and this decoder
parses such streams without refusing anything.

The consequence was invisible to the parse: every temporal MV candidate came
out at eighth-pel where libaom rounds it to full pel, so the mv stack held
values libaom never produced. The stack still had the right shape for a
while, so the frame decoded "successfully" into a whole-frame prediction
mismatch, and the entropy desync that followed surfaced as the unrelated
refusal "a Golomb tail longer than this decoder reads" (class
`refusal-names-a-correlate`).

First divergence, measured against the instrumented libaom oracle: film-B
gate clip, `-cpu-used 6 -crf 35 -g 12`, decode-order frame 3 (order_hint 1,
the one inter frame with `force_integer_mv == 1`), block mi(0,0), the NEWMV
predictor -- identical `EC_TPL` field cells and identical range in both
decoders, aomdec's stack `(16,0)w16 (16,-8)w12 (8,-40)w4` against ours
`(14,-4)w16 (12,-2)w8 (12,-38)w4 (16,-4)w4`.

Class: `branch-dropped-as-unreachable` -- a spec branch deleted on an
unreachability note that a capability change (screen-content streams no
longer refused) silently invalidated.

All four libaom film-B ladder points at 48 frames now decode sample-exact
against ffmpeg/libdav1d except crf 5, which desyncs on the KEY frame at
mi(184,344) (base_q 9) -- a separate, still-open defect.