forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 12f1dab3fe2f911ef1247d7bbcea13b76a8757d0

2026-09-06

Merge branch 'lane-av1txdepth' (75a083aa): the 32x32 inter tx-depth search and compound var-tx rebuilt behind knobsAhmet Kaan Gümüş · 12f1dab
Merge branch 'lane-av1txdepth' (75a083aa): the 32x32 inter tx-depth search and compound var-tx rebuilt behind knobs

Both re-judged at lambda 0.05 on the native table and both still lose
(32x32 split wins 62-71% of blocks yet costs ladder bytes; the pricer
puts its units within 1.4% of written bits, so it is not mis-pricing).
Default encoder byte-identical; EC_AV1_TX32_DEPTH / EC_AV1_COMP_VARTX.
test(av1): re-judge both var-tx rebuilds at the halved rate weight -- neither keepsAhmet Kaan Gümüş · 8137f07
test(av1): re-judge both var-tx rebuilds at the halved rate weight -- neither keeps

32x32 tx-depth search (EC_AV1_TX32_DEPTH): native film 1080p +16.6/-0.5,
2160p +46.6/+18.8, screen +50.9/-14.3 against +16.2/-1.1, +46.6/+18.8,
+51.3/-14.4 off. Fires on 53-71% of 32x32 blocks and the pricer census
clears the split units (Luma16Inter within 1.4% from two non-zeros up, its
zero bucket +30.1% i.e. biased against splitting), so the loss is ladder
bytes, not blindness or mis-pricing.

Compound var-tx at the leaves (EC_AV1_COMP_VARTX): +16.0/-1.1, +46.6/+18.8,
+51.4/-14.4 -- one row 0.2 down, two flat, short of the keep rule. Both
knobs stay off; measurements recorded at their call sites.
feat(av1): rebuild the 32x32 inter tx-depth search and the compound var-tx trial set behind knobsAhmet Kaan Gümüş · 7d0a80d
feat(av1): rebuild the 32x32 inter tx-depth search and the compound var-tx trial set behind knobs

Both were measured and removed at LAMBDA_SCALE 0.1; the lambda lane halved
the rate weight, so they need rebuilding to be re-judged. commit_inter_luma
now takes an optional second reference (mc_trial_compound predicts each
half-side unit from both), and search_inter_block routes its 32x32 winner
through it instead of coding tx_depth 0 blind. EC_AV1_TX32_DEPTH and
EC_AV1_COMP_VARTX, both off; the var-tx census is keyed by block class.
Merge branch 'lane-av1rejudge' (968a8c58): every tool rejected at lambda 0.1 re-judged at 0.05 -- local warp ships on, LEAF_SECOND_NEW_MARGIN 0.8 -> 1.2Ahmet Kaan Gümüş · 4cfdfb5
Merge branch 'lane-av1rejudge' (968a8c58): every tool rejected at lambda 0.1 re-judged at 0.05 -- local warp ships on, LEAF_SECOND_NEW_MARGIN 0.8 -> 1.2

Native crops: film 1080p +17.0/-0.3 -> +16.2/-1.1, film 2160p +47.0/+19.2
-> +46.6/+18.8, screen +51.6/-14.2 -> +51.3/-14.4 (vs libaom / vs rav1e);
640x384 +70.4/+85.3/+48.5. OBMC, split threshold, NEAR_NEAR, pyramid
arms, chroma top-K re-measured and left off with their tables.
feat(av1): local warp on by default and a looser second-reference margin, re-judged at the new rate weightAhmet Kaan Gümüş · 70b0f42
feat(av1): local warp on by default and a looser second-reference margin, re-judged at the new rate weight

Halving LAMBDA_SCALE re-opened every decision constant taken at the old
weight. Re-measured on the native gate, one run per arm:

- local warp (EC_AV1_WARP) KEPT ON: +16.7/-0.5, +47.0/+19.1, +51.3/-14.3
  against the base's +17.0/-0.3, +47.0/+19.2, +51.6/-14.2 -- two rows down
  on both columns, one flat. Fires on 5.4/3.3/3.3% of motion_mode blocks;
  clean under EC_COMP_MISMATCH=1 and under EC_AV1_TILES=2:2.
- LEAF_SECOND_NEW_MARGIN 0.8 -> 1.2, the floor of a re-swept bowl
  (0.6/0.8/1.2/1.6/never = +16.9/+16.7/+16.2/+16.4/+16.4 on the 1080p film),
  for ~10% encoder wall on the film clips.
- OBMC, SPLIT_RD_THRESHOLD, EXTRA_NEW_SKIP_MARGIN, COMP_NEARNEAR, the coding
  pyramid and CHROMA_TOP_K re-measured and left where they were, each with
  its new table at its decision site.

Native, defaults: +16.2/-1.1, +46.6/+18.8, +51.3/-14.4.
Merge branch 'lane-opusx' (901c6ac3): stage-by-stage CELT analysis instrument; the 192-sample input delay measured exact and gate-rejectedAhmet Kaan Gümüş · 682c080
Merge branch 'lane-opusx' (901c6ac3): stage-by-stage CELT analysis instrument; the 192-sample input delay measured exact and gate-rejected

The first stage where our CELT differs from libopus is the input window:
libopus buffers delay_compensation = Fs/250 before celt_encode_with_ec;
ec-opus starts at the frame boundary. Matching it makes the spectrum
agree to 0.011 log2 per band, but the 12-row gate loses 5 rows because
later constants were tuned against the misaligned spectrum; reverted in
the lane, the re-sweep is the follow-up.
revert(opus): drop the Fs/250 CELT input delay, keep the EC_OPUS_X_DEBUG bisectAhmet Kaan Gümüş · 55e042f
revert(opus): drop the Fs/250 CELT input delay, keep the EC_OPUS_X_DEBUG bisect

The delay is exact -- it puts our analysis window where libopus's is and
brings the whole spectrum to within .011 log2 of libopus on a steady
frame -- but the 12-row library gate rejects it (5 rows worse on
err_ratio, lanes/opus-opusx-r1.sweep.txt), and it costs the CELT layer
4 ms of algorithmic delay (look_ahead 120 -> 312).  Reverted; the
measurement stays in the two reverted commits and in the sweep file.

What survives: EC_OPUS_X_DEBUG, which prints the pre-emphasised window,
freq, bandE, bandLogE and sum|X| so the same bisect can be re-run.  Note
for anyone comparing frame N of ours against frame N of libopus: the two
windows cover DIFFERENT samples (ours starts at the frame boundary,
libopus 192 samples earlier), so any such comparison is invalid until
the two are aligned.
test(opus): the 12-row gate rows for the Fs/250 CELT input delay, and the alignment constants it movesAhmet Kaan Gümüş · 1af3439
test(opus): the 12-row gate rows for the Fs/250 CELT input delay, and the alignment constants it moves

Gate (lanes/opus-opusx-r1.sweep.txt) vs lanes/opus-opustr2-r1.sweep.txt:
err_ratio better on 7 rows (reell@64 2.697->1.916, reell@96 4.499->3.900,
reelo@64 1.510->1.287, reelo@96 .940->.861, her@64 1.103->.980, dl8a@64
.552->.498, dl8a@96 .374->.361) and WORSE on 5 (nik@64 .708->.800,
nik@96 .985->1.763, her@96 1.051->1.292, hein@64 .853->.980, hein@96
.528->1.602); corr_ours never worse by more than .0001, better on five
rows; rate within .5%, drops 0.  The KEEP rule (err_ratio not worse on
any row) therefore REJECTS it.

look_ahead for a CELT frame moves 120 -> 312, so the unit tests and the
hybrid click tolerance move with it.  Five conformance tests still
compare at a hardcoded 120-sample lag and fail; they are listed in the
lane report rather than rewritten, because the change does not ship.
feat(opus): feed the CELT layer the input delayed by Fs/250 like libopusAhmet Kaan Gümüş · 5d7f93b
feat(opus): feed the CELT layer the input delayed by Fs/250 like libopus

The first quantity that differs between our CELT analysis chain and
libopus 1.6 on the same PCM is not a transform or a table: it is which
samples the frame's analysis window covers. libopus buffers
delay_compensation = Fs/250 (192 samples at 48 kHz) in opus_encoder.c
and hands celt_encode_with_ec that delayed stream, so its MDCT window
sits 4 ms behind the API frame; ours started at the frame boundary.

Measured on the reell attack frame (frame 2, 20 ms, LM=3, transient):
sum|X| 55.29 -> 46.20 against libopus's 46.23, band log-energies
4.349 3.049 3.876 3.670 3.986 4.892 4.797 2.437 ->
3.516 4.003 3.271 4.594 1.143 4.273 4.759 3.718 against libopus's
3.439 4.005 3.260 4.595 1.179 4.277 4.758 3.717.  On a steady frame
(frame 3) sum|X| 85.80 -> 87.43 against 87.42 and every band lands
within 0.011 log2 of libopus (was 0.06-0.21 apart).

EC_OPUS_X_DEBUG prints the chain stage by stage (pre-emphasis window,
freq, bandE, bandLogE, normalised X) for the same bisect.

The layer's algorithmic delay grows by 192 samples: look_ahead() for a
CELT frame is 312, not 120, and the hybrid path's SILK delay follows it.
Merge branch 'lane-opustr2' (eee09948): the CVBR tf boost as a swept term (no point keeps), libopus 1.6 tf probeAhmet Kaan Gümüş · 5811863
Merge branch 'lane-opustr2' (eee09948): the CVBR tf boost as a swept term (no point keeps), libopus 1.6 tf probe

Twelve gate runs over k/offset/gating: the nearest miss (k=1.25) beats
libopus on 10 of 12 rows and loses her@96 by 0.021, so the default term
is unchanged. The reell tf_select tie is not a tf bug: against a
libopus-linked probe on the same PCM the first differing quantity is the
CELT spectrum itself (sum|X| 55.3 vs 46.2 on the attack frame).
Merge branch 'lane-av1lambda' (c2e7f4af): LAMBDA_SCALE 0.1 -> 0.05 (swept: a clean bowl with its floor at 0.0375-0.05)Ahmet Kaan Gümüş · 74d59b2
Merge branch 'lane-av1lambda' (c2e7f4af): LAMBDA_SCALE 0.1 -> 0.05 (swept: a clean bowl with its floor at 0.0375-0.05)

Native crops: film 1080p +18.1/+0.9 -> +17.0/-0.3, film 2160p +47.1/+19.0
-> +47.0/+19.2, screen +58.3/-9.8 -> +51.6/-14.2 (vs libaom / vs rav1e);
640x384 +79.2/+97.7/+53.1 -> +71.9/+87.1/+48.7. Half of the "local RD win,
ladder loss" pattern was the rate weight: local warp now meets the keep
rule and OBMC halves its loss. Per-frame key lambda factor measured inert.
perf(opus): tf boost swept as a term -- 12 gate runs, no point keeps, k=1.25 is the nearest missAhmet Kaan Gümüş · d1d2929
perf(opus): tf boost swept as a term -- 12 gate runs, no point keeps, k=1.25 is the nearest miss

k in {1.25,1.5,2}, offset in {.04,.044,.06,.08}, the transient-flag gate
and a tf_estimate threshold gate, each on the 12-row library gate. No
point passes the keep rule. k=1.25 on every frame (r8) costs only
her@64 +.001 / her@96 +.021 err_ratio with corr no worse than -.0005 and
buys reell@64 2.697->1.440, reell@96 4.499->2.516, hein@64 .853->.302; the
reell gain lives entirely on frames with tf_estimate >= 0.6, and so does
her@96's loss, so no gate built from the transient analysis separates
them. Default term unchanged; the whole table is at the decision site.
docs(av1): the lambda re-verdicts for OBMC, local warp and a key-frame lambda factorAhmet Kaan Gümüş · 7e18446
docs(av1): the lambda re-verdicts for OBMC, local warp and a key-frame lambda factor

At LAMBDA_SCALE 0.05 the local warp candidate flips from a 0.7/0.9 loss on
the 1080p film to two rows down / one flat, and OBMC at min side 8 goes from
a loss to neutral; both stay off by default (warp's margin is 0.3 points and
enabling it is a sequence-header feature change). The key-frame lambda factor
is measured across four values and kept at 1.0: films and screen capture pull
opposite ways and the native table is inside the +-0.3 band.
perf(av1): the RD search's rate weight was twice what the BD gates wantAhmet Kaan Gümüş · f72bb81
perf(av1): the RD search's rate weight was twice what the BD gates want

Swept LAMBDA_SCALE on the BD gates themselves (640x384 over nine points,
the native 1920x1024 crops over four) instead of the synthetic ladders it
was last picked on. The optimum sits at 0.05, not 0.1: on the native table
the 1080p film goes +18.1/+0.9 -> +17.0/-0.3, the screen capture
+58.3/-9.8 -> +51.6/-14.2 and the 2160p film stays flat (+47.1/+19.0 ->
+47.0/+19.2), vs libaom / vs rav1e. Both stream pins move with it.

Also adds EC_AV1_LAMBDA_KEY (test builds), a per-frame-type lambda factor
in libaom's rd_frame_type_factor shape, defaulting to 1.0 = no change.
Merge branch 'lane-av1rect' (91654d7a): pictures whose last block is cut on both frame edges encode; the refusal was a misreading of spec 5.11.4Ahmet Kaan Gümüş · 0e3a352
Merge branch 'lane-av1rect' (91654d7a): pictures whose last block is cut on both frame edges encode; the refusal was a misreading of spec 5.11.4

When hasRows and hasCols are both false no partition symbol is read and
PARTITION_SPLIT is inferred down to the in-frame 8x8 leaves, so no
rectangular transform is involved. 16 doubly-straddling sizes round-trip
three-way exact through ffmpeg; byte pins and BD unchanged.
Merge branch 'lane-av1obmc2' (ab190a23): OBMC at the 16x16/8x8 leaves and a local warp candidate, both behind knobs; the trial decode honours allow_warped_motionAhmet Kaan Gümüş · 0ebeaad
Merge branch 'lane-av1obmc2' (ab190a23): OBMC at the 16x16/8x8 leaves and a local warp candidate, both behind knobs; the trial decode honours allow_warped_motion

Both tools are byte-exact and measured losses on the native table (OBMC
wins 85% of eligible 8x8 leaves and still costs bytes; warp fires on 2-7%
of blocks). Default streams byte-identical. decode_inter_frame_tiles_lr
hard-coded allow_warped_motion=false and the encoder's own trial decode
went through it (stale-header class).
sweep(opus): CVBR tf-boost k/offset/gate grid, 8 twelve-row library gate runsAhmet Kaan Gümüş · 7a68890
sweep(opus): CVBR tf-boost k/offset/gate grid, 8 twelve-row library gate runs

r1 baseline (k=1, off=.044) reproduces the lane's base rows exactly. The
grid: k in {1.25,1.5,2} at off=.04/.044, off in {.04,.06,.08} at k=1.5,
and the transient-flag gate at k in {1.5,2}. Adds an EC_OPUS_TF_THRESH
knob so the boost can be restricted to frames above a tf_estimate.
feat(av1): a local-warp candidate behind EC_AV1_WARPAhmet Kaan Gümüş · a745879
feat(av1): a local-warp candidate behind EC_AV1_WARP

The 3-symbol motion_mode alphabet in the tile writer (num_proj_ref
mirrored from the decoder), the encoder-side WARPED_CAUSAL candidate
built by the decoder's own find_samples/select_samples/find_projection/
warp_affine, and the frame's allow_warped_motion threaded into the
encoder's trial decode -- hard-coding it false there desynced every
warp-knob stream.
feat(av1): code the both-axes frame-edge cut as the spec's inferred splitAhmet Kaan Gümüş · 0e8b39f
feat(av1): code the both-axes frame-edge cut as the spec's inferred split

A 32x32 or 16x16 block whose true frame edge cuts BOTH axes reads no
partition symbol at all (spec 5.11.4: hasRows and hasCols both false =>
PARTITION_SPLIT inferred), down to the 8x8 leaves whose own mi origin is
inside the frame -- the same leaves the one-axis case already coded. The
encoder refused that geometry by name, claiming it needed a rectangular
HORZ/VERT transform; it needs none, and the refusal was a misreading of
the rule. Both writers now emit the inferred split, and the searches drop
their matching refusals.
Merge branch 'lane-av1straddle' (862db122): the writer no longer codes phantom transform units past the right frame edge; the RD pricer reads the real txb_skip/dc_sign contextsAhmet Kaan Gümüş · 16ecf06
Merge branch 'lane-av1straddle' (862db122): the writer no longer codes phantom transform units past the right frame edge; the RD pricer reads the real txb_skip/dc_sign contexts

A right-edge-straddling 32x32 wrote 16 luma units where the decoder and
libaom code 12; libdav1d and libaom refused the whole 216x96 stream. One
clip in write_luma_tus fixes it, byte pins unmoved (gate clips are
block-aligned). On top: the per-trial neighbour context map for the
pricer (lane-av1skipctx): screen all-zero chroma error -73% -> -1.9%,
native screen +58.3/-9.8, 2160p +47.1/+19.0, 1080p +18.1/+0.9.
feat(av1): offer the OBMC candidate at the 16x16 and 8x8 inter leavesAhmet Kaan Gümüş · 74fe5cf
feat(av1): offer the OBMC candidate at the 16x16 and 8x8 inter leaves

The motion_mode symbol is now priced off the frame's own starting tables
(tile::obmc_symbol_bits), like the coefficients since lane-av1price2, and
the native BD arm prints the motion_mode histogram the 640x384 gate
already did.
Merge branch 'lane-av1obmc' (5ea7a530): motion_mode syntax and an OBMC candidate, behind EC_AV1_OBMCAhmet Kaan Gümüş · c9bed9a
Merge branch 'lane-av1obmc' (5ea7a530): motion_mode syntax and an OBMC candidate, behind EC_AV1_OBMC

OBMC for the 32x32 single-reference winner (decoder obmc_plan/obmc_run
reused, 0 mismatches) does not keep at native (+18.2/+0.9, +47.3/+19.2,
+59.1/-10.0 vs +18.0/+0.7, +47.3/+19.2, +59.4/-10.0), so the header bit
and the candidate follow the knob; default streams byte-identical.
fix(av1): never code a transform unit that starts outside the frameAhmet Kaan Gümüş · 683eca4
fix(av1): never code a transform unit that starts outside the frame

The writer's per-unit luma loop walked every unit of a block's transform
grid, including the ones a right-edge- (or bottom-edge-) straddling block
has entirely outside the frame. libaom clips that loop to
max_blocks_wide/high and decode.rs does the same, so the extra all_zero
symbols desynced the tile at the very next symbol: at 216x96 an odd-size
GOP's last block reconstructed a different V, and both libdav1d and
libaom refused the whole key frame.

Clip the loop to the frame's true mi_cols/mi_rows. The block-aligned byte
pins do not move (their clips have no straddling block); the ffmpeg GOP
gate now runs 216x96 as well, three-way exact against reconstruction.
fix(av1): code motion_mode syntax only when the OBMC knob is onAhmet Kaan Gümüş · 0d0c9c4
fix(av1): code motion_mode syntax only when the OBMC knob is on

With OBMC default-off every eligible block coded a SIMPLE_TRANSLATION
symbol for no gain (+0.07% at q=150, +0.02% at q=60), so
is_motion_mode_switchable now follows EC_AV1_OBMC: the default path writes
no motion_mode syntax at all and is byte-identical to the streams before
this lane (pins back to 7106 / 25963). The arming, the writer, the
Encoded/decoder threading and the OBMC candidate are unchanged -- a future
warp knob joins the same disjunction.

Under EC_AV1_OBMC=1 the byte pins and the pricer drift bound fail BY DESIGN
(the knob changes encoder decisions), the same contract
EC_AV1_PRICE_FRAME_CDFS=1 already has; every decode round trip stays
sample-exact with 0 EC_COMP_MISMATCH lines.
docs(av1): record the odd-size straddling-block V desync at the pricer's context siteAhmet Kaan Gümüş · 1058fbb
docs(av1): record the odd-size straddling-block V desync at the pricer's context site

Not caused by the context map (ablated, no EC_AV1_PRUNE_K in 1..=6 and no
EC_AV1_ESTIMATE=1 reproduces it, and a pricer writes no symbol); a decision
change is what reaches the straddling last block's writer/decoder desync.
diag(opus): swept CVBR tf-boost knobs + X/band-energy fingerprint in the tf debugAhmet Kaan Gümüş · ff9aa5e
diag(opus): swept CVBR tf-boost knobs + X/band-energy fingerprint in the tf debug

The tf boost k/offset and an optional transient-only gate come from
EC_OPUS_TF_K / EC_OPUS_TF_OFF / EC_OPUS_TF_GATE so one build sweeps the
grid; the defaults (k=1, off=.044, all frames) are byte-identical to the
shipped term. EC_OPUS_TF_DEBUG additionally prints the first 8 band
log-energies and sum|X| of the tf channel, which is what the libopus
comparison needs.
fix(av1): clamp the pricer's committed context to the frame's true extentAhmet Kaan Gümüş · 088a162
fix(av1): clamp the pricer's committed context to the frame's true extent

Plane::commit_ctx published a straddling block's nz/DC state over the cells
past the true frame edge; the writer's own Neighbours::record_mi_planes
clamps to blocks_wide/blocks_high (spec av1_set_entropy_contexts, off the
true mi_cols/mi_rows, with libaom's round-up-even for a subsampled plane)
and leaves those cells uncoded, so the price read a neighbour the writer
never records.
feat(av1): an OBMC candidate for the 32x32 single-reference winner, measured and defaulted offAhmet Kaan Gümüş · 84a1ea3
feat(av1): an OBMC candidate for the 32x32 single-reference winner, measured and defaulted off

The encoder now offers the 32x32 single-reference winner an OBMC_CAUSAL
candidate built by the DECODER's own plan and blend (decode::obmc_plan /
obmc_run, libaom av1_build_obmc_inter_prediction) off the committed
neighbours' mvs the search grid already carries, prices the motion_mode
symbol against the default obmc CDF, and the tile writer codes whichever
value won. obmc_plan lost its Neighbours parameter for the two filter bands
themselves so an encoder with a fixed interpolation filter can call it; no
second implementation of the blend exists.

MEASURED and NOT KEPT ON: native crop BD with it on is +18.2/+0.9,
+47.3/+19.2, +59.1/-10.0 against +18.0/+0.7, +47.3/+19.2, +59.4/-10.0 off
-- one row down, one flat, one up, short of the two-down-one-flat rule. It
is behind EC_AV1_OBMC=1 with the numbers at the decision site; the default
path is byte-identical to the SIMPLE-only commit before it. Only the 32x32
winner is offered OBMC and the price is the static-CDF estimate: the leaves
and a real-CDF price are the upgrade path.

Byte-exact either way: EC_COMP_MISMATCH=1 prints nothing with OBMC on, and
every decode round trip (our own decoder and ffmpeg) is sample-exact.
Merge branch 'lane-opustr' (ef346028): per-frame coded-decision census vs libopus; three transient ports measured and revertedAhmet Kaan Gümüş · 673c26b
Merge branch 'lane-opustr' (ef346028): per-frame coded-decision census vs libopus; three transient ports measured and reverted

Encoder byte-identical (EC_OPUS_TF_DEBUG print only). Findings at 64k:
alloc_trim +2 on transient frames / +1 steady vs libopus, transient frames
underspend 7-12% at the reference's realised rate; the pre-attack digital
zero is encoder-side (a tf_select near-tie). alloc_trim (third rejection),
the x2 CVBR tf boost and the reservoir release all fail the all-rows rule.
perf(opus): CVBR transient boost measured whole; both halves rejected, reell lever namedAhmet Kaan Gümüş · 31589bd
perf(opus): CVBR transient boost measured whole; both halves rejected, reell lever named

The per-frame census says our transient frames underspend libopus's at the same
realised rate -- reelo@64 202 vs 229 bytes, her@64 216 vs 233 -- while the steady
frames match to 2%. Two documented deviations sit in that mechanism, and both
were re-measured on the 12-row library gate:

  r2 (`lanes/opus-opustr-r2.sweep.txt`) restores libopus CVBR whole: the x2 tf
  boost `2*(tf_estimate-.04)*target` plus the uncapped one-frame reservoir
  release. reell@64 2.697 -> 1.764 and reell@96 4.499 -> 2.114, the largest move any
  lane has made on those rows; against that, 5 rows regress and hein@64 loses
  .0030 corr. That corr loss is the same one that rejected the x2 on the old
  14-row gate -- the rejection was recorded against reelm, whose rows no longer
  exist, so hein reproducing it exactly is what keeps the finding alive.

  r3 (`lanes/opus-opustr-r3.sweep.txt`) isolates the reservoir release: 3 rows
  better, 5 worse (dl8a@96 .374->.415, hein@96 .528->.555), reell unmoved. So the
  whole reell win in r2 belongs to the x2 term.

Both reverted; the encoder is byte-identical to its parent apart from the
env-gated tf debug print. The numbers and the upgrade path -- gate the x2 on
content, since it pays on music transients and starves hein's speech -- are at
the decision site in celt_enc.rs.
feat(av1): arm is_motion_mode_switchable and code a SIMPLE motion_mode symbol on every eligible inter blockAhmet Kaan Gümüş · ba4398c
feat(av1): arm is_motion_mode_switchable and code a SIMPLE motion_mode symbol on every eligible inter block

The encoder's inter frames now set is_motion_mode_switchable and the tile
writer codes the motion_mode/obmc symbol decode.rs' read_motion_mode has
always read, for every single-reference inter block libaom's
motion_mode_allowed accepts. Every block still chooses SIMPLE_TRANSLATION,
so the streams are the old ones plus the header bit and one symbol per
eligible block: 7106 -> 7111 bytes at q=150 and 25963 -> 25969 at q=60 on
the 640x384 gate clip (+0.07%/+0.02%), pins updated.

Eligibility is decode.rs' own motion_mode_eligible term for term, sharing
the neighbour walk through the new has_overlappable_neighbour so writer and
decoder cannot drift; write_motion_mode prints an EC_COMP_MISMATCH line if
a block was trialled OBMC but coded SIMPLE, and EC_TRACE_MODE_STEP prints
the writer-side EC_MMW counterpart of the decoder's EC_MM rung.

is_motion_mode_switchable is threaded to the raw inter tile decode entry
points and carried on Encoded (stale-header class, same contract as
tx_select/start_cdfs) -- hard-coding false there desynced three decode
round trips before it was threaded.
feat(av1): the RD pricer reads the real neighbour txb_skip/dc_sign contextsAhmet Kaan Gümüş · 9afbc09
feat(av1): the RD pricer reads the real neighbour txb_skip/dc_sign contexts

The search priced every transform block at txb_skip context 0 and dc_sign
context 0 -- exact for a luma transform covering its whole block, and the
largest remaining row of the pricer census everywhere else: an all-zero
chroma block was under-priced 41-81%, a one-coefficient Chroma8 over-priced
32%.

Each plane now carries a per-4x4-cell map of what the blocks committed
before it left behind (cul_level and DC sign, tile.rs neighbour_state),
written by Plane::commit and undone with the pixels by Plane::restore, so a
partition trial reads the parent's committed neighbours for its first child
and the just-committed sibling for the later ones -- coding order inside the
tree. Plane::coef_ctx mirrors the writer's own derivation: chroma reads
whether the above/left neighbours coded anything (write_block_planes), luma
context 0 for a whole-block transform and decode.rs SKIP_CONTEXTS for a
smaller unit (write_luma_tus / Neighbours::luma_skip_ctx), both planes the
neighbours' DC sign vote (dc_sign_ctx).

Census, 6 frames of each clip at 640x384 q=100, priced vs written:
  screen total +10.3% -> +9.5%, Chroma8 nz=0 -73.0% -> -1.9%,
  Chroma16 nz=0 -48% -> -23.4%, Chroma4 nz=0 -74% -> -6.7%,
  Chroma8 nz=1 +32.2% -> +4.9%, nz=2 +26.2% -> +7.9%,
  Luma4 nz=0 +464% -> +89.5%
  film total +5.3% -> +1.5%
diag(opus): per-frame ours-vs-libopus decision dump; alloc_trim port rejected a third timeAhmet Kaan Gümüş · fddb8d4
diag(opus): per-frame ours-vs-libopus decision dump; alloc_trim port rejected a third time

The 64k transient gap is an alloc_trim difference, not a tf or anti-collapse
one. `frame_decisions_vs_libopus` decodes both bitstreams with our own decoder
and prints, per frame or aggregated over transient/steady frames, the coded
decisions: bytes, silence, intra, transient, anti_collapse, alloc_trim, spread,
coded_bands, tf_res, pulses, fine_quant, band energies. `EC_OPUS_TF_DEBUG=1`
adds the tf Viterbi's own metric/importance/selcost.

Aggregated over 2000 frames at 64k, our alloc_trim is systematically higher
than libopus's on every source -- +2.0 on transient frames (reelo 4.02 vs 1.99,
reell 4.59 vs 2.68, her 5.83 vs 3.88) and +1.0 on steady ones -- which is exactly
the missing `trim -= 2*tf_estimate` term plus the coarse pre-1.1 tilt ladder.
Mean tf_res and anti_collapse rates agree within noise, so those are not it.

Porting the libopus 1.3 float `alloc_trim_analysis` whole moves the 12-row
library gate 5 rows better / 4 worse on err_ratio and costs corr on every row;
the KEEP rule rejects it, and this is its third rejection. Numbers are recorded
at the decision site and in lanes/opus-opustr-r1.sweep.txt.

The reell/her pre-attack window is an ENCODER-side hole: our decoder replays
libopus's own bitstream at the source's -110 dBFS ramp level (1.5e-12, 4.0e-10
per 120-sample hop) while our encoder's stream decodes to 1e-18 there.
Merge branch 'lane-av1price2' (50b7ad42): the frame-tables coefficient price is the default on non-screen framesAhmet Kaan Gümüş · fbeac19
Merge branch 'lane-av1price2' (50b7ad42): the frame-tables coefficient price is the default on non-screen frames

Native crops: film 1080p +18.7/+1.4 -> +18.0/+0.7, film 2160p +48.1/+19.8
-> +47.3/+19.2, screen byte-identical (the detector fires on every screen
frame). At 640x384 the 2160p clip regresses +0.5/+0.7; the native table
is the standing recipe for this decision.
test(av1): re-pin the encoder's own streams and widen the drift boundAhmet Kaan Gümüş · d4a3234
test(av1): re-pin the encoder's own streams and widen the drift bound

The frame-table price on non-screen frames is a decision change: the 640x384
4-frame pins move to 7106/25963 bytes and the predicted-vs-written drift bound
to 0.34 (the +32.6% lane-av1txbits measured under the knob is the default
path now).
doc(av1): the frame-table price becomes the default on non-screen framesAhmet Kaan Gümüş · 0b17e82
doc(av1): the frame-table price becomes the default on non-screen frames

Both BD tables measured on one build (mode 0 vs mode 2) go in the doc comment,
including the one regression -- the 2160p film at the downscaled 640x384 gate.
The screen capture is byte-identical to base in both gates, which is what a
per-frame gate should be. The census on the real clips says why screen needs
the gate: real tables flatten the inter luma rows and leave the chroma and
all-zero rows exactly where they were, so the search's tradeoff between them
is skewed rather than corrected. The all-zero row's own cause (the pricer's
skip_ctx 0) is recorded at coeff_bits with the numbers and what closing it
would need.
feat(av1): price coefficients against the frame's real tables on non-screen framesAhmet Kaan Gümüş · 7639e56
feat(av1): price coefficients against the frame's real tables on non-screen frames

The RD pricer took its coefficient rate against the DEFAULT CDF tables while
an inter frame's writer starts from the tables the previous frame stored.
lane-av1txbits measured the fix (EC_AV1_PRICE_FRAME_CDFS=1) as better on both
film clips and worse on the screen capture, so it shipped off. The encoder
already classifies every frame (screen_content -> allow_screen_content_tools),
so the choice can be made per frame: real tables when the detector says no,
defaults when it says yes.

arm_pricing_cdfs takes that bit; EC_AV1_PRICE_FRAME_CDFS=0/1/2 selects
never/always/gated. Both BD gates print the per-frame arming counts.
Merge branch 'lane-opus64' (e5f3faa0): opus_compare diagnosis at 64k -- drop-k window instrument, per-band table, two-pass coarse energy ported and parked offAhmet Kaan Gümüş · 1dee32d
Merge branch 'lane-opus64' (e5f3faa0): opus_compare diagnosis at 64k -- drop-k window instrument, per-band table, two-pass coarse energy ported and parked off

err_ratio at 64k is an outlier-window statistic (reell and her are one 40 ms
window each; reelo's gap is transient frames); our per-band energy error is
lower than libopus's in nearly every band. libopus's two-pass coarse
energy measured 6 rows better / 4 worse under the decided rule and ships
behind TWO_PASS_COARSE_ENERGY=false with the numbers.
perf(opus): two-pass coarse energy ships off; err_ratio at 64k is an outlier-window statisticAhmet Kaan Gümüş · 48b35d9
perf(opus): two-pass coarse energy ships off; err_ratio at 64k is an outlier-window statistic

The 64k err_ratio gap is not band-energy fidelity. On every source whose
ratio is above 1 the per-band mean log-energy error is LOWER than libopus's
in nearly every one of the 15 compare bands; the ratio is carried by a
handful of 40 ms windows, which opus_compare raises to the 4th power twice.
The diagnostic now recomputes both sides' err with the worst k windows
dropped (same denominator):

  source     drop-0   drop-1   drop-8   drop-1%
  reell@64      2.697    1.025    0.992    0.918
  her@64      1.103    0.995    0.962    0.955
  reelo@64     1.510    1.563    1.217    1.036
  nik@64      0.708    0.843    0.959    0.939
  dl8a@64     0.552    0.540    0.586    0.957
  hein@64     0.853    0.634    0.491    0.864

reell and her are ONE window each (a silence -> attack transition where our
decode is orders of magnitude quieter than the source's -110 dBFS ramp while
libopus tracks it); reelo is the only source with a distributed gap, and its
worst windows are all transient frames.

The mechanism ported whole meanwhile is libopus's two-pass coarse energy
(quant_coarse_energy + quant_coarse_energy_impl badness, enc_start_state
rewind): it codes both the intra and the inter-predicted pass and keeps the
lower-badness one. Gated on the 12-row library gate it moved 6 rows better
and 4 worse (reelo@64 1.510->1.581, her@64 1.102->1.135, her@96 1.052->1.059,
nik@96 .982->.990 against dl8a .551/.374->.503/.346, hein .855/.528->
.771/.419, reelo@96 .940->.872, nik@64 .708->.703), corr within +.0001
everywhere, so under the KEEP rule (err_ratio not worse on any row) it ships
behind TWO_PASS_COARSE_ENERGY = false with the numbers at the decision site.

- range: EncSnapshot save/restore of the coder scalars plus the front bytes,
  so a trial pass can be rewound exactly.
- conformance: the spectral divergence diagnostic gains reelo/nik sources, a
  SWEEP_TAG output name and the drop-k err recomputation; the hop-energy
  instrument gains HOP_KBPS.
wip(opus): two-pass coarse energy ported from libopus; per-band diagnosis at 64kAhmet Kaan Gümüş · e4775f2
wip(opus): two-pass coarse energy ported from libopus; per-band diagnosis at 64k

- range: EncSnapshot save/restore of the coder scalars + front bytes, so a
  trial coarse-energy pass can be rewound (libopus enc_start_state).
- celt_enc: quant_coarse_energy_impl returns badness; quant_coarse_energy
  codes both intra and inter passes and keeps the lower-badness one.
- conformance: spectral divergence diag gains reelo/nik sources and a
  SWEEP_TAG output name; hop-energy instrument gains HOP_KBPS.
Merge branch 'lane-av1txbits' (59679eed): per-class pricer census; the frame-tables coefficient price ships as a knobAhmet Kaan Gümüş · 5ab2d2a
Merge branch 'lane-av1txbits' (59679eed): per-class pricer census; the frame-tables coefficient price ships as a knob

Default bytes identical. Census: the RD pricer charged coefficients
against default CDF tables while inter frames write from start_cdfs
(+31% over-price on one-coefficient inter blocks). Pricing with the real
tables (EC_AV1_PRICE_FRAME_CDFS=1) helps both films and hurts screen, so
it ships off; a content-gated variant is in flight.
Merge branch 'lane-mp4qt' (e0049a23): QuickTime .mov sound descriptions -- esds inside `wave`, version-2 sample rateAhmet Kaan Gümüş · 0b25973
Merge branch 'lane-mp4qt' (e0049a23): QuickTime .mov sound descriptions -- esds inside `wave`, version-2 sample rate

A QuickTime-brand mp4a entry (Resolve, Final Cut, ffmpeg -f mov) keeps its
esds inside a `wave` child, which the reader skipped, so the AAC track
demuxed with no AudioSpecificConfig; a version-2 entry also read 0 Hz.
Both real exports now demux with ffprobe-identical extradata.
feat(av1): the frame-tables coefficient price ships as a knob; the compound and 32x32 var-tx trials measured again on top of itAhmet Kaan Gümüş · 1f18bea
feat(av1): the frame-tables coefficient price ships as a knob; the compound and 32x32 var-tx trials measured again on top of it

Pricing against the tables the frame is really written with is the more
accurate estimate -- the census goes +7.6% -> +4.8% over every transform
block and +31.4%/+22.3% -> +3.1%/+3.6% on the one- and two-coefficient
inter blocks -- but it does not convert on every clip (film down, screen
up), so it sits behind EC_AV1_PRICE_FRAME_CDFS with both BD tables in the
doc comment and the default bytes unchanged.

With it on, both trials the accuracy was supposed to unlock were rebuilt
and measured: the compound var-tx trial set and a transform-depth search
for the 32x32 inter path each came out neutral to slightly worse, so the
static-CDF estimate was not what held them back. Both measurements are
recorded at their decision sites; neither ships.
feat(av1): price the search against the tables the frame is really written with, plus a per-class pricer censusAhmet Kaan Gümüş · 95c183b
feat(av1): price the search against the tables the frame is really written with, plus a per-class pricer census

The inter frame writer starts from the tables the previous frame stored,
not from the defaults, so the coefficient price the mode search ranked by
charged for a narrowing the writer no longer pays. The new census -- per
transform block, priced bits against the bits the writer spent, split by
table set and non-zero count -- measured it at +31% on the
one-coefficient inter blocks the search lives on (+7.6% over all blocks);
arming the frame's own starting tables takes those rows to +3% and the
whole census to +4.8%.
fix(mp4): a QuickTime .mov kept its esds inside wave and demuxed silentAhmet Kaan Gümüş · 25da208
fix(mp4): a QuickTime .mov kept its esds inside wave and demuxed silent

QuickTime-brand files (Resolve, Final Cut, `ffmpeg -f mov`) state `mp4a` as
a SoundDescription, not an ISO sample entry: the codec configuration sits in
a `wave` box beside the `frma` restating the format, and the entry itself
carries a version-1 tail or a version-2 block before its children. The
reader skipped `wave` outright, so it never found the `esds`, handed the
decoder no AudioSpecificConfig and the sound track played as nothing.

`wave` is now walked for the configuration box the sample entry's own
fourcc names (`esds`, `dac3`, `dec3`, `alac`, `dfLa`, `dOps`), stopping at
the zero terminator. The version-2 block's sample rate, a double, is read
instead of dropped for an `mdhd` timescale nothing applied -- a v2 entry
reported 0 Hz.

The ISO path is untouched: the corpus gains a QuickTime-branded copy of the
AAC fixture, checked against ffprobe for codec, rate, channels and
extradata, and a synthetic v2 entry pins the shape no ffmpeg-written
fixture has.