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