forge
Explore
Log in

Don't you dare go Hollow

Merge branch 'lane-b64b' (6f53db9b): the 64x64 root prices compound references and depth-1 var-tx, and edge superblocks score only the inside

Browse files at this commit

e08e2e63cf38aa6f5a6939b0643fd30f51357f2aAhmet Kaan GümüşParent: e7e40c6ab431b5
12-frame film A +37.5/+7.6 -> +35.4/+5.4, film B +54.1/+23.9 ->
+47.6/+17.0 (compound off on screen); long-GOP at the lane's base film A
+39.2/+1.3, film B +118.5/+25.1. Pins re-taken on the merged tree.
crates/ec-av1/src/encode.rsmodified+467 -34
@@ -487,6 +487,82 @@ pub fn take_b64_residual_hits() -> usize {
487 B64_RESIDUAL_HITS.swap(0, std::sync::atomic::Ordering::Relaxed)487 B64_RESIDUAL_HITS.swap(0, std::sync::atomic::Ordering::Relaxed)
488 }488 }
489 489
490+/// Whether the 64x64 root also prices COMPOUND candidates (lane-b64b): the
491+/// `LAST` + extra-reference pairs the 32x32 level already offers, at the
492+/// three modes a root can form without a second 64x64 motion search --
493+/// `NEAREST_NEARESTMV`, `GLOBAL_GLOBALMV` and `NEW_NEARESTMV` (whose NEW half
494+/// is the vector `search_skip_64`'s own single-reference search already
495+/// found). `NEAREST_NEWMV`/`NEW_NEWMV` need the SECOND reference's own
496+/// `NEWMV` vector, which only a second search per superblock produces -- the
497+/// wall this root exists to save -- so they are not offered here.
498+///
499+/// Off by `EC_AV1_B64COMP=0`, so both arms measure on one build.
500+fn b64_compound() -> bool {
501+ static ENV: std::sync::LazyLock<Option<bool>> = std::sync::LazyLock::new(|| {
502+ crate::envflags::var("EC_AV1_B64COMP").ok().map(|v| v != "0")
503+ });
504+ ENV.unwrap_or(true) && b64_root()
505+}
506+
507+/// How many 64x64 roots took a COMPOUND candidate since the last
508+/// [`take_b64_compound_hits`] (class `gate-blind-to-feature`).
509+static B64_COMPOUND_HITS: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
510+
511+/// The compound 64x64-root count since the last call, and zero it.
512+pub fn take_b64_compound_hits() -> usize {
513+ B64_COMPOUND_HITS.swap(0, std::sync::atomic::Ordering::Relaxed)
514+}
515+
516+/// Whether a 64x64 root that codes a residual may SPLIT its luma transform
517+/// (lane-b64b): four TX_32X32 units instead of the one TX_64X64, decided by
518+/// [`commit_inter_luma`] like every other inter block's var-tx, and coded by
519+/// the writer's `Whole64` arm as `txfm_split = 1`. It exists because
520+/// TX_64X64 zeroes everything outside its 32x32 corner, so a root whose
521+/// residual has detail in the other three quadrants cannot code it at all.
522+///
523+/// Off by `EC_AV1_B64VARTX=0`.
524+fn b64_var_tx() -> bool {
525+ static ENV: std::sync::LazyLock<Option<bool>> = std::sync::LazyLock::new(|| {
526+ crate::envflags::var("EC_AV1_B64VARTX").ok().map(|v| v != "0")
527+ });
528+ ENV.unwrap_or(true) && b64_root()
529+}
530+
531+/// How many 64x64 roots split their luma transform since the last
532+/// [`take_b64_var_tx_hits`].
533+static B64_VAR_TX_HITS: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
534+
535+/// The split-luma 64x64-root count since the last call, and zero it.
536+pub fn take_b64_var_tx_hits() -> usize {
537+ B64_VAR_TX_HITS.swap(0, std::sync::atomic::Ordering::Relaxed)
538+}
539+
540+/// Whether a superblock the true frame edge CUTS THROUGH may be left whole
541+/// (lane-b64b). AV1 asks only that the block's own half is inside
542+/// (`has_cols`/`has_rows`, spec `decode_partition`), and the writer already
543+/// codes that case; what was missing was a trial whose SSE is scored over the
544+/// INSIDE part alone ([`inside_sse`]) instead of over the padding the encoder
545+/// invented past the edge. Both gate films are superblock-aligned, so this
546+/// only reaches the user's own arbitrary export sizes.
547+///
548+/// Off by `EC_AV1_B64EDGE=0`.
549+fn b64_edge() -> bool {
550+ static ENV: std::sync::LazyLock<Option<bool>> = std::sync::LazyLock::new(|| {
551+ crate::envflags::var("EC_AV1_B64EDGE").ok().map(|v| v != "0")
552+ });
553+ ENV.unwrap_or(true) && b64_root()
554+}
555+
556+/// How many 64x64 roots the frame edge cut through since the last
557+/// [`take_b64_edge_hits`] (class `gate-blind-to-feature`: both gate films are
558+/// superblock-aligned, so nothing but a synthetic size fires this).
559+static B64_EDGE_HITS: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
560+
561+/// The edge 64x64-root count since the last call, and zero it.
562+pub fn take_b64_edge_hits() -> usize {
563+ B64_EDGE_HITS.swap(0, std::sync::atomic::Ordering::Relaxed)
564+}
565+
490 /// Whether the encoder searches loop restoration at all (spec 7.17): one566 /// Whether the encoder searches loop restoration at all (spec 7.17): one
491 /// Wiener filter per 64x64 luma restoration unit, picked from567 /// Wiener filter per 64x64 luma restoration unit, picked from
492 /// [`crate::filter_search::WIENER_CANDIDATES`]. Swept by `EC_AV1_LR` in a568 /// [`crate::filter_search::WIENER_CANDIDATES`]. Swept by `EC_AV1_LR` in a
@@ -3406,7 +3482,7 @@ fn commit_inter_luma(
3406 && !skip3482 && !skip
3407 && side >= 163483 && side >= 16
3408 && (second.is_none() || compound_var_tx())3484 && (second.is_none() || compound_var_tx())
3409- && (side < BLOCK || tx32_depth_search())3485+ && (side != BLOCK || tx32_depth_search())
3410 && x + side <= luma.true_width3486 && x + side <= luma.true_width
3411 && y + side <= luma.true_height;3487 && y + side <= luma.true_height;
3412 if !eligible {3488 if !eligible {
@@ -3414,7 +3490,14 @@ fn commit_inter_luma(
3414 return (flat.levels.clone(), 0, 0.0);3490 return (flat.levels.clone(), 0, 0.0);
3415 }3491 }
3416 let tx = side / 2;3492 let tx = side / 2;
3417- let set = if tx >= 16 { TxbSet::Luma16Inter } else { TxbSet::Luma8Inter };3493+ let set = if tx >= 32 {
3494+ // lane-b64b: the 64x64 root's halved transform is TX_32X32.
3495+ TxbSet::Luma32Inter
3496+ } else if tx >= 16 {
3497+ TxbSet::Luma16Inter
3498+ } else {
3499+ TxbSet::Luma8Inter
3500+ };
3418 let mut levels = vec![0i32; side * side];3501 let mut levels = vec![0i32; side * side];
3419 let (mut sse, mut bits) = (0.0, 0.0);3502 let (mut sse, mut bits) = (0.0, 0.0);
3420 let mut units = Vec::with_capacity(4);3503 let mut units = Vec::with_capacity(4);
@@ -3448,14 +3531,22 @@ fn commit_inter_luma(
3448 let split_cost = sse + search.lambda * (bits + txfm_split_bits(side, 1));3531 let split_cost = sse + search.lambda * (bits + txfm_split_bits(side, 1));
3449 let flat_cost = flat.sse + search.lambda * (flat.bits + txfm_split_bits(side, 0));3532 let flat_cost = flat.sse + search.lambda * (flat.bits + txfm_split_bits(side, 0));
3450 let class = usize::from(side == BLOCK) * 4 + usize::from(second.is_some()) * 2;3533 let class = usize::from(side == BLOCK) * 4 + usize::from(second.is_some()) * 2;
3534+ // The depth census has a leaf row and a 32x32 row and no 64 one, so the
3535+ // 64x64 root counts itself ([`take_b64_var_tx_hits`]) instead of landing
3536+ // in the leaf row (class `gate-blind-to-feature`).
3537+ let counted = side <= BLOCK;
3451 if split_cost < flat_cost {3538 if split_cost < flat_cost {
3452 for (tu_x, tu_y, trial) in &units {3539 for (tu_x, tu_y, trial) in &units {
3453 luma.commit(*tu_x, *tu_y, tx, trial);3540 luma.commit(*tu_x, *tu_y, tx, trial);
3454 }3541 }
3455- INTER_TX_SPLIT_HITS[class + 1].fetch_add(1, std::sync::atomic::Ordering::Relaxed);3542+ if counted {
3543+ INTER_TX_SPLIT_HITS[class + 1].fetch_add(1, std::sync::atomic::Ordering::Relaxed);
3544+ }
3456 return (levels, 1, split_cost - flat_cost);3545 return (levels, 1, split_cost - flat_cost);
3457 }3546 }
3458- INTER_TX_SPLIT_HITS[class].fetch_add(1, std::sync::atomic::Ordering::Relaxed);3547+ if counted {
3548+ INTER_TX_SPLIT_HITS[class].fetch_add(1, std::sync::atomic::Ordering::Relaxed);
3549+ }
3459 luma.commit(x, y, side, flat);3550 luma.commit(x, y, side, flat);
3460 (flat.levels.clone(), 0, 0.0)3551 (flat.levels.clone(), 0, 0.0)
3461 }3552 }
@@ -5937,6 +6028,46 @@ where
5937 /// of the frame's reconstruction because a tile's prediction never reads a6028 /// of the frame's reconstruction because a tile's prediction never reads a
5938 /// sample outside its own rectangle, and every sample inside it is written6029 /// sample outside its own rectangle, and every sample inside it is written
5939 /// before it is read.6030 /// before it is read.
6031+/// [`Plane::block_sse`] over the part of a block that is INSIDE the true
6032+/// frame. A block the edge cuts through is still coded whole -- the decoder
6033+/// reconstructs its outside samples too and the display crop throws them away
6034+/// -- so scoring them would rank a 64x64 root by how well it predicts padding
6035+/// the source does not have (lane-b64b).
6036+fn inside_sse(plane: &Plane, x: usize, y: usize, side: usize, reconstruction: &[u8]) -> f64 {
6037+ let rows = side.min(plane.true_height.saturating_sub(y));
6038+ let cols = side.min(plane.true_width.saturating_sub(x));
6039+ let mut sse = 0u64;
6040+ for row in 0..rows {
6041+ let source = &plane.source[(y + row) * plane.width + x..][..cols];
6042+ for (col, &s) in source.iter().enumerate() {
6043+ let d = u32::from(s.abs_diff(reconstruction[row * side + col]));
6044+ sse += u64::from(d * d);
6045+ }
6046+ }
6047+ sse as f64
6048+}
6049+
6050+/// Rescores one 64x64 root trial set (luma and the two chroma planes) over
6051+/// the inside part of a superblock the frame edge cuts through.
6052+fn clip_sb64_sse(
6053+ trials: &mut [Trial; 3],
6054+ luma: &Plane,
6055+ chroma: &[Plane; 2],
6056+ (x, y): (usize, usize),
6057+ side: usize,
6058+) {
6059+ trials[0].sse = inside_sse(luma, x, y, side, &trials[0].reconstruction);
6060+ for plane in 0..2 {
6061+ trials[plane + 1].sse = inside_sse(
6062+ &chroma[plane],
6063+ x / 2,
6064+ y / 2,
6065+ side / 2,
6066+ &trials[plane + 1].reconstruction,
6067+ );
6068+ }
6069+}
6070+
5940 fn fresh_plane(source: &[u8], width: usize, height: usize, true_width: usize, true_height: usize) -> Plane<'_> {6071 fn fresh_plane(source: &[u8], width: usize, height: usize, true_width: usize, true_height: usize) -> Plane<'_> {
5941 Plane {6072 Plane {
5942 source,6073 source,
@@ -7328,6 +7459,42 @@ fn predict_u8(
7328 prediction.iter().map(|&v| v as u8).collect()7459 prediction.iter().map(|&v| v as u8).collect()
7329 }7460 }
7330 7461
7462+/// [`predict_u8`]'s compound counterpart, on the heap because a 64x64 root's
7463+/// side is twice what [`mc_trial_compound`]'s fixed trial buffers hold: both
7464+/// references predict into the `CONV_BUF` intermediate domain and are blended
7465+/// at the simple-average split `(8, 8)`, the same path (and so the same
7466+/// samples) a `comp_group_idx == 0`, `compound_idx == 1` decoder computes.
7467+fn predict_compound_u8(
7468+ ref0: (&[u16], usize, usize, usize),
7469+ ref1: (&[u16], usize, usize, usize),
7470+ (x, y): (usize, usize),
7471+ side: usize,
7472+ (mv0, mv1): ((i32, i32), (i32, i32)),
7473+ luma: bool,
7474+ fctx: &crate::decode::FrameCtx,
7475+) -> Vec<u8> {
7476+ let mut inter = [vec![0i32; side * side], vec![0i32; side * side]];
7477+ for ((mv, r), dst) in [(mv0, ref0), (mv1, ref1)].into_iter().zip(inter.iter_mut()) {
7478+ mc::predict_compound_intermediate(
7479+ r.0,
7480+ r.1,
7481+ r.2,
7482+ r.3,
7483+ mv_to_q4(x, mv.1, luma),
7484+ mv_to_q4(y, mv.0, luma),
7485+ mc::REF_NO_SCALE,
7486+ side,
7487+ side,
7488+ mc::InterpFilterKind::Regular,
7489+ mc::InterpFilterKind::Regular,
7490+ dst,
7491+ );
7492+ }
7493+ let mut blended = vec![0u16; side * side];
7494+ mc::combine_compound(&inter[0], &inter[1], 8, 8, &mut blended, fctx);
7495+ blended.iter().map(|&v| v as u8).collect()
7496+}
7497+
7331 /// The 64x64 `PARTITION_NONE` candidate for a whole superblock ([`B64_ROOT`]):7498 /// The 64x64 `PARTITION_NONE` candidate for a whole superblock ([`B64_ROOT`]):
7332 /// single-reference LAST at `NEARESTMV`/`GLOBALMV`/`NEARMV`/`NEWMV`, coded7499 /// single-reference LAST at `NEARESTMV`/`GLOBALMV`/`NEARMV`/`NEWMV`, coded
7333 /// SKIP, priced through the same `symbol_bits` path every other candidate7500 /// SKIP, priced through the same `symbol_bits` path every other candidate
@@ -7348,6 +7515,10 @@ fn search_skip_64(
7348 residual: bool,7515 residual: bool,
7349 reference: &Picture,7516 reference: &Picture,
7350 stack: &MvStack,7517 stack: &MvStack,
7518+ // The COMPOUND stack of each `LAST` + extra-reference pair at THIS
7519+ // superblock's 16x16-mi window, built off the same grid the tile writer
7520+ // rebuilds it from (empty unless the frame carries `reference_select`).
7521+ compound: &[(i8, &Picture, crate::mvstack::CompoundMvStack)],
7351 fctx: &crate::decode::FrameCtx,7522 fctx: &crate::decode::FrameCtx,
7352 ) -> Option<(f64, BlockCoeffs)> {7523 ) -> Option<(f64, BlockCoeffs)> {
7353 let side = SUPERBLOCK;7524 let side = SUPERBLOCK;
@@ -7386,6 +7557,9 @@ fn search_skip_64(
7386 ));7557 ));
7387 }7558 }
7388 }7559 }
7560+ // `LAST`'s own `NEWMV` vector, kept for the compound `NEW_NEARESTMV`
7561+ // candidate below to pair with the second reference's NEAREST half.
7562+ let mut last_new_mv: Option<(i32, i32)> = None;
7389 if leaf_new_mv() {7563 if leaf_new_mv() {
7390 let source_block = luma.source_block(x, y, side);7564 let source_block = luma.source_block(x, y, side);
7391 let (seeds, seed_n) = mv_seeds(stack);7565 let (seeds, seed_n) = mv_seeds(stack);
@@ -7407,6 +7581,7 @@ fn search_skip_64(
7407 );7581 );
7408 let mv = round_to_valid_mv(found.mv, stack.pred_mv);7582 let mv = round_to_valid_mv(found.mv, stack.pred_mv);
7409 if let Some((bits, ref_mv_idx)) = best_new_mv_syntax(stack, mv) {7583 if let Some((bits, ref_mv_idx)) = best_new_mv_syntax(stack, mv) {
7584+ last_new_mv = Some(mv);
7410 cands.push((7585 cands.push((
7411 symbol_bits(&cdf::NEW_MV[stack.new_mv_ctx], 0) + bits,7586 symbol_bits(&cdf::NEW_MV[stack.new_mv_ctx], 0) + bits,
7412 info_of(InterMode::NewMv, mv, ref_mv_idx),7587 info_of(InterMode::NewMv, mv, ref_mv_idx),
@@ -7414,9 +7589,12 @@ fn search_skip_64(
7414 }7589 }
7415 }7590 }
7416 7591
7592+ // A superblock the true frame edge cuts through: every trial below is
7593+ // ranked over its inside part only ([`clip_sb64_sse`]).
7594+ let edge = x + side > luma.true_width || y + side > luma.true_height;
7417 let mut best: Option<(f64, f64, InterInfo, [Trial; 3])> = None;7595 let mut best: Option<(f64, f64, InterInfo, [Trial; 3])> = None;
7418 for (bits, info) in cands {7596 for (bits, info) in cands {
7419- let trials = [7597+ let mut trials = [
7420 (0usize, x, y, side, true),7598 (0usize, x, y, side, true),
7421 (1, x / 2, y / 2, side / 2, false),7599 (1, x / 2, y / 2, side / 2, false),
7422 (2, x / 2, y / 2, side / 2, false),7600 (2, x / 2, y / 2, side / 2, false),
@@ -7453,15 +7631,138 @@ fn search_skip_64(
7453 TxbSet::Luma32Inter,7631 TxbSet::Luma32Inter,
7454 )7632 )
7455 });7633 });
7634+ if edge {
7635+ clip_sb64_sse(&mut trials, luma, chroma, (x, y), side);
7636+ }
7456 let cost = trials[0].sse7637 let cost = trials[0].sse
7457 + trials[1].sse7638 + trials[1].sse
7458 + trials[2].sse7639 + trials[2].sse
7459 + search.lambda * (fixed + bits);7640 + search.lambda * (fixed + bits);
7460 if best.as_ref().is_none_or(|b| cost < b.0) {7641 if best.as_ref().is_none_or(|b| cost < b.0) {
7461- best = Some((cost, bits, info, trials));7642+ best = Some((cost, fixed + bits, info, trials));
7462 }7643 }
7463 }7644 }
7464- let (skip_cost, bits, info, skip_trials) = best?;7645+
7646+ // lane-b64b: the COMPOUND candidates at the 64 root, the same three a
7647+ // superblock can form without a second motion search ([`b64_compound`]),
7648+ // priced through the same `symbol_bits` path -- `fixed` minus the single
7649+ // reference's tree, plus the pair tree and the compound mode.
7650+ for (ref1, g, cstack) in compound.iter().filter(|_| b64_compound()) {
7651+ let (ref1, g) = (*ref1, *g);
7652+ let uni = (crate::mvstack::BWDREF_FRAME..=crate::mvstack::ALTREF_FRAME).contains(&ref1);
7653+ let pair_bits = symbol_bits(&cdf::COMP_MODE[0], 1)
7654+ + if uni {
7655+ symbol_bits(&cdf::COMP_REF_TYPE[0], 1)
7656+ + symbol_bits(&cdf::COMP_REF[0][0], 0)
7657+ + symbol_bits(&cdf::COMP_REF[0][1], 0)
7658+ + symbol_bits(&cdf::COMP_BWDREF[0][0], 1)
7659+ } else {
7660+ symbol_bits(&cdf::COMP_REF_TYPE[0], 0)
7661+ + symbol_bits(&cdf::UNI_COMP_REF[0][0], 0)
7662+ + symbol_bits(&cdf::UNI_COMP_REF[0][1], 1)
7663+ + symbol_bits(&cdf::UNI_COMP_REF[0][2], 1)
7664+ };
7665+ let mode_ctx =
7666+ cdf::COMPOUND_MODE_CTX_MAP[cstack.ref_mv_ctx >> 1][cstack.new_mv_ctx.min(4)];
7667+ let mode_bits_of =
7668+ |mode: usize| pair_bits + symbol_bits(&cdf::INTER_COMPOUND_MODE[mode_ctx], mode);
7669+ let compound_info = |mode: InterMode, mvs: ((i32, i32), (i32, i32))| InterInfo {
7670+ ref1: Some(ref1),
7671+ mv1: mvs.1,
7672+ ref_frame: crate::mvstack::LAST_FRAME,
7673+ mode,
7674+ mv: mvs.0,
7675+ ref_mv_idx: 0,
7676+ };
7677+ let mut ccands: Vec<(((i32, i32), (i32, i32)), f64, InterInfo)> = vec![
7678+ (
7679+ cstack.nearest_mv,
7680+ mode_bits_of(0),
7681+ compound_info(InterMode::NearestNearestMv, cstack.nearest_mv),
7682+ ),
7683+ (
7684+ ((0, 0), (0, 0)),
7685+ mode_bits_of(6),
7686+ compound_info(InterMode::GlobalGlobalMv, ((0, 0), (0, 0))),
7687+ ),
7688+ ];
7689+ // `NEW_NEARESTMV`: the NEW half is `LAST`'s vector from the search
7690+ // above, its residual priced against compound stack entry 0 -- what
7691+ // `assign_compound_mv` predicts from at `ref_mv_idx = 0`.
7692+ let cbase = cstack
7693+ .entries
7694+ .first()
7695+ .map_or(cstack.nearest_mv, |e| (e.mv0, e.mv1));
7696+ if let Some(new_mv) = last_new_mv
7697+ && let Some(b0) = mv_residual_bits(new_mv, cbase.0)
7698+ {
7699+ let mvs = (new_mv, cstack.nearest_mv.1);
7700+ ccands.push((
7701+ mvs,
7702+ mode_bits_of(3) + b0,
7703+ compound_info(InterMode::NewNearestMv, mvs),
7704+ ));
7705+ }
7706+ ccands.sort_by(|a, b| a.0.cmp(&b.0).then(a.1.total_cmp(&b.1)));
7707+ ccands.dedup_by_key(|c| c.0);
7708+ for (mvs, bits, info) in ccands {
7709+ let mut trials = [
7710+ (0usize, x, y, side, true),
7711+ (1, x / 2, y / 2, side / 2, false),
7712+ (2, x / 2, y / 2, side / 2, false),
7713+ ]
7714+ .map(|(plane, px, py, s, is_luma)| {
7715+ let (r0, r1) = match plane {
7716+ 0 => (
7717+ (reference.y.as_slice(), reference.width, luma.true_width, luma.true_height),
7718+ (g.y.as_slice(), g.width, luma.true_width, luma.true_height),
7719+ ),
7720+ 1 => (
7721+ (
7722+ reference.u.as_slice(),
7723+ reference.width / 2,
7724+ chroma[0].true_width,
7725+ chroma[0].true_height,
7726+ ),
7727+ (g.u.as_slice(), g.width / 2, chroma[0].true_width, chroma[0].true_height),
7728+ ),
7729+ _ => (
7730+ (
7731+ reference.v.as_slice(),
7732+ reference.width / 2,
7733+ chroma[1].true_width,
7734+ chroma[1].true_height,
7735+ ),
7736+ (g.v.as_slice(), g.width / 2, chroma[1].true_width, chroma[1].true_height),
7737+ ),
7738+ };
7739+ let prediction =
7740+ predict_compound_u8(r0, r1, (px, py), s, mvs, is_luma, fctx);
7741+ let target: &Plane = if plane == 0 { luma } else { &chroma[plane - 1] };
7742+ target.code_from_prediction(
7743+ px,
7744+ py,
7745+ s,
7746+ &prediction,
7747+ true,
7748+ search.base_q_idx,
7749+ search.deadzone,
7750+ TxbSet::Luma32Inter,
7751+ )
7752+ });
7753+ if edge {
7754+ clip_sb64_sse(&mut trials, luma, chroma, (x, y), side);
7755+ }
7756+ let syntax = fixed - ref_bits + bits;
7757+ let cost =
7758+ trials[0].sse + trials[1].sse + trials[2].sse + search.lambda * syntax;
7759+ if best.as_ref().is_none_or(|b| cost < b.0) {
7760+ best = Some((cost, syntax, info, trials));
7761+ }
7762+ }
7763+ }
7764+
7765+ let (skip_cost, syntax, info, skip_trials) = best?;
7465 7766
7466 // The winner's prediction coded with a REAL residual (lane-tx64): one7767 // The winner's prediction coded with a REAL residual (lane-tx64): one
7467 // TX_64X64 luma transform -- `TxbSet::Luma64`, whose coded quarter is the7768 // TX_64X64 luma transform -- `TxbSet::Luma64`, whose coded quarter is the
@@ -7475,9 +7776,16 @@ fn search_skip_64(
7475 // two numbers are comparable: `fixed` charged `skip` coded 1, and this7776 // two numbers are comparable: `fixed` charged `skip` coded 1, and this
7476 // arm charges 0 instead and adds its three planes' coefficient bits.7777 // arm charges 0 instead and adds its three planes' coefficient bits.
7477 let mut chosen = (skip_cost, true, skip_trials);7778 let mut chosen = (skip_cost, true, skip_trials);
7779+ // Set when [`commit_inter_luma`] already wrote the residual arm's luma
7780+ // into the plane, so the tail below does not commit over its units.
7781+ let mut luma_committed = false;
7782+ // The residual arm's luma levels and the `txfm_split` depth the writer
7783+ // codes: depth 0 is the TX_64X64 corner in 32x32 coordinates, depth 1 is
7784+ // four TX_32X32 units in 64x64 ones.
7785+ let mut luma_levels: Option<(Vec<i32>, u8)> = None;
7478 if residual {7786 if residual {
7479 let sets = [TxbSet::Luma64, TxbSet::Chroma32, TxbSet::Chroma32];7787 let sets = [TxbSet::Luma64, TxbSet::Chroma32, TxbSet::Chroma32];
7480- let residual_trials = [0usize, 1, 2].map(|plane| {7788+ let mut residual_trials = [0usize, 1, 2].map(|plane| {
7481 let (target, px, py, s) = if plane == 0 {7789 let (target, px, py, s) = if plane == 0 {
7482 (&*luma, x, y, side)7790 (&*luma, x, y, side)
7483 } else {7791 } else {
@@ -7494,18 +7802,59 @@ fn search_skip_64(
7494 sets[plane],7802 sets[plane],
7495 )7803 )
7496 });7804 });
7805+ if edge {
7806+ clip_sb64_sse(&mut residual_trials, luma, chroma, (x, y), side);
7807+ }
7497 let unskip = symbol_bits(&cdf::SKIP[0], 0) - symbol_bits(&cdf::SKIP[0], 1);7808 let unskip = symbol_bits(&cdf::SKIP[0], 0) - symbol_bits(&cdf::SKIP[0], 1);
7498 let coeff_bits: f64 = residual_trials.iter().map(|t| t.bits).sum();7809 let coeff_bits: f64 = residual_trials.iter().map(|t| t.bits).sum();
7810+ // lane-b64b: the root's own var-tx decision -- one TX_64X64 or the
7811+ // four TX_32X32 units of `txfm_split = 1`, taken by the same
7812+ // `commit_inter_luma` every other inter block's is (it commits the
7813+ // winner and hands back the cost it took off the flat arm).
7814+ let (levels, depth, gain) = if b64_var_tx() {
7815+ let second = info.ref1.and_then(|r1| {
7816+ compound.iter().find(|(r, _, _)| *r == r1).map(|&(_, g, _)| {
7817+ (
7818+ info.mv1,
7819+ (g.y.as_slice(), g.width, luma.true_width, luma.true_height),
7820+ )
7821+ })
7822+ });
7823+ luma_committed = true;
7824+ commit_inter_luma(
7825+ luma,
7826+ (x, y),
7827+ side,
7828+ info.mv,
7829+ (&reference.y, reference.width, luma.true_width, luma.true_height),
7830+ search,
7831+ &residual_trials[0],
7832+ false,
7833+ second,
7834+ fctx,
7835+ )
7836+ } else {
7837+ (residual_trials[0].levels.clone(), 0, 0.0)
7838+ };
7499 let cost = residual_trials.iter().map(|t| t.sse).sum::<f64>()7839 let cost = residual_trials.iter().map(|t| t.sse).sum::<f64>()
7500- + search.lambda * (fixed + bits + unskip + coeff_bits);7840+ + search.lambda * (syntax + unskip + coeff_bits)
7841+ + gain;
7501 if cost < skip_cost {7842 if cost < skip_cost {
7502 B64_RESIDUAL_HITS.fetch_add(1, std::sync::atomic::Ordering::Relaxed);7843 B64_RESIDUAL_HITS.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
7844+ if depth == 1 {
7845+ B64_VAR_TX_HITS.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
7846+ }
7847+ luma_levels = Some((levels, depth));
7503 chosen = (cost, false, residual_trials);7848 chosen = (cost, false, residual_trials);
7504 }7849 }
7505 }7850 }
7506 7851
7507 let (cost, skip, trials) = chosen;7852 let (cost, skip, trials) = chosen;
7508- luma.commit(x, y, side, &trials[0]);7853+ // `commit_inter_luma` already wrote the residual arm's luma (its four
7854+ // split units are not one 64-sided trial); a skip winner overwrites it.
7855+ if skip || !luma_committed {
7856+ luma.commit(x, y, side, &trials[0]);
7857+ }
7509 chroma[0].commit(x / 2, y / 2, side / 2, &trials[1]);7858 chroma[0].commit(x / 2, y / 2, side / 2, &trials[1]);
7510 chroma[1].commit(x / 2, y / 2, side / 2, &trials[2]);7859 chroma[1].commit(x / 2, y / 2, side / 2, &trials[2]);
7511 Some((7860 Some((
@@ -7513,9 +7862,16 @@ fn search_skip_64(
7513 BlockCoeffs {7862 BlockCoeffs {
7514 skip,7863 skip,
7515 inter: Some(info),7864 inter: Some(info),
7516- // Both grids are 32-sided: the luma one is the 64-point7865+ // The chroma grids are whole TX_32X32; the luma one is the
7517- // transform's coded corner, the chroma ones are whole TX_32X32.7866+ // 64-point transform's coded 32x32 corner at depth 0 and the
7518- luma: if skip { Vec::new() } else { coeffs(&trials[0].levels, BLOCK) },7867+ // whole 64-sided block at depth 1 (lane-b64b).
7868+ tx_depth: luma_levels.as_ref().map_or(0, |&(_, d)| d),
7869+ luma: match (skip, &luma_levels) {
7870+ (true, _) => Vec::new(),
7871+ (false, Some((levels, 1))) => coeffs(levels, SUPERBLOCK),
7872+ (false, Some((levels, _))) => coeffs(levels, BLOCK),
7873+ (false, None) => coeffs(&trials[0].levels, BLOCK),
7874+ },
7519 u: if skip { Vec::new() } else { coeffs(&trials[1].levels, side / 2) },7875 u: if skip { Vec::new() } else { coeffs(&trials[1].levels, side / 2) },
7520 v: if skip { Vec::new() } else { coeffs(&trials[2].levels, side / 2) },7876 v: if skip { Vec::new() } else { coeffs(&trials[2].levels, side / 2) },
7521 ..BlockCoeffs::default()7877 ..BlockCoeffs::default()
@@ -9173,19 +9529,30 @@ pub(crate) fn encode_inter_frame(
9173 // lane-b64: the whole superblock as ONE 64x64 block, tried before9529 // lane-b64: the whole superblock as ONE 64x64 block, tried before
9174 // its quadrants are (`search_skip_64`) and compared against the9530 // its quadrants are (`search_skip_64`) and compared against the
9175 // four of them below. Only a superblock wholly inside the true9531 // four of them below. Only a superblock wholly inside the true
9176- // frame is offered it: a 64x64 root whose right or bottom part9532+ // frame is offered it, and (lane-b64b, `EC_AV1_B64EDGE`) one the
9177- // hangs over the edge is legal AV1 (`has_cols`/`has_rows` only9533+ // edge CUTS THROUGH: the spec's own `has_cols`/`has_rows` ask
9178- // ask for half), but its trial would score prediction the frame9534+ // only that the block's half is inside, and the trial is ranked
9179- // does not have -- corner-cut, ceiling = the edge superblocks of9535+ // over the inside part alone ([`clip_sb64_sse`]).
9180- // a frame whose size is not a multiple of 64, which stay split.
9181 let (x64, y64) = (sb_c * SUPERBLOCK, sb_r * SUPERBLOCK);9536 let (x64, y64) = (sb_c * SUPERBLOCK, sb_r * SUPERBLOCK);
9182- let sb64_legal = b64_root()9537+ let whole_inside = (sb_c as u32 + 1) * crate::tile::SB_MI <= header.mi_cols
9183- && sb_r * 2 + 1 < rows
9184- && sb_c * 2 + 1 < cols
9185- && (sb_c as u32 + 1) * crate::tile::SB_MI <= header.mi_cols
9186 && (sb_r as u32 + 1) * crate::tile::SB_MI <= header.mi_rows9538 && (sb_r as u32 + 1) * crate::tile::SB_MI <= header.mi_rows
9187 && x64 + SUPERBLOCK <= luma.true_width9539 && x64 + SUPERBLOCK <= luma.true_width
9188 && y64 + SUPERBLOCK <= luma.true_height;9540 && y64 + SUPERBLOCK <= luma.true_height;
9541+ let edge_inside = b64_edge()
9542+ && crate::tile::has_half(
9543+ sb_c as u32 * crate::tile::SB_MI,
9544+ crate::tile::SB_MI,
9545+ header.mi_cols,
9546+ )
9547+ && crate::tile::has_half(
9548+ sb_r as u32 * crate::tile::SB_MI,
9549+ crate::tile::SB_MI,
9550+ header.mi_rows,
9551+ );
9552+ let sb64_legal = b64_root()
9553+ && sb_r * 2 + 1 < rows
9554+ && sb_c * 2 + 1 < cols
9555+ && (whole_inside || edge_inside);
9189 // One lambda for the whole superblock, the same mean the 32x329556 // One lambda for the whole superblock, the same mean the 32x32
9190 // level takes over its own four tpl cells: the 64-vs-four-329557 // level takes over its own four tpl cells: the 64-vs-four-32
9191 // comparison below weighs one cost against four, so both sides9558 // comparison below weighs one cost against four, so both sides
@@ -9208,6 +9575,47 @@ pub(crate) fn encode_inter_frame(
9208 let (mi_row, mi_col) = (sb_r * 16, sb_c * 16);9575 let (mi_row, mi_col) = (sb_r * 16, sb_c * 16);
9209 let stack =9576 let stack =
9210 find_mv_stack(&grid, mi_row, mi_col, 16, 16, LAST_FRAME, mi_cols, mi_rows);9577 find_mv_stack(&grid, mi_row, mi_col, 16, 16, LAST_FRAME, mi_cols, mi_rows);
9578+ // lane-b64b: the `LAST` + extra-reference pairs at this
9579+ // superblock's own 16x16-mi window, the same stacks the tile
9580+ // writer's `Whole64` arm rebuilds. Empty unless the frame
9581+ // codes `reference_select`, which is what gates the syntax.
9582+ // `!screen` for the same reason the residual arm is gated
9583+ // there ([`b64_residual`]): a desktop capture's superblocks
9584+ // are flat runs the skip arm already codes for nothing, and
9585+ // MEASURED, compound at the root cost it +33.4/-23.8 ->
9586+ // +33.7/-23.6 while both film rows gained (step 1's table).
9587+ let sb_compound: Vec<(i8, &Picture, crate::mvstack::CompoundMvStack)> =
9588+ if header.reference_select && b64_compound() && !screen {
9589+ [
9590+ (crate::mvstack::GOLDEN_FRAME, golden),
9591+ (crate::mvstack::ALTREF_FRAME, altref),
9592+ ]
9593+ .into_iter()
9594+ .filter_map(|(r, pic)| {
9595+ pic.map(|p| {
9596+ (
9597+ r,
9598+ p,
9599+ crate::mvstack::find_mv_stack_compound(
9600+ &grid,
9601+ mi_row,
9602+ mi_col,
9603+ 16,
9604+ 16,
9605+ (crate::mvstack::LAST_FRAME, r),
9606+ mi_cols,
9607+ mi_rows,
9608+ grid.sign_bias_table(),
9609+ &[(0, 0); 7],
9610+ None,
9611+ ),
9612+ )
9613+ })
9614+ })
9615+ .collect()
9616+ } else {
9617+ Vec::new()
9618+ };
9211 if let Some((cost, block)) = search_skip_64(9619 if let Some((cost, block)) = search_skip_64(
9212 &mut luma,9620 &mut luma,
9213 &mut chroma,9621 &mut chroma,
@@ -9216,6 +9624,7 @@ pub(crate) fn encode_inter_frame(
9216 b64_residual() && !screen,9624 b64_residual() && !screen,
9217 reference,9625 reference,
9218 &stack,9626 &stack,
9627+ &sb_compound,
9219 fctx,9628 fctx,
9220 ) {9629 ) {
9221 let after = snapshot(&luma, &chroma, (x64, y64), SUPERBLOCK);9630 let after = snapshot(&luma, &chroma, (x64, y64), SUPERBLOCK);
@@ -9656,6 +10065,12 @@ pub(crate) fn encode_inter_frame(
9656 + sb_search.lambda * crate::tile::partition_bits(SUPERBLOCK, true))10065 + sb_search.lambda * crate::tile::partition_bits(SUPERBLOCK, true))
9657 {10066 {
9658 B64_HITS.fetch_add(1, std::sync::atomic::Ordering::Relaxed);10067 B64_HITS.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
10068+ if block.inter.is_some_and(|i| i.ref1.is_some()) {
10069+ B64_COMPOUND_HITS.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
10070+ }
10071+ if !whole_inside {
10072+ B64_EDGE_HITS.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
10073+ }
9659 blocks.truncate(mark);10074 blocks.truncate(mark);
9660 restore(&mut luma, &mut chroma, (x64, y64), SUPERBLOCK, &after);10075 restore(&mut luma, &mut chroma, (x64, y64), SUPERBLOCK, &after);
9661 // Overwrites every 16x16 mi cell the quadrant searches10076 // Overwrites every 16x16 mi cell the quadrant searches
@@ -13630,19 +14045,12 @@ mod tests {
13630 // base now, not 16 ([`crate::encoder::Pyramid::leaf_q_offset`]) -- 977814045 // base now, not 16 ([`crate::encoder::Pyramid::leaf_q_offset`]) -- 9778
13631 // -> 9835 at q=150 and 35450 -> 35798 at q=60.14046 // -> 9835 at q=150 and 35450 -> 35798 at q=60.
13632 // `EC_AV1_PYRAMID=8:-32:16:-8:-48` restores these.14047 // `EC_AV1_PYRAMID=8:-32:16:-8:-48` restores these.
13633- // Re-taken on lane-arfcen: the pyramid path hands every frame the14048+ // Re-taken at the lane-b64b merge: the 64x64 root prices compound
13634- // lookahead window its temporal lambda map needs14049+ // references and depth-1 var-tx, on top of the tpl window and the
13635- // (`crate::encoder::tpl_pyramid`), which it never had, so every14050+ // ARF's second reference from lane-arfcen. `EC_AV1_B64COMP=0
13636- // superblock of these four pictures is priced at its own lambda --14051+ // EC_AV1_B64VARTX=0` restores 9853 / 35866.
13637- // 9835 -> 9859 at q=150 and 35798 -> 35904 at q=60.
13638- // `EC_AV1_TPL_PYRAMID=0` restores these.
13639- // Re-taken again on lane-arfcen: a group's top ARF names the ARF from
13640- // two groups back as its own `ALTREF_FRAME`
13641- // (`crate::encoder::arf_altref`) instead of the key frame it already
13642- // reads as `GOLDEN` -- 9859 -> 9853 at q=150 and 35904 -> 35866 at
13643- // q=60. `EC_AV1_ARF_ALTREF=0` restores these.
13644 let pins: [(u8, usize, u64); 2] =14052 let pins: [(u8, usize, u64); 2] =
13645- [(150, 9853, 0x0f6d_bbc8_b72c_ceb3), (60, 35866, 0xbd00_f4ed_e283_3ce4)];14053+ [(150, 9808, 0xb71a_2a4c_0aff_713c), (60, 35791, 0x57a3_93fa_5324_255b)];
13646 for (q, bytes, hash) in pins {14054 for (q, bytes, hash) in pins {
13647 let encoded = encode_sequence(&source, q, 0.5).unwrap();14055 let encoded = encode_sequence(&source, q, 0.5).unwrap();
13648 assert_eq!(14056 assert_eq!(
@@ -14196,6 +14604,9 @@ mod tests {
14196 let _ = crate::tile::take_compound_pair_hits();14604 let _ = crate::tile::take_compound_pair_hits();
14197 let _ = crate::tile::take_compound_size_hits();14605 let _ = crate::tile::take_compound_size_hits();
14198 let _ = crate::tile::take_compound_leaf_mode_hits();14606 let _ = crate::tile::take_compound_leaf_mode_hits();
14607+ let _ = take_b64_root_hits();
14608+ let _ = take_b64_residual_hits();
14609+ let _ = take_b64_compound_hits();
14199 let _ = crate::motion::take_census();14610 let _ = crate::motion::take_census();
14200 // The entry-surface arm: run the SAME ladder through the14611 // The entry-surface arm: run the SAME ladder through the
14201 // streaming facade the editor's export calls, which must print14612 // streaming facade the editor's export calls, which must print
@@ -14243,6 +14654,17 @@ mod tests {
14243 // a compound reference at all, which compound mode they took, and14654 // a compound reference at all, which compound mode they took, and
14244 // which pair (gate-blind-to-feature -- a compound mode nobody14655 // which pair (gate-blind-to-feature -- a compound mode nobody
14245 // picks cannot be what a BD number credits).14656 // picks cannot be what a BD number credits).
14657+ // The 64x64 root's own fire shares (lane-b64/tx64/b64b): how many
14658+ // superblocks were left whole at all, and how many of those coded
14659+ // a residual or took a compound reference.
14660+ let (roots, root_res, root_comp) = (
14661+ take_b64_root_hits(),
14662+ take_b64_residual_hits(),
14663+ take_b64_compound_hits(),
14664+ );
14665+ eprintln!(
14666+ "{name}: 64x64 roots {roots} (with a residual {root_res}, compound {root_comp})"
14667+ );
14246 let comp_modes = crate::tile::take_compound_mode_hits();14668 let comp_modes = crate::tile::take_compound_mode_hits();
14247 let comp_pairs = crate::tile::take_compound_pair_hits();14669 let comp_pairs = crate::tile::take_compound_pair_hits();
14248 let comp_sizes = crate::tile::take_compound_size_hits();14670 let comp_sizes = crate::tile::take_compound_size_hits();
@@ -14812,6 +15234,17 @@ mod tests {
14812 // the real side, a screen clip none of them.15234 // the real side, a screen clip none of them.
14813 let (price_default, price_real) = crate::tile::take_pricing_hits();15235 let (price_default, price_real) = crate::tile::take_pricing_hits();
14814 eprintln!("{name}: pricer armings default={price_default} real={price_real}");15236 eprintln!("{name}: pricer armings default={price_default} real={price_real}");
15237+ // The 64x64 root's own fire shares (lane-b64/tx64/b64b): how many
15238+ // superblocks stayed whole, and how many of those coded a
15239+ // residual, split that residual's luma, or took a compound
15240+ // reference (class `gate-blind-to-feature`).
15241+ eprintln!(
15242+ "{name}: 64x64 roots {} (with a residual {}, split luma {}, compound {})",
15243+ take_b64_root_hits(),
15244+ take_b64_residual_hits(),
15245+ take_b64_var_tx_hits(),
15246+ take_b64_compound_hits(),
15247+ );
14815 // lane-av1obmc2: the same motion_mode census the 640x384 gate15248 // lane-av1obmc2: the same motion_mode census the 640x384 gate
14816 // prints (class `gate-blind-to-feature`) -- how many blocks coded15249 // prints (class `gate-blind-to-feature`) -- how many blocks coded
14817 // the symbol at each footprint and how many took OBMC. Without it15250 // the symbol at each footprint and how many took OBMC. Without it
crates/ec-av1/src/encoder.rsmodified+186 -0
@@ -3149,6 +3149,192 @@ mod tests {
3149 }3149 }
3150 }3150 }
3151 3151
3152+ /// A frame whose size is NOT a multiple of a superblock (lane-b64b):
3153+ /// 232x168 leaves the last superblock column and row cut by the true
3154+ /// frame edge, with more than half of each inside -- which is exactly
3155+ /// what AV1's `has_cols`/`has_rows` allow to stay whole. Both gate films
3156+ /// are superblock-aligned, so nothing but a synthetic size reaches this
3157+ /// path at all (class `gate-blind-to-feature`), and the user's own
3158+ /// exports are arbitrary sizes.
3159+ #[test]
3160+ fn a_non_superblock_aligned_clip_codes_edge_64x64_roots_and_decodes_sample_exact() {
3161+ let _knobs = crate::speed::knob_write();
3162+ let _gate_lock = crate::stream::tests::lock_gate_counters();
3163+ let (width, height) = (232usize, 168usize);
3164+ let still = test_card(width, height, 0);
3165+ let sources: Vec<Picture> = (0..3).map(|_| still.clone()).collect();
3166+ let config = EncoderConfig {
3167+ width,
3168+ height,
3169+ base_q_idx: 120,
3170+ gop: 8,
3171+ colour: Colour::Bt709Limited,
3172+ tile_cols_log2: 0,
3173+ tile_rows_log2: 0,
3174+ };
3175+ let mut enc = Av1Encoder::new(config).unwrap();
3176+ let mut stream = Vec::new();
3177+ let _ = crate::encode::take_b64_edge_hits();
3178+ for packet in encode_all(&mut enc, &sources) {
3179+ stream.extend_from_slice(&packet.data);
3180+ }
3181+ let edges = crate::encode::take_b64_edge_hits();
3182+ assert!(edges > 0, "no 64x64 root was taken at a superblock the frame edge cuts");
3183+ eprintln!("edge 64x64 roots: {edges}");
3184+
3185+ let ours = crate::stream::decode_stream(&stream).expect("our decoder");
3186+ assert_eq!(ours.len(), sources.len(), "our decoder's frames");
3187+ if !have_ffmpeg() {
3188+ eprintln!("SKIP the ffmpeg half: no ffmpeg");
3189+ return;
3190+ }
3191+ let theirs = ffmpeg_decode_luma(&stream, width, height);
3192+ assert_eq!(theirs.len(), sources.len(), "ffmpeg's frames");
3193+ for (i, (ours_i, theirs_i)) in ours.iter().zip(&theirs).enumerate() {
3194+ let got: Vec<u8> = ours_i.y.iter().map(|&v| v as u8).collect();
3195+ if let Some(at) = got.iter().zip(theirs_i).position(|(x, y)| x != y) {
3196+ panic!(
3197+ "frame {i}: luma differs first at ({}, {}): ours {} vs ffmpeg {}",
3198+ at % width,
3199+ at / width,
3200+ got[at],
3201+ theirs_i[at],
3202+ );
3203+ }
3204+ }
3205+ }
3206+
3207+ /// A clip whose inter residual is HIGH-FREQUENCY (lane-b64b): every
3208+ /// frame adds a 4-pixel checkerboard, so the 64x64 root's prediction is
3209+ /// off by exactly the detail a TX_64X64 throws away (it codes only the
3210+ /// top-left 32x32 corner of its coefficient space) and the root's var-tx
3211+ /// arm splits its luma into four TX_32X32 units instead. The counter is
3212+ /// the gate (class `gate-blind-to-feature`), and a `txfm_split` the
3213+ /// reader does not expect desyncs the whole tile, so both decoders have
3214+ /// to reconstruct it sample-exact.
3215+ #[test]
3216+ fn a_high_frequency_clip_splits_the_64x64_roots_luma_and_decodes_sample_exact() {
3217+ let _knobs = crate::speed::knob_write();
3218+ let _gate_lock = crate::stream::tests::lock_gate_counters();
3219+ let (width, height) = (256usize, 128usize);
3220+ let still = test_card(width, height, 0);
3221+ let sources: Vec<Picture> = (0..4)
3222+ .map(|t| {
3223+ let mut p = still.clone();
3224+ for (i, v) in p.y.iter_mut().enumerate() {
3225+ let checker = ((i % width) / 4 + (i / width) / 4) % 2;
3226+ let bump = (t * 5 * (checker + 1)) as u16;
3227+ *v = (*v + bump).min(255);
3228+ }
3229+ p
3230+ })
3231+ .collect();
3232+ let config = EncoderConfig {
3233+ width,
3234+ height,
3235+ base_q_idx: 90,
3236+ gop: 8,
3237+ colour: Colour::Bt709Limited,
3238+ tile_cols_log2: 0,
3239+ tile_rows_log2: 0,
3240+ };
3241+ let mut enc = Av1Encoder::new(config).unwrap();
3242+ let mut stream = Vec::new();
3243+ let _ = crate::encode::take_b64_var_tx_hits();
3244+ for packet in encode_all(&mut enc, &sources) {
3245+ stream.extend_from_slice(&packet.data);
3246+ }
3247+ let split = crate::encode::take_b64_var_tx_hits();
3248+ assert!(split > 0, "no 64x64 root split its luma transform at all");
3249+ eprintln!("64x64 roots with a SPLIT luma transform: {split}");
3250+
3251+ let ours = crate::stream::decode_stream(&stream).expect("our decoder");
3252+ assert_eq!(ours.len(), sources.len(), "our decoder's frames");
3253+ if !have_ffmpeg() {
3254+ eprintln!("SKIP the ffmpeg half: no ffmpeg");
3255+ return;
3256+ }
3257+ let theirs = ffmpeg_decode_luma(&stream, width, height);
3258+ assert_eq!(theirs.len(), sources.len(), "ffmpeg's frames");
3259+ for (i, (ours_i, theirs_i)) in ours.iter().zip(&theirs).enumerate() {
3260+ let got: Vec<u8> = ours_i.y.iter().map(|&v| v as u8).collect();
3261+ if let Some(at) = got.iter().zip(theirs_i).position(|(x, y)| x != y) {
3262+ panic!(
3263+ "frame {i}: luma differs first at ({}, {}): ours {} vs ffmpeg {}",
3264+ at % width,
3265+ at / width,
3266+ got[at],
3267+ theirs_i[at],
3268+ );
3269+ }
3270+ }
3271+ }
3272+
3273+ /// A CROSSFADE clip (lane-b64b): each picture is a linear blend of two
3274+ /// stills, so on a leaf frame the average of its past (`LAST`) and future
3275+ /// (`ALTREF`) references IS the source and neither reference alone is --
3276+ /// exactly the content a COMPOUND 64x64 root pays on. The counter is the
3277+ /// gate (class `gate-blind-to-feature`): without it a green three-way
3278+ /// compare says nothing about whether one compound root was written, and
3279+ /// the writer's compound arm (`write_compound_block` at `SB_MI` 16, no
3280+ /// `motion_mode` symbol) desyncs the whole tile if it is wrong.
3281+ #[test]
3282+ fn a_crossfade_clip_codes_a_compound_64x64_root_and_decodes_sample_exact() {
3283+ let _knobs = crate::speed::knob_write();
3284+ let _gate_lock = crate::stream::tests::lock_gate_counters();
3285+ let (width, height) = (256usize, 128usize);
3286+ let (a, b) = (test_card(width, height, 0), test_card(width, height, 24));
3287+ let sources: Vec<Picture> = (0..9)
3288+ .map(|t| {
3289+ let mut p = a.clone();
3290+ let w = t as u32;
3291+ for (v, &other) in p.y.iter_mut().zip(&b.y) {
3292+ *v = ((u32::from(*v) * (8 - w) + u32::from(other) * w) / 8) as u16;
3293+ }
3294+ p
3295+ })
3296+ .collect();
3297+ let config = EncoderConfig {
3298+ width,
3299+ height,
3300+ base_q_idx: 120,
3301+ gop: 9,
3302+ colour: Colour::Bt709Limited,
3303+ tile_cols_log2: 0,
3304+ tile_rows_log2: 0,
3305+ };
3306+ let mut enc = Av1Encoder::new(config).unwrap();
3307+ let mut stream = Vec::new();
3308+ let _ = crate::encode::take_b64_compound_hits();
3309+ for packet in encode_all(&mut enc, &sources) {
3310+ stream.extend_from_slice(&packet.data);
3311+ }
3312+ let compound = crate::encode::take_b64_compound_hits();
3313+ assert!(compound > 0, "a crossfade clip coded no COMPOUND 64x64 root at all");
3314+ eprintln!("compound 64x64 roots on a crossfade clip: {compound}");
3315+
3316+ let ours = crate::stream::decode_stream(&stream).expect("our decoder");
3317+ assert_eq!(ours.len(), sources.len(), "our decoder's frames");
3318+ if !have_ffmpeg() {
3319+ eprintln!("SKIP the ffmpeg half: no ffmpeg");
3320+ return;
3321+ }
3322+ let theirs = ffmpeg_decode_luma(&stream, width, height);
3323+ assert_eq!(theirs.len(), sources.len(), "ffmpeg's frames");
3324+ for (i, (ours_i, theirs_i)) in ours.iter().zip(&theirs).enumerate() {
3325+ let got: Vec<u8> = ours_i.y.iter().map(|&v| v as u8).collect();
3326+ if let Some(at) = got.iter().zip(theirs_i).position(|(x, y)| x != y) {
3327+ panic!(
3328+ "frame {i}: luma differs first at ({}, {}): ours {} vs ffmpeg {}",
3329+ at % width,
3330+ at / width,
3331+ got[at],
3332+ theirs_i[at],
3333+ );
3334+ }
3335+ }
3336+ }
3337+
3152 #[test]3338 #[test]
3153 fn every_tile_layout_decodes_sample_exact_through_both_decoders() {3339 fn every_tile_layout_decodes_sample_exact_through_both_decoders() {
3154 let _knobs = crate::speed::knob_read();3340 let _knobs = crate::speed::knob_read();
crates/ec-av1/src/tile.rsmodified+108 -53
@@ -3962,13 +3962,13 @@ fn write_luma_tus(
3962 // tables, not the intra ones (`TxbSet::Luma*Inter`).3962 // tables, not the intra ones (`TxbSet::Luma*Inter`).
3963 inter: bool,3963 inter: bool,
3964 ) -> Result<()> {3964 ) -> Result<()> {
3965- if tx < side && side > 32 {3965+ if tx < side && side > 32 && tx < 32 {
3966 // A 64x64 block's own levels reach the writer as the 32x32 corner a3966 // A 64x64 block's own levels reach the writer as the 32x32 corner a
3967- // 64-point transform codes, not as a 64x64 block grid, so there is3967+ // 64-point transform codes unless the whole block was SPLIT into
3968- // nothing to slice per unit here.3968+ // TX_32X32 units (lane-b64b), so any finer split has nothing to slice.
3969 return Err(Error::unsupported(3969 return Err(Error::unsupported(
3970 "AV1 tile",3970 "AV1 tile",
3971- "a 64x64 block's split luma transform is not written yet",3971+ "a 64x64 block's luma transform splits no finer than TX_32X32",
3972 ));3972 ));
3973 }3973 }
3974 let coeff_side = tx.min(32);3974 let coeff_side = tx.min(32);
@@ -4377,8 +4377,25 @@ pub(crate) fn predicted_coeff_bits(blocks: &[Quadrant], base_q_idx: u8) -> f64 {
4377 return match block.skip {4377 return match block.skip {
4378 true => 0.0,4378 true => 0.0,
4379 false => {4379 false => {
4380- coeff_bits(&dense(&block.luma, 32), TxbSet::Luma64, q_ctx, 0, 0)4380+ // lane-b64b: at `tx_depth = 1` the luma levels are
4381- + coeff_bits(&dense(&block.u, 32), TxbSet::Chroma32, q_ctx, 0, 0)4381+ // the whole 64-sided block, written as four
4382+ // TX_32X32 units, so the pricer slices them the
4383+ // same way the writer does.
4384+ let luma = if block.tx_depth == 1 {
4385+ let g = dense(&block.luma, 64);
4386+ (0..4)
4387+ .map(|tu| {
4388+ let (r0, c0) = ((tu / 2) * 32, (tu % 2) * 32);
4389+ let unit: Vec<i32> = (0..32)
4390+ .flat_map(|row| g[(r0 + row) * 64 + c0..][..32].to_vec())
4391+ .collect();
4392+ coeff_bits(&unit, TxbSet::Luma32Inter, q_ctx, 0, 0)
4393+ })
4394+ .sum::<f64>()
4395+ } else {
4396+ coeff_bits(&dense(&block.luma, 32), TxbSet::Luma64, q_ctx, 0, 0)
4397+ };
4398+ luma + coeff_bits(&dense(&block.u, 32), TxbSet::Chroma32, q_ctx, 0, 0)
4382 + coeff_bits(&dense(&block.v, 32), TxbSet::Chroma32, q_ctx, 0, 0)4399 + coeff_bits(&dense(&block.v, 32), TxbSet::Chroma32, q_ctx, 0, 0)
4383 }4400 }
4384 };4401 };
@@ -5634,12 +5651,6 @@ pub(crate) fn sb_coeff_inter_frame_tile_cdfs(
5634 let info = block.inter.ok_or_else(|| {5651 let info = block.inter.ok_or_else(|| {
5635 Error::unsupported("AV1 tile", "a 64x64 root block is coded inter")5652 Error::unsupported("AV1 tile", "a 64x64 root block is coded inter")
5636 })?;5653 })?;
5637- if info.ref1.is_some() {
5638- return Err(Error::unsupported(
5639- "AV1 tile",
5640- "a 64x64 root block is coded single-reference",
5641- ));
5642- }
5643 enc.symbol(PARTITION_NONE, &mut cdfs.partition_w64[sb_ctx]);5654 enc.symbol(PARTITION_NONE, &mut cdfs.partition_w64[sb_ctx]);
5644 let (mi_r, mi_c) = (sb_at.0 * (SUB / MI), sb_at.1 * (SUB / MI));5655 let (mi_r, mi_c) = (sb_at.0 * (SUB / MI), sb_at.1 * (SUB / MI));
5645 let has_above = neighbours.has_above(mi_r);5656 let has_above = neighbours.has_above(mi_r);
@@ -5661,28 +5672,46 @@ pub(crate) fn sb_coeff_inter_frame_tile_cdfs(
5661 &neighbours,5672 &neighbours,
5662 (mi_r, mi_c),5673 (mi_r, mi_c),
5663 (has_above, has_left),5674 (has_above, has_left),
5664- false,5675+ info.ref1.is_some(),
5665- );
5666- write_single_ref(
5667- &mut enc,
5668- &mut cdfs,
5669- info.ref_frame,
5670- neighbours.above_ref[mi_c],
5671- neighbours.above_ref1[mi_c],
5672- neighbours.left_ref[mi_r],
5673- neighbours.left_ref1[mi_r],
5674- );
5675- let stack = find_mv_stack(
5676- &grid,
5677- mi_r,
5678- mi_c,
5679- SB_MI as usize,
5680- SB_MI as usize,
5681- info.ref_frame,
5682- mi_cols as usize,
5683- mi_rows as usize,
5684 );5676 );
5685- let (mv, is_new_mv) = write_inter_mode(&mut enc, &mut cdfs, info, &stack)?;5677+ // lane-b64b: a COMPOUND 64x64 root takes the same mode chain
5678+ // every other compound block does, at this superblock's own
5679+ // 16x16-mi window.
5680+ let (mv, mv1, is_new_mv) = if info.ref1.is_some() {
5681+ write_compound_block(
5682+ &mut enc,
5683+ &mut cdfs,
5684+ &neighbours,
5685+ &grid,
5686+ (mi_r, mi_c),
5687+ (SB_MI as usize, SB_MI as usize),
5688+ (has_above, has_left),
5689+ info,
5690+ (mi_cols as usize, mi_rows as usize),
5691+ )?
5692+ } else {
5693+ write_single_ref(
5694+ &mut enc,
5695+ &mut cdfs,
5696+ info.ref_frame,
5697+ neighbours.above_ref[mi_c],
5698+ neighbours.above_ref1[mi_c],
5699+ neighbours.left_ref[mi_r],
5700+ neighbours.left_ref1[mi_r],
5701+ );
5702+ let stack = find_mv_stack(
5703+ &grid,
5704+ mi_r,
5705+ mi_c,
5706+ SB_MI as usize,
5707+ SB_MI as usize,
5708+ info.ref_frame,
5709+ mi_cols as usize,
5710+ mi_rows as usize,
5711+ );
5712+ let (mv, is_new_mv) = write_inter_mode(&mut enc, &mut cdfs, info, &stack)?;
5713+ (mv, (0, 0), is_new_mv)
5714+ };
5686 for dr in 0..SB_MI as usize {5715 for dr in 0..SB_MI as usize {
5687 for dc in 0..SB_MI as usize {5716 for dc in 0..SB_MI as usize {
5688 grid.set(5717 grid.set(
@@ -5691,8 +5720,8 @@ pub(crate) fn sb_coeff_inter_frame_tile_cdfs(
5691 MiInfo {5720 MiInfo {
5692 is_inter: true,5721 is_inter: true,
5693 ref_frame: info.ref_frame,5722 ref_frame: info.ref_frame,
5694- ref_frame1: NO_REF1,5723+ ref_frame1: info.ref1.unwrap_or(NO_REF1),
5695- mv1: (0, 0),5724+ mv1: mv16(mv1),
5696 mv: mv16(mv),5725 mv: mv16(mv),
5697 is_new_mv,5726 is_new_mv,
5698 size: SB_MI as u8,5727 size: SB_MI as u8,
@@ -5703,24 +5732,28 @@ pub(crate) fn sb_coeff_inter_frame_tile_cdfs(
5703 );5732 );
5704 }5733 }
5705 }5734 }
5706- write_motion_mode(5735+ if info.ref1.is_none() {
5707- &mut enc,5736+ // libaom's `motion_mode_allowed` fails on a compound
5708- &mut cdfs,5737+ // block, so the decoder reads no symbol for one.
5709- &grid,5738+ write_motion_mode(
5710- (mi_r, mi_c),5739+ &mut enc,
5711- (SB_MI as usize, SB_MI as usize),5740+ &mut cdfs,
5712- (SB, SB),5741+ &grid,
5713- (mi_cols as usize, mi_rows as usize),5742+ (mi_r, mi_c),
5714- info.ref_frame,5743+ (SB_MI as usize, SB_MI as usize),
5715- block.motion_mode,5744+ (SB, SB),
5716- )?;5745+ (mi_cols as usize, mi_rows as usize),
5746+ info.ref_frame,
5747+ block.motion_mode,
5748+ )?;
5749+ }
5717 if tx_select {5750 if tx_select {
5718 // A skipped inter block writes no `txfm_split` at all --5751 // A skipped inter block writes no `txfm_split` at all --
5719 // that call only publishes the max transform size the5752 // that call only publishes the max transform size the
5720 // reader infers for it; an unskipped one writes the5753 // reader infers for it; an unskipped one writes the
5721- // `txfm_split` flag, 0 here because a 64x64 root's luma5754+ // `txfm_split` flag: 0 when the root's luma is one whole
5722- // is one whole TX_64X64 (depth 1 is lane-tx64's deferred5755+ // TX_64X64, 1 when it is the four TX_32X32 units
5723- // var-tx arm).5756+ // lane-b64b's var-tx arm chose.
5724 write_tx_syntax_inter(5757 write_tx_syntax_inter(
5725 &mut enc,5758 &mut enc,
5726 &mut cdfs,5759 &mut cdfs,
@@ -5729,7 +5762,7 @@ pub(crate) fn sb_coeff_inter_frame_tile_cdfs(
5729 SB,5762 SB,
5730 true,5763 true,
5731 block.skip,5764 block.skip,
5732- 0,5765+ usize::from(block.tx_depth),
5733 );5766 );
5734 }5767 }
5735 if block.skip {5768 if block.skip {
@@ -5741,11 +5774,32 @@ pub(crate) fn sb_coeff_inter_frame_tile_cdfs(
5741 // `sb_coeff_key_frame_tile`'s `Superblock::Whole` writes),5774 // `sb_coeff_key_frame_tile`'s `Superblock::Whole` writes),
5742 // chroma one whole TX_32X32 per plane, and `split` is5775 // chroma one whole TX_32X32 per plane, and `split` is
5743 // false because the luma transform covers the block.5776 // false because the luma transform covers the block.
5777+ // lane-b64b: at `txfm_split = 1` the luma levels arrive in
5778+ // 64x64 block coordinates and are written as the four
5779+ // TX_32X32 units `write_luma_tus` slices out, each
5780+ // publishing its own coefficient context before the next
5781+ // one reads it; chroma is one TX_32X32 per plane either
5782+ // way.
5783+ let split = block.tx_depth == 1;
5744 let grids = [5784 let grids = [
5745- level_grid(&block.luma, TX32)?,5785+ level_grid(&block.luma, if split { SB } else { TX32 })?,
5746 level_grid(&block.u, TX32)?,5786 level_grid(&block.u, TX32)?,
5747 level_grid(&block.v, TX32)?,5787 level_grid(&block.v, TX32)?,
5748 ];5788 ];
5789+ if split {
5790+ write_luma_tus(
5791+ &mut enc,
5792+ &mut cdfs,
5793+ &mut neighbours,
5794+ (mi_r, mi_c),
5795+ SB,
5796+ TX32,
5797+ &grids[0],
5798+ 0,
5799+ &all_scans,
5800+ true,
5801+ )?;
5802+ }
5749 write_block_planes(5803 write_block_planes(
5750 &mut enc,5804 &mut enc,
5751 &mut cdfs,5805 &mut cdfs,
@@ -5754,11 +5808,12 @@ pub(crate) fn sb_coeff_inter_frame_tile_cdfs(
5754 &[&scan32, &scan32, &scan32],5808 &[&scan32, &scan32, &scan32],
5755 &neighbours.around(sb_at, SB),5809 &neighbours.around(sb_at, SB),
5756 0,5810 0,
5757- false,5811+ split,
5758 );5812 );
5759- neighbours.record_planes(sb_at, SB, 0, &grids, true);5813+ neighbours.record_planes(sb_at, SB, 0, &grids, !split);
5760 }5814 }
5761 neighbours.record_inter(sb_at, SB, block.skip, true, block_ref(block));5815 neighbours.record_inter(sb_at, SB, block.skip, true, block_ref(block));
5816+ record_block_compound(&mut neighbours, (mi_r, mi_c), SB, block);
5762 continue;5817 continue;
5763 }5818 }
5764 match (has_cols, has_rows) {5819 match (has_cols, has_rows) {
lanes/b64b.report.mdadded+207 -0
@@ -0,0 +1,207 @@
1+# lane-b64b — the 64x64 root: compound, var-tx, edge, intra
2+
3+Branch `lane-b64b`, base `12a8c4a7`. Scope: `crates/ec-av1/src/encode.rs`'s 64
4+root (`search_skip_64`, its residual arm, `sb64_legal`), `tile.rs`'s
5+`Quadrant::Whole64` writer arm, tests.
6+
7+## Step 1 — COMPOUND references at the 64 root (commit `b9a4d589`)
8+
9+Search: `search_skip_64` takes this superblock's `LAST` + GOLDEN/ALTREF
10+compound stacks (`find_mv_stack_compound` at the 16x16-mi window the writer
11+rebuilds from) and prices three modes — `NEAREST_NEARESTMV`,
12+`GLOBAL_GLOBALMV`, `NEW_NEARESTMV` — through `predict_compound_u8`, a heap
13+counterpart of `predict_u8` on the same `predict_compound_intermediate` +
14+`combine_compound` path (`mc_trial_compound`'s fixed buffers are sized for a
15+32x32 block, so they cannot serve a 64 root). Every candidate is compared
16+against the single-reference arm at ONE syntax price: `fixed` minus the single
17+reference tree, plus the pair tree and the compound mode symbol.
18+
19+DEVIATION from the charter, named: `NEAREST_NEWMV` and `NEW_NEWMV` are NOT
20+offered. Both need the SECOND reference's own `NEWMV` vector, which only a
21+second 64x64 motion search per superblock produces — the wall this root exists
22+to save (`b64_residual`'s doc: a root that wins is four quadrant searches that
23+never run). The three modes above cost no extra search.
24+
25+Writer: the `Whole64` arm's "a 64x64 root block is coded single-reference"
26+refusal is gone; a compound root codes `comp_mode` 1 and the whole
27+`write_compound_block` chain at `(bw4, bh4) = (16, 16)`, publishes both
28+references and both vectors into the MI grid, writes NO `motion_mode` symbol
29+(libaom's `motion_mode_allowed` refuses a compound block) and stamps
30+`record_block_compound` so the next block reads the right compound contexts.
31+
32+`EC_AV1_B64COMP=0` restores the single-reference root, so both arms measure on
33+one build.
34+
35+### Exactness
36+
37+`encoder::tests::a_crossfade_clip_codes_a_compound_64x64_root_and_decodes_sample_exact`
38+— a 9-picture linear crossfade between two test cards, so on a leaf frame the
39+average of `LAST` and `ALTREF` IS the source: 2 compound 64x64 roots fire and
40+every frame decodes sample-exact through our decoder AND ffmpeg, with
41+`EC_COMP_MISMATCH=1` printing nothing.
42+
43+### Step 1's 12-frame table (`encode::tests::bd_rate_screen_native`, 12 frames, gop 12)
44+
45+Two arms of ONE build, `EC_AV1_B64COMP=0` vs default; the OFF arm reproduces
46+the charter's control to the digit (film A +37.5/+7.6, film B +54.1/+23.9,
47+screen +33.4/-23.8), so the baseline is this build's own.
48+
49+| row | OFF (control) | ON (all clips) | SHIPPED (`!screen`) |
50+|---|---|---|---|
51+| bars 1080p | +1.7% / -14.5% | +1.8% / -14.4% | +1.8% / -14.4% |
52+| bars 2160p | +12.2% / -10.2% | +12.3% / -10.2% | +12.3% / -10.2% |
53+| film A | +37.5% / +7.6% | **+35.5% / +5.6%** | **+35.5% / +5.6%** |
54+| film B | +54.1% / +23.9% | **+47.8% / +17.1%** | **+47.8% / +17.1%** |
55+| screen | +33.4% / -23.8% | +33.7% / -23.6% | +33.4% / -23.8% (byte-identical) |
56+
57+Screen at +33.7 was exactly the keep rule's 0.3 bound, so the compound arm
58+takes the same `!screen` content gate the residual arm does; the shipped arm
59+is byte-identical to the control there. Wall (ours:libaom:rav1e, noisy, two
60+arms sharing the box): film A 94.1 -> 93.8 s, film B 88.7 -> 88.0 s.
61+
62+DECISION: **KEEP, default on** (`EC_AV1_B64COMP=0` restores). Both film rows
63+improve on both columns; screen unchanged.
64+
65+Fire shares (shipped, from the gate's own `64x64 roots` census line): film A
66+9141 roots, 3559 compound (38.9%); film B 15248 roots, 6913 compound (45.3%);
67+screen 20558 roots, 0 compound (gated).
68+
69+## Step 2 — depth-1 var-tx under the 64 root (commit `484c390e`)
70+
71+`commit_inter_luma` -- the var-tx decision every other inter block already
72+takes -- reaches side 64 now: its halved transform is TX_32X32
73+(`TxbSet::Luma32Inter`), and the eligibility line that read `side < BLOCK ||
74+tx32_depth_search()` reads `side != BLOCK || ...` so a 64 root is offered the
75+trial while the 32x32 knob keeps meaning what it meant. The root's own
76+counter (`take_b64_var_tx_hits`) keeps it out of the depth census's leaf row.
77+The writer's `Whole64` arm codes `txfm_split = usize::from(block.tx_depth)`
78+and, at depth 1, the four TX_32X32 units `write_luma_tus` slices out of the
79+block's 64x64 levels (its "a 64x64 block's split luma transform is not
80+written yet" refusal now only covers a split finer than TX_32X32); the pricer
81+(`predicted_coeff_bits`) slices the same four units in the same diff.
82+
83+`EC_AV1_B64VARTX=0` restores the single TX_64X64.
84+
85+### Exactness
86+
87+`encoder::tests::a_high_frequency_clip_splits_the_64x64_roots_luma_and_decodes_sample_exact`
88+— every frame adds a 4-pixel checkerboard, which is exactly the detail
89+TX_64X64 throws away (it codes only the top-left 32x32 corner of its
90+coefficient space): 24 roots split their luma and every frame decodes
91+sample-exact through our decoder AND ffmpeg.
92+
93+### 12-frame table (`EC_AV1_B64VARTX=0` vs default, one build)
94+
95+| row | OFF (= step 1 shipped) | ON | roots / with residual / split luma |
96+|---|---|---|---|
97+| bars 1080p | +1.8% / -14.4% | +1.6% / -14.6% | 17585 / 12602 / 3076 |
98+| bars 2160p | +12.3% / -10.2% | +12.4% / -10.1% | 18446 / 12409 / 2477 |
99+| film A | +35.5% / +5.6% | **+35.4% / +5.4%** | 9159 / 6146 / 2873 (46.7% of residual roots) |
100+| film B | +47.8% / +17.1% | **+47.6% / +17.0%** | 15308 / 6604 / 1942 (29.4%) |
101+| screen | +33.4% / -23.8% | +33.4% / -23.8% | 20558 / 0 / 0 (byte-identical) |
102+
103+Wall: film A 102.7 -> 103.0 s, film B 90.1 -> 89.9 s (both arms sharing the
104+box with a second gate).
105+
106+DECISION: **KEEP, default on**. Both film rows improve on both columns
107+(small: 0.1-0.2), screen byte-identical.
108+
109+Pins re-taken for steps 1+2 together: 9835 -> 9798 at q=150 and 35798 ->
110+35614 at q=60.
111+
112+## Step 3 — EDGE superblocks (commit pending)
113+
114+`sb64_legal` required the WHOLE superblock inside the true frame. AV1 asks
115+only that the block's own half is (`has_cols`/`has_rows`, spec
116+`decode_partition`), and the writer's `Whole64` arm already refuses exactly
117+the other case, so the missing half was the SEARCH's: a trial scored over the
118+padding the encoder invented past the edge. `inside_sse` scores the inside
119+part alone and `clip_sb64_sse` rescores all three planes of every 64-root
120+trial set (skip, compound and residual arms) when the edge cuts the
121+superblock. The root's var-tx arm stays off there by `commit_inter_luma`'s own
122+"wholly inside" rule, so an edge root is one TX_64X64 or a skip.
123+
124+`EC_AV1_B64EDGE=0` restores the old rule.
125+
126+### Exactness
127+
128+`encoder::tests::a_non_superblock_aligned_clip_codes_edge_64x64_roots_and_decodes_sample_exact`
129+— 232x168 (mi 58x42: the last superblock column and row are cut with more
130+than half inside): 9 edge roots, every frame sample-exact through our decoder
131+AND ffmpeg.
132+
133+### 12-frame gate
134+
135+The gate CANNOT see this step: film A is 1920x768 (mi 480x192), film B and
136+the screen capture are 1920x1024 (mi 480x256) — every row is superblock
137+aligned, so `take_b64_edge_hits` is 0 on all five and the shipped table below
138+is identical to step 2's ON arm. The decision rests on the synthetic
139+exactness test above plus the fact that it is the user's arbitrary export
140+sizes, not the gate clips, that reach the path (class
141+`gate-blind-to-feature`, stated rather than hidden).
142+
143+DECISION: **KEEP, default on** — no gate row moves, one new capability, one
144+witness.
145+
146+## Step 4 — INTRA 64x64 root
147+
148+NOT IMPLEMENTED this round. `Superblock::Whole` is produced nowhere but three
149+unit tests (`tile.rs:8024/8142/8710`), so the key-frame search would need a
150+whole-superblock intra candidate (13 modes at 64x64, TX_64X64 luma plus two
151+TX_32X32 chroma), its own `Superblock::Whole` assembly in the key search's
152+block list, and the pricer's key-frame arm — a diff the size of steps 1 and 2
153+together, which did not fit this lane's budget after three gate rounds.
154+
155+`deferred: the intra 64x64 root on key frames — the key-frame search has no
156+whole-superblock candidate at all and the change is not a variant of the
157+inter root's — unblocks: one lane scoped to the key search plus
158+`sb_coeff_key_frame_tile`'s `Superblock::Whole` arm, gated on the key-frame
159+share of the film rows (a 12-frame gate at gop 12 codes one key frame in
160+twelve, so the long-GOP arm is the honest one for it).`
161+
162+## Shipped state
163+
164+Steps 1, 2 and 3 all default ON; step 4 deferred (above).
165+
166+### 12-frame `bd_rate_screen_native` at the shipped state
167+
168+| clip | vs libaom cpu-used 6 | vs rav1e speed 6 | roots / residual / split luma / compound | wall ours:libaom:rav1e |
169+|---|---|---|---|---|
170+| bars 1080p | +1.6% | -14.6% | 17585 / 12602 / 3076 / 6371 | 43.5s:8.1s:21.8s |
171+| bars 2160p | +12.4% | -10.1% | 18446 / 12409 / 2477 / 5387 | 35.6s:6.7s:19.0s |
172+| film A 1920x768 | **+35.4%** | **+5.4%** | 9159 / 6146 / 2873 / 3543 | 82.8s:12.8s:18.9s |
173+| film B 1920x1024 | **+47.6%** | **+17.0%** | 15308 / 6604 / 1942 / 6976 | 83.1s:21.2s:16.6s |
174+| screen capture | +33.4% | -23.8% | 20558 / 0 / 0 / 0 | 43.2s:10.9s:16.1s |
175+
176+Against the charter's control (film A +37.5/+7.6, film B +54.1/+23.9, screen
177++33.4/-23.8, reproduced to the digit by this build's OFF arm): film A -2.1 /
178+-2.2, film B -6.5 / -6.9, screen unchanged. Edge roots on every row: 0 (all
179+five clips are superblock aligned).
180+
181+### Long-GOP `bd_rate_film_long_gop` at the shipped state (48 frames, gop 48)
182+
183+| clip | vs libaom | vs rav1e | wall ours:libaom:rav1e |
184+|---|---|---|---|
185+| film A 1920x768 | **+39.2%** | **+1.3%** | 349.5s:37.0s:61.6s |
186+| film B 1920x1024 | **+118.5%** | **+25.1%** | 276.4s:74.4s:60.2s |
187+
188+Charter control: film A +43.1/+4.6, film B +129.0/+34.3 — so -3.9 / -3.3 and
189+-10.5 / -9.2.
190+
191+### Invariants
192+
193+- `the_encoders_own_streams_are_byte_identical_to_their_pins`: green at
194+ 9798 (q=150) / 35614 (q=60), re-taken once for steps 1+2 (step 3 does not
195+ move that clip: it is superblock aligned).
196+- `every_speed_preset_decodes_sample_exact_through_both_decoders --ignored`:
197+ green (speeds 0, 3, 6, 10).
198+- `tile_bytes_do_not_depend_on_the_thread_count --include-ignored`,
199+ `filter_stage_bytes_do_not_depend_on_the_thread_count`,
200+ `the_facade_codes_the_same_bytes_as_encode_sequence`,
201+ `predicted_coeff_bits_track_the_tile_the_writer_wrote`: green.
202+- `EC_COMP_MISMATCH=1` over all of the above and the four 64-root witnesses:
203+ silent.
204+- Full lib suite (release binary, `--test-threads=4`): **561 passed / 0
205+ failed / 44 ignored**, 707.9 s (558 + this lane's three new tests).
206+- `timeout 900 cargo check --workspace --all-targets -j4`: 0 errors, 0
207+ ec-av1 warnings (21 pre-existing ec-opus doc warnings, 1 ec-vorbis).
lanes/b64b/bin-controladded+0 -0

Binary file changed

lanes/b64b/bin-r1added+0 -0

Binary file changed

lanes/b64b/bin-r2added+0 -0

Binary file changed

lanes/b64b/bin-r3added+0 -0

Binary file changed

lanes/b64b/bin-shipadded+0 -0

Binary file changed

lanes/b64b/ctl.logadded+6 -0
@@ -0,0 +1,6 @@
1+
2+running 0 tests
3+
4+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 602 filtered out; finished in 0.00s
5+
6+RC=0
lanes/b64b/r1-off.logadded+47 -0
@@ -0,0 +1,47 @@
1+
2+running 1 test
3+
4+native crop, 12 frames, gop=12; tiles (0, 0), tile threads 1, intrabc false, palette maxcolors 128
5+| clip | ours PSNR/bytes per point | BD-rate vs libaom | BD-rate vs rav1e | wall ours:libaom:rav1e (noisy) |
6+|---|---|---|---|---|
7+bars 1080p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
8+bars 1080p: pricer armings default=17 real=186
9+bars 1080p: motion_mode 32x32 SIMPLE=50273 OBMC=0 WARP=178 | 16x16 SIMPLE=4821 OBMC=0 WARP=316 | 8x8 SIMPLE=17680 OBMC=0 WARP=1286 (0.0% OBMC / 2.4% WARP of 74554 eligible)
10+bars 1080p: inter var-tx depths of 11490 blocks -- leaf single 0=1833 1=1120 (37.9% split) | leaf compound 0=909 1=635 (41.1% split) | 32x32 single 0=790 1=1741 (68.8% split) | 32x32 compound 0=2249 1=2213 (49.6% split)
11+bars 1080p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
12+bars 1080p: filter intra on=true blocks 29430 (modes DC=7287 V=3047 H=5419 D157=9114 PAETH=4563)
13+test encode::tests::bd_rate_screen_native has been running for over 60 seconds
14+| bars 1080p 1920x1024 | 44.10 dB/218144 B, 47.66 dB/318010 B, 51.05 dB/439435 B, 54.25 dB/587007 B | +1.7% | -14.5% | 43.4s:9.1s:21.5s |
15+bars 2160p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
16+bars 2160p: pricer armings default=14 real=172
17+bars 2160p: motion_mode 32x32 SIMPLE=40526 OBMC=0 WARP=275 | 16x16 SIMPLE=2452 OBMC=0 WARP=801 | 8x8 SIMPLE=7250 OBMC=0 WARP=461 (0.0% OBMC / 3.0% WARP of 51765 eligible)
18+bars 2160p: inter var-tx depths of 9016 blocks -- leaf single 0=1113 1=512 (31.5% split) | leaf compound 0=1107 1=240 (17.8% split) | 32x32 single 0=378 1=1204 (76.1% split) | 32x32 compound 0=144 1=4318 (96.8% split)
19+bars 2160p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
20+bars 2160p: filter intra on=true blocks 11967 (modes DC=3217 V=773 H=2519 D157=3855 PAETH=1603)
21+| bars 2160p 1920x1024 | 43.70 dB/228646 B, 47.60 dB/341309 B, 51.18 dB/452951 B, 54.52 dB/582847 B | +12.2% | -10.2% | 41.1s:8.9s:26.4s |
22+film A (1080p source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
23+film A (1080p source): pricer armings default=20 real=212
24+film A (1080p source): motion_mode 32x32 SIMPLE=41371 OBMC=0 WARP=1393 | 16x16 SIMPLE=20213 OBMC=0 WARP=2070 | 8x8 SIMPLE=4708 OBMC=0 WARP=1038 (0.0% OBMC / 6.4% WARP of 70793 eligible)
25+film A (1080p source): inter var-tx depths of 85428 blocks -- leaf single 0=15069 1=2749 (15.4% split) | leaf compound 0=31906 1=6568 (17.1% split) | 32x32 single 0=7219 1=5640 (43.9% split) | 32x32 compound 0=9936 1=6341 (39.0% split)
26+film A (1080p source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
27+film A (1080p source): filter intra on=true blocks 24625 (modes DC=6298 V=3531 H=4705 D157=7026 PAETH=3065)
28+| film A (1080p source) 1920x768 | 44.23 dB/75096 B, 45.82 dB/125659 B, 47.05 dB/217532 B, 48.31 dB/518999 B | +37.5% | +7.6% | 94.1s:13.5s:21.4s |
29+film B (2160p HDR source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
30+film B (2160p HDR source): pricer armings default=20 real=189
31+film B (2160p HDR source): motion_mode 32x32 SIMPLE=51091 OBMC=0 WARP=1231 | 16x16 SIMPLE=13800 OBMC=0 WARP=1158 | 8x8 SIMPLE=1892 OBMC=0 WARP=478 (0.0% OBMC / 4.1% WARP of 69650 eligible)
32+film B (2160p HDR source): inter var-tx depths of 75827 blocks -- leaf single 0=14308 1=2386 (14.3% split) | leaf compound 0=27605 1=4672 (14.5% split) | 32x32 single 0=7920 1=5847 (42.5% split) | 32x32 compound 0=8142 1=4947 (37.8% split)
33+film B (2160p HDR source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
34+film B (2160p HDR source): filter intra on=true blocks 18014 (modes DC=4944 V=2455 H=2591 D157=6224 PAETH=1800)
35+| film B (2160p HDR source) 1920x1024 | 46.69 dB/34137 B, 48.03 dB/69950 B, 49.15 dB/149378 B, 50.29 dB/399139 B | +54.1% | +23.9% | 88.7s:22.9s:17.4s |
36+screen capture (2026-07-25 02-09-04.mkv): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective None
37+screen capture (2026-07-25 02-09-04.mkv): pricer armings default=155 real=0
38+screen capture (2026-07-25 02-09-04.mkv): motion_mode 32x32 SIMPLE=23654 OBMC=0 WARP=160 | 16x16 SIMPLE=1322 OBMC=0 WARP=318 | 8x8 SIMPLE=562 OBMC=0 WARP=576 (0.0% OBMC / 4.0% WARP of 26592 eligible)
39+screen capture (2026-07-25 02-09-04.mkv): inter var-tx depths of 34092 blocks -- leaf single 0=5772 1=7043 (55.0% split) | leaf compound 0=2826 1=2851 (50.2% split) | 32x32 single 0=6059 1=8017 (57.0% split) | 32x32 compound 0=860 1=664 (43.6% split)
40+screen capture (2026-07-25 02-09-04.mkv): screen frames on=48 off=0 (100.0% on); palette blocks luma 9907 chroma 1109; intrabc blocks 0 (searched 0 / valid 0 / won 0)
41+screen capture (2026-07-25 02-09-04.mkv): filter intra on=true blocks 8198 (modes DC=98 V=2410 H=5376 D157=223 PAETH=91)
42+| screen capture (2026-07-25 02-09-04.mkv) 1920x1024 | 45.87 dB/40155 B, 48.55 dB/51325 B, 50.86 dB/63998 B, 53.07 dB/80203 B | +33.4% | -23.8% | 50.0s:11.6s:15.5s |
43+test encode::tests::bd_rate_screen_native ... ok
44+
45+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 602 filtered out; finished in 519.46s
46+
47+RC=0
lanes/b64b/r1-on.logadded+47 -0
@@ -0,0 +1,47 @@
1+
2+running 1 test
3+
4+native crop, 12 frames, gop=12; tiles (0, 0), tile threads 1, intrabc false, palette maxcolors 128
5+| clip | ours PSNR/bytes per point | BD-rate vs libaom | BD-rate vs rav1e | wall ours:libaom:rav1e (noisy) |
6+|---|---|---|---|---|
7+bars 1080p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
8+bars 1080p: pricer armings default=17 real=185
9+bars 1080p: motion_mode 32x32 SIMPLE=36908 OBMC=0 WARP=163 | 16x16 SIMPLE=4594 OBMC=0 WARP=318 | 8x8 SIMPLE=18266 OBMC=0 WARP=1382 (0.0% OBMC / 3.0% WARP of 61631 eligible)
10+bars 1080p: inter var-tx depths of 11232 blocks -- leaf single 0=1669 1=1025 (38.0% split) | leaf compound 0=885 1=616 (41.0% split) | 32x32 single 0=756 1=1777 (70.2% split) | 32x32 compound 0=2250 1=2254 (50.0% split)
11+bars 1080p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
12+bars 1080p: filter intra on=true blocks 29028 (modes DC=6905 V=3000 H=5419 D157=9117 PAETH=4587)
13+test encode::tests::bd_rate_screen_native has been running for over 60 seconds
14+| bars 1080p 1920x1024 | 44.11 dB/217737 B, 47.66 dB/318868 B, 51.05 dB/440424 B, 54.26 dB/587284 B | +1.8% | -14.4% | 44.1s:9.2s:21.6s |
15+bars 2160p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
16+bars 2160p: pricer armings default=14 real=175
17+bars 2160p: motion_mode 32x32 SIMPLE=31585 OBMC=0 WARP=290 | 16x16 SIMPLE=2756 OBMC=0 WARP=678 | 8x8 SIMPLE=7509 OBMC=0 WARP=447 (0.0% OBMC / 3.3% WARP of 43265 eligible)
18+bars 2160p: inter var-tx depths of 9192 blocks -- leaf single 0=1220 1=600 (33.0% split) | leaf compound 0=1083 1=221 (16.9% split) | 32x32 single 0=371 1=1234 (76.9% split) | 32x32 compound 0=141 1=4322 (96.8% split)
19+bars 2160p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
20+bars 2160p: filter intra on=true blocks 12387 (modes DC=3329 V=811 H=2621 D157=3956 PAETH=1670)
21+| bars 2160p 1920x1024 | 43.68 dB/229668 B, 47.60 dB/340632 B, 51.18 dB/453178 B, 54.52 dB/582676 B | +12.3% | -10.2% | 42.0s:9.2s:26.8s |
22+film A (1080p source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
23+film A (1080p source): pricer armings default=20 real=214
24+film A (1080p source): motion_mode 32x32 SIMPLE=33077 OBMC=0 WARP=1298 | 16x16 SIMPLE=19240 OBMC=0 WARP=1887 | 8x8 SIMPLE=4708 OBMC=0 WARP=931 (0.0% OBMC / 6.7% WARP of 61141 eligible)
25+film A (1080p source): inter var-tx depths of 85244 blocks -- leaf single 0=15366 1=2875 (15.8% split) | leaf compound 0=31528 1=6450 (17.0% split) | 32x32 single 0=7510 1=5922 (44.1% split) | 32x32 compound 0=9593 1=6000 (38.5% split)
26+film A (1080p source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
27+film A (1080p source): filter intra on=true blocks 24000 (modes DC=6012 V=3472 H=4526 D157=6964 PAETH=3026)
28+| film A (1080p source) 1920x768 | 44.29 dB/73949 B, 45.82 dB/123906 B, 47.03 dB/213467 B, 48.28 dB/508664 B | +35.5% | +5.6% | 94.9s:13.6s:21.7s |
29+film B (2160p HDR source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
30+film B (2160p HDR source): pricer armings default=20 real=189
31+film B (2160p HDR source): motion_mode 32x32 SIMPLE=35371 OBMC=0 WARP=1194 | 16x16 SIMPLE=12510 OBMC=0 WARP=1144 | 8x8 SIMPLE=2069 OBMC=0 WARP=483 (0.0% OBMC / 5.3% WARP of 52771 eligible)
32+film B (2160p HDR source): inter var-tx depths of 75130 blocks -- leaf single 0=14148 1=2497 (15.0% split) | leaf compound 0=27160 1=4854 (15.2% split) | 32x32 single 0=8028 1=5889 (42.3% split) | 32x32 compound 0=7821 1=4733 (37.7% split)
33+film B (2160p HDR source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
34+film B (2160p HDR source): filter intra on=true blocks 17165 (modes DC=4796 V=2302 H=2518 D157=5821 PAETH=1728)
35+| film B (2160p HDR source) 1920x1024 | 46.91 dB/33324 B, 48.04 dB/67896 B, 49.10 dB/143229 B, 50.25 dB/388721 B | +47.8% | +17.1% | 86.8s:22.9s:18.0s |
36+screen capture (2026-07-25 02-09-04.mkv): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective None
37+screen capture (2026-07-25 02-09-04.mkv): pricer armings default=155 real=0
38+screen capture (2026-07-25 02-09-04.mkv): motion_mode 32x32 SIMPLE=7132 OBMC=0 WARP=150 | 16x16 SIMPLE=1241 OBMC=0 WARP=301 | 8x8 SIMPLE=538 OBMC=0 WARP=523 (0.0% OBMC / 9.9% WARP of 9885 eligible)
39+screen capture (2026-07-25 02-09-04.mkv): inter var-tx depths of 38200 blocks -- leaf single 0=2224 1=2714 (55.0% split) | leaf compound 0=7816 1=8960 (53.4% split) | 32x32 single 0=4619 1=6300 (57.7% split) | 32x32 compound 0=2607 1=2960 (53.2% split)
40+screen capture (2026-07-25 02-09-04.mkv): screen frames on=48 off=0 (100.0% on); palette blocks luma 9909 chroma 1109; intrabc blocks 0 (searched 0 / valid 0 / won 0)
41+screen capture (2026-07-25 02-09-04.mkv): filter intra on=true blocks 8200 (modes DC=97 V=2409 H=5380 D157=222 PAETH=92)
42+| screen capture (2026-07-25 02-09-04.mkv) 1920x1024 | 45.86 dB/40256 B, 48.56 dB/51515 B, 50.86 dB/64136 B, 53.07 dB/80386 B | +33.7% | -23.6% | 50.3s:11.8s:14.5s |
43+test encode::tests::bd_rate_screen_native ... ok
44+
45+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 602 filtered out; finished in 523.30s
46+
47+RC=0
lanes/b64b/r2-ship.logadded+47 -0
@@ -0,0 +1,47 @@
1+
2+running 1 test
3+
4+native crop, 12 frames, gop=12; tiles (0, 0), tile threads 1, intrabc false, palette maxcolors 128
5+| clip | ours PSNR/bytes per point | BD-rate vs libaom | BD-rate vs rav1e | wall ours:libaom:rav1e (noisy) |
6+|---|---|---|---|---|
7+bars 1080p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
8+bars 1080p: pricer armings default=17 real=185
9+bars 1080p: motion_mode 32x32 SIMPLE=36908 OBMC=0 WARP=163 | 16x16 SIMPLE=4594 OBMC=0 WARP=318 | 8x8 SIMPLE=18266 OBMC=0 WARP=1382 (0.0% OBMC / 3.0% WARP of 61631 eligible)
10+bars 1080p: inter var-tx depths of 11232 blocks -- leaf single 0=1669 1=1025 (38.0% split) | leaf compound 0=885 1=616 (41.0% split) | 32x32 single 0=756 1=1777 (70.2% split) | 32x32 compound 0=2250 1=2254 (50.0% split)
11+bars 1080p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
12+bars 1080p: filter intra on=true blocks 29028 (modes DC=6905 V=3000 H=5419 D157=9117 PAETH=4587)
13+test encode::tests::bd_rate_screen_native has been running for over 60 seconds
14+| bars 1080p 1920x1024 | 44.11 dB/217737 B, 47.66 dB/318868 B, 51.05 dB/440424 B, 54.26 dB/587284 B | +1.8% | -14.4% | 45.4s:11.3s:23.7s |
15+bars 2160p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
16+bars 2160p: pricer armings default=14 real=175
17+bars 2160p: motion_mode 32x32 SIMPLE=31585 OBMC=0 WARP=290 | 16x16 SIMPLE=2756 OBMC=0 WARP=678 | 8x8 SIMPLE=7509 OBMC=0 WARP=447 (0.0% OBMC / 3.3% WARP of 43265 eligible)
18+bars 2160p: inter var-tx depths of 9192 blocks -- leaf single 0=1220 1=600 (33.0% split) | leaf compound 0=1083 1=221 (16.9% split) | 32x32 single 0=371 1=1234 (76.9% split) | 32x32 compound 0=141 1=4322 (96.8% split)
19+bars 2160p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
20+bars 2160p: filter intra on=true blocks 12387 (modes DC=3329 V=811 H=2621 D157=3956 PAETH=1670)
21+| bars 2160p 1920x1024 | 43.68 dB/229668 B, 47.60 dB/340632 B, 51.18 dB/453178 B, 54.52 dB/582676 B | +12.3% | -10.2% | 45.8s:8.8s:20.6s |
22+film A (1080p source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
23+film A (1080p source): pricer armings default=20 real=214
24+film A (1080p source): motion_mode 32x32 SIMPLE=33077 OBMC=0 WARP=1298 | 16x16 SIMPLE=19240 OBMC=0 WARP=1887 | 8x8 SIMPLE=4708 OBMC=0 WARP=931 (0.0% OBMC / 6.7% WARP of 61141 eligible)
25+film A (1080p source): inter var-tx depths of 85244 blocks -- leaf single 0=15366 1=2875 (15.8% split) | leaf compound 0=31528 1=6450 (17.0% split) | 32x32 single 0=7510 1=5922 (44.1% split) | 32x32 compound 0=9593 1=6000 (38.5% split)
26+film A (1080p source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
27+film A (1080p source): filter intra on=true blocks 24000 (modes DC=6012 V=3472 H=4526 D157=6964 PAETH=3026)
28+| film A (1080p source) 1920x768 | 44.29 dB/73949 B, 45.82 dB/123906 B, 47.03 dB/213467 B, 48.28 dB/508664 B | +35.5% | +5.6% | 93.8s:14.5s:17.7s |
29+film B (2160p HDR source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
30+film B (2160p HDR source): pricer armings default=20 real=189
31+film B (2160p HDR source): motion_mode 32x32 SIMPLE=35371 OBMC=0 WARP=1194 | 16x16 SIMPLE=12510 OBMC=0 WARP=1144 | 8x8 SIMPLE=2069 OBMC=0 WARP=483 (0.0% OBMC / 5.3% WARP of 52771 eligible)
32+film B (2160p HDR source): inter var-tx depths of 75130 blocks -- leaf single 0=14148 1=2497 (15.0% split) | leaf compound 0=27160 1=4854 (15.2% split) | 32x32 single 0=8028 1=5889 (42.3% split) | 32x32 compound 0=7821 1=4733 (37.7% split)
33+film B (2160p HDR source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
34+film B (2160p HDR source): filter intra on=true blocks 17165 (modes DC=4796 V=2302 H=2518 D157=5821 PAETH=1728)
35+| film B (2160p HDR source) 1920x1024 | 46.91 dB/33324 B, 48.04 dB/67896 B, 49.10 dB/143229 B, 50.25 dB/388721 B | +47.8% | +17.1% | 88.0s:24.0s:17.7s |
36+screen capture (2026-07-25 02-09-04.mkv): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective None
37+screen capture (2026-07-25 02-09-04.mkv): pricer armings default=155 real=0
38+screen capture (2026-07-25 02-09-04.mkv): motion_mode 32x32 SIMPLE=23654 OBMC=0 WARP=160 | 16x16 SIMPLE=1322 OBMC=0 WARP=318 | 8x8 SIMPLE=562 OBMC=0 WARP=576 (0.0% OBMC / 4.0% WARP of 26592 eligible)
39+screen capture (2026-07-25 02-09-04.mkv): inter var-tx depths of 34092 blocks -- leaf single 0=5772 1=7043 (55.0% split) | leaf compound 0=2826 1=2851 (50.2% split) | 32x32 single 0=6059 1=8017 (57.0% split) | 32x32 compound 0=860 1=664 (43.6% split)
40+screen capture (2026-07-25 02-09-04.mkv): screen frames on=48 off=0 (100.0% on); palette blocks luma 9907 chroma 1109; intrabc blocks 0 (searched 0 / valid 0 / won 0)
41+screen capture (2026-07-25 02-09-04.mkv): filter intra on=true blocks 8198 (modes DC=98 V=2410 H=5376 D157=223 PAETH=91)
42+| screen capture (2026-07-25 02-09-04.mkv) 1920x1024 | 45.87 dB/40155 B, 48.55 dB/51325 B, 50.86 dB/63998 B, 53.07 dB/80203 B | +33.4% | -23.8% | 47.9s:15.4s:15.4s |
43+test encode::tests::bd_rate_screen_native ... ok
44+
45+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 602 filtered out; finished in 521.63s
46+
47+RC=0
lanes/b64b/r3-off.logadded+52 -0
@@ -0,0 +1,52 @@
1+
2+running 1 test
3+
4+native crop, 12 frames, gop=12; tiles (0, 0), tile threads 1, intrabc false, palette maxcolors 128
5+| clip | ours PSNR/bytes per point | BD-rate vs libaom | BD-rate vs rav1e | wall ours:libaom:rav1e (noisy) |
6+|---|---|---|---|---|
7+bars 1080p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
8+bars 1080p: pricer armings default=17 real=185
9+bars 1080p: 64x64 roots 17555 (with a residual 12507, split luma 0, compound 6018)
10+bars 1080p: motion_mode 32x32 SIMPLE=36908 OBMC=0 WARP=163 | 16x16 SIMPLE=4594 OBMC=0 WARP=318 | 8x8 SIMPLE=18266 OBMC=0 WARP=1382 (0.0% OBMC / 3.0% WARP of 61631 eligible)
11+bars 1080p: inter var-tx depths of 11232 blocks -- leaf single 0=1669 1=1025 (38.0% split) | leaf compound 0=885 1=616 (41.0% split) | 32x32 single 0=756 1=1777 (70.2% split) | 32x32 compound 0=2250 1=2254 (50.0% split)
12+bars 1080p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
13+bars 1080p: filter intra on=true blocks 29028 (modes DC=6905 V=3000 H=5419 D157=9117 PAETH=4587)
14+test encode::tests::bd_rate_screen_native has been running for over 60 seconds
15+| bars 1080p 1920x1024 | 44.11 dB/217737 B, 47.66 dB/318868 B, 51.05 dB/440424 B, 54.26 dB/587284 B | +1.8% | -14.4% | 51.7s:9.5s:22.1s |
16+bars 2160p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
17+bars 2160p: pricer armings default=14 real=175
18+bars 2160p: 64x64 roots 18459 (with a residual 12291, split luma 0, compound 5326)
19+bars 2160p: motion_mode 32x32 SIMPLE=31585 OBMC=0 WARP=290 | 16x16 SIMPLE=2756 OBMC=0 WARP=678 | 8x8 SIMPLE=7509 OBMC=0 WARP=447 (0.0% OBMC / 3.3% WARP of 43265 eligible)
20+bars 2160p: inter var-tx depths of 9192 blocks -- leaf single 0=1220 1=600 (33.0% split) | leaf compound 0=1083 1=221 (16.9% split) | 32x32 single 0=371 1=1234 (76.9% split) | 32x32 compound 0=141 1=4322 (96.8% split)
21+bars 2160p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
22+bars 2160p: filter intra on=true blocks 12387 (modes DC=3329 V=811 H=2621 D157=3956 PAETH=1670)
23+| bars 2160p 1920x1024 | 43.68 dB/229668 B, 47.60 dB/340632 B, 51.18 dB/453178 B, 54.52 dB/582676 B | +12.3% | -10.2% | 39.8s:8.4s:21.4s |
24+film A (1080p source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
25+film A (1080p source): pricer armings default=20 real=214
26+film A (1080p source): 64x64 roots 9141 (with a residual 5770, split luma 0, compound 3559)
27+film A (1080p source): motion_mode 32x32 SIMPLE=33077 OBMC=0 WARP=1298 | 16x16 SIMPLE=19240 OBMC=0 WARP=1887 | 8x8 SIMPLE=4708 OBMC=0 WARP=931 (0.0% OBMC / 6.7% WARP of 61141 eligible)
28+film A (1080p source): inter var-tx depths of 85244 blocks -- leaf single 0=15366 1=2875 (15.8% split) | leaf compound 0=31528 1=6450 (17.0% split) | 32x32 single 0=7510 1=5922 (44.1% split) | 32x32 compound 0=9593 1=6000 (38.5% split)
29+film A (1080p source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
30+film A (1080p source): filter intra on=true blocks 24000 (modes DC=6012 V=3472 H=4526 D157=6964 PAETH=3026)
31+| film A (1080p source) 1920x768 | 44.29 dB/73949 B, 45.82 dB/123906 B, 47.03 dB/213467 B, 48.28 dB/508664 B | +35.5% | +5.6% | 102.7s:12.6s:19.0s |
32+film B (2160p HDR source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
33+film B (2160p HDR source): pricer armings default=20 real=189
34+film B (2160p HDR source): 64x64 roots 15248 (with a residual 6204, split luma 0, compound 6913)
35+film B (2160p HDR source): motion_mode 32x32 SIMPLE=35371 OBMC=0 WARP=1194 | 16x16 SIMPLE=12510 OBMC=0 WARP=1144 | 8x8 SIMPLE=2069 OBMC=0 WARP=483 (0.0% OBMC / 5.3% WARP of 52771 eligible)
36+film B (2160p HDR source): inter var-tx depths of 75130 blocks -- leaf single 0=14148 1=2497 (15.0% split) | leaf compound 0=27160 1=4854 (15.2% split) | 32x32 single 0=8028 1=5889 (42.3% split) | 32x32 compound 0=7821 1=4733 (37.7% split)
37+film B (2160p HDR source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
38+film B (2160p HDR source): filter intra on=true blocks 17165 (modes DC=4796 V=2302 H=2518 D157=5821 PAETH=1728)
39+| film B (2160p HDR source) 1920x1024 | 46.91 dB/33324 B, 48.04 dB/67896 B, 49.10 dB/143229 B, 50.25 dB/388721 B | +47.8% | +17.1% | 90.1s:23.4s:19.3s |
40+screen capture (2026-07-25 02-09-04.mkv): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective None
41+screen capture (2026-07-25 02-09-04.mkv): pricer armings default=155 real=0
42+screen capture (2026-07-25 02-09-04.mkv): 64x64 roots 20558 (with a residual 0, split luma 0, compound 0)
43+screen capture (2026-07-25 02-09-04.mkv): motion_mode 32x32 SIMPLE=23654 OBMC=0 WARP=160 | 16x16 SIMPLE=1322 OBMC=0 WARP=318 | 8x8 SIMPLE=562 OBMC=0 WARP=576 (0.0% OBMC / 4.0% WARP of 26592 eligible)
44+screen capture (2026-07-25 02-09-04.mkv): inter var-tx depths of 34092 blocks -- leaf single 0=5772 1=7043 (55.0% split) | leaf compound 0=2826 1=2851 (50.2% split) | 32x32 single 0=6059 1=8017 (57.0% split) | 32x32 compound 0=860 1=664 (43.6% split)
45+screen capture (2026-07-25 02-09-04.mkv): screen frames on=48 off=0 (100.0% on); palette blocks luma 9907 chroma 1109; intrabc blocks 0 (searched 0 / valid 0 / won 0)
46+screen capture (2026-07-25 02-09-04.mkv): filter intra on=true blocks 8198 (modes DC=98 V=2410 H=5376 D157=223 PAETH=91)
47+| screen capture (2026-07-25 02-09-04.mkv) 1920x1024 | 45.87 dB/40155 B, 48.55 dB/51325 B, 50.86 dB/63998 B, 53.07 dB/80203 B | +33.4% | -23.8% | 51.8s:13.1s:12.7s |
48+test encode::tests::bd_rate_screen_native ... ok
49+
50+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 603 filtered out; finished in 532.80s
51+
52+RC=0
lanes/b64b/r3-on.logadded+52 -0
@@ -0,0 +1,52 @@
1+
2+running 1 test
3+
4+native crop, 12 frames, gop=12; tiles (0, 0), tile threads 1, intrabc false, palette maxcolors 128
5+| clip | ours PSNR/bytes per point | BD-rate vs libaom | BD-rate vs rav1e | wall ours:libaom:rav1e (noisy) |
6+|---|---|---|---|---|
7+bars 1080p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
8+bars 1080p: pricer armings default=17 real=182
9+bars 1080p: 64x64 roots 17585 (with a residual 12602, split luma 3076, compound 6371)
10+bars 1080p: motion_mode 32x32 SIMPLE=35093 OBMC=0 WARP=153 | 16x16 SIMPLE=4272 OBMC=0 WARP=354 | 8x8 SIMPLE=17673 OBMC=0 WARP=1245 (0.0% OBMC / 3.0% WARP of 58790 eligible)
11+bars 1080p: inter var-tx depths of 11083 blocks -- leaf single 0=1579 1=1035 (39.6% split) | leaf compound 0=903 1=595 (39.7% split) | 32x32 single 0=767 1=1743 (69.4% split) | 32x32 compound 0=2256 1=2205 (49.4% split)
12+bars 1080p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
13+bars 1080p: filter intra on=true blocks 28167 (modes DC=6817 V=3003 H=5194 D157=8847 PAETH=4306)
14+test encode::tests::bd_rate_screen_native has been running for over 60 seconds
15+| bars 1080p 1920x1024 | 44.12 dB/216837 B, 47.67 dB/318361 B, 51.05 dB/440558 B, 54.26 dB/586929 B | +1.6% | -14.6% | 52.5s:9.7s:22.2s |
16+bars 2160p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
17+bars 2160p: pricer armings default=14 real=173
18+bars 2160p: 64x64 roots 18446 (with a residual 12409, split luma 2477, compound 5387)
19+bars 2160p: motion_mode 32x32 SIMPLE=30626 OBMC=0 WARP=222 | 16x16 SIMPLE=2726 OBMC=0 WARP=566 | 8x8 SIMPLE=7636 OBMC=0 WARP=418 (0.0% OBMC / 2.9% WARP of 42194 eligible)
20+bars 2160p: inter var-tx depths of 9120 blocks -- leaf single 0=1142 1=574 (33.4% split) | leaf compound 0=1080 1=256 (19.2% split) | 32x32 single 0=355 1=1244 (77.8% split) | 32x32 compound 0=149 1=4320 (96.7% split)
21+bars 2160p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
22+bars 2160p: filter intra on=true blocks 12137 (modes DC=3244 V=758 H=2570 D157=3957 PAETH=1608)
23+| bars 2160p 1920x1024 | 43.69 dB/230153 B, 47.60 dB/340963 B, 51.19 dB/453726 B, 54.53 dB/583931 B | +12.4% | -10.1% | 40.8s:8.0s:21.4s |
24+film A (1080p source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
25+film A (1080p source): pricer armings default=20 real=211
26+film A (1080p source): 64x64 roots 9159 (with a residual 6146, split luma 2873, compound 3543)
27+film A (1080p source): motion_mode 32x32 SIMPLE=31944 OBMC=0 WARP=1354 | 16x16 SIMPLE=19551 OBMC=0 WARP=1774 | 8x8 SIMPLE=4749 OBMC=0 WARP=962 (0.0% OBMC / 6.8% WARP of 60334 eligible)
28+film A (1080p source): inter var-tx depths of 84842 blocks -- leaf single 0=15228 1=2939 (16.2% split) | leaf compound 0=31338 1=6470 (17.1% split) | 32x32 single 0=7351 1=5988 (44.9% split) | 32x32 compound 0=9568 1=5960 (38.4% split)
29+film A (1080p source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
30+film A (1080p source): filter intra on=true blocks 23894 (modes DC=5941 V=3527 H=4575 D157=6839 PAETH=3012)
31+| film A (1080p source) 1920x768 | 44.31 dB/74014 B, 45.82 dB/124228 B, 47.04 dB/213754 B, 48.28 dB/508682 B | +35.4% | +5.4% | 103.0s:12.6s:20.2s |
32+film B (2160p HDR source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
33+film B (2160p HDR source): pricer armings default=20 real=189
34+film B (2160p HDR source): 64x64 roots 15308 (with a residual 6604, split luma 1942, compound 6976)
35+film B (2160p HDR source): motion_mode 32x32 SIMPLE=35188 OBMC=0 WARP=1176 | 16x16 SIMPLE=12759 OBMC=0 WARP=1063 | 8x8 SIMPLE=2051 OBMC=0 WARP=455 (0.0% OBMC / 5.1% WARP of 52692 eligible)
36+film B (2160p HDR source): inter var-tx depths of 75568 blocks -- leaf single 0=14462 1=2522 (14.8% split) | leaf compound 0=27231 1=4839 (15.1% split) | 32x32 single 0=8006 1=5955 (42.7% split) | 32x32 compound 0=7857 1=4696 (37.4% split)
37+film B (2160p HDR source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
38+film B (2160p HDR source): filter intra on=true blocks 17092 (modes DC=4751 V=2305 H=2503 D157=5823 PAETH=1710)
39+| film B (2160p HDR source) 1920x1024 | 46.94 dB/33616 B, 48.04 dB/68149 B, 49.11 dB/143984 B, 50.25 dB/388383 B | +47.6% | +17.0% | 89.9s:23.3s:19.0s |
40+screen capture (2026-07-25 02-09-04.mkv): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective None
41+screen capture (2026-07-25 02-09-04.mkv): pricer armings default=155 real=0
42+screen capture (2026-07-25 02-09-04.mkv): 64x64 roots 20558 (with a residual 0, split luma 0, compound 0)
43+screen capture (2026-07-25 02-09-04.mkv): motion_mode 32x32 SIMPLE=23654 OBMC=0 WARP=160 | 16x16 SIMPLE=1322 OBMC=0 WARP=318 | 8x8 SIMPLE=562 OBMC=0 WARP=576 (0.0% OBMC / 4.0% WARP of 26592 eligible)
44+screen capture (2026-07-25 02-09-04.mkv): inter var-tx depths of 34092 blocks -- leaf single 0=5772 1=7043 (55.0% split) | leaf compound 0=2826 1=2851 (50.2% split) | 32x32 single 0=6059 1=8017 (57.0% split) | 32x32 compound 0=860 1=664 (43.6% split)
45+screen capture (2026-07-25 02-09-04.mkv): screen frames on=48 off=0 (100.0% on); palette blocks luma 9907 chroma 1109; intrabc blocks 0 (searched 0 / valid 0 / won 0)
46+screen capture (2026-07-25 02-09-04.mkv): filter intra on=true blocks 8198 (modes DC=98 V=2410 H=5376 D157=223 PAETH=91)
47+| screen capture (2026-07-25 02-09-04.mkv) 1920x1024 | 45.87 dB/40155 B, 48.55 dB/51325 B, 50.86 dB/63998 B, 53.07 dB/80203 B | +33.4% | -23.8% | 51.3s:12.8s:12.7s |
48+test encode::tests::bd_rate_screen_native ... ok
49+
50+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 603 filtered out; finished in 533.65s
51+
52+RC=0
lanes/b64b/ship-12.logadded+52 -0
@@ -0,0 +1,52 @@
1+
2+running 1 test
3+
4+native crop, 12 frames, gop=12; tiles (0, 0), tile threads 1, intrabc false, palette maxcolors 128
5+| clip | ours PSNR/bytes per point | BD-rate vs libaom | BD-rate vs rav1e | wall ours:libaom:rav1e (noisy) |
6+|---|---|---|---|---|
7+bars 1080p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
8+bars 1080p: pricer armings default=17 real=182
9+bars 1080p: 64x64 roots 17585 (with a residual 12602, split luma 3076, compound 6371)
10+bars 1080p: motion_mode 32x32 SIMPLE=35093 OBMC=0 WARP=153 | 16x16 SIMPLE=4272 OBMC=0 WARP=354 | 8x8 SIMPLE=17673 OBMC=0 WARP=1245 (0.0% OBMC / 3.0% WARP of 58790 eligible)
11+bars 1080p: inter var-tx depths of 11083 blocks -- leaf single 0=1579 1=1035 (39.6% split) | leaf compound 0=903 1=595 (39.7% split) | 32x32 single 0=767 1=1743 (69.4% split) | 32x32 compound 0=2256 1=2205 (49.4% split)
12+bars 1080p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
13+bars 1080p: filter intra on=true blocks 28167 (modes DC=6817 V=3003 H=5194 D157=8847 PAETH=4306)
14+test encode::tests::bd_rate_screen_native has been running for over 60 seconds
15+| bars 1080p 1920x1024 | 44.12 dB/216837 B, 47.67 dB/318361 B, 51.05 dB/440558 B, 54.26 dB/586929 B | +1.6% | -14.6% | 43.5s:8.1s:21.8s |
16+bars 2160p: sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
17+bars 2160p: pricer armings default=14 real=173
18+bars 2160p: 64x64 roots 18446 (with a residual 12409, split luma 2477, compound 5387)
19+bars 2160p: motion_mode 32x32 SIMPLE=30626 OBMC=0 WARP=222 | 16x16 SIMPLE=2726 OBMC=0 WARP=566 | 8x8 SIMPLE=7636 OBMC=0 WARP=418 (0.0% OBMC / 2.9% WARP of 42194 eligible)
20+bars 2160p: inter var-tx depths of 9120 blocks -- leaf single 0=1142 1=574 (33.4% split) | leaf compound 0=1080 1=256 (19.2% split) | 32x32 single 0=355 1=1244 (77.8% split) | 32x32 compound 0=149 1=4320 (96.7% split)
21+bars 2160p: screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
22+bars 2160p: filter intra on=true blocks 12137 (modes DC=3244 V=758 H=2570 D157=3957 PAETH=1608)
23+| bars 2160p 1920x1024 | 43.69 dB/230153 B, 47.60 dB/340963 B, 51.19 dB/453726 B, 54.53 dB/583931 B | +12.4% | -10.1% | 35.6s:6.7s:19.0s |
24+film A (1080p source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
25+film A (1080p source): pricer armings default=20 real=211
26+film A (1080p source): 64x64 roots 9159 (with a residual 6146, split luma 2873, compound 3543)
27+film A (1080p source): motion_mode 32x32 SIMPLE=31944 OBMC=0 WARP=1354 | 16x16 SIMPLE=19551 OBMC=0 WARP=1774 | 8x8 SIMPLE=4749 OBMC=0 WARP=962 (0.0% OBMC / 6.8% WARP of 60334 eligible)
28+film A (1080p source): inter var-tx depths of 84842 blocks -- leaf single 0=15228 1=2939 (16.2% split) | leaf compound 0=31338 1=6470 (17.1% split) | 32x32 single 0=7351 1=5988 (44.9% split) | 32x32 compound 0=9568 1=5960 (38.4% split)
29+film A (1080p source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
30+film A (1080p source): filter intra on=true blocks 23894 (modes DC=5941 V=3527 H=4575 D157=6839 PAETH=3012)
31+| film A (1080p source) 1920x768 | 44.31 dB/74014 B, 45.82 dB/124228 B, 47.04 dB/213754 B, 48.28 dB/508682 B | +35.4% | +5.4% | 82.8s:12.8s:18.9s |
32+film B (2160p HDR source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
33+film B (2160p HDR source): pricer armings default=20 real=189
34+film B (2160p HDR source): 64x64 roots 15308 (with a residual 6604, split luma 1942, compound 6976)
35+film B (2160p HDR source): motion_mode 32x32 SIMPLE=35188 OBMC=0 WARP=1176 | 16x16 SIMPLE=12759 OBMC=0 WARP=1063 | 8x8 SIMPLE=2051 OBMC=0 WARP=455 (0.0% OBMC / 5.1% WARP of 52692 eligible)
36+film B (2160p HDR source): inter var-tx depths of 75568 blocks -- leaf single 0=14462 1=2522 (14.8% split) | leaf compound 0=27231 1=4839 (15.1% split) | 32x32 single 0=8006 1=5955 (42.7% split) | 32x32 compound 0=7857 1=4696 (37.4% split)
37+film B (2160p HDR source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
38+film B (2160p HDR source): filter intra on=true blocks 17092 (modes DC=4751 V=2305 H=2503 D157=5823 PAETH=1710)
39+| film B (2160p HDR source) 1920x1024 | 46.94 dB/33616 B, 48.04 dB/68149 B, 49.11 dB/143984 B, 50.25 dB/388383 B | +47.6% | +17.0% | 83.1s:21.2s:16.6s |
40+screen capture (2026-07-25 02-09-04.mkv): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective None
41+screen capture (2026-07-25 02-09-04.mkv): pricer armings default=155 real=0
42+screen capture (2026-07-25 02-09-04.mkv): 64x64 roots 20558 (with a residual 0, split luma 0, compound 0)
43+screen capture (2026-07-25 02-09-04.mkv): motion_mode 32x32 SIMPLE=23654 OBMC=0 WARP=160 | 16x16 SIMPLE=1322 OBMC=0 WARP=318 | 8x8 SIMPLE=562 OBMC=0 WARP=576 (0.0% OBMC / 4.0% WARP of 26592 eligible)
44+screen capture (2026-07-25 02-09-04.mkv): inter var-tx depths of 34092 blocks -- leaf single 0=5772 1=7043 (55.0% split) | leaf compound 0=2826 1=2851 (50.2% split) | 32x32 single 0=6059 1=8017 (57.0% split) | 32x32 compound 0=860 1=664 (43.6% split)
45+screen capture (2026-07-25 02-09-04.mkv): screen frames on=48 off=0 (100.0% on); palette blocks luma 9907 chroma 1109; intrabc blocks 0 (searched 0 / valid 0 / won 0)
46+screen capture (2026-07-25 02-09-04.mkv): filter intra on=true blocks 8198 (modes DC=98 V=2410 H=5376 D157=223 PAETH=91)
47+| screen capture (2026-07-25 02-09-04.mkv) 1920x1024 | 45.87 dB/40155 B, 48.55 dB/51325 B, 50.86 dB/63998 B, 53.07 dB/80203 B | +33.4% | -23.8% | 43.2s:10.9s:16.1s |
48+test encode::tests::bd_rate_screen_native ... ok
49+
50+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 604 filtered out; finished in 471.82s
51+
52+RC=0
lanes/b64b/ship-lg.logadded+28 -0
@@ -0,0 +1,28 @@
1+
2+running 1 test
3+
4+native crop, 48 frames, gop=48; tiles (0, 0), tile threads 1, intrabc false, palette maxcolors 128
5+| clip | ours PSNR/bytes per point | BD-rate vs libaom | BD-rate vs rav1e | wall ours:libaom:rav1e (noisy) |
6+|---|---|---|---|---|
7+test encode::tests::bd_rate_film_long_gop has been running for over 60 seconds
8+film A (1080p source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
9+film A (1080p source): pricer armings default=20 real=914
10+film A (1080p source): 64x64 roots 37956 (with a residual 29069, split luma 13979, compound 20454)
11+film A (1080p source): motion_mode 32x32 SIMPLE=110256 OBMC=0 WARP=5364 | 16x16 SIMPLE=70639 OBMC=0 WARP=8484 | 8x8 SIMPLE=24386 OBMC=0 WARP=4175 (0.0% OBMC / 8.1% WARP of 223304 eligible)
12+film A (1080p source): inter var-tx depths of 368368 blocks -- leaf single 0=54189 1=11591 (17.6% split) | leaf compound 0=143138 1=34825 (19.6% split) | 32x32 single 0=27727 1=21869 (44.1% split) | 32x32 compound 0=43580 1=31449 (41.9% split)
13+film A (1080p source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
14+film A (1080p source): filter intra on=true blocks 108179 (modes DC=26484 V=15961 H=20634 D157=30138 PAETH=14962)
15+| film A (1080p source) 1920x768 | 44.39 dB/214863 B, 45.95 dB/382467 B, 47.11 dB/678120 B, 48.22 dB/1559181 B | +39.2% | +1.3% | 349.5s:37.0s:61.6s |
16+film B (2160p HDR source): sequence, pyramid requested Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 }) effective Some(Pyramid { mini_gop: 8, arf_q_offset: -32, leaf_q_offset: 12, mid_q_offset: Some(-8), quarter_q_offset: None, key_q_offset: -48 })
17+film B (2160p HDR source): pricer armings default=20 real=809
18+film B (2160p HDR source): 64x64 roots 65052 (with a residual 21582, split luma 7182, compound 33309)
19+film B (2160p HDR source): motion_mode 32x32 SIMPLE=137733 OBMC=0 WARP=3986 | 16x16 SIMPLE=55701 OBMC=0 WARP=4167 | 8x8 SIMPLE=14788 OBMC=0 WARP=2226 (0.0% OBMC / 4.7% WARP of 218601 eligible)
20+film B (2160p HDR source): inter var-tx depths of 326918 blocks -- leaf single 0=52760 1=12425 (19.1% split) | leaf compound 0=112608 1=26391 (19.0% split) | 32x32 single 0=31963 1=28897 (47.5% split) | 32x32 compound 0=33390 1=28484 (46.0% split)
21+film B (2160p HDR source): screen frames on=0 off=4 (0.0% on); palette blocks luma 0 chroma 0; intrabc blocks 0 (searched 0 / valid 0 / won 0)
22+film B (2160p HDR source): filter intra on=true blocks 68560 (modes DC=18004 V=9535 H=10010 D157=24205 PAETH=6806)
23+| film B (2160p HDR source) 1920x1024 | 46.90 dB/87437 B, 48.01 dB/191846 B, 48.94 dB/439618 B, 50.01 dB/1209815 B | +118.5% | +25.1% | 276.4s:74.4s:60.2s |
24+test encode::tests::bd_rate_film_long_gop ... ok
25+
26+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 604 filtered out; finished in 890.44s
27+
28+RC=0