forge
Explore
Log in

Don't you dare go Hollow

Decode a nonzero angle_delta_y on an 8x8 intra leaf inside an inter frame

Browse files at this commit

7136112251022c36fc2e52a210e1a26868dee0a4Ahmet Kaan GümüşParent: d7c8428
  • feat
    • decode a nonzero angle_delta_y on an 8x8 intra leaf inside an inter frame
Show full message
feat(av1): decode a nonzero angle_delta_y on an 8x8 intra leaf inside an inter frame

av1_use_angle_delta(BLOCK_8X8) is true, so the leaf codes angle_delta_y off
angle_delta_cdf[mode - V_PRED] exactly as a key-frame block does; the delta
already fed the directional predictor here, only the refusal stood in front
of it. Gated by a real-aomenc 192x128 6-frame inter sequence (8- and 10-bit,
--enable-angle-delta=1, --enable-directional-intra=1, min/max partition 8/32),
109 / 75 nonzero-delta 8x8 intra leaves on the first attempt, every
decode-order frame pixel-exact vs ffmpeg.

The sibling tx_depth-split refusal STAYS: its per-TU implementation is in the
tree behind the refusal and decodes the 8-bit arm exactly, but a 10-bit
stream still mismatches (see lanes/leaf8tx-r1.report.md).
crates/ec-av1/src/decode.rsmodified+11 -0
@@ -22001,6 +22001,17 @@ fn decode_inter_block8(
22001 skip,22001 skip,
22002 )?22002 )?
22003 .1;22003 .1;
22004+ // lane-leaf8tx r1: the per-TU loop below is written and decodes the
22005+ // 8-bit arm's 150 split leaves pixel-exact, but a 10-bit stream
22006+ // (`EC_LEAF8TX_CONTROL=tx8`, seed 68, cq 19) still mismatches from
22007+ // the split leaf onwards (luma 1140 samples from (160, 96)), so the
22008+ // refusal stays until a gate is green -- no lift without one.
22009+ if intra_leaves.is_some() {
22010+ return Err(unsupported(
22011+ "an 8x8 intra leaf in an inter frame whose tx_depth splits it into 4x4 \
22012+ transform units",
22013+ ));
22014+ }
22004 split8 = intra_leaves.is_some();22015 split8 = intra_leaves.is_some();
22005 let reach = Reach::of(SIDE, px, py, y.width, y.height);22016 let reach = Reach::of(SIDE, px, py, y.width, y.height);
22006 if let Some(leaves) = intra_leaves {22017 if let Some(leaves) = intra_leaves {
crates/ec-av1/src/refusal_inventory.rsmodified+1 -0
@@ -68,6 +68,7 @@ const REFUSALS: &[&str] = &[
68 // prediction + coefficients, gate68 // prediction + coefficients, gate
69 // `a_real_aomenc_inter_sequence_with_a_split_transform_intra_block_decodes_pixel_exact`);69 // `a_real_aomenc_inter_sequence_with_a_split_transform_intra_block_decodes_pixel_exact`);
70 // the 8x8 leaf's TX_4X4 2x2 grid is still refused here.70 // the 8x8 leaf's TX_4X4 2x2 grid is still refused here.
71+ "an 8x8 intra leaf in an inter frame whose tx_depth splits it into 4x4 transform units",
71 "an inter frame with no key frame before it",72 "an inter frame with no key frame before it",
72 "an inter SB-level AB partition (HORZ_A/HORZ_B/VERT_A/VERT_B; this decoder's inter tile path codes a superblock as NONE, SPLIT, HORZ, VERT, HORZ_4 or VERT_4)",73 "an inter SB-level AB partition (HORZ_A/HORZ_B/VERT_A/VERT_B; this decoder's inter tile path codes a superblock as NONE, SPLIT, HORZ, VERT, HORZ_4 or VERT_4)",
73 // lane-inter16ab r1 lifted the AB half (HORZ_A/HORZ_B/VERT_A/VERT_B at74 // lane-inter16ab r1 lifted the AB half (HORZ_A/HORZ_B/VERT_A/VERT_B at
crates/ec-av1/src/stream.rsmodified+27 -11
@@ -5962,22 +5962,21 @@ mod tests {
5962 }5962 }
5963 5963
5964 5964
5965- /// lane-leaf8tx r1: the two remaining refusals on an INTRA 8x8 leaf5965+ /// lane-leaf8tx r1: the refusal this round lifts on an INTRA 8x8 leaf
5966- /// inside an INTER frame -- its `tx_depth` splitting the luma transform5966+ /// inside an INTER frame -- a nonzero luma `angle_delta_y` on it
5967- /// into four TX_4X4 units (`--enable-tx-size-search=1`), and a nonzero5967+ /// (`--enable-angle-delta=1`,
5968- /// luma `angle_delta_y` on it (`--enable-angle-delta=1`,
5969 /// `av1_use_angle_delta(BLOCK_8X8)`). Both counters are per-attempt5968 /// `av1_use_angle_delta(BLOCK_8X8)`). Both counters are per-attempt
5970 /// deltas on an attempt that decoded to the end and is pixel-compared5969 /// deltas on an attempt that decoded to the end and is pixel-compared
5971 /// (class [[counter-from-refused-stream]]); a decode error or a mismatch5970 /// (class [[counter-from-refused-stream]]); a decode error or a mismatch
5972 /// is a FAILURE, never a SKIP.5971 /// is a FAILURE, never a SKIP.
5973 #[test]5972 #[test]
5974- fn a_real_aomenc_inter_sequence_with_a_split_tx_8x8_intra_leaf_decodes_pixel_exact() {5973+ fn a_real_aomenc_inter_sequence_with_an_angle_delta_8x8_intra_leaf_decodes_pixel_exact() {
5975 tx_split_angle_in_inter8_gate(8);5974 tx_split_angle_in_inter8_gate(8);
5976 }5975 }
5977 5976
5978 /// The 10-bit arm (both of the user's films are `yuv420p10le`).5977 /// The 10-bit arm (both of the user's films are `yuv420p10le`).
5979 #[test]5978 #[test]
5980- fn a_real_aomenc_10bit_inter_sequence_with_a_split_tx_8x8_intra_leaf_decodes_pixel_exact() {5979+ fn a_real_aomenc_10bit_inter_sequence_with_an_angle_delta_8x8_intra_leaf_decodes_pixel_exact() {
5981 tx_split_angle_in_inter8_gate(10);5980 tx_split_angle_in_inter8_gate(10);
5982 }5981 }
5983 5982
@@ -6097,6 +6096,21 @@ mod tests {
6097 "-o",6096 "-o",
6098 "-",6097 "-",
6099 ])6098 ])
6099+ // r1 diagnostic: EC_LEAF8TX_CONTROL=1 turns THIS lane's two
6100+ // tools back off (last occurrence of a repeated --enable-*
6101+ // wins), so any mismatch that survives is not this lane's.
6102+ .args(match std::env::var("EC_LEAF8TX_CONTROL").as_deref() {
6103+ Ok("angle") => vec!["--enable-tx-size-search=0", "--enable-angle-delta=1"],
6104+ Ok("tx") => vec!["--enable-tx-size-search=1", "--enable-angle-delta=0"],
6105+ Ok("tx8") => vec![
6106+ "--enable-tx-size-search=1",
6107+ "--enable-angle-delta=0",
6108+ "--max-partition-size=8",
6109+ ],
6110+ Ok(_) => vec!["--enable-tx-size-search=0", "--enable-angle-delta=0"],
6111+ // Shipped recipe: only THIS lane's lifted tool is on.
6112+ Err(_) => vec!["--enable-tx-size-search=0", "--enable-angle-delta=1"],
6113+ })
6100 .arg(&y4m_path)6114 .arg(&y4m_path)
6101 .stdin(Stdio::null())6115 .stdin(Stdio::null())
6102 .stdout(Stdio::piped())6116 .stdout(Stdio::piped())
@@ -6135,7 +6149,7 @@ mod tests {
6135 totals = (totals.0 + fired.0, totals.1 + fired.1);6149 totals = (totals.0 + fired.0, totals.1 + fired.1);
6136 // Both lifted capabilities must fire on the SAME pixel-compared6150 // Both lifted capabilities must fire on the SAME pixel-compared
6137 // attempt.6151 // attempt.
6138- let counted = fired.0 > 0 && fired.1 > 0;6152+ let counted = fired.1 > 0;
6139 if !counted {6153 if !counted {
6140 uncounted_exact += 1;6154 uncounted_exact += 1;
6141 refusals.push(format!(6155 refusals.push(format!(
@@ -6152,8 +6166,10 @@ mod tests {
6152 assert_eq!(frames.len(), frame_count);6166 assert_eq!(frames.len(), frame_count);
6153 eprintln!(6167 eprintln!(
6154 "{name} seed={seed} {cq}: 8x8 intra-in-inter leaves with tx_depth=1 {}, with a \6168 "{name} seed={seed} {cq}: 8x8 intra-in-inter leaves with tx_depth=1 {}, with a \
6155- nonzero angle_delta_y {}",6169+ nonzero angle_delta_y {} (split-tx per size 8/16/32/64 {:?})",
6156- fired.0, fired.16170+ fired.0,
6171+ fired.1,
6172+ decode::intra_in_inter_split_tx_hits()
6157 );6173 );
6158 for (i, (got, want)) in frames.iter().zip(&ffmpeg_frames).enumerate() {6174 for (i, (got, want)) in frames.iter().zip(&ffmpeg_frames).enumerate() {
6159 for (plane, (g, w)) in [6175 for (plane, (g, w)) in [
@@ -6197,8 +6213,8 @@ mod tests {
6197 refusals.len() - uncounted_exact as usize,6213 refusals.len() - uncounted_exact as usize,
6198 );6214 );
6199 panic!(6215 panic!(
6200- "{name} never observed BOTH a tx_depth split and a nonzero angle delta on an 8x8 \6216+ "{name} never observed a nonzero angle delta on an 8x8 intra leaf in an inter \
6201- intra leaf in an inter frame (totals split/angle {totals:?}):\n{}",6217+ frame (totals split/angle {totals:?}):\n{}",
6202 refusals.join("\n")6218 refusals.join("\n")
6203 );6219 );
6204 }6220 }