From 05b720f6b3bd170f111d3aca0f16f19a1e2404ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 2 Dec 2026 15:13:57 +0300 Subject: [PATCH] S9: drop the CU sink callback; every caller passed a no-op closure, so the sink param and its call go --- crates/ec-h265/src/dec/cu_syntax.rs | 14 +++++--------- crates/ec-h265/src/dec/cu_syntax/wpp.rs | 2 +- crates/ec-h265/src/dec/picjob.rs | 1 - 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/crates/ec-h265/src/dec/cu_syntax.rs b/crates/ec-h265/src/dec/cu_syntax.rs index c5783aa4..4869c4b1 100644 --- a/crates/ec-h265/src/dec/cu_syntax.rs +++ b/crates/ec-h265/src/dec/cu_syntax.rs @@ -184,7 +184,6 @@ pub fn parse_slice_into( motion: &mut SliceMotion<'_>, pic: &mut PicState, refs: Option<&InterRefs>, - sink: &mut dyn FnMut(&CodingUnit), rows: &mut dyn FnMut(&mut PicState, usize), ) -> Result { let min_cb_log2 = sps.log2_min_cb_size_minus3 + 3; @@ -310,7 +309,7 @@ pub fn parse_slice_into( if header.sao_luma || header.sao_chroma { p.sao(&mut dec, rs, rx, ry)?; } - p.coding_quadtree(&mut dec, x0, y0, ctb_log2, 0, sink)?; + p.coding_quadtree(&mut dec, x0, y0, ctb_log2, 0)?; // The row is complete with its last CTB. Single-tile pictures are in raster order. if raster && rx + 1 == cols { p.motion.row_done(p.pic, y0 + ctb_size); @@ -574,8 +573,7 @@ impl Parser<'_, '_> { y0: usize, log2: u32, depth: u32, - sink: &mut dyn FnMut(&CodingUnit), - ) -> Result<()> { + ) -> Result<()> { let n = 1usize << log2; let fits = x0 + n <= self.pic.width && y0 + n <= self.pic.height; let split = if fits && log2 > self.min_cb_log2 { @@ -604,12 +602,12 @@ impl Parser<'_, '_> { let half = n / 2; for (dx, dy) in [(0, 0), (half, 0), (0, half), (half, half)] { if x0 + dx < self.pic.width && y0 + dy < self.pic.height { - self.coding_quadtree(dec, x0 + dx, y0 + dy, log2 - 1, depth + 1, sink)?; + self.coding_quadtree(dec, x0 + dx, y0 + dy, log2 - 1, depth + 1)?; } } Ok(()) } else { - self.coding_unit(dec, x0, y0, log2, depth, sink) + self.coding_unit(dec, x0, y0, log2, depth) } } @@ -631,8 +629,7 @@ impl Parser<'_, '_> { y0: usize, log2: u32, depth: u32, - sink: &mut dyn FnMut(&CodingUnit), - ) -> Result<()> { + ) -> Result<()> { let n = 1usize << log2; self.stats.cus += 1; let is_i = self.header.slice_type == SliceType::I; @@ -771,7 +768,6 @@ impl Parser<'_, '_> { self.pic.update_info(x0, y0, n, n, |b| b.qp = qp); self.stats.pus += cu.pus.len(); self.stats.residual_blocks += cu.residuals.len(); - sink(&cu); Ok(()) } diff --git a/crates/ec-h265/src/dec/cu_syntax/wpp.rs b/crates/ec-h265/src/dec/cu_syntax/wpp.rs index d1c372c6..a9ae0dd3 100644 --- a/crates/ec-h265/src/dec/cu_syntax/wpp.rs +++ b/crates/ec-h265/src/dec/cu_syntax/wpp.rs @@ -359,7 +359,7 @@ fn parse_row( if sao { p.sao(&mut dec, rs, x, ry)?; } - p.coding_quadtree(&mut dec, x0, y0, ctb_log2, 0, &mut |_| {})?; + p.coding_quadtree(&mut dec, x0, y0, ctb_log2, 0)?; // 9.3.2.2: the wavefront storage after the second CTB of a row. let stored = (x == 1 && cols > 1).then(|| dec.contexts.clone()); sync.leave(&*p.pic, &mut *p.motion, x, stored.as_ref())?; diff --git a/crates/ec-h265/src/dec/picjob.rs b/crates/ec-h265/src/dec/picjob.rs index 461c4554..dc8dda57 100644 --- a/crates/ec-h265/src/dec/picjob.rs +++ b/crates/ec-h265/src/dec/picjob.rs @@ -171,7 +171,6 @@ impl PicJob { &mut source, pic, refs.as_ref(), - &mut |_| {}, &mut rows, )?; }