From d106c89c17b2170cf9ff035b946eed07255ea6c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 9 Sep 2026 17:27:49 +0300 Subject: [PATCH] feat(av1): the 128 root offers PARTITION_HORZ and PARTITION_VERT search_root_128_rect prices the root as two 128x64 / 64x128 skip blocks -- single reference or compound, the shipped NONE machinery halved. The first half is published into the mi grid before the second is searched (the writer publishes it too), and the grid is put back for the four-superblock arm; the NONE / HORZ / VERT candidates are ranked together against the split. search_skip_64 now takes a (w, h) footprint and tiles it into squares of its shorter side, which is byte-identical at w == h. Census extended with the HORZ/VERT counts. Witness green on the first draft: 2640 forced 128x64 and 2640 forced 64x128 halves sample-exact through decode_stream and ffmpeg, with 17 HORZ + 9 VERT unforced over 12 frames. Pin q=150 8290 -> 8291; the q=60 pin does not move; EC_AV1_B128HV=0 restores both. --- crates/ec-av1/src/encode.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/ec-av1/src/encode.rs b/crates/ec-av1/src/encode.rs index 481e6875..612dfcc9 100644 --- a/crates/ec-av1/src/encode.rs +++ b/crates/ec-av1/src/encode.rs @@ -18360,7 +18360,13 @@ mod tests { // 33017 at q=60 (the same LENGTH, different bytes). // Re-taken at the merge of lane-arftf (ARF filter strength 2) and // lane-rlclamp onto the 128 compound default. - let pins: [(u8, usize, u64); 2] = [(150, 8290, 0x92cb11033d1f5813), (60, 33227, 0x57ee6b1f8eacd881)]; + // Re-taken on lane-b128hv: the 128 root now also offers PARTITION_HORZ + // and PARTITION_VERT ([`b128_rect`]), two 128x64 / 64x128 skip blocks, + // so every inter frame whose RD takes one codes a different partition + // -- 8290 -> 8291 bytes at q=150. The q=60 pin does NOT move: at that + // quantizer the rect cut never wins its own comparison on this clip. + // `EC_AV1_B128HV=0` restores 8290 exactly. + let pins: [(u8, usize, u64); 2] = [(150, 8291, 0x1f00bb0eb099a27f), (60, 33227, 0x57ee6b1f8eacd881)]; let coded: Vec<(u8, usize, u64)> = pins .iter() .map(|&(q, _, _)| {