Commits
Commits on
052d1d3f81ff6b9e7c09b93b58c5e772d825fcb3Filtered to crates/ec-av1/src/quant.rsClear filter2026-09-24
2026-09-04
perf(av1): dequantize into a reused buffer, with the loop invariants hoistedAhmet Kaan Gümüş · 32f9ae5
perf(av1): dequantize into a reused buffer, with the loop invariants hoisted `dequant_wh` was a `map`/`collect` building a fresh `Vec<i32>` per transform unit (7.8% self time, the third-hottest symbol in the decode profile), and inside it every coefficient repeated the whole per-coefficient spec function: two quantizer-table lookups with their own clamps, the area denominator's match, and the bound shift -- all of which depend on the transform, not on the coefficient. `dequant_wh_into` hoists them and writes a caller-owned buffer, which the one hot caller (`dequant_and_inverse_typed_wh`) keeps thread-local. A zero level dequantizes to zero for every parameter set, so the all-but-EOB tail of a grid now costs a compare rather than a 64-bit multiply and divide. The arithmetic on a non-zero level is untouched; `dequant_wh` keeps its `Vec` signature for the other callers. `buffered_dequant_matches_the_per_coefficient_form` checks the buffered form against `dequant_coeff_wh` over six transform shapes, three bit depths, three quantizer/delta sets and both level signs. Byte-exact: `EC_PROBE_OUT16` dumps cmp IDENTICAL against the lane's baseline binary on 1080p 10-bit, 2160p HDR and the 8-bit palette fixture. Interleaved medians against the previous commit: 1080p 13.46 s -> 12.15 s, 4K 67.11 s -> 63.38 s.
2026-08-30
fix(av1): thread per-plane quantizer deltas (delta_q_y_dc/u_dc/u_ac/v_dc/v_ac) into dequantAhmet Kaan Gümüş · 8560456
fix(av1): thread per-plane quantizer deltas (delta_q_y_dc/u_dc/u_ac/v_dc/v_ac) into dequant Spec 5.9.12/7.12.2: these were parsed by ec-av1-syntax and used for nothing but the lossless[] check. Threaded QuantDeltas through dequant_coeff_wh/ dequant_wh/dequant_and_inverse_typed(_wh) and all 8 decode.rs leaf call sites, plane-correct (Y has no AC delta). decode_stream's 5 call sites now pass header.quantization.delta_q_*; convenience wrappers pass ::default(). Plain 4-arg dequant/dequant_coeff/dequant_and_inverse (~20 external callers in tile.rs/encode.rs/transform.rs) unchanged. Blast radius measured, not assumed: EC_AV1_TRACE now prints the 5 deltas at parse time. Measured zero on the r10 pinned repro (seed42.obu, base_q_idx 180) and on every stream the scoped decode::/quant::/transform:: suites exercise (27/27 green) -- no gate was passing "for the wrong reason". Charter's 81-vs-76 defect is NOT this: deltas are genuinely zero for seed42, disproven by measurement per the charter's own fallback clause. Pinned repro currently panics on an unrelated pre-existing gap (32x32 partition value=4, later superblock, same shape as the r9 part32-AB dead-end) before it can even reach the pixel comparison. Report names the next suspect (CURRENT_Q_IDX per-superblock delta-q state / segmentation qindex) with a one-line instrumentation step, left for the next round. Red: pinned_sbpart_stream_decodes_pixel_exact still fails (pre-existing, unrelated gap, not a regression from this diff).
wip(av1): rectangular inverse transform + libaom dump harness (in progress)Ahmet Kaan Gümüş · 1a9fc2c
wip(av1): rectangular inverse transform + libaom dump harness (in progress) Committed by the orchestrator: the builder hit its turn cap mid-verification.
2026-08-25
feat(av1): dequantization and the inverse DCTAhmet Kaan Gümüş · 6a83833
feat(av1): dequantization and the inverse DCT An encoder that cannot say what the decoder will show cannot choose coefficients by what they cost against what they are worth. This adds the decode-side arithmetic to ec-av1: the dequantizer of spec 7.12.3 and the inverse DCT of 7.13, written from the specification's own butterfly stage list so that one network serves every size from 4 to 64. The gate is agreement with a real decoder, sample for sample: two key frames whose first block carries coefficients from DC to the far corner decode under ffmpeg to exactly 128 plus the residual this code computes, over all 1024 and 4096 samples. Beneath that sit the two tables of decoder-pinned DC residuals the tile tests already carried, all 28 levels of each, plus structural gates for the transpose, the sign rounding, and the row shifts of the four sizes the frame syntax cannot reach. Mutation-checked: a cosine table entry off by one, and an 8x8 row shift off by one, each fail a named test.