forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on af0283676a56841ffed3e3f8a480db6a166ab371

2026-09-07

feat(av1): gate the 64x64 residual arm off on screen content; clamp the 64-root early-outAhmet Kaan Gümüş · af02836
feat(av1): gate the 64x64 residual arm off on screen content; clamp the 64-root early-out

Native gate, two arms of one build, baseline reproduced to the tenth
(film A +43.0/+15.0, film B +64.7/+34.0, screen +33.4/-23.8):

| row | skip-only root | + residual arm |
|---|---|---|
| film A | +43.0 / +15.0 | +42.9 / +14.8 |
| film B | +64.7 / +34.0 | +63.3 / +31.5 |
| screen | +33.4 / -23.8 | +34.3 / -23.4 |

Both film rows improve on both columns; screen loses 0.9 vs libaom,
outside the keep rule's screen clause -- so the arm is gated off on a
screen frame, the same content gate the coding pyramid takes. Re-run with
the gate: film rows unchanged, screen row byte-identical to the skip-only
arm (40155/51325/63998/80203 B), keep rule passes.

Also: the 64-root early-out no longer follows crate::speed::SPLIT_RD up
the preset ladder (b64_breakout_threshold clamps it at the shipped 0.125).
lane-b64 measured what 0.5 does one size up: a whole superblock taken at
64x64 with its four quadrants never searched, film B +91.5/+53.4 ->
+114.6/+71.5. Inert at presets 0..3, which already run 0.125.
feat(av1): a 64x64 inter root can code a real residualAhmet Kaan Gümüş · 236d76c
feat(av1): a 64x64 inter root can code a real residual

lane-tx64 step 1+2. The charter's premise (a) -- "transform.rs has no
forward TX_64X64" -- is STALE: forward_dct_n::<_, 6> has been there since
the network was written, quantize already drops everything outside the
coded 32x32 corner, and a_64x64_transform_keeps_what_fits_in_its_coded_quarter
round-trips a 64x64 residual through the decoder's own inverse. What was
missing was the two ends around it.

Encoder: code_from_prediction takes a 64-sided block (heap residual only
for that one case, the 4x4..32x32 path keeps its stack array) and hands
back the coded 32x32 corner as its levels, which is what both the pricer
and the writer want. search_skip_64 prices the skip winner's prediction a
second time with a real residual -- one TX_64X64 luma, one TX_32X32 per
chroma plane -- and takes it when it costs less.

Writer: Quadrant::Whole64 no longer refuses a non-skip block; it codes
skip 0, the txfm_split flag at depth 0, and TxbSet::Luma64 + two
Chroma32 planes, the same pair sb_coeff_key_frame_tile's
Superblock::Whole already wrote.

Deferred: compound refs at the 64 root, depth-1 4x32x32 var-tx, intra 64,
edge superblocks -- all still refused/unsearched.
Merge branch 'lane-b64' (52edbfd2): a 64x64 skip root in the inter search, on at presets 0..3Ahmet Kaan Gümüş · 473ca5c
Merge branch 'lane-b64' (52edbfd2): a 64x64 skip root in the inter search, on at presets 0..3

Film A +44.2/+15.7 -> +43.0/+15.0, film B +70.5/+35.2 -> +64.7/+34.0,
screen +48.2/-16.4 -> +33.4/-23.8 vs libaom cpu-used 6 / rav1e speed 6;
wall down on four rows. Pins 7291 / 27466. Non-skip and intra 64 roots
wait on a forward 64-point transform.
perf(av1): the 64x64 root ships at presets 0..=3, off from 4Ahmet Kaan Gümüş · 71bf2a8
perf(av1): the 64x64 root ships at presets 0..=3, off from 4

Measured on the native gate at EC_AV1_SPEED=6 (two arms side by side): ON
costs film A +55.1/+24.8 -> +64.5/+37.5 and film B +91.5/+53.4 ->
+114.6/+71.5 for -16%/-36% wall, because the trial's early-out rides
SPLIT_RD -- at 0.5 a superblock is taken whole with its quadrants never
searched and film B's q150 point drops 1.2 dB. Presets 1..=3 keep SPLIT_RD
at 0.125, so they get the early-out that was measured good.
test(av1): re-pin the encoder's own streams for the 64x64 rootAhmet Kaan Gümüş · be3d4bc
test(av1): re-pin the encoder's own streams for the 64x64 root

8076 -> 7291 bytes at q=150 and 27585 -> 27466 at q=60 over the four-frame
pin clip. The native gate keeps the lever: every row improves on both
columns (film A +44.2/+15.7 -> +43.0/+15.0, film B +70.5/+35.2 ->
+64.7/+34.0, screen +48.2/-16.4 -> +33.4/-23.8, bars 2160p +20.7/-3.8 ->
+13.3/-9.9). EC_AV1_B64=0 restores the old pins byte for byte.
feat(av1): a 64x64 PARTITION_NONE skip root for the inter searchAhmet Kaan Gümüş · 5bcc6a5
feat(av1): a 64x64 PARTITION_NONE skip root for the inter search

The census (lanes/census-filmB.md) found rav1e speed 6 coding 45.2% of its
blocks at 64x64 -- 73.8% of its leaf blocks, 99.2% of them skip -- while
every block this encoder wrote was a 32x32 quadrant or smaller, which put our
mode+mv+partition+tx_size spend at 162,669 bits against rav1e's 61,988.

The search now offers the whole superblock as one 64x64 block coded SKIP
(NEAREST/NEAR/GLOBAL/NEW single-ref, priced through the same symbol_bits
path) against the four quadrants, and takes it outright when its per-pixel
cost is already under the split-RD threshold -- where the lever saves wall
rather than spending it. Skip-only: a 64x64 residual needs a forward
TX_64X64 the encoder does not have, and the writer refuses any other shape.

EC_AV1_B64=0 switches it off; speed::B64_ROOT is the preset column.
Merge branch 'lane-census' (eee03662): decode-side syntax and bit census (EC_AV1_BITCENSUS), and the film B answerAhmet Kaan Gümüş · 09cb0af
Merge branch 'lane-census' (eee03662): decode-side syntax and bit census (EC_AV1_BITCENSUS), and the film B answer

Bits are charged per CDF table by address range, so every tool is
accounted without call-site labels; census total tracks the tile payload
to 0.03%. Film B at matched PSNR: the whole gap is inter frames (leaves
11.5x rav1e's bytes); no 64x64 blocks or transforms are coded (46% of
the gap); rav1e's q ladder spreads 61 steps against our 24.
Merge branch 'lane-pyr3' (fb84d37d): the frame pyramid re-swept on real film; default 16:-24:16Ahmet Kaan Gümüş · 29892fb
Merge branch 'lane-pyr3' (fb84d37d): the frame pyramid re-swept on real film; default 16:-24:16

Film A +52.8/+23.3 -> +44.2/+15.7, film B +81.0/+46.1 -> +70.5/+35.2 vs
libaom cpu-used 6 / rav1e speed 6; screen byte-identical. Pins 8076 /
27585. The 12-frame gate cannot separate mini_gop 16 from 12; a longer
GOP gate follows.
perf(av1): re-sweep the coding pyramid on real film -- 16:-24:16Ahmet Kaan Gümüş · 92428b3
perf(av1): re-sweep the coding pyramid on real film -- 16:-24:16

The shipped 4:-16:8 was chosen when the BD gate's "film" rows were still
testsrc2 colour bars, and CfL, the luma angle deltas, filter intra, the
propagating tpl map and the rate-loop step have all landed since, so the
shape was unswept on real content (class `unswept decision constants`).

Swept through the gate's own EC_AV1_PYRAMID knob on the two real film rows
of encode::tests::bd_rate_screen_native: the mini-GOP axis at the shipped
offsets, then both offset axes at the best mini-GOP, then the joint corners
(21 arms, table in Pyramid::default and lanes/pyr3.sweep.txt).

16:-24:16 takes 8.6 / 7.6 BD points off film A and 10.5 / 10.9 off film B
against 4:-16:8 (vs libaom / vs rav1e); the screen row is byte-identical in
every arm because the content gate codes it flat. Leaf +16 was the swept
range's edge and still improving on film A, so two arms past it were run:
film B turns back up at +20, so +16 is where both films are minimal.

Pins re-taken: encode_sequence codes the 4-picture pin clip as one truncated
group now (hidden ALTREF at q-24, three leaves at q+16), 7373 -> 8076 at
q=150 and 27074 -> 27585 at q=60; EC_AV1_PYRAMID=4:-16:8 restores them.
feat(av1): a decode-side syntax census, and the film B vs rav1e table it producedAhmet Kaan Gümüş · 373b6a2
feat(av1): a decode-side syntax census, and the film B vs rav1e table it produced

The BD gate says our stream is bigger; it never says which syntax it is
bigger in. This adds a per-CDF-table bit accountant to the symbol decoder
(EC_AV1_BITCENSUS=1, one relaxed load per symbol when off) plus block, tx,
mv, mode and frame-header funnels, and an examples/syntax_census.rs that
prints one table per stream -- so our stream and rav1e's are measured by the
same reader.

lanes/census-filmB.md holds the answer for film B at matched PSNR: the whole
gap is in the inter frames (our key frame is the smaller and the worse one),
75% of it in the leaves, and the three mechanisms are the flat pyramid q
ladder, the missing 64x64 blocks and transforms, and a 52.5% vs 84.8% skip
share.
feat(av1): filter intra predicts per transform unit, depths searched on screen framesAhmet Kaan Gümüş · 235add9
feat(av1): filter intra predicts per transform unit, depths searched on screen frames

The filter-intra candidate used to be priced at tx_depth 0 only: a block
whose ordinary intra winner wanted a split transform was compared against
a handicapped filter arm, and only 19-44% of intra blocks code depth 0.

`Plane::code_tx_depth` now takes the block's `filter_intra_mode` and
predicts each transform unit recursively off the units before it -- what
decode.rs already does per unit -- so the arm can be priced at every
depth through the same pricer, neighbour context and `fimode_to_intradir`
tx row.

Measured on the native BD table: searching the depths on EVERY frame
moves screen -1.0/-0.4 and the bars rows -0.4/-0.7, but leaves film A
flat and film B +0.1/+0.5 WORSE at +30..35% encoder wall -- the extra
filter blocks are a locally cheaper reconstruction the film rows then
predict from. So the depth search is armed on screen frames only: every
non-screen frame keeps the depth-0-only arm and codes byte-identical
streams (film A/B and both bars rows reproduce the baseline table byte
for byte), while the screen row goes +49.2 -> +48.2 vs libaom and
-16.0 -> -16.4 vs rav1e for +21% wall on that row.
Merge branch 'lane-av1fast' (d3c88c3d): a speed preset axis 0..=10 for the software encoder, preset 0 the shipped searchAhmet Kaan Gümüş · db67894
Merge branch 'lane-av1fast' (d3c88c3d): a speed preset axis 0..=10 for the software encoder, preset 0 the shipped search

Levers priced on film A; compound is the costliest tool to drop and warp,
loop restoration and the tpl map are free. The Pareto against rav1e and
SVT-AV1 fast presets is recorded in speed.rs: pruning alone does not reach
real time. Filter intra ships as a preset-0-only lever.
feat(av1): filter intra is a speed lever -- on at preset 0, off above itAhmet Kaan Gümüş · a14fe08
feat(av1): filter intra is a speed lever -- on at preset 0, off above it

Rebased onto main's filter-intra candidate, then priced it the way every
other lever in speed.rs was priced. Two sequential arms on film A native
at speed 3 (lanes/fi-s3-{on,off}.log): ON +54.6/+24.3 BD at 43.1s over a
13.7s rav1e anchor, OFF +55.1/+24.7 at 39.6s over 14.2s -- 0.5 BD points
for 12.8% wall, 0.039 points per 1% wall, between the levers speed 3
already cuts (CfL + angle, 0.031) and the next one it keeps (coefficient
breakout, 0.041). A preset whose purpose is wall does not spend it there,
so FILTER_INTRA is true at index 0 only; EC_AV1_FILTER_INTRA still wins.

filter_intra_on() also loses its OnceLock cache for the LazyLock-env +
speed::at shape every other lever uses -- the preset is set at encoder
construction, so a cached value would have frozen the first speed.
docs(av1): the preset Pareto against rav1e, libaom and SVT-AV1Ahmet Kaan Gümüş · 4ff71fa
docs(av1): the preset Pareto against rav1e, libaom and SVT-AV1

Native-gate film and screen rows per preset, threaded fps at 1920x1080
and 3840x1608 (4x2 tiles, 8 threads), and a 4-point ladder for every
reference preset this ffmpeg can run (its libaom wrapper caps cpu-used at
8, and cpu-used 6 and 8 code byte-identical ladders here). The keep rule
fails on film at every preset: rav1e reaches our speed-10 wall at +16.9
BD where we are at +104.9.
test(av1): the shipped presets decode sample-exact through both decodersAhmet Kaan Gümüş · e66bbaa
test(av1): the shipped presets decode sample-exact through both decoders

Re-adds the preset gate the crate-wide rustfmt revert took with it, and
records the measured lever table and preset rows in speed.rs's own docs.
feat(av1): compose the speed presets from a measured per-lever tableAhmet Kaan Gümüş · ed24ce6
feat(av1): compose the speed presets from a measured per-lever table

One native-gate ablation per lever on film A at speed 0 (lanes/ab-*.log):
warp, loop restoration and the tpl map are free or better on real film
(-0.2/-0.2/0.0 BD) and the 8x8 split is 59% of the wall for +0.6, while
compound costs +30.5 BD and leaf compound +9.6 -- so the ladder switches
them off in that order, not in the order the old bars-fixture sweeps
suggested. The table and the end-to-end preset rows are in speed.rs.
feat(av1): a speed preset axis (0..=10), preset 0 the search we shipAhmet Kaan Gümüş · 597c1a3
feat(av1): a speed preset axis (0..=10), preset 0 the search we ship

Every search lever this crate already has an EC_AV1_* knob for reads its
default from a per-speed table in the new `speed` module, indexed by one
process-global preset (`Av1Encoder::with_speed`, `EC_AV1_SPEED`). Index 0
of every table IS the shipped constant, so preset 0 is byte-identical by
construction; `speed::levers` names what each preset switches off, and
ec-bench codes one row per preset {0,3,6,10}.
Merge branch 'lane-fintra' (88c5ef0f): filter intra as an intra-search candidate, default on; enable_filter_intra threaded through every raw decode of the encoder's own tilesAhmet Kaan Gümüş · 9b5376d
Merge branch 'lane-fintra' (88c5ef0f): filter intra as an intra-search candidate, default on; enable_filter_intra threaded through every raw decode of the encoder's own tiles

Native table: film A +53.2/+23.4 -> +52.8/+23.3, film B +81.5/+46.5 ->
+81.0/+46.1, screen flat. Pins 7373 / 27074. Six gate decodes passed a
literal false for the header bit (stale-header class, swept).
test(av1): mode ablations opt out of filter intra; re-pin the encoder's own streamsAhmet Kaan Gümüş · 0b03c13
test(av1): mode ablations opt out of filter intra; re-pin the encoder's own streams
test(av1): a filter-intra key frame decodes pixel-exact through ffmpeg; native gate prints the fire rateAhmet Kaan Gümüş · 24771c9
test(av1): a filter-intra key frame decodes pixel-exact through ffmpeg; native gate prints the fire rate
perf(av1): measure the encoder's first decode -- 94% of it is parse, not reconstructionAhmet Kaan Gümüş · 591f575
perf(av1): measure the encoder's first decode -- 94% of it is parse, not reconstruction

The encoder decodes its own written tiles once per frame to reach the
reconstruction and the per-mi neighbour state the filter search reads
(`par::S_FIRST`). The plan for removing it was to hand the decoder the
encoder's own reconstruction, which the writer already holds.

`EC_AV1_NORECON=1` drops every recorded pixel write in `exec_op` and
leaves the entropy parse and the neighbour bookkeeping alone. At
3840x1608 (4 frames, 4x2 tiles, 8 tile threads) the stage moves 150 ms
-> 141 ms: the reconstruction is 6% of it, the parse and the per-mi
grids are the other 94%. So the planes are not the lever -- only a
writer-side publisher of the filter-relevant `decode::Neighbours` grids
(blk_grid, tx/tx_h, uv_tx/uv_tx_h, ref_grid, delta_lf_grid), which skips
the parse entirely, can remove the stage.

Measurement only; the flag is off by default and the encoder's own
streams are byte-identical to their pins.
feat(av1): filter intra as an intra-search candidateAhmet Kaan Gümüş · b978eaa
feat(av1): filter intra as an intra-search candidate

Threads the sequence header's `enable_filter_intra` through the raw inter
tile decode entry points and the gates that decode the encoder's own tiles
(stale-header class: five hard-coded `false`s), writes
`filter_intra_mode_info` at all five intra write sites between the palette
colour lists and the colour-index maps, and offers the five recursive
filter-intra modes as RD-priced candidates after the mode/tx-depth/palette
searches. `EC_AV1_FILTER_INTRA=0` restores the previous streams.
fix(tests): fixture selection matched the checkout path, not the file nameAhmet Kaan Gümüş · a8b31aa
fix(tests): fixture selection matched the checkout path, not the file name

The GPU decode tests picked their fixtures with
p.to_string_lossy().contains(codec), which sees the whole path. In a
worktree called edith_codecs-av1fast every .ivf matched "av1", so the
VP9 streams were handed to the AV1 decoder and came back as
Stream(Corrupt { context: "AV1 obu_forbidden_bit is set" }) after the
five real AV1 fixtures had decoded frame-exactly. Same shape swept in
ec-image (lossless/lossy/animated), ec-ogg and ec-mp4.
Merge branch 'lane-hwav1p010' (bc5dfe9c): 10-bit hardware AV1 encode and CBR/VBR/QVBR rate controlAhmet Kaan Gümüş · 6c19568
Merge branch 'lane-hwav1p010' (bc5dfe9c): 10-bit hardware AV1 encode and CBR/VBR/QVBR rate control

P010 surfaces with high_bitdepth in the sequence header; film B's native
10-bit crop agrees frame for frame between ec-av1 and libdav1d. The rate
control attribute must be set at config creation, and the HRD buffer is one
rate window three-quarters full (two half-full windows undershot by 20%).
test(ec-hw): exercise the two 10-bit refusals; bench 10-bit row off the black leaderAhmet Kaan Gümüş · b19cdc4
test(ec-hw): exercise the two 10-bit refusals; bench 10-bit row off the black leader

The refusals are claims, so they are driven: a 10-bit HEVC config must
fail to build (High and Main are 8-bit profiles) and 8-bit pixels handed
to a 10-bit encoder must be refused. ec-bench's 10-bit row seeks a
minute in -- frame 0 of a film is its black leader, which coded to 1 kB
for 30 frames and benchmarked nothing (101 kB now).
build: raise the test-thread stack in the repo config; the 48-frame rate-target test overflowed 2 MB in debug buildsAhmet Kaan Gümüş · 06e0c1f
build: raise the test-thread stack in the repo config; the 48-frame rate-target test overflowed 2 MB in debug builds
feat(ec-hw): 10-bit BD row, 10-bit fps, ec-bench 10-bit row, docsAhmet Kaan Gümüş · ebea85e
feat(ec-hw): 10-bit BD row, 10-bit fps, ec-bench 10-bit row, docs

The 10-bit BD row is film B's own 1920x1024 native crop, every arm in
the 10-bit domain: hw AV1 10-bit is +36.7% BD-rate against librav1e
speed 6 10-bit and +52.9% against libaom cpu-used 6 10-bit, with all
three ladders asserted monotone. av1_encode_speed gains a 3840x1608
10-bit row, and ec-bench an 'ec-hw av1 10-bit' encode row that skips as
a row without a VA device.
feat(ec-hw): CBR, VBR and QVBR rate control for hardware encodeAhmet Kaan Gümüş · 5fcd26f
feat(ec-hw): CBR, VBR and QVBR rate control for hardware encode

The AV1 path had only ever measured CQP because the VA config was
created without a VAConfigAttribRateControl at all: a driver configured
for CQP ignores a bitrate handed to it afterwards. The attribute is now
set from the mode, and VariableBitrate / Qvbr join the enum (VBR sends
the ask as a 1.5x ceiling at 66%, QVBR sends quality_factor, which
needed a field in VAEncMiscParameterRateControl's payload).

Root cause of a 20% CBR undershoot, found by comparing with ffmpeg's own
av1_vaapi on the same clip (it undershot 8%): the HRD buffer was two
rate windows starting half full. One window, three quarters full -- what
ffmpeg asks for -- brings CBR to -4.2/-5.1/-7.9% and VBR to
+1.0/-3.8/-6.9% at 2/6/12 Mbps on film A 1080p30.

Gate av1_encode_rate_control_lands prints the whole table (pix_fmt, mode,
target, delivered, PSNR) and asserts CBR within 15%, VBR within 25%,
PSNR monotone in the target, and QVBR under its ceiling.
feat(ec-hw): 10-bit AV1 hardware encodeAhmet Kaan Gümüş · 98dcdcf
feat(ec-hw): 10-bit AV1 hardware encode

His whole AV1 library is yuv420p10le, so an 8-bit-only hardware encoder
does not serve his files. EncoderConfig gains a bit_depth (8, or 10 for
AV1: H264High and HEVCMain are 8-bit profiles by definition, which is a
fact about the profiles this crate configures, not a driver refusal), a
10-bit encoder allocates P010 surfaces, uploads through encode_16, sets
bit_depth_minus8 = 2 in the sequence parameters and high_bitdepth in the
sequence header OBU it packs. encode_frame now passes a 10-bit decoded
surface straight through when the encoder is 10-bit too, and VPPs only
when the depths or the sizes differ.

Gate av1_10bit_encode_agrees_between_two_decoders on film B's own
1920x1024 native crop: ec-av1 and libdav1d agree sample for sample on
all 10 frames, ffprobe reads yuv420p10le out of the sequence header,
decoded peak luma 610 (> 255), worst frame 48.09 dB from the source in
the 10-bit domain.
Merge branch 'lane-hwav1enc' (eda549f4): VAAPI AV1 hardware encode, on by default, agreed by two decodersAhmet Kaan Gümüş · cb7efaf
Merge branch 'lane-hwav1enc' (eda549f4): VAAPI AV1 hardware encode, on by default, agreed by two decoders

radeonsi parses the app-written sequence and frame header OBUs and writes its
own; the coded buffer carries no temporal delimiter, so one is prepended per
frame. Film A reads +29.2% vs librav1e speed 6 at 122.8 fps (1080p) and
48.2 fps at 3840x1608.
test(ec-hw): a hardware AV1 quality row against librav1e and libaomAhmet Kaan Gümüş · c1c4cb5
test(ec-hw): a hardware AV1 quality row against librav1e and libaom

Four quantisers on a 1080p crop of a film and of a screen capture from
the real-library manifest, PSNR from ffmpeg, BD-rate over the shared
quality range. The number is printed, not asserted -- a fixed-function
encoder is not a search -- but the ladders are asserted monotone.
Merge branch 'lane-av1libdet' (3b42e286): the screen detector probed against the whole real library; zero camera rows fire, constants unchangedAhmet Kaan Gümüş · ed9607d
Merge branch 'lane-av1libdet' (3b42e286): the screen detector probed against the whole real library; zero camera rows fire, constants unchanged

The premise that a real film of his was classified as screen was false: the
ec-bench "real film" h264 source is a desktop recording, so the flat verdict
was right. probe_screen_library walks the manifest at three offsets.
feat(ec-hw): AV1 encode on by default, and an ec-bench hardware rowAhmet Kaan Gümüş · 24f4e5c
feat(ec-hw): AV1 encode on by default, and an ec-bench hardware row

The opt-in existed because a 2026-08-14 submission crashed the GPU; on
mesa 26.1.8 the path encodes streams two decoders agree on, so the
refusal goes rather than outliving its evidence. ec-bench gains an
'ec-hw av1 encode' row that skips as a row when there is no VA device.
feat(ec-hw): AV1 hardware encode that two independent decoders agree onAhmet Kaan Gümüş · a518304
feat(ec-hw): AV1 hardware encode that two independent decoders agree on

The AV1 encode path submitted parameters no header described: radeonsi
parses the application's sequence and frame header OBUs and writes the
stream from them, so without those OBUs the coded buffer meant nothing.
This writes both (spec 5.5.1 / 5.9.1, the subset the driver advertises:
one tile, one reference, no CDEF, no restoration, no superres), fills
the picture parameter buffer to agree with them field for field, and
prepends the temporal delimiter the driver does not emit.

Gate: ec-av1 and ffmpeg's libdav1d decode every shown frame of a
640x384 and a 1920x1080 stream sample for sample, and the coded picture
is within 60 dB of the one submitted.
Merge branch 'lane-av1cfl' (012f8eab): chroma-from-luma and luma angle deltas in the intra search; the rate loop's per-slot acquisition stepAhmet Kaan Gümüş · 5546c56
Merge branch 'lane-av1cfl' (012f8eab): chroma-from-luma and luma angle deltas in the intra search; the rate loop's per-slot acquisition step

Native rows: film A +54.1/+24.2 -> +53.2/+23.4, film B +82.6/+47.4 ->
+81.5/+46.5, screen +50.1/-15.4 -> +49.3/-16.0, bars -17/-29 points (CfL
wins half their chroma blocks). The bitrate undershoot at 1536k with the
pyramid was convergence lag (STEP_CLAMP walked 12 q-steps a frame): one
unclamped acquisition step per slot, -10.2% -> -2.7%. Pins 7321 / 27285.
test(av1): probe the screen detector against the whole real libraryAhmet Kaan Gümüş · 1a055ad
test(av1): probe the screen detector against the whole real library

A new --ignored probe walks every video row of the real-library manifest
(plus the two colour-bar fixtures as anchors), decodes four frames at
10/50/90% of each duration at native size or a 1920x1080 centred crop,
and prints per file and offset the share of qualifying 16x16 blocks, the
screen_content verdict and a content hint (mean luma, luma sd, inter
MAD), then sweeps the colour bound against the variance floor over the
whole library.

Result: no camera or film row fires the detector anywhere -- 0 of ~400
rows, worst share 6.8% against the shipped one-tenth-of-frame threshold
-- so the premise that a real film of his is coded flat with the screen
tools on does not hold, and the constants are left alone. The one row
that does fire is a desktop capture by its own content.

2026-09-06

fix(av1): the rate loop seeds each level's quantizer off its first coded frameAhmet Kaan Gümüş · 12e6ab7
fix(av1): the rate loop seeds each level's quantizer off its first coded frame

`STEP_CLAMP` protects an operating point the slot has not found yet: every
slot starts at the caller's `base_q_idx` guess (100 in the gate) and the
clamp made the loop WALK to the right quantizer at twelve steps a frame.
Traced over the 48-frame bitrate gate, the pyramid's ARF slot spent five of
its twelve frames pinned at -STEP_CLAMP and the stream landed 10.2% under
target. That is convergence lag, not steady-state offset -- this loop's
fixed point is actual == target exactly -- so the fix is one unclamped
acquisition step per slot, not an accumulated error term: nothing is carried
between frames and the windup bound still holds from the second frame on.

  bits/s   pyramid   before    after
  768000   false     -0.1%     -1.8%
  768000   true      +0.7%     +1.1%
  1536000  false     -3.6%     -3.0%
  1536000  true     -10.2%     -2.7%

bytes_per_frame_controller_never_oscillates_past_its_clamp now exempts the
acquisition step alone (the first frame q moves at all -- the lookahead
queue means that is not frame zero) and asserts the clamp on every frame
after it.
feat(av1): directional luma winners search their angle_delta_y, off screen framesAhmet Kaan Gümüş · a005252
feat(av1): directional luma winners search their angle_delta_y, off screen frames

tile.rs coded ANGLE_DELTA_ZERO at all four luma sites because nothing ever
searched a delta. The luma search now refines the winning directional mode
over delta -3..=3 through the decoder's own predictor (its `angle_delta`
argument; `enable_intra_edge_filter` stays off in this encoder's sequence
header, so both sides gather the same edge samples), prices the symbol as a
difference from ZERO, and threads the delta through `trial`/`trial_typed`/
`code_tx_depth` so a transform-depth trial re-predicts at the same angle.

Screen frames are excluded: measured, the refinement is +0.7/+0.3 the wrong
way on the screen capture (synthetic edges sit on the base angles, so a
delta buys a symbol and no prediction) while the film rows gain.

5-row native gate, EC_AV1_ANGLE=0 -> default (both with CfL on):
  bars 1080p +0.3/-15.5 -> +0.2/-15.5, bars 2160p +16.8/-6.5 -> +16.9/-6.5,
  film A +67.7/+36.3 -> +67.7/+36.3, film B +99.6/+61.2 -> +99.0/+60.6,
  screen +50.4/-15.1 -> +50.4/-15.1 (byte-identical).
feat(av1): the chroma search offers UV_CFL_PRED, alpha searched and codedAhmet Kaan Gümüş · f944910
feat(av1): the chroma search offers UV_CFL_PRED, alpha searched and coded

The encoder never coded chroma-from-luma: every intra block's chroma came
off DC/V/H/SMOOTH*/PAETH while the decoder has read `cfl_alpha_signs` and
scaled the luma AC since lane-cfl. The chroma search now builds the
decoder's own CfL candidate -- `cfl_ac_q3_at` (the shared body behind
`cfl_ac_q3`/`cfl_ac_q3_rect`) over the committed luma reconstruction, the
decoder's `cfl_scaled` nudge on a DC_PRED base -- picks each plane's
alpha_q3 from the least-squares optimum and its two neighbours, and prices
the three sign combinations against the best ordinary chroma mode and the
chroma palette. Offered only where `is_cfl_allowed` does (<=32x32).

The writer codes `uv_mode = UV_CFL_PRED` plus the joint sign and magnitude
symbols at all four uv_mode sites; the three intra-in-inter sites needed it
too (without them the inter path desynced at picture 8).

5-row native gate, EC_AV1_CFL=0 -> default:
  bars 1080p +15.6/-1.7 -> +0.3/-15.5, bars 2160p +46.5/+18.8 -> +16.8/-6.5,
  film A +69.0/+37.5 -> +67.7/+36.3, film B +100.0/+61.5 -> +99.6/+61.2,
  screen +51.0/-14.5 -> +50.4/-15.1.