forge
Explore
Log in

Don't you dare go Hollow

The 64x64 root ships at every speed preset

Browse files at this commit

7b4f91d155e0c9b999bb3cc8ca2fe376e67b20b5Ahmet Kaan GümüşParent: af02836
  • feat
    • the 64x64 root ships at every speed preset
    • re-pin
Show full message
feat(av1): the 64x64 root ships at every speed preset; re-pin

With the early-out clamped at 0.125 the preset-6 regression lane-b64
measured is gone -- every row of the native gate is better on both
columns with the root on (film A +55.1/+24.8 -> +51.0/+21.7, film B
+91.5/+53.4 -> +77.9/+44.3, screen +57.7/-11.7 -> +40.3/-20.0, bars
+88.9/+54.8 -> +79.5/+47.2 and +91.6/+49.8 -> +72.6/+35.1) at 28.1s vs
30.8s, 31.3s vs 28.0s, 14.3s vs 15.2s.

Pins re-taken for the residual arm, ON THIS LANE'S BASE (456295e9, whose
pins are 7291/27466 -- main has since moved to 8446/28548 under the
8:-32:16 pyramid, and those get re-taken at merge): 7291 -> 7355 at
q=150, 27466 -> 27573 at q=60. EC_AV1_B64=0 still gives lane-b64's
pre-root 8076 / 27585, verified on this base.

Also drops the stale claim in B64_ROOT's doc that transform.rs has no
forward TX_64X64.
crates/ec-av1/src/encode.rsmodified+17 -5
@@ -386,10 +386,16 @@ fn split_inter_blocks() -> bool {
386 /// 32x32 or smaller, which put our mode+mv+partition+tx_size spend at 162,669386 /// 32x32 or smaller, which put our mode+mv+partition+tx_size spend at 162,669
387 /// bits against rav1e's 61,988, about 46% of the film B gap.387 /// bits against rav1e's 61,988, about 46% of the film B gap.
388 ///388 ///
389-/// SKIP-only: a 64x64 residual needs a forward TX_64X64 the encoder does not389+/// lane-tx64: no longer skip-only. The root also prices a REAL residual --
390-/// have (`transform.rs` tops out at 32x32), and the writer refuses any other390+/// one TX_64X64 luma transform (`transform.rs`'s forward network has always
391-/// shape (`crate::tile::Quadrant::Whole64`). Switched off by `EC_AV1_B64=0`391+/// reached 64 points; what was missing was the block coder and the writer
392-/// in any build.392+/// around it) and one TX_32X32 per chroma plane -- see [`b64_residual`],
393+/// which carries that arm's own gate table. Still refused at the 64 root:
394+/// compound references, a depth-1 4x32x32 var-tx tree, intra, and a
395+/// superblock the true frame edge cuts through.
396+///
397+/// Switched off by `EC_AV1_B64=0` in any build; `EC_AV1_B64RES=0` keeps the
398+/// root and restores the skip-only shape lane-b64 shipped.
393 pub(crate) const B64_ROOT: bool = true;399 pub(crate) const B64_ROOT: bool = true;
394 400
395 /// How many superblocks took the 64x64 root since the last401 /// How many superblocks took the 64x64 root since the last
@@ -13495,8 +13501,14 @@ mod tests {
13495 // one mode/mv chain and no residual where four quadrants used to --13501 // one mode/mv chain and no residual where four quadrants used to --
13496 // 8076 -> 7291 at q=150 and 27585 -> 27466 at q=60. `EC_AV1_B64=0`13502 // 8076 -> 7291 at q=150 and 27585 -> 27466 at q=60. `EC_AV1_B64=0`
13497 // restores these.13503 // restores these.
13504+ // Re-taken on lane-tx64: that 64x64 root can code a REAL residual now
13505+ // (one TX_64X64 luma transform and two TX_32X32 chroma ones), so a
13506+ // superblock whose skip arm was too coarse codes coefficients where
13507+ // it used to fall back to four quadrants -- 7291 -> 7355 at q=150 and
13508+ // 27466 -> 27573 at q=60. `EC_AV1_B64RES=0` restores these;
13509+ // `EC_AV1_B64=0` still gives lane-b64's own pre-root 8076 / 27585.
13498 let pins: [(u8, usize, u64); 2] =13510 let pins: [(u8, usize, u64); 2] =
13499- [(150, 7291, 0xa411_97e8_8a80_2a1b), (60, 27466, 0xdc87_26a3_c625_46ce)];13511+ [(150, 7355, 0xd074_3dc7_a231_8a20), (60, 27573, 0xd9fb_3c84_57cc_b86f)];
13500 for (q, bytes, hash) in pins {13512 for (q, bytes, hash) in pins {
13501 let encoded = encode_sequence(&source, q, 0.5).unwrap();13513 let encoded = encode_sequence(&source, q, 0.5).unwrap();
13502 assert_eq!(13514 assert_eq!(
crates/ec-av1/src/speed.rsmodified+19 -21
@@ -149,27 +149,25 @@ pub(crate) fn at<T: Copy>(table: &[T; 11]) -> T {
149 /// film B +70.5/+35.2 -> +64.7/+34.0, screen +48.2/-16.4 -> +33.4/-23.8) at149 /// film B +70.5/+35.2 -> +64.7/+34.0, screen +48.2/-16.4 -> +33.4/-23.8) at
150 /// -4% to -20% wall on four of the five rows.150 /// -4% to -20% wall on four of the five rows.
151 ///151 ///
152-/// MEASURED OFF from preset 4 up (lane-b64, native gate at `EC_AV1_SPEED=6`,152+/// lane-b64 MEASURED it off from preset 4 up: at `EC_AV1_SPEED=6` ON cost
153-/// two arms side by side): ON costs film A +55.1/+24.8 -> +64.5/+37.5 and153+/// film A +55.1/+24.8 -> +64.5/+37.5 and film B +91.5/+53.4 -> +114.6/+71.5.
154-/// film B +91.5/+53.4 -> +114.6/+71.5 for -16%/-36% wall. The cause is the154+/// The cause was named there and FIXED in lane-tx64: the trial's early-out
155-/// trial's own early-out, which rides [`SPLIT_RD`]: at 0.5 (preset 6) a155+/// rode [`SPLIT_RD`], so at 0.5 (preset 6) a superblock was taken whole with
156-/// superblock is taken whole without its quadrants ever being searched, and156+/// its quadrants never searched. `encode::b64_breakout_threshold` clamps that
157-/// film B's q150 point loses 1.2 dB. Presets 1..=3 keep it because they keep157+/// early-out at the shipped 0.125 whatever the preset, and the same gate at
158-/// `SPLIT_RD` at 0.125, i.e. the early-out they get is the measured one;158+/// `EC_AV1_SPEED=6` now reads, every row better on both columns:
159-/// 4 and up switch it off with `SPLIT_RD`'s first step.159+///
160-pub(crate) const B64_ROOT: [bool; 11] = [160+/// | row | B64 off | B64 on, clamped |
161- crate::encode::B64_ROOT,161+/// |---|---|---|
162- true,162+/// | bars 1080p | +88.9 / +54.8 | +79.5 / +47.2 |
163- true,163+/// | bars 2160p | +91.6 / +49.8 | +72.6 / +35.1 |
164- true,164+/// | film A | +55.1 / +24.8 | +51.0 / +21.7 |
165- false,165+/// | film B | +91.5 / +53.4 | +77.9 / +44.3 |
166- false,166+/// | screen | +57.7 / -11.7 | +40.3 / -20.0 |
167- false,167+///
168- false,168+/// at 28.1s vs 30.8s (film A), 31.3s vs 28.0s (film B), 14.3s vs 15.2s
169- false,169+/// (screen). So it is on at every preset.
170- false,170+pub(crate) const B64_ROOT: [bool; 11] = [crate::encode::B64_ROOT; 11];
171- false,
172-];
173 171
174 /// `encode::SPLIT_RD_THRESHOLD`: how cheap a block has to be before its split172 /// `encode::SPLIT_RD_THRESHOLD`: how cheap a block has to be before its split
175 /// trial is withheld. The single biggest wall lever in the tile search.173 /// trial is withheld. The single biggest wall lever in the tile search.