Commits
Commits on
fddb8d42e379cef06cd445269f5d92d7185ed4f72026-09-06
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-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.
Merge branch 'lane-av1pyr2' (0e86c029): the native BD arm honours EC_AV1_PYRAMID; pyramid re-measured at native and stays opt-inAhmet Kaan Gümüş · 8060962
Merge branch 'lane-av1pyr2' (0e86c029): the native BD arm honours EC_AV1_PYRAMID; pyramid re-measured at native and stays opt-in At 1920x1024 crops the pyramid loses by 5 points instead of the 30 the downscaled gate showed, but still loses on both films together (2:-16:8 wins the 2160p clip by 1.2 and loses 6.2 on 1080p). The offset grid is monotone: leaf-to-ARF prediction is the limit, not the offsets.
doc(av1): the pyramid measured at native resolution -- still offAhmet Kaan Gümüş · 7ad04d2
doc(av1): the pyramid measured at native resolution -- still off The 640x384 verdict was taken on a 4x-downscaled recipe. At native 1920x1024 crops the pyramid gap is 5 BD points rather than 30, but no arm beats the flat encoder on both films: every arm costs 4-6 points on 1080p, and the only arm that wins anything (2:-16:8, -1.2 on the 2160p film vs libaom) pays +10 on screen capture. A 3x3 native offset sweep on the 2160p clip spans 2.9 points and never reaches flat, with a monotone gradient in both knobs -- the offsets are not the limit. Default unchanged (pyramid opt-in, encoder byte-identical).
Merge branch 'lane-av1comp4' (d9490b51): second-reference motion search at the leaves (NEAREST_NEW / NEW_NEW), compound stacks at the straddling leavesAhmet Kaan Gümüş · 020b822
Merge branch 'lane-av1comp4' (d9490b51): second-reference motion search at the leaves (NEAREST_NEW / NEW_NEW), compound stacks at the straddling leaves BD vs libaom +83.0/+99.9/+54.5 -> +79.9/+94.6/+54.5, vs rav1e +39.7/+60.0/+1.1 -> +37.3/+55.7/+1.1; margin 0.8 swept; mismatches 0. Compound var-tx measured and rejected (small residuals: the per-unit txb_skip/eob symbols cost more than the static estimate prices).
test(av1): the native BD arm honours EC_AV1_PYRAMIDAhmet Kaan Gümüş · dbe9b29
test(av1): the native BD arm honours EC_AV1_PYRAMID The native-crop arm called our_ladder directly, so every pyramid arm measured at native was silently the flat encoder. It now takes the same pyramid_from_env branch the default gate does, with the same three-way check that path can make (ffmpeg vs our decoder, Y/U/V, display order) and the per-level frame and byte census.
Merge branch 'lane-av1native2' (897fa938): the native-crop BD arm prints all three clipsAhmet Kaan Gümüş · 81d8241
Merge branch 'lane-av1native2' (897fa938): the native-crop BD arm prints all three clips Native 1920x1024 crops on this tree: film 1080p +18.9 / +1.5, film 2160p +48.2 / +19.8, screen +59.3 / -10.0 (vs libaom / vs rav1e). Test-only change to an ignored test; default gate unchanged.
test(av1): the native BD arm covers all three gate clips in one tableAhmet Kaan Gümüş · 706758b
test(av1): the native BD arm covers all three gate clips in one table The native-crop arm only ever measured the screen capture, with the 1080p film behind an opt-in and the 2160p film absent, so the two content classes whose default-gate numbers are worst were never read at a resolution the encoder's tools can serve. It now runs all three clips by default -- both films and the capture, each a centred, superblock-aligned 1920x1024 crop of its own source, never scaled -- printing the default gate's own columns with the crop size folded into the clip cell. The three per-clip selectors survive as a subset filter (EC_AV1_NATIVE_FILM / _FILM4K / _SCREEN): setting any one keeps only those rows, setting none keeps all. The wall column is labelled noisy; it is not a measurement on a loaded box. No encoder change: the default gate reads +83.0 / +99.9 / +54.5 as before.
Merge branch 'lane-av1native' (288a7963): a native-resolution BD arm (bd_rate_screen_native, 1920x1024 crop, no downscale)Ahmet Kaan Gümüş · 4a3f924
Merge branch 'lane-av1native' (288a7963): a native-resolution BD arm (bd_rate_screen_native, 1920x1024 crop, no downscale) At native the screen capture is +59.3 vs libaom and -10.0 vs rav1e, the 1080p film crop +18.9 / +1.5: the 640x384 recipe measures content 4x further from libaom than the real files. No default moved; intrabc loses at native too (11499 RD wins cannot pay the key frame's filter loss).
Merge branch 'lane-av1simd' (5da4ea68): exact integer SAD/SSE, cached transposed forward basis, no per-row / per-prediction allocationsAhmet Kaan Gümüş · 107329c
Merge branch 'lane-av1simd' (5da4ea68): exact integer SAD/SSE, cached transposed forward basis, no per-row / per-prediction allocations Byte-identical (FNV sets on the three gate clips against a clean-checkout baseline binary); single-thread ladder -11.1% instructions; 3840x1608 4x2/8 threads 1.41 -> 1.60 fps. AVX2 forward passes not built: 67% of forward transforms are 4x4 and the addressable share is ~1.4%.
test(av1): a native-resolution screen BD arm, crop not downscaleAhmet Kaan Gümüş · cd2c183
test(av1): a native-resolution screen BD arm, crop not downscale The default gate downscales the OBS capture to 640x384, which destroys the exact 16x16 repeats intrabc and part of the palette exist for. bd_rate_screen_native crops a superblock-aligned 1920x1024 window out of the middle at native size and runs the same 12-frame four-quantizer ladder against libaom cpu-used 6 and rav1e speed 6, with the same three-way sample-exact assertion.
test(av1): the BD census prints the LEAF compound mode histogramAhmet Kaan Gümüş · 07efe78
test(av1): the BD census prints the LEAF compound mode histogram The frame-wide histogram cannot say whether a compound mode reaches the leaves, which is the only question the leaf compound steps ask.
feat(av1): the straddling-edge leaves are offered compound tooAhmet Kaan Gümüş · 48a7da3
feat(av1): the straddling-edge leaves are offered compound too Both true-edge leaf call sites passed an empty compound stack list, so no block along a frame edge that straddles a 32x32 boundary could ever be coded compound. They now build the same stacks the split quadrants do, through one helper shared by all three sites. Invisible to the BD gate (its clips are 640x384, a whole number of 32x32 blocks): byte-identical there. Measured on the straddle round trips instead -- 15 compound 16x16 and 58 compound 8x8 leaves fire at 640x360 and at the real clip straddle size, and every straddle round trip stays sample-exact through ffmpeg and through our own decoder.
Merge branch 'lane-av1ibc' (5ddbe178): intra block copy on screen-detected key frames, oracle-proven, default OFFAhmet Kaan Gümüş · cbbd6e2
Merge branch 'lane-av1ibc' (5ddbe178): intra block copy on screen-detected key frames, oracle-proven, default OFF Ships behind EC_AV1_INTRABC=1: at the gate's 640x384 downscale only 22 of 1200 searches find a valid DV and none win RD, so the frame pays the in-loop-filter loss for nothing (screen +54.5 -> +59.1 with it on). Default streams byte-identical. Measure at native capture resolution before any constant moves (class: gate-recipe confound).
chore(av1): the intrabc gate counters are read only from the cfg(test) gatesAhmet Kaan Gümüş · 4241847Browse files
test(av1): repin the encoder streams and widen the own-decoder fixture for the leaf second-reference searchAhmet Kaan Gümüş · f2d1542
test(av1): repin the encoder streams and widen the own-decoder fixture for the leaf second-reference search q=150 keeps its 7084 bytes with a moved hash; q=60 falls 26116 -> 25905. The own-decoder round trip moves to 256x128: at 128x64 every var-tx-eligible block now goes to a compound winner (which commits its flat transform), so the split-fired guard had nothing left to see.
feat(av1): an inter LEAF searches its second reference, so NEAREST_NEW and NEW_NEW reach the leavesAhmet Kaan Gümüş · e83e29a
feat(av1): an inter LEAF searches its second reference, so NEAREST_NEW and NEW_NEW reach the leaves A 16x16/8x8 leaf only ever ran one motion search (against LAST), so its compound candidates could name a stack vector for the second half and nothing else. It now runs a search against the second reference too, seeded from and rounded to compound stack entry 0 (what assign_compound_mv predicts from at ref_mv_idx 0), behind the same early-out shape the whole-block extra-reference NEWMV uses, swept to 0.8. BD vs libaom +83.0/+99.9/+54.5 -> +79.9/+94.6/+54.5, vs rav1e +39.7/+60.0/+1.1 -> +37.3/+55.7/+1.1; extra motion searches +23% at 2160p.
doc(av1): a compound leaf keeps the flat transform -- the var-tx split is measured worseAhmet Kaan Gümüş · bbbf1cd
doc(av1): a compound leaf keeps the flat transform -- the var-tx split is measured worse Built the compound commit_inter_luma the previous lane named as the upgrade path (both references predicting every half-side trial) and swept its split margin on the BD gate: no margin beats the flat commit on more than one clip, and 1080p and screen lose at every one. Recorded at the decision site.
measure(av1): intrabc ships behind EC_AV1_INTRABC, default OFF -- it loses the key frame's in-loop filters for nothing on the real screen captureAhmet Kaan Gümüş · 331a966Browse files
test(av1): pin the typed forward transform bit-identical to its strided formAhmet Kaan Gümüş · e70dd64
test(av1): pin the typed forward transform bit-identical to its strided form Compares raw bit patterns, not an epsilon: the contiguous-basis rewrite is exact only because it moved the loop over the outputs and left each output's term order alone, so a reassociation would surface here as a last-place difference. Covers every non-flipped non-DCT type at 4/8/16/32, with an all-zero residual and a half-zero-rows residual so both skips are walked.
test(av1): a repeated-pattern key frame codes intrabc blocks, ffmpeg and our own decoder read them back sample-exactAhmet Kaan Gümüş · ffa03f8Browse files
Merge branch 'lane-av1gatedec' (15c70d52): the BD gate decodes every ladder point with ffmpeg and with this crate's own decoder and asserts all three sample-exactAhmet Kaan Gümüş · c759b78
Merge branch 'lane-av1gatedec' (15c70d52): the BD gate decodes every ladder point with ffmpeg and with this crate's own decoder and asserts all three sample-exact The ffmpeg leg always ran; the own-decoder leg was missing on the flat ladder. Failures now name clip, q, frame, plane and sample.
perf(av1): stop allocating per row and per intra predictionAhmet Kaan Gümüş · 013dc91
perf(av1): stop allocating per row and per intra prediction `Plane::source_block`/`snapshot` built one `Vec` per row of the square they copied and then collected those; `rows_of` copies straight into one buffer. `intra_predict_u8` allocated its two widened edges and its `u16` destination on every call -- once per mode per trial -- and all three fit on the stack at the sizes the encoder uses. No arithmetic changed; the enc_probe FNV set on the three gate clips is unmoved. 1080p ladder: 101.65e9 -> 98.27e9 instructions:u (-11.5% against the b5373c65 baseline's 111.09e9, ABAB x2).
Merge branch 'lane-av1comp3' (d9be6595): compound candidates at the 16x16/8x8 leaves; straddling-leaf mi publication goes through record_miAhmet Kaan Gümüş · 8b1a733
Merge branch 'lane-av1comp3' (d9be6595): compound candidates at the 16x16/8x8 leaves; straddling-leaf mi publication goes through record_mi BD vs libaom +94.4/+104.3/+66.8 -> +83.0/+99.9/+66.4, vs rav1e +47.5/+63.6/+10.7 -> +39.7/+60.0/+10.2; compound share 26-34% of inter blocks; EC_COMP_MISMATCH 0. SPLIT_RD_THRESHOLD re-swept, stays 0.125.
perf(av1): exact integer SAD/SSE and a vectorizable typed forward basisAhmet Kaan Gümüş · fae8c1b
perf(av1): exact integer SAD/SSE and a vectorizable typed forward basis Two byte-exact rewrites on the encoder search's hottest loops, both proved by the enc_probe FNV set on the three gate clips at four q points. `Plane::block_sad`/`block_sse` replace four hand-rolled `f64` accumulations that ran an integer division and remainder per sample to recover (row, col) from a flat index. The sums they replace are whole numbers far below 2^28, so `f64` held every partial sum exactly and neither the order of the adds nor the accumulator type can change the result. `forward_transform_2d_typed`'s two matmuls summed over a strided basis, which no vectorizer can touch. `axis_basis_t` caches the transposed basis so the pass is contiguous in the basis index and strided in nothing; each lane's terms stay in the same order, so the levels are unchanged. The row pass now also records which rows it filled, and the column pass walks only those. 1080p ladder, 12 frames, 4 q points: 111.09e9 -> 101.65e9 instructions:u (-8.5%, ABAB x2).
test(av1): the BD gate decodes every ladder point with our own decoder tooAhmet Kaan Gümüş · 8f036d9
test(av1): the BD gate decodes every ladder point with our own decoder too `our_ladder` already decoded each of our streams with ffmpeg and asserted that decode sample-exact against the encoder's reconstruction; what it never did was run OUR decoder over the same stream, so every feature only our writer/reader had seen (size-8 chroma palettes on the screen clip, say) was gated by ffmpeg alone. Each ladder point now decodes the stream twice and asserts all three pictures -- reconstruction, ffmpeg, ours -- equal in Y, U and V over every shown frame in display order, and a failure names the clip, q, frame, plane and first differing sample. The `EC_AV1_PYRAMID` path gets the same all-plane compare (the facade exposes no per-packet reconstruction, so it pins the two decoders).
Merge branch 'lane-av1pal2' (be1937b0): chroma palette and a 128-colour palette boundAhmet Kaan Gümüş · 691f69e
Merge branch 'lane-av1pal2' (be1937b0): chroma palette and a 128-colour palette bound Screen BD vs libaom +66.4 -> +55.1, vs rav1e +10.3 -> +1.1; both film clips byte-identical. The 32-colour bound was an unswept constant (-9.5 points on its own). Screen tools forced on for film measured worse on 1080p and non-monotone, so the detector stays; the 32x32 palette arm was dead work and is not in.
Merge branch 'lane-av1fpar' (a883afd5): the filter-search replay fires on cropping frames and the whole filter stage runs banded across the tile workersAhmet Kaan Gümüş · d4248c3
Merge branch 'lane-av1fpar' (a883afd5): the filter-search replay fires on cropping frames and the whole filter stage runs banded across the tile workers The replay demanded frame dims == padded plane dims, which no export size meets, so every candidate re-decoded the frame (57% of a 1080p frame wall). 1080p 4x2/8 threads 1.19 -> 3.49 fps; 3840x1608 0.69 -> 1.46 fps (1.59 at 12). Byte-identical; EC_AV1_STAGE_TIMES prints the per-stage breakdown.
test(av1): repin the encoder's own streams for the leaf compound candidatesAhmet Kaan Gümüş · 4619f22
test(av1): repin the encoder's own streams for the leaf compound candidates Both pins shrink (7103 -> 7084 B at q=150, 26778 -> 26116 B at q=60).
feat(av1): compound candidates at the 16x16 and 8x8 inter leavesAhmet Kaan Gümüş · 9dbe40f
feat(av1): compound candidates at the 16x16 and 8x8 inter leaves The two straddling-leaf mi publications spelled their vote out by hand with ref_frame pinned to LAST and mv1 to (0,0) -- the encoder-grid-drift class, correct only for as long as a leaf could never be compound. Both now go through record_mi, byte-identically. A leaf is then offered the compound candidates a whole 32x32 block is: NEAREST_NEARESTMV, GLOBAL_GLOBALMV and NEW_NEARESTMV off the vector the leaf already searched, against the compound stack built at the leaf's own bw4/bh4. The tile writer already codes a compound block at any leaf size, so no writer change was needed.
perf(av1): band the loop-restoration unit search by unit rowAhmet Kaan Gümüş · 63f3f62
perf(av1): band the loop-restoration unit search by unit row `pick_restoration` priced every unit of every Wiener candidate on the frame thread while the whole pool sat idle. A unit's cost is read off its own samples and written to its own slot, so the walk is `chunks_mut` bands of the same `best` -- the choice cannot depend on how many bands there are. 4 frames at 3840x1608, 4x2 tiles, 8 threads: the LR search goes 31.0 -> 13.4 ms/frame; 1080p 8.4 -> 4.5 ms/frame.
Merge branch 'lane-av1comp2' (238c65d8): NEAREST_NEW/NEW_NEAREST compound modes, distance-scaled motion search, and the encoder's mi grid votes both referencesAhmet Kaan Gümüş · fa932fb
Merge branch 'lane-av1comp2' (238c65d8): NEAREST_NEW/NEW_NEAREST compound modes, distance-scaled motion search, and the encoder's mi grid votes both references BD vs libaom +94.4/+104.3/+66.8, vs rav1e +47.5/+63.6/+10.7 (from +120.1/+128.5/+66.4 and +67.8/+86.0/+10.3). Root cause: record_mi published compound blocks as single-reference, so 95 blocks per gate run were predicted from vectors never trialled -- invisible to the ffmpeg gate; EC_COMP_MISMATCH=1 is the detector (0 is the invariant). Pyramid still loses on all three clips and stays off.
fix(av1): the per-tile search job arms its own order hintsAhmet Kaan Gümüş · aeaf6ba
fix(av1): the per-tile search job arms its own order hints lane-av1tsearch moved the RD/motion search into one job per tile, and ref_distance (the distance-scaled search step) reads tile.rs' ORDER_HINTS thread-local: a search worker read (0, 0, [0; 7]) and scaled nothing, so the coded bits depended on the thread count -- 2x1 tiles came out 9852 bytes at one thread and 10034 at four. The inter search_tile closure now arms the hints the same way the write jobs do. encoder::tests::tile_bytes_do_not_depend_on_the_thread_count fails before this and passes after. BD unchanged: +94.4/+104.3/+66.8 vs libaom.
perf(av1): band the encoder's frame-level filter stage across the tile workersAhmet Kaan Gümüş · 996b587
perf(av1): band the encoder's frame-level filter stage across the tile workers The per-tile search leaves every core idle for the rest of the frame. The filter stage now bands itself across the same workers: `par::override_filter_threads` (thread-local, so nothing outside this span changes) puts the deblock and CDEF replays, the capture decode's own filter chain and the loop-restoration passes on the decoder's existing band split, the per-64 SSE gets a unit-row band of its own (`unit_sse_rows`, partial u64 sums), and a candidate's ~6 MB plane copies come off a recycled buffer pool -- a fresh Vec per copy was 12.6% of a 1080p frame's wall in page faults alone -- banded when the buffer is already the right length. Gated by `filter_stage_bytes_do_not_depend_on_the_thread_count` (one tile, a cropping size, 1 vs 2/4/8 threads) and by `unit_sse_matches_the_naive_sum` at 2/4/8 bands.
perf(av1): the filter search's replay now covers cropped framesAhmet Kaan Gümüş · 8a4a771
perf(av1): the filter search's replay now covers cropped frames The encoder scores ~30 deblock/CDEF candidates per frame by replaying the loop filters on one captured reconstruction (`decode::FilterReplay`), but the capture demanded `frame == plane` dimensions -- and no export size meets that: 1080 and 1608 both pad to a superblock row. Every candidate at those sizes fell through to a full re-decode of the frame, which the new per-stage breakdown measures at 57% of a 1080p frame's wall. The capture now also fires on a cropped frame and the replay finishes with the decoder's own cropped return path (crop + wide-margin stash), so it is still exactly the decode it stands in for. 1920x1080, 8 frames, 4x2 tiles, 8 tile threads: 6.75s -> 2.63s (1.19 -> 3.05 fps); filter search 57.2% -> 27.6% of wall. Adds `par::timer`/`EC_AV1_STAGE_TIMES` (off by default: one relaxed atomic load per stage per frame) and `encoder::tests::filter_stage_wall_*`, plus `filter_replay_codes_the_same_stream_as_a_full_decode` at a cropping size.