wip(av1): lane-superres r5 at the 75-turn cap (orchestrator commit, unverified)
Browse files at this commit6069597928006c15d581f3b4f82ea71fb2b0e7cfParent: e0104c41 changed file +27 -1
- crates/ec-av1/src/decode.rs +27 -1
crates/ec-av1/src/decode.rsmodified+27 -1
| @@ -4979,6 +4979,23 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | ||
| 4979 | 4979 | } else { |
| 4980 | 4980 | PREFILT_PICTURE_IDX.fetch_add(1, std::sync::atomic::Ordering::SeqCst); |
| 4981 | 4981 | } |
| 4982 | + if let Ok(path) = std::env::var("EC_AV1_PREFILT_WIDE_DUMP") { | |
| 4983 | + use std::io::Write; | |
| 4984 | + static IDX2: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0); | |
| 4985 | + let idx = IDX2.fetch_add(1, std::sync::atomic::Ordering::SeqCst); | |
| 4986 | + let crop_wide = |plane: &PlaneBuf| -> Vec<u8> { | |
| 4987 | + let mut out = Vec::with_capacity(plane.true_width * plane.true_height); | |
| 4988 | + for row in 0..plane.true_height { | |
| 4989 | + out.extend_from_slice(&plane.data[row * plane.width..][..plane.true_width]); | |
| 4990 | + } | |
| 4991 | + out | |
| 4992 | + }; | |
| 4993 | + if let Ok(mut f) = std::fs::File::create(format!("{path}.f{idx}")) { | |
| 4994 | + let _ = f.write_all(&crop_wide(&y)); | |
| 4995 | + let _ = f.write_all(&crop_wide(&u)); | |
| 4996 | + let _ = f.write_all(&crop_wide(&v)); | |
| 4997 | + } | |
| 4998 | + } | |
| 4982 | 4999 | apply_deblock(&mut y, &mut u, &mut v, loop_filter, &neighbours); |
| 4983 | 5000 | apply_cdef(&mut y, &mut u, &mut v, cdef, &neighbours); |
| 4984 | 5001 | |
| @@ -5019,10 +5036,19 @@ pub(crate) fn decode_key_frame_tile_with_cdfs( | ||
| 5019 | 5036 | // non-superres frame whose width just isn't 32-block aligned). |
| 5020 | 5037 | LAST_KEY_FRAME_WIDE_MARGIN.with(|m| { |
| 5021 | 5038 | *m.borrow_mut() = if true_width > fw || true_height > fh { |
| 5039 | + let yc = crop(&y, true_width, true_height); | |
| 5040 | + if let Ok(path) = std::env::var("EC_AV1_MARGIN_DUMP") { | |
| 5041 | + use std::io::Write; | |
| 5042 | + static IDX: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0); | |
| 5043 | + let idx = IDX.fetch_add(1, std::sync::atomic::Ordering::SeqCst); | |
| 5044 | + if let Ok(mut f) = std::fs::File::create(format!("{path}.f{idx}")) { | |
| 5045 | + let _ = f.write_all(&yc); | |
| 5046 | + } | |
| 5047 | + } | |
| 5022 | 5048 | Some(Picture { |
| 5023 | 5049 | width: true_width, |
| 5024 | 5050 | height: true_height, |
| 5025 | - y: crop(&y, true_width, true_height), | |
| 5051 | + y: yc, | |
| 5026 | 5052 | u: crop(&u, true_width.div_ceil(2), true_height.div_ceil(2)), |
| 5027 | 5053 | v: crop(&v, true_width.div_ceil(2), true_height.div_ceil(2)), |
| 5028 | 5054 | }) |