debug(av1): env-gated dump of frame-2 saved CDF tables, decisive negative result
Browse files at this commita45ccae00a952718b1c128479c332c61e817a794Parent: 82a96d21 changed file +18 -0
- crates/ec-av1/src/stream.rs +18 -0
crates/ec-av1/src/stream.rsmodified+18 -0
| @@ -236,6 +236,24 @@ pub fn decode_stream(data: &[u8]) -> Result<Vec<Picture>> { | ||
| 236 | 236 | end_cdfs.reset_counts(); |
| 237 | 237 | end_cdfs |
| 238 | 238 | }; |
| 239 | + if let Ok(path) = std::env::var("EC_AV1_DUMP_TABLES") { | |
| 240 | + use std::io::Write; | |
| 241 | + if let Ok(mut f) = std::fs::OpenOptions::new() | |
| 242 | + .create(true) | |
| 243 | + .append(true) | |
| 244 | + .open(&path) | |
| 245 | + { | |
| 246 | + let _ = writeln!(f, "=== frame idx={} ===", pictures.len()); | |
| 247 | + let _ = writeln!(f, "partition_w64 {:?}", stored_cdfs.partition_w64); | |
| 248 | + let _ = writeln!(f, "partition_w32 {:?}", stored_cdfs.partition_w32); | |
| 249 | + let _ = writeln!(f, "partition_w16 {:?}", stored_cdfs.partition_w16); | |
| 250 | + let _ = writeln!(f, "skip {:?}", stored_cdfs.skip); | |
| 251 | + let _ = writeln!(f, "new_mv {:?}", stored_cdfs.new_mv); | |
| 252 | + let _ = writeln!(f, "zero_mv {:?}", stored_cdfs.zero_mv); | |
| 253 | + let _ = writeln!(f, "ref_mv {:?}", stored_cdfs.ref_mv); | |
| 254 | + let _ = writeln!(f, "mv_joint {:?}", stored_cdfs.mv_joint); | |
| 255 | + } | |
| 256 | + } | |
| 239 | 257 | for i in 0..NUM_REF_FRAMES { |
| 240 | 258 | if header.refresh_frame_flags & (1 << i) != 0 { |
| 241 | 259 | cdf_slots[i] = Some(stored_cdfs.clone()); |