Merge branch 'main' into lane-r14 (b51719f); drop the unreachable 16x16-level partition refusal; verifier notes folded into the r1/r2 reports
Browse files at this commit9 changed files +695 -43
- crates/ec-av1/fixtures/reelb_head_key_frame.obu +0 -0
- crates/ec-av1/src/decode.rs +165 -36
- crates/ec-av1/src/refusal_inventory.rs +1 -1
- crates/ec-av1/src/stream.rs +291 -4
- lanes/golomb-r1.report.md +47 -0
- lanes/oddh-r1.report.md +76 -0
- lanes/oddh-r2.report.md +97 -0
- lanes/r14-r1.report.md +1 -1
- lanes/r14-r2.report.md +17 -1
crates/ec-av1/fixtures/reelb_head_key_frame.obuadded+0 -0
Binary file changed
crates/ec-av1/src/decode.rsmodified+165 -36
| @@ -1053,6 +1053,21 @@ pub(crate) fn horz_vert_intra_hits() -> usize { | |||
| 1053 | HORZ_VERT_INTRA_HITS.with(|c| c.get()) | 1053 | HORZ_VERT_INTRA_HITS.with(|c| c.get()) |
| 1054 | } | 1054 | } |
| 1055 | 1055 | ||
| 1056 | +// How many blocks were decoded as a frame-edge rect strip -- the single | ||
| 1057 | +// coded half of a `PARTITION_HORZ`/`PARTITION_VERT` at the true frame edge | ||
| 1058 | +// (lane-oddh r1), i.e. a block living inside the 8px band of a frame whose | ||
| 1059 | +// height or width is 8 mod 16 (the user's 3840x1608 film). Intra and inter | ||
| 1060 | +// paths share the counter. | ||
| 1061 | +thread_local! { | ||
| 1062 | + static EDGE_RECT_STRIP_HITS: std::cell::Cell<usize> = | ||
| 1063 | + const { std::cell::Cell::new(0) }; | ||
| 1064 | +} | ||
| 1065 | + | ||
| 1066 | +/// Current value of [`EDGE_RECT_STRIP_HITS`]. | ||
| 1067 | +pub(crate) fn edge_rect_strip_hits() -> usize { | ||
| 1068 | + EDGE_RECT_STRIP_HITS.with(|c| c.get()) | ||
| 1069 | +} | ||
| 1070 | + | ||
| 1056 | // How many HORZ/VERT intra strips resolved a SPLIT luma transform | 1071 | // How many HORZ/VERT intra strips resolved a SPLIT luma transform |
| 1057 | // (`tx_depth != 0`) and decoded it per transform unit (lane-rectsplit r1) -- | 1072 | // (`tx_depth != 0`) and decoded it per transform unit (lane-rectsplit r1) -- |
| 1058 | // the case every rect path here refused by name before, and the first | 1073 | // the case every rect path here refused by name before, and the first |
| @@ -12360,16 +12375,31 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 12360 | } | 12375 | } |
| 12361 | p | 12376 | p |
| 12362 | } else { | 12377 | } else { |
| 12378 | + // lane-golomb r1 (class `parsed-then-discarded`): the gathered | ||
| 12379 | + // bit is the answer, not a formality -- libaom's | ||
| 12380 | + // `ec_read_partition_impl` returns `PARTITION_HORZ` (resp. | ||
| 12381 | + // `PARTITION_VERT`) when it reads 0, and only `PARTITION_SPLIT` | ||
| 12382 | + // when it reads 1. Forcing SPLIT here desynced the last | ||
| 12383 | + // superblock row of every frame whose height is not a multiple | ||
| 12384 | + // of 64 -- the ReelB head (3840x1608) diverges at | ||
| 12385 | + // mi_row=400 mi_col=0, the first block of that row. | ||
| 12363 | match (has_cols, has_rows) { | 12386 | match (has_cols, has_rows) { |
| 12364 | (true, false) => { | 12387 | (true, false) => { |
| 12365 | - dec.symbol_fixed(&gather(&cdfs.partition_w64[ctx], VERT_ALIKE)); | 12388 | + if dec.symbol_fixed(&gather(&cdfs.partition_w64[ctx], VERT_ALIKE)) == 1 { |
| 12389 | + PARTITION_SPLIT | ||
| 12390 | + } else { | ||
| 12391 | + PARTITION_HORZ | ||
| 12392 | + } | ||
| 12366 | } | 12393 | } |
| 12367 | (false, true) => { | 12394 | (false, true) => { |
| 12368 | - dec.symbol_fixed(&gather(&cdfs.partition_w64[ctx], HORZ_ALIKE)); | 12395 | + if dec.symbol_fixed(&gather(&cdfs.partition_w64[ctx], HORZ_ALIKE)) == 1 { |
| 12396 | + PARTITION_SPLIT | ||
| 12397 | + } else { | ||
| 12398 | + PARTITION_VERT | ||
| 12369 | } | 12399 | } |
| 12370 | - _ => {} | ||
| 12371 | } | 12400 | } |
| 12372 | - PARTITION_SPLIT | 12401 | + _ => PARTITION_SPLIT, |
| 12402 | + } | ||
| 12373 | }; | 12403 | }; |
| 12374 | match part { | 12404 | match part { |
| 12375 | PARTITION_NONE => { | 12405 | PARTITION_NONE => { |
| @@ -12426,20 +12456,27 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 12426 | } else { | 12456 | } else { |
| 12427 | match (has_cols32, has_rows32) { | 12457 | match (has_cols32, has_rows32) { |
| 12428 | (true, false) => { | 12458 | (true, false) => { |
| 12429 | - dec.symbol_fixed(&gather( | 12459 | + // lane-golomb r1 (class `parsed-then-discarded`): the gathered |
| 12430 | - &cdfs.partition_w32[ctx32], | 12460 | + // bit IS the partition -- 0 means PARTITION_HORZ, only 1 means SPLIT |
| 12431 | - VERT_ALIKE, | 12461 | + // (libaom `ec_read_partition_impl`). |
| 12432 | - )); | 12462 | + if dec.symbol_fixed(&gather(&cdfs.partition_w32[ctx32], VERT_ALIKE)) == 1 { |
| 12463 | + PARTITION_SPLIT | ||
| 12464 | + } else { | ||
| 12465 | + PARTITION_HORZ | ||
| 12466 | + } | ||
| 12433 | } | 12467 | } |
| 12434 | (false, true) => { | 12468 | (false, true) => { |
| 12435 | - dec.symbol_fixed(&gather( | 12469 | + // lane-golomb r1 (class `parsed-then-discarded`): the gathered |
| 12436 | - &cdfs.partition_w32[ctx32], | 12470 | + // bit IS the partition -- 0 means PARTITION_VERT, only 1 means SPLIT |
| 12437 | - HORZ_ALIKE, | 12471 | + // (libaom `ec_read_partition_impl`). |
| 12438 | - )); | 12472 | + if dec.symbol_fixed(&gather(&cdfs.partition_w32[ctx32], HORZ_ALIKE)) == 1 { |
| 12473 | + PARTITION_SPLIT | ||
| 12474 | + } else { | ||
| 12475 | + PARTITION_VERT | ||
| 12439 | } | 12476 | } |
| 12440 | - _ => {} | ||
| 12441 | } | 12477 | } |
| 12442 | - PARTITION_SPLIT | 12478 | + _ => PARTITION_SPLIT, |
| 12479 | + } | ||
| 12443 | }; | 12480 | }; |
| 12444 | match part32 { | 12481 | match part32 { |
| 12445 | PARTITION_NONE => { | 12482 | PARTITION_NONE => { |
| @@ -12760,11 +12797,14 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 12760 | )?; | 12797 | )?; |
| 12761 | continue; | 12798 | continue; |
| 12762 | } | 12799 | } |
| 12763 | - if part16 != PARTITION_SPLIT { | 12800 | + // lane-r14 r2 (verifier note): every |
| 12764 | - return Err(unsupported( | 12801 | + // one of the 10 symbols this CDF can |
| 12765 | - "a 16x16-level partition value outside PARTITION_NONE..PARTITION_VERT_4", | 12802 | + // produce is handled above, so SPLIT |
| 12766 | - )); | 12803 | + // is the only value that reaches |
| 12767 | - } | 12804 | + // here -- the refusal that used to |
| 12805 | + // stand here was unreachable and is | ||
| 12806 | + // gone from `refusal_inventory`. | ||
| 12807 | + debug_assert_eq!(part16, PARTITION_SPLIT); | ||
| 12768 | // A real (non-straddle) SPLIT of a | 12808 | // A real (non-straddle) SPLIT of a |
| 12769 | // whole 16x16 into four 8x8 leaves -- | 12809 | // whole 16x16 into four 8x8 leaves -- |
| 12770 | // the same recursion the straddle | 12810 | // the same recursion the straddle |
| @@ -12898,16 +12938,63 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 12898 | does not code yet", | 12938 | does not code yet", |
| 12899 | )); | 12939 | )); |
| 12900 | } | 12940 | } |
| 12901 | - if has_cols16 { | 12941 | + // lane-golomb r1 (class |
| 12942 | + // `parsed-then-discarded`): the gathered | ||
| 12943 | + // bit IS the partition -- 0 names | ||
| 12944 | + // PARTITION_HORZ (resp. VERT), only 1 is | ||
| 12945 | + // SPLIT (libaom `ec_read_partition_impl`). | ||
| 12946 | + // This path can only walk the four SPLIT | ||
| 12947 | + // leaves, so a 0 refuses by name instead | ||
| 12948 | + // of desyncing. | ||
| 12949 | + let edge_split = if has_cols16 { | ||
| 12902 | dec.symbol_fixed(&gather( | 12950 | dec.symbol_fixed(&gather( |
| 12903 | &cdfs.partition_w16[ctx16], | 12951 | &cdfs.partition_w16[ctx16], |
| 12904 | VERT_ALIKE, | 12952 | VERT_ALIKE, |
| 12905 | - )); | 12953 | + )) |
| 12906 | } else { | 12954 | } else { |
| 12907 | dec.symbol_fixed(&gather( | 12955 | dec.symbol_fixed(&gather( |
| 12908 | &cdfs.partition_w16[ctx16], | 12956 | &cdfs.partition_w16[ctx16], |
| 12909 | HORZ_ALIKE, | 12957 | HORZ_ALIKE, |
| 12910 | - )); | 12958 | + )) |
| 12959 | + }; | ||
| 12960 | + if edge_split == 0 { | ||
| 12961 | + // lane-oddh r1: the strip IS decodable | ||
| 12962 | + // -- libaom's `decode_partition` codes | ||
| 12963 | + // only the FIRST half of an edge | ||
| 12964 | + // HORZ/VERT (the second call is | ||
| 12965 | + // guarded by the same has_rows/ | ||
| 12966 | + // has_cols test that made the | ||
| 12967 | + // partition non-square), so one | ||
| 12968 | + // 16x8 (resp. 8x16) strip covers the | ||
| 12969 | + // whole visible band of a frame whose | ||
| 12970 | + // height (resp. width) is 8 mod 16 -- | ||
| 12971 | + // the user's 3840x1608 film. | ||
| 12972 | + HORZ_VERT_INTRA_HITS.with(|c| c.set(c.get() + 1)); | ||
| 12973 | + EDGE_RECT_STRIP_HITS.with(|c| c.set(c.get() + 1)); | ||
| 12974 | + let (mi_row0, mi_col0) = | ||
| 12975 | + (sr as u32 * SUB_MI, sc as u32 * SUB_MI); | ||
| 12976 | + let (bw, bh) = if has_cols16 { (16, 8) } else { (8, 16) }; | ||
| 12977 | + let mode = decode_leaf_rect( | ||
| 12978 | + &mut dec, | ||
| 12979 | + &mut cdfs, | ||
| 12980 | + &mut neighbours, | ||
| 12981 | + at16, | ||
| 12982 | + (mi_row0 as usize, mi_col0 as usize), | ||
| 12983 | + bw, | ||
| 12984 | + bh, | ||
| 12985 | + None, | ||
| 12986 | + &mut y, | ||
| 12987 | + &mut u, | ||
| 12988 | + &mut v, | ||
| 12989 | + enable_filter_intra, | ||
| 12990 | + allow_screen_content_tools, | ||
| 12991 | + base_q_idx, | ||
| 12992 | + tx_select, | ||
| 12993 | + reduced_tx_set, | ||
| 12994 | + )?; | ||
| 12995 | + neighbours.above_mode[sc] = mode; | ||
| 12996 | + neighbours.left_mode[sr] = mode; | ||
| 12997 | + continue; | ||
| 12911 | } | 12998 | } |
| 12912 | let (mi_row0, mi_col0) = | 12999 | let (mi_row0, mi_col0) = |
| 12913 | (sr as u32 * SUB_MI, sc as u32 * SUB_MI); | 13000 | (sr as u32 * SUB_MI, sc as u32 * SUB_MI); |
| @@ -13457,6 +13544,10 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 13457 | tx_select, | 13544 | tx_select, |
| 13458 | reduced_tx_set, | 13545 | reduced_tx_set, |
| 13459 | )?; | 13546 | )?; |
| 13547 | + // lane-golomb r1: at the frame edge only the first half of the | ||
| 13548 | + // strip is coded (libaom `decode_partition` guards the second | ||
| 13549 | + // with the same has_rows test that made this partition non-square). | ||
| 13550 | + if has_rows { | ||
| 13460 | decode_block_rect64( | 13551 | decode_block_rect64( |
| 13461 | &mut dec, | 13552 | &mut dec, |
| 13462 | &mut cdfs, | 13553 | &mut cdfs, |
| @@ -13474,6 +13565,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 13474 | reduced_tx_set, | 13565 | reduced_tx_set, |
| 13475 | )?; | 13566 | )?; |
| 13476 | } | 13567 | } |
| 13568 | + } | ||
| 13477 | PARTITION_VERT => { | 13569 | PARTITION_VERT => { |
| 13478 | // lane-sbpart r2: mirror of PARTITION_HORZ above with | 13570 | // lane-sbpart r2: mirror of PARTITION_HORZ above with |
| 13479 | // width/height swapped. | 13571 | // width/height swapped. |
| @@ -13493,6 +13585,10 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 13493 | tx_select, | 13585 | tx_select, |
| 13494 | reduced_tx_set, | 13586 | reduced_tx_set, |
| 13495 | )?; | 13587 | )?; |
| 13588 | + // lane-golomb r1: at the frame edge only the first half of the | ||
| 13589 | + // strip is coded (libaom `decode_partition` guards the second | ||
| 13590 | + // with the same has_cols test that made this partition non-square). | ||
| 13591 | + if has_cols { | ||
| 13496 | decode_block_rect64( | 13592 | decode_block_rect64( |
| 13497 | &mut dec, | 13593 | &mut dec, |
| 13498 | &mut cdfs, | 13594 | &mut cdfs, |
| @@ -13510,6 +13606,7 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | |||
| 13510 | reduced_tx_set, | 13606 | reduced_tx_set, |
| 13511 | )?; | 13607 | )?; |
| 13512 | } | 13608 | } |
| 13609 | + } | ||
| 13513 | PARTITION_HORZ_A | PARTITION_HORZ_B | PARTITION_VERT_A | PARTITION_VERT_B => { | 13610 | PARTITION_HORZ_A | PARTITION_HORZ_B | PARTITION_VERT_A | PARTITION_VERT_B => { |
| 13514 | // lane-part32 r4: the four superblock-level AB arms, each | 13611 | // lane-part32 r4: the four superblock-level AB arms, each |
| 13515 | // two 32x32 squares plus one 64x32/32x64 strip, in | 13612 | // two 32x32 squares plus one 64x32/32x64 strip, in |
| @@ -19850,12 +19947,24 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( | |||
| 19850 | p | 19947 | p |
| 19851 | } | 19948 | } |
| 19852 | (true, false) => { | 19949 | (true, false) => { |
| 19853 | - dec.symbol_fixed(&gather(&cdfs.partition_w64[sb_ctx], VERT_ALIKE)); | 19950 | + // lane-golomb r1 (class `parsed-then-discarded`): the gathered |
| 19951 | + // bit IS the partition -- 0 means PARTITION_HORZ, only 1 means SPLIT | ||
| 19952 | + // (libaom `ec_read_partition_impl`). | ||
| 19953 | + if dec.symbol_fixed(&gather(&cdfs.partition_w64[sb_ctx], VERT_ALIKE)) == 1 { | ||
| 19854 | PARTITION_SPLIT | 19954 | PARTITION_SPLIT |
| 19955 | + } else { | ||
| 19956 | + PARTITION_HORZ | ||
| 19957 | + } | ||
| 19855 | } | 19958 | } |
| 19856 | (false, true) => { | 19959 | (false, true) => { |
| 19857 | - dec.symbol_fixed(&gather(&cdfs.partition_w64[sb_ctx], HORZ_ALIKE)); | 19960 | + // lane-golomb r1 (class `parsed-then-discarded`): the gathered |
| 19961 | + // bit IS the partition -- 0 means PARTITION_VERT, only 1 means SPLIT | ||
| 19962 | + // (libaom `ec_read_partition_impl`). | ||
| 19963 | + if dec.symbol_fixed(&gather(&cdfs.partition_w64[sb_ctx], HORZ_ALIKE)) == 1 { | ||
| 19858 | PARTITION_SPLIT | 19964 | PARTITION_SPLIT |
| 19965 | + } else { | ||
| 19966 | + PARTITION_VERT | ||
| 19967 | + } | ||
| 19859 | } | 19968 | } |
| 19860 | (false, false) => PARTITION_SPLIT, | 19969 | (false, false) => PARTITION_SPLIT, |
| 19861 | }; | 19970 | }; |
| @@ -20023,14 +20132,27 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( | |||
| 20023 | } else { | 20132 | } else { |
| 20024 | match (has_cols32, has_rows32) { | 20133 | match (has_cols32, has_rows32) { |
| 20025 | (true, false) => { | 20134 | (true, false) => { |
| 20026 | - dec.symbol_fixed(&gather(&cdfs.partition_w32[ctx32], VERT_ALIKE)); | 20135 | + // lane-golomb r1 (class `parsed-then-discarded`): the gathered |
| 20136 | + // bit IS the partition -- 0 means PARTITION_HORZ, only 1 means SPLIT | ||
| 20137 | + // (libaom `ec_read_partition_impl`). | ||
| 20138 | + if dec.symbol_fixed(&gather(&cdfs.partition_w32[ctx32], VERT_ALIKE)) == 1 { | ||
| 20139 | + PARTITION_SPLIT | ||
| 20140 | + } else { | ||
| 20141 | + PARTITION_HORZ | ||
| 20142 | + } | ||
| 20027 | } | 20143 | } |
| 20028 | (false, true) => { | 20144 | (false, true) => { |
| 20029 | - dec.symbol_fixed(&gather(&cdfs.partition_w32[ctx32], HORZ_ALIKE)); | 20145 | + // lane-golomb r1 (class `parsed-then-discarded`): the gathered |
| 20146 | + // bit IS the partition -- 0 means PARTITION_VERT, only 1 means SPLIT | ||
| 20147 | + // (libaom `ec_read_partition_impl`). | ||
| 20148 | + if dec.symbol_fixed(&gather(&cdfs.partition_w32[ctx32], HORZ_ALIKE)) == 1 { | ||
| 20149 | + PARTITION_SPLIT | ||
| 20150 | + } else { | ||
| 20151 | + PARTITION_VERT | ||
| 20030 | } | 20152 | } |
| 20031 | - _ => {} | ||
| 20032 | } | 20153 | } |
| 20033 | - PARTITION_SPLIT | 20154 | + _ => PARTITION_SPLIT, |
| 20155 | + } | ||
| 20034 | }; | 20156 | }; |
| 20035 | match part32 { | 20157 | match part32 { |
| 20036 | PARTITION_NONE => { | 20158 | PARTITION_NONE => { |
| @@ -20122,17 +20244,24 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( | |||
| 20122 | p | 20244 | p |
| 20123 | } else { | 20245 | } else { |
| 20124 | if has_cols16 { | 20246 | if has_cols16 { |
| 20125 | - dec.symbol_fixed(&gather( | 20247 | + // lane-golomb r1 (class `parsed-then-discarded`): the gathered |
| 20126 | - &cdfs.partition_w16[ctx16], | 20248 | + // bit IS the partition -- 0 means PARTITION_HORZ, only 1 means SPLIT |
| 20127 | - VERT_ALIKE, | 20249 | + // (libaom `ec_read_partition_impl`). |
| 20128 | - )); | 20250 | + if dec.symbol_fixed(&gather(&cdfs.partition_w16[ctx16], VERT_ALIKE)) == 1 { |
| 20251 | + PARTITION_SPLIT | ||
| 20129 | } else { | 20252 | } else { |
| 20130 | - dec.symbol_fixed(&gather( | 20253 | + PARTITION_HORZ |
| 20131 | - &cdfs.partition_w16[ctx16], | ||
| 20132 | - HORZ_ALIKE, | ||
| 20133 | - )); | ||
| 20134 | } | 20254 | } |
| 20255 | + } else { | ||
| 20256 | + // lane-golomb r1 (class `parsed-then-discarded`): the gathered | ||
| 20257 | + // bit IS the partition -- 0 means PARTITION_VERT, only 1 means SPLIT | ||
| 20258 | + // (libaom `ec_read_partition_impl`). | ||
| 20259 | + if dec.symbol_fixed(&gather(&cdfs.partition_w16[ctx16], HORZ_ALIKE)) == 1 { | ||
| 20135 | PARTITION_SPLIT | 20260 | PARTITION_SPLIT |
| 20261 | + } else { | ||
| 20262 | + PARTITION_VERT | ||
| 20263 | + } | ||
| 20264 | + } | ||
| 20136 | }; | 20265 | }; |
| 20137 | if part16 == PARTITION_NONE { | 20266 | if part16 == PARTITION_NONE { |
| 20138 | decode_inter_block( | 20267 | decode_inter_block( |
crates/ec-av1/src/refusal_inventory.rsmodified+1 -1
| @@ -34,7 +34,6 @@ const REFUSALS: &[&str] = &[ | |||
| 34 | "a coded HORZ/VERT strip whose chroma transform has no rect coefficient tables here", | 34 | "a coded HORZ/VERT strip whose chroma transform has no rect coefficient tables here", |
| 35 | "a split intra strip whose transform unit is {tx_w}x{tx_h} (no luma coefficient tables for that shape here)", | 35 | "a split intra strip whose transform unit is {tx_w}x{tx_h} (no luma coefficient tables for that shape here)", |
| 36 | "an inter partition below 8x8 (this decoder codes no inter leaf smaller than 8x8; lane-sub8 scoped to intra)", | 36 | "an inter partition below 8x8 (this decoder codes no inter leaf smaller than 8x8; lane-sub8 scoped to intra)", |
| 37 | - "a 16x16-level partition value outside PARTITION_NONE..PARTITION_VERT_4", | ||
| 38 | "a 1:4 rect strip that actually uses a palette (reconstruction is not ported at this shape)", | 37 | "a 1:4 rect strip that actually uses a palette (reconstruction is not ported at this shape)", |
| 39 | "a 16x16 block whose true edge cuts through both axes needs a rectangular transform this decoder does not code yet", | 38 | "a 16x16 block whose true edge cuts through both axes needs a rectangular transform this decoder does not code yet", |
| 40 | "a 16x16 inter block whose true edge cuts through both axes needs a rectangular transform this decoder does not code yet", | 39 | "a 16x16 inter block whose true edge cuts through both axes needs a rectangular transform this decoder does not code yet", |
| @@ -50,6 +49,7 @@ const REFUSALS: &[&str] = &[ | |||
| 50 | "a sub-8x8 leaf that uses intrabc (this reader has no block-vector path; the 8x8-and-up reader reconstructs one)", | 49 | "a sub-8x8 leaf that uses intrabc (this reader has no block-vector path; the 8x8-and-up reader reconstructs one)", |
| 51 | "an intrabc block under TxMode::Select (its transform size is coded by the inter var-tx partition tree, which this decoder never reads)", | 50 | "an intrabc block under TxMode::Select (its transform size is coded by the inter var-tx partition tree, which this decoder never reads)", |
| 52 | "a bit depth of 12 (this decoder is gated at 8 and 10 only: warp/MC/wiener rounding shifts change at 12-bit and no 12-bit gate exists)", | 51 | "a bit depth of 12 (this decoder is gated at 8 and 10 only: warp/MC/wiener rounding shifts change at 12-bit and no 12-bit gate exists)", |
| 52 | + "a sequence using 128x128 superblocks on a frame larger than 64x64 (this decoder's whole partition/CDEF/LR grid is 64x64-superblock only; aomenc picks 128x128 at --cpu-used=0)", | ||
| 53 | "a frame OBU with no tile group", | 53 | "a frame OBU with no tile group", |
| 54 | "a frame naming primary_ref_frame at a reference slot with no saved CDF state", | 54 | "a frame naming primary_ref_frame at a reference slot with no saved CDF state", |
| 55 | "a frame with no mode-info grid", | 55 | "a frame with no mode-info grid", |
crates/ec-av1/src/stream.rsmodified+291 -4
| @@ -531,6 +531,37 @@ pub fn decode_stream(data: &[u8]) -> Result<Vec<Picture>> { | |||
| 531 | "a bit depth of 12 (this decoder is gated at 8 and 10 only: warp/MC/wiener rounding shifts change at 12-bit and no 12-bit gate exists)", | 531 | "a bit depth of 12 (this decoder is gated at 8 and 10 only: warp/MC/wiener rounding shifts change at 12-bit and no 12-bit gate exists)", |
| 532 | )); | 532 | )); |
| 533 | } | 533 | } |
| 534 | + // lane-oddh r2: `use_128x128_superblock` reaches every level of the | ||
| 535 | + // decode -- the partition tree starts at BLOCK_128X128, `SB_MI` is 32 | ||
| 536 | + // mi units, and the CDEF/LR/deblock grids are per-128 -- and this | ||
| 537 | + // decoder is written for 64x64 superblocks throughout (`SB_MI = 16`, | ||
| 538 | + // no BLOCK_128X128 partition read at all). Until r1 that was SILENT: | ||
| 539 | + // a 64x72 aomenc key frame at `--cpu-used=0` (libaom picks 128x128 | ||
| 540 | + // whenever speed is 0, `av1_select_sb_size`) desynced at the very | ||
| 541 | + // first symbol -- aomdec reads a gathered 2-symbol | ||
| 542 | + // BLOCK_128X128 partition (has_cols false at mi_cols=16, | ||
| 543 | + // has_rows true at mi_rows=18) where we read a 10-symbol | ||
| 544 | + // BLOCK_64X64 one from the same byte, giving PARTITION_VERT_4 (9) | ||
| 545 | + // against SPLIT (3). Refuse by name rather than decode wrong pixels. | ||
| 546 | + // | ||
| 547 | + // Scoped, not blanket (measured: a blanket refusal red-lined 29 | ||
| 548 | + // previously pixel-exact gates): on a frame of at most 64x64 a | ||
| 549 | + // 128x128 superblock decodes IDENTICALLY to a 64x64 one -- mi (0,0) | ||
| 550 | + // has neither `has_rows` nor `has_cols`, so BLOCK_128X128 is a forced | ||
| 551 | + // SPLIT that reads no symbol, and only one of its four 64x64 children | ||
| 552 | + // is inside the frame. Every sibling inter gate at 64x64 and | ||
| 553 | + // `--cpu-used=0` is exactly that case. The divergence starts the | ||
| 554 | + // moment a superblock has a second child in frame. | ||
| 555 | + if parser | ||
| 556 | + .sequence_header() | ||
| 557 | + .is_some_and(|seq| seq.use_128x128_superblock) | ||
| 558 | + && (header.mi_cols > 16 || header.mi_rows > 16) | ||
| 559 | + { | ||
| 560 | + return Err(Error::unsupported( | ||
| 561 | + "AV1 decode_stream", | ||
| 562 | + "a sequence using 128x128 superblocks on a frame larger than 64x64 (this decoder's whole partition/CDEF/LR grid is 64x64-superblock only; aomenc picks 128x128 at --cpu-used=0)", | ||
| 563 | + )); | ||
| 564 | + } | ||
| 534 | crate::decode::set_bit_depth(bit_depth); | 565 | crate::decode::set_bit_depth(bit_depth); |
| 535 | // lane-av1comp: `comp_group_idx`/`compound_idx`'s own gating bits. | 566 | // lane-av1comp: `comp_group_idx`/`compound_idx`'s own gating bits. |
| 536 | let enable_masked_compound = parser | 567 | let enable_masked_compound = parser |
| @@ -942,6 +973,209 @@ mod tests { | |||
| 942 | ); | 973 | ); |
| 943 | } | 974 | } |
| 944 | 975 | ||
| 976 | + /// lane-oddh r2 GATE: the frame-edge half-strip arms r1 added (a 64x32 / | ||
| 977 | + /// 32x64 superblock-level or 16x8 / 8x16 16-level INTER block where the | ||
| 978 | + /// frame's true edge cuts the strip in half) actually fire and decode | ||
| 979 | + /// pixel-exact, at both bit depths. 160 = two full superblock rows plus | ||
| 980 | + /// 32 pixels, so every superblock in the last row is a half strip; without | ||
| 981 | + /// r1's arms these attempts refused outright, which is why this gate | ||
| 982 | + /// asserts a nonzero `edge_rect_strip_hits` DELTA on attempts that were | ||
| 983 | + /// actually compared -- a refused attempt's hits would prove nothing | ||
| 984 | + /// (class "counter from refused stream"). | ||
| 985 | + #[test] | ||
| 986 | + #[ignore = "2026-09-02 lane-oddh r2: no aomenc recipe reaches the INTER edge half-strip arm yet -- rect partitions OFF makes the encoder answer the forced gathered edge symbol SPLIT every time (both bit depths decode 192x160 pixel-exact, edge_rect_strip_hits=0), and rect ON stops at three other lanes' gaps first: at cq 40 'a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs rectangular residual coding', at cq 62 'an INTER 32x32 partition type this decoder does not code (value=8/9)' (HORZ_4/VERT_4 even with --enable-1to4-partitions=0), and at min-partition 16 'a HORZ/VERT intra strip below 16x16 with a split transform'. The KEY-frame half of the same edge is gated: the tiny size sweep now covers 64x72/72x64/64x136/136x64/192x136"] | ||
| 987 | + fn a_real_aomenc_inter_frame_edge_half_strip_decodes_pixel_exact() { | ||
| 988 | + const NAME: &str = "a_real_aomenc_inter_frame_edge_half_strip_decodes_pixel_exact"; | ||
| 989 | + let _gate_lock = lock_gate_counters(); | ||
| 990 | + if !have_ffmpeg() || !have_aomenc() { | ||
| 991 | + eprintln!("SKIP {NAME}: no ffmpeg/aomenc"); | ||
| 992 | + return; | ||
| 993 | + } | ||
| 994 | + let (width, height, frames) = (192usize, 160usize, 6usize); | ||
| 995 | + let mut compared = 0u32; | ||
| 996 | + let mut strip_hits = 0usize; | ||
| 997 | + let mut refused = 0u32; | ||
| 998 | + for bit_depth in [8u32, 10u32] { | ||
| 999 | + let duration = frames as f64 / 25.0; | ||
| 1000 | + let source = format!("testsrc2=size={width}x{height}:duration={duration}:rate=25"); | ||
| 1001 | + let pix_fmt = if bit_depth == 10 { "yuv420p10le" } else { "yuv420p" }; | ||
| 1002 | + let y4m = Command::new("ffmpeg") | ||
| 1003 | + .args([ | ||
| 1004 | + "-v", "error", "-f", "lavfi", "-i", &source, "-t", &duration.to_string(), | ||
| 1005 | + "-pix_fmt", pix_fmt, "-strict", "-1", "-f", "yuv4mpegpipe", "-", | ||
| 1006 | + ]) | ||
| 1007 | + .stdin(Stdio::null()) | ||
| 1008 | + .stdout(Stdio::piped()) | ||
| 1009 | + .stderr(Stdio::piped()) | ||
| 1010 | + .output() | ||
| 1011 | + .expect("ffmpeg failed to run"); | ||
| 1012 | + assert!( | ||
| 1013 | + y4m.status.success(), | ||
| 1014 | + "{NAME}: ffmpeg refused the {bit_depth}-bit fixture: {}", | ||
| 1015 | + String::from_utf8_lossy(&y4m.stderr) | ||
| 1016 | + ); | ||
| 1017 | + let depth_arg = format!("--bit-depth={bit_depth}"); | ||
| 1018 | + let input_depth_arg = format!("--input-bit-depth={bit_depth}"); | ||
| 1019 | + let mut child = Command::new(aomenc_path()) | ||
| 1020 | + .args([ | ||
| 1021 | + "--codec=av1", "--passes=1", "--end-usage=q", "--cq-level=62", | ||
| 1022 | + // cpu-used >= 1 keeps libaom on 64x64 superblocks at this | ||
| 1023 | + // size (`av1_select_sb_size`: speed >= 1 and <= 480p). | ||
| 1024 | + "--cpu-used=4", "--threads=1", "--row-mt=0", "--kf-max-dist=1000", | ||
| 1025 | + &depth_arg, &input_depth_arg, | ||
| 1026 | + // The tool set every sibling inter gate pins; the edge | ||
| 1027 | + // strip itself needs rect partitions left ON. | ||
| 1028 | + "--enable-warped-motion=0", "--enable-obmc=0", "--enable-masked-comp=0", | ||
| 1029 | + "--enable-interintra-comp=0", "--enable-onesided-comp=0", | ||
| 1030 | + "--enable-interintra-wedge=0", "--enable-smooth-interintra=0", | ||
| 1031 | + // Rect partitions stay ON: the edge strip is a FORCED | ||
| 1032 | + // (gathered) HORZ at the boundary, but with rect coding | ||
| 1033 | + // off the encoder answers that gathered symbol SPLIT every | ||
| 1034 | + // time and the arm never fires (measured, r2). | ||
| 1035 | + "--enable-ab-partitions=0", "--enable-1to4-partitions=0", | ||
| 1036 | + "--enable-palette=0", "--enable-intrabc=0", "--enable-cdef=0", | ||
| 1037 | + "--enable-restoration=0", "--enable-ref-frame-mvs=0", | ||
| 1038 | + "--enable-tx-size-search=0", "--enable-filter-intra=0", | ||
| 1039 | + "--enable-smooth-intra=0", "--enable-paeth-intra=0", | ||
| 1040 | + "--enable-directional-intra=0", "--enable-angle-delta=0", | ||
| 1041 | + "--enable-cfl-intra=0", | ||
| 1042 | + // 16 is the smallest leaf this decoder codes rect strips | ||
| 1043 | + // at; below it the sub-16 strip/1:4 refusals fire first | ||
| 1044 | + // and the gate never reaches the edge arm. | ||
| 1045 | + // 160 = two full superblock rows plus 32, so the forced | ||
| 1046 | + // HORZ at the last row is a 64x32 -- the superblock-level | ||
| 1047 | + // arm -- and a 32 floor keeps the run out of the sub-16 | ||
| 1048 | + // rect-strip gap another lane owns. | ||
| 1049 | + "--min-partition-size=32", "--max-partition-size=64", | ||
| 1050 | + "--obu", "-o", "-", "-", | ||
| 1051 | + ]) | ||
| 1052 | + .stdin(Stdio::piped()) | ||
| 1053 | + .stdout(Stdio::piped()) | ||
| 1054 | + .stderr(Stdio::piped()) | ||
| 1055 | + .spawn() | ||
| 1056 | + .expect("aomenc failed to start"); | ||
| 1057 | + child.stdin.take().expect("aomenc stdin").write_all(&y4m.stdout).expect("write y4m"); | ||
| 1058 | + let out = child.wait_with_output().expect("aomenc failed to run"); | ||
| 1059 | + assert!(out.status.success(), "aomenc refused: {}", String::from_utf8_lossy(&out.stderr)); | ||
| 1060 | + let stream = out.stdout; | ||
| 1061 | + | ||
| 1062 | + let before = crate::decode::edge_rect_strip_hits(); | ||
| 1063 | + let decoded = match decode_stream(&stream) { | ||
| 1064 | + Ok(f) => f, | ||
| 1065 | + Err(e) => { | ||
| 1066 | + let msg = e.to_string(); | ||
| 1067 | + assert!( | ||
| 1068 | + msg.contains("unsupported"), | ||
| 1069 | + "{NAME}: {bit_depth}-bit failed outright, not a named refusal: {msg}" | ||
| 1070 | + ); | ||
| 1071 | + eprintln!("{NAME}: {bit_depth}-bit REFUSED {msg}"); | ||
| 1072 | + refused += 1; | ||
| 1073 | + continue; | ||
| 1074 | + } | ||
| 1075 | + }; | ||
| 1076 | + let reference = if bit_depth == 10 { | ||
| 1077 | + ffmpeg_decode_sequence_10bit(&stream, width, height, frames) | ||
| 1078 | + } else { | ||
| 1079 | + ffmpeg_decode_sequence(&stream, width, height, frames) | ||
| 1080 | + }; | ||
| 1081 | + assert_eq!( | ||
| 1082 | + decoded.len(), | ||
| 1083 | + reference.len(), | ||
| 1084 | + "{NAME}: {bit_depth}-bit frame count" | ||
| 1085 | + ); | ||
| 1086 | + for (i, (ours, theirs)) in decoded.iter().zip(&reference).enumerate() { | ||
| 1087 | + let nd = |a: &[u16], b: &[u16]| a.iter().zip(b).filter(|(x, y)| x != y).count(); | ||
| 1088 | + assert_eq!( | ||
| 1089 | + (nd(&ours.y, &theirs.y), nd(&ours.u, &theirs.u), nd(&ours.v, &theirs.v)), | ||
| 1090 | + (0, 0, 0), | ||
| 1091 | + "{NAME}: {bit_depth}-bit frame {i} differs from ffmpeg" | ||
| 1092 | + ); | ||
| 1093 | + } | ||
| 1094 | + compared += 1; | ||
| 1095 | + strip_hits += crate::decode::edge_rect_strip_hits() - before; | ||
| 1096 | + } | ||
| 1097 | + assert!(compared > 0, "{NAME}: every attempt refused ({refused}) -- gate proved nothing"); | ||
| 1098 | + assert!( | ||
| 1099 | + strip_hits > 0, | ||
| 1100 | + "{NAME}: {compared} attempts decoded pixel-exact but not one frame-edge half strip \ | ||
| 1101 | + fired -- the recipe no longer reaches the arm this gate exists for" | ||
| 1102 | + ); | ||
| 1103 | + eprintln!("{NAME}: {compared} attempts pixel-exact, edge_rect_strip_hits={strip_hits}, {refused} refusals"); | ||
| 1104 | + } | ||
| 1105 | + | ||
| 1106 | + /// lane-oddh r2 GATE: a REAL aomenc stream that uses 128x128 superblocks | ||
| 1107 | + /// is refused by name, not silently mis-decoded. This is the root cause of | ||
| 1108 | + /// r1's pinned 64x72 first-symbol desync: libaom's `av1_select_sb_size` | ||
| 1109 | + /// returns BLOCK_128X128 whenever speed is 0, so a tiny frame encoded at | ||
| 1110 | + /// `--cpu-used=0` carries 128x128 superblocks, and this 64x64-only | ||
| 1111 | + /// decoder read a 10-symbol BLOCK_64X64 partition (value 9, VERT_4) where | ||
| 1112 | + /// aomdec read a gathered 2-symbol BLOCK_128X128 one (value 3, SPLIT) from | ||
| 1113 | + /// the same byte -- the uncompressed header parse was byte-identical | ||
| 1114 | + /// (49 bits, tile data at file offset 20; hand-verified against spec | ||
| 1115 | + /// 5.9.2 field by field). | ||
| 1116 | + /// | ||
| 1117 | + /// The `use_128x128_superblock` assert is the "knob reached the tool" | ||
| 1118 | + /// half: without it, an aomenc that ignored `--sb-size=128` would leave | ||
| 1119 | + /// the gate asserting a refusal that never fires. | ||
| 1120 | + #[test] | ||
| 1121 | + fn a_real_aomenc_128x128_superblock_stream_is_refused_by_name() { | ||
| 1122 | + if !have_ffmpeg() || !have_aomenc() { | ||
| 1123 | + eprintln!("SKIP: no ffmpeg/aomenc"); | ||
| 1124 | + return; | ||
| 1125 | + } | ||
| 1126 | + let (width, height) = (64usize, 72usize); | ||
| 1127 | + let y4m = Command::new("ffmpeg") | ||
| 1128 | + .args([ | ||
| 1129 | + "-v", "error", "-f", "lavfi", "-i", | ||
| 1130 | + "mandelbrot=size=64x72:rate=25:start_x=-0.6:start_y=-0.4", "-t", "0.04", | ||
| 1131 | + "-pix_fmt", "yuv420p", "-f", "yuv4mpegpipe", "-", | ||
| 1132 | + ]) | ||
| 1133 | + .stdin(Stdio::null()) | ||
| 1134 | + .stdout(Stdio::piped()) | ||
| 1135 | + .stderr(Stdio::piped()) | ||
| 1136 | + .output() | ||
| 1137 | + .expect("ffmpeg failed to run"); | ||
| 1138 | + assert!(y4m.status.success(), "ffmpeg fixture: {}", String::from_utf8_lossy(&y4m.stderr)); | ||
| 1139 | + let mut child = Command::new(aomenc_path()) | ||
| 1140 | + .args([ | ||
| 1141 | + "--codec=av1", "--passes=1", "--end-usage=q", "--cq-level=32", | ||
| 1142 | + "--cpu-used=0", "--sb-size=128", "--kf-max-dist=0", "--limit=1", | ||
| 1143 | + "--threads=1", "--row-mt=0", "--obu", "-o", "-", "-", | ||
| 1144 | + ]) | ||
| 1145 | + .stdin(Stdio::piped()) | ||
| 1146 | + .stdout(Stdio::piped()) | ||
| 1147 | + .stderr(Stdio::piped()) | ||
| 1148 | + .spawn() | ||
| 1149 | + .expect("aomenc failed to start"); | ||
| 1150 | + child.stdin.take().expect("aomenc stdin").write_all(&y4m.stdout).expect("write y4m"); | ||
| 1151 | + let out = child.wait_with_output().expect("aomenc failed to run"); | ||
| 1152 | + assert!(out.status.success(), "aomenc refused: {}", String::from_utf8_lossy(&out.stderr)); | ||
| 1153 | + let stream = out.stdout; | ||
| 1154 | + | ||
| 1155 | + // The knob actually arrived: this stream's sequence header codes | ||
| 1156 | + // `use_128x128_superblock = 1`. | ||
| 1157 | + let mut parser = Av1Parser::new(); | ||
| 1158 | + let mut pos = 0usize; | ||
| 1159 | + let mut sb128 = false; | ||
| 1160 | + while pos < stream.len() { | ||
| 1161 | + let Ok(obu) = parser.parse_obu(&stream[pos..]) else { | ||
| 1162 | + break; | ||
| 1163 | + }; | ||
| 1164 | + pos += obu.total_size.max(1); | ||
| 1165 | + if let Some(seq) = parser.sequence_header() { | ||
| 1166 | + sb128 = seq.use_128x128_superblock; | ||
| 1167 | + break; | ||
| 1168 | + } | ||
| 1169 | + } | ||
| 1170 | + assert!(sb128, "aomenc ignored --sb-size=128: this stream is 64x64-superblock"); | ||
| 1171 | + | ||
| 1172 | + let err = decode_stream(&stream).unwrap_err().to_string(); | ||
| 1173 | + assert!( | ||
| 1174 | + err.contains("a sequence using 128x128 superblocks"), | ||
| 1175 | + "expected the 128x128-superblock refusal for {width}x{height}, got: {err}" | ||
| 1176 | + ); | ||
| 1177 | + } | ||
| 1178 | + | ||
| 945 | /// `decode_stream` on a lone key frame's stream matches both the tile | 1179 | /// `decode_stream` on a lone key frame's stream matches both the tile |
| 946 | /// path (`decode_key_frame_tile` called directly on `Encoded::tile`) and | 1180 | /// path (`decode_key_frame_tile` called directly on `Encoded::tile`) and |
| 947 | /// the encoder's own reconstruction, at an even and an odd size. | 1181 | /// the encoder's own reconstruction, at an even and an odd size. |
| @@ -2709,6 +2943,41 @@ mod tests { | |||
| 2709 | eprintln!("{NAME}: pixel-exact, grain_hits={}", crate::film_grain::grain_hits()); | 2943 | eprintln!("{NAME}: pixel-exact, grain_hits={}", crate::film_grain::grain_hits()); |
| 2710 | } | 2944 | } |
| 2711 | 2945 | ||
| 2946 | + /// lane-golomb r1: THE FILM ITSELF. `crates/ec-av1/fixtures/reelb_head_key_frame.obu` | ||
| 2947 | + /// is the first frame of the user's ReelB AV1 release (3840x1608 | ||
| 2948 | + /// yuv420p10le, `ffmpeg -i <mkv> -c copy -frames:v 1 -f obu`, 147 bytes) -- | ||
| 2949 | + /// a real 10-bit key frame whose height is NOT a multiple of the 64-pixel | ||
| 2950 | + /// superblock, so its last superblock row (mi_row=400 of 402) carries the | ||
| 2951 | + /// edge partition symbol this lane fixed: libaom's `ec_read_partition_impl` | ||
| 2952 | + /// returns `PARTITION_HORZ` when the gathered `split_or_horz` bit is 0, and | ||
| 2953 | + /// this decoder used to READ that bit and throw it away, forcing SPLIT | ||
| 2954 | + /// (class `parsed-then-discarded`). The desync surfaced two rows later as | ||
| 2955 | + /// "a Golomb tail longer than this decoder reads" -- a refusal naming the | ||
| 2956 | + /// symptom, never the cause. | ||
| 2957 | + #[test] | ||
| 2958 | + fn the_reelb_head_key_frame_decodes_pixel_exact() { | ||
| 2959 | + const NAME: &str = "the_reelb_head_key_frame_decodes_pixel_exact"; | ||
| 2960 | + if !have_ffmpeg() { | ||
| 2961 | + eprintln!("SKIP {NAME}: no ffmpeg"); | ||
| 2962 | + return; | ||
| 2963 | + } | ||
| 2964 | + let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) | ||
| 2965 | + .join("fixtures/reelb_head_key_frame.obu"); | ||
| 2966 | + let stream = std::fs::read(&path) | ||
| 2967 | + .unwrap_or_else(|e| panic!("{NAME}: reading {}: {e}", path.display())); | ||
| 2968 | + let (width, height) = (3840usize, 1608usize); | ||
| 2969 | + let frames = match decode_stream(&stream) { | ||
| 2970 | + Ok(frames) => frames, | ||
| 2971 | + Err(e) => panic!("{NAME}: decode_stream refused: {e}"), | ||
| 2972 | + }; | ||
| 2973 | + assert_eq!(frames.len(), 1, "{NAME}: one key frame"); | ||
| 2974 | + assert_eq!((frames[0].width, frames[0].height), (width, height)); | ||
| 2975 | + let ffmpeg_frames = ffmpeg_decode_sequence_10bit(&stream, width, height, 1); | ||
| 2976 | + assert_eq!(frames[0].y, ffmpeg_frames[0].y, "{NAME}: luma vs ffmpeg"); | ||
| 2977 | + assert_eq!(frames[0].u, ffmpeg_frames[0].u, "{NAME}: U vs ffmpeg"); | ||
| 2978 | + assert_eq!(frames[0].v, ffmpeg_frames[0].v, "{NAME}: V vs ffmpeg"); | ||
| 2979 | + } | ||
| 2980 | + | ||
| 2712 | /// lane-hbd10 r1: a real `aomenc --bit-depth=10 --superres-mode=1 | 2981 | /// lane-hbd10 r1: a real `aomenc --bit-depth=10 --superres-mode=1 |
| 2713 | /// --superres-denominator=12` key frame, decoded pixel-exact against | 2982 | /// --superres-denominator=12` key frame, decoded pixel-exact against |
| 2714 | /// ffmpeg's own 10-bit decode. Proves `superres::upscale_row`'s | 2983 | /// ffmpeg's own 10-bit decode. Proves `superres::upscale_row`'s |
| @@ -13195,8 +13464,26 @@ mod tests { | |||
| 13195 | eprintln!("SKIP: no ffmpeg/aomenc"); | 13464 | eprintln!("SKIP: no ffmpeg/aomenc"); |
| 13196 | return; | 13465 | return; |
| 13197 | } | 13466 | } |
| 13198 | - let sizes: &[(usize, usize)] = | 13467 | + // lane-oddh r2: the second half of this list is the odd-height / |
| 13199 | - &[(8, 8), (16, 16), (32, 32), (16, 32), (32, 16), (64, 64), (48, 48), (24, 24)]; | 13468 | + // odd-width ladder -- frame sizes whose last superblock row or column |
| 13469 | + // is a partial 64 (72 = one full SB plus 8 rows, 136 = two plus 8), | ||
| 13470 | + // which is where the frame-edge half-strip path r1 added is the only | ||
| 13471 | + // way to code the edge. 192x136 is the inter-sized member. | ||
| 13472 | + let sizes: &[(usize, usize)] = &[ | ||
| 13473 | + (8, 8), | ||
| 13474 | + (16, 16), | ||
| 13475 | + (32, 32), | ||
| 13476 | + (16, 32), | ||
| 13477 | + (32, 16), | ||
| 13478 | + (64, 64), | ||
| 13479 | + (48, 48), | ||
| 13480 | + (24, 24), | ||
| 13481 | + (64, 72), | ||
| 13482 | + (72, 64), | ||
| 13483 | + (64, 136), | ||
| 13484 | + (136, 64), | ||
| 13485 | + (192, 136), | ||
| 13486 | + ]; | ||
| 13200 | let mut total_exact = 0u32; | 13487 | let mut total_exact = 0u32; |
| 13201 | for &(width, height) in sizes { | 13488 | for &(width, height) in sizes { |
| 13202 | let mut ok = 0u32; | 13489 | let mut ok = 0u32; |
| @@ -13314,12 +13601,12 @@ mod tests { | |||
| 13314 | } | 13601 | } |
| 13315 | // Hit counter: the sweep proved nothing unless every size x seed | 13602 | // Hit counter: the sweep proved nothing unless every size x seed |
| 13316 | // attempt really ran end to end (aomenc -> us -> ffmpeg compare). | 13603 | // attempt really ran end to end (aomenc -> us -> ffmpeg compare). |
| 13317 | - // Floor (hit counter): 7 of the 8 sizes must decode all 10 seeds | 13604 | + // Floor (hit counter): 12 of the 13 sizes must decode all 10 seeds |
| 13318 | // pixel-exact -- only 8x8 is allowed to refuse outright today. If a | 13605 | // pixel-exact -- only 8x8 is allowed to refuse outright today. If a |
| 13319 | // future change makes sizes refuse instead of decode, this fails | 13606 | // future change makes sizes refuse instead of decode, this fails |
| 13320 | // rather than passing on refusals alone. | 13607 | // rather than passing on refusals alone. |
| 13321 | assert!( | 13608 | assert!( |
| 13322 | - total_exact >= 70, | 13609 | + total_exact >= 120, |
| 13323 | "tiny sweep only reached {total_exact} pixel-exact attempts (floor 70) -- \ | 13610 | "tiny sweep only reached {total_exact} pixel-exact attempts (floor 70) -- \ |
| 13324 | refusals cannot substitute for decodes" | 13611 | refusals cannot substitute for decodes" |
| 13325 | ); | 13612 | ); |
lanes/golomb-r1.report.mdadded+47 -0
| @@ -0,0 +1,47 @@ | |||
| 1 | +# lane-golomb r1 — the edge partition bit was read and thrown away | ||
| 2 | + | ||
| 3 | +## Verdict | ||
| 4 | +The "a Golomb tail longer than this decoder reads" refusal on the ReelB head was, as | ||
| 5 | +suspected (`refusal-from-own-desync`), a symptom. Root cause: at a frame edge the partition | ||
| 6 | +symbol is a single *gathered* bit, and this decoder read it and **discarded** it, always | ||
| 7 | +inferring `PARTITION_SPLIT`. libaom `ec_read_partition_impl` (decodeframe.c:1255): | ||
| 8 | +`!has_rows && has_cols` → `read ? PARTITION_SPLIT : PARTITION_HORZ`; the mirror case → | ||
| 9 | +`PARTITION_VERT`. Class: `parsed-then-discarded`. | ||
| 10 | + | ||
| 11 | +Charter STEP-2 fallback ("libaom read_golomb caps at 32 bits, extend the reader") is FALSE: | ||
| 12 | +`~/.cache/aom-oracle/src/av1/decoder/decodetxb.c:22` aborts the frame at `length > 20`, exactly | ||
| 13 | +our cap. The cap was never the bug and is unchanged. | ||
| 14 | + | ||
| 15 | +## First divergent element (EVIDENCE) | ||
| 16 | +EVIDENCE: /tmp/.../scratchpad/{ao-all.txt,ours-all.txt} | instrumented aomdec vs decode_probe, | ||
| 17 | +EC_TRACE_MODE+EC_TRACE_MODE_STEP+EC_TRACE_COEFF on the 2-frame extract f2.obu, ladders aligned | ||
| 18 | +element by element on msac RANGE | first diff at element 12053: key frame, **mi_row=400 | ||
| 19 | +mi_col=0** (last, 8-pixel-tall superblock row of a 1608-tall frame), `name=skip` | ||
| 20 | +oracle rng=34753 vs ours rng=43258. Oracle codes that superblock as one `BLOCK_64X32` | ||
| 21 | +(`EC_IMODE ... bsize=11`, PARTITION_HORZ); we forced SPLIT and descended to 16x16. | ||
| 22 | +After the fix the range ladder is element-exact for all 13712 shared elements of the key frame | ||
| 23 | +(EVIDENCE: /tmp/.../scratchpad/{a4.n,o4.n} | awk first-diff | idx 13713, inside a later INTER | ||
| 24 | +frame, i.e. past the whole key frame). | ||
| 25 | + | ||
| 26 | +## Fix | ||
| 27 | +`crates/ec-av1/src/decode.rs` — every edge-partition site, both tile paths, all three levels | ||
| 28 | +(64/32/16, intra and inter): the gathered bit now names HORZ/VERT vs SPLIT. The 64-level | ||
| 29 | +HORZ/VERT arms only decode the second half when it is inside the frame (`has_rows`/`has_cols`), | ||
| 30 | +mirroring libaom `decode_partition`. The intra 16x16 edge site can only walk four SPLIT leaves, | ||
| 31 | +so a 0 bit refuses by name there (new string, listed in `refusal_inventory.rs`) instead of | ||
| 32 | +desyncing. | ||
| 33 | + | ||
| 34 | +## Gates | ||
| 35 | +- NEW `stream::tests::the_reelb_head_key_frame_decodes_pixel_exact` — the film itself: | ||
| 36 | + `crates/ec-av1/fixtures/reelb_head_key_frame.obu` (147 B, first frame of his 3840x1608 | ||
| 37 | + yuv420p10le release) decodes and matches `ffmpeg -pix_fmt yuv420p10le` on Y, U and V. | ||
| 38 | + EVIDENCE: cargo test -p ec-av1 --lib -- the_reelb_head_key_frame | 1 passed | | ||
| 39 | + Y/U/V all equal to ffmpeg's decode, 3840x1608. | ||
| 40 | +- Full lib suite: `$HOME/.cache/golomb-suite.log` — **337 passed / 0 failed / 31 ignored**. | ||
| 41 | + | ||
| 42 | +## Film probes after the fix | ||
| 43 | +- `hg-head.obu` (18 frames): key frame + first inter frames now entropy-exact; stops at | ||
| 44 | + "an inter SB-level partition type other than NONE or SPLIT" — the same edge partition, now | ||
| 45 | + correctly decoded as HORZ, on an INTER superblock row the inter path cannot code (rect inter | ||
| 46 | + residual coding does not exist here). Next lane. | ||
| 47 | +- `reelb5.obu`: "a 32x32-level 1:4 strip with a split transform (depth=2)" (unchanged by this lane). | ||
lanes/oddh-r1.report.mdadded+76 -0
| @@ -0,0 +1,76 @@ | |||
| 1 | +# lane-oddh r1 — frames whose height/width is 8 mod 16 | ||
| 2 | + | ||
| 3 | +Branch `lane-oddh` off main `b1d8457`. Target: the user's ReelB film shape | ||
| 4 | +(3840x1608, `1608 % 16 == 8`), where every inter attempt derailed. | ||
| 5 | + | ||
| 6 | +## What the round established (measured, not reasoned) | ||
| 7 | + | ||
| 8 | +1. **The charter's premise is stale in its blame, right in its shape.** The refusal | ||
| 9 | + `"a non-DC chroma mode on an 8x8 inter-frame leaf"` is NOT what odd-height frames | ||
| 10 | + stop at once lane-golomb's edge-partition fix is present. Cherry-picking | ||
| 11 | + `eacd7fd` (clean, no conflicts) moves 192x136 to the same refusal its | ||
| 12 | + *even-height control* 192x128 hits, i.e. that one is width/content-related, not | ||
| 13 | + odd-height (see 4). | ||
| 14 | + | ||
| 15 | +2. **Minimal repro is 64x72, not 192x136.** With the standard inter-gate recipe | ||
| 16 | + (`--enable-rect-partitions=0 --min/max-partition-size=8/16`, mandelbrot, cq 40): | ||
| 17 | + - `64x64` decodes 4/4 frames pixel-exact (control), | ||
| 18 | + - `64x72` (bottom band 8 px) stopped at the key-frame 16-level edge refusal, | ||
| 19 | + - `72x64` (right band 8 px) stops in the inter tile path. | ||
| 20 | + | ||
| 21 | +3. **The real blocker underneath is a first-symbol desync of the KEY tile at | ||
| 22 | + height 72.** Not an edge-band defect at all: the *first* partition symbol of the | ||
| 23 | + frame diverges. | ||
| 24 | + `EVIDENCE: /tmp/.../scratchpad/k-64x72.obu (667 B, key frame only, aomenc cq40) | EC_AV1_TRACE=1 decode_probe vs EC_TRACE=1 aomdec | first element mi=(0,0) bsize=BLOCK_64X64 ctx=0: aomdec value=3 (PARTITION_SPLIT, tell=1 rng=32768), ours value=9` | ||
| 25 | + `EVIDENCE: /tmp/.../scratchpad/k-64x72.{ours,aom,ref}.y | aomdec --rawvideo + ffmpeg rawvideo vs our Y dump | aomdec == ffmpeg byte-for-byte; ours differs in 4583 of 4608 Y samples (whole frame), while the 64x64 control differs in 0` | ||
| 26 | + Our tile payload starts at file offset 20 in both the 64x64 and the 64x72 stream | ||
| 27 | + (`key_tile_bytes len=543`/`647`, file sizes 563/667), and `base_q_idx=160`, | ||
| 28 | + `mi_cols=16`, `mi_rows=18` all parse correctly, so the header field values are | ||
| 29 | + right; the divergence is in the very first symbol read off those bytes. | ||
| 30 | + **Not diagnosed further — this is the handoff item.** Ruled out by reading the | ||
| 31 | + source: `sb_rows`/`sb_cols` (`sequence.rs:409-422`, 18 -> 2 correct) and the | ||
| 32 | + uniform-spacing tile-info loops (`frame.rs:1296-1334`, both increment loops match | ||
| 33 | + spec 5.9.15, so the extra `increment_tile_rows_log2` bit that height 72 introduces | ||
| 34 | + IS consumed). | ||
| 35 | + | ||
| 36 | +4. Pre-existing, unrelated to odd height: `192x128` and `192x136` both stop at | ||
| 37 | + `"a 1:4 partition below 16x16"` with `--enable-1to4-partitions=0` on the command | ||
| 38 | + line — a same-shaped refusal-from-own-desync at width 192, present on the control. | ||
| 39 | + | ||
| 40 | +## Code changed (all in this worktree, unproven end to end) | ||
| 41 | + | ||
| 42 | +- cherry-pick `eacd7fd` (lane-golomb) — the frame-edge partition bit at 6 sites in | ||
| 43 | + both tile paths, plus its film key-frame fixture/gate. Clean merge. | ||
| 44 | +- `crates/ec-av1/src/decode.rs:11371` — the key-frame 16-level frame-edge | ||
| 45 | + `PARTITION_HORZ`/`VERT` now decodes its single visible 16x8 / 8x16 strip through | ||
| 46 | + `decode_leaf_rect` instead of refusing (removes that refusal string; entry dropped | ||
| 47 | + from `refusal_inventory.rs`). | ||
| 48 | +- `crates/ec-av1/src/decode.rs` (inter tile path, superblock level and 16-level) — | ||
| 49 | + the same edge half-strip as one 64x32 / 32x64 resp. 16x8 / 8x16 inter block | ||
| 50 | + (`write_w`/`write_h`, square CDF/size-class corner-cut, exactly the accepted | ||
| 51 | + corner-cut of the 32-level rect arm at `decode.rs:18448`). Interior rect | ||
| 52 | + partitions still refuse by name. | ||
| 53 | +- `decode.rs` — new counter `edge_rect_strip_hits()` (blocks decoded inside the 8px | ||
| 54 | + edge band), for the gate a successor must write. | ||
| 55 | + | ||
| 56 | +`corner-cut:` the two inter edge arms read square CDFs / size classes for a | ||
| 57 | +rectangular block (ceiling: coefficient and mode syntax for TX_64X32/TX_16X8 inter is | ||
| 58 | +not modelled; upgrade path = the same treatment the 32-level rect arm eventually gets). | ||
| 59 | + | ||
| 60 | +## Verification status — honest | ||
| 61 | + | ||
| 62 | +- NO gate was added and NO refusal claim is proven: every stream that reaches the new | ||
| 63 | + arms is desynced before them (finding 3), so a pixel compare would measure the | ||
| 64 | + desync, not the arm. Writing | ||
| 65 | + `a_real_aomenc_inter_sequence_with_an_8px_tall_edge_row_decodes_pixel_exact` on top | ||
| 66 | + of a first-symbol desync would have produced a vacuous or a permanently-red gate. | ||
| 67 | +- Suite: see `$HOME/.cache/oddh-suite.log` (run as a systemd unit, result quoted in | ||
| 68 | + the handoff message). | ||
| 69 | + | ||
| 70 | +## Disposition | ||
| 71 | + | ||
| 72 | +- fix-now (next round, r2): the 64x72 key-tile first-symbol desync. It is the root | ||
| 73 | + blocker; the edge arms above are dead code until it is fixed. | ||
| 74 | +- deferred(the desync above): the 8px-edge-band gate + the refusal lift claim. | ||
| 75 | +- deferred(width-192 defect, separate lane): the `"1:4 partition below 16x16"` stop | ||
| 76 | + that both 192x128 and 192x136 share. | ||
lanes/oddh-r2.report.mdadded+97 -0
| @@ -0,0 +1,97 @@ | |||
| 1 | +# lane-oddh r2 — the 64x72 first-symbol desync is 128x128 superblocks | ||
| 2 | + | ||
| 3 | +## Root cause (byte-level proof, not inference) | ||
| 4 | + | ||
| 5 | +r1's pinned defect — a 64x72 aomenc KEY frame desyncing at the FIRST symbol | ||
| 6 | +(aomdec value=3, ours 9) — is **not** an odd-height defect and **not** a header | ||
| 7 | +parse defect. The stream's sequence header codes `use_128x128_superblock = 1`, | ||
| 8 | +and this decoder is 64x64-superblock only (`SB_MI = 16`, no BLOCK_128X128 | ||
| 9 | +partition read anywhere; `decode.rs` never reads `use_128x128_superblock`). | ||
| 10 | + | ||
| 11 | +libaom picks it: `av1_select_sb_size` (encoder_utils.c:1000-1003) returns | ||
| 12 | +BLOCK_64X64 only when `speed >= 1 && min(w,h) <= 480`. r1's fixture was | ||
| 13 | +encoded at `--cpu-used=0`, so speed 0 fell through to BLOCK_128X128. | ||
| 14 | + | ||
| 15 | +What the two decoders do with the same first byte: | ||
| 16 | + | ||
| 17 | +| | libaom (aomdec) | ours | | ||
| 18 | +|---|---|---| | ||
| 19 | +| first block | BLOCK_128X128 at mi (0,0): `has_cols = 0+16 < 16` false, `has_rows = 16 < 18` true | BLOCK_64X64 at mi (0,0) | | ||
| 20 | +| symbol read | gathered 2-symbol partition (`partition_gather_horz_alike`) | 10-symbol `partition_cdf[12]` | | ||
| 21 | +| value | 3 = PARTITION_SPLIT | 9 = PARTITION_VERT_4 | | ||
| 22 | + | ||
| 23 | +Ruled out first, by hand, field by field against spec 5.9.2 for this stream: | ||
| 24 | +the uncompressed header is **49 bits** (3 before tile_info, 1 tile_info, 12 | ||
| 25 | +quant, 1 seg, 1 delta, 29 loop filter — levels 36/38/21/19, sharpness 0, | ||
| 26 | +mode_ref_delta_enabled 1, update 0 — 0 cdef, 0 lr, tx_mode 1, reduced_tx_set 1), | ||
| 27 | +byte-aligning tile data to file offset 20. Our parser reads exactly the same 49 | ||
| 28 | +bits. Two independent msac implementations (ours and a from-spec python one) | ||
| 29 | +read symbol 9 from offset 20 with `partition_cdf[12]`, so the bytes and the | ||
| 30 | +table are both ours-correct — only the *block size* is wrong. | ||
| 31 | + | ||
| 32 | +EVIDENCE: hand-parsed header bits + msac offset probe (both diagnostics reverted after use) | parsed k-64x72.obu, printed per-section bit positions (3/4/16/17/18/47/47/47/49), then decoded the first partition symbol at file offsets 16..24 with `PARTITION_W64[0]` in ours and in a from-spec python msac | both give 9 at offset 20 (aomdec: 3), i.e. same bytes, same table, different alphabet | ||
| 33 | + | ||
| 34 | +## What changed | ||
| 35 | + | ||
| 36 | +- `crates/ec-av1/src/stream.rs:509` — `decode_stream` now REFUSES a sequence | ||
| 37 | + with `use_128x128_superblock` **on a frame larger than 64x64** by name | ||
| 38 | + instead of silently decoding it as 64x64 superblocks (wrong pixels, whole | ||
| 39 | + frame). The scoping is measured, not reasoned: a blanket refusal red-lined | ||
| 40 | + 29 previously pixel-exact gates (29 failed / 318 passed), because at | ||
| 41 | + <= 64x64 a 128x128 superblock decodes identically -- mi (0,0) has neither | ||
| 42 | + `has_rows` nor `has_cols`, so BLOCK_128X128 is a forced SPLIT that reads no | ||
| 43 | + symbol and only one 64x64 child is in frame. Every sibling inter gate at | ||
| 44 | + 64x64 `--cpu-used=0` is exactly that case. | ||
| 45 | +- `crates/ec-av1/src/stream.rs` — new gate | ||
| 46 | + `a_real_aomenc_128x128_superblock_stream_is_refused_by_name`: real aomenc, | ||
| 47 | + 64x72, `--cpu-used=0 --sb-size=128`; asserts the stream's sequence header | ||
| 48 | + really codes `use_128x128_superblock` (knob-reached-the-tool) and then that | ||
| 49 | + the refusal fires. | ||
| 50 | +- `crates/ec-av1/src/stream.rs` — `a_real_aomenc_tiny_frame_size_sweep_decodes_pixel_exact` | ||
| 51 | + extended with the odd ladder 64x72, 72x64, 64x136, 136x64, 192x136; floor | ||
| 52 | + raised 70 -> 120 pixel-exact attempts. | ||
| 53 | +- `crates/ec-av1/src/refusal_inventory.rs` — the new refusal string pinned. | ||
| 54 | +- `crates/ec-av1/src/stream.rs` — `a_real_aomenc_inter_frame_edge_half_strip_decodes_pixel_exact` | ||
| 55 | + written and left `#[ignore]`d with its measured reason (below). | ||
| 56 | + | ||
| 57 | +## The size ladder (the table the charter asked for) | ||
| 58 | + | ||
| 59 | +`cargo test -p ec-av1 --lib -- a_real_aomenc_tiny_frame_size_sweep_decodes_pixel_exact`, | ||
| 60 | +10 seeds each, real aomenc at `--cpu-used=4` (= 64x64 superblocks), 8-bit: | ||
| 61 | + | ||
| 62 | +| size | pixel-exact | refused | | ||
| 63 | +|---|---|---| | ||
| 64 | +| 8x8 | 0/10 | 10 (16x16 rect transform, pre-existing) | | ||
| 65 | +| 16x16, 32x32, 16x32, 32x16, 64x64, 48x48, 24x24 | 10/10 each | 0 | | ||
| 66 | +| **64x72, 72x64, 64x136, 136x64, 192x136** | **10/10 each** | 0 | | ||
| 67 | + | ||
| 68 | +EVIDENCE: $HOME/.cache/oddh-suite-r2.log + the run above | 13 sizes x 10 seeds, aomenc -> our decoder -> ffmpeg sample compare | 120 pixel-exact attempts, 0 mismatches, "tiny frame sweep: 120 pixel-exact attempts" | ||
| 69 | + | ||
| 70 | +So odd height/width at 64x64 superblocks is **clean**, including r1's | ||
| 71 | +frame-edge half-strip code on the KEY path. | ||
| 72 | + | ||
| 73 | +## Open / deferred | ||
| 74 | + | ||
| 75 | +- deferred: 128x128 superblock decode — refused by name, not implemented — the | ||
| 76 | + partition tree, `SB_MI`, CDEF/LR/deblock grids and the loop-filter unit size | ||
| 77 | + are all 64-only; that is a lane, not a fix. Unblocked by: a lane that makes | ||
| 78 | + `SB_MI` a parameter and adds the BLOCK_128X128 partition read. | ||
| 79 | +- deferred: the INTER frame-edge half-strip arms r1 added are still UNGATED. | ||
| 80 | + Measured this round at 192x160 (last superblock row 32 tall, so the forced | ||
| 81 | + gathered edge symbol is a 64x32): with `--enable-rect-partitions=0` both bit | ||
| 82 | + depths decode 6 frames **pixel-exact** but `edge_rect_strip_hits = 0` (the | ||
| 83 | + encoder answers the forced symbol SPLIT every time); with rect ON the run | ||
| 84 | + stops at other lanes' gaps — cq 40 "a non-skip rectangular (HORZ/VERT/HORZ_B) | ||
| 85 | + strip needs rectangular residual coding", cq 62 "an INTER 32x32 partition | ||
| 86 | + type this decoder does not code (value=8/9)", min-partition 16 "a HORZ/VERT | ||
| 87 | + intra strip below 16x16 with a split transform". Unblocked by: the rect | ||
| 88 | + inter-residual lane. | ||
| 89 | + | ||
| 90 | +## Suite | ||
| 91 | + | ||
| 92 | +`cargo test -p ec-av1 --lib` (systemd unit, log `$HOME/.cache/oddh-suite-r2.log`): | ||
| 93 | +the blanket-refusal run was 318 passed / 29 failed / 32 ignored, every failure | ||
| 94 | +the new refusal firing on a 64x64 `--cpu-used=0` stream. After scoping the | ||
| 95 | +refusal to frames larger than 64x64, the 7-gate subset covering all of them | ||
| 96 | +plus the three new/extended gates is green (7 passed, 0 failed); the full-suite | ||
| 97 | +rerun on the scoped tree is launched to the same log and is r3's first read. | ||
lanes/r14-r1.report.mdmodified+1 -1
| @@ -15,7 +15,7 @@ then `decode_probe`: | |||
| 15 | alone was not enough. | 15 | alone was not enough. |
| 16 | * AFTER ccd58a2: `REFUSED: a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs | 16 | * AFTER ccd58a2: `REFUSED: a non-skip rectangular (HORZ/VERT/HORZ_B) strip needs |
| 17 | rectangular residual coding` -- ANOTHER lane's wall; the 1:4 one is gone, with | 17 | rectangular residual coding` -- ANOTHER lane's wall; the 1:4 one is gone, with |
| 18 | - 104 16x4 + 172 4x16 strips decoded at the 32 level alone before it stops. | 18 | + rect4_32 counters horz=104 vert=172 coded=238 (these are the 32-level 1:4 counters decode_probe prints, NOT rect4_16; the true rect4_16 numbers on kf300 are 96, 148, 122, 311, 63) strips decoded at the 32 level alone before it stops. |
| 19 | 19 | ||
| 20 | EVIDENCE: /tmp/claude-1000/-home-user-Documents-Code-Rust-edith-codecs/b6d8a07f-96a4-4bbb-b378-af9ae25cf7c9/scratchpad/r14/kf300.obu | decode_probe before/after each commit | refusal string moved 1:4-partition -> 1:4-split-transform -> rect-residual (another lane) | 20 | EVIDENCE: /tmp/claude-1000/-home-user-Documents-Code-Rust-edith-codecs/b6d8a07f-96a4-4bbb-b378-af9ae25cf7c9/scratchpad/r14/kf300.obu | decode_probe before/after each commit | refusal string moved 1:4-partition -> 1:4-split-transform -> rect-residual (another lane) |
| 21 | 21 | ||
lanes/r14-r2.report.mdmodified+17 -1
| @@ -57,7 +57,23 @@ EVIDENCE: `cargo run --example decode_probe -- seg3000.obu` before/after, `EC_AV | |||
| 57 | Merge-verification gates (on `399278b`): `16_level_1to4 superblock_level_ 32x32_level_1to4 | 57 | Merge-verification gates (on `399278b`): `16_level_1to4 superblock_level_ 32x32_level_1to4 |
| 58 | inter_sequence refusal_inventory gate_coverage` → 38 passed, 0 failed, 4 ignored. | 58 | inter_sequence refusal_inventory gate_coverage` → 38 passed, 0 failed, 4 ignored. |
| 59 | 59 | ||
| 60 | -Full suite: `$HOME/.cache/r14-suite-r2.log` (see totals line at the end of this file). | 60 | +Full suite: `$HOME/.cache/r14-suite-r2.log`, run on the tip after the second `git merge main` |
| 61 | +(main `b51719f`) — totals appended below. | ||
| 62 | + | ||
| 63 | +## Verifier notes folded in (round 2) | ||
| 64 | + | ||
| 65 | +1. `lanes/r14-r1.report.md:18` corrected: the "104 / 172" pair is `decode_probe`'s **rect4_32** | ||
| 66 | + counter line, not rect4_16; the true rect4_16 numbers on `kf300.obu` are 96, 148, 122, 311, 63. | ||
| 67 | +2. `"a 16x16-level partition value outside PARTITION_NONE..PARTITION_VERT_4"` was unreachable | ||
| 68 | + (all 10 symbols of that CDF are handled above the check) — removed from `decode.rs` (now a | ||
| 69 | + `debug_assert_eq!(part16, PARTITION_SPLIT)`) and from `refusal_inventory.rs`. | ||
| 70 | +3. The rectangular-residual wall lives in `decode_inter_block`, reached only from | ||
| 71 | + `decode_inter_frame_tile`, so it fires on an **inter** frame: the key frame of `kf300.obu` | ||
| 72 | + decodes through. **Not measured this round**: the decode-order index of the stopping frame and | ||
| 73 | + a 16-bit byte-equality compare of every frame before it. `decode_probe` reports only the | ||
| 74 | + refusal, and adding the per-frame `cmp` ladder did not fit this round's budget — | ||
| 75 | + deferred(a `decode_probe` mode that dumps every decoded frame before the refusal and diffs it | ||
| 76 | + against `ffmpeg -pix_fmt yuv420p10le`). | ||
| 61 | 77 | ||
| 62 | ## Residue | 78 | ## Residue |
| 63 | 79 | ||