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(
184 motion: &mut SliceMotion<'_>,184 motion: &mut SliceMotion<'_>,
185 pic: &mut PicState,185 pic: &mut PicState,
186 refs: Option<&InterRefs>,186 refs: Option<&InterRefs>,
187- sink: &mut dyn FnMut(&CodingUnit),
188 rows: &mut dyn FnMut(&mut PicState, usize),187 rows: &mut dyn FnMut(&mut PicState, usize),
189 ) -> Result<SliceStats> {188 ) -> Result<SliceStats> {
190 let min_cb_log2 = sps.log2_min_cb_size_minus3 + 3;189 let min_cb_log2 = sps.log2_min_cb_size_minus3 + 3;
@@ -310,7 +309,7 @@ pub fn parse_slice_into(
310 if header.sao_luma || header.sao_chroma {309 if header.sao_luma || header.sao_chroma {
311 p.sao(&mut dec, rs, rx, ry)?;310 p.sao(&mut dec, rs, rx, ry)?;
312 }311 }
313- p.coding_quadtree(&mut dec, x0, y0, ctb_log2, 0, sink)?;312+ p.coding_quadtree(&mut dec, x0, y0, ctb_log2, 0)?;
314 // The row is complete with its last CTB. Single-tile pictures are in raster order.313 // The row is complete with its last CTB. Single-tile pictures are in raster order.
315 if raster && rx + 1 == cols {314 if raster && rx + 1 == cols {
316 p.motion.row_done(p.pic, y0 + ctb_size);315 p.motion.row_done(p.pic, y0 + ctb_size);
@@ -574,8 +573,7 @@ impl Parser<'_, '_> {
574 y0: usize,573 y0: usize,
575 log2: u32,574 log2: u32,
576 depth: u32,575 depth: u32,
577- sink: &mut dyn FnMut(&CodingUnit),576+ ) -> Result<()> {
578- ) -> Result<()> {
579 let n = 1usize << log2;577 let n = 1usize << log2;
580 let fits = x0 + n <= self.pic.width && y0 + n <= self.pic.height;578 let fits = x0 + n <= self.pic.width && y0 + n <= self.pic.height;
581 let split = if fits && log2 > self.min_cb_log2 {579 let split = if fits && log2 > self.min_cb_log2 {
@@ -604,12 +602,12 @@ impl Parser<'_, '_> {
604 let half = n / 2;602 let half = n / 2;
605 for (dx, dy) in [(0, 0), (half, 0), (0, half), (half, half)] {603 for (dx, dy) in [(0, 0), (half, 0), (0, half), (half, half)] {
606 if x0 + dx < self.pic.width && y0 + dy < self.pic.height {604 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)?;
608 }606 }
609 }607 }
610 Ok(())608 Ok(())
611 } else {609 } else {
612- self.coding_unit(dec, x0, y0, log2, depth, sink)610+ self.coding_unit(dec, x0, y0, log2, depth)
613 }611 }
614 }612 }
615 613
@@ -631,8 +629,7 @@ impl Parser<'_, '_> {
631 y0: usize,629 y0: usize,
632 log2: u32,630 log2: u32,
633 depth: u32,631 depth: u32,
634- sink: &mut dyn FnMut(&CodingUnit),632+ ) -> Result<()> {
635- ) -> Result<()> {
636 let n = 1usize << log2;633 let n = 1usize << log2;
637 self.stats.cus += 1;634 self.stats.cus += 1;
638 let is_i = self.header.slice_type == SliceType::I;635 let is_i = self.header.slice_type == SliceType::I;
@@ -771,7 +768,6 @@ impl Parser<'_, '_> {
771 self.pic.update_info(x0, y0, n, n, |b| b.qp = qp);768 self.pic.update_info(x0, y0, n, n, |b| b.qp = qp);
772 self.stats.pus += cu.pus.len();769 self.stats.pus += cu.pus.len();
773 self.stats.residual_blocks += cu.residuals.len();770 self.stats.residual_blocks += cu.residuals.len();
774- sink(&cu);
775 Ok(())771 Ok(())
776 }772 }
777 773
crates/ec-h265/src/dec/cu_syntax/wpp.rsmodified+1 -1
@@ -359,7 +359,7 @@ fn parse_row(
359 if sao {359 if sao {
360 p.sao(&mut dec, rs, x, ry)?;360 p.sao(&mut dec, rs, x, ry)?;
361 }361 }
362- p.coding_quadtree(&mut dec, x0, y0, ctb_log2, 0, &mut |_| {})?;362+ p.coding_quadtree(&mut dec, x0, y0, ctb_log2, 0)?;
363 // 9.3.2.2: the wavefront storage after the second CTB of a row.363 // 9.3.2.2: the wavefront storage after the second CTB of a row.
364 let stored = (x == 1 && cols > 1).then(|| dec.contexts.clone());364 let stored = (x == 1 && cols > 1).then(|| dec.contexts.clone());
365 sync.leave(&*p.pic, &mut *p.motion, x, stored.as_ref())?;365 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 {
171 &mut source,171 &mut source,
172 pic,172 pic,
173 refs.as_ref(),173 refs.as_ref(),
174- &mut |_| {},
175 &mut rows,174 &mut rows,
176 )?;175 )?;
177 }176 }