A 16x8/8x16 intra leaf reads tx_size_cdf[cat 1], not cat 2 -- wrong-row tx_depth desynced every 16-level rect strip under --enable-tx-size-search
Browse files at this commit5f35cce379c5779ee184b0897472dee744a68063Parent: 38d3bd3- fix
- a 16x8/8x16 intra leaf reads tx_size_cdf[cat 1], not cat 2 -- wrong-row tx_depth desynced every 16-level rect strip under --enable-tx-size-search
4 changed files +351 -5
- crates/ec-av1/examples/dump_yuv.rs +46 -0
- crates/ec-av1/src/decode.rs +36 -1
- crates/ec-av1/src/gate_coverage.rs +6 -4
- crates/ec-av1/src/stream.rs +263 -0
crates/ec-av1/examples/dump_yuv.rsadded+46 -0
| @@ -0,0 +1,46 @@ | ||
| 1 | +//! Decode one OBU stream and write every frame's planes as raw little-endian | |
| 2 | +//! `u16` (`<out-prefix>.f<N>.yuv`) — the high-bit-depth companion to | |
| 3 | +//! `EC_AV1_PREFILT_DUMP`, whose `as u8` narrowing throws away exactly the bits | |
| 4 | +//! a 10-bit mismatch lives in (lane-rect1d r1 found its defect by diffing this | |
| 5 | +//! against `ffmpeg -pix_fmt yuv420p10le -f rawvideo`). | |
| 6 | +//! | |
| 7 | +//! ```text | |
| 8 | +//! cargo run -p ec-av1 --example dump_yuv -- s.obu /tmp/ours | |
| 9 | +//! ffmpeg -v error -i s.obu -pix_fmt yuv420p10le -f rawvideo /tmp/ref.yuv | |
| 10 | +//! cmp /tmp/ours.f0.yuv /tmp/ref.yuv | |
| 11 | +//! ``` | |
| 12 | +fn main() { | |
| 13 | + let mut args = std::env::args().skip(1); | |
| 14 | + let (Some(path), Some(out)) = (args.next(), args.next()) else { | |
| 15 | + eprintln!("usage: dump_yuv <stream.obu> <out-prefix>"); | |
| 16 | + std::process::exit(2); | |
| 17 | + }; | |
| 18 | + let data = match std::fs::read(&path) { | |
| 19 | + Ok(data) => data, | |
| 20 | + Err(e) => { | |
| 21 | + eprintln!("{path}: {e}"); | |
| 22 | + std::process::exit(2); | |
| 23 | + } | |
| 24 | + }; | |
| 25 | + let frames = match ec_av1::stream::decode_stream(&data) { | |
| 26 | + Ok(frames) => frames, | |
| 27 | + Err(e) => { | |
| 28 | + eprintln!("{path}: {e}"); | |
| 29 | + std::process::exit(1); | |
| 30 | + } | |
| 31 | + }; | |
| 32 | + for (i, f) in frames.iter().enumerate() { | |
| 33 | + let mut buf = Vec::with_capacity((f.y.len() + f.u.len() + f.v.len()) * 2); | |
| 34 | + for plane in [&f.y, &f.u, &f.v] { | |
| 35 | + for &s in plane.iter() { | |
| 36 | + buf.extend_from_slice(&s.to_le_bytes()); | |
| 37 | + } | |
| 38 | + } | |
| 39 | + let name = format!("{out}.f{i}.yuv"); | |
| 40 | + if let Err(e) = std::fs::write(&name, &buf) { | |
| 41 | + eprintln!("{name}: {e}"); | |
| 42 | + std::process::exit(2); | |
| 43 | + } | |
| 44 | + println!("frame {i}: {}x{} -> {name}", f.width, f.height); | |
| 45 | + } | |
| 46 | +} |
crates/ec-av1/src/decode.rsmodified+36 -1
| @@ -972,6 +972,28 @@ pub(crate) fn filter_intra_rect_hits() -> usize { | ||
| 972 | 972 | FILTER_INTRA_RECT_HITS.with(|c| c.get()) |
| 973 | 973 | } |
| 974 | 974 | |
| 975 | +// How many rectangular transform units actually coded coefficients through | |
| 976 | +// [`read_coeffs_rect`] (`all_zero == 0`) -- lane-rect1d's measure that a gate | |
| 977 | +// exercised the rect coefficient reader at all rather than passing on | |
| 978 | +// all-skip blocks. | |
| 979 | +thread_local! { | |
| 980 | + static RECT_COEFF_TU_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; | |
| 981 | + static RECT_CLASS1_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; | |
| 982 | +} | |
| 983 | + | |
| 984 | +/// Current value of [`RECT_COEFF_TU_HITS`]. | |
| 985 | +pub(crate) fn rect_coeff_tu_hits() -> usize { | |
| 986 | + RECT_COEFF_TU_HITS.with(|c| c.get()) | |
| 987 | +} | |
| 988 | + | |
| 989 | +/// Rectangular transform units whose resolved `tx_type` is a 1D class | |
| 990 | +/// (`V_DCT`/`H_DCT`) -- [`TX_CLASS1_HITS`]'s rect-only half, so a gate can | |
| 991 | +/// pin that the 1D-class-on-a-RECT-transform path fired rather than settling | |
| 992 | +/// for the square reader's own 1D types. | |
| 993 | +pub(crate) fn rect_class1_hits() -> usize { | |
| 994 | + RECT_CLASS1_HITS.with(|c| c.get()) | |
| 995 | +} | |
| 996 | + | |
| 975 | 997 | // As [`FILTER_INTRA_RECT_HITS`], counting only the strips BELOW 16x16 |
| 976 | 998 | // (8x16/16x8 leaves of a 16x16 HORZ/VERT partition, lane-fistrip r1) -- the |
| 977 | 999 | // shapes whose `use_filter_intra` symbol had no CDF class before this round. |
| @@ -2777,6 +2799,7 @@ fn read_coeffs( | ||
| 2777 | 2799 | let class = TxClass::of(tx_type); |
| 2778 | 2800 | if class != TxClass::TwoD { |
| 2779 | 2801 | TX_CLASS1_HITS.with(|c| c.set(c.get() + 1)); |
| 2802 | + RECT_CLASS1_HITS.with(|c| c.set(c.get() + 1)); | |
| 2780 | 2803 | } |
| 2781 | 2804 | let eob = read_eob(dec, coding, class); |
| 2782 | 2805 | if trace { |
| @@ -2927,6 +2950,7 @@ fn read_coeffs_rect( | ||
| 2927 | 2950 | if all_zero { |
| 2928 | 2951 | return Ok((grid, TxType::DctDct)); |
| 2929 | 2952 | } |
| 2953 | + RECT_COEFF_TU_HITS.with(|c| c.set(c.get() + 1)); | |
| 2930 | 2954 | // lane-tx4x8: a 4x8/8x4 luma TU DOES carry a `tx_type` symbol (its set is |
| 2931 | 2955 | // `EXT_TX_SET_DTT4_IDTX(_1DDCT)`, `tx_size_sqr_up == TX_8X8`), including |
| 2932 | 2956 | // the `V_DCT`/`H_DCT` members whose 1D tx class needs its own scan and |
| @@ -5757,7 +5781,18 @@ fn decode_leaf_rect( | ||
| 5757 | 5781 | let smooth_neighbor_uv = neighbours.smooth_uv_neighbour(leaf_mi.0, leaf_mi.1, r, c); |
| 5758 | 5782 | let depth = if tx_select { |
| 5759 | 5783 | let ctx = tx_size_context_rect(neighbours, leaf_mi, bw, bh); |
| 5760 | - dec.symbol(&mut cdfs.tx_size_cat2[ctx]) | |
| 5784 | + // lane-rect1d r1: the CATEGORY of this leaf is 1, not 2. libaom's | |
| 5785 | + // `bsize_to_tx_size_cat` reads `bsize_to_tx_size_depth_table` and | |
| 5786 | + // subtracts one: BLOCK_16X8/8X16 (and the 1:4 BLOCK_16X4/4X16 this | |
| 5787 | + // function also decodes) sit at depth 2, so they read | |
| 5788 | + // `tx_size_cdf[1]` -- the same table a 16x16 square block reads -- | |
| 5789 | + // while `tx_size_cat2` belongs to the 32-level shapes | |
| 5790 | + // ([`decode_block_rect`]). Both tables carry three symbols, so the | |
| 5791 | + // wrong one decodes a plausible depth from the wrong probabilities: | |
| 5792 | + // the range diverges silently at the first such leaf and every later | |
| 5793 | + // symbol in the tile is read from the wrong place (class | |
| 5794 | + // `wrong-alphabet-same-value`, here same alphabet / wrong row). | |
| 5795 | + dec.symbol(&mut cdfs.tx_size_cat1[ctx]) | |
| 5761 | 5796 | } else { |
| 5762 | 5797 | 0 |
| 5763 | 5798 | }; |
crates/ec-av1/src/gate_coverage.rsmodified+6 -4
| @@ -226,10 +226,12 @@ const NEVER_EXERCISED_10BIT: &[(&str, &str)] = &[ // lane-cwarp's 10-bit comp | ||
| 226 | 226 | "enable-dual-filter", |
| 227 | 227 | "hole at both depths, see the 8-bit list", |
| 228 | 228 | ), |
| 229 | - ( | |
| 230 | - "enable-flip-idtx", | |
| 231 | - "hole at both depths, see the 8-bit list", | |
| 232 | - ), | |
| 229 | + // `enable-flip-idtx` LEFT this list on 2026-09-02 (lane-rect1d r1): | |
| 230 | + // `a_real_aomenc_stream_with_a_1d_tx_class_on_a_rect_transform_decodes_pixel_exact` | |
| 231 | + // passes `=1` at both depths and pixel-compares six 10-bit decodes, so the | |
| 232 | + // flip/identity/1D transform types are proven to reach a real 10-bit stream | |
| 233 | + // this decoder reconstructs exactly (10 of its rect coefficient TUs carry a | |
| 234 | + // 1D tx class). | |
| 233 | 235 | ("enable-intrabc", "hole at both depths, see the 8-bit list"), |
| 234 | 236 | ("enable-rect-tx", "hole at both depths, see the 8-bit list"), |
| 235 | 237 | ( |
crates/ec-av1/src/stream.rsmodified+263 -0
| @@ -15567,6 +15567,269 @@ mod tests { | ||
| 15567 | 15567 | ); |
| 15568 | 15568 | } |
| 15569 | 15569 | |
| 15570 | + /// lane-rect1d r1 (copied from lane-rectclass r1): the class-correctness measurement for every | |
| 15571 | + /// RECTANGULAR transform unit this decoder reads. [`crate::decode::read_coeffs_rect`] | |
| 15572 | + /// handles `TxClass::TwoD` only -- it refuses by name both a coded | |
| 15573 | + /// `tx_type` symbol and a non-2D default -- so the open question a | |
| 15574 | + /// verifier raised was whether a real encoder ever puts a | |
| 15575 | + /// `V_DCT`/`H_DCT` (`TX_CLASS_HORIZ`/`VERT`) type on a rect TU that | |
| 15576 | + /// reaches this reader. The recipe deliberately maximises the chance: | |
| 15577 | + /// `--enable-flip-idtx=1` (the flip/identity/1D types are exactly what | |
| 15578 | + /// `EXT_TX_SET_DTT4_IDTX_1DDCT` and the wider inter sets add), | |
| 15579 | + /// `--enable-tx-size-search=1`, rect partitions on, small minimum | |
| 15580 | + /// partition size, both bit depths. Every successful decode is | |
| 15581 | + /// pixel-compared; the rect-TU counter is folded in PER ATTEMPT and only | |
| 15582 | + /// after that attempt compared (class `counter-from-refused-stream`), and | |
| 15583 | + /// the class-1 refusal counter is summed over EVERY attempt including the | |
| 15584 | + /// refused ones -- a refused attempt is exactly where a 1D class on a | |
| 15585 | + /// rect TU would show up. | |
| 15586 | + /// | |
| 15587 | + /// lane-rect1d: on THIS tree `read_coeffs_rect` no longer refuses a 1D | |
| 15588 | + /// class -- lane-tx4x8 gave it the mrow/mcol scan and the class-aware | |
| 15589 | + /// base/br contexts -- so the live pins are `compared_class1 > 0` (the | |
| 15590 | + /// flag arrived and 1D types were coded) plus the pixel compare itself. | |
| 15591 | + #[test] | |
| 15592 | + fn a_real_aomenc_stream_with_a_1d_tx_class_on_a_rect_transform_decodes_pixel_exact() { | |
| 15593 | + const NAME: &str = | |
| 15594 | + "a_real_aomenc_stream_with_a_1d_tx_class_on_a_rect_transform_decodes_pixel_exact"; | |
| 15595 | + let _gate_lock = lock_gate_counters(); | |
| 15596 | + if !have_ffmpeg() { | |
| 15597 | + eprintln!("SKIP {NAME}: no ffmpeg"); | |
| 15598 | + return; | |
| 15599 | + } | |
| 15600 | + if !have_aomenc() { | |
| 15601 | + eprintln!("SKIP {NAME}: no aomenc at {}", aomenc_path().display()); | |
| 15602 | + return; | |
| 15603 | + } | |
| 15604 | + let (width, height) = (192usize, 128usize); | |
| 15605 | + let mut named_refusals = 0u32; | |
| 15606 | + let mut matched = 0u32; | |
| 15607 | + let mut matched_10bit = 0u32; | |
| 15608 | + let mut compared_rect_tus = 0usize; | |
| 15609 | + let mut compared_rect_parts = 0usize; | |
| 15610 | + let mut compared_tx_depths = 0usize; | |
| 15611 | + let mut compared_class1 = 0usize; | |
| 15612 | + let mut compared_rect_class1 = 0usize; | |
| 15613 | + let n_attempts: u32 = std::env::var("EC_RECTCLASS_GATE_ATTEMPTS") | |
| 15614 | + .ok() | |
| 15615 | + .and_then(|s| s.parse().ok()) | |
| 15616 | + .unwrap_or(12); | |
| 15617 | + // Both bit depths in one sweep: his two films are yuv420p10le, and a | |
| 15618 | + // class claim that only holds at 8 bits is worth nothing to them. | |
| 15619 | + for attempt in 0..n_attempts { | |
| 15620 | + let seed = 42 + attempt / 2; | |
| 15621 | + let ten_bit = attempt % 2 == 1; | |
| 15622 | + let pix_fmt = if ten_bit { "yuv420p10le" } else { "yuv420p" }; | |
| 15623 | + // Content + quantiser sweep: the 1D (`V_DCT`/`H_DCT`) types RD can | |
| 15624 | + // only pick on strongly one-directional detail, and only when the | |
| 15625 | + // quantiser leaves that detail in the residual -- smooth gradients | |
| 15626 | + // at cq 45 produced exactly zero of them (measured this round), | |
| 15627 | + // which would have made the `--enable-flip-idtx=1` arrival assert | |
| 15628 | + // fail rather than the gate pass vacuously. | |
| 15629 | + let period = [4u32, 6, 8, 12, 16][(attempt as usize / 2) % 5]; | |
| 15630 | + let source = format!("testsrc2=size={width}x{height}:rate=25"); | |
| 15631 | + let filter = format!( | |
| 15632 | + "geq=lum='128+80*sin(2*PI*Y/{period})':cb='128+60*sin(2*PI*X/{period})':cr=128,\ | |
| 15633 | + noise=alls=6:allf=t" | |
| 15634 | + ); | |
| 15635 | + let cq = if attempt % 4 < 2 { "--cq-level=20" } else { "--cq-level=40" }; | |
| 15636 | + let y4m = Command::new("ffmpeg") | |
| 15637 | + .args([ | |
| 15638 | + // `-strict -1`: y4m calls 10-bit an unofficial pixel | |
| 15639 | + // format and refuses to write the header otherwise (no-op | |
| 15640 | + // at 8 bit). | |
| 15641 | + "-v", "error", "-f", "lavfi", "-i", &source, "-vf", &filter, "-t", "0.04", | |
| 15642 | + "-pix_fmt", pix_fmt, "-strict", "-1", "-f", "yuv4mpegpipe", "-", | |
| 15643 | + ]) | |
| 15644 | + .stdin(Stdio::null()) | |
| 15645 | + .stdout(Stdio::piped()) | |
| 15646 | + .stderr(Stdio::piped()) | |
| 15647 | + .output() | |
| 15648 | + .expect("ffmpeg failed to run"); | |
| 15649 | + assert!( | |
| 15650 | + y4m.status.success(), | |
| 15651 | + "ffmpeg fixture: {}", | |
| 15652 | + String::from_utf8_lossy(&y4m.stderr) | |
| 15653 | + ); | |
| 15654 | + // aomenc keeps the LAST occurrence of a repeated `--enable-*` | |
| 15655 | + // flag (measured 2026-09-02 by md5 of four orderings), so this | |
| 15656 | + // lane's overrides come AFTER the base recipe. They are also | |
| 15657 | + // proven to have ARRIVED rather than assumed: the asserts below | |
| 15658 | + // pin a nonzero rect-partition, tx-depth and 1D-tx-class counter | |
| 15659 | + // on pixel-compared attempts, one per override. | |
| 15660 | + let mut args: Vec<&str> = vec![ | |
| 15661 | + "--codec=av1", | |
| 15662 | + "--passes=1", | |
| 15663 | + "--end-usage=q", | |
| 15664 | + cq, | |
| 15665 | + "--cpu-used=0", | |
| 15666 | + "--threads=1", | |
| 15667 | + "--row-mt=0", | |
| 15668 | + "--sb-size=64", | |
| 15669 | + "--enable-ab-partitions=0", | |
| 15670 | + "--enable-1to4-partitions=0", | |
| 15671 | + "--enable-restoration=0", | |
| 15672 | + "--enable-palette=0", | |
| 15673 | + "--deltaq-mode=0", | |
| 15674 | + "--enable-filter-intra=0", | |
| 15675 | + "--enable-cfl-intra=0", | |
| 15676 | + "--enable-intrabc=0", | |
| 15677 | + ]; | |
| 15678 | + if ten_bit { | |
| 15679 | + args.extend_from_slice(&["--input-bit-depth=10", "--bit-depth=10"]); | |
| 15680 | + } | |
| 15681 | + args.extend_from_slice(&[ | |
| 15682 | + "--enable-rect-partitions=1", | |
| 15683 | + "--enable-tx-size-search=1", | |
| 15684 | + "--enable-flip-idtx=1", | |
| 15685 | + // Without this aomenc's reduced tx set narrows every block to | |
| 15686 | + // DCT_DCT/IDTX and no 1D type can be coded at all -- the flag | |
| 15687 | + // that actually gates the class, as the arrival assert below | |
| 15688 | + // proved by staying at 0 without it. | |
| 15689 | + "--reduced-tx-type-set=0", | |
| 15690 | + "--min-partition-size=8", | |
| 15691 | + "--max-partition-size=32", | |
| 15692 | + "--obu", | |
| 15693 | + "-o", | |
| 15694 | + "-", | |
| 15695 | + "-", | |
| 15696 | + ]); | |
| 15697 | + let mut child = Command::new(aomenc_path()) | |
| 15698 | + .args(&args) | |
| 15699 | + .stdin(Stdio::piped()) | |
| 15700 | + .stdout(Stdio::piped()) | |
| 15701 | + .stderr(Stdio::piped()) | |
| 15702 | + .spawn() | |
| 15703 | + .expect("aomenc failed to start"); | |
| 15704 | + child | |
| 15705 | + .stdin | |
| 15706 | + .take() | |
| 15707 | + .expect("aomenc stdin") | |
| 15708 | + .write_all(&y4m.stdout) | |
| 15709 | + .expect("writing y4m to aomenc"); | |
| 15710 | + let out = child.wait_with_output().expect("aomenc failed to run"); | |
| 15711 | + assert!( | |
| 15712 | + out.status.success(), | |
| 15713 | + "aomenc refused the fixture: {}", | |
| 15714 | + String::from_utf8_lossy(&out.stderr) | |
| 15715 | + ); | |
| 15716 | + let stream = out.stdout; | |
| 15717 | + assert!(!stream.is_empty(), "{NAME}: aomenc wrote an empty stream (seed {seed})"); | |
| 15718 | + if ten_bit { | |
| 15719 | + let mut probe = Av1Parser::new(); | |
| 15720 | + let mut pos = 0usize; | |
| 15721 | + while pos < stream.len() && probe.sequence_header().is_none() { | |
| 15722 | + let obu = probe.parse_obu(&stream[pos..]).unwrap(); | |
| 15723 | + pos += obu.total_size; | |
| 15724 | + } | |
| 15725 | + assert_eq!( | |
| 15726 | + probe | |
| 15727 | + .sequence_header() | |
| 15728 | + .expect("stream has a sequence header OBU") | |
| 15729 | + .color_config | |
| 15730 | + .bit_depth, | |
| 15731 | + 10, | |
| 15732 | + "{NAME}: aomenc did not actually write a 10-bit sequence header" | |
| 15733 | + ); | |
| 15734 | + } | |
| 15735 | + let attempt_before = crate::decode::rect_coeff_tu_hits(); | |
| 15736 | + let rect_before = crate::decode::rect_partition_hits(); | |
| 15737 | + let depth_before = crate::decode::tx_depth_hits(); | |
| 15738 | + let class1_before = crate::decode::tx_class1_hits(); | |
| 15739 | + let rect_class1_before = crate::decode::rect_class1_hits(); | |
| 15740 | + let frames = match decode_stream(&stream) { | |
| 15741 | + Err(e) => { | |
| 15742 | + let msg = e.to_string(); | |
| 15743 | + assert!( | |
| 15744 | + msg.contains("unsupported"), | |
| 15745 | + "{NAME} failed outright, not a named refusal (seed {seed}, 10bit \ | |
| 15746 | + {ten_bit}): {msg}" | |
| 15747 | + ); | |
| 15748 | + named_refusals += 1; | |
| 15749 | + continue; | |
| 15750 | + } | |
| 15751 | + Ok(frames) => frames, | |
| 15752 | + }; | |
| 15753 | + let ffmpeg_frames = if ten_bit { | |
| 15754 | + ffmpeg_decode_sequence_10bit(&stream, width, height, 1) | |
| 15755 | + } else { | |
| 15756 | + ffmpeg_decode_sequence(&stream, width, height, 1) | |
| 15757 | + }; | |
| 15758 | + assert_eq!(frames.len(), 1, "{NAME}: expected one frame (seed {seed})"); | |
| 15759 | + assert_eq!( | |
| 15760 | + frames[0].y, ffmpeg_frames[0].y, | |
| 15761 | + "{NAME}: luma vs ffmpeg (seed {seed}, 10bit {ten_bit})" | |
| 15762 | + ); | |
| 15763 | + assert_eq!( | |
| 15764 | + frames[0].u, ffmpeg_frames[0].u, | |
| 15765 | + "{NAME}: U vs ffmpeg (seed {seed}, 10bit {ten_bit})" | |
| 15766 | + ); | |
| 15767 | + assert_eq!( | |
| 15768 | + frames[0].v, ffmpeg_frames[0].v, | |
| 15769 | + "{NAME}: V vs ffmpeg (seed {seed}, 10bit {ten_bit})" | |
| 15770 | + ); | |
| 15771 | + compared_rect_tus += crate::decode::rect_coeff_tu_hits() - attempt_before; | |
| 15772 | + compared_rect_parts += crate::decode::rect_partition_hits() - rect_before; | |
| 15773 | + compared_tx_depths += crate::decode::tx_depth_hits() - depth_before; | |
| 15774 | + compared_class1 += crate::decode::tx_class1_hits() - class1_before; | |
| 15775 | + compared_rect_class1 += crate::decode::rect_class1_hits() - rect_class1_before; | |
| 15776 | + matched += 1; | |
| 15777 | + matched_10bit += u32::from(ten_bit); | |
| 15778 | + } | |
| 15779 | + assert!( | |
| 15780 | + matched > 0, | |
| 15781 | + "{NAME}: every attempt refused ({named_refusals} named refusals) -- gate decoded \ | |
| 15782 | + nothing" | |
| 15783 | + ); | |
| 15784 | + assert!( | |
| 15785 | + matched_10bit > 0, | |
| 15786 | + "{NAME}: every 10-bit attempt refused -- his films are yuv420p10le, so a gate that \ | |
| 15787 | + only compared 8-bit streams proves nothing for them" | |
| 15788 | + ); | |
| 15789 | + assert!( | |
| 15790 | + compared_rect_tus > 0, | |
| 15791 | + "{NAME}: no pixel-exact attempt coded a single rectangular transform unit \ | |
| 15792 | + ({matched} matches, {named_refusals} refusals out of {n_attempts}) -- the gate \ | |
| 15793 | + measured nothing about rect coefficient reading" | |
| 15794 | + ); | |
| 15795 | + // FLAG ARRIVAL, one assert per override (a flag whose counter stays | |
| 15796 | + // at 0 is an inert flag, not a passing gate). | |
| 15797 | + assert!( | |
| 15798 | + compared_rect_parts > 0, | |
| 15799 | + "{NAME}: --enable-rect-partitions=1 never produced a rect partition on a compared \ | |
| 15800 | + attempt ({matched} matches) -- the flag did not arrive" | |
| 15801 | + ); | |
| 15802 | + assert!( | |
| 15803 | + compared_tx_depths > 0, | |
| 15804 | + "{NAME}: --enable-tx-size-search=1 never produced a nonzero tx depth on a compared \ | |
| 15805 | + attempt ({matched} matches) -- the flag did not arrive" | |
| 15806 | + ); | |
| 15807 | + assert!( | |
| 15808 | + compared_class1 > 0, | |
| 15809 | + "{NAME}: --enable-flip-idtx=1 never produced a V_DCT/H_DCT transform on a compared \ | |
| 15810 | + attempt ({matched} matches) -- the 1D types live only in the extended ext-tx sets \ | |
| 15811 | + this flag enables, so the flag did not arrive" | |
| 15812 | + ); | |
| 15813 | + // lane-rect1d r1: the pin of the LANE's own capability -- a V_DCT/H_DCT | |
| 15814 | + // transform on a RECTANGULAR transform unit, read through | |
| 15815 | + // `read_coeffs_rect`'s own 1D scan and contexts. `compared_class1` | |
| 15816 | + // above counts square TUs too, so it can be nonzero while this path | |
| 15817 | + // never fires. | |
| 15818 | + assert!( | |
| 15819 | + compared_rect_class1 > 0, | |
| 15820 | + "{NAME}: no pixel-exact attempt put a 1D tx class on a RECTANGULAR transform \ | |
| 15821 | + ({compared_class1} 1D transforms overall, {compared_rect_tus} rect coefficient \ | |
| 15822 | + TUs) -- the gate proves nothing about the rect 1D path" | |
| 15823 | + ); | |
| 15824 | + eprintln!( | |
| 15825 | + "{NAME}: {matched} pixel-exact decodes ({named_refusals} named refusals out of \ | |
| 15826 | + {n_attempts} attempts, {matched_10bit} of the matches 10-bit), rect coefficient \ | |
| 15827 | + TUs on compared attempts: {compared_rect_tus} ({compared_rect_class1} of them a \ | |
| 15828 | + 1D tx class); flag arrival: rect partitions {compared_rect_parts}, tx \ | |
| 15829 | + depths {compared_tx_depths}, 1D-class (square) transforms {compared_class1}" | |
| 15830 | + ); | |
| 15831 | + } | |
| 15832 | + | |
| 15570 | 15833 | /// lane-rectsplit r1 gate (c): gate (a)'s recipe with |
| 15571 | 15834 | /// `--enable-filter-intra=1` (every sibling gate here pins it to 0), so |
| 15572 | 15835 | /// aomenc's RD is free to pick `use_filter_intra` on a 32x16/16x32 strip |