forge
Explore
Log in

Don't you dare go Hollow

S9: drop the CU sink callback; every caller passed a no-op closure, so the sink param and its call go

Browse files at this commit

05b720f6b3bd170f111d3aca0f16f19a1e2404adAhmet Kaan GümüşParent: 265d15d
crates/ec-h265/src/dec/cu_syntax.rsmodified+5 -9
@@ -184,7 +184,6 @@ pub fn parse_slice_into(
184184 motion: &mut SliceMotion<'_>,
185185 pic: &mut PicState,
186186 refs: Option<&InterRefs>,
187- sink: &mut dyn FnMut(&CodingUnit),
188187 rows: &mut dyn FnMut(&mut PicState, usize),
189188 ) -> Result<SliceStats> {
190189 let min_cb_log2 = sps.log2_min_cb_size_minus3 + 3;
@@ -310,7 +309,7 @@ pub fn parse_slice_into(
310309 if header.sao_luma || header.sao_chroma {
311310 p.sao(&mut dec, rs, rx, ry)?;
312311 }
313- p.coding_quadtree(&mut dec, x0, y0, ctb_log2, 0, sink)?;
312+ p.coding_quadtree(&mut dec, x0, y0, ctb_log2, 0)?;
314313 // The row is complete with its last CTB. Single-tile pictures are in raster order.
315314 if raster && rx + 1 == cols {
316315 p.motion.row_done(p.pic, y0 + ctb_size);
@@ -574,8 +573,7 @@ impl Parser<'_, '_> {
574573 y0: usize,
575574 log2: u32,
576575 depth: u32,
577- sink: &mut dyn FnMut(&CodingUnit),
578- ) -> Result<()> {
576+ ) -> Result<()> {
579577 let n = 1usize << log2;
580578 let fits = x0 + n <= self.pic.width && y0 + n <= self.pic.height;
581579 let split = if fits && log2 > self.min_cb_log2 {
@@ -604,12 +602,12 @@ impl Parser<'_, '_> {
604602 let half = n / 2;
605603 for (dx, dy) in [(0, 0), (half, 0), (0, half), (half, half)] {
606604 if x0 + dx < self.pic.width && y0 + dy < self.pic.height {
607- self.coding_quadtree(dec, x0 + dx, y0 + dy, log2 - 1, depth + 1, sink)?;
605+ self.coding_quadtree(dec, x0 + dx, y0 + dy, log2 - 1, depth + 1)?;
608606 }
609607 }
610608 Ok(())
611609 } else {
612- self.coding_unit(dec, x0, y0, log2, depth, sink)
610+ self.coding_unit(dec, x0, y0, log2, depth)
613611 }
614612 }
615613
@@ -631,8 +629,7 @@ impl Parser<'_, '_> {
631629 y0: usize,
632630 log2: u32,
633631 depth: u32,
634- sink: &mut dyn FnMut(&CodingUnit),
635- ) -> Result<()> {
632+ ) -> Result<()> {
636633 let n = 1usize << log2;
637634 self.stats.cus += 1;
638635 let is_i = self.header.slice_type == SliceType::I;
@@ -771,7 +768,6 @@ impl Parser<'_, '_> {
771768 self.pic.update_info(x0, y0, n, n, |b| b.qp = qp);
772769 self.stats.pus += cu.pus.len();
773770 self.stats.residual_blocks += cu.residuals.len();
774- sink(&cu);
775771 Ok(())
776772 }
777773
crates/ec-h265/src/dec/cu_syntax/wpp.rsmodified+1 -1
@@ -359,7 +359,7 @@ fn parse_row(
359359 if sao {
360360 p.sao(&mut dec, rs, x, ry)?;
361361 }
362- p.coding_quadtree(&mut dec, x0, y0, ctb_log2, 0, &mut |_| {})?;
362+ p.coding_quadtree(&mut dec, x0, y0, ctb_log2, 0)?;
363363 // 9.3.2.2: the wavefront storage after the second CTB of a row.
364364 let stored = (x == 1 && cols > 1).then(|| dec.contexts.clone());
365365 sync.leave(&*p.pic, &mut *p.motion, x, stored.as_ref())?;
crates/ec-h265/src/dec/picjob.rsmodified+0 -1
@@ -171,7 +171,6 @@ impl PicJob {
171171 &mut source,
172172 pic,
173173 refs.as_ref(),
174- &mut |_| {},
175174 &mut rows,
176175 )?;
177176 }