Merge branch 'lane-t900' (19f7af9a): sub-8x8 inter chroma inherits the chroma-reference sub-block's tx_type; 128-SB witness extended to 16 decode frames
Browse files at this commit6 changed files +258 -27
- crates/ec-av1/examples/decode_probe.rs +4 -0
- crates/ec-av1/fixtures/reelc_sb128_inter_witness.obu +0 -0
- crates/ec-av1/src/decode.rs +62 -19
- crates/ec-av1/src/stream.rs +25 -8
- lanes/t900-r7.handoff.md +48 -0
- lanes/t900-r7.report.md +119 -0
crates/ec-av1/examples/decode_probe.rsmodified+4 -0
| @@ -118,6 +118,10 @@ fn main() { | |||
| 118 | ); | 118 | ); |
| 119 | // lane-rectres r1: how many of those 32x8/8x32 strips coded a real | 119 | // lane-rectres r1: how many of those 32x8/8x32 strips coded a real |
| 120 | // rectangular residual transform unit (a skipped one codes none). | 120 | // rectangular residual transform unit (a skipped one codes none). |
| 121 | + println!( | ||
| 122 | + "sub8_chroma_tx_from_ref: {}", | ||
| 123 | + ec_av1::stream::sub8_chroma_tx_from_ref_hits() | ||
| 124 | + ); | ||
| 121 | let r328 = ec_av1::stream::rect32x8_inter_tu_hits(); | 125 | let r328 = ec_av1::stream::rect32x8_inter_tu_hits(); |
| 122 | println!("rect32x8_inter_tu: 32x8={} 8x32={}", r328[0], r328[1]); | 126 | println!("rect32x8_inter_tu: 32x8={} 8x32={}", r328[0], r328[1]); |
| 123 | // lane-intra16x4: INTRA strips of an inter 16x16-level 1:4 partition. | 127 | // lane-intra16x4: INTRA strips of an inter 16x16-level 1:4 partition. |
crates/ec-av1/fixtures/reelc_sb128_inter_witness.obumodified+0 -0
Binary file changed
crates/ec-av1/src/decode.rsmodified+62 -19
| @@ -3318,6 +3318,29 @@ pub fn sub8_inter_split_hits() -> usize { | |||
| 3318 | SUB8_INTER_SPLIT_HITS.with(|c| c.get()) | 3318 | SUB8_INTER_SPLIT_HITS.with(|c| c.get()) |
| 3319 | } | 3319 | } |
| 3320 | 3320 | ||
| 3321 | +// lane-t900 r7: sub-8x8 inter groups whose one chroma unit inherits a | ||
| 3322 | +// `tx_type` DIFFERENT from the group's FIRST sub-block -- the only shape that | ||
| 3323 | +// tells the two rules apart (`av1_get_tx_type` indexes `xd->tx_type_map`, | ||
| 3324 | +// which `set_mi_offsets` re-points to the CHROMA-REFERENCE sub-block, so the | ||
| 3325 | +// first sub-block's type is never the one). Reading it off sub-block 0 | ||
| 3326 | +// inverted one 4x4 chroma unit on the wrong basis with the entropy stream | ||
| 3327 | +// perfectly in sync (no chroma `tx_type` symbol is coded), so a gate can only | ||
| 3328 | +// see this rule through this counter. | ||
| 3329 | +thread_local! { | ||
| 3330 | + static SUB8_CHROMA_TX_FROM_REF_HITS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) }; | ||
| 3331 | +} | ||
| 3332 | + | ||
| 3333 | +/// Current value of `SUB8_CHROMA_TX_FROM_REF_HITS`. | ||
| 3334 | +pub fn sub8_chroma_tx_from_ref_hits() -> usize { | ||
| 3335 | + SUB8_CHROMA_TX_FROM_REF_HITS.with(|c| c.get()) | ||
| 3336 | +} | ||
| 3337 | + | ||
| 3338 | +fn note_sub8_chroma_tx(first_sub: TxType, chroma_ref: TxType, coeffs: bool) { | ||
| 3339 | + if coeffs && first_sub != chroma_ref { | ||
| 3340 | + SUB8_CHROMA_TX_FROM_REF_HITS.with(|c| c.set(c.get() + 1)); | ||
| 3341 | + } | ||
| 3342 | +} | ||
| 3343 | + | ||
| 3321 | // How many 4x8 / 8x4 leaves (lane-tx4x8's `PARTITION_VERT`/`PARTITION_HORZ` | 3344 | // How many 4x8 / 8x4 leaves (lane-tx4x8's `PARTITION_VERT`/`PARTITION_HORZ` |
| 3322 | // of an 8x8 block) this thread's decode reconstructed with REAL coefficients | 3345 | // of an 8x8 block) this thread's decode reconstructed with REAL coefficients |
| 3323 | // -- a skipped leaf exercises the prediction and the mi bookkeeping but never | 3346 | // -- a skipped leaf exercises the prediction and the mi bookkeeping but never |
| @@ -14668,6 +14691,9 @@ fn read_inter_plane_rect( | |||
| 14668 | ac_delta, | 14691 | ac_delta, |
| 14669 | tx_type, | 14692 | tx_type, |
| 14670 | ); | 14693 | ); |
| 14694 | + if std::env::var_os("EC_TRACE_TXTYPE").is_some() { | ||
| 14695 | + eprintln!("OUR_TXTYPE plane={plane_idx} x={x} y={y} w={w} h={h} tx_type={tx_type:?} inh={inherited_luma_tx_type:?}"); | ||
| 14696 | + } | ||
| 14671 | // `reconstruct_mc_rect` reads both buffers at the square prediction | 14697 | // `reconstruct_mc_rect` reads both buffers at the square prediction |
| 14672 | // stride, so the dense `w x h` residual is re-laid at that stride first. | 14698 | // stride, so the dense `w x h` residual is re-laid at that stride first. |
| 14673 | let mut strided = vec![0i32; stride * stride]; | 14699 | let mut strided = vec![0i32; stride * stride]; |
| @@ -18449,6 +18475,9 @@ fn read_inter_plane( | |||
| 18449 | None, | 18475 | None, |
| 18450 | )?; | 18476 | )?; |
| 18451 | note_chroma_class1(plane_idx, tx_type); | 18477 | note_chroma_class1(plane_idx, tx_type); |
| 18478 | + if std::env::var_os("EC_TRACE_TXTYPE").is_some() { | ||
| 18479 | + eprintln!("OUR_TXTYPE plane={plane_idx} x={x} y={y} side={side} tx_type={tx_type:?} inh={inherited_luma_tx_type:?}"); | ||
| 18480 | + } | ||
| 18452 | // lane-inter8 r1: a 64-point transform covers the whole 64x64 area but | 18481 | // lane-inter8 r1: a 64-point transform covers the whole 64x64 area but |
| 18453 | // codes only its top-left 32x32 of frequencies (spec 5.11.40) -- the | 18482 | // codes only its top-left 32x32 of frequencies (spec 5.11.40) -- the |
| 18454 | // caller hands the 32-point `scan` there, and the coded corner goes into | 18483 | // caller hands the 32-point `scan` there, and the coded corner goes into |
| @@ -22451,10 +22480,11 @@ fn decode_inter_block( | |||
| 22451 | // lane-t900 r6: THAT WITNESS EXISTS, so `EC_INTRA16X4_DECODE` is gone | 22480 | // lane-t900 r6: THAT WITNESS EXISTS, so `EC_INTRA16X4_DECODE` is gone |
| 22452 | // and the refusal is narrowed back to "no chroma-pair record". The | 22481 | // and the refusal is narrowed back to "no chroma-pair record". The |
| 22453 | // witness is a REAL 10-bit 1920x792 128-superblock film stream, not an | 22482 | // witness is a REAL 10-bit 1920x792 128-superblock film stream, not an |
| 22454 | - // aomenc recipe: `fixtures/reelc_sb128_inter_witness.obu` (166303 bytes, | 22483 | + // aomenc recipe: `fixtures/reelc_sb128_inter_witness.obu` (177773 bytes, |
| 22455 | - // 19 frame-carrying OBUs, 14 decode-order frames) decodes all 14 | 22484 | + // 23 frame-carrying OBUs, 16 decode-order frames, extended from 14 in |
| 22456 | - // decode-order frames byte-exact against instrumented aomdec | 22485 | + // lane-t900 r7) decodes all 16 decode-order frames byte-exact against |
| 22457 | - // (`EC_AV1_FINAL_DUMP`) and all 12 shown frames pixel-exact against | 22486 | + // instrumented aomdec |
| 22487 | + // (`EC_AV1_FINAL_DUMP`) and all 15 shown frames pixel-exact against | ||
| 22458 | // ffmpeg, while this arm fires 78x 16x4 + 149x 4x16 (108 of them | 22488 | // ffmpeg, while this arm fires 78x 16x4 + 149x 4x16 (108 of them |
| 22459 | // chroma-paired). Unlike lane-sub8x4 r3's phantom (class | 22489 | // chroma-paired). Unlike lane-sub8x4 r3's phantom (class |
| 22460 | // `counter-from-refused-stream`) every one of those hits lies inside a | 22490 | // `counter-from-refused-stream`) every one of those hits lies inside a |
| @@ -23282,6 +23312,7 @@ fn decode_inter_sub8_split4( | |||
| 23282 | let mut piece: [Option<(i8, (i32, i32), mc::InterpFilterKind, mc::InterpFilterKind)>; 4] = | 23312 | let mut piece: [Option<(i8, (i32, i32), mc::InterpFilterKind, mc::InterpFilterKind)>; 4] = |
| 23283 | [None; 4]; | 23313 | [None; 4]; |
| 23284 | let mut first_tx_type = TxType::DctDct; | 23314 | let mut first_tx_type = TxType::DctDct; |
| 23315 | + let mut sub0_tx_type = TxType::DctDct; | ||
| 23285 | let mut last_skip = true; | 23316 | let mut last_skip = true; |
| 23286 | // Set when the chroma-reference (last) sub-block is INTRA: it coded the | 23317 | // Set when the chroma-reference (last) sub-block is INTRA: it coded the |
| 23287 | // group's one chroma unit itself. | 23318 | // group's one chroma unit itself. |
| @@ -23576,14 +23607,19 @@ fn decode_inter_sub8_split4( | |||
| 23576 | None, | 23607 | None, |
| 23577 | None, | 23608 | None, |
| 23578 | )?; | 23609 | )?; |
| 23579 | - if i == 0 || piece[0].is_none() { | 23610 | + if i == 0 { |
| 23580 | - // `av1_get_tx_type`: an inter block's chroma inherits the | 23611 | + sub0_tx_type = tx_type; |
| 23581 | - // tx_type of the CO-LOCATED luma position, which for the | 23612 | + } |
| 23582 | - // group's one chroma unit is luma (0, 0) -- the FIRST | 23613 | + if i == 3 { |
| 23583 | - // sub-block, not the last. lane-sub8intra: an INTRA first | 23614 | + // `av1_get_tx_type`'s chroma tail scales `blk_row`/`blk_col` |
| 23584 | - // sub-block writes no inter tx_type there at all, so the | 23615 | + // back by the subsampling, but it indexes `xd->tx_type_map`, |
| 23585 | - // later inter sub-blocks' own is what `xd->tx_type_map` | 23616 | + // which `set_mi_offsets` (av1_common_int.h:1679) re-points to |
| 23586 | - // holds. | 23617 | + // the CURRENT sub-block's own mi -- so the group's one chroma |
| 23618 | + // unit inherits the CHROMA-REFERENCE (last) sub-block's | ||
| 23619 | + // tx_type, never the group's first. lane-t900 r7: reading it | ||
| 23620 | + // off sub-block 0 left the entropy stream in sync (no symbol | ||
| 23621 | + // is coded for chroma) and inverted one 4x4 chroma unit on the | ||
| 23622 | + // wrong basis. | ||
| 23587 | first_tx_type = tx_type; | 23623 | first_tx_type = tx_type; |
| 23588 | } | 23624 | } |
| 23589 | neighbours.record_mi_luma_rect(lmi, B4, B4, &luma_grid); | 23625 | neighbours.record_mi_luma_rect(lmi, B4, B4, &luma_grid); |
| @@ -23673,6 +23709,8 @@ fn decode_inter_sub8_split4( | |||
| 23673 | &pred_v, Some(first_tx_type), None, | 23709 | &pred_v, Some(first_tx_type), None, |
| 23674 | )? | 23710 | )? |
| 23675 | .0; | 23711 | .0; |
| 23712 | + let coded = ug.iter().chain(vg.iter()).any(|&c| c != 0); | ||
| 23713 | + note_sub8_chroma_tx(sub0_tx_type, first_tx_type, coded); | ||
| 23676 | (ug, vg) | 23714 | (ug, vg) |
| 23677 | }; | 23715 | }; |
| 23678 | neighbours.record_uv_mode_mi(gr, gc, 2, 2, DC_PRED); | 23716 | neighbours.record_uv_mode_mi(gr, gc, 2, 2, DC_PRED); |
| @@ -24204,6 +24242,7 @@ fn decode_inter_sub8_rect2( | |||
| 24204 | let mut piece: [Option<(i8, (i32, i32), mc::InterpFilterKind, mc::InterpFilterKind)>; 2] = | 24242 | let mut piece: [Option<(i8, (i32, i32), mc::InterpFilterKind, mc::InterpFilterKind)>; 2] = |
| 24205 | [None; 2]; | 24243 | [None; 2]; |
| 24206 | let mut first_tx_type = TxType::DctDct; | 24244 | let mut first_tx_type = TxType::DctDct; |
| 24245 | + let mut sub0_tx_type = TxType::DctDct; | ||
| 24207 | let mut last_skip = true; | 24246 | let mut last_skip = true; |
| 24208 | // Set when the chroma-reference sub-block is INTRA: it coded the group's | 24247 | // Set when the chroma-reference sub-block is INTRA: it coded the group's |
| 24209 | // one chroma unit itself. | 24248 | // one chroma unit itself. |
| @@ -24552,13 +24591,15 @@ fn decode_inter_sub8_rect2( | |||
| 24552 | None, | 24591 | None, |
| 24553 | )? | 24592 | )? |
| 24554 | }; | 24593 | }; |
| 24555 | - if idx == 0 && (i == 0 || piece[0].is_none()) { | 24594 | + if idx == 0 && i == 0 { |
| 24556 | - // `av1_get_tx_type`: the group's one chroma unit scales | 24595 | + sub0_tx_type = tu_tx_type; |
| 24557 | - // back to luma (0, 0), i.e. the FIRST sub-block's first | 24596 | + } |
| 24558 | - // transform unit -- unless that sub-block is INTRA | 24597 | + if idx == 0 && i == 1 { |
| 24559 | - // (lane-sub8intra), in which case it wrote no inter | 24598 | + // `av1_get_tx_type` indexes `xd->tx_type_map`, which |
| 24560 | - // tx_type at all and `xd->tx_type_map[0]` of the | 24599 | + // `set_mi_offsets` (av1_common_int.h:1679) re-points to the |
| 24561 | - // chroma-reference block is this one's. | 24600 | + // CURRENT sub-block: the group's one chroma unit inherits |
| 24601 | + // the CHROMA-REFERENCE (second) sub-block's first transform | ||
| 24602 | + // unit, never the first sub-block's (lane-t900 r7). | ||
| 24562 | first_tx_type = tu_tx_type; | 24603 | first_tx_type = tu_tx_type; |
| 24563 | } | 24604 | } |
| 24564 | neighbours.record_mi_luma_rect(tu_mi, tw, th, &tu_grid); | 24605 | neighbours.record_mi_luma_rect(tu_mi, tw, th, &tu_grid); |
| @@ -24662,6 +24703,8 @@ fn decode_inter_sub8_rect2( | |||
| 24662 | &pred_v, Some(first_tx_type), None, | 24703 | &pred_v, Some(first_tx_type), None, |
| 24663 | )? | 24704 | )? |
| 24664 | .0; | 24705 | .0; |
| 24706 | + let coded = ug.iter().chain(vg.iter()).any(|&c| c != 0); | ||
| 24707 | + note_sub8_chroma_tx(sub0_tx_type, first_tx_type, coded); | ||
| 24665 | (ug, vg) | 24708 | (ug, vg) |
| 24666 | }; | 24709 | }; |
| 24667 | neighbours.record_uv_mode_mi(gr, gc, 2, 2, DC_PRED); | 24710 | neighbours.record_uv_mode_mi(gr, gc, 2, 2, DC_PRED); |
crates/ec-av1/src/stream.rsmodified+25 -8
| @@ -87,6 +87,13 @@ pub fn rect32x8_inter_tu_hits() -> [usize; 2] { | |||
| 87 | crate::decode::rect32x8_inter_tu_hits() | 87 | crate::decode::rect32x8_inter_tu_hits() |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | +/// lane-t900 r7: sub-8x8 inter groups whose one chroma unit inherited a | ||
| 91 | +/// `tx_type` different from the group's FIRST sub-block, i.e. groups that can | ||
| 92 | +/// only decode right under `av1_get_tx_type`'s chroma-reference rule. | ||
| 93 | +pub fn sub8_chroma_tx_from_ref_hits() -> usize { | ||
| 94 | + crate::decode::sub8_chroma_tx_from_ref_hits() | ||
| 95 | +} | ||
| 96 | + | ||
| 90 | /// lane-intra16x4: `(16x4, 4x16, chroma-reference)` INTRA strips decoded inside | 97 | /// lane-intra16x4: `(16x4, 4x16, chroma-reference)` INTRA strips decoded inside |
| 91 | /// an inter 16x16-level 1:4 partition. | 98 | /// an inter 16x16-level 1:4 partition. |
| 92 | pub fn intra16x4_in_inter_hits() -> (usize, usize, usize) { | 99 | pub fn intra16x4_in_inter_hits() -> (usize, usize, usize) { |
| @@ -30282,12 +30289,18 @@ mod tests { | |||
| 30282 | } | 30289 | } |
| 30283 | 30290 | ||
| 30284 | /// lane-t900 r6: the 128-superblock INTER witness. | 30291 | /// lane-t900 r6: the 128-superblock INTER witness. |
| 30285 | - /// `crates/ec-av1/fixtures/reelc_sb128_inter_witness.obu`, 166303 bytes, | 30292 | + /// `crates/ec-av1/fixtures/reelc_sb128_inter_witness.obu`, 177773 bytes, |
| 30286 | - /// sha256 `1191ce80e2c6c5855eaf7a8f5e8cda2cdf809f467b0dbc5e26df96dfa6b2c8bd`: | 30293 | + /// sha256 `09d995946d27695ef4b7b1a24a4d7ad85f8e2c8176d58ee54e825efc061f9cbc`: |
| 30287 | - /// the first 19 frame-carrying OBUs of a 2 s cut taken 900 s into a 10-bit | 30294 | + /// the first 23 frame-carrying OBUs of a 2 s cut taken 900 s into a 10-bit |
| 30288 | - /// 1920x792 AV1 stream with `use_128x128_superblock=1`, 14 decode-order | 30295 | + /// 1920x792 AV1 stream with `use_128x128_superblock=1`, 16 decode-order |
| 30289 | - /// frames, 12 shown. Cut twice independently from the source (`-ss 900 -t 2 | 30296 | + /// frames, 15 shown. Cut twice independently from the source (`-ss 900 -t 2 |
| 30290 | /// -c:v copy` then the OBU truncation) -- both cuts hash identically. | 30297 | /// -c:v copy` then the OBU truncation) -- both cuts hash identically. |
| 30298 | + /// lane-t900 r7 extended it from 19 OBUs / 14 frames: decode-order frame 14 | ||
| 30299 | + /// is the ONLY frame in this repository's fixtures whose sub-8x8 inter | ||
| 30300 | + /// chroma inherits a `tx_type` from a chroma-reference sub-block that | ||
| 30301 | + /// differs from its group's first sub-block AND codes coefficients | ||
| 30302 | + /// (`sub8_chroma_tx_from_ref_hits`), i.e. the only frame that can tell | ||
| 30303 | + /// `av1_get_tx_type`'s two candidate rules apart. | ||
| 30291 | /// | 30304 | /// |
| 30292 | /// It is the first stream in this repository that decodes exactly while | 30305 | /// It is the first stream in this repository that decodes exactly while |
| 30293 | /// five separately-found defects' paths all fire, which is why the asserts | 30306 | /// five separately-found defects' paths all fire, which is why the asserts |
| @@ -30344,6 +30357,7 @@ mod tests { | |||
| 30344 | crate::decode::intra_in_inter_txctx_hits(), | 30357 | crate::decode::intra_in_inter_txctx_hits(), |
| 30345 | crate::decode::edge_filter_mi_fix_hits(), | 30358 | crate::decode::edge_filter_mi_fix_hits(), |
| 30346 | ); | 30359 | ); |
| 30360 | + let sub8tx_before = crate::decode::sub8_chroma_tx_from_ref_hits(); | ||
| 30347 | let i16_before = crate::decode::intra16x4_in_inter_hits(); | 30361 | let i16_before = crate::decode::intra16x4_in_inter_hits(); |
| 30348 | let frames = match decode_stream(&stream) { | 30362 | let frames = match decode_stream(&stream) { |
| 30349 | Ok(frames) => frames, | 30363 | Ok(frames) => frames, |
| @@ -30358,6 +30372,7 @@ mod tests { | |||
| 30358 | crate::decode::intra_in_inter_txctx_hits() - before.5, | 30372 | crate::decode::intra_in_inter_txctx_hits() - before.5, |
| 30359 | crate::decode::edge_filter_mi_fix_hits() - before.6, | 30373 | crate::decode::edge_filter_mi_fix_hits() - before.6, |
| 30360 | ); | 30374 | ); |
| 30375 | + let sub8tx = crate::decode::sub8_chroma_tx_from_ref_hits() - sub8tx_before; | ||
| 30361 | let i16_now = crate::decode::intra16x4_in_inter_hits(); | 30376 | let i16_now = crate::decode::intra16x4_in_inter_hits(); |
| 30362 | let i16 = ( | 30377 | let i16 = ( |
| 30363 | i16_now.0 - i16_before.0, | 30378 | i16_now.0 - i16_before.0, |
| @@ -30375,13 +30390,14 @@ mod tests { | |||
| 30375 | ("intra16x4_in_inter 16x4", i16.0), | 30390 | ("intra16x4_in_inter 16x4", i16.0), |
| 30376 | ("intra16x4_in_inter 4x16", i16.1), | 30391 | ("intra16x4_in_inter 4x16", i16.1), |
| 30377 | ("intra16x4_in_inter chroma_ref", i16.2), | 30392 | ("intra16x4_in_inter chroma_ref", i16.2), |
| 30393 | + ("sub8_chroma_tx_from_ref", sub8tx), | ||
| 30378 | ] { | 30394 | ] { |
| 30379 | assert!( | 30395 | assert!( |
| 30380 | n > 0, | 30396 | n > 0, |
| 30381 | "{NAME}: {what} never fired on this stream -- the gate would be vacuous for it" | 30397 | "{NAME}: {what} never fired on this stream -- the gate would be vacuous for it" |
| 30382 | ); | 30398 | ); |
| 30383 | } | 30399 | } |
| 30384 | - assert_eq!(frames.len(), 12, "{NAME}: 12 shown frames"); | 30400 | + assert_eq!(frames.len(), 15, "{NAME}: 15 shown frames"); |
| 30385 | assert_eq!((frames[0].width, frames[0].height), (width, height)); | 30401 | assert_eq!((frames[0].width, frames[0].height), (width, height)); |
| 30386 | let ffmpeg_frames = ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()); | 30402 | let ffmpeg_frames = ffmpeg_decode_sequence_10bit(&stream, width, height, frames.len()); |
| 30387 | assert_eq!( | 30403 | assert_eq!( |
| @@ -30397,9 +30413,10 @@ mod tests { | |||
| 30397 | assert_eq!(ours.v, theirs.v, "{NAME}: frame {i} V vs ffmpeg"); | 30413 | assert_eq!(ours.v, theirs.v, "{NAME}: frame {i} V vs ffmpeg"); |
| 30398 | } | 30414 | } |
| 30399 | eprintln!( | 30415 | eprintln!( |
| 30400 | - "{NAME}: 12 shown frames pixel-exact on every plane; warp_plane_suppress={} \ | 30416 | + "{NAME}: 15 shown frames pixel-exact on every plane; warp_plane_suppress={} \ |
| 30401 | cdef_idx={} inter_sb128_vert={} interintra_rect={} non_chroma_ref_ctx_skip={} \ | 30417 | cdef_idx={} inter_sb128_vert={} interintra_rect={} non_chroma_ref_ctx_skip={} \ |
| 30402 | - intra_in_inter_txctx={} edge_filter_mi_fix={} intra16x4_in_inter={:?}", | 30418 | + intra_in_inter_txctx={} edge_filter_mi_fix={} intra16x4_in_inter={:?} \ |
| 30419 | + sub8_chroma_tx_from_ref={sub8tx}", | ||
| 30403 | fired.0, fired.1, fired.2, fired.3, fired.4, fired.5, fired.6, i16 | 30420 | fired.0, fired.1, fired.2, fired.3, fired.4, fired.5, fired.6, i16 |
| 30404 | ); | 30421 | ); |
| 30405 | } | 30422 | } |
lanes/t900-r7.handoff.mdadded+48 -0
| @@ -0,0 +1,48 @@ | |||
| 1 | +# lane-t900 r7 handoff -- frame-14 chroma basis CLOSED; next stop is t900 frame 41 (ONE U sample) | ||
| 2 | + | ||
| 3 | +Branch `lane-t900`, tip `5c2ab6a5` (fix+gate `04154beb`, report `5c2ab6a5`), | ||
| 4 | +main `3b529205` merged (fast-forward). Suite on this tip: **426 passed, 0 | ||
| 5 | +failed, 38 ignored** (`$HOME/.cache/t900-suite-r7.log`). | ||
| 6 | + | ||
| 7 | +## Closed this round | ||
| 8 | + | ||
| 9 | +Sub-8x8 inter groups: the one chroma unit inherits the CHROMA-REFERENCE (last) | ||
| 10 | +sub-block's first transform unit's `tx_type`, because `av1_get_tx_type` indexes | ||
| 11 | +`xd->tx_type_map`, which `set_mi_offsets` (av1_common_int.h:1679) re-points to | ||
| 12 | +the CURRENT sub-block. `decode.rs:23614` (`i == 3`) and `decode.rs:24598` | ||
| 13 | +(`idx == 0 && i == 1`). Counter `sub8_chroma_tx_from_ref_hits`. | ||
| 14 | + | ||
| 15 | +Witness fixture EXTENDED (same path): 23 frame-carrying OBUs, 177773 bytes, | ||
| 16 | +sha256 `09d995946d27695ef4b7b1a24a4d7ad85f8e2c8176d58ee54e825efc061f9cbc`, | ||
| 17 | +16 decode-order frames, 15 shown. `trunc.py <2s cut> 23`. | ||
| 18 | + | ||
| 19 | +## Instruments (reuse, do not rebuild) | ||
| 20 | + | ||
| 21 | +* Oracle `~/.cache/t900-tmp/aom-build/aomdec` -- private build of the SHARED | ||
| 22 | + source with the additive `EC_TRACE_TXTYPE` rung | ||
| 23 | + (`decodetxb.c:187`: `EC_TXTYPE mi=<row>,<col> plane= br= bc= txs= tx_type=`). | ||
| 24 | + Only prints for units that are not `all_zero` (libaom returns at | ||
| 25 | + `decodetxb.c:172` before it). | ||
| 26 | +* Ours: `EC_TRACE_TXTYPE=1` -> `OUR_TXTYPE plane= x= y= (side=|w= h=) tx_type= | ||
| 27 | + inh=` (`decode.rs:14695` rect, `decode.rs:18480` square). `x`/`y` are that | ||
| 28 | + plane's own pixel coords. | ||
| 29 | +* `~/.cache/t900-tmp/`: `pf.sh` (prefilter compare), `px.py` (per-plane diff; | ||
| 30 | + RUN IT FROM `~/.cache/t900-tmp`, its paths are relative), `cmp.sh` | ||
| 31 | + (decode-order final compare), `sb.py`, `lad.py`, `reg.py`, cuts | ||
| 32 | + `cut_{900,5400,6300,8100}.obu` (2 s each) and dumps `d_r7_*`. | ||
| 33 | + | ||
| 34 | +## Next defect, already localised to one sample | ||
| 35 | + | ||
| 36 | +t900 cut, decode-order frame 41: ONE U sample differs, chroma (354,395), | ||
| 37 | +aomdec 490 vs ours 491. y=395 is the LAST chroma row (792/2 = 396). No cascade | ||
| 38 | +-- frame 42 is exact. Start with `pf.sh` on that cut: if the PREFILTER frame 41 | ||
| 39 | +is exact, it is a post-filter (deblock/CDEF/LR) bottom-edge rounding, which is | ||
| 40 | +a different class from every r2-r7 fix. | ||
| 41 | + | ||
| 42 | +Then, each its own round: t5400 frame 33 (1642397 bytes), t6300 frame 11 (35 | ||
| 43 | +bytes -- small, likely another basis/rounding defect), t8100 frame 1 (1313 | ||
| 44 | +bytes). All four cuts now decode ALL frames; no refusal stops any of them, and | ||
| 45 | +`~/.cache/reelc-0-10s.obu` decodes 240 frames with no env switches. | ||
| 46 | + | ||
| 47 | +`intra128_in_inter` fires 0 times on every stream tried, so its refusal stays | ||
| 48 | +un-lifted for want of a witness (do not lift it without one). | ||
lanes/t900-r7.report.mdadded+119 -0
| @@ -0,0 +1,119 @@ | |||
| 1 | +# lane-t900 r7 -- sub-8x8 inter chroma inherits the CHROMA-REFERENCE sub-block's tx_type | ||
| 2 | + | ||
| 3 | +Branch `lane-t900`, code+fixture commit `04154beb` on top of main `3b529205` | ||
| 4 | +(merged first, fast-forward). `CARGO_TARGET_DIR=$HOME/.cache/cargo-target-t900` | ||
| 5 | +(suite/gates) and `-t900-b` (release `decode_probe`). | ||
| 6 | + | ||
| 7 | +## Root cause (r6's open defect, closed) | ||
| 8 | + | ||
| 9 | +`av1_get_tx_type` (`av1/common/blockd.h:1291-1305`) scales a chroma transform's | ||
| 10 | +`blk_row`/`blk_col` back by the subsampling and indexes `xd->tx_type_map`. | ||
| 11 | +`set_mi_offsets` (`av1/common/av1_common_int.h:1679`) re-points that pointer to | ||
| 12 | +the CURRENT sub-block's mi, so for a sub-8x8 group the block current at the | ||
| 13 | +chroma read is the CHROMA-REFERENCE (last) sub-block -- its first transform | ||
| 14 | +unit's `tx_type` is what chroma inherits. Both sub-8x8 inter paths took the | ||
| 15 | +group's FIRST sub-block: | ||
| 16 | + | ||
| 17 | +* `crates/ec-av1/src/decode.rs:23614` (`decode_inter_sub8_split4`): `i == 0` -> `i == 3`; | ||
| 18 | +* `crates/ec-av1/src/decode.rs:24598` (`decode_inter_sub8_rect2`): `idx == 0 && (i == 0 || piece[0].is_none())` -> `idx == 0 && i == 1`. | ||
| 19 | + | ||
| 20 | +The `piece[0].is_none()` (INTRA first sub-block) special case disappears: under | ||
| 21 | +the correct rule the chroma-reference block's own type is always the answer. | ||
| 22 | + | ||
| 23 | +No chroma `tx_type` symbol is coded, so the msac stream stayed in sync and only | ||
| 24 | +the inverse transform's BASIS was wrong (class `tx-type-set-membership`). | ||
| 25 | + | ||
| 26 | +tx_type VALUES, both sides, at the defect (`~/.cache/t900-tmp/t900_h.obu`, | ||
| 27 | +decode-order frame 14, luma 8x8 at (944,568) = mi(142,236) split HORZ into two | ||
| 28 | +8x4 sub-blocks; the top one is skip, the bottom one codes `ADST_FLIPADST`): | ||
| 29 | + | ||
| 30 | +| side | rung | value | | ||
| 31 | +|---|---|---| | ||
| 32 | +| aomdec | `EC_TXTYPE mi=143,236 plane=0 br=0 bc=0 txs=6 tx_type=7` | luma 8x4 = ADST_FLIPADST | | ||
| 33 | +| aomdec | `EC_TXTYPE mi=143,236 plane=1 br=0 bc=0 txs=0 tx_type=7` | chroma 4x4 = ADST_FLIPADST | | ||
| 34 | +| ours (pre-fix) | `OUR_TXTYPE plane=1 x=472 y=284 side=4 tx_type=DctDct inh=Some(DctDct)` | chroma 4x4 = DCT_DCT | | ||
| 35 | + | ||
| 36 | +(V is absent from the oracle's list because its unit was `all_zero` -- which is | ||
| 37 | +exactly why the residue was U-only.) | ||
| 38 | + | ||
| 39 | +Instrumentation added this round: additive, env-gated `EC_TRACE_TXTYPE` rungs -- | ||
| 40 | +oracle `av1/decoder/decodetxb.c:187` (`EC_TXTYPE mi= plane= br= bc= txs= | ||
| 41 | +tx_type=`, built into the PRIVATE `~/.cache/t900-tmp/aom-build`, never | ||
| 42 | +`~/.cache/aom-oracle/build`) and ours `decode.rs:14695/18480` (`OUR_TXTYPE | ||
| 43 | +plane= x= y= (side|w,h)= tx_type= inh=`). | ||
| 44 | + | ||
| 45 | +EVIDENCE: ~/.cache/t900-tmp/pf_h3/, aom_tt.log:25618-25619, our_tt.log:29969-29971 | pf.sh h3 (aomdec vs ours, EC_AV1_PREFILT_DUMP16) then px.py per frame | frame 14 U diff 14 px -> 0; all 16 decode-order frames Y/U/V 0 px | ||
| 46 | + | ||
| 47 | +## Same-shape sweep | ||
| 48 | + | ||
| 49 | +Every site that hands an inherited chroma `tx_type` to | ||
| 50 | +`read_inter_plane`/`read_inter_plane_rect` was checked (`grep -n | ||
| 51 | +"Some(first_tx_type)\|Some(luma_tx_type)"`, 18 hits): 14 are WITHIN one block | ||
| 52 | +(the block's own top-left var-tx unit, where the current-block rule and the | ||
| 53 | +first-unit rule coincide -- correct), the 4 sub-8x8 group ones are the two | ||
| 54 | +fixed paths' U and V reads. No other cross-sub-block inheritance exists. | ||
| 55 | + | ||
| 56 | +## Gate | ||
| 57 | + | ||
| 58 | +`a_10bit_128sb_film_frames_with_warp_cdef_and_interintra_decode_pixel_exact` | ||
| 59 | +(`crates/ec-av1/src/stream.rs:30334`), the r6 witness, EXTENDED from 19 to 23 | ||
| 60 | +frame-carrying OBUs so it covers decode-order frame 14: | ||
| 61 | +`crates/ec-av1/fixtures/reelc_sb128_inter_witness.obu`, 177773 bytes, sha256 | ||
| 62 | +`09d995946d27695ef4b7b1a24a4d7ad85f8e2c8176d58ee54e825efc061f9cbc`, 16 | ||
| 63 | +decode-order frames, 15 shown. Two independent `-ss 900 -t 2 -c:v copy` cuts + | ||
| 64 | +`trunc.py <obu> 23` hash identically. | ||
| 65 | + | ||
| 66 | +New counter `sub8_chroma_tx_from_ref_hits` (`decode.rs:3323`, re-exported | ||
| 67 | +`stream.rs:90`, printed by `decode_probe`) counts ONLY the groups that tell the | ||
| 68 | +two rules apart: chroma-reference `tx_type` != first sub-block's AND the chroma | ||
| 69 | +unit codes coefficients. The gate hard-asserts it > 0 (fires 2) next to its | ||
| 70 | +eight existing counters. | ||
| 71 | + | ||
| 72 | + a_10bit_128sb_film_frames_with_warp_cdef_and_interintra_decode_pixel_exact: | ||
| 73 | + 15 shown frames pixel-exact on every plane; warp_plane_suppress=15 | ||
| 74 | + cdef_idx=852 inter_sb128_vert=76 interintra_rect=118 | ||
| 75 | + non_chroma_ref_ctx_skip=194 intra_in_inter_txctx=2069 | ||
| 76 | + edge_filter_mi_fix=206 intra16x4_in_inter=(80, 163, 113) | ||
| 77 | + sub8_chroma_tx_from_ref=2 | ||
| 78 | + | ||
| 79 | +Refusals: none lifted, none added (`refusal_inventory` + `gate_coverage` green). | ||
| 80 | + | ||
| 81 | +## Suite | ||
| 82 | + | ||
| 83 | +`cargo test -p ec-av1 --lib` (systemd unit `t900-suite-r7-1788376817`, log | ||
| 84 | +`$HOME/.cache/t900-suite-r7.log`): **426 passed, 0 failed, 38 ignored** -- | ||
| 85 | +identical to the r6 tip. Sibling gates named in the charter all green in that | ||
| 86 | +run: the witness gate, `a_real_aomenc_10bit_stream_with_interintra_wedge_...`, | ||
| 87 | +`a_real_aomenc_inter_sequence_with_intra_sub8x8_leaves_...`, | ||
| 88 | +`a_real_aomenc_inter_sequence_with_a_sub8x8_inter_split_...`, | ||
| 89 | +`a_real_aomenc_stream_with_a_sub8_rect_leaf_...`, | ||
| 90 | +`a_real_aomenc_stream_with_a_sub8_split_...`, | ||
| 91 | +`a_real_aomenc_stream_with_a_coded_strip_whose_chroma_is_a_4to1_or_sub8_rect_...`, | ||
| 92 | +`refusal_inventory` (3), `gate_coverage` (9). | ||
| 93 | + | ||
| 94 | +## Film frontier, this tip (2 s cuts, decode-order vs aomdec `EC_AV1_FINAL_DUMP`) | ||
| 95 | + | ||
| 96 | +| cut | aom frames | ours | first differing | size of that diff | stop | | ||
| 97 | +|---|---|---|---|---|---| | ||
| 98 | +| t900 | 267 | 267 | **41** (was 14) | 1 sample: U(354,395) 490 vs 491 | -- | | ||
| 99 | +| t5400 | 275 | 275 | **33** (was 1) | 1642397 bytes | -- | | ||
| 100 | +| t6300 | 125 | 125 | **11** (was 1) | 35 bytes | -- | | ||
| 101 | +| t8100 | 96 | 96 | 1 | 1313 bytes | none (r6's Golomb stop is GONE) | | ||
| 102 | + | ||
| 103 | +EVIDENCE: ~/.cache/t900-tmp/d_r7_{900,5400,6300,8100}/ | cmp.sh per cut, aomdec vs decode_probe, byte compare per decode-order frame | first differing frame 14->41, 1->33, 1->11, 1 (t8100 now decodes all 96 frames instead of stopping at 32) | ||
| 104 | + | ||
| 105 | +`~/.cache/reelc-0-10s.obu`: 240 frames decoded, NO env switches (r6's | ||
| 106 | +"an intra-coded 128x64 block on the inter block path" stop is gone -- other | ||
| 107 | +lanes' merges). With `EC_INTRA128_IN_INTER=1` the arm fires **0 times** | ||
| 108 | +(`intra128_in_inter: 128x64=0 64x128=0`), so that refusal is NOT lifted: there | ||
| 109 | +is still no witness for it. | ||
| 110 | + | ||
| 111 | +## Residue | ||
| 112 | + | ||
| 113 | +* fix-now(next round): t900 decode-order frame 41 -- ONE U sample at chroma | ||
| 114 | + (354,395), 490 vs 491, on the LAST chroma row, no cascade (frame 42 exact). | ||
| 115 | + Smells like a post-filter bottom-edge rounding, not an entropy defect. | ||
| 116 | +* deferred(a round of its own): t5400 frame 33, t6300 frame 11 (35 bytes), | ||
| 117 | + t8100 frame 1 -- three independent untouched defects, each needs its own | ||
| 118 | + pf.sh -> sb.py -> EC_MODE ladder. | ||
| 119 | +* accepted: the intra-128-in-inter refusal stays; 0 hits on every stream tried. | ||