wip(av1): pre-filter dump pinned frame-1 desync to Luma32Inter's tx_type
Browse files at this commita3dcb121bddb208d8198e40b93f4172ec587d00bParent: 8d878fe2 changed files +49 -0
crates/ec-av1/src/cdf_state.rsmodified+12 -0
| @@ -1038,6 +1038,18 @@ impl Cdfs { | ||
| 1038 | 1038 | tx_type: None, |
| 1039 | 1039 | eob_pt_class1: None, |
| 1040 | 1040 | }, |
| 1041 | + // lane-comppin r4 (REVERTED, see r4's own commit message): | |
| 1042 | + // `Some(inter_tx_type_32)` looked wrong against aomdec's 32x32 | |
| 1043 | + // trace (degenerate 1-symbol EC_TXTYPE_VAL=0 read) and matches | |
| 1044 | + // spec `av1_get_ext_tx_set_type`'s `EXT_TX_SET_DCTONLY` for | |
| 1045 | + // every tx_size_sqr >= TX_32X32 -- but flipping this to `None` | |
| 1046 | + // regressed 16 previously-green `ec-av1` tests (full-suite count | |
| 1047 | + // went 217/217 -> 201/216), and did NOT fix the pin's own | |
| 1048 | + // eob_pt desync either (still reads 6 instead of aomdec's 5 | |
| 1049 | + // right after this read, proving eob_pt's own context/table | |
| 1050 | + // selection is a SEPARATE, still-unfound bug upstream of this | |
| 1051 | + // one) -- kept `Some` pending a real fix that ports both without | |
| 1052 | + // breaking the 16. | |
| 1041 | 1053 | TxbSet::Luma32Inter => TxbTables { |
| 1042 | 1054 | side: 32, |
| 1043 | 1055 | txb_skip: &mut self.txb_skip_luma_32, |
crates/ec-av1/src/decode.rsmodified+37 -0
| @@ -62,6 +62,11 @@ pub(crate) fn filter_intra_hits() -> usize { | ||
| 62 | 62 | /// before/after counter pattern as [`FILTER_INTRA_HITS`], proving a stream |
| 63 | 63 | /// exercised `apply_deblock` rather than every edge landing on level 0. |
| 64 | 64 | static DEBLOCK_HITS: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0); |
| 65 | +/// lane-comppin r4: decode-order picture counter for `EC_AV1_PREFILT_DUMP`, | |
| 66 | +/// mirroring stream.rs's `pictures_decoded` so the two dumps index | |
| 67 | +/// identically against aomdec's own `ec_frame_idx` in decodeframe.c. | |
| 68 | +static PREFILT_PICTURE_IDX: std::sync::atomic::AtomicUsize = | |
| 69 | + std::sync::atomic::AtomicUsize::new(0); | |
| 65 | 70 | |
| 66 | 71 | /// Current value of [`DEBLOCK_HITS`]. |
| 67 | 72 | pub(crate) fn deblock_hits() -> usize { |
| @@ -3613,6 +3618,22 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | ||
| 3613 | 3618 | } |
| 3614 | 3619 | } |
| 3615 | 3620 | |
| 3621 | + // lane-comppin r4: pre-loop-filter decode-order dump, matching aomdec's | |
| 3622 | + // own EC_AV1_PREFILT_DUMP shape (decodeframe.c ~5451) -- diffs against | |
| 3623 | + // that isolate whether a decode-order frame's mismatch already exists | |
| 3624 | + // in reconstruction (this dump) vs is introduced by the loop filter | |
| 3625 | + // (EC_AV1_DECODE_ORDER_DUMP's post-filter dump). | |
| 3626 | + if let Ok(path) = std::env::var("EC_AV1_PREFILT_DUMP") { | |
| 3627 | + use std::io::Write; | |
| 3628 | + let idx = PREFILT_PICTURE_IDX.fetch_add(1, std::sync::atomic::Ordering::SeqCst); | |
| 3629 | + if let Ok(mut f) = std::fs::File::create(format!("{path}.f{idx}")) { | |
| 3630 | + let _ = f.write_all(&y.data); | |
| 3631 | + let _ = f.write_all(&u.data); | |
| 3632 | + let _ = f.write_all(&v.data); | |
| 3633 | + } | |
| 3634 | + } else { | |
| 3635 | + PREFILT_PICTURE_IDX.fetch_add(1, std::sync::atomic::Ordering::SeqCst); | |
| 3636 | + } | |
| 3616 | 3637 | apply_deblock(&mut y, &mut u, &mut v, loop_filter, &neighbours); |
| 3617 | 3638 | apply_cdef(&mut y, &mut u, &mut v, cdef, &neighbours); |
| 3618 | 3639 | |
| @@ -7190,6 +7211,22 @@ pub(crate) fn decode_inter_frame_tile_with_cdfs( | ||
| 7190 | 7211 | } |
| 7191 | 7212 | } |
| 7192 | 7213 | |
| 7214 | + // lane-comppin r4: pre-loop-filter decode-order dump, matching aomdec's | |
| 7215 | + // own EC_AV1_PREFILT_DUMP shape (decodeframe.c ~5451) -- diffs against | |
| 7216 | + // that isolate whether a decode-order frame's mismatch already exists | |
| 7217 | + // in reconstruction (this dump) vs is introduced by the loop filter | |
| 7218 | + // (EC_AV1_DECODE_ORDER_DUMP's post-filter dump). | |
| 7219 | + if let Ok(path) = std::env::var("EC_AV1_PREFILT_DUMP") { | |
| 7220 | + use std::io::Write; | |
| 7221 | + let idx = PREFILT_PICTURE_IDX.fetch_add(1, std::sync::atomic::Ordering::SeqCst); | |
| 7222 | + if let Ok(mut f) = std::fs::File::create(format!("{path}.f{idx}")) { | |
| 7223 | + let _ = f.write_all(&y.data); | |
| 7224 | + let _ = f.write_all(&u.data); | |
| 7225 | + let _ = f.write_all(&v.data); | |
| 7226 | + } | |
| 7227 | + } else { | |
| 7228 | + PREFILT_PICTURE_IDX.fetch_add(1, std::sync::atomic::Ordering::SeqCst); | |
| 7229 | + } | |
| 7193 | 7230 | apply_deblock(&mut y, &mut u, &mut v, loop_filter, &neighbours); |
| 7194 | 7231 | apply_cdef(&mut y, &mut u, &mut v, cdef, &neighbours); |
| 7195 | 7232 |