The 12-frame gate table before and after the chroma fix, invariants, instruments
Browse files at this commitb1674922a49e3aa6f7740a712229c634af6c3740Parent: 7971d34- docs
- the 12-frame gate table before and after the chroma fix, invariants, instruments
2 changed files +55 -1
- crates/ec-av1/src/encode.rs +3 -1
- lanes/txrd.report.md +52 -0
crates/ec-av1/src/encode.rsmodified+3 -1
| @@ -3831,7 +3831,9 @@ pub(crate) static TXRD_STATS: [std::sync::atomic::AtomicU64; 7] = [ | |||
| 3831 | std::sync::atomic::AtomicU64::new(0), | 3831 | std::sync::atomic::AtomicU64::new(0), |
| 3832 | ]; | 3832 | ]; |
| 3833 | 3833 | ||
| 3834 | -/// Reads [`TXRD_STATS`] and zeroes it. | 3834 | +/// Reads [`TXRD_STATS`] and zeroes it. Only the gate reads it, so the lib |
| 3835 | +/// build would warn `dead_code` (class from lane-txset2's `coeff_bits`). | ||
| 3836 | +#[cfg(test)] | ||
| 3835 | pub(crate) fn take_txrd_stats() -> [u64; 7] { | 3837 | pub(crate) fn take_txrd_stats() -> [u64; 7] { |
| 3836 | std::array::from_fn(|i| TXRD_STATS[i].swap(0, std::sync::atomic::Ordering::Relaxed)) | 3838 | std::array::from_fn(|i| TXRD_STATS[i].swap(0, std::sync::atomic::Ordering::Relaxed)) |
| 3837 | } | 3839 | } |
lanes/txrd.report.mdmodified+52 -0
| @@ -73,3 +73,55 @@ always `DCT_DCT` in this encoder. | |||
| 73 | ## Gates | 73 | ## Gates |
| 74 | 74 | ||
| 75 | See the table appended below; the arms are running at the time of writing. | 75 | See the table appended below; the arms are running at the time of writing. |
| 76 | + | ||
| 77 | +### The 12-frame native gate (`bd_rate_screen_native`, 12 frames, gop 12) | ||
| 78 | + | ||
| 79 | +BD-rate vs libaom `cpu-used 6` / rav1e `speed 6`; lower is better. | ||
| 80 | + | ||
| 81 | +| clip | control (pre-lane) | unconditional BEFORE the fix | unconditional AFTER the fix | shipped (screen-gated) AFTER | | ||
| 82 | +|---|---|---|---|---| | ||
| 83 | +| bars 1080p | -1.0% / -16.8% | +23.1% / +3.3% | **-0.6% / -16.2%** | -1.0% / -16.8% | | ||
| 84 | +| bars 2160p | +9.4% / -12.7% | +31.2% / +3.7% | **+10.3% / -11.7%** | +9.4% / -12.7% | | ||
| 85 | +| film A | +21.7% / -4.4% | +21.5% / -4.5% | +21.6% / -4.5% | +21.7% / -4.4% | | ||
| 86 | +| film B | +26.9% / -0.6% | +27.2% / -0.3% | +27.2% / -0.3% | +26.9% / -0.6% | | ||
| 87 | +| screen capture | +20.1% / -30.4% (shipped) | +20.1% / -30.4% | +19.8% / -30.5% | **+19.8% / -30.5%** | | ||
| 88 | + | ||
| 89 | +The twenty-point collapse is GONE: the two bars rows come back to within | ||
| 90 | +0.4/0.6 and 0.9/1.0 of the control instead of 24/20 points off it. | ||
| 91 | + | ||
| 92 | +DECISION: the unconditional arm still does NOT pass the keep rule (bars | ||
| 93 | +1080p 0.4/0.6 down, bars 2160p 0.9/1.0 down, film B 0.3/0.3 down -- the | ||
| 94 | +charter's bound was 0.3), so the inter search STAYS screen-gated and the | ||
| 95 | +default is unchanged on every non-screen row: the four non-screen rows print | ||
| 96 | +the control's own byte counts to the digit (194497/299067/419042/567789, | ||
| 97 | +205409/321883/435765/564573, 64392/102508/170169/413430, | ||
| 98 | +27442/50374/105485/296813). What the fix does change is the row the search | ||
| 99 | +already ships on: the screen capture goes +20.1/-30.4 -> **+19.8/-30.5**, | ||
| 100 | +i.e. the shipped screen-gated search was carrying this defect and is 0.3 | ||
| 101 | +better against libaom with it repaired. | ||
| 102 | + | ||
| 103 | +What is left on the bars rows is now the real `local-rd-on-references` | ||
| 104 | +residue, not a correctness bug -- a whole order of magnitude smaller than | ||
| 105 | +what was attributed to the price. | ||
| 106 | + | ||
| 107 | +### Invariants | ||
| 108 | + | ||
| 109 | +* `cargo test -p ec-av1 --release --lib` (detached): **569 passed, 0 failed, | ||
| 110 | + 46 ignored** (45 + this lane's `txrd_gain_probe` measurement). | ||
| 111 | +* `cargo check --workspace --all-targets -j4`: 0 errors, 0 ec-av1 warnings. | ||
| 112 | +* The BD gate itself asserts, at all four quantizers of all five rows, that | ||
| 113 | + ffmpeg's decode AND our decoder's both equal the encoder's reconstruction | ||
| 114 | + sample for sample -- three-way exact under the fix, in both arms. | ||
| 115 | + | ||
| 116 | +### Instruments this lane leaves | ||
| 117 | + | ||
| 118 | +* `EC_AV1_TXRD_LAMBDA=<f>` -- rate weight of the transform-TYPE decision | ||
| 119 | + only (`0` = compare types on reconstruction error alone). | ||
| 120 | +* `EC_AV1_TXRD_CENSUS=1` -- chosen vs `DCT_DCT` summed sse/bits over the flat | ||
| 121 | + inter luma decisions, printed by the gate. | ||
| 122 | +* `EC_AV1_FRAME_PSNR=1` -- per-frame all-plane AND per-plane (Y/U/V) PSNR per | ||
| 123 | + ladder point, plus `EC_PREFILTER`/`EC_POSTFILTER` frame luma SSE around | ||
| 124 | + `pick_and_apply_filters`, which is what separates a bad trial from a bad | ||
| 125 | + filter choice. | ||
| 126 | +* `transform::tests::txrd_gain_probe` (`--ignored`) -- the measured | ||
| 127 | + forward-inverse gain per type and size. | ||