forge
Explore
Log in

Don't you dare go Hollow

wip(av1): lane-superres r5 at the 75-turn cap (orchestrator commit, unverified)

Browse files at this commit

6069597928006c15d581f3b4f82ea71fb2b0e7cfAhmet Kaan GümüşParent: e0104c4
crates/ec-av1/src/decode.rsmodified+27 -1
@@ -4979,6 +4979,23 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
49794979 } else {
49804980 PREFILT_PICTURE_IDX.fetch_add(1, std::sync::atomic::Ordering::SeqCst);
49814981 }
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+ }
49824999 apply_deblock(&mut y, &mut u, &mut v, loop_filter, &neighbours);
49835000 apply_cdef(&mut y, &mut u, &mut v, cdef, &neighbours);
49845001
@@ -5019,10 +5036,19 @@ pub(crate) fn decode_key_frame_tile_with_cdfs(
50195036 // non-superres frame whose width just isn't 32-block aligned).
50205037 LAST_KEY_FRAME_WIDE_MARGIN.with(|m| {
50215038 *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+ }
50225048 Some(Picture {
50235049 width: true_width,
50245050 height: true_height,
5025- y: crop(&y, true_width, true_height),
5051+ y: yc,
50265052 u: crop(&u, true_width.div_ceil(2), true_height.div_ceil(2)),
50275053 v: crop(&v, true_width.div_ceil(2), true_height.div_ceil(2)),
50285054 })