forge
Explore
Log in

Don't you dare go Hollow

Compound references at the 64x64 root

Browse files at this commit

52db304f71532fb67f4cdb76e0f15020bb1c25f4Ahmet Kaan GümüşParent: eabe538
  • feat
    • compound references at the 64x64 root
Show full message
feat(av1): compound references at the 64x64 root

The 64 root offered only single-reference LAST. It now also prices the
LAST + GOLDEN/ALTREF pairs at NEAREST_NEARESTMV, GLOBAL_GLOBALMV and
NEW_NEARESTMV (the NEW half is the vector the root's own search already
found -- the two remaining modes need the second reference's own NEWMV
vector, i.e. a second 64x64 search, which is the wall this root exists
to save), and the writer's Whole64 arm codes one through
write_compound_block at SB_MI 16 with no motion_mode symbol.

EC_AV1_B64COMP=0 restores the single-reference root.
crates/ec-av1/src/encode.rsmodified+230 -3
@@ -467,6 +467,32 @@ pub fn take_b64_residual_hits() -> usize {
467467 B64_RESIDUAL_HITS.swap(0, std::sync::atomic::Ordering::Relaxed)
468468 }
469469
470+/// Whether the 64x64 root also prices COMPOUND candidates (lane-b64b): the
471+/// `LAST` + extra-reference pairs the 32x32 level already offers, at the
472+/// three modes a root can form without a second 64x64 motion search --
473+/// `NEAREST_NEARESTMV`, `GLOBAL_GLOBALMV` and `NEW_NEARESTMV` (whose NEW half
474+/// is the vector `search_skip_64`'s own single-reference search already
475+/// found). `NEAREST_NEWMV`/`NEW_NEWMV` need the SECOND reference's own
476+/// `NEWMV` vector, which only a second search per superblock produces -- the
477+/// wall this root exists to save -- so they are not offered here.
478+///
479+/// Off by `EC_AV1_B64COMP=0`, so both arms measure on one build.
480+fn b64_compound() -> bool {
481+ static ENV: std::sync::LazyLock<Option<bool>> = std::sync::LazyLock::new(|| {
482+ crate::envflags::var("EC_AV1_B64COMP").ok().map(|v| v != "0")
483+ });
484+ ENV.unwrap_or(true) && b64_root()
485+}
486+
487+/// How many 64x64 roots took a COMPOUND candidate since the last
488+/// [`take_b64_compound_hits`] (class `gate-blind-to-feature`).
489+static B64_COMPOUND_HITS: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);
490+
491+/// The compound 64x64-root count since the last call, and zero it.
492+pub fn take_b64_compound_hits() -> usize {
493+ B64_COMPOUND_HITS.swap(0, std::sync::atomic::Ordering::Relaxed)
494+}
495+
470496 /// Whether the encoder searches loop restoration at all (spec 7.17): one
471497 /// Wiener filter per 64x64 luma restoration unit, picked from
472498 /// [`crate::filter_search::WIENER_CANDIDATES`]. Swept by `EC_AV1_LR` in a
@@ -7308,6 +7334,42 @@ fn predict_u8(
73087334 prediction.iter().map(|&v| v as u8).collect()
73097335 }
73107336
7337+/// [`predict_u8`]'s compound counterpart, on the heap because a 64x64 root's
7338+/// side is twice what [`mc_trial_compound`]'s fixed trial buffers hold: both
7339+/// references predict into the `CONV_BUF` intermediate domain and are blended
7340+/// at the simple-average split `(8, 8)`, the same path (and so the same
7341+/// samples) a `comp_group_idx == 0`, `compound_idx == 1` decoder computes.
7342+fn predict_compound_u8(
7343+ ref0: (&[u16], usize, usize, usize),
7344+ ref1: (&[u16], usize, usize, usize),
7345+ (x, y): (usize, usize),
7346+ side: usize,
7347+ (mv0, mv1): ((i32, i32), (i32, i32)),
7348+ luma: bool,
7349+ fctx: &crate::decode::FrameCtx,
7350+) -> Vec<u8> {
7351+ let mut inter = [vec![0i32; side * side], vec![0i32; side * side]];
7352+ for ((mv, r), dst) in [(mv0, ref0), (mv1, ref1)].into_iter().zip(inter.iter_mut()) {
7353+ mc::predict_compound_intermediate(
7354+ r.0,
7355+ r.1,
7356+ r.2,
7357+ r.3,
7358+ mv_to_q4(x, mv.1, luma),
7359+ mv_to_q4(y, mv.0, luma),
7360+ mc::REF_NO_SCALE,
7361+ side,
7362+ side,
7363+ mc::InterpFilterKind::Regular,
7364+ mc::InterpFilterKind::Regular,
7365+ dst,
7366+ );
7367+ }
7368+ let mut blended = vec![0u16; side * side];
7369+ mc::combine_compound(&inter[0], &inter[1], 8, 8, &mut blended, fctx);
7370+ blended.iter().map(|&v| v as u8).collect()
7371+}
7372+
73117373 /// The 64x64 `PARTITION_NONE` candidate for a whole superblock ([`B64_ROOT`]):
73127374 /// single-reference LAST at `NEARESTMV`/`GLOBALMV`/`NEARMV`/`NEWMV`, coded
73137375 /// SKIP, priced through the same `symbol_bits` path every other candidate
@@ -7328,6 +7390,10 @@ fn search_skip_64(
73287390 residual: bool,
73297391 reference: &Picture,
73307392 stack: &MvStack,
7393+ // The COMPOUND stack of each `LAST` + extra-reference pair at THIS
7394+ // superblock's 16x16-mi window, built off the same grid the tile writer
7395+ // rebuilds it from (empty unless the frame carries `reference_select`).
7396+ compound: &[(i8, &Picture, crate::mvstack::CompoundMvStack)],
73317397 fctx: &crate::decode::FrameCtx,
73327398 ) -> Option<(f64, BlockCoeffs)> {
73337399 let side = SUPERBLOCK;
@@ -7366,6 +7432,9 @@ fn search_skip_64(
73667432 ));
73677433 }
73687434 }
7435+ // `LAST`'s own `NEWMV` vector, kept for the compound `NEW_NEARESTMV`
7436+ // candidate below to pair with the second reference's NEAREST half.
7437+ let mut last_new_mv: Option<(i32, i32)> = None;
73697438 if leaf_new_mv() {
73707439 let source_block = luma.source_block(x, y, side);
73717440 let (seeds, seed_n) = mv_seeds(stack);
@@ -7387,6 +7456,7 @@ fn search_skip_64(
73877456 );
73887457 let mv = round_to_valid_mv(found.mv, stack.pred_mv);
73897458 if let Some((bits, ref_mv_idx)) = best_new_mv_syntax(stack, mv) {
7459+ last_new_mv = Some(mv);
73907460 cands.push((
73917461 symbol_bits(&cdf::NEW_MV[stack.new_mv_ctx], 0) + bits,
73927462 info_of(InterMode::NewMv, mv, ref_mv_idx),
@@ -7438,10 +7508,127 @@ fn search_skip_64(
74387508 + trials[2].sse
74397509 + search.lambda * (fixed + bits);
74407510 if best.as_ref().is_none_or(|b| cost < b.0) {
7441- best = Some((cost, bits, info, trials));
7511+ best = Some((cost, fixed + bits, info, trials));
74427512 }
74437513 }
7444- let (skip_cost, bits, info, skip_trials) = best?;
7514+
7515+ // lane-b64b: the COMPOUND candidates at the 64 root, the same three a
7516+ // superblock can form without a second motion search ([`b64_compound`]),
7517+ // priced through the same `symbol_bits` path -- `fixed` minus the single
7518+ // reference's tree, plus the pair tree and the compound mode.
7519+ for (ref1, g, cstack) in compound.iter().filter(|_| b64_compound()) {
7520+ let (ref1, g) = (*ref1, *g);
7521+ let uni = (crate::mvstack::BWDREF_FRAME..=crate::mvstack::ALTREF_FRAME).contains(&ref1);
7522+ let pair_bits = symbol_bits(&cdf::COMP_MODE[0], 1)
7523+ + if uni {
7524+ symbol_bits(&cdf::COMP_REF_TYPE[0], 1)
7525+ + symbol_bits(&cdf::COMP_REF[0][0], 0)
7526+ + symbol_bits(&cdf::COMP_REF[0][1], 0)
7527+ + symbol_bits(&cdf::COMP_BWDREF[0][0], 1)
7528+ } else {
7529+ symbol_bits(&cdf::COMP_REF_TYPE[0], 0)
7530+ + symbol_bits(&cdf::UNI_COMP_REF[0][0], 0)
7531+ + symbol_bits(&cdf::UNI_COMP_REF[0][1], 1)
7532+ + symbol_bits(&cdf::UNI_COMP_REF[0][2], 1)
7533+ };
7534+ let mode_ctx =
7535+ cdf::COMPOUND_MODE_CTX_MAP[cstack.ref_mv_ctx >> 1][cstack.new_mv_ctx.min(4)];
7536+ let mode_bits_of =
7537+ |mode: usize| pair_bits + symbol_bits(&cdf::INTER_COMPOUND_MODE[mode_ctx], mode);
7538+ let compound_info = |mode: InterMode, mvs: ((i32, i32), (i32, i32))| InterInfo {
7539+ ref1: Some(ref1),
7540+ mv1: mvs.1,
7541+ ref_frame: crate::mvstack::LAST_FRAME,
7542+ mode,
7543+ mv: mvs.0,
7544+ ref_mv_idx: 0,
7545+ };
7546+ let mut ccands: Vec<(((i32, i32), (i32, i32)), f64, InterInfo)> = vec![
7547+ (
7548+ cstack.nearest_mv,
7549+ mode_bits_of(0),
7550+ compound_info(InterMode::NearestNearestMv, cstack.nearest_mv),
7551+ ),
7552+ (
7553+ ((0, 0), (0, 0)),
7554+ mode_bits_of(6),
7555+ compound_info(InterMode::GlobalGlobalMv, ((0, 0), (0, 0))),
7556+ ),
7557+ ];
7558+ // `NEW_NEARESTMV`: the NEW half is `LAST`'s vector from the search
7559+ // above, its residual priced against compound stack entry 0 -- what
7560+ // `assign_compound_mv` predicts from at `ref_mv_idx = 0`.
7561+ let cbase = cstack
7562+ .entries
7563+ .first()
7564+ .map_or(cstack.nearest_mv, |e| (e.mv0, e.mv1));
7565+ if let Some(new_mv) = last_new_mv
7566+ && let Some(b0) = mv_residual_bits(new_mv, cbase.0)
7567+ {
7568+ let mvs = (new_mv, cstack.nearest_mv.1);
7569+ ccands.push((
7570+ mvs,
7571+ mode_bits_of(3) + b0,
7572+ compound_info(InterMode::NewNearestMv, mvs),
7573+ ));
7574+ }
7575+ ccands.sort_by(|a, b| a.0.cmp(&b.0).then(a.1.total_cmp(&b.1)));
7576+ ccands.dedup_by_key(|c| c.0);
7577+ for (mvs, bits, info) in ccands {
7578+ let trials = [
7579+ (0usize, x, y, side, true),
7580+ (1, x / 2, y / 2, side / 2, false),
7581+ (2, x / 2, y / 2, side / 2, false),
7582+ ]
7583+ .map(|(plane, px, py, s, is_luma)| {
7584+ let (r0, r1) = match plane {
7585+ 0 => (
7586+ (reference.y.as_slice(), reference.width, luma.true_width, luma.true_height),
7587+ (g.y.as_slice(), g.width, luma.true_width, luma.true_height),
7588+ ),
7589+ 1 => (
7590+ (
7591+ reference.u.as_slice(),
7592+ reference.width / 2,
7593+ chroma[0].true_width,
7594+ chroma[0].true_height,
7595+ ),
7596+ (g.u.as_slice(), g.width / 2, chroma[0].true_width, chroma[0].true_height),
7597+ ),
7598+ _ => (
7599+ (
7600+ reference.v.as_slice(),
7601+ reference.width / 2,
7602+ chroma[1].true_width,
7603+ chroma[1].true_height,
7604+ ),
7605+ (g.v.as_slice(), g.width / 2, chroma[1].true_width, chroma[1].true_height),
7606+ ),
7607+ };
7608+ let prediction =
7609+ predict_compound_u8(r0, r1, (px, py), s, mvs, is_luma, fctx);
7610+ let target: &Plane = if plane == 0 { luma } else { &chroma[plane - 1] };
7611+ target.code_from_prediction(
7612+ px,
7613+ py,
7614+ s,
7615+ &prediction,
7616+ true,
7617+ search.base_q_idx,
7618+ search.deadzone,
7619+ TxbSet::Luma32Inter,
7620+ )
7621+ });
7622+ let syntax = fixed - ref_bits + bits;
7623+ let cost =
7624+ trials[0].sse + trials[1].sse + trials[2].sse + search.lambda * syntax;
7625+ if best.as_ref().is_none_or(|b| cost < b.0) {
7626+ best = Some((cost, syntax, info, trials));
7627+ }
7628+ }
7629+ }
7630+
7631+ let (skip_cost, syntax, info, skip_trials) = best?;
74457632
74467633 // The winner's prediction coded with a REAL residual (lane-tx64): one
74477634 // TX_64X64 luma transform -- `TxbSet::Luma64`, whose coded quarter is the
@@ -7477,7 +7664,7 @@ fn search_skip_64(
74777664 let unskip = symbol_bits(&cdf::SKIP[0], 0) - symbol_bits(&cdf::SKIP[0], 1);
74787665 let coeff_bits: f64 = residual_trials.iter().map(|t| t.bits).sum();
74797666 let cost = residual_trials.iter().map(|t| t.sse).sum::<f64>()
7480- + search.lambda * (fixed + bits + unskip + coeff_bits);
7667+ + search.lambda * (syntax + unskip + coeff_bits);
74817668 if cost < skip_cost {
74827669 B64_RESIDUAL_HITS.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
74837670 chosen = (cost, false, residual_trials);
@@ -9182,6 +9369,42 @@ pub(crate) fn encode_inter_frame(
91829369 let (mi_row, mi_col) = (sb_r * 16, sb_c * 16);
91839370 let stack =
91849371 find_mv_stack(&grid, mi_row, mi_col, 16, 16, LAST_FRAME, mi_cols, mi_rows);
9372+ // lane-b64b: the `LAST` + extra-reference pairs at this
9373+ // superblock's own 16x16-mi window, the same stacks the tile
9374+ // writer's `Whole64` arm rebuilds. Empty unless the frame
9375+ // codes `reference_select`, which is what gates the syntax.
9376+ let sb_compound: Vec<(i8, &Picture, crate::mvstack::CompoundMvStack)> =
9377+ if header.reference_select && b64_compound() {
9378+ [
9379+ (crate::mvstack::GOLDEN_FRAME, golden),
9380+ (crate::mvstack::ALTREF_FRAME, altref),
9381+ ]
9382+ .into_iter()
9383+ .filter_map(|(r, pic)| {
9384+ pic.map(|p| {
9385+ (
9386+ r,
9387+ p,
9388+ crate::mvstack::find_mv_stack_compound(
9389+ &grid,
9390+ mi_row,
9391+ mi_col,
9392+ 16,
9393+ 16,
9394+ (crate::mvstack::LAST_FRAME, r),
9395+ mi_cols,
9396+ mi_rows,
9397+ grid.sign_bias_table(),
9398+ &[(0, 0); 7],
9399+ None,
9400+ ),
9401+ )
9402+ })
9403+ })
9404+ .collect()
9405+ } else {
9406+ Vec::new()
9407+ };
91859408 if let Some((cost, block)) = search_skip_64(
91869409 &mut luma,
91879410 &mut chroma,
@@ -9190,6 +9413,7 @@ pub(crate) fn encode_inter_frame(
91909413 b64_residual() && !screen,
91919414 reference,
91929415 &stack,
9416+ &sb_compound,
91939417 fctx,
91949418 ) {
91959419 let after = snapshot(&luma, &chroma, (x64, y64), SUPERBLOCK);
@@ -9630,6 +9854,9 @@ pub(crate) fn encode_inter_frame(
96309854 + sb_search.lambda * crate::tile::partition_bits(SUPERBLOCK, true))
96319855 {
96329856 B64_HITS.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
9857+ if block.inter.is_some_and(|i| i.ref1.is_some()) {
9858+ B64_COMPOUND_HITS.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
9859+ }
96339860 blocks.truncate(mark);
96349861 restore(&mut luma, &mut chroma, (x64, y64), SUPERBLOCK, &after);
96359862 // Overwrites every 16x16 mi cell the quadrant searches
crates/ec-av1/src/encoder.rsmodified+65 -0
@@ -2846,6 +2846,71 @@ mod tests {
28462846 }
28472847 }
28482848
2849+ /// A CROSSFADE clip (lane-b64b): each picture is a linear blend of two
2850+ /// stills, so on a leaf frame the average of its past (`LAST`) and future
2851+ /// (`ALTREF`) references IS the source and neither reference alone is --
2852+ /// exactly the content a COMPOUND 64x64 root pays on. The counter is the
2853+ /// gate (class `gate-blind-to-feature`): without it a green three-way
2854+ /// compare says nothing about whether one compound root was written, and
2855+ /// the writer's compound arm (`write_compound_block` at `SB_MI` 16, no
2856+ /// `motion_mode` symbol) desyncs the whole tile if it is wrong.
2857+ #[test]
2858+ fn a_crossfade_clip_codes_a_compound_64x64_root_and_decodes_sample_exact() {
2859+ let _knobs = crate::speed::knob_write();
2860+ let _gate_lock = crate::stream::tests::lock_gate_counters();
2861+ let (width, height) = (256usize, 128usize);
2862+ let (a, b) = (test_card(width, height, 0), test_card(width, height, 24));
2863+ let sources: Vec<Picture> = (0..9)
2864+ .map(|t| {
2865+ let mut p = a.clone();
2866+ let w = t as u32;
2867+ for (v, &other) in p.y.iter_mut().zip(&b.y) {
2868+ *v = ((u32::from(*v) * (8 - w) + u32::from(other) * w) / 8) as u16;
2869+ }
2870+ p
2871+ })
2872+ .collect();
2873+ let config = EncoderConfig {
2874+ width,
2875+ height,
2876+ base_q_idx: 120,
2877+ gop: 9,
2878+ colour: Colour::Bt709Limited,
2879+ tile_cols_log2: 0,
2880+ tile_rows_log2: 0,
2881+ };
2882+ let mut enc = Av1Encoder::new(config).unwrap();
2883+ let mut stream = Vec::new();
2884+ let _ = crate::encode::take_b64_compound_hits();
2885+ for packet in encode_all(&mut enc, &sources) {
2886+ stream.extend_from_slice(&packet.data);
2887+ }
2888+ let compound = crate::encode::take_b64_compound_hits();
2889+ assert!(compound > 0, "a crossfade clip coded no COMPOUND 64x64 root at all");
2890+ eprintln!("compound 64x64 roots on a crossfade clip: {compound}");
2891+
2892+ let ours = crate::stream::decode_stream(&stream).expect("our decoder");
2893+ assert_eq!(ours.len(), sources.len(), "our decoder's frames");
2894+ if !have_ffmpeg() {
2895+ eprintln!("SKIP the ffmpeg half: no ffmpeg");
2896+ return;
2897+ }
2898+ let theirs = ffmpeg_decode_luma(&stream, width, height);
2899+ assert_eq!(theirs.len(), sources.len(), "ffmpeg's frames");
2900+ for (i, (ours_i, theirs_i)) in ours.iter().zip(&theirs).enumerate() {
2901+ let got: Vec<u8> = ours_i.y.iter().map(|&v| v as u8).collect();
2902+ if let Some(at) = got.iter().zip(theirs_i).position(|(x, y)| x != y) {
2903+ panic!(
2904+ "frame {i}: luma differs first at ({}, {}): ours {} vs ffmpeg {}",
2905+ at % width,
2906+ at / width,
2907+ got[at],
2908+ theirs_i[at],
2909+ );
2910+ }
2911+ }
2912+ }
2913+
28492914 #[test]
28502915 fn every_tile_layout_decodes_sample_exact_through_both_decoders() {
28512916 let _knobs = crate::speed::knob_read();
crates/ec-av1/src/tile.rsmodified+57 -40
@@ -5634,12 +5634,6 @@ pub(crate) fn sb_coeff_inter_frame_tile_cdfs(
56345634 let info = block.inter.ok_or_else(|| {
56355635 Error::unsupported("AV1 tile", "a 64x64 root block is coded inter")
56365636 })?;
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- }
56435637 enc.symbol(PARTITION_NONE, &mut cdfs.partition_w64[sb_ctx]);
56445638 let (mi_r, mi_c) = (sb_at.0 * (SUB / MI), sb_at.1 * (SUB / MI));
56455639 let has_above = neighbours.has_above(mi_r);
@@ -5661,28 +5655,46 @@ pub(crate) fn sb_coeff_inter_frame_tile_cdfs(
56615655 &neighbours,
56625656 (mi_r, mi_c),
56635657 (has_above, has_left),
5664- false,
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,
5658+ info.ref1.is_some(),
56845659 );
5685- let (mv, is_new_mv) = write_inter_mode(&mut enc, &mut cdfs, info, &stack)?;
5660+ // lane-b64b: a COMPOUND 64x64 root takes the same mode chain
5661+ // every other compound block does, at this superblock's own
5662+ // 16x16-mi window.
5663+ let (mv, mv1, is_new_mv) = if info.ref1.is_some() {
5664+ write_compound_block(
5665+ &mut enc,
5666+ &mut cdfs,
5667+ &neighbours,
5668+ &grid,
5669+ (mi_r, mi_c),
5670+ (SB_MI as usize, SB_MI as usize),
5671+ (has_above, has_left),
5672+ info,
5673+ (mi_cols as usize, mi_rows as usize),
5674+ )?
5675+ } else {
5676+ write_single_ref(
5677+ &mut enc,
5678+ &mut cdfs,
5679+ info.ref_frame,
5680+ neighbours.above_ref[mi_c],
5681+ neighbours.above_ref1[mi_c],
5682+ neighbours.left_ref[mi_r],
5683+ neighbours.left_ref1[mi_r],
5684+ );
5685+ let stack = find_mv_stack(
5686+ &grid,
5687+ mi_r,
5688+ mi_c,
5689+ SB_MI as usize,
5690+ SB_MI as usize,
5691+ info.ref_frame,
5692+ mi_cols as usize,
5693+ mi_rows as usize,
5694+ );
5695+ let (mv, is_new_mv) = write_inter_mode(&mut enc, &mut cdfs, info, &stack)?;
5696+ (mv, (0, 0), is_new_mv)
5697+ };
56865698 for dr in 0..SB_MI as usize {
56875699 for dc in 0..SB_MI as usize {
56885700 grid.set(
@@ -5691,8 +5703,8 @@ pub(crate) fn sb_coeff_inter_frame_tile_cdfs(
56915703 MiInfo {
56925704 is_inter: true,
56935705 ref_frame: info.ref_frame,
5694- ref_frame1: NO_REF1,
5695- mv1: (0, 0),
5706+ ref_frame1: info.ref1.unwrap_or(NO_REF1),
5707+ mv1: mv16(mv1),
56965708 mv: mv16(mv),
56975709 is_new_mv,
56985710 size: SB_MI as u8,
@@ -5703,17 +5715,21 @@ pub(crate) fn sb_coeff_inter_frame_tile_cdfs(
57035715 );
57045716 }
57055717 }
5706- write_motion_mode(
5707- &mut enc,
5708- &mut cdfs,
5709- &grid,
5710- (mi_r, mi_c),
5711- (SB_MI as usize, SB_MI as usize),
5712- (SB, SB),
5713- (mi_cols as usize, mi_rows as usize),
5714- info.ref_frame,
5715- block.motion_mode,
5716- )?;
5718+ if info.ref1.is_none() {
5719+ // libaom's `motion_mode_allowed` fails on a compound
5720+ // block, so the decoder reads no symbol for one.
5721+ write_motion_mode(
5722+ &mut enc,
5723+ &mut cdfs,
5724+ &grid,
5725+ (mi_r, mi_c),
5726+ (SB_MI as usize, SB_MI as usize),
5727+ (SB, SB),
5728+ (mi_cols as usize, mi_rows as usize),
5729+ info.ref_frame,
5730+ block.motion_mode,
5731+ )?;
5732+ }
57175733 if tx_select {
57185734 // A skipped inter block writes no `txfm_split` at all --
57195735 // that call only publishes the max transform size the
@@ -5759,6 +5775,7 @@ pub(crate) fn sb_coeff_inter_frame_tile_cdfs(
57595775 neighbours.record_planes(sb_at, SB, 0, &grids, true);
57605776 }
57615777 neighbours.record_inter(sb_at, SB, block.skip, true, block_ref(block));
5778+ record_block_compound(&mut neighbours, (mi_r, mi_c), SB, block);
57625779 continue;
57635780 }
57645781 match (has_cols, has_rows) {
lanes/b64b/bin-controladded+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