forge
Explore
Log in

Don't you dare go Hollow

Merge branch 'lane-dgolomb' (a4670b5a): temporal MV candidates ignored force_integer_mv; libaom's film B streams decode sample-exact

Browse files at this commit

edaf3688d77d06b19db2bd1ed3288cba32df783bAhmet Kaan GümüşParent: ef39a14fabb8ce
The "Golomb tail" refusal was a correlate: lower_mv_precision had dropped
the is_integer half as unreachable, while libaom sets screen-content
tools on dark smooth film and force_integer_mv on any inter frame whose
source repeats the previous one. Class: branch dropped as unreachable.
crates/ec-av1/src/decode.rsmodified+6 -0
@@ -26220,6 +26220,7 @@ fn decode_inter_block(
2622026220 t.ref_order_hints[(ref1 - LAST_FRAME) as usize],
2622126221 ),
2622226222 allow_high_precision_mv,
26223+ force_integer_mv,
2622326224 });
2622426225 let gm_table = build_gm_mv_table(
2622526226 global_motion,
@@ -27444,6 +27445,7 @@ fn decode_inter_block(
2744427445 t.ref_order_hints[(ref_frame - LAST_FRAME) as usize],
2744527446 ),
2744627447 allow_high_precision_mv,
27448+ force_integer_mv,
2744727449 });
2744827450 let gm_table = build_gm_mv_table(
2744927451 global_motion,
@@ -29829,6 +29831,7 @@ fn decode_inter_sub8_split4(
2982929831 t.ref_order_hints[(ref_frame - LAST_FRAME) as usize],
2983029832 ),
2983129833 allow_high_precision_mv,
29834+ force_integer_mv,
2983229835 });
2983329836 let stack = crate::mvstack::find_mv_stack_with_sign_bias(
2983429837 grid,
@@ -30857,6 +30860,7 @@ fn decode_inter_sub8_rect2(
3085730860 t.ref_order_hints[(ref_frame - LAST_FRAME) as usize],
3085830861 ),
3085930862 allow_high_precision_mv,
30863+ force_integer_mv,
3086030864 });
3086130865 let stack = crate::mvstack::find_mv_stack_with_sign_bias(
3086230866 grid,
@@ -31603,6 +31607,7 @@ fn decode_inter_block8(
3160331607 t.ref_order_hints[(ref1 - LAST_FRAME) as usize],
3160431608 ),
3160531609 allow_high_precision_mv,
31610+ force_integer_mv,
3160631611 });
3160731612 // lane-av1comp: this leaf path has neither a real sign-bias
3160831613 // table nor `tpl_frame` (see this function's own doc on the
@@ -32293,6 +32298,7 @@ fn decode_inter_block8(
3229332298 t.ref_order_hints[(ref_frame - LAST_FRAME) as usize],
3229432299 ),
3229532300 allow_high_precision_mv,
32301+ force_integer_mv,
3229632302 });
3229732303 let stack = crate::mvstack::find_mv_stack_with_sign_bias(
3229832304 grid,
crates/ec-av1/src/motion_field.rsmodified+70 -8
@@ -174,11 +174,35 @@ fn get_mv_projection(mv: (i32, i32), num: i32, den: i32) -> (i32, i32) {
174174 (scale(mv.0), scale(mv.1))
175175 }
176176
177-/// `lower_mv_precision` (`mvref_common.h`), the `is_integer == false` half
178-/// only — every stream this decoder ever reaches has `force_integer_mv ==
179-/// false` on an inter frame (`allow_screen_content_tools`, the only source
180-/// of a `true` value here, is refused outright at the stream level).
181-pub fn lower_mv_precision(mv: (i32, i32), allow_high_precision_mv: bool) -> (i32, i32) {
177+/// `lower_mv_precision` (`mvref_common.h`), both halves. lane-dgolomb: the
178+/// `is_integer` half used to be dropped as unreachable on the claim that
179+/// `allow_screen_content_tools` is refused at the stream level -- it is not,
180+/// and libaom turns screen-content tools on for dark, smooth FILM (its
181+/// `av1_set_screen_content_options` counts near-flat blocks), so a real
182+/// libaom stream carries `force_integer_mv == 1` on an inter frame and every
183+/// temporal MV candidate has to be rounded to full pel. Without it the
184+/// candidates were 1/8-pel values libaom never produces: a whole-frame
185+/// prediction mismatch behind a clean parse (class
186+/// `branch-dropped-as-unreachable`).
187+pub fn lower_mv_precision(
188+ mv: (i32, i32),
189+ allow_high_precision_mv: bool,
190+ force_integer_mv: bool,
191+) -> (i32, i32) {
192+ if force_integer_mv {
193+ // `integer_mv_precision`: drop to the nearest full pel, ties away
194+ // from zero (`abs(mod) > 4`).
195+ let round = |v: i32| {
196+ let m = v % 8;
197+ match m {
198+ 0 => v,
199+ _ if m > 4 => v - m + 8,
200+ _ if m < -4 => v - m - 8,
201+ _ => v - m,
202+ }
203+ };
204+ return (round(mv.0), round(mv.1));
205+ }
182206 if allow_high_precision_mv {
183207 return mv;
184208 }
@@ -526,6 +550,7 @@ pub fn add_tpl_ref_mv(
526550 blk_col: isize,
527551 cur_offset_0: i32,
528552 allow_high_precision_mv: bool,
553+ force_integer_mv: bool,
529554 ) -> Option<TplCandidate> {
530555 let probe = tpl.probe(mi_row, mi_col).cell(blk_row, blk_col);
531556 if crate::envflags::env_flag!("EC_TRACE_TPL") {
@@ -539,7 +564,13 @@ pub fn add_tpl_ref_mv(
539564 }
540565 let (fwd_mv, ref_frame_offset) = probe?;
541566 Some(TplCandidate {
542- mv: project_tpl_mv(fwd_mv, cur_offset_0, ref_frame_offset, allow_high_precision_mv),
567+ mv: project_tpl_mv(
568+ fwd_mv,
569+ cur_offset_0,
570+ ref_frame_offset,
571+ allow_high_precision_mv,
572+ force_integer_mv,
573+ ),
543574 })
544575 }
545576
@@ -552,9 +583,10 @@ pub fn project_tpl_mv(
552583 cur_offset: i32,
553584 ref_frame_offset: i32,
554585 allow_high_precision_mv: bool,
586+ force_integer_mv: bool,
555587 ) -> (i32, i32) {
556588 let projected = get_mv_projection(fwd_mv, cur_offset, ref_frame_offset);
557- lower_mv_precision(projected, allow_high_precision_mv)
589+ lower_mv_precision(projected, allow_high_precision_mv, force_integer_mv)
558590 }
559591
560592 /// One query block's view of [`TplField`] (lane-tpl). `add_tpl_ref_mv`'s
@@ -709,7 +741,37 @@ mod tests {
709741 // ref_frame_offset = get_relative_dist(2,1) = 1, scaling (-64,0) by
710742 // 2/1 -> (-128,0); get_block_position's sign_bias (dir=2) subtracts
711743 // the offset, landing at 8x8 cell (2, 0).
712- let cand = add_tpl_ref_mv(&tpl, 4, 0, 0isize, 0isize, get_relative_dist(7, 4, 2), true);
744+ let cand =
745+ add_tpl_ref_mv(&tpl, 4, 0, 0isize, 0isize, get_relative_dist(7, 4, 2), true, false);
713746 assert!(cand.is_some(), "expected a projected temporal candidate");
714747 }
748+
749+ /// lane-dgolomb: `lower_mv_precision`'s `force_integer_mv` half, which
750+ /// this decoder used to drop as unreachable. The values are the ones a
751+ /// real libaom stream (film B, `-cpu-used 6 -crf 35`, the one inter frame
752+ /// whose header carries `force_integer_mv == 1`) produces at its first
753+ /// 128x128 block: the same 16 temporal probes, projected and then rounded
754+ /// to full pel, are what put `(16,0)`/`(16,-8)`/`(8,-40)` in libaom's own
755+ /// traced mv stack where the eighth-pel values were `(14,-4)`/`(12,-2)`/
756+ /// `(12,-38)`/`(16,-4)`.
757+ #[test]
758+ fn force_integer_mv_rounds_a_projected_candidate_to_full_pel() {
759+ // (mfmv0, ref_frame_offset) -> (eighth-pel value, full-pel value),
760+ // all at cur_offset_0 == 1.
761+ for (mv, rfo, eighth, integer) in [
762+ ((74, -20), 5, (14, -4), (16, 0)),
763+ ((74, -24), 5, (14, -4), (16, -8)),
764+ ((82, -24), 5, (16, -4), (16, -8)),
765+ ((66, -16), 5, (12, -2), (16, 0)),
766+ ((24, -76), 2, (12, -38), (8, -40)),
767+ ] {
768+ assert_eq!(project_tpl_mv(mv, 1, rfo, false, false), eighth, "{mv:?}");
769+ assert_eq!(project_tpl_mv(mv, 1, rfo, false, true), integer, "{mv:?}");
770+ }
771+ // `integer_mv_precision`'s tie rule is away from zero on |mod| > 4
772+ // only, and it is signed-symmetric.
773+ assert_eq!(lower_mv_precision((4, -4), false, true), (0, 0));
774+ assert_eq!(lower_mv_precision((5, -5), false, true), (8, -8));
775+ assert_eq!(lower_mv_precision((-12, 8), false, true), (-8, 8));
776+ }
715777 }
crates/ec-av1/src/mvstack.rsmodified+35 -2
@@ -154,6 +154,10 @@ pub struct TplArgs<'a> {
154154 pub cur_offset_0: i32,
155155 /// The frame header's own `allow_high_precision_mv`.
156156 pub allow_high_precision_mv: bool,
157+ /// The frame header's own `force_integer_mv` (`lower_mv_precision`'s
158+ /// `is_integer`): a screen-content frame rounds every projected temporal
159+ /// candidate to full pel.
160+ pub force_integer_mv: bool,
157161 }
158162
159163 /// [`MiInfo::ref_frame1`]'s "this unit was not coded compound" value. Slot 1
@@ -1036,6 +1040,7 @@ fn tpl_trace_sample(
10361040 blk_col: isize,
10371041 cur_offset: i32,
10381042 allow_high_precision_mv: bool,
1043+ force_integer_mv: bool,
10391044 ) -> Option<(i32, i32)> {
10401045 crate::motion_field::add_tpl_ref_mv(
10411046 field,
@@ -1045,6 +1050,7 @@ fn tpl_trace_sample(
10451050 blk_col,
10461051 cur_offset,
10471052 allow_high_precision_mv,
1053+ force_integer_mv,
10481054 )
10491055 .map(|c| c.mv)
10501056 }
@@ -1061,6 +1067,7 @@ fn tpl_trace_sample_compound(
10611067 blk_col: isize,
10621068 cur_offsets: (i32, i32),
10631069 allow_high_precision_mv: bool,
1070+ force_integer_mv: bool,
10641071 ) {
10651072 for off in [cur_offsets.0, cur_offsets.1] {
10661073 let _ = crate::motion_field::add_tpl_ref_mv(
@@ -1071,6 +1078,7 @@ fn tpl_trace_sample_compound(
10711078 blk_col,
10721079 off,
10731080 allow_high_precision_mv,
1081+ force_integer_mv,
10741082 );
10751083 }
10761084 }
@@ -1093,6 +1101,7 @@ fn tpl_sample(
10931101 blk_col: isize,
10941102 cur_offset: i32,
10951103 allow_high_precision_mv: bool,
1104+ force_integer_mv: bool,
10961105 ) -> Option<(i32, i32)> {
10971106 if trace_tpl {
10981107 return tpl_trace_sample(
@@ -1103,6 +1112,7 @@ fn tpl_sample(
11031112 blk_col,
11041113 cur_offset,
11051114 allow_high_precision_mv,
1115+ force_integer_mv,
11061116 );
11071117 }
11081118 let (fwd_mv, rfo) = probe.cell(blk_row, blk_col)?;
@@ -1111,6 +1121,7 @@ fn tpl_sample(
11111121 cur_offset,
11121122 rfo,
11131123 allow_high_precision_mv,
1124+ force_integer_mv,
11141125 ))
11151126 }
11161127
@@ -1128,6 +1139,7 @@ fn tpl_sample_compound(
11281139 blk_col: isize,
11291140 cur_offsets: (i32, i32),
11301141 allow_high_precision_mv: bool,
1142+ force_integer_mv: bool,
11311143 ) -> Option<((i32, i32), (i32, i32))> {
11321144 if trace_tpl {
11331145 tpl_trace_sample_compound(
@@ -1138,12 +1150,25 @@ fn tpl_sample_compound(
11381150 blk_col,
11391151 cur_offsets,
11401152 allow_high_precision_mv,
1153+ force_integer_mv,
11411154 );
11421155 }
11431156 let (fwd_mv, rfo) = probe.cell(blk_row, blk_col)?;
11441157 Some((
1145- crate::motion_field::project_tpl_mv(fwd_mv, cur_offsets.0, rfo, allow_high_precision_mv),
1146- crate::motion_field::project_tpl_mv(fwd_mv, cur_offsets.1, rfo, allow_high_precision_mv),
1158+ crate::motion_field::project_tpl_mv(
1159+ fwd_mv,
1160+ cur_offsets.0,
1161+ rfo,
1162+ allow_high_precision_mv,
1163+ force_integer_mv,
1164+ ),
1165+ crate::motion_field::project_tpl_mv(
1166+ fwd_mv,
1167+ cur_offsets.1,
1168+ rfo,
1169+ allow_high_precision_mv,
1170+ force_integer_mv,
1171+ ),
11471172 ))
11481173 }
11491174
@@ -1312,6 +1337,7 @@ pub fn find_mv_stack_with_sign_bias(
13121337 field,
13131338 cur_offset_0,
13141339 allow_high_precision_mv,
1340+ force_integer_mv,
13151341 }) = tpl
13161342 {
13171343 let mut any_hit = false;
@@ -1342,6 +1368,7 @@ pub fn find_mv_stack_with_sign_bias(
13421368 blk_col,
13431369 cur_offset_0,
13441370 allow_high_precision_mv,
1371+ force_integer_mv,
13451372 )
13461373 };
13471374 let mut blk_row = 0usize;
@@ -2116,6 +2143,7 @@ pub fn find_mv_stack_compound(
21162143 cur_offset_0,
21172144 cur_offset_1,
21182145 allow_high_precision_mv,
2146+ force_integer_mv,
21192147 }) = tpl
21202148 {
21212149 let mut any_hit = false;
@@ -2144,6 +2172,7 @@ pub fn find_mv_stack_compound(
21442172 blk_col,
21452173 (cur_offset_0, cur_offset_1),
21462174 allow_high_precision_mv,
2175+ force_integer_mv,
21472176 )
21482177 };
21492178 let mut blk_row = 0usize;
@@ -2411,6 +2440,10 @@ pub struct CompoundTplArgs<'a> {
24112440 pub cur_offset_1: i32,
24122441 /// The frame header's own `allow_high_precision_mv`.
24132442 pub allow_high_precision_mv: bool,
2443+ /// The frame header's own `force_integer_mv` (`lower_mv_precision`'s
2444+ /// `is_integer`): a screen-content frame rounds every projected temporal
2445+ /// candidate to full pel.
2446+ pub force_integer_mv: bool,
24142447 }
24152448
24162449 /// The single-reference context shared by the `single_ref_p1`/`p3`/`p4`
crates/ec-av1/src/stream.rsmodified+109 -0
@@ -3758,6 +3758,115 @@ pub(crate) mod tests {
37583758 }
37593759 }
37603760
3761+ /// lane-dgolomb: the `force_integer_mv` gate. libaom turns screen-content
3762+ /// tools on for DARK, SMOOTH content -- its `av1_set_screen_content_options`
3763+ /// counts 16x16 blocks with 2..=4 distinct luma values -- and then sets
3764+ /// `force_integer_mv` on any inter frame whose source is pixel-identical to
3765+ /// the previously coded source (`av1_is_integer_mv`: `cs_rate >= 0.8` and
3766+ /// `C == T`, every collocated 8x8 block matching, is the only path that
3767+ /// returns 1). Both hold on his real AV1 films, and this decoder used to
3768+ /// drop `lower_mv_precision`'s `is_integer` half as unreachable, so every
3769+ /// temporal MV candidate on such a frame came out at eighth-pel: the frame
3770+ /// decoded without any error into a whole-frame prediction mismatch, and
3771+ /// the desync surfaced blocks later as "a Golomb tail longer than this
3772+ /// decoder reads".
3773+ ///
3774+ /// The source is SYNTHETIC (no film sample lives in `fixtures`): a
3775+ /// near-flat dark background at the film-B crop size, 1920x1024, with one
3776+ /// textured patch stepping 9 px every SECOND frame, so half the frames are
3777+ /// exact duplicates of their predecessor (the `C == T` trigger) while the
3778+ /// motion field still holds non-zero MVs whose projections are not
3779+ /// multiples of 8. The gate asserts both halves: at least one INTER frame
3780+ /// really carries `force_integer_mv` (class `gate-blind-to-feature`), and
3781+ /// every shown frame decodes sample-exact against ffmpeg's own decode.
3782+ #[test]
3783+ fn a_libaom_force_integer_mv_stream_decodes_exact() {
3784+ const NAME: &str = "a_libaom_force_integer_mv_stream_decodes_exact";
3785+ if !have_ffmpeg() {
3786+ eprintln!("SKIP {NAME}: no ffmpeg");
3787+ return;
3788+ }
3789+ let (w, h, frames) = (1920usize, 1024usize, 12usize);
3790+ let mut raw = Vec::with_capacity(frames * w * h * 3 / 2);
3791+ for f in 0..frames {
3792+ let mut y = vec![0u8; w * h];
3793+ for row in 0..h {
3794+ for col in 0..w {
3795+ // 2..=4 distinct values per 16x16 block, all dark: the
3796+ // screen-content detector's own counting rule.
3797+ y[row * w + col] =
3798+ 16 + ((col / 32 + row / 32) % 5) as u8 + ((col / 4 + row / 4) % 3) as u8;
3799+ }
3800+ }
3801+ let x0 = 200 + 9 * (f / 2);
3802+ for row in 300..428 {
3803+ for col in x0..x0 + 192 {
3804+ y[row * w + col] =
3805+ ((((col - x0) / 3) * 7 + ((row - 300) / 5) * 13) % 200 + 30) as u8;
3806+ }
3807+ }
3808+ raw.extend_from_slice(&y);
3809+ raw.extend(std::iter::repeat_n(128u8, w * h / 2));
3810+ }
3811+ // [[pid-keyed-temp-path]]: parallel test binaries must not share a name.
3812+ let src = std::env::temp_dir().join(format!("ec-av1-intmv-{}.yuv", std::process::id()));
3813+ std::fs::write(&src, &raw).expect("raw source");
3814+ let out = Command::new("ffmpeg")
3815+ .args(["-v", "error", "-y", "-f", "rawvideo", "-pix_fmt", "yuv420p"])
3816+ .args(["-s", &format!("{w}x{h}"), "-r", "24", "-i"])
3817+ .arg(&src)
3818+ .args(["-an", "-threads", "1", "-g", "12", "-c:v", "libaom-av1"])
3819+ .args(["-cpu-used", "6", "-b:v", "0", "-crf", "35", "-f", "obu", "-"])
3820+ .stdin(Stdio::null())
3821+ .stdout(Stdio::piped())
3822+ .stderr(Stdio::piped())
3823+ .output()
3824+ .expect("ffmpeg failed to run");
3825+ let _ = std::fs::remove_file(&src);
3826+ if !out.status.success() {
3827+ eprintln!(
3828+ "SKIP {NAME}: ffmpeg has no libaom-av1 encoder ({})",
3829+ String::from_utf8_lossy(&out.stderr)
3830+ );
3831+ return;
3832+ }
3833+ let stream = out.stdout;
3834+
3835+ // Half of the gate: the stream must actually carry the feature.
3836+ let mut parser = Av1Parser::new();
3837+ let (mut pos, mut int_mv_inter) = (0usize, 0usize);
3838+ while pos < stream.len() {
3839+ let obu = parser.parse_obu(&stream[pos..]).expect("libaom OBU parses");
3840+ pos += obu.total_size.max(1);
3841+ let header = match &obu.kind {
3842+ ObuKind::FrameHeader(h) | ObuKind::Frame(h, _) => h,
3843+ _ => continue,
3844+ };
3845+ if header.force_integer_mv && !header.frame_is_intra && header.use_ref_frame_mvs {
3846+ int_mv_inter += 1;
3847+ }
3848+ }
3849+ assert!(
3850+ int_mv_inter > 0,
3851+ "{NAME} went blind: libaom coded no inter frame with force_integer_mv"
3852+ );
3853+
3854+ let ours = decode_stream(&stream).expect("libaom screen-content stream decodes");
3855+ let theirs = ffmpeg_decode_sequence(&stream, w, h, frames);
3856+ assert_eq!(ours.len(), frames, "shown frame count");
3857+ for (i, (a, b)) in ours.iter().zip(theirs.iter()).enumerate() {
3858+ for (plane, l, r) in [("Y", &a.y, &b.y), ("U", &a.u, &b.u), ("V", &a.v, &b.v)] {
3859+ let first = l.iter().zip(r.iter()).position(|(x, y)| x != y);
3860+ assert!(
3861+ first.is_none(),
3862+ "frame {i} plane {plane} differs from ffmpeg at sample {} \
3863+ ({int_mv_inter} force_integer_mv inter frames in this stream)",
3864+ first.unwrap()
3865+ );
3866+ }
3867+ }
3868+ }
3869+
37613870 /// Hardened past the report-only test above: a real libaom-av1 gradients
37623871 /// stream, pinned deterministic (`gradients`' own `seed=`, plus
37633872 /// `-threads 1`/`-row-mt 0`/no tiling so libaom's `cpu-used 8` RD search
lanes/dgolomb.report.mdadded+89 -0
@@ -0,0 +1,89 @@
1+# lane-dgolomb — libaom film-B decode (the "Golomb tail" refusal)
2+
3+## Root cause (closed)
4+`crates/ec-av1/src/motion_field.rs` `lower_mv_precision` implemented only the
5+`is_integer == false` half of libaom's function, on a comment claiming
6+`force_integer_mv` is unreachable because `allow_screen_content_tools` is
7+"refused outright at the stream level". Both halves of that claim are false:
8+
9+* libaom's `av1_set_screen_content_options` counts 16x16 blocks with 2..=4
10+ distinct luma values, so DARK, SMOOTH FILM reads as screen content — every
11+ frame of the film-B gate clip has `allow_screen_content_tools = 1`;
12+* `av1_is_integer_mv` (encoder_utils.c:1357) returns 1 exactly when
13+ `cs_rate >= 0.8` **and** `C == T`, i.e. when the source frame is
14+ pixel-identical to the previously coded source. Film B has such frames.
15+
16+So a real libaom stream carries `force_integer_mv = 1` on an inter frame, and
17+every temporal MV candidate must be rounded to full pel. Ours stayed at
18+eighth-pel → the mv stack held values libaom never produced → whole-frame
19+prediction mismatch behind a clean parse, and the entropy desync surfaced
20+blocks later as `a Golomb tail longer than this decoder reads`
21+(class `refusal-names-a-correlate`).
22+
23+**Class: `branch-dropped-as-unreachable`** — a spec branch deleted on an
24+unreachability note that a later capability change silently invalidated.
25+
26+## First divergence (measured, not reasoned)
27+Film-B gate clip (1920x1024 crop, `-cpu-used 6 -crf 35 -g 12`), decode-order
28+frame 3 = order_hint 1, the ONE inter frame with `force_integer_mv = 1`,
29+block mi(0,0) (128x128, NEWMV, ref LAST):
30+
31+* `EC_TPL` field cells identical in both decoders (16 probes), range identical
32+ (`rng=49952`) — so the field and the entropy state were right;
33+* instrumented aomdec stack: `(16,0)w16 (16,-8)w12 (8,-40)w4`
34+* ours before the fix: `(14,-4)w16 (12,-2)w8 (12,-38)w4 (16,-4)w4`
35+* `(74,-20)/5 → 15,-4 → integer → (16,0)` reproduces libaom exactly.
36+
37+## Fix
38+`lower_mv_precision(mv, allow_high_precision_mv, force_integer_mv)` with
39+libaom's `integer_mv_precision` (ties away from zero on `|mod| > 4`), threaded
40+through `project_tpl_mv`/`add_tpl_ref_mv`, `TplArgs`/`CompoundTplArgs` and the
41+six `decode.rs` construction sites.
42+
43+## Sweep (class + siblings)
44+* `grep` for unreachability claims over `ec-av1`/`ec-av1-syntax`: no other
45+ "spec branch dropped because a header flag is refused" site.
46+* The other decoder-side `is_integer` consumers in libaom —
47+ `av1_find_best_ref_mvs` (mvref_common.c:847) and the compound nearest/near
48+ lowering (decodemv.c:1519) — are provably no-ops for us once the temporal
49+ path is fixed: under `force_integer_mv` every other candidate source is
50+ already integer (`read_mv_component` honours the flag, `warp.rs:128` honours
51+ it for global MVs, spatial candidates are decoded MVs). Not implemented; if
52+ a future defect lands here, this is the place.
53+
54+## Verification
55+* `crates/ec-av1/src/motion_field.rs` `force_integer_mv_rounds_a_projected_candidate_to_full_pel`
56+ — the five (mfmv0, rfo) pairs of that first block, eighth-pel vs full-pel,
57+ values taken from the oracle. Fails without the fix. PASSES.
58+* Film-B ladder, 48 frames, `-cpu-used 6 -g 48`, our `decode_stream` vs
59+ `ffmpeg -c:v libdav1d`, sample-exact over all 48 shown frames:
60+ crf 20 EXACT, crf 35 EXACT (was the Golomb refusal), crf 45 EXACT.
61+ Same at `-g 12`. Before the fix: crf 20/45 25–28 dB garbage, crf 35 refused.
62+* `crates/ec-av1/src/stream.rs` `a_libaom_force_integer_mv_stream_decodes_exact`
63+ — synthetic 1920x1024 source (no film sample in `fixtures`): near-flat dark
64+ background (2..=4 luma values per 16x16 block, the detector's own rule) with
65+ a textured patch stepping 9 px every SECOND frame, so half the frames are
66+ exact duplicates (the `C == T` trigger). Asserts (a) libaom really coded an
67+ inter frame with `force_integer_mv` + `use_ref_frame_mvs` (anti-blindness),
68+ (b) all 12 shown frames decode sample-exact vs ffmpeg. PASSES, 2.1 s.
69+
70+## OPEN / deferred
71+1. **The synthetic gate is BLIND to this defect.** Re-run with the integer
72+ branch stubbed out (`if false {`) and it still passes: on that source the
73+ temporal candidates are already full-pel (or unused), so only the unit test
74+ above actually regresses the fix. Fixing this needs a synthetic clip whose
75+ duplicate frame still reads NON-multiple-of-8 projected temporal MVs —
76+ e.g. motion of an odd number of half-pels between the earlier frames, with
77+ the duplicate pair placed so the ARF's field survives into it. Unblocks:
78+ one more recipe iteration against `EC_TPL`/`EC_STACK`.
79+2. **crf 5 still fails**: `-cpu-used 6 -crf 5 -g 48` desyncs on the KEY frame
80+ (base_q 9, `delta_q_present`, `cdef_bits 3`), first divergent intra block
81+ mi(184,344) — aomdec `EC_IMODE ... rng=49148` vs ours `rng=52010`, the
82+ previous traced block being mi(188,340). Unrelated to temporal MVs; needs
83+ its own bisect from that block's coefficient ladder (`EC_TRACE_COEFF`).
84+3. **Not done in this lane** (budget): the "reference streams decode exact
85+ through our decoder" assertion inside `external_ladder`/the native gates;
86+ the full `cargo test -p ec-av1 --release` run (started detached, was still
87+ running at hand-off, log
88+ `/tmp/claude-1000/.../scratchpad/suite.log`); `cargo check --workspace
89+ --all-targets`; the byte pins (8590 / 28535) were not re-read.