Commits
Commits on
cf280e5aa9eeaf426419a18b70d44d8dbbf227ac2026-09-06
test(av1): the intra-mode ablations force the palette offAhmet Kaan Gümüş · cf280e5
test(av1): the intra-mode ablations force the palette off A two-colour synthetic picture is coded losslessly by the palette under every arm of a mode ablation, so both ladders reach infinite PSNR and the ablation measures nothing (three tests failed exactly that way). `force_screen` is a per-thread override -- the suite runs in one process, so an environment variable could not do it.
feat(av1): tune screen detection to the measured colour-count split, gate printsAhmet Kaan Gümüş · 55cb55e
feat(av1): tune screen detection to the measured colour-count split, gate prints libaom's own bound (blocks with 2..=4 distinct colours over a tenth of the frame) separates NOTHING on real material: `probe_screen_detect` measures the share of 16x16 luma blocks under each bound on the gate's three clips and the two populations only part at 32 colours -- film 20.3..21.9%, the OBS capture 51.1..51.5%. Defaults move to 32 colours over a third of the frame, both still swept by EC_AV1_SCREEN_COLORS/EC_AV1_SCREEN_PCT. The gate now prints, per clip, how many frames set `allow_screen_content_tools`, how many blocks took a palette and of what size (gate-blind-to-feature). BD gate, 12 frames at 640x384 (vs libaom / vs rav1e), base -> now: 1080p film +121.2 / +71.8 -> unchanged, detector off, pins unmoved 2160p film +146.4 / +97.8 -> unchanged, detector off screen +79.1 / +17.0 -> +74.9 / +14.2 (487 palette blocks) wall ours 5.6 / 4.7 / 5.5 s against 5.1 / 4.7 / 5.4 s.
feat(av1): palette-coded luma intra blocks on a screen-content key frameAhmet Kaan Gümüş · f2eac79
feat(av1): palette-coded luma intra blocks on a screen-content key frame The whole spec 5.11.46 chain, mirrored symbol for symbol from this crate's own decoder: `palette_y_mode` off the real `av1_get_palette_mode_ctx` neighbour bands, `palette_y_size`, the colours coded against the above/left colour cache `av1_get_palette_cache` builds (`palette_ctx_and_cache`, the decoder's own merge and dedup), and the colour-index map on `decode_color_map_tokens`' wavefront diagonal with `av1_get_palette_color_index_context`'s ordering. The candidate palettes are libaom `av1_k_means`-shaped: a block with at most 8 distinct colours takes them all (exact prediction), a busier one is quantised to 8 and to 4 by a histogram Lloyd iteration, and each is priced through the very writers the tile uses (`palette_bits` on a `SymbolEncoder::pricer`) against the mode the intra search already settled. Check: encode::tests::a_screen_content_picture_codes_palette_blocks_ffmpeg_decodes_exactly -- 48 palette blocks (sizes 2/3/4, 16 each) on a 192x96 screen card, ffmpeg and our own decoder both reconstruct the encoder's picture exactly, and the film-shaped test card leaves the detector off.
feat(av1): screen-content detection sets allow_screen_content_tools on a key frameAhmet Kaan Gümüş · 3136cbe
feat(av1): screen-content detection sets allow_screen_content_tools on a key frame libaom's `av1_set_screen_content_options` shape (distinct colours per 16x16 luma block, blocks with 2..=4 of them covering more than a tenth of the frame), run on the source luma before any header is built. When it fires the sequence header carries the SELECT form of `seq_force_screen_content_tools` and the key frame sets its own `allow_screen_content_tools`; every intra block of that tile then codes the two `read_palette_mode_info` flags (spec 5.11.46), both at ctx 0 and both "no palette" -- the syntax a palette block will fire inside next. A sequence with no screen content leaves the sequence bit at 0 and writes exactly the stream it wrote before: the byte pins do not move. Verified with the detector forced on (EC_AV1_SCREEN=1): ffmpeg_decodes_exactly_what_the_encoder_reconstructed and every_frame_of_a_sequence_decodes_through_our_own_decoder both pass, so the new symbols are the ones libaom reads.
Merge branch 'lane-av1fsearch' (0a6ed84e): filter search scores per unit in one chunked pass and replays CDEF candidates off cached deblocked planesAhmet Kaan Gümüş · 39035c8
Merge branch 'lane-av1fsearch' (0a6ed84e): filter search scores per unit in one chunked pass and replays CDEF candidates off cached deblocked planes Byte-identical to 7f2ab3ea (FNV sets on the three gate clips, BD unchanged); instructions -11.2%, ladder wall 5.34/4.91/7.06 -> 4.51/4.08/4.80 s. The filter stage is 12.9% of the encode now (26.3% before).
test(av1): pin unit_sse's chunked sums against the naive per-sample onesAhmet Kaan Gümüş · e92d113Browse files
perf(av1): the filter replay deblocks once per level pairAhmet Kaan Gümüş · 95de47f
perf(av1): the filter replay deblocks once per level pair The search fixes the deblocking levels in its first three stages and then walks 18 CDEF strength candidates that all replay the same deblock. The replay now keeps the deblocked planes with the levels that produced them and copies those instead when the levels match -- the same copy the replay was already making, with the deblock skipped. Byte-identical on the three gate clips; ladder wall 4.64/4.21/4.91 -> 4.51/4.08/4.80 s.
perf(av1): score the filter search's two sides once each, per unitAhmet Kaan Gümüş · 2b23fd6
perf(av1): score the filter search's two sides once each, per unit The filter search's per-64x64 error pass (`unit_sse`) was the encoder's second-largest self-time symbol (10.6%), and the frame-level `plane_sse` that ran beside it (1.7%) summed the very same terms a second time. Two exact changes, no decision moved (byte-identical streams on the three gate clips): * `unit_sse` returns the frame total as well, so `plane_sse` is gone, and its inner loop walks unit-sized chunks with a `u32` accumulator instead of dividing `col / unit` per sample and accumulating straight into `out` -- a shape LLVM turns into a reduction. * Each candidate's luma and chroma error is memoized under the parameters that side actually reads: `apply_deblock` filters luma on `level[0..2]` and chroma on `level[2..4]`, and CDEF's strengths are per plane type, so the ~11 luma-deblock candidates all share one chroma score and the 9 chroma-CDEF candidates all share one luma score. The luma deblock level is in the CHROMA key because CDEF's direction search runs on the post-deblock luma window and chroma reuses that direction -- except when chroma CDEF is off, which is the case that makes the deblock stages share. 1080p / 2160p / screen ladder wall 5.34/4.91/7.06 -> 4.64/4.21/4.91 s.
Merge branch 'lane-av1trial' (782b5748): trial-set census, exact SAD pre-pass skip, split RD breakout (0.125 lambda)Ahmet Kaan Gümüş · 826851c
Merge branch 'lane-av1trial' (782b5748): trial-set census, exact SAD pre-pass skip, split RD breakout (0.125 lambda) Wall -11.0/-11.1/-6.9% (instructions -10.0% 1080p) for BD +0.1/+0.3/-0.2 vs libaom (+121.2/+146.4/+79.1). Chroma top-K ships off (measured: SAD ranks the chroma winner first only 67-77% of the time). Census via EC_AV1_CENSUS=1 on examples/enc_probe.
Merge branch 'lane-av1pyr' (a5447b64): two-level frame pyramid (opt-in), target-bitrate rate mode, encode_frames/flush APIAhmet Kaan Gümüş · 7c2597d
Merge branch 'lane-av1pyr' (a5447b64): two-level frame pyramid (opt-in), target-bitrate rate mode, encode_frames/flush API Pyramid ships OFF: 4:-16:8 measures +131.9/+178.7/+78.4 vs libaom against flat +121.1/+146.1/+79.3 (hidden frame predicted mini_gop pictures ahead under the same search range; leaves reach it only via extra-ref modes). Defect fixed on the way: decode_inter_frame_tile_lr hard-coded NO_SIGN_BIAS, desyncing the encoder's own filter-search re-decode for any backward reference (surfaced as a missing-picture refusal).
perf(av1): RD breakout on the inter split trial, chroma top-K lever, leaf censusAhmet Kaan Gümüş · 4e368e4
perf(av1): RD breakout on the inter split trial, chroma top-K lever, leaf census The census says the split trial runs on nearly every non-skip 32x32 block and wins 7.6% of the time on film, 3.0% on screen. A 32x32 whose whole-block RD cost per pixel comes out under 0.125*lambda (and a 16x16 leaf likewise) is no longer offered the split: -10.0%/-5.7% instructions (1080p/screen) for +0.1/+0.3/-0.2 BD points vs libaom. Chroma top-K by prediction SAD ships off: no K bought >=5% wall inside +0.3 BD.
docs(av1): post-merge pyramid sweep, why it ships off and what unblocks itAhmet Kaan Gümüş · 51ea72dBrowse files
fix(av1): the encoder's filter-search re-decode ignored ref_frame_sign_biasAhmet Kaan Gümüş · 28f2d42
fix(av1): the encoder's filter-search re-decode ignored ref_frame_sign_bias decode_inter_frame_tile_lr hard-coded NO_SIGN_BIAS, so the trial decode of a pyramid leaf reading its group's backward hidden ALTREF built different MV stacks than the writer and desynced into 'a reference frame selected with no picture at this frame's own ref_frame_idx slot'.
perf(av1): trial-set census, and the intra SAD pre-pass only when something ranks by itAhmet Kaan Gümüş · bf299cd
perf(av1): trial-set census, and the intra SAD pre-pass only when something ranks by it The key-frame luma search summed a per-mode SAD the unpruned default never reads (top_k is None there); byte-exact on all three probe clips, ~2% wall. EC_AV1_CENSUS=1 counts the search's full RD trials by kind and histograms where the RD winner sat in the SAD ranking.
merge: main (lane-av1mv motion search, lane-av1price msac pricer) into lane-av1pyrAhmet Kaan Gümüş · a802372Browse files
Merge branch 'lane-av1price' (128ba78b): byte-exact pricer speed -- telescoped symbol cost, pricing coder without the carry state, interior context fast path, all-zero eob testAhmet Kaan Gümüş · e6e02af
Merge branch 'lane-av1price' (128ba78b): byte-exact pricer speed -- telescoped symbol cost, pricing coder without the carry state, interior context fast path, all-zero eob test -5.3% instructions on the 1080p ladder, streams byte-identical (12/12 FNV points on the three gate clips against its base; the byte pins from lane-av1mv hold on the merged tree).
docs(av1): pin the pyramid QP-offset sweep and why the pyramid ships offAhmet Kaan Gümüş · 006a259Browse files
feat(av1): target-bitrate rate mode, per-level rate loop and an EC_AV1_PYRAMID knob on ec-benchAhmet Kaan Gümüş · 4d40670Browse files
Merge branch 'lane-av1mv' (8f1e2498): NEWMV against GOLDEN/ALTREF with stack-seeded starts and a swept early-outAhmet Kaan Gümüş · 3e400dc
Merge branch 'lane-av1mv' (8f1e2498): NEWMV against GOLDEN/ALTREF with stack-seeded starts and a swept early-out BD vs libaom +121.1/+146.1/+79.3, vs rav1e +71.8/+97.5/+17.2 (all down or flat from 52819482); wall +2-3% on the film clips, inside this box's run-to-run noise. Census: motion::search is not the wall (halving its evals moved a 6 s ladder by 0.2 s).
merge main (lane-av1lr) into lane-av1mv: pins re-measured with the extra-reference NEWMV inAhmet Kaan Gümüş · 97b0f08Browse files
test(av1): pyramid round trip through both decoders, per-reference hit counter, pyramid arm in the BD gateAhmet Kaan Gümüş · f025ec8Browse files
feat(av1): a two-level frame pyramid in the encoder facadeAhmet Kaan Gümüş · d496905
feat(av1): a two-level frame pyramid in the encoder facade Hidden ALTREF coded ahead of its display position and re-output by a show_existing_frame header, per-level quantizer offsets, a per-level rate loop and packet dts/level. The flat one-in-one-out path is untouched.
feat(av1): NEWMV against GOLDEN/ALTREF with a swept early-out, plus a motion-search censusAhmet Kaan Gümüş · 242c431Browse files
Merge branch 'lane-av1lr' (12055f9c): per-64x64 CDEF strengths and luma Wiener loop restoration in the encoderAhmet Kaan Gümüş · 56a796a
Merge branch 'lane-av1lr' (12055f9c): per-64x64 CDEF strengths and luma Wiener loop restoration in the encoder Both searched with the decoder's own kernels on decoder-exposed post-deblock / post-CDEF planes (FrameCtx::capture_stages, one bool read when off). BD vs libaom +122.7/+147.3/+79.4, vs rav1e +73.4/+98.5/+17.2 (all six down from d5fc99e0); wall +0.6 s 2160p / +0.8 s screen for the tile re-code.
perf(av1): settle an all-zero transform block before the scan-order searchAhmet Kaan Gümüş · c3d93a7
perf(av1): settle an all-zero transform block before the scan-order search Finding the end of block walks the scan backwards through one dependent grid load per position, so an all-zero block pays the whole scan -- once per priced candidate. A straight-line all-zero test runs first: it vectorises, and a block that codes anything at all almost always codes its DC, so the test stops at the first element. Byte-exact on all twelve ladder points; 1080p ladder -0.41% instructions:u (110.14G -> 109.69G, ABAB x2).
wip(av1): motion-search census, stack-seeded starts, extra-ref NEWMV behind knobsAhmet Kaan Gümüş · 082d0dcBrowse files
perf(av1): gather a coefficient's context neighbours without per-neighbour edge testsAhmet Kaan Gümüş · 02bd8ae
perf(av1): gather a coefficient's context neighbours without per-neighbour edge tests `neighbour` was a third of `write_coeffs`'s self time: five (base) or three (base-range) loads, each behind its own pair of edge compares plus a slice bound check, for every coefficient of every candidate the search prices. A coefficient clear of the far edges reaches all of them, so that case indexes straight off the position. Byte-exact on all twelve ladder points; 1080p ladder -0.71% instructions:u (110.95G -> 110.15G, ABAB x2).
perf(av1): price a symbol string off its final interval, not one log2 per symbolAhmet Kaan Gümüş · fb3fa69
perf(av1): price a symbol string off its final interval, not one log2 per symbol The bit account the RD search prices with cost `__log2_fma` 8.2% of the encoder's profile, one call per symbol written or priced. A symbol costs `log2(r) - log2(rng)` for the two widths it narrows between, and the next symbol's `r` is this one's `rng` shifted up by the renormalisation, so a whole string's cost telescopes to `bits_base + shifts - log2(rng)`: one `log2` per price asked for. Same reading as libaom's `od_ec_enc_tell_frac`. A pricing coder also keeps `low`, `cnt` and the precarry buffer whose only consumer is `finish`, which a search never calls; `SymbolEncoder::pricer` drops that bookkeeping and keeps the interval width the account reads. Byte-exact: all twelve ladder points of the three gate clips keep their length and FNV-1a hash. 1080p ladder -4.76% instructions:u (116.49G -> 110.95G, ABAB x2), of which the pricer accounts for -0.92%.
Merge branch 'main' (d5fc99e0) into lane-av1lrAhmet Kaan Gümüş · 8e2799a
Merge branch 'main' (d5fc99e0) into lane-av1lr Nine hunks across three files, all taken both ways. tile.rs: that lane split each writer into a `_tx` wrapper and a `_cdfs` worker, so this lane's arm/clear guard moves down into the worker, where the symbols are actually written. decode.rs: `decode_inter_frame_tile_lr` now takes `initial_cdfs` alongside `lr` and both wrappers thread it; the two chained-decode tests pass this frame's own `loop_restoration` AND its `start_cdfs`. encode.rs: the tile is written through the CDF-carrying writer, and this lane's re-codes (for the `cdef_idx` literals and the per-unit restoration syntax) each restart from the frame's OWN `start_cdfs` rather than from where the first write left them -- the second tile is the first tile's symbol sequence plus new ones, so it has to adapt from the same point the decoder will. The winning re-code publishes its end-of-tile tables into `next_cdfs`, which is what the next frame's writer starts from; the first write's would have been stale. Byte pins re-measured on the merged tree: q=150 7416 -> 7458 bytes, q=60 27927 -> 27807.
Merge branch 'lane-av1s3' (91f6923f): NEARMV/GLOBALMV with a real DRL index, GOLDEN/ALTREF references, CDF carry across framesAhmet Kaan Gümüş · 0f15668
Merge branch 'lane-av1s3' (91f6923f): NEARMV/GLOBALMV with a real DRL index, GOLDEN/ALTREF references, CDF carry across frames Merge resolution: the byte pins from lane-av1fwd move to the merged tree's streams (7416 / 27927 bytes), since the inter syntax changed on purpose.
test(av1): fold the golden-only ref bank helper into the three-slot oneAhmet Kaan Gümüş · a947556Browse files
Merge branch 'main' (45b942bd) into lane-av1lrAhmet Kaan Gümüş · 3bf4b1b
Merge branch 'main' (45b942bd) into lane-av1lr Five hunks in `pick_and_apply_filters` and its two call sites, resolved so both lanes survive: the deblocking/CDEF coordinate search runs through main's `FilterReplay` (one decode, then the filters alone per candidate), and the per-64x64 error this lane's CDEF preset search reads comes off those REPLAYED pictures -- the replay is pinned byte-exact against a decode, so the per-unit measurement is the same measurement. The tile recode with `cdef_idx` literals and the one capturing decode the loop restoration stage needs both run after the replay is cleared. The byte pins move, as that lane's own comment said they would for new tile syntax: 7823 -> 7796 bytes at q=150 and 28189 -> 28182 at q=60, both SMALLER, re-measured on this merged tree.
feat(av1): ALTREF as the frame two back, on an alternating slotAhmet Kaan Gümüş · 9310981
feat(av1): ALTREF as the frame two back, on an alternating slot Frame n refreshes slot 0 for odd n and slot 2 for even n, so the frame two back is still intact in the very slot this one is about to overwrite (read before write): ref_frame_idx names it as ALTREF_FRAME, LAST names the other slot, GOLDEN stays on slot 1. inter_frame_headers_slots is the header builder that takes the three slots apart; the five-argument inter_frame_headers keeps its old read-and-write-one-slot meaning for the hand-built fixtures. The RD prices each extra reference's two search-free modes from a slice, so LAST/GOLDEN/ALTREF share one code path. ALTREF is picked for 337/405/1793 blocks per ladder. BD-rate vs libaom 127.3/153.4/83.0 -> 126.5/152.9/80.9, vs rav1e 78.6/105.7/18.3 -> 77.9/105.5/17.6; wall 7.8/7.1/7.8 -> 8.0/7.2/7.7 s. ffmpeg decodes every stream sample-exact.
Merge branch 'lane-av1fwd' (ea3cd233): encoder pricer keeps its CDF tables, filter search replays filters instead of re-decoding, zero-residual transform skipsAhmet Kaan Gümüş · 93d97dc
Merge branch 'lane-av1fwd' (ea3cd233): encoder pricer keeps its CDF tables, filter search replays filters instead of re-decoding, zero-residual transform skips Byte-exact vs a6649c4e (pinned by count + FNV-1a); instructions:u -27.0% / -25.6% / -22.1% on the gate clips. The AVX2 forward pass was NOT built: the census puts 70% of forward calls on an all-zero residual and the profile put the pricer and the filter re-decode 2-3x above the whole transform.
test(av1): pin the encoder's own streams byte for byteAhmet Kaan Gümüş · f79740b
test(av1): pin the encoder's own streams byte for byte The BD gate measures quality, which a speed lane can move by a hair without failing anything. This pins two points of the 1080p gate clip's own ladder by byte count and FNV-1a hash; both values are identical at a6649c4e (the merge before this lane) and at its tip, which is what "exact speed work" has to mean.
docs(av1): the BD gate's own table records what the speed lane cost it (nothing) and boughtAhmet Kaan Gümüş · eadf8b5Browse files
feat(av1): a real GOLDEN reference beside LASTAhmet Kaan Gümüş · 2f069ae
feat(av1): a real GOLDEN reference beside LAST The key frame refreshes all eight DPB slots and every inter frame only slot 0, so slot 1 still holds the key frame however long the GOP runs: inter_frame_headers now points ref_frame_idx[3] (GOLDEN_FRAME) at it, the encoder carries that picture through encode_sequence and Av1Encoder, and the 32x32 inter RD prices GOLDEN's two search-free modes (NEARESTMV off its own mv stack, GLOBALMV) beside LAST's whole mode set. No second motion search -- that stage owns the wall -- and one trial set per distinct (reference, vector) pair, so the added modes mostly reuse work. The trial decode of the filter search and the two GOP tests take the golden plane at RefPix index 4 (the array is keyed by reference NAME, not by DPB slot). GOLDEN is picked for 50%/56%/37% of inter blocks. BD-rate vs libaom 133.7/162.3/83.8 -> 127.3/153.4/83.0, vs rav1e 84.7/113.1/18.0 -> 78.6/105.7/18.3; wall 10.1/9.5/9.4 -> 7.8/7.1/7.8 s. ffmpeg decodes every stream sample-exact (ffmpeg_and_this_decoder_agree_on_a_gop).
feat(av1): the encoder searches loop restoration, one Wiener unit at a timeAhmet Kaan Gümüş · 2b5ba17
feat(av1): the encoder searches loop restoration, one Wiener unit at a time Loop restoration was the half of the in-loop filter chain the frame-level search could not reach: a unit's filter is coded in the TILE, so no re-decode under candidate header parameters can choose it, and the decoder never handed back the pictures spec 7.17 filters from. It does now, on request: `FrameCtx::capture_stages` leaves the post-deblock and post-CDEF planes behind between the two stages, and off (every decode but this search) it costs one bool read and not a copy. The search prices four Wiener candidates per 64x64 unit against RESTORE_NONE, running the DECODER's own kernel over the captured picture, and the winner is written through the tile writers' new per-unit syntax -- `restore_wiener` plus the reference-relative subexp taps, whose writers now sit beside the readers they invert (the test-only transcription of them is gone, and a roundtrip pins the pair). A frame no unit restores keeps RESTORE_NONE on every plane instead of paying a bit per unit for a tile full of zero symbols.
wip(av1): loop restoration unit syntax + search, snapshot at the agent cap (may not compile)Ahmet Kaan Gümüş · c3b0776Browse files
feat(av1): the writer mirrors the decoder's single_ref context functionsAhmet Kaan Gümüş · f5cb29a
feat(av1): the writer mirrors the decoder's single_ref context functions InterInfo carries its own ref_frame and the writer codes the whole single_ref_p1..p6 tree through write_single_ref, each symbol at the context decode.rs read_single_ref uses (single_ref_p1_ctx/p2/p3/p4/p5/p6 on the immediate above/left neighbours' references, -1 for an intra or unavailable one) -- the writer's Neighbours now tracks above_ref/left_ref the way the decoder's does. The mv stack and the MI grid take the block's own reference too. Byte-exact against the previous streams: the BD gate reports the same bytes at all twelve points (133.7/162.3/83.8 vs libaom, 84.7/113.1/18.0 vs rav1e), which is what proves the mirrored contexts equal the collapsed all-LAST ones they replace. mvstack::single_ref_ctx is now test-only.
perf(av1): the forward transform skips an all-zero residual, and the quantizer stops dividing per coefficientAhmet Kaan Gümüş · eca6458
perf(av1): the forward transform skips an all-zero residual, and the quantizer stops dividing per coefficient A census of the BD gate's own ladder (12 frames, four quality points): 4.14M DCT_DCT forward transforms (67% 4x4, 24% 8x8, 6% 16x16, 2% 32x32) of which 72% carry an all-zero residual, and 1.86M non-DCT ones (77% 4x4, 23% 8x8) of which 68% do. The fixed-point path skipped those row by row and column by column but still allocated the row buffer; the f64 analysis basis the non-DCT types use had no skip at all and ran both matmuls over zeros. Both now return early -- exactly, since a row of zeros contributes only `0.0 * b` terms and a sum of zeros is `+0.0` -- and `quantize` walks rows and columns instead of recovering them with a division per coefficient. Byte-exact: 1080p gate ladder unchanged (same FNV-1a per stream); 6.61s -> 6.24s.
perf(av1): the filter search decodes its tile once instead of once per candidateAhmet Kaan Gümüş · 675eebb
perf(av1): the filter search decodes its tile once instead of once per candidate `filter_search::pick_filters` scores ~25 deblock/CDEF candidates by handing the coded tile back to the decoder under each one. The entropy decode and reconstruction it repeated are identical every time -- both filters run after them -- and that re-parse was 24% of the encoder's profile. The decoder now captures its pre-filter frame plus the neighbour state the filters read (`decode::FilterReplay`, armed for exactly one decode), and `replay_filters` re-runs `apply_deblock` + `apply_cdef` on a copy of it. Capture only happens on the shape whose decode tail is those two calls and nothing else (no superres, no loop restoration, no crop); anything else decodes for real as before. Byte-exact: the four-point ladder of the 1080p gate clip is unchanged (17643/32317/53048/76330 bytes, same FNV-1a per stream); 8.24s -> 6.61s.
feat(av1): the encoder codes one CDEF strength per 64x64 superblockAhmet Kaan Gümüş · 93429cb
feat(av1): the encoder codes one CDEF strength per 64x64 superblock The filter search only ever wrote `cdef_bits = 0`: one strength pair for the whole frame, because a per-unit choice needs a `cdef_idx` literal in the tile payload and the whole-frame re-decode the search runs cannot reach one. It can. Every candidate the coordinate search already decodes carries its own error PER 64x64 unit, so the pool of strength pairs tried under the winning deblocking levels doubles as libaom `av1_cdef_search`'s preset list: the units vote, the list grows by that histogram, and the cheapest list length wins on error plus lambda times the literals it costs. The tile is then written a second time with those literals (`tile::arm_cdef_idx`, mirroring the decoder's own `cdef_transmitted` slot) and the winner re-decoded from it, so the encoder's reference frame is still exactly what a decoder reconstructs. The BD gate prints the per-clip `cdef_bits` distribution and how many 64x64 units left the default preset.
perf(av1): the coefficient rate pricer stops rebuilding every CDF table per candidateAhmet Kaan Gümüş · 7947a2d
perf(av1): the coefficient rate pricer stops rebuilding every CDF table per candidate `tile::coeff_bits` is called once per priced candidate and built a whole `Cdfs` each time -- 9% of the encoder's profile between `Cdfs::new` and the copy behind it. It now keeps one pristine and one scratch `Cdfs` per q-context per thread and restores only the tables `write_coeffs` adapts, so the price is taken against exactly the same state as before. `partition_bits` builds its read-only tables once. Byte-exact: the four-point ladder of the 1080p gate clip is identical (17643/32317/53048/76330 bytes, same FNV-1a per stream); 9.58s -> 8.24s.
merge main a6649c4e (lane-av1filt): thread this frame's start_cdfs into the filter search's trial decodeAhmet Kaan Gümüş · 97f0e31Browse files
test(av1): the hand-built GOLDEN fixture keeps its frames' CDF carry offAhmet Kaan Gümüş · 4db0da1
test(av1): the hand-built GOLDEN fixture keeps its frames' CDF carry off Its two inter tiles are hand-coded from a fresh Cdfs, so their headers must say so now that inter_frame_headers leaves disable_frame_end_update_cdf off -- otherwise frame 2's decode loads what frame 1 stored and desyncs at the first symbol. Swept the crate: the only other hand-built inter headers (frame.rs' header round trip) code no tile.
Merge branch 'lane-av1filt' (193d9a9e): the encoder searches deblock levels and CDEF strengths by re-decoding its own tileAhmet Kaan Gümüş · 1b6265b
Merge branch 'lane-av1filt' (193d9a9e): the encoder searches deblock levels and CDEF strengths by re-decoding its own tile Merge resolution: the trial decoder now takes the frame's own tx_select bit (c78863b8), so the filter search runs under inter TxMode::Select too instead of skipping -- with Select the default since lane-av1tx2, the lane's own skip would have left every inter frame unfiltered (class: merge cross-product).
test(av1): pin that the filter search fires, and record the measured ladderAhmet Kaan Gümüş · 06cf00e
test(av1): pin that the filter search fires, and record the measured ladder A non-ignored gate proves some frame of a sequence chooses a real deblocking level or CDEF strength and that decode_stream reproduces the encoder's filtered reconstruction byte for byte; the BD gate's doc table carries the per-step numbers.
feat(av1): carry the CDF state across frames (spec 7.20)Ahmet Kaan Gümüş · e161916
feat(av1): carry the CDF state across frames (spec 7.20)
Inter frames now leave `disable_frame_end_update_cdf` off, so each one
stores its end-of-tile tables with the counts reset and the next frame's
writer starts from them -- the encoder mirrors `stream::stored_cdfs_for`
exactly, and the key frame keeps the bit set, so what it stores is the
defaults it started from and the first inter frame is unchanged.
`sb_coeff_{key,inter}_frame_tile_cdfs` are the writers that take and leave
the caller's `Cdfs`; the old entry points wrap them with a fresh one.
`Encoded` carries `start_cdfs`/`next_cdfs`, `Av1Encoder` carries the state
between `encode` calls, and `decode_inter_frame_tile` takes an
`initial_cdfs` -- the same threading the frame's `tx_select` bit needed,
third instance of that class, and the three GOP tests (one of which checks
ffmpeg against us) now pass the frame's own start state.
BD-rate vs libaom 210.1/218.7/167.4 -> 202.6/206.6/159.0, vs rav1e
151.8/164.7/72.7 -> 144.5/153.2/65.9; wall unchanged at 7.9/7.4/7.6 s.