Un-ignore the intrabc TX_MODE_SELECT witness
Browse files at this commitbbe08502569c6ab76be0418fa800ca7793f20eaaParent: 0674134- test
- un-ignore the intrabc TX_MODE_SELECT witness
- lift the 128-root screen-strip refusal
3 changed files +54 -73
- crates/ec-av1/src/decode.rs +6 -6
- crates/ec-av1/src/refusal_inventory.rs +15 -46
- crates/ec-av1/src/stream.rs +33 -21
crates/ec-av1/src/decode.rsmodified+6 -6
| @@ -8119,12 +8119,12 @@ fn decode_intra_rect_in_inter( | |||
| 8119 | // reference holds (a fresh smooth ramp) in exactly those two bands of an | 8119 | // reference holds (a fresh smooth ramp) in exactly those two bands of an |
| 8120 | // inter frame and the encoder codes those forced halves INTRA. | 8120 | // inter frame and the encoder codes those forced halves INTRA. |
| 8121 | if bw.max(bh) == 128 { | 8121 | if bw.max(bh) == 128 { |
| 8122 | - if allow_screen_content_tools { | 8122 | + // lane-t900 r32: no screen-content refusal here. `av1_allow_palette` |
| 8123 | - return Err(unsupported( | 8123 | + // rejects every footprint with a 128-pixel side (`bw > 64 || bh > 64`, |
| 8124 | - "a HORZ/VERT intra strip in a screen-content frame (palette syntax \ | 8124 | + // enumerated by `no_block_footprint_with_a_128_pixel_side_can_carry_\ |
| 8125 | - is consumed for square blocks only)", | 8125 | + // palette_syntax`), so a 128-root half consumes no palette syntax and |
| 8126 | - )); | 8126 | + // a screen-content frame's half is syntactically identical to the |
| 8127 | - } | 8127 | + // non-screen one this arm already decodes byte-exact. |
| 8128 | if coeff_trace_on() { | 8128 | if coeff_trace_on() { |
| 8129 | // lane-t900 r16: which decode-order frame this arm fires in -- | 8129 | // lane-t900 r16: which decode-order frame this arm fires in -- |
| 8130 | // interleaved with the `EC_COEFF_FRAME` markers, this is what | 8130 | // interleaved with the `EC_COEFF_FRAME` markers, this is what |
crates/ec-av1/src/refusal_inventory.rsmodified+15 -46
| @@ -56,7 +56,6 @@ const REFUSALS: &[&str] = &[ | |||
| 56 | "a block that actually uses a palette (Y) -- reconstruction is out of scope", | 56 | "a block that actually uses a palette (Y) -- reconstruction is out of scope", |
| 57 | "intra block copy on a HORZ/VERT/1:4 rect intra strip (reconstruction is not ported at this shape)", | 57 | "intra block copy on a HORZ/VERT/1:4 rect intra strip (reconstruction is not ported at this shape)", |
| 58 | "a sub-8x8 leaf that uses intrabc (this reader has no block-vector path; the 8x8-and-up reader reconstructs one)", | 58 | "a sub-8x8 leaf that uses intrabc (this reader has no block-vector path; the 8x8-and-up reader reconstructs one)", |
| 59 | - "an intrabc block under TxMode::Select (its transform size is coded by the inter var-tx partition tree, which this decoder never reads)", | ||
| 60 | "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)", | 59 | "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)", |
| 61 | "a frame OBU with no tile group", | 60 | "a frame OBU with no tile group", |
| 62 | "a frame naming primary_ref_frame at a reference slot with no saved CDF state", | 61 | "a frame naming primary_ref_frame at a reference slot with no saved CDF state", |
| @@ -124,37 +123,21 @@ const REFUSALS: &[&str] = &[ | |||
| 124 | // What still refuses is the 128-root half of a screen-content frame, whose | 123 | // What still refuses is the 128-root half of a screen-content frame, whose |
| 125 | // body (`decode_block_128rect`) reads no palette syntax and for which no | 124 | // body (`decode_block_128rect`) reads no palette syntax and for which no |
| 126 | // `--sb-size=128` screen witness exists yet. | 125 | // `--sb-size=128` screen witness exists yet. |
| 127 | - // lane-t900 r23 CENSUS for this string's remaining 128-root arm (the | 126 | + // lane-t900 r32: the 128-root arm is LIFTED. r31's enumeration |
| 128 | - // 16x4/4x16 arm was lifted in r22): its premise is already known to be | 127 | + // (`no_block_footprint_with_a_128_pixel_side_can_carry_palette_syntax`) is |
| 129 | - // false by the spec -- `read_palette_mode_info` (5.11.46) codes palette | 128 | + // its proof -- `av1_allow_palette`'s `bw > 64 || bh > 64` bound means a |
| 130 | - // only for `Block_Width <= 64 && Block_Height <= 64`, so a 128x64/64x128 | 129 | + // 128x64/64x128 half codes NO palette syntax at all, so a screen-content |
| 131 | - // half consumes NO palette syntax and the screen flag changes nothing | 130 | + // frame's half is byte-identical in syntax to the non-screen twin gate |
| 132 | - // about it. It stays because nothing witnesses it: 6 aomenc encodes at | 131 | + // `an_intra_coded_128_half_inside_an_inter_frame_decodes_pixel_exact` |
| 133 | - // `--sb-size=128 --tune-content=screen` (704x320 = 5*128+64 by 2*128+64, | 132 | + // already decodes pixel-exact. Nothing of this string remains. |
| 134 | - // the edge-forced size r18 proved for the non-screen twin; screen cell | 133 | + // lane-t900 r32: the residue of the LIFTED "an intrabc block under |
| 135 | - // content at cq 10/20/40, and r18's own panning-texture-plus-fresh-ramp | 134 | + // TxMode::Select". The inter var-tx tree is read in full, but the intra |
| 136 | - // shape with `--max-partition-size=128 --enable-ab-partitions=0 | 135 | + // luma reconstruct loop it feeds is a UNIFORM grid of one square |
| 137 | - // --enable-1to4-partitions=0`) code ZERO 128-root halves of any kind | 136 | + // transform, so a tree resolving to mixed leaf sizes would be |
| 138 | - // (`intra128_in_inter` and `sb128_rect` both 0 in every stream), so | 137 | + // reconstructed at the wrong stride. Neither arm of |
| 139 | - // lifting it would be a capability claim no gate exercises (class | 138 | + // `an_intrabc_block_under_tx_mode_select_decodes_pixel_exact` reaches it |
| 140 | - // `refusal-lifted-without-a-gate`). What is still untried: a 10-bit | 139 | + // (both resolve uniform), so it is unwitnessed and stays live. |
| 141 | - // source, and screen content in the forced bands with a NON-screen | 140 | + "an intrabc block whose var-tx tree resolved to mixed leaf transform sizes", |
| 142 | - // interior. | ||
| 143 | - // lane-t900 r31, ENUMERATION: the premise is DISPROVED -- `av1_allow_palette`'s | ||
| 144 | - // bound (`palette_bsize_ctx_wh`: `bw > 64 || bh > 64`) rejects every | ||
| 145 | - // footprint with a 128-pixel side, so a screen-content frame codes no | ||
| 146 | - // palette syntax on a 128-root half and that half decodes exactly like the | ||
| 147 | - // non-screen twin r18 already witnesses (test | ||
| 148 | - // `no_block_footprint_with_a_128_pixel_side_can_carry_palette_syntax`). | ||
| 149 | - // The string is a claim about the SYNTAX, and the syntax it fears does not | ||
| 150 | - // exist at this size. It stays UNPROVEN and live for two reasons: the | ||
| 151 | - // guarded condition is reachable (proving the lift safe is not proving the | ||
| 152 | - // case absent), and lifting it is a `decode.rs` edit -- delete the | ||
| 153 | - // `if allow_screen_content_tools { return Err(unsupported(..)) }` block | ||
| 154 | - // inside the `bw.max(bh) == 128` branch of `decode_intra_rect_in_inter` | ||
| 155 | - // -- which needs a `--sb-size=128 --tune-content=screen` witness that | ||
| 156 | - // actually codes a 128-root half (r23's census found none). | ||
| 157 | - "a HORZ/VERT intra strip in a screen-content frame (palette syntax is consumed for square blocks only)", | ||
| 158 | "a motion_mode symbol for a block shape with no CDF row here", | 141 | "a motion_mode symbol for a block shape with no CDF row here", |
| 159 | ]; | 142 | ]; |
| 160 | 143 | ||
| @@ -374,20 +357,6 @@ const PROVEN: &[(&str, &str)] = &[ | |||
| 374 | "a frame naming primary_ref_frame at a reference slot with no saved CDF state", | 357 | "a frame naming primary_ref_frame at a reference slot with no saved CDF state", |
| 375 | "an_inter_frame_naming_an_unrefreshed_primary_ref_slot_is_refused_by_name", | 358 | "an_inter_frame_naming_an_unrefreshed_primary_ref_slot_is_refused_by_name", |
| 376 | ), | 359 | ), |
| 377 | - // lane-t900 r31, census + refusal-by-name: 13 real `--tune-content=screen | ||
| 378 | - // --enable-intrabc=1` key frames measure this string instead of assuming | ||
| 379 | - // it. The refusal is NOT unreachable -- an exact-repetition source | ||
| 380 | - // (a 2x2 tiling of one bar pattern) with the rect/1:4 partitions off codes | ||
| 381 | - // an unskipped intrabc block on a square block of a TX_MODE_SELECT frame, | ||
| 382 | - // and exactly that arm refuses by name while the other twelve decode | ||
| 383 | - // pixel-exact. So it is a real capability gap with a waiting witness gate | ||
| 384 | - // (`an_intrabc_block_under_tx_mode_select_decodes_pixel_exact`, ignored), | ||
| 385 | - // and libaom does not couple the two bits: `select_tx_mode` | ||
| 386 | - // (encodeframe.c:2355) never reads `allow_intrabc`. | ||
| 387 | - ( | ||
| 388 | - "an intrabc block under TxMode::Select (its transform size is coded by the inter var-tx partition tree, which this decoder never reads)", | ||
| 389 | - "an_intrabc_census_over_screen_key_frames_measures_the_tx_select_refusal", | ||
| 390 | - ), | ||
| 391 | ]; | 360 | ]; |
| 392 | 361 | ||
| 393 | /// Gates whose `Err` arm turns a decode failure into a printed SKIP rather than | 362 | /// Gates whose `Err` arm turns a decode failure into a printed SKIP rather than |
crates/ec-av1/src/stream.rsmodified+33 -21
| @@ -4370,7 +4370,7 @@ mod tests { | |||
| 4370 | const TILE: &str = "smptebars=size=128x96:rate=25"; | 4370 | const TILE: &str = "smptebars=size=128x96:rate=25"; |
| 4371 | let (width, height) = (256usize, 192usize); | 4371 | let (width, height) = (256usize, 192usize); |
| 4372 | // (arm, source, cq, tx-size-search, tiled, square_only) | 4372 | // (arm, source, cq, tx-size-search, tiled, square_only) |
| 4373 | - let arms: [(&str, &str, &str, &str, bool, bool); 13] = [ | 4373 | + let arms: [(&str, &str, &str, &str, bool, bool); 14] = [ |
| 4374 | ("smptebars-cq40-txs1", SB, "40", "1", false, false), | 4374 | ("smptebars-cq40-txs1", SB, "40", "1", false, false), |
| 4375 | ("smptebars-cq45-txs1", SB, "45", "1", false, false), | 4375 | ("smptebars-cq45-txs1", SB, "45", "1", false, false), |
| 4376 | ("smptebars-cq55-txs1", SB, "55", "1", false, false), | 4376 | ("smptebars-cq55-txs1", SB, "55", "1", false, false), |
| @@ -4384,13 +4384,11 @@ mod tests { | |||
| 4384 | ("tiled-cq30-txs1", TILE, "30", "1", true, false), | 4384 | ("tiled-cq30-txs1", TILE, "30", "1", true, false), |
| 4385 | ("tiled-cq45-txs1", TILE, "45", "1", true, false), | 4385 | ("tiled-cq45-txs1", TILE, "45", "1", true, false), |
| 4386 | ("tiled-square-cq30-txs1", TILE, "30", "1", true, true), | 4386 | ("tiled-square-cq30-txs1", TILE, "30", "1", true, true), |
| 4387 | - // `tiled-square-cq45-txs1` belongs here too and is NOT in this | 4387 | + // lane-t900 r32: both square arms are now ORDINARY census members |
| 4388 | - // table: its intrabc blocks are all `skip`, so the `&& !skip` | 4388 | + // -- cq30 (unskipped intrabc, the inter var-tx tree) and cq45 |
| 4389 | - // guard lets them through -- and the frame decodes WRONG against | 4389 | + // (all-skip intrabc, `maxRectTxSize` with no symbol at all) decode |
| 4390 | - // ffmpeg. A refusal one `&&` narrower than the hole it guards | 4390 | + // pixel-exact, so nothing here reaches the lifted refusal. |
| 4391 | - // (class `refusal-hides-a-defect`); that arm lives in the ignored | 4391 | + ("tiled-square-cq45-txs1", TILE, "45", "1", true, true), |
| 4392 | - // gate below with the unskipped one, and the guard itself is a | ||
| 4393 | - // `decode.rs` edit this round could not make. | ||
| 4394 | ]; | 4392 | ]; |
| 4395 | let (mut select_arms, mut premise_arms, mut intrabc_arms, mut blocks_total) = | 4393 | let (mut select_arms, mut premise_arms, mut intrabc_arms, mut blocks_total) = |
| 4396 | (0u32, 0u32, 0u32, 0usize); | 4394 | (0u32, 0u32, 0u32, 0usize); |
| @@ -4468,9 +4466,9 @@ mod tests { | |||
| 4468 | tx_mode == Select, so the refusal's own premise was never within reach" | 4466 | tx_mode == Select, so the refusal's own premise was never within reach" |
| 4469 | ); | 4467 | ); |
| 4470 | assert_eq!( | 4468 | assert_eq!( |
| 4471 | - refused_tx_select, 1, | 4469 | + refused_tx_select, 0, |
| 4472 | - "{NAME}: exactly one arm (tiled-square-cq30-txs1) must reach the refusal -- if \ | 4470 | + "{NAME}: lane-t900 r32 lifted this refusal -- an intrabc block now reads the \ |
| 4473 | - none does, the census no longer measures it; if more do, say so here" | 4471 | + INTER tx-size syntax, so no arm may reach it again" |
| 4474 | ); | 4472 | ); |
| 4475 | assert!(frames_compared > 0, "{NAME}: no frame was compared pixel-exact"); | 4473 | assert!(frames_compared > 0, "{NAME}: no frame was compared pixel-exact"); |
| 4476 | } | 4474 | } |
| @@ -4484,13 +4482,17 @@ mod tests { | |||
| 4484 | /// (`read_var_tx_size`), which this decoder reads nowhere on the intra | 4482 | /// (`read_var_tx_size`), which this decoder reads nowhere on the intra |
| 4485 | /// path -- reading the intra `tx_depth` symbol instead desyncs. | 4483 | /// path -- reading the intra `tx_depth` symbol instead desyncs. |
| 4486 | /// | 4484 | /// |
| 4487 | - /// Two arms of the same recipe: `cq=30`, whose intrabc block is unskipped | 4485 | + /// lane-t900 r32 closed both arms. A SKIPPED intrabc block reads no |
| 4488 | - /// and refused by name, and `cq=45`, whose intrabc blocks are all `skip` | 4486 | + /// tx-size symbol at all (`allowSelect = !skip || !is_inter`, false for an |
| 4489 | - /// and therefore pass the `&& !skip` guard -- and decode WRONG (frame 0 | 4487 | + /// intrabc block since libaom's `is_inter_block` counts one); reading the |
| 4490 | - /// mismatches ffmpeg). So the refusal is one `&&` narrower than the hole: | 4488 | + /// intra `tx_depth` for it consumed a symbol libaom never wrote and |
| 4491 | - /// until the var-tx read lands, the skipped case needs the same refusal. | 4489 | + /// desynced the tile a whole block later, at the superblock corner |
| 4490 | + /// (192,64) (class `equal-range-means-unread`). An UNSKIPPED one reads the | ||
| 4491 | + /// inter var-tx tree (`read_var_tx_size`). r31's note that cq=45's blocks | ||
| 4492 | + /// are all `skip` was read off that desynced decode: with the tx-size read | ||
| 4493 | + /// corrected, cq=45 carries 3 unskipped intrabc blocks of 10 and cq=30 | ||
| 4494 | + /// carries 1 of 16, so both arms exercise both sides of the split. | ||
| 4492 | #[test] | 4495 | #[test] |
| 4493 | - #[ignore = "capability gap: an intrabc block's tx size is coded by the inter var-tx tree"] | ||
| 4494 | fn an_intrabc_block_under_tx_mode_select_decodes_pixel_exact() { | 4496 | fn an_intrabc_block_under_tx_mode_select_decodes_pixel_exact() { |
| 4495 | const NAME: &str = "an_intrabc_block_under_tx_mode_select_decodes_pixel_exact"; | 4497 | const NAME: &str = "an_intrabc_block_under_tx_mode_select_decodes_pixel_exact"; |
| 4496 | if !have_ffmpeg() || !have_aomenc() { | 4498 | if !have_ffmpeg() || !have_aomenc() { |
| @@ -4507,11 +4509,21 @@ mod tests { | |||
| 4507 | (select={select} premise={premise})" | 4509 | (select={select} premise={premise})" |
| 4508 | ); | 4510 | ); |
| 4509 | crate::decode::reset_intrabc_hits(); | 4511 | crate::decode::reset_intrabc_hits(); |
| 4512 | + crate::decode::reset_intrabc_vartx_hits(); | ||
| 4510 | let frames = decode_stream(&stream).unwrap_or_else(|e| panic!("{NAME}: cq={cq}: {e}")); | 4513 | let frames = decode_stream(&stream).unwrap_or_else(|e| panic!("{NAME}: cq={cq}: {e}")); |
| 4511 | - assert!( | 4514 | + let (blocks, vartx) = |
| 4512 | - crate::decode::intrabc_hits() > 0, | 4515 | + (crate::decode::intrabc_hits(), crate::decode::intrabc_vartx_hits()); |
| 4513 | - "{NAME}: cq={cq} no longer decodes an intrabc block" | 4516 | + assert!(blocks > 0, "{NAME}: cq={cq} no longer decodes an intrabc block"); |
| 4514 | - ); | 4517 | + // r31 recorded cq=45's intrabc blocks as ALL skip; that was read |
| 4518 | + // off the desynced decode. With the tx-size read corrected both | ||
| 4519 | + // arms carry unskipped ones (cq30 1 of 16, cq45 3 of 10), so both | ||
| 4520 | + // must reach the var-tx tree or the gate is blind to the lift | ||
| 4521 | + // (class `gate-blind-to-feature`). | ||
| 4522 | + assert!( | ||
| 4523 | + vartx > 0, | ||
| 4524 | + "{NAME}: cq={cq} no longer reads the inter var-tx tree for an intrabc block" | ||
| 4525 | + ); | ||
| 4526 | + eprintln!("{NAME}: cq={cq} {blocks} intrabc block(s), {vartx} through var-tx"); | ||
| 4515 | let theirs = ffmpeg_decode_sequence(&stream, width, height, frames.len()); | 4527 | let theirs = ffmpeg_decode_sequence(&stream, width, height, frames.len()); |
| 4516 | assert_eq!(frames.len(), theirs.len(), "{NAME}: cq={cq} frame count"); | 4528 | assert_eq!(frames.len(), theirs.len(), "{NAME}: cq={cq} frame count"); |
| 4517 | for (i, (ours, ref_frame)) in frames.iter().zip(theirs.iter()).enumerate() { | 4529 | for (i, (ours, ref_frame)) in frames.iter().zip(theirs.iter()).enumerate() { |